Documentation
¶
Overview ¶
Package config reads halo.yaml (the roster) and the saved state (server, API key, address tokens).
Index ¶
- Constants
- func DetectWeb(dir string) (string, bool)
- func LagrangeLogin() (server, key string)
- func RosterPath() (string, error)
- func StatePath() (string, error)
- type Agent
- type Config
- func (c *Config) Agent(handle string) (Agent, bool)
- func (c *Config) ByRole(role string) []Agent
- func (c *Config) Clone() *Config
- func (c *Config) Command(a Agent) string
- func (c *Config) Handle(name string) string
- func (c *Config) Lead() Agent
- func (c *Config) Name(handle string) string
- func (c *Config) Notifies() bool
- func (c *Config) PreviewCommand(dir string) (string, bool)
- func (c *Config) Reviewer() Agent
- func (c *Config) SaveRoster(path string) error
- func (c *Config) Validate() error
- func (c *Config) WorkerModels() []string
- type State
Constants ¶
const ( RoleLead = "lead" RoleWorker = "worker" RoleReviewer = "reviewer" )
Roles of an agent.
Variables ¶
This section is empty.
Functions ¶
func LagrangeLogin ¶
func LagrangeLogin() (server, key string)
LagrangeLogin reads the server and API key `lagrange login` saved ($LAGRANGE_CONFIG, or lagrange/config.json in the user's config directory). Both are empty when there is no login.
func RosterPath ¶
RosterPath is the global roster, next to the state: one team for every repo. HALO_ROSTER overrides it.
Types ¶
type Agent ¶
type Agent struct {
Name string `yaml:"name"`
Model string `yaml:"model"`
Role string `yaml:"role"`
Capacity int `yaml:"capacity"`
// ACP is this agent's coding agent command, e.g. "agy acp --process-per-session";
// empty uses the roster's acp. Model is then whatever that agent calls its
// models (a session option), e.g. "gemini-3.8-flash-low".
ACP string `yaml:"acp,omitempty"`
}
Agent is one roster entry.
type Config ¶
type Config struct {
// Server is the Lagrange server's URL. LAGRANGE_SERVER overrides it.
Server string `yaml:"server"`
// Prefix starts every address handle: "halo" gives @halo-lead, @halo-sonnet-1, ...
Prefix string `yaml:"prefix"`
// Repo is the git repository the agents work on. Relative paths are resolved
// against the directory of halo.yaml.
Repo string `yaml:"repo"`
// ACP is the coding agent command, "claude-agent-acp" by default. An agent's
// own acp overrides it (see [Config.Command]).
ACP string `yaml:"acp"`
// Preview is the command that serves the project for the live preview row,
// e.g. "npm run dev". Setting it marks the project as a web project; without
// it Halo detects one from package.json (see [Config.PreviewCommand]).
Preview string `yaml:"preview"`
// Notify, when false, keeps Halo from pinging the terminal (a desktop
// notification and a bell) when something new waits on you. On by default.
Notify *bool `yaml:"notify,omitempty"`
// Agents is the roster: one lead, one reviewer, any number of workers.
Agents []Agent `yaml:"agents"`
}
Config is halo.yaml.
func LoadRoster ¶
LoadRoster returns the roster: local if that file exists (a repo that wants its own team), else the global one, which it creates from Default on first use. The second result says where it came from.
func (*Config) Command ¶
Command is the coding agent command an agent runs: its own acp, or the roster's.
func (*Config) PreviewCommand ¶
PreviewCommand returns the command that serves the project in dir and whether it is a web project. The configured Preview wins; otherwise dir is a web project when its package.json has a dev or start script (dev preferred), or when it has an index.html or a vite/next config (then "npm run dev").
func (*Config) SaveRoster ¶
SaveRoster writes the roster (prefix, coding agent and agents) to path.
func (*Config) Validate ¶
Validate checks the roster: one lead, one reviewer, at least one worker, and unique names that work as handles.
func (*Config) WorkerModels ¶
WorkerModels lists the models workers run, in ladder order of appearance.
type State ¶
type State struct {
Server string `json:"server"`
Key string `json:"key"`
Human string `json:"human"`
Tokens map[string]string `json:"tokens,omitempty"` // "server handle" -> token
}
State is what halo remembers between runs: the server, the API key, who it acts for, and the address tokens it minted.