Documentation
¶
Overview ¶
Package source reconciles declarative skill sources with owned installations.
Index ¶
- Variables
- func Edit(config *schema.AtmosConfiguration, o EditOptions) (string, error)
- func ParseAdHoc(raw string) (*schema.AISkillConfig, error)
- type EditOptions
- type Engine
- func (e *Engine) AdHocConfig(label string) (*schema.AtmosConfiguration, error)
- func (e *Engine) InstalledConfig(scope string) (*schema.AtmosConfiguration, error)
- func (e *Engine) InstalledSources(name, scope string) ([]string, error)
- func (e *Engine) Recover() error
- func (e *Engine) ResolveInstalled(name, scope string) (string, error)
- func (e *Engine) Run(ctx context.Context, opts Options) ([]Status, error)
- func (e *Engine) Status(ctx context.Context, opts Options) ([]Status, error)
- type Fetcher
- type GitFetcher
- type Lock
- type LockedSkill
- type Options
- type Record
- type Repository
- type Resolution
- type State
- type Status
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalid = errUtils.ErrAISkillSourceInvalid ErrDrift = errUtils.ErrAISkillSourceDrift ErrOwnership = errUtils.ErrAISkillSourceOwnership ErrRecovery = errUtils.ErrAISkillSourceRecovery )
Functions ¶
func Edit ¶
func Edit(config *schema.AtmosConfiguration, o EditOptions) (string, error)
Edit changes one declaration while preserving the surrounding YAML document.
func ParseAdHoc ¶
func ParseAdHoc(raw string) (*schema.AISkillConfig, error)
ParseAdHoc preserves shorthand and local sources while accepting generic Git URLs.
Types ¶
type EditOptions ¶
EditOptions specifies a configuration-only operation.
type Engine ¶
type Engine struct {
AdHoc bool
Config *schema.AtmosConfiguration
Project, Home string
Fetcher Fetcher
// Rename permits deterministic injection of apply and rollback failures.
Rename func(string, string) error
// contains filtered or unexported fields
}
Engine owns dependencies and project identity, never global process configuration.
func New ¶
func New(config *schema.AtmosConfiguration) (*Engine, error)
New constructs an engine without creating files or contacting sources.
func (*Engine) AdHocConfig ¶
func (e *Engine) AdHocConfig(label string) (*schema.AtmosConfiguration, error)
AdHocConfig restores locally recorded declarations for installed ad-hoc skills.
func (*Engine) InstalledConfig ¶
func (e *Engine) InstalledConfig(scope string) (*schema.AtmosConfiguration, error)
InstalledConfig selects declarations that have existing installations.
func (*Engine) InstalledSources ¶
InstalledSources resolves installed names to source owners without writing.
func (*Engine) ResolveInstalled ¶
type Fetcher ¶
type Fetcher interface {
Fetch(context.Context, Repository, string) (Repository, error)
}
Fetcher stages a repository and returns its exact provenance.
type GitFetcher ¶
type GitFetcher struct {
Config *schema.AtmosConfiguration
Downloader downloader.ContextFileDownloader
// ExcludedPaths are generated paths owned by the current project. They are
// omitted only from local repository snapshots, never from installed trees.
ExcludedPaths []string
}
GitFetcher uses Atmos authentication and cancellation for remote Git sources.
func (*GitFetcher) Fetch ¶
func (f *GitFetcher) Fetch(ctx context.Context, repo Repository, dest string) (Repository, error)
Fetch stages exactly the requested commit, or resolves the declared ref once.
type Lock ¶
type Lock struct {
Version int `yaml:"version"`
Tracks map[string]map[string]Resolution `yaml:"tracks"`
}
Lock is portable resolution evidence, partitioned by track and declaration.
type LockedSkill ¶
type LockedSkill struct {
Name string `yaml:"name"`
Plugin string `yaml:"plugin,omitempty"`
Repository int `yaml:"repository"`
Path string `yaml:"path"`
Digest string `yaml:"digest"`
}
LockedSkill identifies one complete skill tree within a resolved repository.
type Options ¶
type Options struct {
Source, Name, Track, Scope, Path string
Clients []string
Update, Prune, Frozen, Check, DryRun, Force, Uninstall bool
}
Options controls reconciliation without changing declarations.
type Record ¶
type Record struct {
Project string `json:"project"`
Source string `json:"source"`
Track string `json:"track"`
Scope string `json:"scope"`
Name string `json:"name"`
Client string `json:"client"`
Path string `json:"path"`
Digest string `json:"digest"`
ManualRoot string `json:"manual_root,omitempty"`
}
Record owns one actual destination, including the canonical Atmos copy.
type Repository ¶
type Repository struct {
Source string `yaml:"source"`
Ref string `yaml:"ref,omitempty"`
Commit string `yaml:"commit,omitempty"`
Digest string `yaml:"digest,omitempty"`
}
Repository records immutable Git provenance or a local content digest.
type Resolution ¶
type Resolution struct {
Declaration schema.AISkillConfig `yaml:"declaration"`
Version string `yaml:"resolved_version,omitempty"`
Repositories []Repository `yaml:"repositories"`
Skills []LockedSkill `yaml:"skills"`
}
Resolution pins every repository contributing to a declaration.