Documentation
¶
Overview ¶
Package workerstate records worker lifecycle and readiness state.
Package workerstate persists the local worker heartbeat shown by `codog state`.
Index ¶
Constants ¶
View Source
const FileName = "worker-state.json"
FileName is the workspace-local JSON file used for worker state snapshots.
Variables ¶
This section is empty.
Functions ¶
func RenderText ¶
RenderText writes a compact human-readable worker state report.
Types ¶
type MissingError ¶
type MissingError struct {
Path string
}
MissingError reports that a workspace has not written worker state yet.
func (MissingError) Error ¶
func (e MissingError) Error() string
Error returns an actionable message for creating the missing worker state.
type Options ¶
type Options struct {
WorkerID string
Version string
Mode string
Status string
Workspace string
SessionID string
SessionPath string
Model string
PermissionMode string
PID int
LastError string
Ship *ship.Report
Now time.Time
}
Options contains the runtime facts captured in a worker state snapshot.
type State ¶
type State struct {
Kind string `json:"kind"`
WorkerID string `json:"worker_id"`
Version string `json:"version"`
Mode string `json:"mode"`
Status string `json:"status"`
Workspace string `json:"workspace"`
SessionID string `json:"session_id,omitempty"`
SessionPath string `json:"session_path,omitempty"`
Model string `json:"model,omitempty"`
PermissionMode string `json:"permission_mode,omitempty"`
PID int `json:"pid"`
LastError string `json:"last_error,omitempty"`
Ship *ship.Report `json:"ship,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
State is the stable JSON payload written by prompt and REPL workers.
Click to show internal directories.
Click to hide internal directories.