Documentation
¶
Overview ¶
Package config loads pocketagent's YAML config file.
The config knows the shape shared by every agent and speech provider, but not their individual settings: those are kept as Options and decoded by the implementation that owns them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandHome ¶
ExpandHome replaces a leading ~ with the user's home directory.
Types ¶
type Agent ¶
type Agent struct {
Type string `yaml:"type"`
Command Command `yaml:"command"`
Wrap Command `yaml:"wrap"`
Env []string `yaml:"env"`
Model string `yaml:"model"` // default model
Models []string `yaml:"models"` // offered in the model picker
Options Options `yaml:"-"`
}
Agent is one configured agent. Keys other than the common ones below are the adapter's own options.
type Budget ¶
type Budget struct {
DailyUSD float64 `yaml:"daily_usd"` // per user; 0 means unlimited
}
type Command ¶
type Command []string
Command accepts either a string ("aider --yes") or a list (["npx", "-y", "pkg"]).
type Config ¶
type Config struct {
Telegram Telegram `yaml:"telegram"`
Defaults Defaults `yaml:"defaults"`
Permissions Permissions `yaml:"permissions"`
Agents map[string]Agent `yaml:"agents"`
Projects map[string]Project `yaml:"projects"`
Transcriber Provider `yaml:"transcriber"`
TTS Provider `yaml:"tts"`
Budget Budget `yaml:"budget"`
Output Output `yaml:"output"`
Checkpoints *bool `yaml:"checkpoints"`
// BridgeHost is how agents reach pocketagent's tool server. Set it to
// host.docker.internal when agents run in containers.
BridgeHost string `yaml:"bridge_host"`
// Home holds state, logs and uploads: the directory of the config file.
Home string `yaml:"-"`
Path string `yaml:"-"`
}
func Load ¶
Load reads and validates the config at path. ${VAR} references are replaced with environment variables, so secrets can live outside the file.
func (*Config) AgentNames ¶
AgentNames returns configured agent names, sorted.
func (*Config) CheckpointsEnabled ¶
CheckpointsEnabled reports whether git checkpoints are on (default true).
func (*Config) ProjectNames ¶
ProjectNames returns configured project names, sorted.
type Options ¶ added in v0.6.0
type Options struct {
// contains filtered or unexported fields
}
Options holds implementation-specific keys from a YAML mapping.
func OptionsFrom ¶ added in v0.6.0
OptionsFrom builds Options from a map, for tests and generated configs. It panics if m can't be represented as YAML, which is a programming error.
type Output ¶
type Output struct {
// Replies longer than this many characters are sent as a file.
FileThreshold int `yaml:"file_threshold"`
}