settings

package
v0.3.0-beta.20 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WriteTargetGlobalConfig persists to `~/.compozy/config.toml`.
	WriteTargetGlobalConfig = compozyconfig.WriteTargetGlobalConfig
	// WriteTargetWorkspaceConfig persists to `<workspace>/.compozy/config.toml`.
	WriteTargetWorkspaceConfig = compozyconfig.WriteTargetWorkspaceConfig
	// WriteTargetGlobalMCPSidecar persists to `~/.compozy/mcp.json`.
	WriteTargetGlobalMCPSidecar = compozyconfig.WriteTargetGlobalMCPSidecar
	// WriteTargetWorkspaceMCPSidecar persists to `<workspace>/.compozy/mcp.json`.
	WriteTargetWorkspaceMCPSidecar = compozyconfig.WriteTargetWorkspaceMCPSidecar
	// WriteTargetGlobalAgentFile persists to `~/.compozy/agents/<name>/AGENT.md`.
	WriteTargetGlobalAgentFile WriteTargetKind = "global-agent-file"
	// WriteTargetWorkspaceAgentFile persists to `<root>/.compozy/agents/<name>/AGENT.md`.
	WriteTargetWorkspaceAgentFile WriteTargetKind = "workspace-agent-file"
)

Variables

View Source
var ErrConflict = errors.New("settings: conflict")

ErrConflict marks conflicting settings scope or target combinations.

View Source
var ErrForbidden = errors.New("settings: forbidden")

ErrForbidden marks settings operations rejected by policy.

View Source
var ErrNotFound = errors.New("settings: not found")

ErrNotFound marks missing settings sections, collections, or items.

View Source
var ErrUnavailable = errors.New("settings: unavailable")

ErrUnavailable marks a required settings dependency that is not configured.

View Source
var ErrUnprocessable = errors.New("settings: unprocessable")

ErrUnprocessable marks settings requests whose selected resource exists but cannot be processed because its backing state is invalid.

View Source
var ErrValidation = errors.New("settings: validation")

ErrValidation marks malformed settings requests or payloads.

Functions

func WithMutationSource

func WithMutationSource(ctx context.Context, source string) context.Context

WithMutationSource annotates a settings-service context with the public transport or runtime source that initiated a persisted mutation.

Types

type ActionMetadata

type ActionMetadata struct {
	Name      string
	Available bool
	Behavior  MutationBehavior
}

ActionMetadata reports one action trigger's semantic behavior.

type ApplyFailure

type ApplyFailure struct {
	Subsystem  string
	Diagnostic diagnosticcontract.DiagnosticItem
}

ApplyFailure reports one subsystem failure after the desired config was written.

type ApplyRecord

type ApplyRecord struct {
	ID          string
	DesiredHash string
	ActiveHash  string
	Generation  int64
	Actor       string
	DiffClass   lifecycle.DiffClass
	Status      lifecycle.Status
	Lifecycle   lifecycle.Lifecycle
	NextAction  lifecycle.NextAction
	Diagnostics []diagnosticcontract.DiagnosticItem
	CreatedAt   time.Time
	AppliedAt   *time.Time
	UpdatedAt   time.Time
}

ApplyRecord is one persisted config_apply_records row.

type ApplyRecordDBSource

type ApplyRecordDBSource interface {
	DB() *sql.DB
}

ApplyRecordDBSource exposes the SQL connection needed by the apply-record repository.

type ApplyRecordFilter

type ApplyRecordFilter struct {
	Status lifecycle.Status
	Actor  string
	Limit  int
}

ApplyRecordFilter selects apply-record history rows.

type ApplyRecordStore

type ApplyRecordStore interface {
	CreateApplyRecord(ctx context.Context, record ApplyRecord) (ApplyRecord, error)
	UpdateApplyRecord(ctx context.Context, record ApplyRecord) (ApplyRecord, error)
	ListApplyRecords(ctx context.Context, filter ApplyRecordFilter) ([]ApplyRecord, error)
	LatestAppliedRecord(ctx context.Context) (*ApplyRecord, error)
}

ApplyRecordStore persists config apply attempts.

func NewConfigApplyRecordRepository

func NewConfigApplyRecordRepository(db *sql.DB, now func() time.Time) ApplyRecordStore

NewConfigApplyRecordRepository creates the SQLite-backed config_apply_records repository.

type ApplyResult

type ApplyResult struct {
	Record          ApplyRecord
	Section         SectionName
	Scope           ScopeKind
	WriteTarget     WriteTargetKind
	WorkspaceID     string
	AgentName       string
	Applied         bool
	NextAction      lifecycle.NextAction
	RestartRequired bool
	RestartScope    string
	Warnings        []string
	PartialFailures []ApplyFailure
	Skipped         bool
	SkippedReason   string
	MCPServer       *MCPServerItem `json:"-"`
}

ApplyResult is the public config-apply outcome returned by mutation, reload, and reconcile paths after the attempt is persisted.

