diff options
| author | soryu <soryu@soryu.co> | 2026-01-15 03:26:28 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-15 03:26:28 +0000 |
| commit | eeafe072bc6bb81459f7d087b48fc921afe9cc11 (patch) | |
| tree | 7f835993edd732f8ff66d756391dedffe3d44e90 /makima/src/daemon/api/supervisor.rs | |
| parent | c61a2b9b9c988f5460f85980d4ddf285f1a730b5 (diff) | |
| download | soryu-eeafe072bc6bb81459f7d087b48fc921afe9cc11.tar.gz soryu-eeafe072bc6bb81459f7d087b48fc921afe9cc11.zip | |
Automatically derive repo URL and add notifications for input
Diffstat (limited to 'makima/src/daemon/api/supervisor.rs')
| -rw-r--r-- | makima/src/daemon/api/supervisor.rs | 28 |
1 files changed, 28 insertions, 0 deletions
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<String>, + #[serde(skip_serializing_if = "Option::is_none")] + pub context: Option<String>, + 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<String>, + context: Option<String>, + timeout_seconds: i32, + ) -> Result<JsonValue, ApiError> { + let req = AskQuestionRequest { + question: question.to_string(), + choices, + context, + timeout_seconds, + }; + self.post("/api/v1/mesh/supervisor/questions", &req).await + } } |
