@dougbots/avenor-mcp 0.10.0 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +109 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
5
5
|
import { Hono } from "hono";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
import { answerPermissionTool, eventsTool, followUpTool, resultTool, shutdownTool, spawnTool, statusTool, validateSpawnSelection } from "@dougbots/avenor-core";
|
|
7
|
+
import { THINKING_LEVELS, answerPermissionTool, eventsTool, followUpTool, resultTool, shutdownTool, spawnTool, statusTool, validateSpawnSelection, workflowCompleteTool, workflowEventsTool, workflowGateTool, workflowInspectTool, workflowStatusTool, workflowWaitTool } from "@dougbots/avenor-core";
|
|
8
8
|
//#region src/spawn-schema.ts
|
|
9
9
|
const spawnInputShape = {
|
|
10
10
|
agent: z.string().optional().describe("Optional agent name; omission uses the supplied model or runtime defaults"),
|
|
@@ -14,15 +14,7 @@ const spawnInputShape = {
|
|
|
14
14
|
label: z.string().optional().describe("Human-readable label for this run"),
|
|
15
15
|
timeout: z.string().optional().describe("Timeout duration (e.g. 5m, 1h)"),
|
|
16
16
|
model: z.string().optional().describe("Model override"),
|
|
17
|
-
thinking: z.enum(
|
|
18
|
-
"off",
|
|
19
|
-
"minimal",
|
|
20
|
-
"low",
|
|
21
|
-
"medium",
|
|
22
|
-
"high",
|
|
23
|
-
"xhigh",
|
|
24
|
-
"max"
|
|
25
|
-
]).optional().describe("Thinking level; omission uses the backend default and unsupported backends reject explicit values"),
|
|
17
|
+
thinking: z.enum(THINKING_LEVELS).optional().describe("Thinking level; omission uses the backend default and unsupported backends reject explicit values"),
|
|
26
18
|
backend: z.string().optional().describe("Backend override"),
|
|
27
19
|
roster_file: z.string().optional().describe("Path to the roster map"),
|
|
28
20
|
roster_entry: z.string().optional().describe("Roster entry to select"),
|
|
@@ -189,6 +181,113 @@ server.registerTool("avenor_shutdown", {
|
|
|
189
181
|
force
|
|
190
182
|
});
|
|
191
183
|
});
|
|
184
|
+
server.registerTool("avenor_workflow_status", {
|
|
185
|
+
description: "Get lightweight status for a workflow instance",
|
|
186
|
+
inputSchema: {
|
|
187
|
+
workflow_id: z.string().describe("Workflow ID"),
|
|
188
|
+
supervisor_id: z.string().optional().describe("Supervisor ID for multi-supervisor mode")
|
|
189
|
+
}
|
|
190
|
+
}, async ({ workflow_id, supervisor_id }) => {
|
|
191
|
+
return workflowStatusTool({
|
|
192
|
+
workflowId: workflow_id,
|
|
193
|
+
supervisorId: supervisor_id
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
server.registerTool("avenor_workflow_wait", {
|
|
197
|
+
description: "Wait for a workflow to reach a terminal state or until timeout",
|
|
198
|
+
inputSchema: {
|
|
199
|
+
workflow_id: z.string().describe("Workflow ID"),
|
|
200
|
+
timeout: z.string().optional().describe("Timeout (e.g. 30s, 5m)"),
|
|
201
|
+
supervisor_id: z.string().optional().describe("Supervisor ID for multi-supervisor mode")
|
|
202
|
+
}
|
|
203
|
+
}, async ({ workflow_id, timeout, supervisor_id }) => {
|
|
204
|
+
return workflowWaitTool({
|
|
205
|
+
workflowId: workflow_id,
|
|
206
|
+
timeout,
|
|
207
|
+
supervisorId: supervisor_id
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
server.registerTool("avenor_workflow_inspect", {
|
|
211
|
+
description: "Return the full instance detail for a workflow",
|
|
212
|
+
inputSchema: {
|
|
213
|
+
workflow_id: z.string().describe("Workflow ID"),
|
|
214
|
+
supervisor_id: z.string().optional().describe("Supervisor ID for multi-supervisor mode")
|
|
215
|
+
}
|
|
216
|
+
}, async ({ workflow_id, supervisor_id }) => {
|
|
217
|
+
return workflowInspectTool({
|
|
218
|
+
workflowId: workflow_id,
|
|
219
|
+
supervisorId: supervisor_id
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
server.registerTool("avenor_workflow_events", {
|
|
223
|
+
description: "Read log events from a workflow instance's event log",
|
|
224
|
+
inputSchema: {
|
|
225
|
+
workflow_id: z.string().describe("Workflow ID"),
|
|
226
|
+
after_seq: z.number().optional().describe("Only include events after this sequence number"),
|
|
227
|
+
limit: z.number().optional().describe("Max events to return (default 50)"),
|
|
228
|
+
supervisor_id: z.string().optional().describe("Supervisor ID for multi-supervisor mode")
|
|
229
|
+
}
|
|
230
|
+
}, async ({ workflow_id, after_seq, limit, supervisor_id }) => {
|
|
231
|
+
return workflowEventsTool({
|
|
232
|
+
workflowId: workflow_id,
|
|
233
|
+
afterSeq: after_seq,
|
|
234
|
+
limit,
|
|
235
|
+
supervisorId: supervisor_id
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
server.registerTool("avenor_workflow_complete", {
|
|
239
|
+
description: "Atomically complete a machine/external handoff activation",
|
|
240
|
+
inputSchema: {
|
|
241
|
+
workflow_id: z.string().describe("Workflow ID"),
|
|
242
|
+
node_id: z.string().describe("Node ID"),
|
|
243
|
+
activation_id: z.string().describe("Activation ID"),
|
|
244
|
+
attempt_id: z.string().describe("Attempt ID"),
|
|
245
|
+
lease_id: z.string().describe("Lease ID"),
|
|
246
|
+
owner_token: z.string().describe("Owner token"),
|
|
247
|
+
outcome: z.string().describe("Outcome"),
|
|
248
|
+
outputs: z.unknown().optional().describe("Outputs"),
|
|
249
|
+
artifacts: z.unknown().optional().describe("Artifacts"),
|
|
250
|
+
supervisor_id: z.string().optional().describe("Supervisor ID for multi-supervisor mode")
|
|
251
|
+
}
|
|
252
|
+
}, async (args) => {
|
|
253
|
+
const { supervisor_id, ...rest } = args;
|
|
254
|
+
return workflowCompleteTool({
|
|
255
|
+
...rest,
|
|
256
|
+
supervisorId: supervisor_id
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
server.registerTool("avenor_workflow_gate", {
|
|
260
|
+
description: "Record a gate decision on a parked awaiting_gate activation",
|
|
261
|
+
inputSchema: {
|
|
262
|
+
workflow_id: z.string().describe("Workflow ID"),
|
|
263
|
+
node_id: z.string().describe("Node ID"),
|
|
264
|
+
gate_id: z.string().describe("Gate ID"),
|
|
265
|
+
activation_id: z.string().describe("Activation ID"),
|
|
266
|
+
operation: z.enum([
|
|
267
|
+
"satisfy",
|
|
268
|
+
"reject",
|
|
269
|
+
"waive",
|
|
270
|
+
"external_result"
|
|
271
|
+
]).describe("Gate operation"),
|
|
272
|
+
actor: z.string().optional().describe("Actor"),
|
|
273
|
+
reason: z.string().optional().describe("Reason"),
|
|
274
|
+
outcome: z.string().optional().describe("Outcome"),
|
|
275
|
+
subject: z.unknown().optional().describe("Subject"),
|
|
276
|
+
poll_id: z.string().optional().describe("Poll ID"),
|
|
277
|
+
source: z.string().optional().describe("Source"),
|
|
278
|
+
result: z.string().optional().describe("Result"),
|
|
279
|
+
response_hash: z.string().optional().describe("Response hash"),
|
|
280
|
+
observed_at: z.string().optional().describe("Observed at"),
|
|
281
|
+
evidence_ids: z.array(z.string()).optional().describe("Evidence IDs"),
|
|
282
|
+
supervisor_id: z.string().optional().describe("Supervisor ID for multi-supervisor mode")
|
|
283
|
+
}
|
|
284
|
+
}, async (args) => {
|
|
285
|
+
const { supervisor_id, ...rest } = args;
|
|
286
|
+
return workflowGateTool({
|
|
287
|
+
...rest,
|
|
288
|
+
supervisorId: supervisor_id
|
|
289
|
+
});
|
|
290
|
+
});
|
|
192
291
|
if (import.meta.main) if (process.env.MCP_TRANSPORT !== "sse") {
|
|
193
292
|
const transport = new StdioServerTransport();
|
|
194
293
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dougbots/avenor-mcp",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dev": "tsdown --watch"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@dougbots/avenor-core": "^0.10.
|
|
33
|
+
"@dougbots/avenor-core": "^0.10.2",
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
35
35
|
"hono": "^4.12.19",
|
|
36
36
|
"zod": "^4.4.3"
|