type AutomationRuntimeProvider

type AutomationRuntimeProvider interface {
	AutomationRuntimeStatus(ctx context.Context) (AutomationRuntimeStatus, error)
}

AutomationRuntimeProvider returns automation runtime metadata.

type AutomationRuntimeStatus

type AutomationRuntimeStatus struct {
	Available        bool
	Running          bool
	SchedulerRunning bool
	JobTotal         int
	JobEnabled       int
	TriggerTotal     int
	TriggerEnabled   int
	NextFire         *time.Time
	LastSyncedAt     *time.Time
}

AutomationRuntimeStatus summarizes automation runtime state.

type AutomationSection

type AutomationSection struct {
	Config  AutomationSettings
	Runtime AutomationRuntimeStatus
	Links   []OperationalLink
}

AutomationSection is the automation section read model.

type AutomationSettings

type AutomationSettings struct {
	Enabled           bool
	Timezone          string
	MaxConcurrentJobs int
	DefaultFireLimit  automationmodel.FireLimitConfig
}

AutomationSettings groups the editable automation-engine settings.

type CapabilityStatus

type CapabilityStatus struct {
	Available bool
}

CapabilityStatus reports whether one auxiliary feature is available.

type CollectionEnvelope

type CollectionEnvelope struct {
	Collection      CollectionName
	Scope           ScopeKind
	WorkspaceID     string
	AvailableScopes []ScopeKind
	Providers       []ProviderItem
	MCPServers      []MCPServerItem
	Sandboxes       []SandboxItem
	Hooks           []HookItem
}

CollectionEnvelope returns one typed collection payload.

type CollectionItemDeleteRequest

type CollectionItemDeleteRequest struct {
	CollectionRequest
	Name   string
	Target TargetSelector
}

CollectionItemDeleteRequest identifies one collection delete.

type CollectionItemPutRequest

type CollectionItemPutRequest struct {
	CollectionRequest
	Name                  string
	Target                TargetSelector
	Provider              *ProviderSettings
	ProviderModelCuration *ProviderModelCurationRequest
	ProviderSecrets       []ProviderSecretWrite
	MCPServer             *compozyconfig.MCPServer
	MCPSecrets            MCPSecretValues
	MCPSecretPreservation MCPSecretPreservation
	MCPEnvPreservation    []string
	Sandbox               *compozyconfig.SandboxProfile
	Hook                  *hookspkg.HookDecl
}

CollectionItemPutRequest identifies one collection upsert.

type CollectionName

type CollectionName string

CollectionName names one collection-oriented settings resource.

const (
	// CollectionProviders exposes the provider catalog.
	CollectionProviders CollectionName = "providers"
	// CollectionMCPServers exposes the scoped MCP server catalog.
	CollectionMCPServers CollectionName = "mcp-servers"
	// CollectionSandboxes exposes execution sandboxes.
	CollectionSandboxes CollectionName = "sandboxes"
	// CollectionHooks exposes config-defined hook declarations.
	CollectionHooks CollectionName = "hooks"
)

type CollectionRequest

type CollectionRequest struct {
	Collection  CollectionName
	Scope       ScopeKind
	WorkspaceID string
}

CollectionRequest identifies one collection read.

type ConfigPaths

type ConfigPaths struct {
	HomeDir          string
	GlobalConfig     string
	GlobalMCPSidecar string
	LogFile          string
	DaemonInfo       string
}

ConfigPaths exposes resolved daemon config file locations.

type ConfigRuntimeApplier

type ConfigRuntimeApplier interface {
	// ApplyActiveConfig installs a fully projected next-active snapshot, not the persisted desired config.
	ApplyActiveConfig(ctx context.Context, snap *compozyconfig.Config) []ApplyFailure
}

ConfigRuntimeApplier reconciles a validated config snapshot with daemon-owned runtime state.

type DaemonRuntimeStatus

type DaemonRuntimeStatus struct {
	Available      bool
	Status         string
	PID            int
	StartedAt      time.Time
	UptimeSeconds  int64
	Socket         string
	HTTPHost       string
	HTTPPort       int
	ActiveSessions int
	ActiveAgents   int
	TotalSessions  int
	Version        string
}

DaemonRuntimeStatus summarizes daemon-local runtime state.

type Dependencies

