From 579c983d3efb8f1414ffb45b9e031f741cce5f76 Mon Sep 17 00:00:00 2001 From: soryu Date: Fri, 23 Jan 2026 23:52:35 +0000 Subject: Add resume to daemon tasks --- makima/src/daemon/ws/protocol.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'makima/src/daemon/ws/protocol.rs') diff --git a/makima/src/daemon/ws/protocol.rs b/makima/src/daemon/ws/protocol.rs index ec9b09e..2e7caef 100644 --- a/makima/src/daemon/ws/protocol.rs +++ b/makima/src/daemon/ws/protocol.rs @@ -60,6 +60,25 @@ pub enum DaemonMessage { error: Option, }, + /// Task recovery detected after daemon restart. + /// Sent when daemon finds orphaned tasks that can be recovered. + TaskRecoveryDetected { + #[serde(rename = "taskId")] + task_id: Uuid, + /// Previous state of the task before daemon restart. + #[serde(rename = "previousState")] + previous_state: String, + /// Whether the worktree is still intact. + #[serde(rename = "worktreeIntact")] + worktree_intact: bool, + /// Path to the worktree if available. + #[serde(rename = "worktreePath")] + worktree_path: Option, + /// Whether the task needs a checkpoint patch for recovery. + #[serde(rename = "needsPatch")] + needs_patch: bool, + }, + /// Register a tool key for orchestrator API access. RegisterToolKey { #[serde(rename = "taskId")] @@ -698,6 +717,23 @@ impl DaemonMessage { } } + /// Create a task recovery detected message. + pub fn task_recovery_detected( + task_id: Uuid, + previous_state: &str, + worktree_intact: bool, + worktree_path: Option, + needs_patch: bool, + ) -> Self { + Self::TaskRecoveryDetected { + task_id, + previous_state: previous_state.to_string(), + worktree_intact, + worktree_path, + needs_patch, + } + } + /// Create a register tool key message. pub fn register_tool_key(task_id: Uuid, key: String) -> Self { Self::RegisterToolKey { task_id, key } -- cgit v1.2.3