From f6d5692eb1e290689df516cec6fe77f07d419783 Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 27 Jan 2026 02:38:37 +0000 Subject: Fix worktree info and patches endpoint --- makima/src/server/state.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'makima/src/server/state.rs') diff --git a/makima/src/server/state.rs b/makima/src/server/state.rs index b3cf27d..6872d5e 100644 --- a/makima/src/server/state.rs +++ b/makima/src/server/state.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use dashmap::DashMap; use sqlx::PgPool; -use tokio::sync::{broadcast, mpsc, Mutex, OnceCell}; +use tokio::sync::{broadcast, mpsc, oneshot, Mutex, OnceCell}; use uuid::Uuid; use crate::listen::{DiarizationConfig, ParakeetEOU, ParakeetTDT, Sortformer}; @@ -188,6 +188,23 @@ pub struct SupervisorQuestionResponse { pub responded_at: chrono::DateTime, } +/// Worktree info response from daemon +#[derive(Debug, Clone, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct WorktreeInfoResponse { + pub task_id: Uuid, + pub success: bool, + pub worktree_path: Option, + pub exists: bool, + pub files_changed: i32, + pub insertions: i32, + pub deletions: i32, + pub files: Option, + pub branch: Option, + pub head_sha: Option, + pub error: Option, +} + /// Command sent from server to daemon. #[derive(Debug, Clone, serde::Serialize)] #[serde(tag = "type", rename_all = "camelCase")] @@ -563,6 +580,8 @@ pub struct AppState { pub tool_keys: DashMap, /// JWT verifier for Supabase authentication (None if not configured) pub jwt_verifier: Option, + /// Pending worktree info requests awaiting daemon response (keyed by task_id) + pub pending_worktree_info: DashMap>, } impl AppState { @@ -636,6 +655,7 @@ impl AppState { daemon_connections: DashMap::new(), tool_keys: DashMap::new(), jwt_verifier, + pending_worktree_info: DashMap::new(), } } -- cgit v1.2.3