type Dependencies struct {
	WorkspaceResolver           WorkspaceResolver
	GeneralRuntime              GeneralRuntimeProvider
	MemoryRuntime               MemoryRuntimeProvider
	SkillsRuntime               SkillsRuntime
	AutomationRuntime           AutomationRuntimeProvider
	NetworkRuntime              NetworkRuntimeProvider
	ObservabilityRuntime        ObservabilityRuntimeProvider
	Extensions                  ExtensionStatusProvider
	TransportParity             TransportParityProvider
	MCPAuth                     MCPAuthRuntimeProvider
	MCPRuntime                  MCPRuntimeProvider
	MCPCatalog                  MCPCatalog
	MarketplaceInstallEvents    MarketplaceInstallNotifier
	MCPDefinitionWriter         MCPDefinitionWriter
	MCPDefinitionRetirer        MCPDefinitionRetirer
	ModelCatalog                modelcatalog.Service
	RuntimeApplier              ConfigRuntimeApplier
	ProviderSecrets             ProviderSecretStore
	EventSummaries              store.EventSummaryStore
	ApplyRecords                ApplyRecordStore
	RestartActionAvailable      bool
	ConsolidateActionAvailable  bool
	LogTailAvailable            bool
	CommandLookPath             func(string) (string, error)
	ProviderAuthCommandResolver authproviders.ProviderAuthCommandResolver
	LookupEnv                   func(string) (string, bool)
}

Dependencies captures the runtime dependencies required by the settings service.

type ExtensionStatusProvider

type ExtensionStatusProvider interface {
	InstalledExtensions(ctx context.Context) ([]InstalledExtension, error)
}

ExtensionStatusProvider returns installed extension summaries.

type GatewaySection

type GatewaySection struct {
	Config compozyconfig.GatewayConfig
}

GatewaySection is the remote gateway section read model.

type GeneralActions

type GeneralActions struct {
	Restart ActionMetadata
}

GeneralActions reports general-section action metadata.

type GeneralRuntimeProvider

type GeneralRuntimeProvider interface {
	GeneralRuntimeStatus(ctx context.Context) (DaemonRuntimeStatus, error)
}

GeneralRuntimeProvider returns general daemon runtime metadata.

type GeneralSection

type GeneralSection struct {
	Runtime     DaemonRuntimeStatus
	ConfigPaths ConfigPaths
	Settings    GeneralSettings
	Actions     GeneralActions
}

GeneralSection is the general section read model.

type GeneralSettings

GeneralSettings groups the editable general section config.

type HookItem

type HookItem struct {
	Name           string
	Declaration    hookspkg.HookDecl
	SourceMetadata SourceMetadata
}

HookItem is one config-defined hook collection row.

type HooksExtensionsSection

type HooksExtensionsSection struct {
	Hooks           []HookItem
	Extensions      compozyconfig.ExtensionsConfig
	Installed       []InstalledExtension
	TransportParity TransportParityStatus
}

HooksExtensionsSection is the hooks and extensions section read model.

type InstalledExtension

type InstalledExtension struct {
	Name          string
	Version       string
	Enabled       bool
	State         string
	Health        string
	HealthMessage string
	LastError     string
	RequiresEnv   []string
	MissingEnv    []string
}

InstalledExtension summarizes one installed extension for settings surfaces.

type MCPAuthBeginRequest

type MCPAuthBeginRequest struct {
	MCPAuthTargetRequest
	CallbackURL            string
	ApprovedScopes         []string
	ApproveScopeEscalation bool
}

MCPAuthBeginRequest starts one daemon-owned OAuth session.

type MCPAuthExchangeRequest

type MCPAuthExchangeRequest struct {
	MCPAuthTargetRequest
	RedirectURL string
}

MCPAuthExchangeRequest completes one daemon-owned OAuth session.

type MCPAuthRuntimeProvider

type MCPAuthRuntimeProvider interface {
	MCPAuthStatus(ctx context.Context, target mcpauth.Target, server compozyconfig.MCPServer) (mcpauth.Status, error)
	MCPAuthBegin(
		ctx context.Context,
		target mcpauth.Target,
		server compozyconfig.MCPServer,
		callbackURL string,
	) (mcpauth.BeginResult, error)
	MCPAuthBeginStepUp(
		ctx context.Context,
		target mcpauth.Target,
		server compozyconfig.MCPServer,
		callbackURL string,
		approvedScopes []string,
		approved bool,
	) (mcpauth.BeginResult, error)
	MCPAuthExchange(
		ctx context.Context,
		target mcpauth.Target,
		server compozyconfig.MCPServer,
		input mcpauth.ExchangeInput,
	) (mcpauth.Status, error)
	MCPAuthCallbackTarget(callbackURL string) (mcpauth.Target, error)
	MCPAuthCompleteCallback(
		ctx context.Context,
		target mcpauth.Target,
		server compozyconfig.MCPServer,
		callbackURL string,
	) (mcpauth.Status, error)
	MCPAuthInvalidate(target mcpauth.Target) error
	MCPAuthDeleteState(ctx context.Context, target mcpauth.Target) error
	MCPAuthLogout(
		ctx context.Context,
		target mcpauth.Target,
		server compozyconfig.MCPServer,
	) (mcpauth.Status, error)
}

MCPAuthRuntimeProvider owns daemon-mediated MCP OAuth sessions and status.

type MCPAuthStatus

type MCPAuthStatus = mcpauth.Status

MCPAuthStatus is a redacted remote MCP authentication status.

type MCPAuthTargetRequest

type MCPAuthTargetRequest struct {
	Scope       ScopeKind
	WorkspaceID string
	Name        string
}

