config

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config loads the agent's YAML configuration.

Index

Constants

View Source
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

View Source
var DefaultAbilities = []string{"read_book", "read_article"}
View Source
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 Autonomy

type Autonomy struct {
	Owner      string            `yaml:"owner"`
	Classes    map[string]string `yaml:"classes"`
	AskExpires time.Duration     `yaml:"ask_expires"`
}

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

func Load(fsys fs.FS, path string, work []byte) (*Config, error)

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

func (c *Config) Policy() (action.Policy, error)

Policy is the defaults with the config's overrides. The owner defaults to the first Telegram owner.

func (*Config) ValidateAgent

func (c *Config) ValidateAgent() error

type Console

type Console struct {
	Addr  string `yaml:"addr"`  // empty: no console
	Token string `yaml:"token"` // required unless addr is localhost
}

func (Console) Local

func (c Console) Local() bool

Local reports whether the console only listens on this machine.

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

func (d DailyLife) AbilityNames() []string

func (DailyLife) ReviewTime

func (d DailyLife) ReviewTime() (time.Weekday, time.Duration, error)

func (DailyLife) Times

func (d DailyLife) Times() (plan, journal time.Duration, err error)

type Database

type Database struct {
	URL string `yaml:"url"`
}

type Decision

type Decision struct {
	Provider     `yaml:",inline"`
	QuestionSets string `yaml:"question_sets"`
}

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)

func (Initiative) Zone

func (i Initiative) Zone() (*time.Location, error)

type Judgment

type Judgment struct {
	Calls       bool          `yaml:"calls"`
	AsksPerDay  int           `yaml:"asks_per_day"` // day-plan calls only; goal calls are always asked
	ReplyWindow time.Duration `yaml:"reply_window"`
}

type Log

type Log struct {
	Level string `yaml:"level"`
}

type Memory

type Memory struct {
	RecallCandidates int `yaml:"recall_candidates"`
}

type Portfolio

type Portfolio struct {
	Addr     string `yaml:"addr"` // empty: no page
	Prompt   string `yaml:"prompt"`
	UpdateAt string `yaml:"update_at"` // "HH:MM" in UTC, not its own time zone
}

func (Portfolio) UpdateTime

func (p Portfolio) UpdateTime() (time.Duration, error)

type Provider

type Provider struct {
	Provider string `yaml:"provider"`
	Model    string `yaml:"model"`
	APIKey   string `yaml:"api_key"`
	BaseURL  string `yaml:"base_url"`
}

type Reasoning

type Reasoning struct {
	Provider `yaml:",inline"`
	Prompt   string `yaml:"prompt"`
	Effort   string `yaml:"effort"` // empty: the model's default
}
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 Telegram

type Telegram struct {
	Token              string  `yaml:"token"`
	OwnerIDs           []int64 `yaml:"owner_ids"`
	PollTimeoutSeconds int     `yaml:"poll_timeout_seconds"`
}

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).

func (Tools) Validate

func (t Tools) Validate() error

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.

type Web

type Web struct {
	Searches int `yaml:"searches_per_day"`
	Pages    int `yaml:"pages_per_day"`
}

type WorkingMemory

type WorkingMemory struct {
	Turns  int           `yaml:"turns"` // 0 turns recall off
	Window time.Duration `yaml:"window"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL