diff options
Diffstat (limited to 'makima/src/daemon/ws/protocol.rs')
| -rw-r--r-- | makima/src/daemon/ws/protocol.rs | 36 |
1 files changed, 36 insertions, 0 deletions
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<String>, }, + /// 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<String>, + /// 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<String>, + 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 } |
