Documentation
¶
Overview ¶
Package config loads ~/.tomo/config.yaml: providers, the default model, and agent knobs. Values may reference environment variables with ${VAR} so keys never have to live in the file itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Channels ¶
type Channels struct {
Telegram Telegram `yaml:"telegram"`
Discord Discord `yaml:"discord"`
Slack Slack `yaml:"slack"`
IMessage IMessage `yaml:"imessage"`
}
Channels configures the front doors serve turns on.
type Config ¶
type Config struct {
DefaultModel string `yaml:"default_model"`
Providers map[string]Provider `yaml:"providers"`
Agent Agent `yaml:"agent"`
Policy Policy `yaml:"policy"`
Channels Channels `yaml:"channels"`
Heartbeat Heartbeat `yaml:"heartbeat"`
Voice Voice `yaml:"voice"`
MCP MCP `yaml:"mcp"`
Workers map[string]Worker `yaml:"workers"`
DataDir string `yaml:"data_dir"`
}
Config is the whole file. Policy is left as a raw map so pkg/config need not import pkg/policy; the cli decodes it into policy.Config.
type Heartbeat ¶
type Heartbeat struct {
Enabled bool `yaml:"enabled"`
Every string `yaml:"every"` // schedule spec, defaults to @every 30m
File string `yaml:"file"` // checklist to read each beat, defaults to HEARTBEAT.md in the data dir
Channel string `yaml:"channel"` // where to deliver anything worth saying, defaults to web
Chat string `yaml:"chat"` // chat id within that channel
}
Heartbeat runs tomo on a cadence against a checklist file, so it can pick up standing work without being spoken to. It stays quiet when there is nothing to report. Off unless enabled.
type IMessage ¶
type IMessage struct {
Enabled bool `yaml:"enabled"`
AllowHandles []string `yaml:"allow_handles"`
DBPath string `yaml:"db_path"`
}
IMessage configures the macOS iMessage channel. It is off unless enabled, since it reaches a real Messages account. AllowHandles lists the phone numbers or emails permitted to drive the agent.
type MCP ¶
MCP lists the Model Context Protocol servers to attach on startup. Each one contributes its tools, namespaced by the server key.
type MCPServer ¶
type MCPServer struct {
Command string `yaml:"command"` // executable to run for a stdio server
Args []string `yaml:"args"` // its arguments
Env map[string]string `yaml:"env"` // extra environment for it
URL string `yaml:"url"` // endpoint of an HTTP server
Headers map[string]string `yaml:"headers"` // sent on every HTTP request, for auth
}
MCPServer describes one MCP server. Set command to launch it as a local subprocess over stdio, or url to reach a remote one over HTTP.
type Policy ¶
type Policy struct {
Read string `yaml:"read"`
Net string `yaml:"net"`
Write string `yaml:"write"`
Exec string `yaml:"exec"`
Rules map[string]string `yaml:"rules"`
}
Policy mirrors the policy section without depending on pkg/policy.
type Provider ¶
type Provider struct {
Type string `yaml:"type"` // "anthropic" or "openai"
APIKey string `yaml:"api_key"`
BaseURL string `yaml:"base_url"`
}
Provider is one model backend entry.
type Slack ¶
type Slack struct {
AppToken string `yaml:"app_token"`
BotToken string `yaml:"bot_token"`
AllowChannels []string `yaml:"allow_channels"`
}
Slack holds the app-level and bot tokens and the channels allowed to reach the bot. The app token opens the socket; the bot token posts messages.
type Voice ¶
type Voice struct {
Model string `yaml:"model"` // path to a ggml whisper model; setting it enables voice-in
Bin string `yaml:"bin"` // whisper.cpp cli, defaults to whisper-cli
FFmpeg string `yaml:"ffmpeg"` // ffmpeg for decode and opus encode, defaults to ffmpeg
TTSModel string `yaml:"tts_model"` // path to a piper voice model; setting it enables voice-out
TTSBin string `yaml:"tts_bin"` // piper cli, defaults to piper
}
Voice configures speech both ways, all handled locally so no audio leaves the machine. Setting model turns on transcription of inbound voice notes with whisper.cpp; setting tts_model turns on spoken replies with piper, sent back as a voice note wherever the user spoke first.
type Worker ¶
type Worker struct {
Persona string `yaml:"persona"` // extra system-prompt lines that set its role
Model string `yaml:"model"` // provider/model override, empty means the default
Policy Policy `yaml:"policy"` // its own gate, merged over the top-level policy
Channels []string `yaml:"channels"` // channel:chat keys whose messages route to it
}
Worker is a named specialist that handles some conversations in its own right: its own persona, an optional model, its own policy, and the channel:chat bindings that route to it. Anything left unset falls back to the top-level default. The default worker, tomo, needs no entry here.