Documentation
¶
Index ¶
- Constants
- Variables
- func Init(projectRoot, name, version string) error
- func ValidContentHash(value string) bool
- type Config
- type ContentHashError
- type MCPServer
- type Meta
- type PackLock
- func (lock PackLock) MCPServer(name string) (MCPServer, bool)
- func (lock PackLock) PluginCount() int
- func (lock PackLock) Plugins() []Package
- func (lock PackLock) Save(projectRoot string) error
- func (lock PackLock) SkillCount() int
- func (lock PackLock) Skills() []Package
- func (lock PackLock) UnverifiedPackages() []string
- type Package
- type PackageKind
Constants ¶
const ( MCPPinned = "pinned" MCPUnpinnable = "unpinnable" MCPUnpinned = "unpinned" )
const ContentHashPrefix = "sha256-tree-v1:"
ContentHashPrefix names the tree digest algorithm stored in content_hash.
const (
Version uint32 = 3
)
Version is the newest lockfile schema. Version 3 adds package content_hash values and [[mcp_servers]] to version 2; a lock that uses neither is still written as version 2 so binaries that predate version 3 keep reading it.
Variables ¶
var ErrContentHash = errors.New("invalid content hash in lockfile")
ErrContentHash marks a lock whose content_hash key is present but is not a digest this build can check. Such a lock is never regenerated automatically.
Functions ¶
func ValidContentHash ¶
ValidContentHash reports whether value is a complete sha256-tree-v1 digest.
Types ¶
type ContentHashError ¶
type ContentHashError struct{ Module, Value, Path string }
ContentHashError is the ErrContentHash for one package.
func (*ContentHashError) Details ¶
func (err *ContentHashError) Details() string
func (*ContentHashError) Error ¶
func (err *ContentHashError) Error() string
func (*ContentHashError) Summary ¶
func (err *ContentHashError) Summary() string
func (*ContentHashError) Unwrap ¶
func (err *ContentHashError) Unwrap() error
type MCPServer ¶
type MCPServer struct {
Name string `toml:"name"`
Source string `toml:"source"`
Launcher string `toml:"launcher"`
Status string `toml:"status"`
Definition string `toml:"definition"`
Requested string `toml:"requested,omitempty"`
Package string `toml:"package,omitempty"`
Version string `toml:"version,omitempty"`
Integrity string `toml:"integrity,omitempty"`
Registry string `toml:"registry,omitempty"`
Host string `toml:"host,omitempty"`
Command string `toml:"command,omitempty"`
AllowUnpinned bool `toml:"allow_unpinned,omitempty"`
Reason string `toml:"reason,omitempty"`
}
MCPServer records what one merged MCP server definition runs. Environment values and arguments are never stored; Definition is a digest of them.
type PackLock ¶
type PackLock struct {
LockfileVersion uint32 `toml:"lockfile_version"`
Meta Meta `toml:"meta"`
Config Config `toml:"config,omitempty"`
Packages []Package `toml:"packages,omitempty"`
MCPServers []MCPServer `toml:"mcp_servers,omitempty"`
}
func EmptyForProject ¶
func LoadFromPath ¶
func (PackLock) PluginCount ¶
func (PackLock) SkillCount ¶
func (PackLock) UnverifiedPackages ¶
UnverifiedPackages lists modules whose lock entry has no content hash.
type Package ¶
type Package struct {
Module string `toml:"module"`
Direct bool `toml:"direct,omitempty"`
Kind PackageKind `toml:"kind"`
URL string `toml:"url"`
Owner string `toml:"owner"`
Repo string `toml:"repo"`
Path string `toml:"path,omitempty"`
Commit string `toml:"commit"`
CacheKey string `toml:"cache_key"`
// ContentHash is the tree digest of the cached package. Empty means the
// lock predates content hashes and the package is not verified.
ContentHash string `toml:"content_hash,omitempty"`
Name string `toml:"name,omitempty"`
}
func (Package) NeedsBackfill ¶
type PackageKind ¶
type PackageKind string
const ( PackageSkill PackageKind = "skill" PackagePlugin PackageKind = "plugin" )
func (*PackageKind) UnmarshalText ¶
func (kind *PackageKind) UnmarshalText(text []byte) error