config

package
v0.3.0-beta.25 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AgentNameMaxLength keeps an authored name safe when a normal generated
	// session id is composed into a Network Live peer id. Network peers allow
	// 128 characters; generated session ids use 21, and the separator uses one.
	AgentNameMaxLength = 106

	// AgentNamePattern is the canonical grammar for authored agent identities
	// and references to them.
	AgentNamePattern = `^` + agentNamePatternBody + `$`
	// OptionalAgentNamePattern accepts an empty canonical reference for fields
	// whose empty value means clear or inherit.
	OptionalAgentNamePattern = `^(?:|` + agentNamePatternBody + `)$`
)
View Source
const (
	// DefaultSchedulerFanOutAfter is the wake count before the convergence ladder fans out.
	DefaultSchedulerFanOutAfter = 2
	// DefaultSchedulerSpawnAfter is the wake count before a capability-matched worker is spawned.
	DefaultSchedulerSpawnAfter = 4
	// DefaultSchedulerEventAfter is the wake count before the canonical starved event is emitted.
	DefaultSchedulerEventAfter = 6
	// DefaultSchedulerNeedsAttentionAfter is the wake count before a run is parked needs_attention.
	DefaultSchedulerNeedsAttentionAfter = 10
	// DefaultSchedulerMinQueuedAge is the queued age before a claimable run starts escalating.
	DefaultSchedulerMinQueuedAge = 2 * time.Minute
	// DefaultBlockRecurrenceLimit is the default same-kind re-block count before escalation.
	DefaultBlockRecurrenceLimit = configdefaults.BlockRecurrenceLimit
)
View Source
const (
	BuiltinCoordinatorAgentName     = "coordinator"
	BuiltinDreamingCuratorAgentName = "dreaming-curator"
)
View Source
const (
	// DirName is the CompozyOS directory name used for both the global home and workspace overlays.
	DirName = ".compozy"
	// ConfigName is the standard TOML configuration filename.
	ConfigName = "config.toml"
)
View Source
const (
	// DotEnvStatusMissing reports that no .env file exists at the requested path.
	DotEnvStatusMissing = "missing"
	// DotEnvStatusValid reports that the .env file is structured and needs no repair.
	DotEnvStatusValid = "valid"
	// DotEnvStatusRepairable reports that the .env file can be repaired explicitly.
	DotEnvStatusRepairable = "repairable"
	// DotEnvStatusRepaired reports that the .env file was safely rewritten.
	DotEnvStatusRepaired = "repaired"
	// DotEnvStatusUnsupported reports that Compozy found content it will not rewrite.
	DotEnvStatusUnsupported = "unsupported"
)
View Source
const (
	// AgentsDirName is the directory used for persisted agent definitions.
	AgentsDirName = "agents"
	// SkillsDirName is the directory used for persisted user skills.
	SkillsDirName = "skills"
	// LoopsDirName is the directory used for persisted user loop definitions.
	LoopsDirName = LoopsConfigKey
	// MemoryDirName is the directory used for persistent memory files.
	MemoryDirName = "memory"
	// ProfilesDirName is the directory used for profile-owned state.
	ProfilesDirName = "profiles"
	// DefaultProfileDirName is the permanent default profile directory.
	DefaultProfileDirName = "default"
	// SessionsDirName is the directory used for persisted session state.
	SessionsDirName = "sessions"
	// ToolArtifactsDirName is the directory used for retained oversized tool results.
	ToolArtifactsDirName = "tool-artifacts"
	// SessionAttachmentsDirName is the directory used for persisted session attachments.
	SessionAttachmentsDirName = "session-attachments"
	// RestartsDirName is the directory used for persisted daemon restart operations.
	RestartsDirName = "restarts"
	// LogsDirName is the directory used for structured logs.
	LogsDirName = "logs"
	// GatewayDirName is the directory used for client-local gateway state.
	GatewayDirName = "gateway"
	// GatewayCredentialsDirName is the private gateway credential directory.
	GatewayCredentialsDirName = "credentials"
	// BinDirName is the directory for runtime binaries managed by CompozyOS.
	BinDirName = "bin"
	// DatabaseName is the global database filename.
	DatabaseName = "compozy.db"
	// DaemonSocketName is the daemon UDS filename.
	DaemonSocketName = "daemon.sock"
	// DaemonLockName is the daemon file-lock name.
	DaemonLockName = "daemon.lock"
	// UpdateLockName is the cross-process runtime mutation lock name.
	UpdateLockName = "update.lock"
	// DaemonInfoName is the daemon metadata filename.
	DaemonInfoName = "daemon.json"
	// LogFileName is the structured daemon log filename.
	LogFileName = "compozy.log"
	// NetworkAuditFileName is the append-only network audit filename.
	NetworkAuditFileName = "network.audit"
	// AppStateFileName is the desktop shell state filename.
	AppStateFileName = "app.json"
	// UpdateOperationFileName is the live host update journal filename.
	UpdateOperationFileName = "update-operation.json"
	// UpdateOperationLockName is the stable lock guarding the update journal.
	UpdateOperationLockName = "update-operation.lock"
	// UpdateHistoryFileName is the terminal update audit filename.
	UpdateHistoryFileName = "update-history.jsonl"
	// DesktopProvenanceFileName records ownership of the bundled runtime.
	DesktopProvenanceFileName = ".desktop-provenance.json"
	// AgentDefinitionFileName is the canonical file name for persisted agent definitions.
	AgentDefinitionFileName = "AGENT.md"
)
View Source
const (
	// LoopsConfigKey is the top-level Loop configuration section.
	LoopsConfigKey = "loops"
	// LoopInputsConfigKey is the dynamic per-Loop input-default section.
	LoopInputsConfigKey = "inputs"
)
View Source
const (
	DefaultMarketplaceCatalogBaseURL = "https://raw.githubusercontent.com/compozy/compozy/main/catalog"
	DefaultMarketplaceCatalogTTL     = "1h"
	DefaultMarketplaceCatalogTimeout = "10s"
	// MarketplaceCatalogBaseURLEnv selects a runtime-only catalog source without persisting it.
	MarketplaceCatalogBaseURLEnv = "COMPOZY_MARKETPLACE_CATALOG_BASE_URL"
)
View Source
const (
	RoleFieldSourceDefault          = "default"
	RoleFieldSourceGlobal           = "global"
	RoleFieldSourceProfile          = "profile"
	RoleFieldSourceWorkspace        = "workspace"
	RoleFieldSourceWorkspaceProfile = "workspace_profile"
	RoleFieldEnabled                = "enabled"
	RoleFieldAgent                  = "agent"
	RoleFieldProvider               = "provider"
	RoleFieldModel                  = "model"
	RoleFieldReasoning              = "reasoning_effort"
	RoleFieldSpeed                  = "speed"
	RoleFieldACPOptions             = "acp_options"
	RoleFieldFallbacks              = "fallback_chain"
)
View Source
const (
	// DefaultCoordinatorTTL is the default TTL for [roles.coordinator].
	DefaultCoordinatorTTL = 2 * time.Hour
	// MinCoordinatorTTL is the shortest coordinator TTL accepted by config validation.
	MinCoordinatorTTL = time.Minute
	// MaxCoordinatorTTL is the longest coordinator TTL accepted by config validation.
	MaxCoordinatorTTL = 24 * time.Hour
	// DefaultCoordinatorMaxChildren is the safe per-coordinator child-session cap.
	DefaultCoordinatorMaxChildren = 5
	// MaxCoordinatorChildren is the hard MVP cap for coordinator child sessions.
	MaxCoordinatorChildren = 5
	// DefaultCoordinatorMaxActiveSessionsPerWorkspace caps managed coordinator and worker sessions.
	DefaultCoordinatorMaxActiveSessionsPerWorkspace = 5
)
View Source
const (
	// DefaultSessionAttachmentMaxFileBytes is the per-file admission ceiling.
	DefaultSessionAttachmentMaxFileBytes int64 = 10 << 20
	// DefaultSessionAttachmentMaxFilesPerPrompt is the per-prompt attachment count ceiling.
	DefaultSessionAttachmentMaxFilesPerPrompt = 10
	// DefaultSessionAttachmentRetentionMaxCount is the retained attachment count ceiling.
	DefaultSessionAttachmentRetentionMaxCount = 200
	// DefaultSessionAttachmentRetentionMaxBytes is the retained attachment byte ceiling.
	DefaultSessionAttachmentRetentionMaxBytes int64 = 1 << 30
	// DefaultSessionAttachmentRetentionMaxAge is the retained attachment age ceiling.
	DefaultSessionAttachmentRetentionMaxAge = 720 * time.Hour
)
View Source
const (
	SkillSourceCompozy = "compozy"
	SkillSourceAgents  = "agents"
	SkillSourceClaude  = "claude"
)
View Source
const (
	// MaxTaskOrchestrationRuntime is the largest accepted runtime watchdog budget.
	MaxTaskOrchestrationRuntime = 24 * time.Hour
	// DefaultTaskDesignatedRunMax is the default bounded sibling-run fan-out size.
	DefaultTaskDesignatedRunMax = 5
	// MaxTaskDesignatedRunMax is the largest accepted sibling-run fan-out size.
	MaxTaskDesignatedRunMax = 5
	// DefaultTaskMaxActiveRunsPerWorkspace bounds simultaneous task execution per workspace.
	DefaultTaskMaxActiveRunsPerWorkspace = 16
	// DefaultTaskNetworkStatusQueueSize is the default observer queue depth.
	DefaultTaskNetworkStatusQueueSize = 64
	// DefaultTaskNetworkStatusTimeout is the default per-event observer timeout.
	DefaultTaskNetworkStatusTimeout = 5 * time.Second

	TaskCoordinatorModeInherit = "inherit"
	TaskCoordinatorModeGuided  = "guided"
	TaskWorkerModeInherit      = "inherit"
	TaskSandboxModeInherit     = "inherit"
	TaskSandboxModeNone        = "none"
	TaskWorktreeModeInherit    = "inherit"
	TaskWorktreeModeNone       = "none"
	TaskWorktreeModeRef        = "ref"
	TaskWorktreeModePerRun     = "per_run"
	TaskReviewPolicyNone       = "none"
	TaskReviewPolicyOnSuccess  = "on_success"
	TaskReviewPolicyOnFailure  = "on_failure"
	TaskReviewPolicyAlways     = "always"
	TaskReviewFailureBlockTask = "block_task"
	TaskReviewFailureFailTask  = "fail_task"
)
View Source
const (
	DefaultTerminalScrollbackBytes        = 1 << 20
	DefaultTerminalDetachedTTL            = 24 * time.Hour
	DefaultTerminalExitRetention          = 15 * time.Minute
	DefaultTerminalRecordingRetentionDays = 30
	DefaultTerminalMaxPerWorkspace        = 8
	DefaultTerminalMaxPerDaemon           = 32
	DefaultTerminalMaxSubscribers         = 16
)
View Source
const (
	// DefaultToolsMaxResultBytes is the TechSpec default result budget for descriptors without one.
	DefaultToolsMaxResultBytes int64 = 256 << 10
	// MaxToolsMaxResultBytes bounds config-level default result budgets.
	MaxToolsMaxResultBytes int64 = 16 << 20

	// DefaultToolsApprovalTimeoutSeconds is the TechSpec default approval wait.
	DefaultToolsApprovalTimeoutSeconds = 120
	// MinToolsApprovalTimeoutSeconds is the smallest supported approval wait.
	MinToolsApprovalTimeoutSeconds = 1
	// MaxToolsApprovalTimeoutSeconds is the largest supported approval wait.
	MaxToolsApprovalTimeoutSeconds = 600

	// DefaultHostedMCPBindNonceTTLSeconds is the TechSpec default hosted MCP bind window.
	DefaultHostedMCPBindNonceTTLSeconds = 30
	// MinHostedMCPBindNonceTTLSeconds is the smallest supported hosted MCP bind window.
	MinHostedMCPBindNonceTTLSeconds = 1
	// MaxHostedMCPBindNonceTTLSeconds is the largest supported hosted MCP bind window.
	MaxHostedMCPBindNonceTTLSeconds = 300

	// DefaultToolsClarifyTimeout is the boot-snapshotted clarification wait.
	DefaultToolsClarifyTimeout = 5 * time.Minute
	// MinToolsClarifyTimeout is the smallest supported clarification wait.
	MinToolsClarifyTimeout = time.Second
	// MaxToolsClarifyTimeout is the largest supported clarification wait.
	MaxToolsClarifyTimeout = 24 * time.Hour

	// DefaultToolsArtifactMaxCount is the retained artifact count ceiling.
	DefaultToolsArtifactMaxCount = 200
	// DefaultToolsArtifactMaxBytes is the retained artifact byte ceiling.
	DefaultToolsArtifactMaxBytes int64 = 1 << 30
	// DefaultToolsArtifactMaxAge is the retained artifact age ceiling.
	DefaultToolsArtifactMaxAge = 720 * time.Hour
)
View Source
const (
	WindowNewPolicyFloating    = "floating"
	WindowNewPolicyBesideFocus = "beside_focus"

	WindowSmallViewportStack  = "stack"
	WindowSmallViewportReject = "reject"

	WindowFocusClickDirectional = "click_directional"
	WindowFocusDirectional      = "directional"

	WindowDragAwayWindow = "window"
	WindowDragAwayGroup  = "group"

	WindowDesktopTransitionSlide     = "slide"
	WindowDesktopTransitionCrossfade = "crossfade"
	WindowDesktopTransitionInstant   = "instant"

	WindowBindingNone     = "none"
	WindowBindingReserved = "reserved"
	WindowBindingZoom     = "zoom"

	WindowDragModifierAlt     = "alt"
	WindowDragModifierControl = "control"
	WindowDragModifierMeta    = "meta"
	WindowDragModifierShift   = "shift"
	WindowDragModifierNone    = "none"
)
View Source
const (
	// AgentResourceKind is the canonical desired-state resource kind for agent definitions.
	AgentResourceKind resources.ResourceKind = "agent"
)
View Source
const (
	CmdPaletteFallbackAgent = "agent"
)
View Source
const DefaultDaemonMemoryReportInterval = 5 * time.Minute

DefaultDaemonMemoryReportInterval is the built-in process memory sampling cadence.

View Source
const DefaultDaemonSubprocessHealthEscalationThreshold = 3

DefaultDaemonSubprocessHealthEscalationThreshold is the number of consecutive failed health checks that escalates a task-bound session.

View Source
const DefaultMCPClientMetadataURL = "https://compozy.com/.well-known/mcp-client.json"

DefaultMCPClientMetadataURL is the public OAuth client identity used by MCP authorization.

View Source
const ExtensionDataDirName = "extension-data"

ExtensionDataDirName is the dedicated root for extension-owned runtime data.

View Source
const (
	// MCPJSONName is the supported JSON sidecar filename for MCP server declarations.
	MCPJSONName = "mcp.json"
)
View Source
const (
	// MCPServerResourceKind is the canonical desired-state resource kind for MCP server records.
	MCPServerResourceKind resources.ResourceKind = "mcp_server"
)
View Source
const ProfileLayerOrphanedCode = "config_profile_layer_orphaned"

Variables

View Source
var (
	// ErrMissingAgentFrontmatter reports a missing YAML frontmatter block in AGENT.md content.
	ErrMissingAgentFrontmatter = errors.New("config: missing YAML frontmatter")
	// ErrUnterminatedAgentFrontmatter reports an unterminated YAML frontmatter block in AGENT.md content.
	ErrUnterminatedAgentFrontmatter = errors.New("config: unterminated YAML frontmatter")
	// ErrBOMAgentFrontmatter reports a UTF-8 BOM before the YAML frontmatter block.
	ErrBOMAgentFrontmatter = errors.New("config: UTF-8 BOM before YAML frontmatter")
	// ErrInvalidAgentFrontmatterKey reports an unsupported frontmatter key shape.
	ErrInvalidAgentFrontmatterKey = errors.New("config: invalid YAML frontmatter key")
)
View Source
var (
	// ErrInvalidAgentDefinition marks validation failures while authoring an AGENT.md file.
	ErrInvalidAgentDefinition = errors.New("config: invalid agent definition")
	// ErrAgentDefinitionExists marks a create request that would overwrite an existing AGENT.md file.
	ErrAgentDefinitionExists = errors.New("config: agent definition already exists")
)
View Source
var (
	// ErrAgentDefinitionNotFound marks an authored definition that no longer exists.
	ErrAgentDefinitionNotFound = errors.New("config: agent definition not found")
)
View Source
var ErrAgentNameReserved = errors.New("config: agent name is reserved")

ErrAgentNameReserved marks attempts to author a catalog agent with a builtin identity.

View Source
var (
	// ErrDotEnvUnsupported reports that .env content could not be safely parsed
	// or repaired without risking user-owned intent.
	ErrDotEnvUnsupported = errors.New("config: unsupported .env content")
)
View Source
var ErrProviderUnavailable = errors.New("provider unavailable")

ErrProviderUnavailable reports that a requested provider cannot be resolved from the effective workspace/global config.

View Source
var ErrRuntimeModelRequired = errors.New("runtime model required")

ErrRuntimeModelRequired identifies providers that cannot resolve a model.

View Source
var ErrSandboxProfileNotFound = errors.New("sandbox profile not found")

ErrSandboxProfileNotFound reports a sandbox profile reference that is not configured.

View Source
var (
	// ErrUnsupportedTOMLMutation reports a mutation that would require rewriting
	// unrelated TOML structure instead of editing the targeted document fragment.
	ErrUnsupportedTOMLMutation = errors.New("config: unsupported TOML mutation")
)

Functions

func AgentCapabilityCatalogDependencyPaths

func AgentCapabilityCatalogDependencyPaths(agentDir string) (paths []string, err error)

AgentCapabilityCatalogDependencyPaths returns the filesystem inputs that can affect LoadAgentCapabilities for one agent directory.

func AgentDefinitionDigest

func AgentDefinitionDigest(agent AgentDef) (string, error)

AgentDefinitionDigest returns the canonical semantic digest used for update CAS.

func AgentLayerName

func AgentLayerName(source WorkspaceDiscoverySource) string

AgentLayerName returns the public layer label for a discovery source.

func ApplyConfigOverlayFile

func ApplyConfigOverlayFile(path string, dst *Config) error

ApplyConfigOverlayFile deep-merges an optional TOML config file into dst.

func ApplyMarketplaceCatalogEnvironment

func ApplyMarketplaceCatalogEnvironment(cfg *Config, getenv func(string) string)

ApplyMarketplaceCatalogEnvironment overlays the runtime catalog source without persisting it.

func BuiltinAgentNames

func BuiltinAgentNames() []string

BuiltinAgentNames returns the reserved runtime-owned identity names.

func BuiltinProviders

func BuiltinProviders() map[string]ProviderConfig

BuiltinProviders returns a deep copy of the built-in provider registry.

func CanonicalCapabilityDigest

func CanonicalCapabilityDigest(capability CapabilityDef) (string, error)

CanonicalCapabilityDigest computes the runtime-owned digest for one capability document after normalization.

func CanonicalProviderName