MCPAuthTargetRequest selects one exact global or workspace MCP definition.

type MCPCatalog

type MCPCatalog interface {
	Detail(ctx context.Context, kind marketplace.Kind, entryID string) (*marketplace.Entry, error)
}

MCPCatalog provides the single curated entry read needed by settings-owned install orchestration.

type MCPCatalogInstallNextStep

type MCPCatalogInstallNextStep string

MCPCatalogInstallNextStep directs the caller to the only valid follow-up state.

const (
	MCPCatalogInstallNextStepNone      MCPCatalogInstallNextStep = "none"
	MCPCatalogInstallNextStepAuthorize MCPCatalogInstallNextStep = "authorize"
)

type MCPCatalogInstallRequest

type MCPCatalogInstallRequest struct {
	EntryID     string
	Name        string
	Scope       ScopeKind
	WorkspaceID string
	Values      MCPCatalogInstallValues
}

MCPCatalogInstallRequest identifies one feed entry and its target settings scope.

type MCPCatalogInstallResult

type MCPCatalogInstallResult struct {
	Item     MCPServerItem
	Apply    ApplyResult
	NextStep MCPCatalogInstallNextStep
	Warnings []diagnosticcontract.DiagnosticItem
}

MCPCatalogInstallResult returns the persisted item and its config-apply outcome.

type MCPCatalogInstallValues

type MCPCatalogInstallValues struct {
	Inputs map[string]MCPSecretInput
}

MCPCatalogInstallValues contains operator-supplied catalog input bindings.

type MCPDefinitionRetirer

type MCPDefinitionRetirer interface {
	ForgetMCPServer(workspaceID string, serverName string)
}

MCPDefinitionRetirer retires volatile state owned by a deleted workspace MCP definition.

type MCPDefinitionWriter

type MCPDefinitionWriter func(
	homePaths compozyconfig.HomePaths,
	workspaceRoot string,
	name string,
	target compozyconfig.WriteTarget,
	server compozyconfig.MCPServer,
) error

MCPDefinitionWriter persists one MCP definition to its selected config target.

type MCPRuntimeProvider

type MCPRuntimeProvider interface {
	MCPServerRuntimeStatus(
		ctx context.Context,
		target mcpauth.Target,
		server compozyconfig.MCPServer,
	) (MCPServerRuntimeStatus, error)
}

MCPRuntimeProvider returns daemon-observed runtime probe status for settings rows.

type MCPSecretInput

type MCPSecretInput struct {
	Value    string
	VaultRef string
}

MCPSecretInput is one write-only typed value or one existing Vault binding.

type MCPSecretPreservation

type MCPSecretPreservation struct {
	SecretEnv         []string
	OAuthClientSecret bool
}

MCPSecretPreservation identifies existing bindings to retain without revealing their refs.

type MCPSecretValues

type MCPSecretValues struct {
	SecretEnv         map[string]string
	OAuthClientSecret *string
}

MCPSecretValues is the write-only secret material submitted with an MCP server mutation.

func (MCPSecretValues) Empty

func (v MCPSecretValues) Empty() bool

type MCPServerItem

type MCPServerItem struct {
	Name                   string
	Transport              compozyconfig.MCPServerTransport
	Command                string
	Args                   []string
	EnvKeys                []string
	SecretEnvKeys          []string
	URL                    string
	Auth                   compozyconfig.MCPAuthConfig
	ClientSecretConfigured bool
	AuthStatus             *mcpauth.Status
	RuntimeStatus          *MCPServerRuntimeStatus
	Scope                  ScopeKind
	WorkspaceID            string
	CatalogEntry           string
	CatalogVersion         string
	SourceMetadata         SourceMetadata
}

MCPServerItem is one MCP server collection row.

type MCPServerProbeState

type MCPServerProbeState string

MCPServerProbeState reports whether the runtime probe actually touched the server.

const (
	// MCPServerProbeSkipped reports a real preflight state that prevented probing.
	MCPServerProbeSkipped MCPServerProbeState = "skipped"
	// MCPServerProbeSucceeded reports a successful MCP initialize/list-tools probe.
	MCPServerProbeSucceeded MCPServerProbeState = "succeeded"
	// MCPServerProbeFailed reports a failed MCP initialize/list-tools probe.
	MCPServerProbeFailed MCPServerProbeState = "failed"
)

type MCPServerRuntimeState

type MCPServerRuntimeState string

MCPServerRuntimeState reports the daemon-observed MCP server runtime state.

