config

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config provides project-level configuration for Holon. It supports loading configuration from .holon/config.yaml files with proper precedence: CLI flags > project config > defaults.

Index

Constants

View Source
const (
	// ConfigDir is the directory name for Holon configuration
	ConfigDir = ".holon"
	// ConfigFile is the name of the configuration file
	ConfigFile = "config.yaml"
	// ConfigPath is the full path to the config file relative to project root
	ConfigPath = ConfigDir + "/" + ConfigFile
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GitConfig

type GitConfig struct {
	// AuthorName overrides git config user.name for containers
	AuthorName string `yaml:"author_name,omitempty"`

	// AuthorEmail overrides git config user.email for containers
	AuthorEmail string `yaml:"author_email,omitempty"`
}

GitConfig contains Git identity overrides for container operations. These settings override the host's git config when running inside containers.

type ProjectConfig

type ProjectConfig struct {
	// BaseImage is the default container toolchain image (e.g., "golang:1.22")
	// Set to "auto" or "auto-detect" to enable automatic detection based on workspace files.
	BaseImage string `yaml:"base_image,omitempty"`

	// Agent is the default agent bundle reference (path, URL, or alias)
	Agent string `yaml:"agent,omitempty"`

	// AgentChannel controls how the agent is resolved when no explicit agent is specified.
	// Values: "latest" (default), "builtin", "pinned:<version>"
	AgentChannel string `yaml:"agent_channel,omitempty"`

	// LogLevel is the default Holon log level (debug, info, progress, minimal)
	LogLevel string `yaml:"log_level,omitempty"`

	// AssistantOutput controls streaming of assistant text to stdout/stderr
	// Values: "none" (default) or "stream"
	AssistantOutput string `yaml:"assistant_output,omitempty"`

	// Skills is a list of paths to skill directories to include
	Skills []string `yaml:"skills,omitempty"`

	// BuiltinSkillsSource is the default remote source for builtin skills
	// Can be a direct URL or a catalog reference (e.g., "https://github.com/holon-run/holon/releases/download/v1.0.0/holon-skills-v1.0.0.zip")
	// When set, builtin skills will be loaded from this source instead of embedded copies
	BuiltinSkillsSource string `yaml:"builtin_skills_source,omitempty"`

	// BuiltinSkillsRef is the version/ref tag for builtin skills (e.g., "v1.0.0", "main")
	// Used in combination with BuiltinSkillsSource to construct the download URL
	BuiltinSkillsRef string `yaml:"builtin_skills_ref,omitempty"`

	// Git configuration overrides for container operations
	Git GitConfig `yaml:"git,omitempty"`
}

ProjectConfig represents the project-level configuration for Holon. It provides defaults that can be overridden by CLI flags.

func Load

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

Load loads the project configuration from the given directory. It searches for .holon/config.yaml in the directory and its parents.

If no config file is found, it returns a zero config and nil error. If a config file is found but cannot be parsed, it returns an error.

func LoadFromCurrentDir

func LoadFromCurrentDir() (*ProjectConfig, error)

LoadFromCurrentDir loads the project configuration from the current working directory.

func (*ProjectConfig) GetBuiltinSkillsRef added in v0.11.0

func (c *ProjectConfig) GetBuiltinSkillsRef() string

GetBuiltinSkillsRef returns the configured builtin skills ref

func (*ProjectConfig) GetBuiltinSkillsSource added in v0.11.0

func (c *ProjectConfig) GetBuiltinSkillsSource() string

GetBuiltinSkillsSource returns the configured builtin skills source

func (*ProjectConfig) GetGitAuthorEmail

func (c *ProjectConfig) GetGitAuthorEmail() string

GetGitAuthorEmail returns the configured git author email, or empty if not set.

func (*ProjectConfig) GetGitAuthorName

func (c *ProjectConfig) GetGitAuthorName() string

GetGitAuthorName returns the configured git author name, or empty if not set.

func (*ProjectConfig) GetSkills added in v0.9.0

func (c *ProjectConfig) GetSkills() []string

GetSkills returns the configured skills list

func (*ProjectConfig) HasGitConfig

func (c *ProjectConfig) HasGitConfig() bool

HasGitConfig returns true if any git configuration is set.

func (*ProjectConfig) IsImageAutoDetectEnabled

func (c *ProjectConfig) IsImageAutoDetectEnabled() bool

IsImageAutoDetectEnabled returns true if auto-detection is explicitly configured in the project config (vs. default behavior).

func (*ProjectConfig) ResolveAgent

func (c *ProjectConfig) ResolveAgent(cliValue string) (string, string)

ResolveAgent returns the effective agent bundle and its source.

func (*ProjectConfig) ResolveAgentChannel

func (c *ProjectConfig) ResolveAgentChannel(cliValue string) (string, string)

ResolveAgentChannel returns the effective agent channel and its source. Default is "latest" if not specified.

func (*ProjectConfig) ResolveAssistantOutput added in v0.9.0

func (c *ProjectConfig) ResolveAssistantOutput(cliValue, defaultValue string) (string, string)

ResolveAssistantOutput returns the effective assistant output mode and its source. Precedence: cliValue > configValue > defaultValue. Returns the effective value and its source ("cli", "config", or "default").

func (*ProjectConfig) ResolveBaseImage

func (c *ProjectConfig) ResolveBaseImage(cliValue, defaultValue string) (string, string)

ResolveBaseImage returns the effective base image and its source.

func (*ProjectConfig) ResolveBuiltinSkillsRef added in v0.11.0

func (c *ProjectConfig) ResolveBuiltinSkillsRef(cliValue, defaultValue string) (string, string)

ResolveBuiltinSkillsRef returns the effective builtin skills ref and its source. Precedence: cliValue > configValue > defaultValue. Returns the effective value and its source ("cli", "config", or "default").

func (*ProjectConfig) ResolveBuiltinSkillsSource added in v0.11.0

func (c *ProjectConfig) ResolveBuiltinSkillsSource(cliValue, defaultValue string) (string, string)

ResolveBuiltinSkillsSource returns the effective builtin skills source and its source. Precedence: cliValue > configValue > defaultValue. Returns the effective value and its source ("cli", "config", or "default").

func (*ProjectConfig) ResolveLogLevel

func (c *ProjectConfig) ResolveLogLevel(cliValue, defaultValue string) (string, string)

ResolveLogLevel returns the effective log level and its source.

func (*ProjectConfig) ResolveString

func (c *ProjectConfig) ResolveString(cliValue, configValue, defaultValue string) (string, string)

ResolveString returns the effective value for a string configuration field. Precedence: cliValue > configValue > defaultValue. Returns the effective value and its source ("cli", "config", or "default").

func (*ProjectConfig) ShouldAutoDetectImage

func (c *ProjectConfig) ShouldAutoDetectImage() bool

ShouldAutoDetectImage returns true if auto-detection is enabled. Auto-detection is enabled if base_image is "auto" or "auto-detect".

Jump to

Keyboard shortcuts

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