From 5d1fbed2733e93cc2be2e1a89ca022d88bef613f Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 24 Feb 2026 23:37:44 +0000 Subject: feat: non-blocking reconcile polling, directive CLI orders & cleanup (#82) * feat: soryu-co/soryu - makima: Remove aarch64-unknown-linux-gnu from release workflow * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Implement non-blocking ask with client-side polling for reconcile mode --- makima/src/daemon/api/supervisor.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'makima/src/daemon/api/supervisor.rs') diff --git a/makima/src/daemon/api/supervisor.rs b/makima/src/daemon/api/supervisor.rs index c67c9ca..675b0bb 100644 --- a/makima/src/daemon/api/supervisor.rs +++ b/makima/src/daemon/api/supervisor.rs @@ -83,6 +83,20 @@ pub struct AskQuestionRequest { pub question_type: String, } +/// Request to create an order for future work. +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +pub struct CreateOrderRequest { + pub title: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + pub priority: String, + pub order_type: String, + pub labels: serde_json::Value, + #[serde(skip_serializing_if = "Option::is_none")] + pub repository_url: Option, +} + // Generic response type for JSON output #[derive(Deserialize, Serialize)] pub struct JsonValue(pub serde_json::Value); @@ -228,6 +242,18 @@ impl ApiClient { self.post("/api/v1/mesh/supervisor/questions", &req).await } + /// Poll for a question response by question_id. + /// + /// Used after a still_pending response from supervisor_ask. Blocks for up to + /// 5 minutes on the server side. Returns still_pending if no response yet. + pub async fn supervisor_poll_question( + &self, + question_id: Uuid, + ) -> Result { + self.get(&format!("/api/v1/mesh/supervisor/questions/{}/poll", question_id)) + .await + } + /// Advance contract to a new phase. /// /// When `confirmed` is false and phase_guard is enabled, returns a response with @@ -312,6 +338,11 @@ impl ApiClient { .await } + /// Create an order for future work from a directive task. + pub async fn create_order(&self, req: &CreateOrderRequest) -> Result { + self.post("/api/v1/mesh/supervisor/orders", req).await + } + /// Delete a task. pub async fn delete_task(&self, task_id: Uuid) -> Result<(), ApiError> { self.delete(&format!("/api/v1/mesh/tasks/{}", task_id)).await -- cgit v1.2.3