func CanonicalProviderName(name string) string

CanonicalProviderName resolves known builtin aliases to the stable provider id.

func CanonicalSkillSourcePath

func CanonicalSkillSourcePath(path string) string

CanonicalSkillSourcePath returns the normalized identity used by custom-source allocations.

func CloneProviderConfigs

func CloneProviderConfigs(providers map[string]ProviderConfig) map[string]ProviderConfig

CloneProviderConfigs returns a deep copy of a provider registry.

func CustomSourceSlugs

func CustomSourceSlugs(paths []string) map[string]string

CustomSourceSlugs allocates deterministic display slugs for a set of paths.

func DeleteAgentDefinition

func DeleteAgentDefinition(agentsRoot string, sourcePath string) (retErr error)

DeleteAgentDefinition removes one authored directory beneath an authorized agents root.

func EnsureBootstrapAgent

func EnsureBootstrapAgent(homePaths HomePaths) (string, bool, error)

EnsureBootstrapAgent creates the managed default agent definition if it does not already exist.

func EnsureHomeLayout

func EnsureHomeLayout(paths HomePaths) error

EnsureHomeLayout creates the directories required by the Compozy home layout.

func HookDeclarationOverlayValues

func HookDeclarationOverlayValues(decl hookspkg.HookDecl) map[string]any

HookDeclarationOverlayValues converts a hook declaration to TOML overlay values.

func HookDeclarations

func HookDeclarations(hooksCfg HooksConfig, agents []AgentDef) ([]hookspkg.HookDecl, error)

HookDeclarations returns normalized config and agent-definition hook declarations for registry consumption.

func IsReservedAgentName

func IsReservedAgentName(name string) bool

IsReservedAgentName reports whether a catalog name collides with a builtin identity.

func LoadHookDeclarationsFile

func LoadHookDeclarationsFile(path string) ([]hookspkg.HookDecl, error)

LoadHookDeclarationsFile reads config-backed hooks from one concrete overlay without merging declarations from any other config layer.

func NewAgentResourceCodec

func NewAgentResourceCodec() (resources.KindCodec[AgentDef], error)

NewAgentResourceCodec builds the canonical agent resource codec.

func NewMCPServerResourceCodec

func NewMCPServerResourceCodec() (resources.KindCodec[MCPServer], error)

NewMCPServerResourceCodec builds the canonical MCP server resource codec.

func NormalizeAgentName

func NormalizeAgentName(name string) string

NormalizeAgentName returns the canonical in-memory agent identity.

func NormalizeToolConfigValue

func NormalizeToolConfigValue(kind ValueKind, value any) (any, error)

NormalizeToolConfigValue coerces a JSON-decoded tool value into a supported TOML value.

func OverlayHookDeclarations

func OverlayHookDeclarations(target WriteTarget) ([]hookspkg.HookDecl, error)

OverlayHookDeclarations returns config-backed hook declarations from one overlay target.

func ParseDottedConfigPath

func ParseDottedConfigPath(raw string) ([]string, error)

ParseDottedConfigPath parses a user-facing dotted config path.

func RedactStringMap

func RedactStringMap(values map[string]string) map[string]string

RedactStringMap returns the same keys with all values replaced by the shared redaction placeholder.

func RedactedConfigMap

func RedactedConfigMap(cfg *Config) map[string]any

RedactedConfigMap converts config to the same redacted map shape used by operator-facing CLI output.

func RedactedValue

func RedactedValue() string

RedactedValue is the placeholder used when a public surface needs to reveal that a secret-bearing value exists without exposing the value itself.

func ResolveAgentName

func ResolveAgentName(name string, defaults DefaultsConfig) (string, error)

ResolveAgentName resolves an explicit session agent name or falls back to config defaults.

func ResolveHomeDir

func ResolveHomeDir() (string, error)

ResolveHomeDir resolves the global Compozy home directory, honoring COMPOZY_HOME when present.

func ResolveOperatorHomeDir

func ResolveOperatorHomeDir(homePaths HomePaths) (string, error)

ResolveOperatorHomeDir resolves the canonical operator user home directory for workspace defaults.

func ResolveOperatorHomeDirWithLookup

func ResolveOperatorHomeDirWithLookup(
	homePaths HomePaths,
	lookup func(string) (string, bool),
) (string, error)

ResolveOperatorHomeDirWithLookup resolves the canonical operator user home directory with injectable env lookup.

func ResolvePath

func ResolvePath(path string) (string, error)

ResolvePath expands `~`-prefixed paths and returns an absolute path.

func RoleMutableConfigKinds

func RoleMutableConfigKinds() map[string]ValueKind

RoleMutableConfigKinds returns the config-owned role mutation registry.

func SteerCapabilityValues

func SteerCapabilityValues() []string

func ValidGatewayConnectionName

func ValidGatewayConnectionName(name string) bool

ValidGatewayConnectionName reports whether name is safe for config, paths, and keyring identities.

func ValidateAgentName

func ValidateAgentName(name string) error

ValidateAgentName rejects names outside the canonical authored identity grammar.

func ValidateAuthoredAgentName

func ValidateAuthoredAgentName(name string) error

ValidateAuthoredAgentName rejects names that cannot be materialized in an agent catalog.

func ValidateCmdPaletteAlias

func ValidateCmdPaletteAlias(alias string) error

ValidateCmdPaletteAlias enforces the public alias grammar.

func ValidateConfigWriteScope

func ValidateConfigWriteScope(scope WriteScope, path []string) error

ValidateConfigWriteScope rejects paths that the selected runtime scope cannot consume.

func ValidateMCPClientMetadataURL

func ValidateMCPClientMetadataURL(path string, raw string) error

ValidateMCPClientMetadataURL enforces the public CIMD URL contract used by MCP OAuth.

func ValidateMCPOAuthURL

func ValidateMCPOAuthURL(path string, raw string) error

ValidateMCPOAuthURL enforces HTTPS for OAuth endpoints except on loopback hosts.

func ValidateMCPServerName

func ValidateMCPServerName(name string) error

ValidateMCPServerName enforces the identity grammar shared by settings and auth targets.

func ValidateMCPStdioEnvName

func ValidateMCPStdioEnvName(path string, name string, secret bool) error

ValidateMCPStdioEnvName enforces the runtime policy for one catalog or config env declaration.

func ValidateResourceProfileName

func ValidateResourceProfileName(name string) error

ValidateResourceProfileName validates a profile name used in discovery paths.

func ValidateSkillSources

func ValidateSkillSources(slugs []string) error

ValidateSkillSources rejects duplicates and slugs outside the curated table.

func WorkspaceDotEnvFile

func WorkspaceDotEnvFile(workspaceRoot string) string

WorkspaceDotEnvFile returns the .env file path for a resolved workspace root.

func WriteOverride

func WriteOverride(
	homePaths HomePaths,
	workspaceRoot string,
	target WriteTarget,
	path []string,
) (string, bool, error)

WriteOverride reports the highest-precedence file that still wins over a saved value.

Types

type ACPOptionSelection

type ACPOptionSelection = runtimeoption.Selection

ACPOptionSelection identifies one provider-advertised ACP option default. Exactly one of ValueID or BoolValue must be set.

func CloneACPOptionSelections

func CloneACPOptionSelections(selections []ACPOptionSelection) []ACPOptionSelection

CloneACPOptionSelections returns an independent copy of ACP option defaults.

func NormalizeACPOptionSelections

func NormalizeACPOptionSelections(selections []ACPOptionSelection) ([]ACPOptionSelection, error)

NormalizeACPOptionSelections validates, copies, and sorts ACP option defaults by ID.

type AgentDef

type AgentDef struct {
	Name                  string `json:"name"                       yaml:"name"                       toml:"name"`
	Provider              string `json:"provider,omitempty"         yaml:"provider"                   toml:"provider"`
	Command               string `json:"command,omitempty"          yaml:"command,omitempty"          toml:"command,omitempty"`
	Model                 string `json:"model,omitempty"            yaml:"model,omitempty"            toml:"model,omitempty"`
	ReasoningEffort       string `json:"reasoning_effort,omitempty" yaml:"reasoning_effort,omitempty" toml:"reasoning_effort,omitempty"`
	*AgentRuntimeDefaults ` yaml:",inline" toml:",inline"`
	Tools                 []string             `json:"tools,omitempty"            yaml:"tools,omitempty"            toml:"tools,omitempty"`
	Toolsets              []string             `json:"toolsets,omitempty"         yaml:"toolsets,omitempty"         toml:"toolsets,omitempty"`
	DenyTools             []string             `json:"deny_tools,omitempty"       yaml:"deny_tools,omitempty"       toml:"deny_tools,omitempty"`
	Permissions           string               `json:"permissions,omitempty"      yaml:"permissions,omitempty"      toml:"permissions,omitempty"`
	Skills                AgentSkillsConfig    `json:"skills,omitzero"            yaml:"skills,omitempty"           toml:"skills,omitempty"`
	CategoryPath          []string             `json:"category_path,omitempty"    yaml:"category_path,omitempty"    toml:"category_path,omitempty"`
	MCPServers            []MCPServer          `json:"mcp_servers,omitempty"      yaml:"mcp_servers,omitempty"      toml:"mcp_servers,omitempty"`
	Hooks                 []hookspkg.HookDecl  `json:"hooks,omitempty"            yaml:"hooks,omitempty"            toml:"hooks,omitempty"`
	Capabilities          *CapabilityCatalog   `json:"capabilities,omitempty"     yaml:"-"                          toml:"-"`
	Prompt                string               `json:"prompt,omitempty"           yaml:"-"`
	SourcePath            string               `json:"-"                          yaml:"-"                          toml:"-"`
	SourceLayer           string               `json:"-"                          yaml:"-"                          toml:"-"`
	ShadowedDefinitions   []AgentDefinitionRef `json:"-"                          yaml:"-"                          toml:"-"`
}

AgentDef is the parsed representation of an AGENT.md file.

func BuiltinAgentDef

func BuiltinAgentDef(name string) (AgentDef, bool)

BuiltinAgentDef returns a detached copy of a runtime-owned agent definition.

func CloneAgentDef

func CloneAgentDef(agent AgentDef) AgentDef

CloneAgentDef returns a normalized deep copy of an agent definition.

func CreateAgentDefFile

func CreateAgentDefFile(path string, draft AgentDefinitionDraft, overwrite bool) (AgentDef, error)

CreateAgentDefFile renders, validates, and persists one AGENT.md definition.

func DuplicateAgentDefinition

func DuplicateAgentDefinition(
	source AgentDef,
	targetDir string,
	draft AgentDefinitionDraft,
) (agent AgentDef, err error)

DuplicateAgentDefinition clones one complete authored directory into a new target directory.

func EditAgentDefFile

func EditAgentDefFile(path string, mutate func(*AgentDef) error) (agent AgentDef, err error)

EditAgentDefFile rewrites one AGENT.md frontmatter block while preserving the prompt body.

func LoadAgentDef

func LoadAgentDef(name string, homePaths HomePaths) (AgentDef, error)

LoadAgentDef loads an AGENT.md file from the configured Compozy home directory.

func LoadAgentDefFile

func LoadAgentDefFile(path string) (agent AgentDef, err error)

LoadAgentDefFile loads and parses an AGENT.md file from an explicit path.

func LoadWorkspaceAgentDefs

func LoadWorkspaceAgentDefs(
	rootDir string,
	additionalDirs []string,
	homePaths HomePaths,
	profileName string,
) ([]AgentDef, error)

LoadWorkspaceAgentDefs loads workspace-visible agents using project-profile, project, additional, profile, then global precedence.

func ParseAgentDef

func ParseAgentDef(content []byte) (AgentDef, error)

ParseAgentDef parses a Markdown file with YAML frontmatter into an AgentDef.

func RenderAgentDefinition

func RenderAgentDefinition(draft AgentDefinitionDraft) ([]byte, AgentDef, error)

RenderAgentDefinition renders a draft to AGENT.md bytes and validates by parsing the result.

func (AgentDef) ACPOptionsValue

func (a AgentDef) ACPOptionsValue() []ACPOptionSelection

ACPOptionsValue returns the authored typed ACP selections.

func (*AgentDef) SetACPOptions

func (a *AgentDef) SetACPOptions(selections []ACPOptionSelection)

SetACPOptions stores an ownership-safe authored selection set.

func (*AgentDef) SetSpeed

func (a *AgentDef) SetSpeed(value speedpkg.Speed)

SetSpeed stores one normalized authored speed.

func (AgentDef) SpeedValue

func (a AgentDef) SpeedValue() speedpkg.Speed

SpeedValue returns the authored speed without exposing compact pointer storage.

func (AgentDef) Validate

func (a AgentDef) Validate() error

Validate ensures the parsed agent definition is usable.

type AgentDefinitionDraft

type AgentDefinitionDraft struct {
	Name            string
	Provider        string
	Command         string
	Model           string
	ReasoningEffort string
	Speed           speedpkg.Speed
	ACPOptions      []ACPOptionSelection
	Tools           []string
	Toolsets        []string
	DenyTools       []string
	Permissions     string
	Skills          AgentSkillsConfig
	CategoryPath    []string
	MCPServers      []MCPServer
	Hooks           []hookspkg.HookDecl
	Prompt          string
}

AgentDefinitionDraft captures the simple AGENT.md fields supported by authoring surfaces.

func AgentDefinitionDraftFromDef

func AgentDefinitionDraftFromDef(agent AgentDef) AgentDefinitionDraft

AgentDefinitionDraftFromDef preserves every AGENT.md-authored field in a mutable draft.

type AgentDefinitionRef

type AgentDefinitionRef struct {
	Layer string
	Path  string
}

AgentDefinitionRef identifies one lower-precedence definition hidden by a winner.

type AgentOrigin

type AgentOrigin string

AgentOrigin identifies the authored root that owns an agent definition.

const (
	// AgentOriginGlobal identifies a definition stored under COMPOZY_HOME.
	AgentOriginGlobal AgentOrigin = "global"
	// AgentOriginWorkspace identifies a definition stored under a workspace or additional root.
	AgentOriginWorkspace AgentOrigin = "workspace"
)

func AgentOriginFor

func AgentOriginFor(home HomePaths, sourcePath string) (AgentOrigin, string)

AgentOriginFor classifies an AGENT.md source path and returns its workspace root when applicable.

type AgentRuntimeDefaults

type AgentRuntimeDefaults struct {
	Speed      speedpkg.Speed       `json:"speed,omitempty"       yaml:"speed,omitempty"       toml:"speed,omitempty"`
	ACPOptions []ACPOptionSelection `json:"acp_options,omitempty" yaml:"acp_options,omitempty" toml:"acp_options,omitempty"`
}

AgentRuntimeDefaults keeps optional speed and ACP selections compact while its embedded fields preserve the flat agent wire format.

type AgentSkillsConfig

type AgentSkillsConfig struct {
	Disabled []string `json:"disabled,omitempty" yaml:"disabled,omitempty" toml:"disabled,omitempty"`
}

AgentSkillsConfig captures agent-local skill policy stored in AGENT.md.

type AgentsConfig

type AgentsConfig struct {
	Soul      SoulConfig      `toml:"soul"`
	Heartbeat HeartbeatConfig `toml:"heartbeat"`
}

AgentsConfig holds authored agent context settings.

func (AgentsConfig) Validate

func (c AgentsConfig) Validate() error

Validate ensures authored agent context settings are internally consistent.

type AppConfig

type AppConfig struct {
	UpdateCheck         bool          `toml:"update_check"`
	UpdateCheckInterval time.Duration `toml:"update_check_interval"`
}

AppConfig controls desktop-app update checks.

func (AppConfig) Validate

func (c AppConfig) Validate() error

Validate ensures desktop update polling stays within the supported bounds.

type AttentionConfig

type AttentionConfig struct {
	Toasts bool `toml:"toasts"`
	Sound  bool `toml:"sound"`
	System bool `toml:"system"`
}

AttentionConfig controls operator-facing attention delivery.

func DefaultAttentionConfig

func DefaultAttentionConfig() AttentionConfig

DefaultAttentionConfig returns the built-in operator attention policy.

type AutomationConfig

type AutomationConfig struct {
	Enabled           bool                          `toml:"enabled"`
	Timezone          string                        `toml:"timezone,omitempty"`
	MaxConcurrentJobs int                           `toml:"max_concurrent_jobs"`
	DefaultFireLimit  automationpkg.FireLimitConfig `toml:"default_fire_limit"`
	Suggestions       AutomationSuggestionsConfig   `toml:"suggestions"`
	Jobs              []AutomationJob               `toml:"jobs,omitempty"`
	Triggers          []AutomationTrigger           `toml:"triggers,omitempty"`
}

AutomationConfig holds TOML-defined automation defaults, jobs, and triggers.

func (AutomationConfig) Validate

func (c AutomationConfig) Validate() error

Validate ensures the automation config is internally consistent.

type AutomationJob

type AutomationJob struct {
	Scope      automationpkg.Scope           `toml:"scope"`
	Name       string                        `toml:"name"`
	AgentName  string                        `toml:"agent"`
	Workspace  string                        `toml:"workspace,omitempty"`
	Prompt     string                        `toml:"prompt"`
	Schedule   automationpkg.ScheduleSpec    `toml:"schedule"`
	Task       *automationpkg.JobTaskConfig  `toml:"task,omitempty"`
	TargetKind automationpkg.TargetKind      `toml:"target_kind,omitempty"`
	LoopTarget *automationpkg.LoopTarget     `toml:"loop_target,omitempty"`
	Enabled    bool                          `toml:"enabled"`
	Retry      automationpkg.RetryConfig     `toml:"retry,omitempty"`
	FireLimit  automationpkg.FireLimitConfig `toml:"fire_limit,omitempty"`
	Source     automationpkg.JobSource       `toml:"-"`
}

AutomationJob holds a config-defined scheduled job before workspace resolution.

func (AutomationJob) Validate

func (j AutomationJob) Validate(path string) error

Validate ensures the config-defined job is internally consistent before runtime resolution.

type AutomationSuggestionsConfig

type AutomationSuggestionsConfig struct {
	PendingCap int `toml:"pending_cap"`
}

AutomationSuggestionsConfig controls consent-first suggestion emission.

type AutomationTrigger

type AutomationTrigger struct {
	Scope            automationpkg.Scope           `toml:"scope"`
	Name             string                        `toml:"name"`
	AgentName        string                        `toml:"agent"`
	Workspace        string                        `toml:"workspace,omitempty"`
	Prompt           string                        `toml:"prompt"`
	Event            string                        `toml:"event"`
	Filter           map[string]string             `toml:"filter,omitempty"`
	TargetKind       automationpkg.TargetKind      `toml:"target_kind,omitempty"`
	LoopTarget       *automationpkg.LoopTarget     `toml:"loop_target,omitempty"`
	Enabled          bool                          `toml:"enabled"`
	Retry            automationpkg.RetryConfig     `toml:"retry,omitempty"`
	FireLimit        automationpkg.FireLimitConfig `toml:"fire_limit,omitempty"`
	Source           automationpkg.JobSource       `toml:"-"`
	EndpointSlug     string                        `toml:"endpoint_slug,omitempty"`
	WebhookSecretRef string                        `toml:"webhook_secret_ref,omitempty"`
}

