diff --git a/internal/claudehost/wire.go b/internal/claudehost/wire.go index 3482980d..e908e305 100644 --- a/internal/claudehost/wire.go +++ b/internal/claudehost/wire.go @@ -68,6 +68,19 @@ type Pending struct { Offset int64 `json:"offset"` } +// Task is a native background tool still owned by the hosted CLI. It is kept +// separately from the bounded output spool, so trimming old output cannot erase +// the identity needed by a reattaching server. Missing metadata stays absent. +type Task struct { + ToolUseID string `json:"tool_use_id,omitempty"` + TaskID string `json:"task_id,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + TaskType string `json:"task_type,omitempty"` + Command string `json:"command,omitempty"` + Timestamp string `json:"timestamp,omitempty"` +} + // Status is the host's snapshot of its CLI. type Status struct { Version int `json:"version"` @@ -84,6 +97,10 @@ type Status struct { // live processing resumes. Busy bool `json:"busy"` BusyAtAcked bool `json:"busy_at_acked"` + // Tasks is the authoritative running background set at End. Nil means an + // older host did not report this capability; a nonnil empty list means it + // knows that no background tasks remain. Reconcile after replay reaches End. + Tasks *[]Task `json:"tasks,omitempty"` // Init is the CLI's initialize response (models, account), so a // reconnecting server does not initialize the CLI twice. Init json.RawMessage `json:"init,omitempty"`