config

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const EnvDefaultHarness = "BOID_DEFAULT_HARNESS"

EnvDefaultHarness is the environment variable that overrides the configured default harness.

Variables

View Source
var ErrDefaultHarnessNotSet = errors.New("default harness not set")

ErrDefaultHarnessNotSet is returned by DefaultHarness when no default harness has been configured via env var or config file.

Functions

func DefaultHarness added in v0.0.8

func DefaultHarness() (string, error)

DefaultHarness resolves the default harness identifier using:

  1. env var BOID_DEFAULT_HARNESS, if non-empty
  2. config file (~/.config/boid/config.yaml) default_harness key

It returns ErrDefaultHarnessNotSet when neither source supplies a value, so callers can branch on errors.Is(err, ErrDefaultHarnessNotSet) and prompt the user.

func SetDefaultHarness added in v0.0.8

func SetDefaultHarness(harness string) error

SetDefaultHarness persists harness as the default_harness in the user's config file (~/.config/boid/config.yaml). Existing keys are preserved by reading the raw YAML, mutating the default_harness key, and re-marshalling. The write is atomic: a sibling temp file is written and renamed into place.

func ValidateHarnessName added in v0.0.8

func ValidateHarnessName(s string) error

ValidateHarnessName returns an error if s is not a syntactically valid harness identifier. It does NOT verify the binary is installed.

Types

type Config

type Config struct {
	GC      GCConfig      `yaml:"gc"`
	Web     WebConfig     `yaml:"web"`
	Notify  NotifyConfig  `yaml:"notify"`
	Sandbox SandboxConfig `yaml:"sandbox"`
	TaskAsk TaskAskConfig `yaml:"task_ask"`

	// DefaultHarness is the harness identifier (claude, codex, opencode, ...)
	// used by sub-commands that need to launch an interactive agent without
	// a project-level harness context (e.g. `boid kit init`). Empty means
	// "ask the user on first use" — see DefaultHarness() for the resolver.
	DefaultHarness string `yaml:"default_harness"`
}

Config holds the global boid configuration.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default boid configuration.

func Load

func Load() (*Config, error)

Load reads the configuration from the default XDG path (~/.config/boid/config.yaml). If the file does not exist, the default configuration is returned without error.

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler for Config. It starts from DefaultConfig values so that unspecified fields retain defaults. Unknown legacy fields (state_machine.rework_limit) are silently ignored.

type GCConfig

type GCConfig struct {
	Enabled   bool          `yaml:"-"`
	Interval  time.Duration `yaml:"-"`
	OlderThan time.Duration `yaml:"-"`
}

GCConfig holds garbage collection settings.

type NotifyConfig

type NotifyConfig struct {
	Command []string `yaml:"command"`
}

NotifyConfig holds settings for agent-driven notifications.

type SandboxConfig

type SandboxConfig struct {
	AllowedDomains []string `yaml:"allowed_domains"`
}

SandboxConfig holds sandbox-related settings.

type TaskAskConfig added in v0.0.7

type TaskAskConfig struct {
	// DisconnectGrace is how long an awaiting task may sit with no live agent
	// parked (the agent's `boid task ask` was killed by a harness command-timeout
	// and disconnected) before the daemon reclaims it. The agent normally
	// re-asks within one command-timeout and re-attaches; the grace bounds the
	// case where it never returns.
	DisconnectGrace time.Duration `yaml:"-"`
}

TaskAskConfig holds settings for the blocking `boid task ask` Q&A RPC.

type WebConfig

type WebConfig struct {
	PublicURL string `yaml:"public_url"`
	HTTPAddr  string `yaml:"http_addr"`
}

WebConfig holds web UI settings.

Jump to

Keyboard shortcuts

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