From eeafe072bc6bb81459f7d087b48fc921afe9cc11 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 15 Jan 2026 03:26:28 +0000 Subject: Automatically derive repo URL and add notifications for input --- makima/src/daemon/api/supervisor.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 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 b691cc4..a1e8682 100644 --- a/makima/src/daemon/api/supervisor.rs +++ b/makima/src/daemon/api/supervisor.rs @@ -62,6 +62,17 @@ pub struct CheckpointRequest { pub message: String, } +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +pub struct AskQuestionRequest { + pub question: String, + #[serde(skip_serializing_if = "Vec::is_empty")] + pub choices: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub context: Option, + pub timeout_seconds: i32, +} + // Generic response type for JSON output #[derive(Deserialize, Serialize)] pub struct JsonValue(pub serde_json::Value); @@ -183,4 +194,21 @@ impl ApiClient { self.get(&format!("/api/v1/contracts/{}/daemon/status", contract_id)) .await } + + /// Ask a question and wait for user feedback. + pub async fn supervisor_ask( + &self, + question: &str, + choices: Vec, + context: Option, + timeout_seconds: i32, + ) -> Result { + let req = AskQuestionRequest { + question: question.to_string(), + choices, + context, + timeout_seconds, + }; + self.post("/api/v1/mesh/supervisor/questions", &req).await + } } -- cgit v1.2.3