Documentation
¶
Overview ¶
Package installer runs the staging-verify-activate install transaction with temp-then-rename atomicity under an exclusive lock.
Index ¶
Constants ¶
const ( PrefAuto = "auto" PrefSymlink = "symlink" PrefCopy = "copy" )
Mode-preference strings accepted on the command line and in the manifest. PrefAuto is the default: it prefers a symlink and falls back to a copy where symlinks are unsupported. Only ModeSymlink or ModeCopy is ever recorded as the resolved mode — never "auto".
const DefaultModePref = PrefAuto
DefaultModePref is the install-mode preference applied when neither the command line nor the manifest specifies one (FR-022, FR-023).
Variables ¶
This section is empty.
Functions ¶
func CleanupStaging ¶
CleanupStaging removes orphaned staging temp directories left under the given roots by an interrupted install, so a crash never leaves torn state behind (FR-024, SC-007). It returns the number of entries removed.
Types ¶
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer runs the staging-verify-activate transaction over the store, cache, and git runner.
func (*Installer) Discover ¶
Discover materializes the source and discovers the skill without activating it, for pre-flight checks such as learning the skill name or detecting a manifest conflict. Materialized git content is cached, so a following Install reuses it.
func (*Installer) DiscoverAll ¶ added in v0.1.0
func (i *Installer) DiscoverAll(ctx context.Context, req Request, opts discovery.Options) (discovery.Result, error)
DiscoverAll materializes req's source (cache/clone, honoring Offline) then recursively scans it for skills. It is read-only: no staging, activation, or manifest/lock writes. Used by source inspection, search, and the add pre-flight (contracts/discovery.md).
type Mode ¶
type Mode string
Mode is the actual activation method recorded for an installed skill. The requested preference may be "auto", but only symlink or copy is ever recorded (FR-020).
type Request ¶
type Request struct {
Ref source.Ref
Revision resolver.Revision
Name string // declared manifest key; must match frontmatter name
Path string // explicit in-repo subpath (optional)
Agents []agent.Agent
Scope Scope
ModePref string // symlink | copy | auto
ProjectRoot string
Home string
// Offline forbids network fetches; material must already be cached (FR-026).
Offline bool
// ExpectContentHash, when set, must equal the materialized content hash or
// the install fails closed (used by frozen restore, FR-015/FR-037).
ExpectContentHash string
}
Request is everything needed to install one skill.
type Result ¶
type Result struct {
Skill discovery.Skill
ContentHash string
SkillFileHash string
Mode Mode // representative mode (the first agent's)
Modes map[string]string // agentID -> actual mode used
Agents []string
ActivePath string // project-relative active entry (empty for global scope)
Targets map[string]string // agentID -> recorded dir (relative for project scope)
Warnings []string
}
Result is the outcome of a successful install, sufficient to build a lock entry.