summaryrefslogtreecommitdiff
path: root/makima/src/daemon/ws
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/daemon/ws')
-rw-r--r--makima/src/daemon/ws/protocol.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/makima/src/daemon/ws/protocol.rs b/makima/src/daemon/ws/protocol.rs
index ec9b09e..7b0a0b4 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")]
@@ -403,6 +422,10 @@ pub enum DaemonCommand {
/// Commit SHA to apply the patch on top of.
#[serde(rename = "patchBaseSha", default, skip_serializing_if = "Option::is_none")]
patch_base_sha: Option<String>,
+ /// Task IDs that must complete before this task can start.
+ /// Used for enforcing execution order: schema changes -> backend -> UI.
+ #[serde(rename = "dependsOn", default, skip_serializing_if = "Option::is_none")]
+ depends_on: Option<Vec<Uuid>>,
},
/// Pause a running task.
@@ -698,6 +721,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 }