diff options
| author | soryu <soryu@soryu.co> | 2026-01-27 02:38:37 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-27 02:38:37 +0000 |
| commit | f6d5692eb1e290689df516cec6fe77f07d419783 (patch) | |
| tree | 7679fd1a6c3dee19849c0b835fa9e661c36ef053 /makima/src/server/state.rs | |
| parent | f1129adb9799c9c9ca26189220bf9af5970f50fa (diff) | |
| download | soryu-f6d5692eb1e290689df516cec6fe77f07d419783.tar.gz soryu-f6d5692eb1e290689df516cec6fe77f07d419783.zip | |
Fix worktree info and patches endpoint
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(), } } |
