diff options
| author | soryu <soryu@soryu.co> | 2026-01-26 19:00:20 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-26 19:00:20 +0000 |
| commit | 39c743467391e00c7c970753e6165b025784af76 (patch) | |
| tree | cecb31cbc57c9ee046b1f8b9aed5934c3c2570bb /makima/src/daemon | |
| parent | cb4f2fc40dbabb40de948512eee74c7e46264665 (diff) | |
| download | soryu-39c743467391e00c7c970753e6165b025784af76.tar.gz soryu-39c743467391e00c7c970753e6165b025784af76.zip | |
[WIP] Heartbeat checkpoint - 2026-01-26 19:00:20 UTC
Diffstat (limited to 'makima/src/daemon')
| -rw-r--r-- | makima/src/daemon/ws/protocol.rs | 87 |
1 files changed, 87 insertions, 0 deletions
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<String>, }, + + // ========================================================================= + // 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<String>, + /// Number of files in the patch + #[serde(rename = "filesCount")] + files_count: Option<usize>, + /// Lines added + #[serde(rename = "linesAdded")] + lines_added: Option<usize>, + /// Lines removed + #[serde(rename = "linesRemoved")] + lines_removed: Option<usize>, + /// Base commit SHA for applying the patch + #[serde(rename = "baseCommitSha")] + base_commit_sha: Option<String>, + /// Error message if failed + error: Option<String>, + }, + + /// Response to GetWorktreeInfo command. + WorktreeInfo { + #[serde(rename = "taskId")] + task_id: Uuid, + success: bool, + /// Worktree path + path: Option<String>, + /// Current branch name + branch: Option<String>, + /// Base commit SHA + #[serde(rename = "baseCommit")] + base_commit: Option<String>, + /// List of changed files + #[serde(rename = "filesChanged")] + files_changed: Option<Vec<ChangedFileInfo>>, + /// Whether there are uncommitted changes + #[serde(rename = "hasUncommittedChanges")] + has_uncommitted_changes: Option<bool>, + /// Error message if failed + error: Option<String>, + }, +} + +/// 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<String>, }, + // ========================================================================= + // 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, |