const (
	// MCPServerRuntimeStateReady reports a server that initialized and listed tools.
	MCPServerRuntimeStateReady MCPServerRuntimeState = "ready"
	// MCPServerRuntimeStateConfigError reports a malformed server definition.
	MCPServerRuntimeStateConfigError MCPServerRuntimeState = "config_error"
	// MCPServerRuntimeStateAuthRequired reports a remote server requiring login.
	MCPServerRuntimeStateAuthRequired MCPServerRuntimeState = "auth_required"
	// MCPServerRuntimeStateAuthExpired reports an expired remote auth token.
	MCPServerRuntimeStateAuthExpired MCPServerRuntimeState = "auth_expired"
	// MCPServerRuntimeStateAuthInvalid reports an invalid remote auth token.
	MCPServerRuntimeStateAuthInvalid MCPServerRuntimeState = "auth_invalid"
	// MCPServerRuntimeStateAuthRefreshFailed reports a failed auth refresh.
	MCPServerRuntimeStateAuthRefreshFailed MCPServerRuntimeState = "auth_refresh_failed"
	// MCPServerRuntimeStatePermissionDenied reports a permission failure while probing.
	MCPServerRuntimeStatePermissionDenied MCPServerRuntimeState = "permission_denied"
	// MCPServerRuntimeStateRuntimeUnavailable reports a configured server that could not be reached.
	MCPServerRuntimeStateRuntimeUnavailable MCPServerRuntimeState = "runtime_unavailable"
	// MCPServerRuntimeStateDead reports a durably suppressed server awaiting recovery.
	MCPServerRuntimeStateDead MCPServerRuntimeState = "dead"
)

type MCPServerRuntimeStatus

type MCPServerRuntimeStatus struct {
	Configured      bool
	Initialized     bool
	State           MCPServerRuntimeState
	Probe           MCPServerProbeState
	ToolCount       int
	ProtocolVersion string
	Reason          string
	Diagnostic      string
}

MCPServerRuntimeStatus is one daemon-backed MCP server probe result.

type MarketplaceInstallNotifier

type MarketplaceInstallNotifier interface {
	NotifyInstall(ctx context.Context, outcome marketplace.InstallOutcome) error
}

MarketplaceInstallNotifier persists redacted install outcomes.

type MemoryActions

type MemoryActions struct {
	Consolidate ActionMetadata
}

MemoryActions reports memory-section action metadata.

type MemoryHealthStatus

type MemoryHealthStatus struct {
	Available          bool
	FileCount          int
	DreamEnabled       bool
	LastConsolidatedAt *time.Time
}

MemoryHealthStatus summarizes memory runtime state.

type MemoryRuntimeProvider

type MemoryRuntimeProvider interface {
	MemoryHealthStatus(ctx context.Context) (MemoryHealthStatus, error)
}

MemoryRuntimeProvider returns memory runtime metadata.

type MemorySection

type MemorySection struct {
	Config  compozyconfig.MemoryConfig
	Health  MemoryHealthStatus
	Actions MemoryActions
}

MemorySection is the memory section read model.

type MutationBehavior

type MutationBehavior string

MutationBehavior classifies how a mutation takes effect at runtime.

const (
	// MutationBehaviorAppliedNow reports a live-applied mutation.
	MutationBehaviorAppliedNow MutationBehavior = "applied_now"
	// MutationBehaviorRestartRequired reports a persisted mutation that needs restart.
	MutationBehaviorRestartRequired MutationBehavior = "restart_required"
	// MutationBehaviorActionTrigger reports a mutation that triggers an action.
	MutationBehaviorActionTrigger MutationBehavior = "action_trigger"
)

type MutationClassification

type MutationClassification struct {
	Behavior        MutationBehavior
	Applied         bool
	RestartRequired bool
	RestartScope    string
	Lifecycle       lifecycle.Lifecycle
	DiffClass       lifecycle.DiffClass
}

MutationClassification reports the classified runtime behavior for one mutation.

func ClassifyMutation

func ClassifyMutation(descriptor MutationDescriptor) (MutationClassification, error)

ClassifyMutation maps one section or collection mutation onto the v1 runtime-apply matrix.

type MutationDescriptor

type MutationDescriptor struct {
	Section       SectionName
	ChangedFields []string
	Action        string
}

MutationDescriptor identifies the changed fields or action behind one mutation.

type MutationResult

type MutationResult struct {
	Section         SectionName      `json:"section"`
	Scope           ScopeKind        `json:"scope"`
	WriteTarget     WriteTargetKind  `json:"write_target,omitempty"`
	WorkspaceID     string           `json:"workspace_id,omitempty"`
	AgentName       string           `json:"agent_name,omitempty"`
	Behavior        MutationBehavior `json:"behavior"`
	Applied         bool             `json:"applied"`
	RestartRequired bool             `json:"restart_required"`
	RestartScope    string           `json:"restart_scope,omitempty"`
	Warnings        []string         `json:"warnings,omitempty"`
	Lifecycle       lifecycle.Lifecycle
	DiffClass       lifecycle.DiffClass
	MCPServer       *MCPServerItem `json:"-"`
}

MutationResult reports the semantic outcome of one settings mutation.

type NetworkRuntimeProvider

type NetworkRuntimeProvider interface {
	NetworkRuntimeStatus(ctx context.Context) (NetworkRuntimeStatus, error)
}

