Documentation
¶
Overview ¶
Package config loads the agent's YAML configuration.
Index ¶
Constants ¶
const ToolRead = "read"
ToolRead is a tool that only reads. Every other kind is the autonomy class the gate checks before it is used.
Variables ¶
var DefaultAbilities = []string{"read_book", "read_article"}
var ToolKinds = []string{ToolRead, "write", "external_message", "commit", "spend"}
ToolKinds are what a tool can do: read, or one of these autonomy classes.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Database Database `yaml:"database"`
Telegram Telegram `yaml:"telegram"`
Decision Decision `yaml:"decision"` // System 1
Reasoning Reasoning `yaml:"reasoning"` // System 2
WorkingMemory WorkingMemory `yaml:"working_memory"`
Memory Memory `yaml:"memory"`
Portfolio Portfolio `yaml:"portfolio"`
Initiative Initiative `yaml:"initiative"`
DailyLife DailyLife `yaml:"daily_life"`
Console Console `yaml:"console"`
Autonomy Autonomy `yaml:"autonomy"`
Judgment Judgment `yaml:"judgment"`
Search Search `yaml:"search"`
Tools Tools `yaml:"tools"`
// Embedding finds the past decisions most like the one at hand; no
// provider: the newest are used instead.
Embedding Provider `yaml:"embedding"`
Pricing map[string]pricing.Price `yaml:"pricing"`
Log Log `yaml:"log"`
}
func Load ¶
Load reads the file at path in fsys, then how the person works (work.yaml; nil if none) over it, expanding ${VAR} references from the environment.
func (*Config) Policy ¶
Policy is the defaults with the config's overrides. The owner defaults to the first Telegram owner.
func (*Config) ValidateAgent ¶
type Console ¶
type DailyLife ¶
type DailyLife struct {
Enabled bool `yaml:"enabled"`
// Abilities nil: DefaultAbilities. Empty: none besides the journal.
Abilities []string `yaml:"abilities"`
// Deprecated: list Abilities instead. Used only when Abilities is nil.
Reading *bool `yaml:"reading"`
PlanAt string `yaml:"plan_at"`
JournalAt string `yaml:"journal_at"`
ReviewAt string `yaml:"review_at"`
Activities int `yaml:"activities"`
// Pace is the rounds in its waking day; BudgetUSD and Web are per pace-1
// day and are multiplied by it.
Pace int `yaml:"pace"`
BudgetUSD float64 `yaml:"budget_usd"`
PlanPrompt string `yaml:"plan_prompt"`
ActivityPrompt string `yaml:"activity_prompt"`
ReviewPrompt string `yaml:"review_prompt"`
LearnPrompt string `yaml:"learn_prompt"`
DataPrompt string `yaml:"data_prompt"`
ObservePrompt string `yaml:"observe_prompt"`
Web Web `yaml:"web"`
}
func (DailyLife) AbilityNames ¶
type Initiative ¶
type Initiative struct {
Timezone string `yaml:"timezone"` // empty: the one in its life story
CheckIns []string `yaml:"check_ins"`
Quiet time.Duration `yaml:"quiet"`
}
func (Initiative) CheckInTimes ¶
func (i Initiative) CheckInTimes() ([]time.Duration, error)
type Portfolio ¶
type Search ¶
type Search struct {
Provider string `yaml:"provider"`
Model string `yaml:"model"` // empty: the System 2 model
}
Search with the openai provider uses the System 2 key (reasoning.api_key).
type ToolServer ¶
type ToolServer struct {
Name string `yaml:"name"`
// About says what it is and where things are, for the planner, like
// "Busta's shared folder, /Users/busta/shared: notes he shares".
About string `yaml:"about"`
// Command runs a local server; URL reaches a remote one. Exactly one.
Command []string `yaml:"command"`
URL string `yaml:"url"`
// AuthEnv names the environment variable holding a remote server's
// bearer token. Env names the variables a local server is given, besides
// PATH and HOME: it never sees the rest of the environment.
AuthEnv string `yaml:"auth_env"`
Env []string `yaml:"env"`
Tools map[string]string `yaml:"tools"` // tool name → what it can do
Watch []Watch `yaml:"watch"`
}
type Tools ¶
type Tools struct {
CallsPerDay int `yaml:"calls_per_day"` // reading calls; grows with pace, like the web caps
ActionsPerDay int `yaml:"actions_per_day"` // tools that change things: real effects, so not paced
Servers []ToolServer `yaml:"servers"`
}
Tools are MCP servers whose tools it may use. Only the tools listed are offered, each with what it can do (ToolKinds).
type Watch ¶
type Watch struct {
Tool string `yaml:"tool"`
Args map[string]any `yaml:"args"`
Every time.Duration `yaml:"every"` // at least a minute
// Items is where the list is in a JSON result, as dotted keys (like
// "messages"); "" if the result is the list, or a single item. ID is the
// field that identifies an item; "" to tell items apart by what they say.
Items string `yaml:"items"`
ID string `yaml:"id"`
}
Watch calls one of the server's read tools on a schedule; each item in its result not seen before is something the person perceives.