config

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFile = ".herdos.yml"

Variables

This section is empty.

Functions

func Save

func Save(dir string, cfg *Config) error

Save writes the config to .herdos.yml in the given directory.

Types

type Agent

type Agent struct {
	Provider string `yaml:"provider"`
	Binary   string `yaml:"binary"`
	Model    string `yaml:"model"`
	MaxTurns int    `yaml:"max_turns"` // Max agentic turns for headless mode (0 = agent default)
}

type Config

type Config struct {
	Version      int          `yaml:"version"`
	Platform     Platform     `yaml:"platform"`
	Agent        Agent        `yaml:"agent"`
	Workers      Workers      `yaml:"workers"`
	Integrator   Integrator   `yaml:"integrator"`
	Monitor      Monitor      `yaml:"monitor"`
	PullRequests PullRequests `yaml:"pull_requests"`
}

func Default

func Default() *Config

Default returns a Config with all default values.

func Load

func Load(dir string) (*Config, error)

Load reads and parses .herdos.yml from the given directory.

type Integrator

type Integrator struct {
	Strategy                      string `yaml:"strategy"`
	OnConflict                    string `yaml:"on_conflict"`
	MaxConflictResolutionAttempts int    `yaml:"max_conflict_resolution_attempts"`
	RequireCI                     bool   `yaml:"require_ci"`
	Review                        bool   `yaml:"review"`
	ReviewMaxFixCycles            int    `yaml:"review_max_fix_cycles"`
	ReviewStrictness              string `yaml:"review_strictness"` // "standard", "strict", "lenient"
	CIMaxFixCycles                int    `yaml:"ci_max_fix_cycles"`
}

type Monitor

type Monitor struct {
	PatrolIntervalMinutes int      `yaml:"patrol_interval_minutes"`
	StaleThresholdMinutes int      `yaml:"stale_threshold_minutes"`
	MaxPRHAgeHours        int      `yaml:"max_pr_age_hours"`
	AutoRedispatch        bool     `yaml:"auto_redispatch"`
	MaxRedispatchAttempts int      `yaml:"max_redispatch_attempts"`
	NotifyOnFailure       bool     `yaml:"notify_on_failure"`
	NotifyUsers           []string `yaml:"notify_users"`
}

type Platform

type Platform struct {
	Provider string `yaml:"provider"`
	Owner    string `yaml:"owner"`
	Repo     string `yaml:"repo"`
}

type PullRequests

type PullRequests struct {
	AutoMerge     bool   `yaml:"auto_merge"`
	CoAuthorEmail string `yaml:"co_author_email"` // e.g. "123456+herd-os[bot]@users.noreply.github.com"
}

type ValidationError

type ValidationError struct {
	Errors   []string
	Warnings []string
}

ValidationError holds one or more validation errors.

func Validate

func Validate(cfg *Config) *ValidationError

Validate checks the config for invalid values. Returns a *ValidationError if there are errors (warnings alone don't cause an error).

func (*ValidationError) Error

func (e *ValidationError) Error() string

type Workers

type Workers struct {
	MaxConcurrent  int    `yaml:"max_concurrent"`
	RunnerLabel    string `yaml:"runner_label"`
	TimeoutMinutes int    `yaml:"timeout_minutes"`
}

Jump to

Keyboard shortcuts

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