AutomationTrigger holds a config-defined trigger before workspace resolution.

func (AutomationTrigger) Validate

func (t AutomationTrigger) Validate(path string) error

Validate ensures the config-defined trigger is internally consistent before runtime resolution.

type AutonomyConfig

type AutonomyConfig struct {
	BlockRecurrenceLimit int             `toml:"block_recurrence_limit"`
	Scheduler            SchedulerConfig `toml:"scheduler"`
}

AutonomyConfig controls opt-in autonomy features.

func (AutonomyConfig) Validate

func (c AutonomyConfig) Validate() error

Validate ensures autonomy config is internally consistent.

type CapabilityBrief

type CapabilityBrief struct {
	ID      string `json:"id"      toml:"id"`
	Summary string `json:"summary" toml:"summary"`
}

CapabilityBrief is the compact discovery projection for one capability.

type CapabilityCatalog

type CapabilityCatalog struct {
	Capabilities []CapabilityDef `json:"capabilities" toml:"capabilities"`
}

CapabilityCatalog is the normalized local catalog loaded from one agent directory.

func LoadAgentCapabilities

func LoadAgentCapabilities(agentDir string) (catalog *CapabilityCatalog, err error)

LoadAgentCapabilities loads the optional capability catalog for one agent directory. When no supported capability catalog exists, it returns nil without error.

func (*CapabilityCatalog) Clone

Clone returns a deep copy of the catalog.

type CapabilityDef

type CapabilityDef struct {
	ID                string   `json:"id"                     toml:"id"`
	Summary           string   `json:"summary"                toml:"summary"`
	Outcome           string   `json:"outcome"                toml:"outcome"`
	Version           string   `json:"version,omitempty"      toml:"version,omitempty"`
	ContextNeeded     []string `json:"context_needed"         toml:"context_needed"`
	ArtifactsExpected []string `json:"artifacts_expected"     toml:"artifacts_expected"`
	ExecutionOutline  []string `json:"execution_outline"      toml:"execution_outline"`
	Constraints       []string `json:"constraints"            toml:"constraints"`
	Examples          []string `json:"examples"               toml:"examples"`
	Requirements      []string `json:"requirements,omitempty" toml:"requirements,omitempty"`
	Digest            string   `json:"-"                      toml:"-"`
}

CapabilityDef is one normalized, outcome-oriented capability declaration for an agent.

type CmdPaletteConfig

type CmdPaletteConfig struct {
	FallbackTargets []string          `toml:"fallback_targets"`
	Personalization bool              `toml:"personalization"`
	Aliases         map[string]string `toml:"aliases,omitempty"`
}

CmdPaletteConfig controls command-palette behavior and workspace vocabulary.

func ApplyCmdPaletteOverlayFile

func ApplyCmdPaletteOverlayFile(path string, defaults CmdPaletteConfig) (CmdPaletteConfig, error)

ApplyCmdPaletteOverlayFile applies the optional workspace [cmd_palette] overlay.

func CloneCmdPaletteConfig

func CloneCmdPaletteConfig(source CmdPaletteConfig) CmdPaletteConfig

CloneCmdPaletteConfig copies fallback targets and aliases without sharing maps.

func DefaultCmdPaletteConfig

func DefaultCmdPaletteConfig() CmdPaletteConfig

DefaultCmdPaletteConfig returns the shipped command-palette behavior.

func (CmdPaletteConfig) Validate

func (c CmdPaletteConfig) Validate() error

Validate rejects unsupported fallback targets and malformed aliases.

type Config

type Config struct {
	Daemon        DaemonConfig              `toml:"daemon"`
	HTTP          HTTPConfig                `toml:"http"`
	App           AppConfig                 `toml:"app"`
	Shell         ShellConfig               `toml:"shell"`
	Attention     AttentionConfig           `toml:"attention"`
	WindowManager WindowManagerConfig       `toml:"window_manager"`
	Terminal      TerminalConfig            `toml:"terminal"`
	CmdPalette    CmdPaletteConfig          `toml:"cmd_palette"`
	Defaults      DefaultsConfig            `toml:"defaults"`
	Agents        AgentsConfig              `toml:"agents"`
	Limits        LimitsConfig              `toml:"limits"`
	Session       SessionConfig             `toml:"session"`
	Permissions   PermissionsConfig         `toml:"permissions"`
	MCP           MCPConfig                 `toml:"mcp"`
	MCPServers    []MCPServer               `toml:"mcp_servers,omitempty"`
	Providers     map[string]ProviderConfig `toml:"providers"`
	ModelCatalog  ModelCatalogConfig        `toml:"model_catalog"`
	Marketplace   MarketplaceRuntimeConfig  `toml:"marketplace"`
	Sandboxes     map[string]SandboxProfile `toml:"sandboxes"`
	Observability ObservabilityConfig       `toml:"observability"`
	Log           LogConfig                 `toml:"log"`
	Redact        RedactConfig              `toml:"redact"`
	Memory        MemoryConfig              `toml:"memory"`
	Roles         RolesConfig               `toml:"roles"`
	RoleSources   RoleFieldSources          `toml:"-"                     json:"-"`
	Skills        SkillsConfig              `toml:"skills"`
	Extensions    ExtensionsConfig          `toml:"extensions"`
	Tools         ToolsConfig               `toml:"tools"`
	Automation    AutomationConfig          `toml:"automation"`
	Loops         LoopsConfig               `toml:"loops"`
	Goals         GoalsConfig               `toml:"goals"`
	Task          TaskConfig                `toml:"task"`
	Hooks         HooksConfig               `toml:"hooks"`
	Network       NetworkConfig             `toml:"network"`
	Gateway       GatewayConfig             `toml:"gateway"`
	Autonomy      AutonomyConfig            `toml:"autonomy"`
	Worktrees     WorktreesConfig           `toml:"worktrees"`
}

Config is the fully merged Compozy configuration.

func CloneConfig

func CloneConfig(source *Config) Config

CloneConfig returns an ownership-safe copy of the complete runtime configuration.

func DefaultWithHome

func DefaultWithHome(homePaths HomePaths) Config

func DeleteMCPSidecarServer

func DeleteMCPSidecarServer(
	homePaths HomePaths,
	workspaceRoot string,
	target WriteTarget,
	name string,
) (cfg Config, deleted bool, err error)

DeleteMCPSidecarServer removes one MCP server definition from the selected sidecar target when present and returns the merged effective config after validation.

func EditConfigOverlay

func EditConfigOverlay(
	homePaths HomePaths,
	workspaceRoot string,
	target WriteTarget,
	mutate func(*OverlayEditor) error,
) (Config, error)

EditConfigOverlay applies one validated mutation to a canonical TOML overlay target and returns the merged effective config after the write.

func Load

func Load(opts ...LoadOption) (Config, error)

Load reads defaults, global config, optional profile layers, and the optional workspace overlay. Workspace overlays are loaded only when WithWorkspaceRoot supplies an explicit root.

func LoadForHome

func LoadForHome(homePaths HomePaths, opts ...LoadOption) (Config, error)

LoadForHome reads defaults, global config, optional profile layers, and the optional workspace overlay using the supplied Compozy home layout instead of the ambient process home.

func LoadGlobalConfig

func LoadGlobalConfig(homePaths HomePaths) (Config, error)

LoadGlobalConfig loads only the user-global Compozy config from the resolved home.

func PutMCPSidecarServer

func PutMCPSidecarServer(
	homePaths HomePaths,
	workspaceRoot string,
	target WriteTarget,
	server MCPServer,
) (cfg Config, err error)

PutMCPSidecarServer upserts one MCP server definition in the selected sidecar target and returns the merged effective config after validation.

func SaveBootstrapConfig

func SaveBootstrapConfig(homePaths HomePaths, provider string, model string) (Config, error)

SaveBootstrapConfig writes the global bootstrap config managed by `compozy install`.

func (*Config) ResolveAgent

func (c *Config) ResolveAgent(agent AgentDef) (ResolvedAgent, error)

ResolveAgent resolves a parsed agent definition against provider config and global defaults.

func (*Config) ResolveProvider

func (c *Config) ResolveProvider(name string) (ProviderConfig, error)

ResolveProvider resolves a provider using the built-in registry and config overrides.

func (*Config) ResolveSandbox

func (c *Config) ResolveSandbox(ref string) (sandbox.Resolved, error)

ResolveSandbox resolves a named sandbox profile into runtime policy.

func (*Config) ResolveSessionAgent

func (c *Config) ResolveSessionAgent(agent AgentDef, providerOverride string) (ResolvedAgent, error)

ResolveSessionAgent resolves a parsed agent definition for one session. When providerOverride is set, the selected provider becomes canonical and provider-owned runtime fields are re-resolved from that provider to avoid mixed runtimes from the original agent definition.

func (*Config) ResolveSessionAgentWithRuntime

func (c *Config) ResolveSessionAgentWithRuntime(
	agent AgentDef,
	overrides RuntimeOverrides,
) (ResolvedAgent, error)

ResolveSessionAgentWithRuntime resolves one session agent with runtime-level overrides.

func (*Config) RoleFieldSource

func (c *Config) RoleFieldSource(role RoleName, field string) string

RoleFieldSource reports the winning config layer for one routed role field.

func (*Config) Validate

func (c *Config) Validate() error

Validate ensures the loaded configuration is internally consistent.

type CoordinatorRoleConfig

type CoordinatorRoleConfig struct {
	RoleConfig
	TTL                           time.Duration `toml:"ttl"`
	MaxChildren                   int           `toml:"max_children"`
	MaxActiveSessionsPerWorkspace int           `toml:"max_active_sessions_per_workspace"`
}

CoordinatorRoleConfig combines routing with coordinator safety policy.

type DaemonConfig

type DaemonConfig struct {
	Socket                              string                     `toml:"socket"`
	MemoryReportInterval                time.Duration              `toml:"memory_report_interval"`
	SubprocessHealthEscalationThreshold int                        `toml:"subprocess_health_escalation_threshold"`
	ReloadTimeouts                      DaemonReloadTimeoutsConfig `toml:"reload_timeouts"`
}

DaemonConfig controls daemon-local socket, runtime reporting, and hot-reload settings.

func (DaemonConfig) Validate

func (c DaemonConfig) Validate() error

Validate ensures daemon config values are internally consistent.

type DaemonReloadTimeoutsConfig

type DaemonReloadTimeoutsConfig struct {
	Providers time.Duration `toml:"providers"`
	MCP       time.Duration `toml:"mcp"`
	Bridges   time.Duration `toml:"bridges"`
}

DaemonReloadTimeoutsConfig bounds subsystem reload attempts during config apply.

func DefaultDaemonReloadTimeoutsConfig

func DefaultDaemonReloadTimeoutsConfig() DaemonReloadTimeoutsConfig

DefaultDaemonReloadTimeoutsConfig returns daemon hot-reload timeout defaults.

func (DaemonReloadTimeoutsConfig) Validate

func (c DaemonReloadTimeoutsConfig) Validate() error

Validate ensures daemon reload timeout values stay within bounded retry budgets.

type DaytonaProfile

type DaytonaProfile struct {
	APIURL      string `toml:"api_url,omitempty"`
	Target      string `toml:"target,omitempty"`
	Image       string `toml:"image,omitempty"`
	Snapshot    string `toml:"snapshot,omitempty"`
	Class       string `toml:"class,omitempty"`
	AutoStop    string `toml:"auto_stop,omitempty"`
	AutoArchive string `toml:"auto_archive,omitempty"`
}

DaytonaProfile defines Daytona-specific execution sandbox settings.

func (DaytonaProfile) Resolve

func (p DaytonaProfile) Resolve() sandbox.DaytonaConfig

Resolve converts Daytona profile inputs into provider startup policy.

type DefaultsConfig

type DefaultsConfig struct {
	Agent    string `toml:"agent"`
	Provider string `toml:"provider,omitempty"`
	Sandbox  string `toml:"sandbox,omitempty"`
}

DefaultsConfig holds global runtime defaults.

func (DefaultsConfig) Validate

func (c DefaultsConfig) Validate() error

Validate ensures the default agent setting is present and valid.

type DiffEntry

type DiffEntry struct {
	Path           string `json:"path"`
	Before         any    `json:"before,omitempty"`
	After          any    `json:"after,omitempty"`
	BeforeRedacted bool   `json:"before_redacted,omitempty"`
	AfterRedacted  bool   `json:"after_redacted,omitempty"`
}

DiffEntry describes one redacted effective config difference.

func DiffConfigEntries

func DiffConfigEntries(before []Entry, after []Entry) []DiffEntry

DiffConfigEntries returns sorted redacted differences between two effective entry sets.

type DotEnvDiagnostic

