@dougbots/avenor-mcp 0.9.0 → 0.10.1
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/README.md +19 -1
- package/dist/index.js +121 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -94,19 +94,37 @@ Start a new agent run.
|
|
|
94
94
|
|
|
95
95
|
| Parameter | Required | Description |
|
|
96
96
|
|---|---|---|
|
|
97
|
-
| `agent` |
|
|
97
|
+
| `agent` | no | Agent to invoke; omission uses the supplied model or runtime defaults |
|
|
98
98
|
| `repo_dir` | yes | Working directory for the agent |
|
|
99
99
|
| `prompt` | no | Prompt text (mutually exclusive with `prompt_file`) |
|
|
100
100
|
| `prompt_file` | no | Path to a prompt file |
|
|
101
101
|
| `label` | no | Human-readable label for this run |
|
|
102
102
|
| `timeout` | no | Duration string (`5m`, `1h`, `90s`) |
|
|
103
103
|
| `model` | no | Model override for the agent |
|
|
104
|
+
| `thinking` | no | Run-level reasoning control; unsupported effective backends reject explicit values |
|
|
104
105
|
| `backend` | no | Backend override (`opencode-http`, `opencode-acp`, `codex-app-server`, `agy`) |
|
|
106
|
+
| `roster_file` | no | Path to a top-level roster map |
|
|
107
|
+
| `roster_entry` | no | Key within `roster_file`; selects the complete backend/agent/model identity |
|
|
105
108
|
| `server_url` | no | Backend server URL, required by `opencode-http` unless configured by environment |
|
|
106
109
|
| `supervisor_id` | no | Supervisor ID for multi-supervisor setups |
|
|
107
110
|
|
|
108
111
|
Returns `{ run_id, label, supervisor_id }`. The `run_id` is what you pass to the other tools.
|
|
109
112
|
|
|
113
|
+
#### Direct and roster modes
|
|
114
|
+
|
|
115
|
+
Use both `roster_file` and `roster_entry` for roster mode. A roster entry requires `backend` plus at least one of `agent` or `model`, and cannot be mixed with direct `agent`, `model`, or `backend` fields. Direct mode permits all three identity fields to be omitted independently, including a backend-only request; omitted values use runtime defaults.
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"repo_dir": "/repo",
|
|
120
|
+
"prompt": "Analyze the repository",
|
|
121
|
+
"roster_file": "/repo/roster.json",
|
|
122
|
+
"roster_entry": "planner"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The roster map is strict and currently supports only `backend`, `agent`, and `model` in each entry. `system` and `thinking` are not roster fields. The `thinking` argument remains run-level and is validated against the effective backend chosen by the direct request or roster entry. A resumed session cannot switch to a different backend.
|
|
127
|
+
|
|
110
128
|
### `avenor_status`
|
|
111
129
|
|
|
112
130
|
Get the status of one run, or list all runs. Use the compact `lifecycle` view for progress and pending permission checks; `full` remains the compatibility default.
|
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 } 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,16 +14,10 @@ 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"),
|
|
19
|
+
roster_file: z.string().optional().describe("Path to the roster map"),
|
|
20
|
+
roster_entry: z.string().optional().describe("Roster entry to select"),
|
|
27
21
|
server_url: z.string().optional().describe("Backend server URL"),
|
|
28
22
|
supervisor_id: z.string().optional().describe("Supervisor ID for multi-supervisor mode")
|
|
29
23
|
};
|
|
@@ -71,7 +65,14 @@ const server = new McpServer({
|
|
|
71
65
|
server.registerTool("avenor_spawn", {
|
|
72
66
|
description: "Spawn a new agent run with an optional canonical thinking level; unsupported backends reject explicit values",
|
|
73
67
|
inputSchema: spawnInputShape
|
|
74
|
-
}, async ({ repo_dir, agent, prompt, prompt_file, label, timeout, model, thinking, backend, server_url, supervisor_id }) => {
|
|
68
|
+
}, async ({ repo_dir, agent, prompt, prompt_file, label, timeout, model, thinking, backend, roster_file, roster_entry, server_url, supervisor_id }) => {
|
|
69
|
+
validateSpawnSelection({
|
|
70
|
+
agent,
|
|
71
|
+
model,
|
|
72
|
+
backend,
|
|
73
|
+
roster_file,
|
|
74
|
+
roster_entry
|
|
75
|
+
});
|
|
75
76
|
return spawnTool({
|
|
76
77
|
agent,
|
|
77
78
|
dir: repo_dir,
|
|
@@ -82,6 +83,8 @@ server.registerTool("avenor_spawn", {
|
|
|
82
83
|
model,
|
|
83
84
|
thinking,
|
|
84
85
|
backend,
|
|
86
|
+
rosterFile: roster_file,
|
|
87
|
+
rosterEntry: roster_entry,
|
|
85
88
|
serverUrl: server_url,
|
|
86
89
|
supervisorId: supervisor_id
|
|
87
90
|
});
|
|
@@ -178,6 +181,113 @@ server.registerTool("avenor_shutdown", {
|
|
|
178
181
|
force
|
|
179
182
|
});
|
|
180
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
|
+
});
|
|
181
291
|
if (import.meta.main) if (process.env.MCP_TRANSPORT !== "sse") {
|
|
182
292
|
const transport = new StdioServerTransport();
|
|
183
293
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dougbots/avenor-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
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.
|
|
33
|
+
"@dougbots/avenor-core": "^0.10.1",
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
35
35
|
"hono": "^4.12.19",
|
|
36
36
|
"zod": "^4.4.3"
|