diff options
Diffstat (limited to 'makima/src/server/state.rs')
| -rw-r--r-- | makima/src/server/state.rs | 22 |
1 files changed, 21 insertions, 1 deletions
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<chrono::Utc>, } +/// 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<String>, + pub exists: bool, + pub files_changed: i32, + pub insertions: i32, + pub deletions: i32, + pub files: Option<serde_json::Value>, + pub branch: Option<String>, + pub head_sha: Option<String>, + pub error: Option<String>, +} + /// 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<String, Uuid>, /// JWT verifier for Supabase authentication (None if not configured) pub jwt_verifier: Option<JwtVerifier>, + /// Pending worktree info requests awaiting daemon response (keyed by task_id) + pub pending_worktree_info: DashMap<Uuid, oneshot::Sender<WorktreeInfoResponse>>, } impl AppState { @@ -636,6 +655,7 @@ impl AppState { daemon_connections: DashMap::new(), tool_keys: DashMap::new(), jwt_verifier, + pending_worktree_info: DashMap::new(), } } |
