config

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 9 Imported by: ? 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

Index

Constants

View Source
const (
	DiagnosticCodeRoutingDefaultsMissing = "routing_defaults_missing"
	DiagnosticCodeAgentDirMissing        = "agent_dir_missing"
	DiagnosticCodeAdapterSkillMissing    = "adapter_skill_missing"
	DiagnosticCodeAdapterScriptEmpty     = "adapter_script_empty"
	DiagnosticCodeAdapterScriptMissing   = "adapter_script_missing"
	DiagnosticCodeProviderUnknown        = "provider_unknown"
	DiagnosticCodeRuntimeDefaultUnknown  = "runtime_default_unknown"
	DiagnosticCodeNoBacklogAdapter       = "no_backlog_adapter"
	DiagnosticCodeConfigFieldRemoved     = "config_field_removed"
	DiagnosticCodeConfigFieldUnknown     = "config_field_unknown"
	DiagnosticCodeConfigValueNormalized  = "config_value_normalized"
)
View Source
const (
	DefaultConfigPath = ".noodle.toml"
)

Variables

This section is empty.

Functions

func Load

func Load(path string) (Config, ValidationResult, error)

Load reads and validates config from disk.

Types

type AdapterConfig

type AdapterConfig struct {
	Skill   string            `toml:"skill"`
	Scripts map[string]string `toml:"scripts"`
}

type AgentsConfig

type AgentsConfig struct {
	Claude ProviderConfig `toml:"claude"`
	Codex  ProviderConfig `toml:"codex"`
}

type ConcurrencyConfig

type ConcurrencyConfig struct {
	MaxConcurrency int `toml:"max_concurrency"`
}

type Config

type Config struct {
	Adapters    map[string]AdapterConfig `toml:"adapters"`
	Routing     RoutingConfig            `toml:"routing"`
	Skills      SkillsConfig             `toml:"skills"`
	Mode        string                   `toml:"mode"`
	Concurrency ConcurrencyConfig        `toml:"concurrency"`
	Agents      AgentsConfig             `toml:"agents"`
	Runtime     RuntimeConfig            `toml:"runtime"`
	Server      ServerConfig             `toml:"server"`
}

Config is the top-level .noodle.toml contract for runtime wiring.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the full no-config-file defaults.

func Parse

func Parse(data []byte) (Config, error)

Parse parses a .noodle.toml payload and applies omitted-field defaults.

func (Config) AvailableRuntimes

func (c Config) AvailableRuntimes() []string

type ConfigDiagnostic

type ConfigDiagnostic struct {
	FieldPath string
	Message   string
	Severity  DiagnosticSeverity
	Fix       string
	Code      string
	Meta      map[string]string
}

type CursorConfig

type CursorConfig struct {
	APIKeyEnv     string `toml:"api_key_env"`
	BaseURL       string `toml:"base_url"`
	Repository    string `toml:"repository"`
	MaxConcurrent int    `toml:"max_concurrent"`
}

func (CursorConfig) APIKey

func (c CursorConfig) APIKey() string

type DiagnosticSeverity

type DiagnosticSeverity string
const (
	DiagnosticSeverityRepairable DiagnosticSeverity = "repairable"
	DiagnosticSeverityFatal      DiagnosticSeverity = "fatal"
	DiagnosticSeverityWarning    DiagnosticSeverity = "warning"
)

type ModelPolicy

type ModelPolicy struct {
	Provider string `toml:"provider"`
	Model    string `toml:"model"`
}

type ProcessConfig

type ProcessConfig struct {
	MaxConcurrent int `toml:"max_concurrent"`
}

type ProviderConfig

type ProviderConfig struct {
	Path string   `toml:"path"`
	Args []string `toml:"args"`
}

type RoutingConfig

type RoutingConfig struct {
	Defaults ModelPolicy `toml:"defaults"`
}

type RuntimeConfig

type RuntimeConfig struct {
	Default string        `toml:"default"` // runtime kind, defaults to process
	Process ProcessConfig `toml:"process"`
	Sprites SpritesConfig `toml:"sprites"`
	Cursor  CursorConfig  `toml:"cursor"`
	// contains filtered or unexported fields
}

RuntimeConfig controls the default runtime for spawned cook sessions.

func (RuntimeConfig) MaxConcurrentFor

func (c RuntimeConfig) MaxConcurrentFor(name string) int

MaxConcurrentFor returns the per-runtime concurrency cap for a given runtime name. Returns 0 when unlimited (no per-runtime cap; the global MaxConcurrency ceiling applies).

type ServerConfig

type ServerConfig struct {
	Port    int   `toml:"port"`
	Enabled *bool `toml:"enabled"` // nil = auto (enabled in interactive terminals)
}

ServerConfig controls the web UI server.

type SkillsConfig

type SkillsConfig struct {
	Paths []string `toml:"paths"`
}

type SpritesConfig

type SpritesConfig struct {
	TokenEnv      string `toml:"token_env"`
	BaseURL       string `toml:"base_url"`
	SpriteName    string `toml:"sprite_name"`
	GitTokenEnv   string `toml:"git_token_env"`
	MaxConcurrent int    `toml:"max_concurrent"`
}

func (SpritesConfig) GitToken

func (c SpritesConfig) GitToken() string

func (SpritesConfig) Token

func (c SpritesConfig) Token() string

type ValidationResult

type ValidationResult struct {
	Diagnostics []ConfigDiagnostic
}

func Validate

func Validate(config Config) ValidationResult

Validate classifies repairable and fatal runtime diagnostics.

func (ValidationResult) CanSpawn

func (r ValidationResult) CanSpawn() bool

func (ValidationResult) Fatals

func (r ValidationResult) Fatals() []ConfigDiagnostic

func (ValidationResult) Repairables

func (r ValidationResult) Repairables() []ConfigDiagnostic

func (ValidationResult) Warnings

func (r ValidationResult) Warnings() []ConfigDiagnostic

Jump to

Keyboard shortcuts

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