NetworkRuntimeProvider returns network runtime metadata.

type NetworkRuntimeStatus

type NetworkRuntimeStatus struct {
	Available         bool
	Enabled           bool
	Status            string
	LocalPeers        int
	Channels          int
	MessagesReceived  int64
	MessagesDelivered int64
	MessagesRejected  int64
}

NetworkRuntimeStatus summarizes network runtime state.

type NetworkSection

type NetworkSection struct {
	Config  compozyconfig.NetworkConfig
	Runtime NetworkRuntimeStatus
	Links   []OperationalLink
}

NetworkSection is the network section read model.

type ObservabilityRuntimeProvider

type ObservabilityRuntimeProvider interface {
	ObservabilityRuntimeStatus(ctx context.Context) (ObservabilityRuntimeStatus, error)
}

ObservabilityRuntimeProvider returns observability runtime metadata.

type ObservabilityRuntimeStatus

type ObservabilityRuntimeStatus struct {
	Available          bool
	Status             string
	GlobalDBSizeBytes  int64
	SessionDBSizeBytes int64
	ActiveSessions     int
	ActiveAgents       int
	UptimeSeconds      int64
}

ObservabilityRuntimeStatus summarizes observability runtime state.

type ObservabilitySection

type ObservabilitySection struct {
	Config         compozyconfig.ObservabilityConfig
	Runtime        ObservabilityRuntimeStatus
	LogTailSupport CapabilityStatus
}

ObservabilitySection is the observability section read model.

type OperationalLink struct {
	Label string
	Path  string
}

OperationalLink reports one related operational destination.

type ProviderAuthStatus

type ProviderAuthStatus struct {
	Mode       compozyconfig.ProviderAuthMode
	EnvPolicy  compozyconfig.ProviderEnvPolicy
	HomePolicy compozyconfig.ProviderHomePolicy
	State      string
	Code       string
	Message    string
	StatusCmd  string
	Login      authproviders.ProviderLoginDescriptor
}

ProviderAuthStatus is a redacted provider authentication readiness summary.

type ProviderCredentialStatus

type ProviderCredentialStatus struct {
	Name      string
	TargetEnv string
	SecretRef string
	Kind      string
	Required  bool
	Present   bool
	Source    string
}

ProviderCredentialStatus is a redacted launch credential status.

type ProviderFallback

type ProviderFallback struct {
	Source   SourceRef
	Settings ProviderSettings
}

ProviderFallback reports the builtin provider revealed when an overlay is removed.

type ProviderItem

type ProviderItem struct {
	Name             string
	Settings         ProviderSettings
	Default          bool
	CommandAvailable bool
	Credentials      []ProviderCredentialStatus
	AuthStatus       ProviderAuthStatus
	SourceMetadata   SourceMetadata
	Fallback         *ProviderFallback
}

ProviderItem is one provider collection row.

type ProviderModelCurationRequest

type ProviderModelCurationRequest struct {
	ProviderID             string
	ModelID                string
	Hidden                 *bool
	Featured               *bool
	Deprecated             *bool
	DefaultReasoningEffort *modelcatalog.ReasoningEffort
}

ProviderModelCurationRequest identifies one global provider-model curation mutation.

type ProviderModelCurationResult

type ProviderModelCurationResult struct {
	Model modelcatalog.Model
	Apply ApplyResult
}

ProviderModelCurationResult reports the applied config generation and effective model row.

type ProviderSecretStore

type ProviderSecretStore interface {
	GetMetadata(ctx context.Context, ref string) (vault.Metadata, error)
	ResolveRef(ctx context.Context, ref string) (string, error)
	PutSecret(ctx context.Context, ref string, kind string, plaintext string) (vault.Metadata, error)
	DeleteSecret(ctx context.Context, ref string) error
}

ProviderSecretStore stores provider-bound secrets and returns redacted metadata.

type ProviderSecretWrite

type ProviderSecretWrite struct {
	Name      string
	SecretRef string
	Kind      string
	Value     string
}

ProviderSecretWrite is one write-only provider secret mutation.

type ProviderSettings

type ProviderSettings struct {
	Command         string
	DisplayName     string
	Models          compozyconfig.ProviderModelsConfig
	ModelsSet       bool
	Harness         compozyconfig.ProviderHarness
	RuntimeProvider string
	Transport       string
	BaseURL         string
	AuthMode        compozyconfig.ProviderAuthMode
	EnvPolicy       compozyconfig.ProviderEnvPolicy
	HomePolicy      compozyconfig.ProviderHomePolicy
	AuthStatusCmd   string
	AuthLoginCmd    string
	AuthLoginCmdSet bool
	CredentialSlots []compozyconfig.ProviderCredentialSlot
}

ProviderSettings is the editable provider overlay payload.

type RolesSection

type RolesSection struct {
	Config compozyconfig.RolesConfig
}

RolesSection is the background-role routing read model.

type SandboxItem

