Help us shape the future of Go! Take the 2026 Go Developer Survey

source

package
v1.233.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package source reconciles declarative skill sources with owned installations.

Index

Constants

This section is empty.

Variables

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

type EditOptions struct {
	Operation, Label, Field, Value, File string
	DryRun                               bool
}

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

func (e *Engine) InstalledSources(name, scope string) ([]string, error)

InstalledSources resolves installed names to source owners without writing.

func (*Engine) Recover

func (e *Engine) Recover() error

Recover rolls back an interrupted apply or cleans a committed transaction.

func (*Engine) ResolveInstalled

func (e *Engine) ResolveInstalled(name, scope string) (string, error)

func (*Engine) Run

func (e *Engine) Run(ctx context.Context, opts Options) ([]Status, error)

Run resolves, checks and transactionally reconciles the selected declarations.

func (*Engine) Status

func (e *Engine) Status(ctx context.Context, opts Options) ([]Status, error)

Status lists declarations and owned destinations without network or writes.

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.

type State

type State struct {
	Version int       `json:"version"`
	Records []*Record `json:"records"`
}

State contains only machine-local installation records.

type Status

type Status struct {
	Source, Name, Track, Scope, Client, Path, Status string
}

Status describes one desired or recorded destination.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL