Documentation
¶
Overview ¶
Package sources resolves agent references — local files and directories, built-in agents, user-config aliases, URLs and OCI references — to config.Source values. It links every source type, so embedders that only need one should construct it directly (config.NewFileSource, ocisource.New, ...) instead of importing this package.
Index ¶
- func BuiltinAgentNames() []string
- func Resolve(agentFilename string, envProvider environment.Provider, ...) (config.Source, error)
- func ResolveAlias(agentFilename string) *userconfig.Alias
- func ResolveSources(agentsPath string, envProvider environment.Provider, ...) (config.Sources, error)
- func ResolveWithConfig(ref string, cfg *userconfig.Config, env environment.Provider) (config.Source, *userconfig.Alias, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltinAgentNames ¶
func BuiltinAgentNames() []string
BuiltinAgentNames returns the names of all built-in agents.
func Resolve ¶
func Resolve(agentFilename string, envProvider environment.Provider, ociOpts ...ocisource.Option) (config.Source, error)
Resolve resolves an agent file reference (local file, URL, or OCI image) to a source. If envProvider is non-nil, it will be used to look up GITHUB_TOKEN for authentication when fetching from GitHub URLs. For OCI references, always checks remote for updates but falls back to local cache if offline; ociOpts (e.g. ocisource.WithVerificationKey) apply to them and are ignored for other kinds.
func ResolveAlias ¶
func ResolveAlias(agentFilename string) *userconfig.Alias
ResolveAlias resolves an agent reference and returns the alias if it exists and has options. Returns nil if the reference is not an alias or doesn't have options.
func ResolveSources ¶
func ResolveSources(agentsPath string, envProvider environment.Provider, ociOpts ...ocisource.Option) (config.Sources, error)
ResolveSources resolves an agent file reference (local file or directory, URL, or OCI image) to sources. If envProvider is non-nil, it will be used to look up GITHUB_TOKEN for authentication when fetching from GitHub URLs. For OCI references, always checks remote for updates but falls back to local cache if offline; ociOpts (e.g. ocisource.WithVerificationKey) apply to them and are ignored for other kinds.
func ResolveWithConfig ¶ added in v1.144.0
func ResolveWithConfig(ref string, cfg *userconfig.Config, env environment.Provider) (config.Source, *userconfig.Alias, error)
ResolveWithConfig resolves against an already validated alias configuration. It does not reload user configuration or silently fall back to another agent.
Types ¶
This section is empty.