Documentation
¶
Overview ¶
Package config loads pocketagent's YAML config file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Modes = []string{"ask", "edits", "plan", "yolo"}
Modes control how much the agent may do without asking.
Functions ¶
func ExpandHome ¶
Types ¶
type Agent ¶
type Agent struct {
// Type is "claude" (native Claude Code CLI), "acp" (any Agent Client
// Protocol agent) or "command" (any CLI that takes a prompt and prints a reply).
Type string `yaml:"type"`
Command Command `yaml:"command"`
Env []string `yaml:"env"`
Models []string `yaml:"models"`
Model string `yaml:"model"`
// Wrap is prepended to the agent command, e.g. a docker run invocation
// for sandboxing. Supports {cwd}.
Wrap Command `yaml:"wrap"`
// command type only
ModelArgs Command `yaml:"model_args"` // added when a model is set; supports {model}
ImageArgs Command `yaml:"image_args"` // added once per image; supports {path}
Stdin bool `yaml:"stdin"` // send the prompt on stdin instead of {prompt}
Timeout Duration `yaml:"timeout"`
}
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 ("claude") or a list (["npx", "-y", "pkg"]).
type Config ¶
type Config struct {
Telegram Telegram `yaml:"telegram"`
Defaults Defaults `yaml:"defaults"`
AutoAllow []string `yaml:"auto_allow"`
ApprovalTimeout Duration `yaml:"approval_timeout"`
Agents map[string]Agent `yaml:"agents"`
Projects map[string]Project `yaml:"projects"`
Transcriber Transcriber `yaml:"transcriber"`
TTS TTS `yaml:"tts"`
Budget Budget `yaml:"budget"`
Output Output `yaml:"output"`
Checkpoints *bool `yaml:"checkpoints"`
// Home is the directory holding state, logs and uploads. Not read from YAML.
Home string `yaml:"-"`
// Path is the file this config was loaded from.
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 Output ¶
type Output struct {
// Replies longer than this many characters are sent as a .md file.
FileThreshold int `yaml:"file_threshold"`
}
type TTS ¶
type TTS struct {
// Type is "say" (macOS), "openai" (OpenAI-compatible /audio/speech),
// "command" or "none".
Type string `yaml:"type"`
Command Command `yaml:"command"` // command template ({text_file}, {out})
Model string `yaml:"model"`
Voice string `yaml:"voice"`
BaseURL string `yaml:"base_url"`
APIKey string `yaml:"api_key"`
FFmpeg string `yaml:"ffmpeg"`
}
type Transcriber ¶
type Transcriber struct {
// Type is "whisper-cpp", "openai" (any OpenAI-compatible endpoint),
// "command" or "none".
Type string `yaml:"type"`
Command Command `yaml:"command"` // whisper-cpp binary, or the command template ({file})
Model string `yaml:"model"`
Language string `yaml:"language"`
BaseURL string `yaml:"base_url"`
APIKey string `yaml:"api_key"`
FFmpeg string `yaml:"ffmpeg"`
}
Click to show internal directories.
Click to hide internal directories.