Documentation
¶
Overview ¶
Package daemon registers all Reconcilable providers that the kernel daemon (cmd/cogos) needs to surface in proprioception health blocks.
Background: The 8 production providers (agent, component, discord, mcp-tools, openclaw-agents, openclaw-cron, openclaw-gateway, service) were originally defined in the workspace-root package main of the cog CLI. Because package main cannot be imported, the daemon binary (built from cmd/cogos) could not reach those registrations and pkg/reconcile.ListProviders() always returned empty.
This package provides daemon-safe provider structs whose Health() implementations replicate the workspace-root logic using only importable packages (os, filepath, pkg/reconcile). The non-health methods (LoadConfig, FetchLive, ComputePlan, ApplyPlan, BuildState) return errors — the daemon only exercises Health() through the proprioception block.
Workspace context is injected at boot via SetWorkspaceRoot(), called by engine.SetProvidersWorkspace after LoadConfig resolves cfg.WorkspaceRoot. This avoids the workspace.ResolveWorkspace() dependency-injection seams (LoadConfig/GitRoot func vars) that are only wired in the cog CLI's main package, not in cmd/cogos.
The component provider is already fully extracted to internal/providers/component and is wired here via blank import. The other seven are implemented as minimal structs below.
cmd/cogos/providers_wire.go imports this package (triggering init()) and wires both engine.RegisterProviders and engine.SetProvidersWorkspace so the full seam is operational before the HTTP server starts serving requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetWorkspaceRoot ¶
func SetWorkspaceRoot(root string)
SetWorkspaceRoot injects the resolved workspace path into this package so that all daemon-side provider Health() implementations can resolve their filesystem checks without depending on workspace.ResolveWorkspace(), whose dependency-injection seams (LoadConfig/GitRoot) are not wired in the cmd/cogos binary.
Must be called before any provider Health() invocation — engine.runServe() calls it via engine.SetProvidersWorkspace immediately after LoadConfig resolves cfg.WorkspaceRoot.
Types ¶
This section is empty.