type SandboxItem struct {
	Name                string
	Profile             compozyconfig.SandboxProfile
	WorkspaceUsageCount int
	SourceMetadata      SourceMetadata
}

SandboxItem is one sandbox collection row.

type ScopeKind

type ScopeKind string

ScopeKind identifies the supported settings scope.

const (
	// ScopeGlobal selects the global Compozy home scope.
	ScopeGlobal ScopeKind = "global"
	// ScopeWorkspace selects one workspace-local overlay scope.
	ScopeWorkspace ScopeKind = "workspace"
	// ScopeAgent selects one effective agent-local overlay scope.
	ScopeAgent ScopeKind = "agent"
)

func (ScopeKind) Validate

func (s ScopeKind) Validate() error

Validate ensures the requested settings scope is supported.

type SectionEnvelope

type SectionEnvelope struct {
	Section         SectionName
	Scope           ScopeKind
	WorkspaceID     string
	AgentName       string
	AvailableScopes []ScopeKind
	General         *GeneralSection
	Memory          *MemorySection
	Roles           *RolesSection
	Skills          *SkillsSection
	Automation      *AutomationSection
	Network         *NetworkSection
	Gateway         *GatewaySection
	WindowManager   *WindowManagerSection
	Observability   *ObservabilitySection
	HooksExtensions *HooksExtensionsSection
}

SectionEnvelope returns one typed section payload.

type SectionName

type SectionName string

SectionName names one section-oriented settings resource.

const (
	// SectionGeneral exposes daemon-wide runtime and config defaults.
	SectionGeneral SectionName = "general"
	// SectionMemory exposes memory and dream settings.
	SectionMemory SectionName = "memory"
	// SectionRoles exposes background role routing settings.
	SectionRoles SectionName = "roles"
	// SectionSkills exposes global skills-engine settings.
	SectionSkills SectionName = "skills"
	// SectionAutomation exposes automation engine settings.
	SectionAutomation SectionName = "automation"
	// SectionNetwork exposes embedded network settings.
	SectionNetwork SectionName = "network"
	// SectionGateway exposes remote gateway configuration.
	SectionGateway SectionName = "gateway"
	// SectionWindowManager exposes daemon-owned window behavior defaults.
	SectionWindowManager SectionName = "window-manager"
	// SectionObservability exposes observe and transcript settings.
	SectionObservability SectionName = "observability"
	// SectionHooksExtensions exposes hook declarations plus extension policy.
	SectionHooksExtensions SectionName = "hooks-extensions"
)

type SectionRequest

type SectionRequest struct {
	Section     SectionName
	Scope       ScopeKind
	WorkspaceID string
	AgentName   string
}

SectionRequest identifies one section read.

type SectionUpdateRequest

SectionUpdateRequest identifies one section mutation.

type Service

type Service interface {
	GetSection(ctx context.Context, req SectionRequest) (SectionEnvelope, error)
	UpdateSection(ctx context.Context, req SectionUpdateRequest) (MutationResult, error)
	ApplySection(ctx context.Context, req SectionUpdateRequest) (ApplyResult, error)
	ListCollection(ctx context.Context, req CollectionRequest) (CollectionEnvelope, error)
	PutCollectionItem(ctx context.Context, req CollectionItemPutRequest) (MutationResult, error)
	ApplyCollectionItem(ctx context.Context, req CollectionItemPutRequest) (ApplyResult, error)
	ApplyProviderModelCuration(
		ctx context.Context,
		req ProviderModelCurationRequest,
	) (ProviderModelCurationResult, error)
	InstallMCPCatalog(ctx context.Context, req MCPCatalogInstallRequest) (MCPCatalogInstallResult, error)
	GetMCPAuthStatus(ctx context.Context, req MCPAuthTargetRequest) (mcpauth.Status, error)
	BeginMCPAuth(ctx context.Context, req MCPAuthBeginRequest) (mcpauth.BeginResult, error)
	ExchangeMCPAuth(ctx context.Context, req MCPAuthExchangeRequest) (mcpauth.Status, error)
	CompleteMCPAuthCallback(ctx context.Context, callbackURL string) (mcpauth.Status, error)
	LogoutMCPAuth(ctx context.Context, req MCPAuthTargetRequest) (mcpauth.Status, error)
	DeleteCollectionItem(ctx context.Context, req CollectionItemDeleteRequest) (MutationResult, error)
	ApplyCollectionDelete(ctx context.Context, req CollectionItemDeleteRequest) (ApplyResult, error)
	Reload(ctx context.Context) (ApplyResult, error)
	ActiveConfig(ctx context.Context) (compozyconfig.Config, error)
	HasPendingConfigRestart(ctx context.Context) (bool, error)
	ListApplyRecords(ctx context.Context, filter ApplyRecordFilter) ([]ApplyRecord, error)
}

Service is the daemon-facing settings orchestration boundary.

func NewService

func NewService(homePaths compozyconfig.HomePaths, deps Dependencies) (Service, error)

