From 39c743467391e00c7c970753e6165b025784af76 Mon Sep 17 00:00:00 2001 From: soryu Date: Mon, 26 Jan 2026 19:00:20 +0000 Subject: [WIP] Heartbeat checkpoint - 2026-01-26 19:00:20 UTC --- makima/src/daemon/ws/protocol.rs | 87 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) (limited to 'makima/src/daemon') diff --git a/makima/src/daemon/ws/protocol.rs b/makima/src/daemon/ws/protocol.rs index 2e7caef..7e26bac 100644 --- a/makima/src/daemon/ws/protocol.rs +++ b/makima/src/daemon/ws/protocol.rs @@ -328,6 +328,74 @@ pub enum DaemonMessage { /// Error message if failed error: Option, }, + + // ========================================================================= + // Export Patch Response Messages + // ========================================================================= + + /// Response to CreateExportPatch command. + ExportPatchCreated { + #[serde(rename = "taskId")] + task_id: Uuid, + #[serde(rename = "contractId")] + contract_id: Uuid, + success: bool, + /// The patch content (uncompressed git diff) + #[serde(rename = "patchContent")] + patch_content: Option, + /// Number of files in the patch + #[serde(rename = "filesCount")] + files_count: Option, + /// Lines added + #[serde(rename = "linesAdded")] + lines_added: Option, + /// Lines removed + #[serde(rename = "linesRemoved")] + lines_removed: Option, + /// Base commit SHA for applying the patch + #[serde(rename = "baseCommitSha")] + base_commit_sha: Option, + /// Error message if failed + error: Option, + }, + + /// Response to GetWorktreeInfo command. + WorktreeInfo { + #[serde(rename = "taskId")] + task_id: Uuid, + success: bool, + /// Worktree path + path: Option, + /// Current branch name + branch: Option, + /// Base commit SHA + #[serde(rename = "baseCommit")] + base_commit: Option, + /// List of changed files + #[serde(rename = "filesChanged")] + files_changed: Option>, + /// Whether there are uncommitted changes + #[serde(rename = "hasUncommittedChanges")] + has_uncommitted_changes: Option, + /// Error message if failed + error: Option, + }, +} + +/// Information about a changed file in a worktree. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ChangedFileInfo { + /// File path relative to worktree root + pub path: String, + /// Status: "added", "modified", "deleted" + pub status: String, + /// Lines added + #[serde(rename = "linesAdded")] + pub lines_added: i32, + /// Lines removed + #[serde(rename = "linesRemoved")] + pub lines_removed: i32, } /// Information about a branch (used in BranchList message). @@ -654,6 +722,25 @@ pub enum DaemonCommand { source_dir: Option, }, + // ========================================================================= + // Export Patch Commands + // ========================================================================= + + /// Create an export patch for a task's changes. + CreateExportPatch { + #[serde(rename = "taskId")] + task_id: Uuid, + /// Contract ID for creating the patch file. + #[serde(rename = "contractId")] + contract_id: Uuid, + }, + + /// Get worktree information for a task. + GetWorktreeInfo { + #[serde(rename = "taskId")] + task_id: Uuid, + }, + /// Error response. Error { code: String, -- cgit v1.2.3