swarm repositories / source
aboutsummaryrefslogtreecommitdiff
path: root/crates/phone-opus/src/mcp/catalog.rs
diff options
context:
space:
mode:
authormain <main@swarm.moe>2026-03-23 19:16:10 -0400
committermain <main@swarm.moe>2026-03-23 19:16:10 -0400
commit00949559a8a4757e1198e1ea582ebfcf7268fec4 (patch)
tree7bb8821c1d597eb386998a6f0b4cba1b9e24de41 /crates/phone-opus/src/mcp/catalog.rs
parentdd2b64ed08b8ac55d6aaeb54d635b33b51eea790 (diff)
downloadphone_opus-00949559a8a4757e1198e1ea582ebfcf7268fec4.zip
Add blocking wait for background consult jobs
Diffstat (limited to 'crates/phone-opus/src/mcp/catalog.rs')
-rw-r--r--crates/phone-opus/src/mcp/catalog.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/phone-opus/src/mcp/catalog.rs b/crates/phone-opus/src/mcp/catalog.rs
index f3f0925..a4a1780 100644
--- a/crates/phone-opus/src/mcp/catalog.rs
+++ b/crates/phone-opus/src/mcp/catalog.rs
@@ -52,6 +52,12 @@ const TOOL_SPECS: &[ToolSpec] = &[
replay: ReplayContract::Convergent,
},
ToolSpec {
+ name: "consult_wait",
+ description: "Block until one background consult job finishes or a timeout elapses. When the job has finished, the final Claude response or failure is included.",
+ dispatch: DispatchTarget::Host,
+ replay: ReplayContract::Convergent,
+ },
+ ToolSpec {
name: "consult_jobs",
description: "List recent background consult jobs. Defaults to render=porcelain; use render=json for structured output.",
dispatch: DispatchTarget::Host,
@@ -123,6 +129,26 @@ fn tool_schema(name: &str) -> Value {
},
"required": ["job_id"]
})),
+ "consult_wait" => with_common_presentation(json!({
+ "type": "object",
+ "properties": {
+ "job_id": {
+ "type": "string",
+ "description": "Background consult job handle returned by consult with background=true."
+ },
+ "timeout_ms": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "Maximum time to wait for completion before returning the current job state. Defaults to 1800000 (30 minutes)."
+ },
+ "poll_interval_ms": {
+ "type": "integer",
+ "minimum": 10,
+ "description": "Polling interval used while waiting. Defaults to 1000."
+ }
+ },
+ "required": ["job_id"]
+ })),
"consult_jobs" => with_common_presentation(json!({
"type": "object",
"properties": {