Documentation
¶
Index ¶
- Variables
- func ApplyModelOverrides(cfg *latest.Config, overrides []string) error
- func AutoEmbeddingModelConfigs() []latest.ModelConfig
- func AutoModelConfig(ctx context.Context, modelsGateway string, env environment.Provider, ...) latest.ModelConfig
- func AvailableProviders(ctx context.Context, modelsGateway string, env environment.Provider) []string
- func BuiltinAgentNames() []string
- func CheckRequiredEnvVars(ctx context.Context, cfg *latest.Config, modelsGateway string, ...) error
- func GatherEnvVarsForModels(cfg *latest.Config) []string
- func GatherEnvVarsForTools(ctx context.Context, cfg *latest.Config) ([]string, error)
- func HooksFromCLI(preToolUse, postToolUse, sessionStart, sessionEnd, onUserInput []string) *latest.HooksConfig
- func IsExternalReference(input string) bool
- func IsOCIReference(input string) bool
- func IsURLReference(input string) bool
- func Load(ctx context.Context, source Source) (*latest.Config, error)
- func MergeHooks(base, cli *latest.HooksConfig) *latest.HooksConfig
- func ParseExternalAgentRef(input string) (agentName, ref string)
- func PreferredMaxTokens(provider string) *int64
- func ResolveAlias(agentFilename string) *userconfig.Alias
- func ResolveModelAliases(ctx context.Context, cfg *latest.Config, store *modelsdev.Store)
- type AutoModelFallbackError
- type Config
- type RuntimeConfig
- type Source
- type Sources
Constants ¶
This section is empty.
Variables ¶
var DefaultModels = map[string]string{
"openai": "gpt-5-mini",
"anthropic": "claude-sonnet-4-5",
"google": "gemini-2.5-flash",
"dmr": "ai/qwen3:latest",
"mistral": "mistral-small-latest",
"amazon-bedrock": "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
}
Functions ¶
func ApplyModelOverrides ¶
ApplyModelOverrides applies CLI model overrides to the configuration
func AutoEmbeddingModelConfigs ¶
func AutoEmbeddingModelConfigs() []latest.ModelConfig
AutoEmbeddingModelConfigs returns the ordered list of embedding-capable models to try when a RAG strategy uses `model: auto` for embeddings.
The priority is:
- OpenAI -> text-embedding-3-small model
- DMR -> Google's embeddinggemma model (via Docker Model Runner)
func AutoModelConfig ¶
func AutoModelConfig(ctx context.Context, modelsGateway string, env environment.Provider, defaultModel *latest.ModelConfig) latest.ModelConfig
func AvailableProviders ¶
func BuiltinAgentNames ¶
func BuiltinAgentNames() []string
BuiltinAgentNames returns the names of all built-in agents.
func CheckRequiredEnvVars ¶
func CheckRequiredEnvVars(ctx context.Context, cfg *latest.Config, modelsGateway string, env environment.Provider) error
CheckRequiredEnvVars checks which environment variables are required by the models and tools.
This allows exiting early with a proper error message instead of failing later when trying to use a model or tool.
func GatherEnvVarsForModels ¶
func GatherEnvVarsForTools ¶
func HooksFromCLI ¶ added in v1.32.5
func HooksFromCLI(preToolUse, postToolUse, sessionStart, sessionEnd, onUserInput []string) *latest.HooksConfig
HooksFromCLI builds a HooksConfig from CLI flag values. Each string is treated as a shell command to run. Empty strings are silently skipped.
func IsExternalReference ¶
IsExternalReference reports whether the input is an external agent reference (OCI image or URL) rather than a local agent name defined in the same config. Local agent names never contain "/", so the slash check distinguishes them from OCI references like "agentcatalog/pirate" or "docker.io/org/agent:v1". It also handles the "name:ref" syntax (e.g. "reviewer:agentcatalog/review-pr").
func IsOCIReference ¶
IsOCIReference checks if the input is a valid OCI reference
func IsURLReference ¶
IsURLReference checks if the input is a valid HTTP/HTTPS URL.
func MergeHooks ¶ added in v1.32.5
func MergeHooks(base, cli *latest.HooksConfig) *latest.HooksConfig
MergeHooks merges CLI hooks into an existing HooksConfig. CLI hooks are appended after any hooks already defined in the config. When both are non-nil and non-empty, a new merged object is returned without mutating either input.
func ParseExternalAgentRef ¶ added in v1.32.5
ParseExternalAgentRef parses an external agent reference that may include an explicit name prefix. The syntax is "name:reference" where name is a simple identifier (no slashes) and reference is an OCI reference or URL.
If no explicit name is provided, the base name is derived from the reference:
- OCI refs: last path segment without tag (e.g. "agentcatalog/review-pr" → "review-pr")
- URLs: filename without extension (e.g. "https://example.com/agent.yaml" → "agent")
Examples:
ParseExternalAgentRef("reviewer:agentcatalog/review-pr") → ("reviewer", "agentcatalog/review-pr")
ParseExternalAgentRef("agentcatalog/review-pr") → ("review-pr", "agentcatalog/review-pr")
ParseExternalAgentRef("docker.io/myorg/myagent:v1") → ("myagent", "docker.io/myorg/myagent:v1")
ParseExternalAgentRef("https://example.com/agent.yaml") → ("agent", "https://example.com/agent.yaml")
func PreferredMaxTokens ¶
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 ResolveModelAliases ¶
ResolveModelAliases resolves model aliases to their pinned versions in the config. For example, "claude-sonnet-4-5" might resolve to "claude-sonnet-4-5-20250929". This modifies the config in place.
NOTE: Alias resolution is skipped for models with custom base_url configurations, either set directly on the model or inherited from a custom provider definition. This is necessary because external providers (like Azure Foundry) may use the alias names directly as deployment names rather than the pinned version names.
Types ¶
type AutoModelFallbackError ¶
type AutoModelFallbackError struct{}
AutoModelFallbackError is returned when auto model selection fails because no providers are available (no API keys configured and DMR not installed).
func (*AutoModelFallbackError) Error ¶
func (e *AutoModelFallbackError) Error() string
type RuntimeConfig ¶
type RuntimeConfig struct {
Config
EnvProviderForTests environment.Provider
// contains filtered or unexported fields
}
func (*RuntimeConfig) CLIHooks ¶ added in v1.32.5
func (runConfig *RuntimeConfig) CLIHooks() *latest.HooksConfig
CLIHooks returns a HooksConfig derived from the runtime config's CLI hook flags, or nil if no hook flags were specified.
func (*RuntimeConfig) Clone ¶
func (runConfig *RuntimeConfig) Clone() *RuntimeConfig
func (*RuntimeConfig) EnvProvider ¶
func (runConfig *RuntimeConfig) EnvProvider() environment.Provider
type Source ¶
type Source interface {
Name() string
ParentDir() string
Read(ctx context.Context) ([]byte, error)
}
func NewBytesSource ¶
func NewFileSource ¶
func NewOCISource ¶
func NewURLSource ¶
func NewURLSource(rawURL string, envProvider environment.Provider) Source
NewURLSource creates a new URL source. If envProvider is non-nil, it will be used to look up GITHUB_TOKEN for authentication when fetching from GitHub URLs.
func Resolve ¶
func Resolve(agentFilename string, envProvider environment.Provider) (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.
type Sources ¶
func ResolveSources ¶
func ResolveSources(agentsPath string, envProvider environment.Provider) (Sources, error)
ResolveSources resolves an agent file reference (local file, 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.