type DotEnvDiagnostic struct {
	Line    int    `json:"line,omitempty"`
	Key     string `json:"key,omitempty"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

DotEnvDiagnostic describes one .env parse or repair issue without exposing values.

type DotEnvRepairError

type DotEnvRepairError struct {
	Path        string
	Diagnostics []DotEnvDiagnostic
}

DotEnvRepairError carries structured diagnostics for unsupported .env content.

func (*DotEnvRepairError) Error

func (e *DotEnvRepairError) Error() string

Error returns a diagnostic summary without including .env values.

func (*DotEnvRepairError) Is

func (e *DotEnvRepairError) Is(target error) bool

Is matches the unsupported .env sentinel.

type DotEnvRepairReport

type DotEnvRepairReport struct {
	Path        string             `json:"path"`
	Status      string             `json:"status"`
	Repaired    bool               `json:"repaired"`
	Diagnostics []DotEnvDiagnostic `json:"diagnostics,omitempty"`
}

DotEnvRepairReport summarizes .env inspection or repair without including values.

func InspectDotEnvFile

func InspectDotEnvFile(path string) (DotEnvRepairReport, error)

InspectDotEnvFile parses one .env file and reports whether explicit repair is possible.

func RepairDotEnvFile

func RepairDotEnvFile(path string) (report DotEnvRepairReport, err error)

RepairDotEnvFile safely rewrites one .env file when every change is bounded and structured.

type DreamConfig

type DreamConfig struct {
	MinHours      float64                  `toml:"min_hours"`
	MinSessions   int                      `toml:"min_sessions"`
	Debounce      time.Duration            `toml:"debounce"`
	PromptVersion string                   `toml:"prompt_version"`
	CheckInterval time.Duration            `toml:"check_interval"`
	Gates         MemoryDreamGatesConfig   `toml:"gates"`
	Scoring       MemoryDreamScoringConfig `toml:"scoring"`
}

DreamConfig controls background dream consolidation.

func (DreamConfig) Validate

func (c DreamConfig) Validate() error

Validate ensures the dream configuration is internally consistent.

type Entry

type Entry struct {
	Path     string `json:"path"`
	Value    any    `json:"value"`
	Redacted bool   `json:"redacted"`
}

Entry is one flattened, redacted effective config value.

func EntryByPath

func EntryByPath(entries []Entry, path string) (Entry, bool)

EntryByPath returns one flattened entry.

func FlattenConfigEntries

func FlattenConfigEntries(configMap map[string]any) []Entry

FlattenConfigEntries returns deterministic flattened config entries.

type ExtensionsConfig

type ExtensionsConfig struct {
	Trust     ExtensionsTrustConfig     `toml:"trust"`
	Sources   ExtensionsSourcesConfig   `toml:"sources"`
	Dev       ExtensionsDevConfig       `toml:"dev"`
	Resources ExtensionsResourcesConfig `toml:"resources,omitempty"`
}

ExtensionsConfig controls extension trust, sources, development, and resource policy.

func (ExtensionsConfig) Validate

func (c ExtensionsConfig) Validate() error

Validate ensures the extension configuration is internally consistent.

type ExtensionsDevConfig

type ExtensionsDevConfig struct {
	WatchInterval time.Duration `toml:"watch_interval"`
}

ExtensionsDevConfig controls the CLI-side extension development loop.

func (ExtensionsDevConfig) Validate

func (c ExtensionsDevConfig) Validate() error

Validate ensures the extension dev-loop interval is usable.

type ExtensionsGitHubSourceConfig

type ExtensionsGitHubSourceConfig struct {
	Enabled bool   `toml:"enabled"`
	BaseURL string `toml:"base_url"`
}

ExtensionsGitHubSourceConfig controls the GitHub extension source.

func (ExtensionsGitHubSourceConfig) Validate

func (c ExtensionsGitHubSourceConfig) Validate() error

Validate ensures the GitHub extension source is internally consistent.

type ExtensionsGitSourceConfig

type ExtensionsGitSourceConfig struct {
	Enabled bool `toml:"enabled"`
}

ExtensionsGitSourceConfig controls direct Git extension installs.

type ExtensionsResourceRateLimitConfig

type ExtensionsResourceRateLimitConfig struct {
	Requests int           `toml:"requests"`
	Window   time.Duration `toml:"window"`
	Queue    int           `toml:"queue"`
}

ExtensionsResourceRateLimitConfig controls one resource publication rate-limit bucket.

func (ExtensionsResourceRateLimitConfig) Validate

Validate ensures one configured resource rate-limit bucket is internally consistent.

type ExtensionsResourcesConfig

type ExtensionsResourcesConfig struct {
	AllowedKinds           []resources.ResourceKind          `toml:"allowed_kinds,omitempty"`
	MaxScope               resources.ResourceScopeKind       `toml:"max_scope,omitempty"`
	SnapshotRateLimit      ExtensionsResourceRateLimitConfig `toml:"snapshot_rate_limit,omitempty"`
	OperatorWriteRateLimit ExtensionsResourceRateLimitConfig `toml:"operator_write_rate_limit,omitempty"`
}

ExtensionsResourcesConfig controls resource publication policy for extensions.

func (ExtensionsResourcesConfig) Validate

func (c ExtensionsResourcesConfig) Validate() error

Validate ensures the extension resource policy is internally consistent.

type ExtensionsSourcesConfig

type ExtensionsSourcesConfig struct {
	GitHub ExtensionsGitHubSourceConfig `toml:"github"`
	Git    ExtensionsGitSourceConfig    `toml:"git"`
}

ExtensionsSourcesConfig controls published extension source availability.

type ExtensionsTrustConfig

type ExtensionsTrustConfig struct {
	AllowUnverified bool `toml:"allow_unverified"`
}

ExtensionsTrustConfig controls operator policy for unverified published extensions.

type FileError

type FileError struct {
	Op   string
	Path string
	Err  error
}

FileError preserves the source file for configuration read/decode failures.

func (FileError) Error

func (e FileError) Error() string

func (FileError) Unwrap

func (e FileError) Unwrap() error

type GatewayAuthConfig

type GatewayAuthConfig struct {
	RateLimit GatewayAuthRateLimitConfig `toml:"rate_limit"`
}

GatewayAuthConfig groups device authentication controls.

type GatewayAuthRateLimitConfig

type GatewayAuthRateLimitConfig struct {
	Window   time.Duration `toml:"window"`
	MaxFails int           `toml:"max_fails"`
}

GatewayAuthRateLimitConfig bounds failed authentication attempts by source.

type GatewayConfig

type GatewayConfig struct {
	Enabled          bool                      `toml:"enabled"`
	PrivatePort      int                       `toml:"private_port"`
	PublicPort       int                       `toml:"public_port"`
	ActiveConnection string                    `toml:"active_connection,omitempty"`
	Connections      []GatewayConnectionConfig `toml:"connections,omitempty"`
	Pairing          GatewayPairingConfig      `toml:"pairing"`
	StreamTicket     GatewayStreamTicketConfig `toml:"stream_ticket"`
	Auth             GatewayAuthConfig         `toml:"auth"`
	Verify           GatewayVerifyConfig       `toml:"verify"`

	CredentialsDir string `toml:"-" json:"-"`
}

GatewayConfig controls the local gateway ceiling and runtime tunables. Durable exposure intent lives in the global database, never in this config.

func (GatewayConfig) Validate

func (c GatewayConfig) Validate() error

Validate ensures every gateway tunable is safe and bounded.

type GatewayConnectionConfig

type GatewayConnectionConfig struct {
	Name             string `toml:"name"`
	Scheme           string `toml:"scheme"`
	Host             string `toml:"host"`
	Port             int    `toml:"port"`
	CredentialFile   string `toml:"credential_file,omitempty"`
	DefaultWorkspace string `toml:"default_workspace,omitempty"`
	RemoteHome       string `toml:"remote_home,omitempty"`
}

GatewayConnectionConfig is non-secret metadata for one client-side connection profile.

func (GatewayConnectionConfig) Validate

func (c GatewayConnectionConfig) Validate() error

Validate ensures a connection profile is safe to resolve from operator-global config.

type GatewayPairingConfig

type GatewayPairingConfig struct {
	TTL        time.Duration `toml:"ttl"`
	MaxPending int           `toml:"max_pending"`
}

GatewayPairingConfig bounds pending, short-lived pairing artifacts.

type GatewayStreamTicketConfig

type GatewayStreamTicketConfig struct {
	TTL time.Duration `toml:"ttl"`
}

GatewayStreamTicketConfig controls single-use stream ticket lifetime.

type GatewayVerifyConfig

type GatewayVerifyConfig struct {
	Timeout           time.Duration `toml:"timeout"`
	PublicDNSResolver string        `toml:"public_dns_resolver"`
}

GatewayVerifyConfig bounds provider endpoint verification.

type GoalsConfig

type GoalsConfig struct {
	MaxTurns           int           `toml:"max_turns"`
	ContextNudgeRatio  float64       `toml:"context_nudge_ratio"`
	OutboxBatchSize    int           `toml:"outbox_batch_size"`
	OutboxPollInterval time.Duration `toml:"outbox_poll_interval"`
}

GoalsConfig controls defaults applied to newly started Goal runs.

func DefaultGoalsConfig

func DefaultGoalsConfig() GoalsConfig

DefaultGoalsConfig returns the built-in Goal defaults.

func (GoalsConfig) Validate

func (c GoalsConfig) Validate() error

Validate enforces Goal default bounds without changing explicit values.

type HTTPConfig

type HTTPConfig struct {
	Host string `toml:"host"`
	Port int    `toml:"port"`
}

HTTPConfig controls the HTTP server bind address.

func (HTTPConfig) Validate

func (c HTTPConfig) Validate() error

Validate ensures the HTTP bind settings are valid.

type HeartbeatConfig

type HeartbeatConfig struct {
	Enabled                      bool          `toml:"enabled"`
	MaxBodyBytes                 int64         `toml:"max_body_bytes"`
	ContextProjectionBytes       int64         `toml:"context_projection_bytes"`
	MinInterval                  time.Duration `toml:"min_interval"`
	DefaultInterval              time.Duration `toml:"default_interval"`
	WakeCooldown                 time.Duration `toml:"wake_cooldown"`
	MaxWakesPerCycle             int           `toml:"max_wakes_per_cycle"`
	ActiveSessionOnly            bool          `toml:"active_session_only"`
	AllowActiveHoursPreferences  bool          `toml:"allow_active_hours_preferences"`
	WakeEventRetention           time.Duration `toml:"wake_event_retention"`
	SessionHealthStaleAfter      time.Duration `toml:"session_health_stale_after"`
	SessionHealthHookMinInterval time.Duration `toml:"session_health_hook_min_interval"`
}

HeartbeatConfig controls optional HEARTBEAT.md wake-policy parsing and runtime bounds.

func DefaultHeartbeatConfig

func DefaultHeartbeatConfig() HeartbeatConfig

DefaultHeartbeatConfig returns built-in Agent Heartbeat wake-policy limits.

func (HeartbeatConfig) Validate

func (c HeartbeatConfig) Validate() error

Validate ensures HEARTBEAT.md limits and timing bounds are internally consistent.

type HomePaths

type HomePaths struct {
	OperatorHomeDir       string
	HomeDir               string
	ConfigFile            string
	AgentsDir             string
	SkillsDir             string
	LoopsDir              string
	ProfilesDir           string
	DefaultProfileDir     string
	MemoryDir             string
	SessionsDir           string
	ToolArtifactsDir      string
	SessionAttachmentsDir string
	RestartsDir           string
	LogsDir               string
	GatewayDir            string
	GatewayCredentialsDir string
	ExtensionDataRoot     string
	BinDir                string
	LogFile               string
	NetworkAuditFile      string
	AppStateFile          string
	UpdateOperationFile   string
	UpdateOperationLock   string
	UpdateHistoryFile     string
	DesktopProvenanceFile string
	DatabaseFile          string
	DaemonSocket          string
	DaemonLock            string
	DaemonInfo            string
}

HomePaths captures the filesystem layout for the Compozy home directory.

func ResolveHomePaths

func ResolveHomePaths() (HomePaths, error)

ResolveHomePaths resolves the canonical Compozy home layout.

func ResolveHomePathsForWorkspace

func ResolveHomePathsForWorkspace(workspaceRoot string) (HomePaths, error)

ResolveHomePathsForWorkspace resolves the canonical Compozy home layout while honoring COMPOZY_HOME from the supplied workspace .env when the process env omits it.

func ResolveHomePathsFrom

func ResolveHomePathsFrom(homeDir string) (HomePaths, error)

ResolveHomePathsFrom resolves the canonical Compozy home layout from an explicit directory.

func (HomePaths) ExtensionDataPath

func (p HomePaths) ExtensionDataPath(
	name string,
	workspaceID string,
	profileID string,
) (string, error)

ExtensionDataPath returns the deterministic data path for one extension instance, optionally partitioned by workspace and stable profile id.

type HooksConfig

type HooksConfig struct {
	Declarations []hookspkg.HookDecl `toml:"declarations,omitempty"`
}

HooksConfig holds config-defined hook declarations.

func (HooksConfig) Validate

func (c HooksConfig) Validate() error

Validate ensures the hook declarations are internally consistent.

type LimitsConfig

type LimitsConfig struct {
	MaxConcurrentAgents int `toml:"max_concurrent_agents"`
}

LimitsConfig defines runtime safety bounds.

func (LimitsConfig) Validate

func (c LimitsConfig) Validate() error

Validate ensures the configured limits are positive.

type LoadOption

type LoadOption func(*loadOptions)

LoadOption customizes configuration loading.

func WithProfile

func WithProfile(name string) LoadOption

WithProfile loads the personal and workspace layers bound to one active profile name.

func WithWorkspaceRoot

func WithWorkspaceRoot(root string) LoadOption

WithWorkspaceRoot loads the optional workspace overlay from `<root>/.compozy/config.toml`. When omitted, Load applies only the built-in defaults and the global Compozy home config.

func WithoutWorkspaceOverlayFiles

func WithoutWorkspaceOverlayFiles() LoadOption

WithoutWorkspaceOverlayFiles keeps workspace environment lookup while omitting workspace config files.

type LogConfig

type LogConfig struct {
	Level           string `toml:"level"`
	MaxSizeMB       int    `toml:"max_size_mb"`
	MaxBackups      int    `toml:"max_backups"`
	MaxAgeDays      int    `toml:"max_age_days"`
	CompressBackups bool   `toml:"compress_backups"`
}

LogConfig controls structured logging.

func (LogConfig) Validate

func (c LogConfig) Validate() error

Validate ensures the log level is supported.

type LoopAdmissionDefaultConfig

type LoopAdmissionDefaultConfig struct {
	TombstoneHorizon string `toml:"tombstone_horizon"`
}

LoopAdmissionDefaultConfig controls watch admission tombstone retention.

type LoopAutopauseRule

type LoopAutopauseRule struct {
	Match  string `toml:"match"`
	Action string `toml:"action"`
}

LoopAutopauseRule is one ordered first-match-wins pause rule.

type LoopBreakerConfig

type LoopBreakerConfig struct {
	Threshold     int    `toml:"threshold"`
	ProbeInterval string `toml:"probe_interval"`
}

LoopBreakerConfig is the daemon-global target breaker policy.

type LoopBudgetDefaultConfig

type LoopBudgetDefaultConfig struct {
	Tokens       int    `toml:"tokens"`
	WallClockSec int    `toml:"wall_clock_sec"`
	OnExceeded   string `toml:"on_exceeded"`
}

LoopBudgetDefaultConfig controls loop budget defaults.

func (LoopBudgetDefaultConfig) Validate

func (c LoopBudgetDefaultConfig) Validate(path string) error

Validate enforces SET budget semantics before config writes are persisted.

type LoopDefaultConfig

type LoopDefaultConfig struct {
	IterationCap    int                         `toml:"iteration_cap"`
	NoProgress      LoopNoProgressDefaultConfig `toml:"no_progress"`
	Gates           LoopGatesDefaultConfig      `toml:"gates"`
	Budget          LoopBudgetDefaultConfig     `toml:"budget"`
	RuntimeDefaults dsl.RuntimeDefaults         `toml:"runtime_defaults"`
	RuntimeRules    []dsl.RuntimeRule           `toml:"runtime_rules"`
	FanOutWidth     int                         `toml:"fan_out_width"`
	Retry           LoopRetryDefaultConfig      `toml:"retry"`
	Liveness        LoopLivenessDefaultConfig   `toml:"liveness"`
	Resume          LoopResumeDefaultConfig     `toml:"resume"`
	Predicates      LoopPredicateDefaultConfig  `toml:"predicates"`
	Waits           LoopWaitDefaultConfig       `toml:"waits"`
	Requests        LoopRequestsDefaultConfig   `toml:"requests"`
	Admission       LoopAdmissionDefaultConfig  `toml:"admission"`
	Autopause       []LoopAutopauseRule         `toml:"autopause"`
}

LoopDefaultConfig is one `[loops.defaults.<kind>]` seed layer.

func (LoopDefaultConfig) Validate

func (c LoopDefaultConfig) Validate(path string) error

Validate enforces one loop default section without clamping operator input.

type LoopGatesDefaultConfig

type LoopGatesDefaultConfig struct {
	MaxRevisions int `toml:"max_revisions"`
}

LoopGatesDefaultConfig controls gate retry defaults.

type LoopInputDefaultSources

type LoopInputDefaultSources map[string]map[string]string

type LoopInputDefaults

type LoopInputDefaults map[string]map[string]any

LoopInputDefaults stores author-owned defaults by Loop name and declared input key. Values remain untyped until the named Loop definition is resolved.

type LoopLivenessDefaultConfig

type LoopLivenessDefaultConfig struct {
	SilenceWindow string `toml:"silence_window"`
}

LoopLivenessDefaultConfig controls evidence-based silence evaluation.

type LoopNoProgressDefaultConfig

type LoopNoProgressDefaultConfig struct {
	Window int `toml:"window"`
}

LoopNoProgressDefaultConfig controls generation-hash no-progress detection.

type LoopPredicateDefaultConfig

type LoopPredicateDefaultConfig struct {
	CostLimit uint64 `toml:"cost_limit"`
}

LoopPredicateDefaultConfig controls CEL evaluation cost.

type LoopRequestsDefaultConfig

type LoopRequestsDefaultConfig struct {
	ExpireAfter string `toml:"expire_after"`
}

LoopRequestsDefaultConfig controls the default lifetime of human requests.

type LoopResumeDefaultConfig

type LoopResumeDefaultConfig struct {
	DeathStreakLimit int `toml:"death_streak_limit"`
}

LoopResumeDefaultConfig controls bounded dead-session resume.

type LoopRetryDefaultConfig

type LoopRetryDefaultConfig struct {
	MaxAttempts int    `toml:"max_attempts"`
	BackoffBase string `toml:"backoff_base"`
	BackoffMax  string `toml:"backoff_max"`
}

LoopRetryDefaultConfig controls retry defaults for mechanical node families.

type LoopWaitDefaultConfig

type LoopWaitDefaultConfig struct {
	AdmissionAttempts      int    `toml:"admission_attempts"`
	AdmissionRetryInterval string `toml:"admission_retry_interval"`
}

LoopWaitDefaultConfig controls wait admission retries.

type LoopsConfig

type LoopsConfig struct {
	ReconcileInterval string              `toml:"reconcile_interval"`
	Defaults          LoopsDefaultsConfig `toml:"defaults"`
	Breaker           LoopBreakerConfig   `toml:"breaker"`
	Inputs            LoopInputDefaults   `toml:"inputs,omitempty"`
	// contains filtered or unexported fields
}

LoopsConfig holds global and workspace defaults used to seed new loop runs.

func DefaultLoopsConfig

func DefaultLoopsConfig() LoopsConfig

DefaultLoopsConfig returns the TechSpec `[loops.defaults.*]` layer.

func (*LoopsConfig) InputDefaultLayers

func (c *LoopsConfig) InputDefaultLayers(loopName string) (global map[string]any, workspace map[string]any)

InputDefaultLayers returns caller-owned global and workspace defaults for one Loop. The source map is recorded while overlays are applied; origin is never inferred from values.

func (*LoopsConfig) Validate

func (c *LoopsConfig) Validate() error

Validate enforces write-time loop default bounds.

type LoopsDefaultsConfig

type LoopsDefaultsConfig struct {
	Delivery LoopDefaultConfig `toml:"delivery"`
	Watch    LoopDefaultConfig `toml:"watch"`
}

LoopsDefaultsConfig separates delivery and watch loop seed defaults.

func (*LoopsDefaultsConfig) Validate

func (c *LoopsDefaultsConfig) Validate(path string) error

Validate enforces delivery and watch default bounds.

type MCPAuthConfig

type MCPAuthConfig struct {
	Registration    MCPAuthRegistration `json:"registration,omitempty"      yaml:"registration,omitempty"      toml:"registration,omitempty"`
	IssuerURL       string              `json:"issuer_url,omitempty"        yaml:"issuer_url,omitempty"        toml:"issuer_url,omitempty"`
	ClientID        string              `json:"client_id,omitempty"         yaml:"client_id,omitempty"         toml:"client_id,omitempty"`
	ClientSecretRef string              `json:"client_secret_ref,omitempty" yaml:"client_secret_ref,omitempty" toml:"client_secret_ref,omitempty"`
	Scopes          []string            `json:"scopes,omitempty"            yaml:"scopes,omitempty"            toml:"scopes,omitempty"`
}

MCPAuthConfig describes OAuth registration policy and optional pre-registered client values for a remote MCP server.

func (MCPAuthConfig) Enabled

func (a MCPAuthConfig) Enabled() bool

Enabled reports whether auth is configured.

func (MCPAuthConfig) IsZero

func (a MCPAuthConfig) IsZero() bool

IsZero reports whether the auth config is empty.

func (MCPAuthConfig) Validate

func (a MCPAuthConfig) Validate(path string) error

Validate ensures remote MCP OAuth configuration has enough metadata to run the authorization-code flow without placing token material in config files.

type MCPAuthRegistration

type MCPAuthRegistration string

MCPAuthRegistration identifies the OAuth client registration strategy.

const (
	// MCPAuthRegistrationAuto resolves CIMD before one dynamic-registration attempt.
	MCPAuthRegistrationAuto MCPAuthRegistration = "auto"
	// MCPAuthRegistrationPreRegistered uses issuer and client values declared by the operator.
	MCPAuthRegistrationPreRegistered MCPAuthRegistration = "pre_registered"
)

type MCPConfig

type MCPConfig struct {
	OAuth MCPOAuthConfig `toml:"oauth"`
}

MCPConfig controls global MCP client behavior.

func (MCPConfig) Validate

func (c MCPConfig) Validate() error

Validate ensures global MCP configuration is safe to use.

type MCPOAuthConfig

type MCPOAuthConfig struct {
	ClientMetadataURL string `toml:"client_metadata_url,omitempty"`
	RedirectURI       string `toml:"redirect_uri,omitempty"`
}

MCPOAuthConfig controls the Compozy MCP OAuth client identity.

func (MCPOAuthConfig) Validate

func (c MCPOAuthConfig) Validate(path string) error

Validate ensures global MCP OAuth client configuration is safe to use.

type MCPServer

type MCPServer struct {
	Name           string             `json:"name"                      yaml:"name"                      toml:"name"`
	Transport      MCPServerTransport `json:"transport,omitempty"       yaml:"transport,omitempty"       toml:"transport,omitempty"`
	Command        string             `json:"command,omitempty"         yaml:"command,omitempty"         toml:"command,omitempty"`
	CWD            string             `json:"cwd,omitempty"             yaml:"-"                         toml:"-"`
	Args           []string           `json:"args,omitempty"            yaml:"args,omitempty"            toml:"args,omitempty"`
	Env            map[string]string  `json:"env,omitempty"             yaml:"env,omitempty"             toml:"env,omitempty"`
	SecretEnv      map[string]string  `json:"secret_env,omitempty"      yaml:"secret_env,omitempty"      toml:"secret_env,omitempty"`
	URL            string             `json:"url,omitempty"             yaml:"url,omitempty"             toml:"url,omitempty"`
	Headers        map[string]string  `json:"headers,omitempty"         yaml:"headers,omitempty"         toml:"headers,omitempty"`
	SecretHeaders  map[string]string  `json:"secret_headers,omitempty"  yaml:"secret_headers,omitempty"  toml:"secret_headers,omitempty"`
	Auth           MCPAuthConfig      `json:"auth"                      yaml:"auth,omitempty"            toml:"auth,omitempty"`
	CatalogEntry   string             `json:"catalog_entry,omitempty"   yaml:"catalog_entry,omitempty"   toml:"catalog_entry,omitempty"`
	CatalogVersion string             `json:"catalog_version,omitempty" yaml:"catalog_version,omitempty" toml:"catalog_version,omitempty"`
}

MCPServer describes an MCP server passed through to the agent runtime.

func LoadMCPServersJSONFile

func LoadMCPServersJSONFile(path string) ([]MCPServer, error)

LoadMCPServersJSONFile parses an optional `mcp.json` file from disk. Missing files are treated as absent rather than as errors.

func MergeMCPServers

func MergeMCPServers(base []MCPServer, overlay []MCPServer) []MCPServer

MergeMCPServers merges provider-level and agent-level MCP servers by name.

func OverrideMCPServers

func OverrideMCPServers(base []MCPServer, overlay []MCPServer) []MCPServer

OverrideMCPServers overlays MCP servers by name, replacing the full server object on collision instead of field-merging it.

func ParseMCPServersJSON

func ParseMCPServersJSON(content []byte, source string) ([]MCPServer, error)

ParseMCPServersJSON parses an MCP JSON document into canonical MCP server values. The document may use either `mcpServers` or `mcp_servers` as the top-level key.

func RedactedMCPServer

func RedactedMCPServer(server MCPServer) MCPServer

RedactedMCPServer returns a server copy suitable for public API and CLI rendering. It preserves non-secret endpoint metadata and redacts env values.

func (MCPServer) EffectiveTransport

func (s MCPServer) EffectiveTransport() MCPServerTransport

EffectiveTransport returns the explicit transport or the compatibility default. Local command servers remain stdio; servers with a URL default to streamable HTTP.

func (MCPServer) Validate

func (s MCPServer) Validate(path string) error

Validate ensures the MCP server entry is usable.

type MCPServerTransport

type MCPServerTransport string

MCPServerTransport identifies how Compozy reaches an MCP server.

const (
	// MCPServerTransportStdio launches a local subprocess and talks MCP over stdio.
	MCPServerTransportStdio MCPServerTransport = "stdio"
	// MCPServerTransportHTTP talks to a remote streamable HTTP MCP endpoint.
	MCPServerTransportHTTP MCPServerTransport = "http"
)

func (MCPServerTransport) Validate

func (t MCPServerTransport) Validate(path string) error

Validate reports whether the transport is supported.

type MarketplaceCatalogConfig

type MarketplaceCatalogConfig struct {
	BaseURL string `toml:"base_url"`
	TTL     string `toml:"ttl"`
	Timeout string `toml:"timeout"`
}

MarketplaceCatalogConfig controls curated feed fetching and projection freshness.

func (MarketplaceCatalogConfig) EffectiveBaseURL

func (c MarketplaceCatalogConfig) EffectiveBaseURL() string

EffectiveBaseURL returns the configured feed base URL or the built-in default.

func (MarketplaceCatalogConfig) EffectiveTTL

func (c MarketplaceCatalogConfig) EffectiveTTL() string

EffectiveTTL returns the configured projection TTL or the built-in default.

func (MarketplaceCatalogConfig) EffectiveTimeout

func (c MarketplaceCatalogConfig) EffectiveTimeout() string

EffectiveTimeout returns the configured request timeout or the built-in default.

func (MarketplaceCatalogConfig) Validate

func (c MarketplaceCatalogConfig) Validate(path string) error

Validate reports whether the curated catalog fetch settings are usable.

type MarketplaceConfig

type MarketplaceConfig struct {
	Registry string `toml:"registry"`
	BaseURL  string `toml:"base_url,omitempty"`
}

MarketplaceConfig controls the external skill registry used by CLI skill commands.

func (MarketplaceConfig) Validate

func (c MarketplaceConfig) Validate() error

Validate ensures the marketplace configuration is internally consistent when configured.

type MarketplaceRuntimeConfig

type MarketplaceRuntimeConfig struct {
	Catalog MarketplaceCatalogConfig `toml:"catalog"`
}

MarketplaceRuntimeConfig contains shared curated-marketplace runtime settings.

func DefaultMarketplaceRuntimeConfig

func DefaultMarketplaceRuntimeConfig() MarketplaceRuntimeConfig

DefaultMarketplaceRuntimeConfig returns the curated catalog defaults.

func (MarketplaceRuntimeConfig) Validate

func (c MarketplaceRuntimeConfig) Validate() error

Validate reports whether the curated marketplace config is usable.

type MemoryConfig

type MemoryConfig struct {
	Enabled    bool                   `toml:"enabled"`
	GlobalDir  string                 `toml:"global_dir,omitempty"`
	Controller MemoryControllerConfig `toml:"controller"`
	Recall     MemoryRecallConfig     `toml:"recall"`
	Decisions  MemoryDecisionsConfig  `toml:"decisions"`
	Extractor  MemoryExtractorConfig  `toml:"extractor"`
	Dream      DreamConfig            `toml:"dream"`
	Session    MemorySessionConfig    `toml:"session"`
	Daily      MemoryDailyConfig      `toml:"daily"`
	File       MemoryFileConfig       `toml:"file"`
	Provider   MemoryProviderConfig   `toml:"provider"`
	Workspace  MemoryWorkspaceConfig  `toml:"workspace"`
}

MemoryConfig controls persistent memory features.

func CloneMemoryConfig

func CloneMemoryConfig(source *MemoryConfig) MemoryConfig

CloneMemoryConfig returns an ownership-safe copy of the memory configuration.

func DefaultMemoryConfig

func DefaultMemoryConfig(homePaths HomePaths) MemoryConfig

DefaultMemoryConfig returns opt-in persistent memory defaults.

func (*MemoryConfig) Validate

func (c *MemoryConfig) Validate() error

Validate ensures the memory configuration is internally consistent.

type MemoryControllerConfig

type MemoryControllerConfig struct {
	Mode            string                       `toml:"mode"`
	MaxLatency      time.Duration                `toml:"max_latency"`
	DefaultOpOnFail string                       `toml:"default_op_on_fail"`
	Policy          MemoryControllerPolicyConfig `toml:"policy"`
}

MemoryControllerConfig controls the durable write controller.

func (*MemoryControllerConfig) Validate

func (c *MemoryControllerConfig) Validate() error

Validate ensures the controller configuration is internally consistent.

type MemoryControllerPolicyConfig

type MemoryControllerPolicyConfig struct {
	MaxContentChars int      `toml:"max_content_chars"`
	MaxWritesPerMin int      `toml:"max_writes_per_min"`
	AllowOrigins    []string `toml:"allow_origins"`
}

MemoryControllerPolicyConfig controls controller safety limits.

func (*MemoryControllerPolicyConfig) Validate

func (c *MemoryControllerPolicyConfig) Validate() error

Validate ensures the controller policy configuration is internally consistent.

type MemoryControllerRoleConfig

type MemoryControllerRoleConfig struct {
	Enabled         bool                 `toml:"enabled"`
	Provider        string               `toml:"provider,omitempty"`
	Model           string               `toml:"model"`
	ReasoningEffort string               `toml:"reasoning_effort,omitempty"`
	Speed           speedpkg.Speed       `toml:"speed,omitempty"`
	ACPOptions      []ACPOptionSelection `toml:"acp_options,omitempty"`
	Timeout         time.Duration        `toml:"timeout"`
	TopK            int                  `toml:"top_k"`
	PromptVersion   string               `toml:"prompt_version"`
	MaxTokensOut    int                  `toml:"max_tokens_out"`
	FallbackChain   []RoleFallback       `toml:"fallback_chain,omitempty"`
}

MemoryControllerRoleConfig controls the in-process memory-controller model call.

type MemoryDailyConfig

type MemoryDailyConfig struct {
	MaxBytes        int64  `toml:"max_bytes"`
	MaxLines        int    `toml:"max_lines"`
	RotateFormat    string `toml:"rotate_format"`
	DreamingWindow  int    `toml:"dreaming_window"`
	ColdArchiveDays int    `toml:"cold_archive_days"`
	HardDeleteDays  int    `toml:"hard_delete_days"`
	MaxArchiveBytes int64  `toml:"max_archive_bytes"`
	SweepHour       int    `toml:"sweep_hour"`
	ArchivePath     string `toml:"archive_path"`
}

MemoryDailyConfig controls daily note retention and rotation.

func (MemoryDailyConfig) Validate

func (c MemoryDailyConfig) Validate() error

Validate ensures daily note settings are usable.

type MemoryDecisionsConfig

type MemoryDecisionsConfig struct {
	PruneAfterAppliedDays int   `toml:"prune_after_applied_days"`
	KeepAuditSummary      bool  `toml:"keep_audit_summary"`
	MaxPostContentBytes   int64 `toml:"max_post_content_bytes"`
}

MemoryDecisionsConfig controls Decision WAL retention and content caps.

func (MemoryDecisionsConfig) Validate

func (c MemoryDecisionsConfig) Validate() error

Validate ensures Decision WAL retention settings are usable.

type MemoryDreamGatesConfig

type MemoryDreamGatesConfig struct {
	MinUnpromoted  int     `toml:"min_unpromoted"`
	MinRecallCount int     `toml:"min_recall_count"`
	MinScore       float64 `toml:"min_score"`
}

MemoryDreamGatesConfig controls promotion gates for dreaming candidates.

func (MemoryDreamGatesConfig) Validate

func (c MemoryDreamGatesConfig) Validate() error

Validate ensures dreaming promotion gates are usable.

type MemoryDreamScoringConfig

type MemoryDreamScoringConfig struct {
	RecencyHalfLifeDays int                             `toml:"recency_half_life_days"`
	Weights             MemoryDreamScoringWeightsConfig `toml:"weights"`
}

MemoryDreamScoringConfig controls dreaming candidate scoring.

func (MemoryDreamScoringConfig) Validate

func (c MemoryDreamScoringConfig) Validate() error

Validate ensures dreaming scoring settings are usable.

type MemoryDreamScoringWeightsConfig

type MemoryDreamScoringWeightsConfig struct {
	Frequency float64 `toml:"frequency"`
	Relevance float64 `toml:"relevance"`
	Recency   float64 `toml:"recency"`
	Freshness float64 `toml:"freshness"`
}

MemoryDreamScoringWeightsConfig controls dreaming score factors.

func (MemoryDreamScoringWeightsConfig) Validate

Validate ensures dreaming scoring weights are usable.

type MemoryExtractorConfig

type MemoryExtractorConfig struct {
	Mode             string                     `toml:"mode"`
	ThrottleTurns    int                        `toml:"throttle_turns"`
	Deadline         time.Duration              `toml:"deadline"`
	SandboxInboxOnly bool                       `toml:"sandbox_inbox_only"`
	InboxPath        string                     `toml:"inbox_path"`
	DLQPath          string                     `toml:"dlq_path"`
	Queue            MemoryExtractorQueueConfig `toml:"queue"`
}

MemoryExtractorConfig controls the post-message extractor queue.

func (*MemoryExtractorConfig) Validate

func (c *MemoryExtractorConfig) Validate() error

Validate ensures extractor settings are internally consistent.

type MemoryExtractorQueueConfig

type MemoryExtractorQueueConfig struct {
	Capacity    int `toml:"capacity"`
	CoalesceMax int `toml:"coalesce_max"`
}

MemoryExtractorQueueConfig controls bounded extractor work.

func (MemoryExtractorQueueConfig) Validate

func (c MemoryExtractorQueueConfig) Validate() error

Validate ensures extractor queue settings are usable.

type MemoryFileConfig

type MemoryFileConfig struct {
	MaxLines int   `toml:"max_lines"`
	MaxBytes int64 `toml:"max_bytes"`
}

MemoryFileConfig controls individual memory file limits.

func (MemoryFileConfig) Validate

func (c MemoryFileConfig) Validate() error

Validate ensures memory file limits are usable.

type MemoryProviderConfig

type MemoryProviderConfig struct {
	Name             string        `toml:"name"`
	Timeout          time.Duration `toml:"timeout"`
	FailureThreshold int           `toml:"failure_threshold"`
	Cooldown         time.Duration `toml:"cooldown"`
}

MemoryProviderConfig controls the active memory provider registry entry.

func (MemoryProviderConfig) Validate

func (c MemoryProviderConfig) Validate() error

Validate ensures provider settings are usable.

type MemoryRecallConfig

type MemoryRecallConfig struct {
	TopK                   int                         `toml:"top_k"`
	RawCandidates          int                         `toml:"raw_candidates"`
	Fusion                 string                      `toml:"fusion"`
	IncludeAlreadySurfaced bool                        `toml:"include_already_surfaced"`
	IncludeSystem          bool                        `toml:"include_system"`
	Weights                MemoryRecallWeightsConfig   `toml:"weights"`
	Freshness              MemoryRecallFreshnessConfig `toml:"freshness"`
	Signals                MemoryRecallSignalsConfig   `toml:"signals"`
}

MemoryRecallConfig controls deterministic recall.

func (*MemoryRecallConfig) Validate

func (c *MemoryRecallConfig) Validate() error

Validate ensures the recall configuration is internally consistent.

type MemoryRecallFreshnessConfig

type MemoryRecallFreshnessConfig struct {
	BannerAfterDays int `toml:"banner_after_days"`
}

MemoryRecallFreshnessConfig controls recall freshness banners.

type MemoryRecallSignalsConfig

type MemoryRecallSignalsConfig struct {
	QueueCapacity  int `toml:"queue_capacity"`
	WorkerRetryMax int `toml:"worker_retry_max"`
}

MemoryRecallSignalsConfig controls recall signal recording.

func (MemoryRecallSignalsConfig) Validate

func (c MemoryRecallSignalsConfig) Validate() error

Validate ensures recall signal settings are usable.

type MemoryRecallWeightsConfig

type MemoryRecallWeightsConfig struct {
	BM25Unicode  float64 `toml:"bm25_unicode"`
	BM25Trigram  float64 `toml:"bm25_trigram"`
	Recency      float64 `toml:"recency"`
	RecallSignal float64 `toml:"recall_signal"`
}

MemoryRecallWeightsConfig controls deterministic recall scoring weights.

func (MemoryRecallWeightsConfig) Validate

func (c MemoryRecallWeightsConfig) Validate() error

Validate ensures recall weights are usable.

type MemorySessionConfig

type MemorySessionConfig struct {
	LedgerFormat     string        `toml:"ledger_format"`
	LedgerRoot       string        `toml:"ledger_root"`
	EventsPurgeGrace time.Duration `toml:"events_purge_grace"`
	ColdArchiveDays  int           `toml:"cold_archive_days"`
	HardDeleteDays   int           `toml:"hard_delete_days"`
	MaxArchiveBytes  int64         `toml:"max_archive_bytes"`
	UnboundPartition string        `toml:"unbound_partition"`
}

MemorySessionConfig controls forensic session ledger retention.

func (*MemorySessionConfig) Validate

func (c *MemorySessionConfig) Validate() error

Validate ensures session ledger settings are usable.

type MemoryWorkspaceConfig

type MemoryWorkspaceConfig struct {
	TOMLPath   string `toml:"toml_path"`
	AutoCreate bool   `toml:"auto_create"`
}

MemoryWorkspaceConfig controls workspace memory file lifecycle.

func (MemoryWorkspaceConfig) Validate

func (c MemoryWorkspaceConfig) Validate() error

Validate ensures workspace memory settings are usable.

type ModelCatalogConfig

type ModelCatalogConfig struct {
	Sources ModelCatalogSourcesConfig `toml:"sources,omitempty"`
}

ModelCatalogConfig controls daemon-owned model catalog sources.

func DefaultModelCatalogConfig

func DefaultModelCatalogConfig() ModelCatalogConfig

DefaultModelCatalogConfig returns the default model catalog source config.

func (ModelCatalogConfig) Validate

func (c ModelCatalogConfig) Validate() error

Validate reports whether model catalog config is usable.

type ModelCatalogSourcesConfig

type ModelCatalogSourcesConfig struct {
	ModelsDev ModelsDevSourceConfig `toml:"models_dev,omitempty"`
}

ModelCatalogSourcesConfig groups built-in model catalog sources.

type ModelsDevSourceConfig

type ModelsDevSourceConfig struct {
	Enabled  *bool  `toml:"enabled,omitempty"`
	Endpoint string `toml:"endpoint,omitempty"`
	TTL      string `toml:"ttl,omitempty"`
	Timeout  string `toml:"timeout,omitempty"`
}

ModelsDevSourceConfig controls the models.dev catalog source.

func (ModelsDevSourceConfig) EffectiveEnabled

func (c ModelsDevSourceConfig) EffectiveEnabled() bool

EffectiveEnabled reports whether the models.dev source should run.

func (ModelsDevSourceConfig) EffectiveEndpoint

func (c ModelsDevSourceConfig) EffectiveEndpoint() string

EffectiveEndpoint returns the configured endpoint or the default models.dev endpoint.

func (ModelsDevSourceConfig) EffectiveTTL

func (c ModelsDevSourceConfig) EffectiveTTL() string

EffectiveTTL returns the configured TTL or the default models.dev TTL.

func (ModelsDevSourceConfig) EffectiveTimeout

func (c ModelsDevSourceConfig) EffectiveTimeout() string

EffectiveTimeout returns the configured timeout or the default models.dev timeout.

func (ModelsDevSourceConfig) Validate

func (c ModelsDevSourceConfig) Validate(path string) error

Validate reports whether the models.dev source config is usable.

type NetworkConfig

type NetworkConfig struct {
	Enabled      bool              `toml:"enabled"`
	MaxReplayAge int               `toml:"max_replay_age"`
	Live         NetworkLiveConfig `toml:"live"`
}

NetworkConfig controls Network availability and bounded Live participation defaults.

func DefaultNetworkConfig

func DefaultNetworkConfig() NetworkConfig

DefaultNetworkConfig returns built-in Network availability and Live-bound defaults.

func (NetworkConfig) MaxReplayAgeDuration

func (c NetworkConfig) MaxReplayAgeDuration() time.Duration

MaxReplayAgeDuration returns the configured replay age window as a duration.

func (NetworkConfig) Validate

func (c NetworkConfig) Validate() error

Validate ensures availability and Live-bound configuration is internally consistent.

type NetworkLiveConfig

type NetworkLiveConfig struct {
	Defaults NetworkLiveDefaultsConfig `toml:"defaults"`
	Limits   NetworkLiveLimitsConfig   `toml:"limits"`
}

NetworkLiveConfig groups bounds that apply only after an execution explicitly selects Live mode.

type NetworkLiveDefaultsConfig

type NetworkLiveDefaultsConfig struct {
	MaxWakes         int    `toml:"max_wakes"`
	MaxWakeWallTime  string `toml:"max_wake_wall_time"`
	MaxTotalWallTime string `toml:"max_total_wall_time"`
	MaxInputTokens   int64  `toml:"max_input_tokens"`
	MaxOutputTokens  int64  `toml:"max_output_tokens"`
	MaxWakeDepth     int    `toml:"max_wake_depth"`
	CoalesceWindow   string `toml:"coalesce_window"`
}

NetworkLiveDefaultsConfig fills omitted bounds for an explicitly Live execution.

func (NetworkLiveDefaultsConfig) ParticipationBounds

func (c NetworkLiveDefaultsConfig) ParticipationBounds() participation.Bounds

ParticipationBounds converts configured Live defaults into the shared participation contract.

type NetworkLiveLimitsConfig

type NetworkLiveLimitsConfig struct {
	MaxWakes          int    `toml:"max_wakes"`
	MaxWakeWallTime   string `toml:"max_wake_wall_time"`
	MaxTotalWallTime  string `toml:"max_total_wall_time"`
	MaxInputTokens    int64  `toml:"max_input_tokens"`
	MaxOutputTokens   int64  `toml:"max_output_tokens"`
	MaxWakeDepth      int    `toml:"max_wake_depth"`
	MinCoalesceWindow string `toml:"min_coalesce_window"`
	MaxCoalesceWindow string `toml:"max_coalesce_window"`
}

NetworkLiveLimitsConfig defines inclusive administrative ceilings for Live bounds.

func (NetworkLiveLimitsConfig) ParticipationLimits

func (c NetworkLiveLimitsConfig) ParticipationLimits() participation.Limits

ParticipationLimits converts configured Live ceilings into the shared participation contract.

type NetworkProfile

type NetworkProfile struct {
	AllowPublicIngress bool     `toml:"allow_public_ingress,omitempty"`
	AllowOutbound      bool     `toml:"allow_outbound,omitempty"`
	AllowList          []string `toml:"allow_list,omitempty"`
	DenyList           []string `toml:"deny_list,omitempty"`
	Required           bool     `toml:"required,omitempty"`
}

NetworkProfile defines provider-neutral network policy intent.

type ObservabilityConfig

type ObservabilityConfig struct {
	Enabled           bool                          `toml:"enabled"`
	RetentionDays     int                           `toml:"retention_days"`
	MaxGlobalBytes    int64                         `toml:"max_global_bytes"`
	AgentProbeTimeout time.Duration                 `toml:"agent_probe_timeout"`
	Transcripts       ObservabilityTranscriptConfig `toml:"transcripts"`
}

ObservabilityConfig controls global event retention settings.

func (ObservabilityConfig) AgentProbeTimeoutOrDefault

func (c ObservabilityConfig) AgentProbeTimeoutOrDefault() time.Duration

AgentProbeTimeoutOrDefault returns the configured agent probe timeout or the default.

func (ObservabilityConfig) Validate

func (c ObservabilityConfig) Validate() error

Validate ensures observability settings are sensible.

type ObservabilityTranscriptConfig

type ObservabilityTranscriptConfig struct {
	Enabled            bool  `toml:"enabled"`
	SegmentBytes       int   `toml:"segment_bytes"`
	MaxBytesPerSession int64 `toml:"max_bytes_per_session"`
}

ObservabilityTranscriptConfig configures transcript capture and retention.

func (ObservabilityTranscriptConfig) Validate

func (c ObservabilityTranscriptConfig) Validate() error

Validate ensures transcript retention settings are sensible.

type OverlayEditor

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

OverlayEditor applies safe, comment-preserving mutations to one TOML overlay document.

func (*OverlayEditor) Bytes

func (e *OverlayEditor) Bytes() ([]byte, error)

func (*OverlayEditor) Delete

func (e *OverlayEditor) Delete(path []string) error

Delete removes one TOML key path when present.

func (*OverlayEditor) DeleteArrayTableItem

func (e *OverlayEditor) DeleteArrayTableItem(path []string, nameField string, name string) (bool, error)

DeleteArrayTableItem removes one named entry from an array-of-tables.

func (*OverlayEditor) HasPath

func (e *OverlayEditor) HasPath(path []string) bool

HasPath reports whether the current document already contains the given path.

func (*OverlayEditor) SetTable

func (e *OverlayEditor) SetTable(path []string, values map[string]any) error

SetTable replaces or creates a TOML table at the provided path.

func (*OverlayEditor) SetValue

func (e *OverlayEditor) SetValue(path []string, value any) error

SetValue updates or creates one scalar or array value at the provided path.

func (*OverlayEditor) UpsertArrayTableItem

func (e *OverlayEditor) UpsertArrayTableItem(
	path []string,
	nameField string,
	name string,
	values map[string]any,
) error

UpsertArrayTableItem replaces or appends one named entry in an array-of-tables.

type PathDenial

type PathDenial string

PathDenial is the config package's path-policy decision.

const (
	ConfigPathAllowed         PathDenial = ""
	ConfigPathForbidden       PathDenial = "path_forbidden"
	ConfigPathSecretForbidden PathDenial = "secret_path_forbidden"
	ConfigPathTrustForbidden  PathDenial = "trust_root_forbidden"
)

type PathPolicy

type PathPolicy struct {
	Segments []string
	Kind     ValueKind
	Redacted bool
	Denial   PathDenial
}

PathPolicy captures the deterministic decision for an agent-facing config path.

func ClassifyToolConfigPath

func ClassifyToolConfigPath(path []string) (PathPolicy, error)

ClassifyToolConfigPath applies the agent-facing mutable config policy.

type PermissionMode

type PermissionMode string

PermissionMode is the static permission policy applied by the daemon.

const (
	// DefaultAgentName is the bootstrap agent name used across the system.
	DefaultAgentName                          = "general"
	PermissionModeDenyAll      PermissionMode = "deny-all"
	PermissionModeApproveReads PermissionMode = "approve-reads"
	PermissionModeApproveAll   PermissionMode = "approve-all"
	// DefaultObservabilityAgentProbeTimeout bounds daemon health probes for configured agents.
	DefaultObservabilityAgentProbeTimeout = 2 * time.Second
)

func (PermissionMode) Validate

func (m PermissionMode) Validate(path string) error

Validate ensures the permission mode is supported.

type PermissionsConfig

type PermissionsConfig struct {
	Mode PermissionMode `toml:"mode"`
}

PermissionsConfig defines the global default permission policy.

func (PermissionsConfig) Validate

func (c PermissionsConfig) Validate() error

Validate ensures the permission mode is supported.

type ProfileLayerDiagnostic

type ProfileLayerDiagnostic struct {
	Code    string
	Layer   string
	Profile string
	Path    string
	Message string
}

ProfileLayerDiagnostic reports a config or MCP sidecar whose directory does not bind to a known profile.

func InspectProfileLayerFiles

func InspectProfileLayerFiles(
	homePaths HomePaths,
	workspaceRoot string,
	knownProfiles []string,
) ([]ProfileLayerDiagnostic, error)

InspectProfileLayerFiles finds dormant profile-layer files without reading or applying their contents.

type ProviderAuthMode

type ProviderAuthMode string

ProviderAuthMode identifies who owns launch-time provider authentication.

const (
	// ProviderAuthModeNativeCLI lets the provider CLI use its own login/session state.
	ProviderAuthModeNativeCLI ProviderAuthMode = "native_cli"
	// ProviderAuthModeBoundSecret injects explicitly configured credential slots at launch.
	ProviderAuthModeBoundSecret ProviderAuthMode = "bound_secret"
	// ProviderAuthModeNone launches the provider without Compozy-managed credentials.
	ProviderAuthModeNone ProviderAuthMode = "none"
)

func (ProviderAuthMode) Validate

func (m ProviderAuthMode) Validate(path string) error

Validate reports whether the provider auth mode is supported.

type ProviderConfig

type ProviderConfig struct {
	Command         string                   `toml:"command"`
	SteerCapability SteerCapability          `toml:"steer_capability,omitempty"`
	DisplayName     string                   `toml:"display_name,omitempty"`
	Models          ProviderModelsConfig     `toml:"models,omitempty"`
	Harness         ProviderHarness          `toml:"harness,omitempty"`
	RuntimeProvider string                   `toml:"runtime_provider,omitempty"`
	Transport       string                   `toml:"transport,omitempty"`
	BaseURL         string                   `toml:"base_url,omitempty"`
	AuthMode        ProviderAuthMode         `toml:"auth_mode,omitempty"`
	EnvPolicy       ProviderEnvPolicy        `toml:"env_policy,omitempty"`
	HomePolicy      ProviderHomePolicy       `toml:"home_policy,omitempty"`
	NoneSecurity    ProviderNoneSecurity     `toml:"none_security,omitempty"`
	AuthStatusCmd   string                   `toml:"auth_status_command,omitempty"`
	AuthLoginCmd    string                   `toml:"auth_login_command,omitempty"`
	SessionMCP      *bool                    `toml:"session_mcp,omitempty"`
	CredentialSlots []ProviderCredentialSlot `toml:"credential_slots,omitempty"`
	MCPServers      []MCPServer              `toml:"mcp_servers,omitempty"`
}

ProviderConfig describes how to launch a provider in ACP mode.

func CloneProviderConfig

func CloneProviderConfig(provider ProviderConfig) ProviderConfig

CloneProviderConfig returns a deep copy safe for ownership boundaries and caches.

func (ProviderConfig) EffectiveAuthMode

func (p ProviderConfig) EffectiveAuthMode() ProviderAuthMode

EffectiveAuthMode returns the configured auth owner or the slot-derived default.

func (ProviderConfig) EffectiveCredentialSlots

func (p ProviderConfig) EffectiveCredentialSlots() []ProviderCredentialSlot

EffectiveCredentialSlots returns explicit launch credential slots.

func (ProviderConfig) EffectiveEnvPolicy

func (p ProviderConfig) EffectiveEnvPolicy() ProviderEnvPolicy

EffectiveEnvPolicy returns the configured provider environment inheritance policy.

func (ProviderConfig) EffectiveHarness

func (p ProviderConfig) EffectiveHarness() ProviderHarness

EffectiveHarness returns the configured provider harness or the command-backed default.

func (ProviderConfig) EffectiveHomePolicy

func (p ProviderConfig) EffectiveHomePolicy() ProviderHomePolicy

EffectiveHomePolicy returns the configured provider home inheritance policy.

func (ProviderConfig) EffectiveNoneSecurity

func (p ProviderConfig) EffectiveNoneSecurity() ProviderNoneSecurity

EffectiveNoneSecurity returns the auth_mode=none safety rationale.

func (ProviderConfig) RequiresRuntimeModel

func (p ProviderConfig) RequiresRuntimeModel() bool

RequiresRuntimeModel reports whether Compozy must provide a model to start this provider.

func (ProviderConfig) RuntimeProviderName

func (p ProviderConfig) RuntimeProviderName(providerName string) string

RuntimeProviderName returns the downstream runtime provider id for harnesses that need one.

func (ProviderConfig) SessionMCPEnabled

func (p ProviderConfig) SessionMCPEnabled() bool

SessionMCPEnabled reports whether Compozy should pass per-session MCP servers to the provider.

type ProviderCredentialSlot

type ProviderCredentialSlot struct {
	Name      string `toml:"name"`
	TargetEnv string `toml:"target_env"`
	SecretRef string `toml:"secret_ref"`
	Kind      string `toml:"kind,omitempty"`
	Required  bool   `toml:"required"`
}

ProviderCredentialSlot describes one launch-time secret binding needed by a provider.

func (ProviderCredentialSlot) Validate

func (s ProviderCredentialSlot) Validate(path string) error

Validate reports whether the provider credential slot can be resolved at launch.

type ProviderEnvPolicy

type ProviderEnvPolicy string

ProviderEnvPolicy identifies which daemon environment is inherited by a provider process.

const (
	// ProviderEnvPolicyFiltered removes secret-shaped daemon variables but keeps operator context.
	ProviderEnvPolicyFiltered ProviderEnvPolicy = "filtered"
	// ProviderEnvPolicyIsolated keeps only a fixed operational allowlist.
	ProviderEnvPolicyIsolated ProviderEnvPolicy = "isolated"
)

func (ProviderEnvPolicy) Validate

func (p ProviderEnvPolicy) Validate(path string) error

Validate reports whether the provider env policy is supported.

type ProviderHarness

type ProviderHarness string

ProviderHarness identifies the runtime strategy used to launch a provider.

const (
	// ProviderHarnessACP launches the configured command directly as an ACP runtime.
	ProviderHarnessACP ProviderHarness = "acp"
	// ProviderHarnessPiACP launches pi through the pi-acp adapter and materializes provider settings.
	ProviderHarnessPiACP ProviderHarness = "pi_acp"
)

func (ProviderHarness) Validate

func (h ProviderHarness) Validate(path string) error

Validate reports whether the harness is supported.

type ProviderHomePolicy

type ProviderHomePolicy string

ProviderHomePolicy identifies whether provider CLI state comes from the operator home or an isolated home.

const (
	// ProviderHomePolicyOperator lets native CLIs read their existing operator login state.
	ProviderHomePolicyOperator ProviderHomePolicy = "operator"
	// ProviderHomePolicyIsolated points native CLIs at an Compozy-owned provider home.
	ProviderHomePolicyIsolated ProviderHomePolicy = "isolated"
)

func (ProviderHomePolicy) Validate

func (p ProviderHomePolicy) Validate(path string) error

Validate reports whether the provider home policy is supported.

type ProviderModelConfig

type ProviderModelConfig struct {
	ID                       string         `toml:"id"`
	DisplayName              string         `toml:"display_name,omitempty"`
	ContextWindow            *int64         `toml:"context_window,omitempty"`
	MaxInputTokens           *int64         `toml:"max_input_tokens,omitempty"`
	MaxOutputTokens          *int64         `toml:"max_output_tokens,omitempty"`
	SupportsTools            *bool          `toml:"supports_tools,omitempty"`
	SupportsReasoning        *bool          `toml:"supports_reasoning,omitempty"`
	ReasoningEfforts         []string       `toml:"reasoning_efforts,omitempty"`
	DefaultReasoningEffort   string         `toml:"default_reasoning_effort,omitempty"`
	DefaultSpeed             speedpkg.Speed `toml:"default_speed,omitempty"`
	CostInputPerMillion      *float64       `toml:"cost_input_per_million,omitempty"`
	CostOutputPerMillion     *float64       `toml:"cost_output_per_million,omitempty"`
	CostCacheReadPerMillion  *float64       `toml:"cost_cache_read_per_million,omitempty"`
	CostCacheWritePerMillion *float64       `toml:"cost_cache_write_per_million,omitempty"`
	CostReasoningPerMillion  *float64       `toml:"cost_reasoning_per_million,omitempty"`
	Deprecated               *bool          `toml:"deprecated,omitempty"`
	Hidden                   *bool          `toml:"hidden,omitempty"`
	Featured                 *bool          `toml:"featured,omitempty"`
	ReleaseDate              string         `toml:"release_date,omitempty"`
}

ProviderModelConfig describes one curated provider model entry.

type ProviderModelsConfig

type ProviderModelsConfig struct {
	Default   string                        `toml:"default,omitempty"`
	Curated   []ProviderModelConfig         `toml:"curated,omitempty"`
	Discovery ProviderModelsDiscoveryConfig `toml:"discovery,omitempty"`
	Reasoning ProviderReasoningConfig       `toml:"reasoning,omitempty"`
}

ProviderModelsConfig describes provider-scoped model defaults and metadata.

func (ProviderModelsConfig) EffectiveReasoningApply

func (p ProviderModelsConfig) EffectiveReasoningApply() ReasoningApplyStrategy

EffectiveReasoningApply returns the provider's explicit strategy or none.

func (ProviderModelsConfig) Validate

func (m ProviderModelsConfig) Validate(path string) error

Validate reports whether the provider model block is usable.

type ProviderModelsDiscoveryConfig

type ProviderModelsDiscoveryConfig struct {
	Enabled  *bool  `toml:"enabled,omitempty"`
	Command  string `toml:"command,omitempty"`
	Endpoint string `toml:"endpoint,omitempty"`
	Timeout  string `toml:"timeout,omitempty"`
}

ProviderModelsDiscoveryConfig describes optional provider model discovery.

func (ProviderModelsDiscoveryConfig) Validate

func (d ProviderModelsDiscoveryConfig) Validate(path string) error

Validate reports whether the discovery source config is usable.

type ProviderNoneSecurity

type ProviderNoneSecurity string

ProviderNoneSecurity identifies why auth_mode=none is safe for a provider.

const (
	// ProviderNoneSecurityLocalTransport limits unauthenticated providers to local transport.
	ProviderNoneSecurityLocalTransport ProviderNoneSecurity = "local_transport"
	// ProviderNoneSecurityExternalIdentity delegates authentication to the provider transport.
	ProviderNoneSecurityExternalIdentity ProviderNoneSecurity = "external_identity"
	// ProviderNoneSecurityPublicReadonly permits unauthenticated public read-only providers.
	ProviderNoneSecurityPublicReadonly ProviderNoneSecurity = "public_readonly"
)

func (ProviderNoneSecurity) Validate

func (s ProviderNoneSecurity) Validate(path string) error

Validate reports whether the auth_mode=none safety rationale is supported.

type ProviderReasoningConfig

type ProviderReasoningConfig struct {
	Apply ReasoningApplyStrategy `toml:"apply,omitempty"`
}

ProviderReasoningConfig describes provider-level reasoning application.

func (ProviderReasoningConfig) EffectiveReasoningApply

func (r ProviderReasoningConfig) EffectiveReasoningApply() ReasoningApplyStrategy

EffectiveReasoningApply returns the reasoning strategy or none.

func (ProviderReasoningConfig) Validate

func (r ProviderReasoningConfig) Validate(path string) error

Validate reports whether the reasoning strategy is supported.

type QuietPolicy

type QuietPolicy struct {
	WarningAfter   time.Duration
	StopGrace      time.Duration
	StopAfterQuiet time.Duration
}

QuietPolicy is the normalized silence policy consumed by the session manager. Zero durations disable their respective action. StopGrace starts at the warning; StopAfterQuiet is an absolute silence threshold.

type ReasoningApplyStrategy

type ReasoningApplyStrategy string

ReasoningApplyStrategy identifies how Compozy applies a provider reasoning effort.

const (
	// ReasoningApplyACPOption applies effort through an advertised ACP session config option.
	ReasoningApplyACPOption ReasoningApplyStrategy = "acp_option"
	// ReasoningApplyNone exposes no selectable reasoning effort for the provider.
	ReasoningApplyNone ReasoningApplyStrategy = "none"
)

type RedactConfig

type RedactConfig struct {
	Enabled bool `toml:"enabled"`
}

RedactConfig controls additive secret redaction heuristics.

type ResolvedAgent

type ResolvedAgent struct {
	Name            string
	ProfileName     string
	Provider        string
	Command         string
	DisplayName     string
	Model           string
	ReasoningEffort string
	*AgentRuntimeDefaults
	Tools           []string
	Toolsets        []string
	DenyTools       []string
	Permissions     string
	Harness         ProviderHarness
	RuntimeProvider string
	Transport       string
	BaseURL         string
	AuthMode        ProviderAuthMode
	EnvPolicy       ProviderEnvPolicy
	HomePolicy      ProviderHomePolicy
	NoneSecurity    ProviderNoneSecurity
	AuthStatusCmd   string
	AuthLoginCmd    string
	SessionMCP      bool
	CredentialSlots []ProviderCredentialSlot
	MCPServers      []MCPServer
	Reasoning       ProviderReasoningConfig
	RuntimeSources  ResolvedRuntimeSources
	Prompt          string
}

ResolvedAgent is the effective runtime configuration for a parsed agent definition.

func (*ResolvedAgent) ACPOptionsValue

func (a *ResolvedAgent) ACPOptionsValue() []ACPOptionSelection

ACPOptionsValue returns the resolved typed ACP selections.

func (*ResolvedAgent) SetACPOptions

func (a *ResolvedAgent) SetACPOptions(selections []ACPOptionSelection)

SetACPOptions stores an ownership-safe resolved selection set.

func (*ResolvedAgent) SetSpeed

func (a *ResolvedAgent) SetSpeed(value speedpkg.Speed)

SetSpeed stores one normalized resolved speed.

func (*ResolvedAgent) SpeedValue

func (a *ResolvedAgent) SpeedValue() speedpkg.Speed

SpeedValue returns the resolved speed without exposing compact pointer storage.

type ResolvedCoordinatorRole

type ResolvedCoordinatorRole struct {
	Enabled                       bool
	AgentName                     string
	Provider                      string
	Model                         string
	ReasoningEffort               string
	Speed                         speedpkg.Speed
	ACPOptions                    []ACPOptionSelection
	Fallbacks                     []RoleFallback
	TTL                           time.Duration
	MaxChildren                   int
	MaxActiveSessionsPerWorkspace int
}

ResolvedCoordinatorRole is the coordinator runtime policy assembled from a resolved role.

func DefaultResolvedCoordinatorRole

func DefaultResolvedCoordinatorRole() ResolvedCoordinatorRole

DefaultResolvedCoordinatorRole returns the coordinator's resolved default identity and policy.

type ResolvedRuntimeSources

type ResolvedRuntimeSources struct {
	Provider        RuntimeValueSource
	Model           RuntimeValueSource
	ReasoningEffort RuntimeValueSource
	Speed           RuntimeValueSource
}

ResolvedRuntimeSources records the provenance of one effective agent runtime.

type RoleConfig

type RoleConfig struct {
	Enabled         bool   `toml:"enabled"`
	Agent           string `toml:"agent,omitempty"`
	Provider        string `toml:"provider,omitempty"`
	Model           string `toml:"model,omitempty"`
	ReasoningEffort string `toml:"reasoning_effort,omitempty"`
	// Speed selects normal or Fast execution when the provider advertises it.
	Speed speedpkg.Speed `toml:"speed,omitempty"`
	// ACPOptions selects provider-advertised typed session configuration values.
	ACPOptions    []ACPOptionSelection `toml:"acp_options,omitempty"`
	FallbackChain []RoleFallback       `toml:"fallback_chain,omitempty"`
}

RoleConfig controls one session-backed role.

type RoleFallback

type RoleFallback struct {
	Provider        string               `toml:"provider"`
	Model           string               `toml:"model"`
	ReasoningEffort string               `toml:"reasoning_effort,omitempty"`
	Speed           speedpkg.Speed       `toml:"speed,omitempty"`
	ACPOptions      []ACPOptionSelection `toml:"acp_options,omitempty"`
}

RoleFallback is one ordered invocation fallback route.

type RoleFieldSources

type RoleFieldSources map[RoleName]map[string]string

RoleFieldSources records which config layer last wrote each routed role field.

func CloneRoleFieldSources

func CloneRoleFieldSources(sources RoleFieldSources) RoleFieldSources

CloneRoleFieldSources returns an ownership-safe copy of role source metadata.

type RoleName

type RoleName string

RoleName identifies a background runtime role governed by [roles].

const (
	RoleCoordinator       RoleName = "coordinator"
	RoleDream             RoleName = "dream"
	RoleCheckpointSummary RoleName = "checkpoint_summary"
	RoleMemoryExtractor   RoleName = "memory_extractor"
	RoleAutoTitle         RoleName = "auto_title"
	RoleMemoryController  RoleName = "memory_controller"
)

func RoleNames

func RoleNames() []RoleName

RoleNames returns the complete closed role roster.

type RolesConfig

type RolesConfig struct {
	Coordinator       CoordinatorRoleConfig      `toml:"coordinator"`
	Dream             RoleConfig                 `toml:"dream"`
	CheckpointSummary RoleConfig                 `toml:"checkpoint_summary"`
	MemoryExtractor   RoleConfig                 `toml:"memory_extractor"`
	AutoTitle         RoleConfig                 `toml:"auto_title"`
	MemoryController  MemoryControllerRoleConfig `toml:"memory_controller"`
}

RolesConfig is the closed [roles] roster.

func CloneRolesConfig

func CloneRolesConfig(source *RolesConfig) RolesConfig

CloneRolesConfig returns an ownership-safe copy of the roles configuration.

func DefaultRolesConfig

func DefaultRolesConfig() RolesConfig

DefaultRolesConfig returns routing defaults with background dreaming disabled.

func (*RolesConfig) Validate

func (c *RolesConfig) Validate(path string, resolver providerResolver) error

Validate checks role shape, bounds, and configured provider references.

type RootKind

type RootKind string

RootKind identifies the physical convention that produced one skill root.

const (
	RootKindBuiltin RootKind = "builtin"
	RootKindPreset  RootKind = "preset"
	RootKindCustom  RootKind = "custom"
)

type RuntimeOverrides

type RuntimeOverrides struct {
	Provider  string
	Model     string
	Reasoning string
}

RuntimeOverrides are the engine-resolved runtime fields applied to one session.

type RuntimeValueSource

type RuntimeValueSource uint8

RuntimeValueSource identifies the authored/default layer that supplied one effective runtime value.

const (
	// RuntimeValueSourceUnspecified identifies an unresolved runtime value.
	RuntimeValueSourceUnspecified RuntimeValueSource = iota
	// RuntimeValueSourceAgent identifies a value authored in AGENT.md.
	RuntimeValueSourceAgent
	// RuntimeValueSourceProjectDefault identifies defaults.provider.
	RuntimeValueSourceProjectDefault
	// RuntimeValueSourceProviderDefault identifies provider.models.default.
	RuntimeValueSourceProviderDefault
	// RuntimeValueSourceModelDefault identifies a curated model runtime default.
	RuntimeValueSourceModelDefault
)

func (RuntimeValueSource) String

func (s RuntimeValueSource) String() string

String returns the public runtime-source value.

type SandboxProfile

type SandboxProfile struct {
	Backend     string            `toml:"backend"`
	SyncMode    string            `toml:"sync_mode,omitempty"`
	Persistence string            `toml:"persistence,omitempty"`
	RuntimeRoot string            `toml:"runtime_root,omitempty"`
	Env         map[string]string `toml:"env,omitempty"`
	SecretEnv   map[string]string `toml:"secret_env,omitempty"`
	Network     NetworkProfile    `toml:"network,omitempty"`
	Daytona     DaytonaProfile    `toml:"daytona,omitempty"`
}

SandboxProfile defines one reusable execution sandbox profile.

func (SandboxProfile) Resolve

func (p SandboxProfile) Resolve(profileName string) (sandbox.Resolved, error)

Resolve converts one validated config profile into runtime sandbox policy.

func (SandboxProfile) Validate

func (p SandboxProfile) Validate(path string) error

Validate ensures the sandbox profile is internally consistent.

type SchedulerConfig

type SchedulerConfig struct {
	FanOutAfter         int           `toml:"fan_out_after"`
	SpawnAfter          int           `toml:"spawn_after"`
	EventAfter          int           `toml:"event_after"`
	NeedsAttentionAfter int           `toml:"needs_attention_after"`
	MinQueuedAge        time.Duration `toml:"min_queued_age"`
}

SchedulerConfig bounds the mechanical scheduler's convergence escalation ladder. The counts are monotonic wake cycles a claimable run must remain queued before each tier fires.

func DefaultSchedulerConfig

func DefaultSchedulerConfig() SchedulerConfig

DefaultSchedulerConfig returns the built-in convergence ladder defaults.

func (SchedulerConfig) Validate

func (c SchedulerConfig) Validate(path string) error

Validate ensures the convergence ladder thresholds are positive and monotonic.

type SessionAttachmentsConfig

type SessionAttachmentsConfig struct {
	MaxFileBytes      int64                             `toml:"max_file_bytes"`
	MaxFilesPerPrompt int                               `toml:"max_files_per_prompt"`
	AllowedMIME       []string                          `toml:"allowed_mime"`
	Retention         SessionAttachmentsRetentionConfig `toml:"retention"`
}

SessionAttachmentsConfig controls persisted session-attachment admission and retention.

func DefaultSessionAttachmentsConfig

func DefaultSessionAttachmentsConfig() SessionAttachmentsConfig

DefaultSessionAttachmentsConfig returns v1 admission and retention defaults.

func (SessionAttachmentsConfig) Validate

func (c SessionAttachmentsConfig) Validate() error

Validate ensures attachment admission and retention values form real positive bounds.

type SessionAttachmentsRetentionConfig

type SessionAttachmentsRetentionConfig struct {
	MaxCount int           `toml:"max_count"`
	MaxBytes int64         `toml:"max_bytes"`
	MaxAge   time.Duration `toml:"max_age"`
}

SessionAttachmentsRetentionConfig controls disk bounds for stored attachments.

func (SessionAttachmentsRetentionConfig) Validate

Validate ensures attachment retention values form real positive bounds.

type SessionBusyInputConfig

type SessionBusyInputConfig struct {
	DefaultMode  string `toml:"default_mode,omitempty"`
	QueueCap     int    `toml:"queue_cap,omitempty"`
	MaxTextBytes int    `toml:"max_text_bytes,omitempty"`
}

SessionBusyInputConfig controls operator input submitted while a turn is active.

func DefaultSessionBusyInputConfig

func DefaultSessionBusyInputConfig() SessionBusyInputConfig

DefaultSessionBusyInputConfig returns the default busy-input behavior.

func (SessionBusyInputConfig) Normalize

Normalize returns a config copy with implicit defaults applied.

func (SessionBusyInputConfig) Validate

func (c SessionBusyInputConfig) Validate() error

Validate ensures busy-input controls are internally consistent.

type SessionCompactionConfig

type SessionCompactionConfig struct {
	Enabled            bool          `toml:"enabled"`
	PressureThreshold  float64       `toml:"pressure_threshold"`
	MaxAttemptsPerTurn int           `toml:"max_attempts_per_turn"`
	FailureCooldown    time.Duration `toml:"failure_cooldown"`
}

SessionCompactionConfig controls pressure-triggered persisted-context compaction.

func DefaultSessionCompactionConfig

func DefaultSessionCompactionConfig() SessionCompactionConfig

DefaultSessionCompactionConfig returns pressure and retry guards for persisted-context compaction.

func (SessionCompactionConfig) Validate

func (c SessionCompactionConfig) Validate() error

Validate ensures compaction pressure and retry guards are internally consistent.

type SessionConfig

type SessionConfig struct {
	Stop        SessionStopConfig        `toml:"stop"`
	Limits      SessionLimitsConfig      `toml:"limits"`
	Supervision SessionSupervisionConfig `toml:"supervision"`
	BusyInput   SessionBusyInputConfig   `toml:"busy_input"`
	Compaction  SessionCompactionConfig  `toml:"compaction"`
	Attachments SessionAttachmentsConfig `toml:"attachments"`
}

SessionConfig defines session-scoped runtime controls.

func (SessionConfig) Validate

func (c SessionConfig) Validate() error

Validate ensures session-scoped controls are internally consistent.

type SessionLimitsConfig

type SessionLimitsConfig struct {
	Timeout time.Duration `toml:"timeout,omitempty"`
}

SessionLimitsConfig defines runtime limits applied to every session.

func (SessionLimitsConfig) Validate

func (c SessionLimitsConfig) Validate() error

Validate ensures session timeout settings are internally consistent.

type SessionStopConfig

type SessionStopConfig struct {
	CooperativeGrace time.Duration `toml:"cooperative_grace"`
}

SessionStopConfig bounds the cooperative phase before process termination.

func DefaultSessionStopConfig

func DefaultSessionStopConfig() SessionStopConfig

func (SessionStopConfig) Validate

func (c SessionStopConfig) Validate() error

type SessionSupervisionConfig

type SessionSupervisionConfig struct {
	ActivityHeartbeatInterval time.Duration `toml:"activity_heartbeat_interval,omitempty"`
	ProgressNotifyInterval    time.Duration `toml:"progress_notify_interval,omitempty"`
	PromptDeadline            time.Duration `toml:"prompt_deadline,omitempty"`
	QuietAfter                time.Duration `toml:"quiet_after"`
	StopGrace                 time.Duration `toml:"stop_grace"`
	TimeoutCancelGrace        time.Duration `toml:"timeout_cancel_grace,omitempty"`
	// contains filtered or unexported fields
}

SessionSupervisionConfig defines runtime activity monitoring controls applied to sessions.

func DefaultSessionSupervisionConfig

func DefaultSessionSupervisionConfig() SessionSupervisionConfig

DefaultSessionSupervisionConfig returns the default runtime activity supervision settings.

func (SessionSupervisionConfig) QuietPolicy

func (c SessionSupervisionConfig) QuietPolicy() QuietPolicy

QuietPolicy resolves the current keys and the N-1 loader's independent timers.

func (SessionSupervisionConfig) Validate

func (c SessionSupervisionConfig) Validate() error

Validate ensures session supervision settings are internally consistent.

type ShellConfig

type ShellConfig struct {
	Sessions ShellSessionsConfig `toml:"sessions"`
}

ShellConfig persists operator preferences owned by the web shell.

func DefaultShellConfig

func DefaultShellConfig() ShellConfig

DefaultShellConfig returns the built-in operator shell preferences.

func (ShellConfig) Validate

func (c ShellConfig) Validate() error

Validate rejects unsupported shell preference values.

type ShellSessionScope

type ShellSessionScope string

ShellSessionScope identifies the operator's preferred session list breadth.

const (
	ShellSessionScopeWorkspace     ShellSessionScope = "workspace"
	ShellSessionScopeAllWorkspaces ShellSessionScope = "all-workspaces"
)

type ShellSessionSort

type ShellSessionSort string

ShellSessionSort identifies the operator's preferred session ordering.

const (
	ShellSessionSortLastActivity ShellSessionSort = "last_activity"
	ShellSessionSortAttention    ShellSessionSort = "attention"
)

type ShellSessionsConfig

type ShellSessionsConfig struct {
	Sort  ShellSessionSort  `toml:"sort"`
	Scope ShellSessionScope `toml:"scope"`
}

ShellSessionsConfig persists session-list preferences across shell restarts.

type SkillRootSpec

type SkillRootSpec struct {
	Dir           string
	SourceSlug    string
	Kind          RootKind
	ResourceScope resources.ResourceScope
	ProfileID     string
	WorkspaceID   string
}

SkillRootSpec is the typed, profile-aware identity of one skill root.

func ResolveGlobalSkillRoots

func ResolveGlobalSkillRoots(cfg *SkillsConfig, home HomePaths) []SkillRootSpec

ResolveGlobalSkillRoots resolves the user-owned global roots in effective config order.

func (SkillRootSpec) RootID

func (s SkillRootSpec) RootID() string

RootID returns an opaque identity derived only from stable ownership and location fields.

type SkillSourceOverridePresence

type SkillSourceOverridePresence struct {
	Sources       bool
	CustomSources bool
}

SkillSourceOverridePresence reports whether one overlay explicitly owns each source list.

func ReadSkillSourceOverridePresence

func ReadSkillSourceOverridePresence(path string) (SkillSourceOverridePresence, error)

ReadSkillSourceOverridePresence inspects one config overlay without applying inherited values.

type SkillSourcePreset

type SkillSourcePreset struct {
	Slug                   string
	Label                  string
	WorkspaceRel           string
	GlobalPath             string
	WorkspaceNativeReaders []string
	GlobalNativeReaders    []string
	AlwaysOn               bool
	DefaultOn              bool
}

SkillSourcePreset describes one curated filesystem convention understood by CompozyOS.

func SkillSourcePresets

func SkillSourcePresets() []SkillSourcePreset

SkillSourcePresets returns the closed preset table in public display order.

type SkillSourceValidationError

type SkillSourceValidationError struct {
	Code           string
	Source         string
	Field          string
	Path           string
	ExistingSource string
	Valid          []string
	Suggestion     string
	Message        string
}

SkillSourceValidationError reports one portable source-policy validation failure.

func (*SkillSourceValidationError) Error

type SkillsConfig

type SkillsConfig struct {
	Enabled                 bool              `toml:"enabled"`
	Sources                 []string          `toml:"sources,omitempty"`
	CustomSources           []string          `toml:"custom_sources,omitempty"`
	DisabledSkills          []string          `toml:"disabled_skills,omitempty"`
	PollInterval            time.Duration     `toml:"poll_interval"`
	AllowedMarketplaceMCP   []string          `toml:"allowed_marketplace_mcp,omitempty"`
	AllowedMarketplaceHooks []string          `toml:"allowed_marketplace_hooks,omitempty"`
	Marketplace             MarketplaceConfig `toml:"marketplace,omitempty"`
}

SkillsConfig controls skill loading and discovery.

func (SkillsConfig) Validate

func (c SkillsConfig) Validate() error

Validate ensures the skills configuration is internally consistent.

func (SkillsConfig) ValidateForScope

func (c SkillsConfig) ValidateForScope(scope WriteScope) error

ValidateForScope validates source policy for the layer that will own a write.

func (SkillsConfig) ValidateForScopeAtRoot

func (c SkillsConfig) ValidateForScopeAtRoot(scope WriteScope, layerRoot string, home HomePaths) error

ValidateForScopeAtRoot rejects physical collisions using the owning layer's path base.

type SoulConfig

type SoulConfig struct {
	Enabled                bool  `toml:"enabled"`
	MaxBodyBytes           int64 `toml:"max_body_bytes"`
	ContextProjectionBytes int64 `toml:"context_projection_bytes"`
}

SoulConfig controls optional SOUL.md parsing and projection limits.

func DefaultSoulConfig

func DefaultSoulConfig() SoulConfig

DefaultSoulConfig returns the built-in Agent Soul resolver limits.

func (SoulConfig) Validate

func (c SoulConfig) Validate() error

Validate ensures SOUL.md limits are internally consistent.

type SteerCapability

type SteerCapability string
const (
	SteerCapabilityExtension        SteerCapability = "steer_ext"
	SteerCapabilityConcurrentPrompt SteerCapability = "concurrent_prompt"
	SteerCapabilityNone             SteerCapability = "none"
)

func (SteerCapability) Validate

func (c SteerCapability) Validate(path string) error

type TaskConfig

type TaskConfig struct {
	Orchestration TaskOrchestrationConfig `toml:"orchestration"`
	Recovery      TaskRecoveryConfig      `toml:"recovery"`
}

TaskConfig controls task runtime behavior.

func DefaultTaskConfig

func DefaultTaskConfig() TaskConfig

DefaultTaskConfig returns built-in task runtime defaults.

func (TaskConfig) Validate

func (c TaskConfig) Validate() error

Validate ensures task config is safe to consume.

type TaskOrchestrationConfig

type TaskOrchestrationConfig struct {
	SummaryMaxBytes           int                            `toml:"summary_max_bytes"`
	ContextBodyMaxBytes       int                            `toml:"context_body_max_bytes"`
	ContextPriorAttempts      int                            `toml:"context_prior_attempts"`
	ContextRecentEvents       int                            `toml:"context_recent_events"`
	SpawnFailureLimit         int                            `toml:"spawn_failure_limit"`
	SchedulerBadTickThreshold int                            `toml:"scheduler_bad_tick_threshold"`
	SchedulerBadTickCooldown  time.Duration                  `toml:"scheduler_bad_tick_cooldown"`
	DefaultMaxRuntime         time.Duration                  `toml:"default_max_runtime"`
	BridgeNotificationTimeout time.Duration                  `toml:"bridge_notification_timeout"`
	DesignatedRunMax          int                            `toml:"designated_run_max"`
	MaxActiveRunsPerWorkspace int                            `toml:"max_active_runs_per_workspace"`
	NetworkStatusQueueSize    int                            `toml:"network_status_queue_size"`
	NetworkStatusTimeout      time.Duration                  `toml:"network_status_timeout"`
	Profile                   TaskOrchestrationProfileConfig `toml:"profile"`
	Review                    TaskOrchestrationReviewConfig  `toml:"review"`
}

TaskOrchestrationConfig controls bounded task orchestration behavior.

func (TaskOrchestrationConfig) Validate

func (c TaskOrchestrationConfig) Validate(path string) error

Validate ensures task orchestration config is safe to consume.

type TaskOrchestrationProfileConfig

type TaskOrchestrationProfileConfig struct {
	DefaultCoordinatorMode    string `toml:"default_coordinator_mode"`
	DefaultWorkerMode         string `toml:"default_worker_mode"`
	DefaultSandboxMode        string `toml:"default_sandbox_mode"`
	DefaultWorktreeMode       string `toml:"default_worktree_mode"`
	AllowTaskProviderOverride bool   `toml:"allow_task_provider_override"`
	AllowTaskSandboxNone      bool   `toml:"allow_task_sandbox_none"`
}

TaskOrchestrationProfileConfig controls task execution profile defaults and gates.

func (TaskOrchestrationProfileConfig) Validate

func (c TaskOrchestrationProfileConfig) Validate(path string) error

Validate ensures task execution profile defaults are recognized.

type TaskOrchestrationReviewConfig

type TaskOrchestrationReviewConfig struct {
	DefaultPolicy             string        `toml:"default_policy"`
	MaxRounds                 int           `toml:"max_rounds"`
	MaxReviewAttempts         int           `toml:"max_review_attempts"`
	Timeout                   time.Duration `toml:"timeout"`
	RapidTerminalWindow       time.Duration `toml:"rapid_terminal_window"`
	RapidTerminalLimit        int           `toml:"rapid_terminal_limit"`
	MissingWorkMaxItems       int           `toml:"missing_work_max_items"`
	MissingWorkItemMaxBytes   int           `toml:"missing_work_item_max_bytes"`
	ReasonMaxBytes            int           `toml:"reason_max_bytes"`
	ReviewTextMaxBytes        int           `toml:"review_text_max_bytes"`
	NextRoundGuidanceMaxBytes int           `toml:"next_round_guidance_max_bytes"`
	FailurePolicy             string        `toml:"failure_policy"`
}

TaskOrchestrationReviewConfig controls task review gate defaults and bounds.

func (TaskOrchestrationReviewConfig) Validate

func (c TaskOrchestrationReviewConfig) Validate(path string) error

Validate ensures review gate defaults are bounded.

type TaskRecoveryConfig

type TaskRecoveryConfig struct {
	AllowAgentForce bool `toml:"allow_agent_force"`
}

TaskRecoveryConfig controls task-run recovery verbs.

type TerminalConfig

type TerminalConfig struct {
	DefaultShell           string        `toml:"default_shell"`
	ShellIntegration       bool          `toml:"shell_integration"`
	ScrollbackBytes        int           `toml:"scrollback_bytes"`
	DetachedTTL            time.Duration `toml:"detached_ttl"`
	ExitRetention          time.Duration `toml:"exit_retention"`
	Recording              bool          `toml:"recording"`
	RecordingRetentionDays int           `toml:"recording_retention_days"`
	MaxPerWorkspace        int           `toml:"max_per_workspace"`
	MaxPerDaemon           int           `toml:"max_per_daemon"`
	MaxSubscribers         int           `toml:"max_subscribers"`
}

TerminalConfig controls terminal process, retention, and capacity policy.

func DefaultTerminalConfig

func DefaultTerminalConfig() TerminalConfig

DefaultTerminalConfig returns the built-in terminal policy.

func (TerminalConfig) Validate

func (c TerminalConfig) Validate() error

Validate checks terminal policy without probing the local executable set.

type ToolsArtifactsConfig

type ToolsArtifactsConfig struct {
	MaxCount int           `toml:"max_count"`
	MaxBytes int64         `toml:"max_bytes"`
	MaxAge   time.Duration `toml:"max_age"`
}

ToolsArtifactsConfig controls retained oversized tool result storage.

func (ToolsArtifactsConfig) Validate

func (c ToolsArtifactsConfig) Validate() error

Validate ensures artifact retention values form real positive bounds.

type ToolsClarifyConfig

type ToolsClarifyConfig struct {
	Timeout time.Duration `toml:"timeout"`
}

ToolsClarifyConfig controls the boot-scoped human clarification broker.

func (ToolsClarifyConfig) Validate

func (c ToolsClarifyConfig) Validate() error

Validate ensures clarification waits are bounded and useful.

type ToolsConfig

type ToolsConfig struct {
	Enabled               bool                 `toml:"enabled"`
	HostedMCPEnabled      bool                 `toml:"hosted_mcp_enabled"`
	DefaultMaxResultBytes int64                `toml:"default_max_result_bytes"`
	HostedMCP             ToolsHostedMCPConfig `toml:"hosted_mcp"`
	Clarify               ToolsClarifyConfig   `toml:"clarify"`
	Artifacts             ToolsArtifactsConfig `toml:"artifacts"`
	Policy                ToolsPolicyConfig    `toml:"policy"`
}

ToolsConfig controls registry, hosted MCP, and default tool-policy lifecycle settings.

func DefaultToolsConfig

func DefaultToolsConfig() ToolsConfig

DefaultToolsConfig returns the TechSpec defaults for tool registry configuration.

func (ToolsConfig) Validate

func (c ToolsConfig) Validate(mcpServers []MCPServer, providers map[string]ProviderConfig) error

Validate ensures tools lifecycle configuration is deterministic and safe to consume.

type ToolsExternalDefault

type ToolsExternalDefault string

ToolsExternalDefault controls default policy for external executable sources.

const (
	// ToolsExternalDefaultDisabled keeps external tools operator-visible but not session-callable by default.
	ToolsExternalDefaultDisabled ToolsExternalDefault = "disabled"
	// ToolsExternalDefaultAsk requires approval for external tools that otherwise pass policy.
	ToolsExternalDefaultAsk ToolsExternalDefault = "ask"
	// ToolsExternalDefaultEnabled allows external tools that otherwise pass policy.
	ToolsExternalDefaultEnabled ToolsExternalDefault = "enabled"
)

type ToolsHostedMCPConfig

type ToolsHostedMCPConfig struct {
	BindNonceTTLSeconds int `toml:"bind_nonce_ttl_seconds"`
}

ToolsHostedMCPConfig controls Compozy-hosted MCP launch binding values.

func (ToolsHostedMCPConfig) BindNonceTTL

func (c ToolsHostedMCPConfig) BindNonceTTL() time.Duration

BindNonceTTL returns the configured hosted MCP nonce lifetime.

func (ToolsHostedMCPConfig) Validate

func (c ToolsHostedMCPConfig) Validate() error

Validate ensures hosted MCP lifecycle values are inside daemon bounds.

type ToolsPolicyConfig

type ToolsPolicyConfig struct {
	ExternalDefault        ToolsExternalDefault `toml:"external_default"`
	ApprovalTimeoutSeconds int                  `toml:"approval_timeout_seconds"`
	TrustedSources         []string             `toml:"trusted_sources,omitempty"`
}

ToolsPolicyConfig controls default registry policy values consumed by later policy evaluation.

func (ToolsPolicyConfig) ApprovalTimeout

func (c ToolsPolicyConfig) ApprovalTimeout() time.Duration

ApprovalTimeout returns the configured tool approval wait.

func (ToolsPolicyConfig) Validate

func (c ToolsPolicyConfig) Validate(knownMCPSourceOwners map[string]struct{}) error

Validate ensures policy defaults are inside the supported grammar.

type ValidationError

type ValidationError struct {
	Code    string
	Path    string
	Message string
}

ValidationError preserves the config path for agent-parseable validation failures.

func (ValidationError) Error

func (e ValidationError) Error() string

type ValueKind

type ValueKind uint8

ValueKind identifies the TOML scalar shape supported by tool writes.

const (
	ConfigValueString ValueKind = iota
	ConfigValueBool
	ConfigValueInt
	ConfigValueInt64
	ConfigValueUint64
	ConfigValueFloat
	ConfigValueDuration
	ConfigValueStringSlice
	ConfigValueTable
	ConfigValueScalar
	ConfigValueLoopInput
	ConfigValueACPOptions
)

type WindowManagerBindingConfig

type WindowManagerBindingConfig struct {
	TopCenter string `toml:"top_center"`
	// BottomCenter defaults to reserved to keep the approach strip above the Dock clear of snaps.
	BottomCenter string `toml:"bottom_center"`
}

WindowManagerBindingConfig maps each edge-center snap action; "reserved" blocks that edge-center snap.

func (WindowManagerBindingConfig) Validate

func (c WindowManagerBindingConfig) Validate() error

Validate ensures reserved edge centers resolve to supported semantic actions.

type WindowManagerConfig

type WindowManagerConfig struct {
	NewWindowPolicy     string                                   `toml:"new_window_policy"`
	SmallViewportPolicy string                                   `toml:"small_viewport_policy"`
	FocusPolicy         string                                   `toml:"focus_policy"`
	FocusWrap           bool                                     `toml:"focus_wrap"`
	FocusFollowsPointer bool                                     `toml:"focus_follows_pointer"`
	RaiseOnFocus        bool                                     `toml:"raise_on_focus"`
	DragAwayPolicy      string                                   `toml:"drag_away_policy"`
	GroupMoveModifier   string                                   `toml:"group_move_modifier"`
	SwapModifier        string                                   `toml:"swap_modifier"`
	HistoryLimit        int                                      `toml:"history_limit"`
	NavStackLimit       int                                      `toml:"nav_stack_limit"`
	ClosedEntryLimit    int                                      `toml:"closed_entry_limit"`
	DesktopTransition   string                                   `toml:"desktop_transition"`
	Gaps                WindowManagerGapsConfig                  `toml:"gaps"`
	Snap                WindowManagerSnapConfig                  `toml:"snap"`
	Bindings            WindowManagerBindingConfig               `toml:"bindings"`
	Shortcuts           map[string]windowmanager.ShortcutBinding `toml:"shortcuts,omitempty"`
	GlobalShortcuts     map[string]string                        `toml:"global_shortcuts,omitempty"`
}

WindowManagerConfig controls window topology behavior and browser projection defaults.

func ApplyWindowManagerOverlayFile

func ApplyWindowManagerOverlayFile(
	path string,
	defaults WindowManagerConfig,
) (WindowManagerConfig, error)

ApplyWindowManagerOverlayFile applies only the optional [window_manager] section at path onto the supplied active defaults.

func DefaultWindowManagerConfig

func DefaultWindowManagerConfig() WindowManagerConfig

DefaultWindowManagerConfig returns the built-in behavior shared by daemon and web clients.

func (WindowManagerConfig) Validate

func (c WindowManagerConfig) Validate() error

Validate rejects incomplete or internally conflicting window-manager behavior.

type WindowManagerGapsConfig

type WindowManagerGapsConfig struct {
	Inner  int `toml:"inner"`
	Top    int `toml:"top"`
	Right  int `toml:"right"`
	Bottom int `toml:"bottom"`
	Left   int `toml:"left"`
}

WindowManagerGapsConfig controls the shared inner gap and work-area insets.

func (WindowManagerGapsConfig) Validate

func (c WindowManagerGapsConfig) Validate() error

Validate ensures projection gaps stay within a practical viewport-safe range.

type WindowManagerSnapConfig

type WindowManagerSnapConfig struct {
	EdgeBand     int       `toml:"edge_band"`
	CornerReach  int       `toml:"corner_reach"`
	ExitSlack    int       `toml:"exit_slack"`
	RepeatRatios []float64 `toml:"repeat_ratios"`
}

WindowManagerSnapConfig controls pointer target resolution and repeated side ratios.

func (WindowManagerSnapConfig) Validate

func (c WindowManagerSnapConfig) Validate() error

Validate ensures snap thresholds and ratios can resolve deterministic targets.

type WorkspaceDiscoveryRoot

type WorkspaceDiscoveryRoot struct {
	Dir             string
	WorkspaceRoot   string
	Source          WorkspaceDiscoverySource
	ProfileID       string
	WorkspaceID     string
	ResourceScopeID string
	OperatorHomeDir string
}

WorkspaceDiscoveryRoot describes a filesystem root participating in multi-root resource discovery.

func WorkspaceDiscoveryRoots

func WorkspaceDiscoveryRoots(
	rootDir string,
	additionalDirs []string,
	homePaths HomePaths,
	profileName string,
) []WorkspaceDiscoveryRoot

WorkspaceDiscoveryRoots returns ordered discovery roots for workspace-visible resources. A non-empty profile name inserts the two profile-bound roots at their precedence slots.

func (WorkspaceDiscoveryRoot) AgentsDir

func (r WorkspaceDiscoveryRoot) AgentsDir() string

AgentsDir returns the agent-definition directory for this discovery root.

func (WorkspaceDiscoveryRoot) LoopsDir

func (r WorkspaceDiscoveryRoot) LoopsDir() string

LoopsDir returns the loop-definition directory for this discovery root.

func (WorkspaceDiscoveryRoot) SkillsDirs

func (r WorkspaceDiscoveryRoot) SkillsDirs(cfg *SkillsConfig) []SkillRootSpec

SkillsDirs resolves configured roots owned by this discovery layer.

type WorkspaceDiscoverySource

type WorkspaceDiscoverySource string

WorkspaceDiscoverySource identifies where a discovery root came from.

const (

	// WorkspaceDiscoverySourceWorkspace marks the primary workspace root.
	WorkspaceDiscoverySourceWorkspace WorkspaceDiscoverySource = "workspace"
	// WorkspaceDiscoverySourceAdditional marks an additional workspace root.
	WorkspaceDiscoverySourceAdditional WorkspaceDiscoverySource = "additional"
	// WorkspaceDiscoverySourceGlobal marks the global Compozy home root.
	WorkspaceDiscoverySourceGlobal WorkspaceDiscoverySource = "global"
	// WorkspaceDiscoverySourceProfile marks the active profile's personal root.
	WorkspaceDiscoverySourceProfile WorkspaceDiscoverySource = "profile"
	// WorkspaceDiscoverySourceWorkspaceProfile marks the project root bound to the active profile name.
	WorkspaceDiscoverySourceWorkspaceProfile WorkspaceDiscoverySource = "workspace_profile"
)

type WorktreesConfig

type WorktreesConfig struct {
	Root               string        `toml:"root"`
	RunBranchNamespace string        `toml:"run_branch_namespace"`
	CopyList           []string      `toml:"copy_list,omitempty"`
	SetupCommand       string        `toml:"setup_command"`
	SetupTimeout       time.Duration `toml:"setup_timeout"`
	DiscoveryCacheTTL  time.Duration `toml:"discovery_cache_ttl"`
}

WorktreesConfig controls worktree placement, discovery, and bootstrap.

func DefaultWorktreesConfig

func DefaultWorktreesConfig() WorktreesConfig

DefaultWorktreesConfig returns the built-in worktree defaults.

func (WorktreesConfig) ResolveRoot

func (c WorktreesConfig) ResolveRoot(homePaths HomePaths) string

ResolveRoot resolves the central placement root without changing existing worktrees.

func (WorktreesConfig) Validate

func (c WorktreesConfig) Validate() error

Validate rejects invalid worktree configuration and names the offending key.

type WriteScope

type WriteScope string

WriteScope identifies the config scope a write should target.

const (
	// WriteScopeUser targets the user-wide Compozy home config.
	WriteScopeUser WriteScope = "user"
	// WriteScopeProfile targets the active profile's personal config.
	WriteScopeProfile WriteScope = "profile"
	// WriteScopeWorkspace targets a workspace-local Compozy overlay.
	WriteScopeWorkspace WriteScope = "workspace"
)

func (WriteScope) Validate

func (s WriteScope) Validate() error

Validate ensures the write scope is supported.

type WriteTarget

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

WriteTarget captures a semantic destination while keeping the on-disk path internal to the config package.

func ResolveConfigWriteTarget

func ResolveConfigWriteTarget(
	homePaths HomePaths,
	workspaceRoot string,
	scope WriteScope,
	profileName string,
) (WriteTarget, error)

ResolveConfigWriteTarget resolves the canonical config overlay destination for the requested scope.

func ResolveMCPSidecarWriteTarget

func ResolveMCPSidecarWriteTarget(
	homePaths HomePaths,
	workspaceRoot string,
	scope WriteScope,
	profileName string,
) (WriteTarget, error)

ResolveMCPSidecarWriteTarget resolves the canonical MCP sidecar destination for the requested scope.

func (WriteTarget) Kind

func (t WriteTarget) Kind() WriteTargetKind

Kind returns the semantic destination identifier for the write target.

func (WriteTarget) Path

func (t WriteTarget) Path() string

Path returns the resolved filesystem path for operator-facing diagnostics and tools.

func (WriteTarget) Scope

func (t WriteTarget) Scope() WriteScope

Scope returns the write scope for the target.

type WriteTargetKind

type WriteTargetKind string

WriteTargetKind describes the canonical persistence destination without exposing filesystem paths to higher layers.

const (
	// WriteTargetGlobalConfig writes `~/.compozy/config.toml`.
	WriteTargetGlobalConfig WriteTargetKind = "global-config"
	// WriteTargetProfileConfig writes `~/.compozy/profiles/<name>/config.toml`.
	WriteTargetProfileConfig WriteTargetKind = "profile-config"
	// WriteTargetWorkspaceConfig writes `<workspace>/.compozy/config.toml`.
	WriteTargetWorkspaceConfig WriteTargetKind = "workspace-config"
	// WriteTargetGlobalMCPSidecar writes `~/.compozy/mcp.json`.
	WriteTargetGlobalMCPSidecar WriteTargetKind = "global-mcp-sidecar"
	// WriteTargetProfileMCPSidecar writes `~/.compozy/profiles/<name>/mcp.json`.
	WriteTargetProfileMCPSidecar WriteTargetKind = "profile-mcp-sidecar"
	// WriteTargetWorkspaceMCPSidecar writes `<workspace>/.compozy/mcp.json`.
	WriteTargetWorkspaceMCPSidecar WriteTargetKind = "workspace-mcp-sidecar"
)

Source Files

Directories

Path Synopsis
Package lifecycle owns the config-apply lifecycle matrix shared by runtime, API, CLI, web, docs, and codegen checks.
Package lifecycle owns the config-apply lifecycle matrix shared by runtime, API, CLI, web, docs, and codegen checks.

Jump to

Keyboard shortcuts

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