summaryrefslogtreecommitdiff
path: root/makima/src/daemon/api
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-02-24 23:37:44 +0000
committerGitHub <noreply@github.com>2026-02-24 23:37:44 +0000
commit5d1fbed2733e93cc2be2e1a89ca022d88bef613f (patch)
tree48f66f56c2557b5101a49775e0d964ccd94b516a /makima/src/daemon/api
parentb9bc33ab69d094d97fd1398aaa39e8e435547d17 (diff)
downloadsoryu-0.3.1.tar.gz
soryu-0.3.1.zip
feat: non-blocking reconcile polling, directive CLI orders & cleanup (#82)v0.3.1
* 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
Diffstat (limited to 'makima/src/daemon/api')
-rw-r--r--makima/src/daemon/api/supervisor.rs31
1 files changed, 31 insertions, 0 deletions
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<String>,
+ pub priority: String,
+ pub order_type: String,
+ pub labels: serde_json::Value,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub repository_url: Option<String>,
+}
+
// 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<JsonValue, ApiError> {
+ 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<JsonValue, ApiError> {
+ 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