resolve

package
v0.14.4-dev.40 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitModuleAtRef

func SplitModuleAtRef(spec string) (module, gitRef string, hasRef bool)

Types

type MaterializeFunc

type MaterializeFunc func(ctx context.Context, client *http.Client, source githubsource.Source, displayURL string, forceRefresh bool) (lockfile.Package, error)

type ModuleConstraints

type ModuleConstraints struct {
	Exact  string
	Branch string
	Tag    string
	Semver []versionRequirement
	Latest bool
}

func ConstraintsFromDependency

func ConstraintsFromDependency(dependency manifest.Dependency, keyRef string, hasKeyRef bool) (ModuleConstraints, error)

func ConstraintsFromRef

func ConstraintsFromRef(value string, present bool) (ModuleConstraints, error)

func ConstraintsFromTable

func ConstraintsFromTable(table manifest.DependencyTable, keyRef string, hasKeyRef bool) (ModuleConstraints, error)

func (*ModuleConstraints) Merge

func (constraints *ModuleConstraints) Merge(other ModuleConstraints) error

func (ModuleConstraints) PickGitRef

func (constraints ModuleConstraints) PickGitRef(lister TagLister, owner, repo string, forceRefresh bool) (string, error)

type ModuleID

type ModuleID string

ModuleID is a canonical Go-style GitHub module path without an @ref suffix.

func ModuleIDFromOwnerRepoPath

func ModuleIDFromOwnerRepoPath(owner, repo, path string) ModuleID

func ParseModuleID

func ParseModuleID(module string) (ModuleID, error)

func (ModuleID) GitHubSource

func (module ModuleID) GitHubSource(gitRef string) githubsource.Source

func (ModuleID) OwnerRepoPath

func (module ModuleID) OwnerRepoPath() (owner, repo, path string)

type ResolveOptions

type ResolveOptions struct {
	Previous        *lockfile.PackLock
	RefreshFloating bool
	// RefreshModules refreshes only the named modules. It is used by
	// `agentpack update SPEC`; exact commit pins remain immutable.
	RefreshModules map[string]bool
	// RecordContentHashes re-fetches packages whose lock entry has no content
	// hash so one can be recorded from freshly downloaded bytes. Without it a
	// package that is already cached stays unverified.
	RecordContentHashes bool
	// RepairCache replaces a cache entry that fails verification with a fresh
	// fetch of the pinned commit instead of failing.
	RepairCache bool
	// Verify checks an existing cache entry. Nil means cache.VerifyPackage.
	Verify func(lockfile.Package) error
	// Notify receives one-line reports about cache entries that were replaced.
	Notify func(message string)
	// Progress reports the package being resolved before potentially slow I/O.
	Progress func(message string)
}

type Resolver

type Resolver struct {
	Client      *http.Client
	Tags        TagLister
	Materialize MaterializeFunc
	Restore     cache.RemoteRestoreFunc
}

func NewResolver

func NewResolver(ctx context.Context, client *http.Client) Resolver

func (Resolver) Resolve

func (resolver Resolver) Resolve(ctx context.Context, projectRoot string, project *manifest.Manifest, options ResolveOptions) (lockfile.PackLock, error)

type Tag

type Tag struct {
	Name string
	SHA  string
}

type TagLister

type TagLister interface {
	ListTags(owner, repo string, forceRefresh bool) ([]Tag, error)
}

Jump to

Keyboard shortcuts

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