From b0d0b4848b2fc8a44c2575e09a08b34aaf6e1484 Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 27 Jan 2026 01:25:29 +0000 Subject: Default to shared worktree and add worktree endpoint --- makima/src/daemon/ws/protocol.rs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 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 018dc7b..6e4f5cf 100644 --- a/makima/src/daemon/ws/protocol.rs +++ b/makima/src/daemon/ws/protocol.rs @@ -270,6 +270,34 @@ pub enum DaemonMessage { error: Option, }, + /// Response to GetWorktreeInfo command. + WorktreeInfoResult { + #[serde(rename = "taskId")] + task_id: Uuid, + success: bool, + /// Path to the worktree directory + #[serde(rename = "worktreePath")] + worktree_path: Option, + /// Whether the worktree exists + exists: bool, + /// Number of files changed + #[serde(rename = "filesChanged")] + files_changed: i32, + /// Total lines inserted + insertions: i32, + /// Total lines deleted + deletions: i32, + /// Changed files list: [{path, status, linesAdded, linesRemoved}] + files: Option, + /// Current branch name + branch: Option, + /// Current HEAD commit SHA + #[serde(rename = "headSha")] + head_sha: Option, + /// Error message if failed + error: Option, + }, + /// Response to CreateCheckpoint command. CheckpointCreated { #[serde(rename = "taskId")] @@ -449,6 +477,9 @@ pub enum DaemonCommand { /// Whether the contract is in local-only mode (skips automatic completion actions). #[serde(rename = "localOnly", default)] local_only: bool, + /// Task ID to share worktree with (supervisor's task ID). If Some, use that task's worktree instead of creating a new one. + #[serde(rename = "supervisorWorktreeTaskId", default, skip_serializing_if = "Option::is_none")] + supervisor_worktree_task_id: Option, }, /// Pause a running task. @@ -656,6 +687,12 @@ pub enum DaemonCommand { task_id: Uuid, }, + /// Get worktree information (files, stats, branch) for a task. + GetWorktreeInfo { + #[serde(rename = "taskId")] + task_id: Uuid, + }, + /// Create a checkpoint (stage changes, commit, get stats). CreateCheckpoint { #[serde(rename = "taskId")] -- cgit v1.2.3