Documentation
¶
Overview ¶
Package distribution owns fixed-schema manifest loading and verified artifact installation for wrapper distributions.
Index ¶
- Constants
- Variables
- func CaptureSource(ctx context.Context) context.Context
- func CurrentPlatformKey() string
- func Install(ctx context.Context, manifest *Manifest, opts InstallOptions) errs.TypedError
- func PlatformKey(goos, goarch string) string
- func SyncSkills(ctx context.Context, manifest *Manifest, opts InstallOptions) errs.TypedError
- type Artifact
- type InstallOptions
- type Manifest
- type Source
- type SourceSnapshot
Constants ¶
const (
SkillsKey = "skills"
)
Variables ¶
var DefaultClient *http.Client
DefaultClient overrides the manifest/artifact client in tests. Production uses a standalone net/http client so distribution URLs bypass extensions.
Functions ¶
func CaptureSource ¶
CaptureSource resolves the provider once and stores the result in ctx.
func CurrentPlatformKey ¶
func CurrentPlatformKey() string
CurrentPlatformKey returns the artifact key for this binary.
func Install ¶
func Install(ctx context.Context, manifest *Manifest, opts InstallOptions) errs.TypedError
Install downloads, verifies, and commits the configured Skills and binary resources as one rollback-capable local transaction. The executable is committed last.
func PlatformKey ¶
PlatformKey returns the manifest artifact key for a platform.
func SyncSkills ¶
func SyncSkills(ctx context.Context, manifest *Manifest, opts InstallOptions) errs.TypedError
SyncSkills repairs the managed Skills from a manifest without replacing an already-matching binary.
Types ¶
type InstallOptions ¶
type InstallOptions struct {
ExecutablePath string
// SkillsDir overrides automatic Agent directory discovery when non-empty.
SkillsDir string
VerifyBinary func(path, version string) error
}
InstallOptions supplies destinations and test seams for a distribution update.
type Manifest ¶
type Manifest struct {
Schema int `json:"schema"`
Version string `json:"version"`
Artifacts map[string]Artifact `json:"artifacts"`
// contains filtered or unexported fields
}
Manifest is schema 1 of the distribution protocol. Unknown JSON fields are ignored so producers can attach metadata without breaking older CLIs; the required fields and artifacts are still validated before use.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source describes the active update source. The zero value is the npm registry flow; a non-zero Source selects manifest-based distribution.
func ResolveSource ¶
func ResolveSource(ctx context.Context) (Source, errs.TypedError)
ResolveSource reads the optional distribution manifest URL from the registered transport provider. Providers that do not implement exttransport.DistributionProvider, or return an empty URL, yield the zero (npm) Source.
func (Source) FetchManifest ¶
FetchManifest synchronously loads and validates the source's manifest. Fetch failures are network errors; a fetched body that fails validation is an invalid response.
func (Source) Identity ¶
Identity is a stable fingerprint of the source used to attribute persisted state without storing the URL. The npm source has the empty identity, which also matches state files written before source tracking existed.
func (Source) ManifestMode ¶
ManifestMode reports whether this source is a manifest distribution.
type SourceSnapshot ¶
type SourceSnapshot struct {
// contains filtered or unexported fields
}
SourceSnapshot freezes source resolution for one command invocation.