Documentation
¶
Overview ¶
Package daemon wires every component into the running `caprock up` process: store, pricing, recorder, hookd, ingest, loop detector, API/WS server, the idle sweeper, and the runtime.json lifecycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is a running instance.
type Options ¶
type Options struct {
DataDir string
Config config.Config
Version string
Log *slog.Logger
TranscriptRoot string // "" ⇒ ~/.claude/projects
// Listener overrides the port (tests pass a pre-bound 127.0.0.1:0 listener).
Listener net.Listener
// DisableIngest turns transcript tailing off (tests, or hooks-only mode).
DisableIngest bool
// IdleAfter is the silence threshold before a session is marked idle.
IdleAfter time.Duration
// EndAfter is the silence threshold before a session is marked ended (default 12h).
EndAfter time.Duration
// HiveDir enables Phase 2 orchestration (tasks board + Stop-loop) at this path.
// Empty ⇒ orchestration off (task endpoints return 501).
HiveDir string
// RepoCwd is the repo the orchestrator + workers operate on (default: cwd).
RepoCwd string
// OnReady is called once the server is listening (with the bound URL).
OnReady func(url string)
}
Options configure a daemon run.
type PricingStatus ¶
type PricingStatus struct {
Version string `json:"version"`
Source string `json:"source"`
FetchedAt string `json:"fetched_at"`
UserOverride bool `json:"user_override"`
Models int `json:"models"`
}
PricingStatus summarizes the table in force.
type Status ¶
type Status struct {
Version string `json:"version"`
PID int `json:"pid"`
StartedAt int64 `json:"started_at"`
UptimeS int64 `json:"uptime_s"`
URL string `json:"url"`
DataDir string `json:"data_dir"`
Pricing PricingStatus `json:"pricing"`
Ingest *ingest.Stats `json:"ingest,omitempty"`
Hooks *hooks.Status `json:"hooks,omitempty"`
UIBuilt bool `json:"ui_built"`
ClaudeAvailable bool `json:"claude_available"`
OwnedActive int `json:"owned_active"`
Orchestration bool `json:"orchestration"`
LoopK int `json:"loop_k"`
LoopTMin int `json:"loop_t_minutes"`
ActiveLoops int `json:"active_loops"`
Events int64 `json:"events"`
RetentionDays int `json:"retention_days"`
// Desktop is the Claude desktop app's own plan usage, when it has any on
// this machine. Omitted entirely otherwise — most people do not use it.
Desktop *desktop.Reading `json:"desktop,omitempty"`
}
Status is /v1/status.