config

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBasePath    = "config.base.yaml"
	DefaultOverlayPath = "config.yaml"
	DefaultRootID      = "runner.default"
)

Variables

This section is empty.

Functions

func DefaultSubagentToolWhitelist added in v0.1.11

func DefaultSubagentToolWhitelist() []string

DefaultSubagentToolWhitelist is the explicit in-process subagent tool surface. New tool plugins do not appear here until deliberately added.

func DefaultToolBlacklist added in v0.1.11

func DefaultToolBlacklist() []string

DefaultToolBlacklist excludes test, scripted, and alternate implementations from the main agent toolset.

func DumpResolvedYAML added in v0.1.18

func DumpResolvedYAML(basePath string, overlayPaths []string, opts DumpOptions) ([]byte, error)

DumpResolvedYAML loads and renders the effective config graph (merge, extends, prune, interpolate) and returns YAML bytes suitable for inspection.

func LoadDocument

func LoadDocument(basePath string, overlayPaths ...string) (manager.Document, error)

LoadDocument loads L0 base config and optional L1 overlays, prunes unreachable instances, then parses. Overlays apply in order, so a later one wins.

func MergeFromFiles

func MergeFromFiles(basePath string, overlayPaths ...string) ([]byte, error)

MergeFromFiles is an alias for ResolveFiles.

func MergeYAML

func MergeYAML(base, overlay []byte) ([]byte, error)

MergeYAML merges two instance graphs. When overlay changes use, the whole node is replaced; otherwise config and deps are deep-merged into the base node.

func RedactInstances added in v0.1.18

func RedactInstances(raw map[string]any)

RedactInstances scrubs resolved config values that look like secrets. Credential refs such as env:OPENAI_API_KEY are kept so dumps stay debuggable.

func RegisterGraphEnvSource added in v0.1.19

func RegisterGraphEnvSource(source GraphEnvSource)

RegisterGraphEnvSource registers a graph env source used by ResolveYAML and ResolveFiles in addition to per-call WithGraphEnvSource options. Plugins such as credentials/env call this from init.

func ResolveFiles

func ResolveFiles(basePath string, overlayPaths ...string) ([]byte, error)

ResolveFiles merges L0 with each L1 overlay in order and prunes instances unreachable from root. Chaining lets a capability stack live in one preset and a transport swap in another, instead of every preset restating the whole graph.

func ResolveYAML

func ResolveYAML(interpDir string, base []byte, overlays ...[]byte) ([]byte, error)

ResolveYAML merges base with each overlay in order, expands extends, interpolates string values, then prunes unreachable instances. ${env:NAME} expands to env:NAME when present; ${var:NAME} expands to the value. Both gate on the process environment plus RegisterGraphEnvSource / ResolveOption sources.

func ResolveYAMLWithOptions added in v0.1.19

func ResolveYAMLWithOptions(interpDir string, base []byte, overlays [][]byte, opts ...ResolveOption) ([]byte, error)

ResolveYAMLWithOptions is ResolveYAML with per-call env gate sources.

func ScaffoldToolsFragment added in v0.1.11

func ScaffoldToolsFragment(profile ToolProfile, opts ToolsScaffoldOptions) (map[string]any, error)

ScaffoldToolsFragment generates a pluginkit instance map for one tools/runtime profile.

func ScaffoldToolsYAML added in v0.1.11

func ScaffoldToolsYAML(profile ToolProfile, opts ToolsScaffoldOptions) ([]byte, error)

ScaffoldToolsYAML returns a YAML fragment for the given tools/runtime profile.

func SplitOverlayPaths

func SplitOverlayPaths(spec string) []string

SplitOverlayPaths parses a comma-separated overlay list, e.g. "presets/autonomous.yaml,presets/daemon.yaml".

Types

type DumpOptions added in v0.1.18

type DumpOptions struct {
	// Redact scrubs interpolated secrets while keeping credential refs (env:, file:).
	Redact bool
}

DumpOptions controls resolved config output.

type EnvContext added in v0.1.19

type EnvContext struct {
	// contains filtered or unexported fields
}

EnvContext supplies values for ${env:VAR} and ${var:VAR} during prune and interpolation.

func BuildEnvContext added in v0.1.19

func BuildEnvContext(raw map[string]any, opts ...ResolveOption) (EnvContext, error)

BuildEnvContext constructs an EnvContext from the merged graph and options.

func (EnvContext) Lookup added in v0.1.19

func (c EnvContext) Lookup(name string) (string, bool)

Lookup reports whether name is available for ${env:NAME} / ${var:NAME} gating.

type EnvLookup added in v0.1.19

type EnvLookup func(name string) (value string, ok bool)

EnvLookup resolves a single variable name for ${env:NAME} / ${var:NAME} gate probes and interpolation during config loading.

func MapEnvLookup added in v0.1.19

func MapEnvLookup(values map[string]string) EnvLookup

MapEnvLookup returns an EnvLookup backed by a static map.

type GraphEnvSource added in v0.1.19

type GraphEnvSource func(raw map[string]any) (EnvLookup, error)

GraphEnvSource builds an EnvLookup from the merged instance graph after overlays and extends. It must not read secret files or instantiate plugins.

type ResolveOption added in v0.1.19

type ResolveOption func(*resolveOptions)

ResolveOption configures env resolution during ResolveYAML.

func WithEnvLookup added in v0.1.19

func WithEnvLookup(lookup EnvLookup) ResolveOption

WithEnvLookup appends a lookup tried after the process environment.

func WithGraphEnvSource added in v0.1.19

func WithGraphEnvSource(source GraphEnvSource) ResolveOption

WithGraphEnvSource appends a graph-backed lookup tried after process env and any WithEnvLookup sources.

type ToolProfile added in v0.1.11

type ToolProfile string

ToolProfile selects which tools/runtime instance graph fragment to scaffold.

const (
	ToolProfileDefault  ToolProfile = "default"
	ToolProfileSubagent ToolProfile = "subagent"
)

type ToolsScaffoldOptions added in v0.1.11

type ToolsScaffoldOptions struct {
	Whitelist []string
	Blacklist []string
}

ToolsScaffoldOptions controls kind filtering when generating tool graphs.

Jump to

Keyboard shortcuts

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