NewService constructs the daemon-facing settings orchestration service.

type SkillsDiagnosticsRuntime

type SkillsDiagnosticsRuntime interface {
	SkillDiagnostics(
		ctx context.Context,
		resolved *workspacepkg.ResolvedWorkspace,
		agentName string,
	) ([]skillspkg.SkillDiagnostic, error)
}

SkillsDiagnosticsRuntime optionally exposes resolver diagnostics for settings.

type SkillsRuntime

type SkillsRuntime interface {
	List() []*skillspkg.Skill
	ForAgent(
		ctx context.Context,
		resolved *workspacepkg.ResolvedWorkspace,
		agentName string,
	) ([]*skillspkg.Skill, error)
	SetEnabled(name string, resolved *workspacepkg.ResolvedWorkspace, enabled bool) error
	SetEnabledForAgent(name string, resolved *workspacepkg.ResolvedWorkspace, agentName string, enabled bool) error
}

SkillsRuntime exposes the global skills registry state used by settings.

type SkillsSection

type SkillsSection struct {
	Config           compozyconfig.SkillsConfig
	DiscoveredCount  int
	DisabledCount    int
	RuntimeAvailable bool
	Diagnostics      []skillspkg.SkillDiagnostic
	Links            []OperationalLink
}

SkillsSection is the skills section read model.

type SourceKind

type SourceKind string

SourceKind identifies one semantic resource source.

const (
	// SourceKindBuiltinProvider identifies the builtin provider registry.
	SourceKindBuiltinProvider SourceKind = "builtin-provider"
	// SourceKindGlobalConfig identifies the global TOML config.
	SourceKindGlobalConfig SourceKind = "global-config"
	// SourceKindWorkspaceConfig identifies the workspace TOML config.
	SourceKindWorkspaceConfig SourceKind = "workspace-config"
	// SourceKindGlobalMCPSidecar identifies the global MCP JSON sidecar.
	SourceKindGlobalMCPSidecar SourceKind = "global-mcp-sidecar"
	// SourceKindWorkspaceMCPSidecar identifies the workspace MCP JSON sidecar.
	SourceKindWorkspaceMCPSidecar SourceKind = "workspace-mcp-sidecar"
	// SourceKindGlobalAgentFile identifies a global AGENT.md frontmatter source.
	SourceKindGlobalAgentFile SourceKind = "global-agent-file"
	// SourceKindWorkspaceAgentFile identifies a workspace/additional AGENT.md frontmatter source.
	SourceKindWorkspaceAgentFile SourceKind = "workspace-agent-file"
)

type SourceMetadata

type SourceMetadata struct {
	EffectiveSource  SourceRef
	ShadowedSources  []SourceRef
	AvailableTargets []WriteTargetKind
}

SourceMetadata reports precedence and target information for one resource.

type SourceRef

type SourceRef struct {
	Kind        SourceKind
	Scope       ScopeKind
	WorkspaceID string
	AgentName   string
}

SourceRef identifies one semantic source for a resolved resource.

type TargetSelector

type TargetSelector string

TargetSelector selects one MCP persistence destination.

const (
	// TargetAuto edits the highest-precedence definition in the selected scope.
	TargetAuto TargetSelector = "auto"
	// TargetConfig edits the TOML-backed source in the selected scope.
	TargetConfig TargetSelector = "config"
	// TargetSidecar edits the sidecar-backed source in the selected scope.
	TargetSidecar TargetSelector = "sidecar"
)

func (TargetSelector) Normalize

func (s TargetSelector) Normalize() TargetSelector

Normalize returns the canonical selector, defaulting an omitted selector to auto.

func (TargetSelector) Validate

func (s TargetSelector) Validate() error

Validate reports malformed MCP target selectors instead of silently selecting auto.

type TransportParityProvider

type TransportParityProvider interface {
	TransportParityStatus(ctx context.Context) (TransportParityStatus, error)
}

TransportParityProvider returns settings transport parity metadata.

type TransportParityStatus

type TransportParityStatus struct {
	Known          bool
	SettingsHTTP   bool
	SettingsUDS    bool
	ExtensionsHTTP bool
	ExtensionsUDS  bool
}

TransportParityStatus reports whether required settings transports are present.

type WindowManagerSection

type WindowManagerSection struct {
	Config compozyconfig.WindowManagerConfig
}

WindowManagerSection is the window-manager section read model.

type WorkspaceResolver

type WorkspaceResolver interface {
	Resolve(ctx context.Context, idOrNameOrPath string) (workspacepkg.ResolvedWorkspace, error)
	List(ctx context.Context) ([]workspacepkg.Workspace, error)
}

WorkspaceResolver resolves and lists registered workspaces for settings flows.

type WriteTargetKind

type WriteTargetKind = compozyconfig.WriteTargetKind

WriteTargetKind identifies the semantic persistence target for one mutation.

Jump to

Keyboard shortcuts

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