@axonity-ai/mcp 0.6.0 → 0.8.0

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.
Files changed (59) hide show
  1. package/README.md +251 -14
  2. package/dist/client.d.ts +15 -2
  3. package/dist/client.js +8 -1
  4. package/dist/client.js.map +1 -1
  5. package/dist/contract.d.ts +109 -0
  6. package/dist/contract.js +272 -0
  7. package/dist/contract.js.map +1 -0
  8. package/dist/errors.d.ts +15 -3
  9. package/dist/errors.js +27 -3
  10. package/dist/errors.js.map +1 -1
  11. package/dist/generated/listFilters.d.ts +19 -0
  12. package/dist/generated/listFilters.js +78 -0
  13. package/dist/generated/listFilters.js.map +1 -0
  14. package/dist/index.js +29 -2
  15. package/dist/index.js.map +1 -1
  16. package/dist/tools/authoringSpec.d.ts +76 -0
  17. package/dist/tools/authoringSpec.js +169 -0
  18. package/dist/tools/authoringSpec.js.map +1 -0
  19. package/dist/tools/company.d.ts +5 -2
  20. package/dist/tools/company.js +79 -2
  21. package/dist/tools/company.js.map +1 -1
  22. package/dist/tools/conventions.d.ts +16 -0
  23. package/dist/tools/conventions.js +299 -19
  24. package/dist/tools/conventions.js.map +1 -1
  25. package/dist/tools/credentials.d.ts +20 -0
  26. package/dist/tools/credentials.js +41 -0
  27. package/dist/tools/credentials.js.map +1 -1
  28. package/dist/tools/extras.d.ts +17 -0
  29. package/dist/tools/extras.js +151 -9
  30. package/dist/tools/extras.js.map +1 -1
  31. package/dist/tools/operations.d.ts +28 -0
  32. package/dist/tools/operations.js +160 -0
  33. package/dist/tools/operations.js.map +1 -0
  34. package/dist/tools/register.d.ts +27 -0
  35. package/dist/tools/register.js +19 -1
  36. package/dist/tools/register.js.map +1 -1
  37. package/dist/tools/runs.d.ts +24 -0
  38. package/dist/tools/runs.js +304 -26
  39. package/dist/tools/runs.js.map +1 -1
  40. package/dist/tools/secrets.d.ts +33 -0
  41. package/dist/tools/secrets.js +69 -0
  42. package/dist/tools/secrets.js.map +1 -0
  43. package/dist/tools/subworkflows.d.ts +20 -0
  44. package/dist/tools/subworkflows.js +42 -0
  45. package/dist/tools/subworkflows.js.map +1 -0
  46. package/dist/tools/toolboxes.d.ts +32 -0
  47. package/dist/tools/toolboxes.js +165 -0
  48. package/dist/tools/toolboxes.js.map +1 -0
  49. package/dist/tools/triggers.d.ts +8 -0
  50. package/dist/tools/triggers.js +65 -7
  51. package/dist/tools/triggers.js.map +1 -1
  52. package/dist/tools/validation.js +74 -4
  53. package/dist/tools/validation.js.map +1 -1
  54. package/dist/tools/versions.d.ts +9 -0
  55. package/dist/tools/versions.js +36 -0
  56. package/dist/tools/versions.js.map +1 -1
  57. package/dist/tools/workflowMutations.js +53 -12
  58. package/dist/tools/workflowMutations.js.map +1 -1
  59. package/package.json +3 -1
@@ -8,6 +8,30 @@
8
8
  *
9
9
  * Runs are also the only thing in the product with a real archive state —
10
10
  * entities have soft-delete, runs have archive/unarchive.
11
+ *
12
+ * READING A RUN NEED NOT COST THE WHOLE RUN (axonity-mcp#57). `read_run`
13
+ * returns the document; `read_run_outline` returns its table of contents, whose
14
+ * size follows the run's SHAPE rather than its content because it carries no
15
+ * bodies. The two reads that serve those bodies on open — `read_run_value` and
16
+ * `read_run_invocation_messages` — are the only reason the outline can stay
17
+ * small, so they belong with it rather than as conveniences.
18
+ *
19
+ * A RUN THAT ASKS A QUESTION CAN BE ANSWERED (#45 M9). `axonity_conventions`
20
+ * tells an agent to `start_workflow_run` to test a workflow end to end. A run
21
+ * that reaches an `ask_user` step parks there and waits — so, without a way to
22
+ * answer, the guide prescribed a loop the connector could not finish. The two
23
+ * tools that unpark a run supply the INPUT it is waiting for, which is not the
24
+ * same act as deciding a review:
25
+ * - `answer_run_question` / `send_run_message` are here, and since #59 so is
26
+ * `complete_run_step` — one route over two acts. Choosing a DECISION step's
27
+ * branch is routing; completing a MANUAL step asserts that human work
28
+ * happened, which the platform then treats as fact. The tool says so and
29
+ * takes a `confirm`, because leaving it out left the guide prescribing an
30
+ * end-to-end test that hits a wall at the first manual step — the same
31
+ * defect `answer_run_question` was added to fix.
32
+ * - `POST /runs/{id}/steps/{id}/plan-approval` is NOT, and
33
+ * `POST /runs/{id}/restart` cannot be. Both are recorded, with the reason,
34
+ * in `test/exclusions.test.ts` — as a decision rather than an omission.
11
35
  */
12
36
  import { z } from "zod";
13
37
  import { guard, jsonResult } from "./result.js";
@@ -19,18 +43,37 @@ export function registerRunTools(server, client) {
19
43
  "authored. This EXECUTES: it runs the PUBLISHED workflow against live " +
20
44
  "infrastructure (models, connectors), so it can incur cost and cause real " +
21
45
  "side effects. It does not run your unpublished draft. After starting, " +
22
- "follow it with read_run / read_run_trace / read_run_cost. Optionally pass " +
23
- "triggerInput to feed the workflow's trigger.", {
46
+ "follow it with read_run / read_run_trace / read_run_cost. " +
47
+ "\n\nA workflow can have MORE THAN ONE start (a button and a schedule, " +
48
+ "say). Read read_workflow_trigger_parameters first, then name the one you " +
49
+ "mean with triggerId and build triggerInput from the process's `inputs` " +
50
+ "PLUS whatever that start declares on top in its own `parameters` — a " +
51
+ "triggerId that does not exist is a 422 listing the ones that do, never a " +
52
+ "quiet fallback to a different start. " +
53
+ "\n\nA run may PARK on a step that asks a question instead of finishing. " +
54
+ "read_run_waiting_on says what it is parked on; answer_run_question and " +
55
+ "send_run_message are how it moves again.", {
24
56
  workflowId: z.string().describe("The workflow's id."),
57
+ triggerId: z
58
+ .string()
59
+ .optional()
60
+ .describe("Which start to fire, from read_workflow_trigger_parameters' " +
61
+ "`triggers[].id`. Omit and the workflow's FIRST trigger is used — " +
62
+ "the historical behaviour, and an arbitrary choice on a workflow " +
63
+ "with several starts, so name one whenever more than one exists."),
25
64
  triggerInput: z
26
65
  .record(z.unknown())
27
66
  .optional()
28
- .describe("Input payload for the workflow's trigger. Omit for none."),
67
+ .describe("Input payload for the start you are firing, keyed by each " +
68
+ "parameter's `name`. Omit for none. Do NOT send a parameter marked " +
69
+ "`pinned` — the author owns that value and it is overwritten on " +
70
+ "every run regardless of what you send."),
29
71
  manualPhases: z
30
72
  .boolean()
31
73
  .optional()
32
74
  .describe("Run with manual phase gating. Defaults to false."),
33
- }, async ({ workflowId, triggerInput, manualPhases }) => guard(async () => jsonResult(await client.post(`/api/v1/workflows/${workflowId}/runs`, {
75
+ }, async ({ workflowId, triggerId, triggerInput, manualPhases }) => guard(async () => jsonResult(await client.post(`/api/v1/workflows/${workflowId}/runs`, {
76
+ ...(triggerId ? { triggerId } : {}),
34
77
  ...(triggerInput ? { triggerInput } : {}),
35
78
  ...(manualPhases === undefined ? {} : { manualPhases }),
36
79
  }))));
@@ -48,13 +91,19 @@ export function registerRunTools(server, client) {
48
91
  server.tool("list_runs", "List workflow runs across the tenant, newest first. Archived runs are " +
49
92
  "excluded unless includeArchived is true. To list runs of ONE workflow, " +
50
93
  "use list_workflow_runs instead — this route has no workflow filter." +
51
- "\n\nTHIS ONE IS NOT PAGED THE SAME WAY: it answers with a BARE ARRAY, " +
52
- "no envelope, no total and no cursor. You get at most limit rows (default " +
53
- "50, and a larger value is silently clamped to 200), so a result whose " +
54
- "length equals the limit you asked for is the signal that MORE MAY EXIST " +
55
- "— nothing in the response says so. Walk it with offset until you get a " +
56
- "short page. Unlike list_workflow_runs, this route does list per-item " +
57
- "FOR EACH runs alongside their launches.", {
94
+ "\n\nTHE RESPONSE IS ONE PAGE, NOT THE FULL LIST: " +
95
+ "{ items, nextCursor, pageSize, hasMore }. Default page size is 20, max " +
96
+ "200. While hasMore is true you have NOT seen every run — pass the " +
97
+ "response's nextCursor back as cursor to get the next page, and repeat " +
98
+ "until nextCursor is null. Counting or concluding anything (\"how many " +
99
+ "failed?\") from a single page with hasMore: true gives a confidently " +
100
+ "wrong answer. " +
101
+ "\n\nRuns arrive at ~78/min during a fan-out, which is why the position " +
102
+ "is a cursor and not an offset: an offset window under that rate skips " +
103
+ "and repeats rows between pages. Never build a cursor — echo back the " +
104
+ "one you were given. " +
105
+ "\n\nUnlike list_workflow_runs, this route does list per-item FOR EACH " +
106
+ "runs alongside their launches.", {
58
107
  status: z
59
108
  .string()
60
109
  .optional()
@@ -66,21 +115,20 @@ export function registerRunTools(server, client) {
66
115
  .number()
67
116
  .int()
68
117
  .optional()
69
- .describe("Rows to return. Defaults to 50, silently clamped to 200 — asking " +
70
- "for more does not fail, it just returns 200."),
71
- offset: z
72
- .number()
73
- .int()
118
+ .describe("Page size. Defaults to 20, silently clamped to 200 — asking for " +
119
+ "more does not fail, it just returns 200."),
120
+ cursor: z
121
+ .string()
74
122
  .optional()
75
- .describe("Rows to skip. Defaults to 0. Advance it by the page size to walk " +
76
- "the whole list; stop when a page comes back short."),
77
- }, async ({ status, createdAfter, createdBefore, includeArchived, limit, offset }) => guard(async () => jsonResult(await client.get("/api/v1/runs", {
123
+ .describe("Opaque continuation cursor from the previous response's nextCursor. " +
124
+ "Omit for the first page. Do not parse or construct one."),
125
+ }, async ({ status, createdAfter, createdBefore, includeArchived, limit, cursor }) => guard(async () => jsonResult(await client.get("/api/v1/runs", {
78
126
  status,
79
127
  created_after: createdAfter,
80
128
  created_before: createdBefore,
81
129
  include_archived: includeArchived,
82
130
  limit,
83
- offset,
131
+ cursor,
84
132
  }))));
85
133
  server.tool("list_workflow_runs", "List one workflow's LAUNCHES, newest first. Note this route takes " +
86
134
  "archivedOnly (show ONLY archived launches), which is not the same as " +
@@ -98,8 +146,18 @@ export function registerRunTools(server, client) {
98
146
  "entry — not 4,415. That entry carries forEachProgress " +
99
147
  "({ total, pending, inProgress, succeeded, failed, … }), which is where " +
100
148
  "per-item counts come from. Do not read the number of items on a page as " +
101
- "a number of runs.", {
149
+ "a number of runs." +
150
+ "\n\nFilter with status BEFORE paging, not after: the filter is applied " +
151
+ "in the query, so \"which launches failed?\" is one page rather than a " +
152
+ "walk through every page keeping the failures. A status this backend " +
153
+ "does not know is a 422 naming the ones it does — this connector " +
154
+ "deliberately keeps no copy of that list.", {
102
155
  workflowId: z.string().describe("The workflow's id."),
156
+ status: z
157
+ .array(z.string())
158
+ .optional()
159
+ .describe('Restrict to these launch statuses, e.g. ["failed", "cancelled"]. ' +
160
+ "Several are a union. Omit for every status."),
103
161
  archivedOnly: z
104
162
  .boolean()
105
163
  .optional()
@@ -117,23 +175,243 @@ export function registerRunTools(server, client) {
117
175
  "nextCursor verbatim. Omit for the first page. It marks a POSITION, " +
118
176
  "not an offset, so it stays correct while new runs are being " +
119
177
  "inserted. A token you built or edited yourself is a 400."),
120
- }, async ({ workflowId, archivedOnly, limit, cursor }) => guard(async () =>
178
+ }, async ({ workflowId, status, archivedOnly, limit, cursor }) => guard(async () =>
121
179
  // The page envelope is forwarded WHOLE. Unwrapping to items would drop
122
180
  // hasMore/nextCursor and recreate, one layer up, exactly the silent
123
181
  // truncation this tool exists to make visible (#37).
124
182
  jsonResult(await client.get(`/api/v1/workflows/${workflowId}/runs`, {
183
+ // This route reads a REPEATED key (?status=a&status=b); the
184
+ // tenant-wide `list_runs` reads one comma-separated string. A real
185
+ // backend difference, so each tool sends what its route declares.
186
+ status,
125
187
  archived_only: archivedOnly,
126
188
  limit,
127
189
  cursor,
128
190
  }))));
129
- server.tool("read_run", "Read one run in full: status, per-step state, the workflow snapshot it " +
130
- "ran against, trigger input, agent invocations, and validator verdicts. " +
131
- "The verdicts are the closest thing to evaluator findings — there is no " +
132
- "separate findings endpoint.", { runId: z.string().describe("The run's id.") }, async ({ runId }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}`))));
191
+ server.tool("read_run", "Read one run: status, per-step state, trigger input, agent invocations, " +
192
+ "and validator verdicts. The verdicts are the closest thing to evaluator " +
193
+ "findings — there is no separate findings endpoint. " +
194
+ "\n\nThe WORKFLOW SNAPSHOT is omitted by default. It is the immutable " +
195
+ "copy of the document the run executed, and it measured 23,809 of 29,414 " +
196
+ "bytes — 81% — of one real response, none of which says anything about " +
197
+ "how the run went. An oversized response turns a call that SUCCEEDED into " +
198
+ "an error, which is the same trap apply_workflow_mutations avoids by not " +
199
+ "forwarding a document either. Pass includeSnapshot: true when you " +
200
+ "actually need to see what the run executed (e.g. it behaved unlike the " +
201
+ "current draft and you want to know which document it ran).", {
202
+ runId: z.string().describe("The run's id."),
203
+ includeSnapshot: z
204
+ .boolean()
205
+ .optional()
206
+ .describe("Include `workflowSnapshot`, the document this run executed. " +
207
+ "Defaults to FALSE here — the backend's own default is true, and " +
208
+ "this tool overrides it because the snapshot is typically most of " +
209
+ "the response and never the answer to a question about the run."),
210
+ }, async ({ runId, includeSnapshot }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}`, {
211
+ includeSnapshot: includeSnapshot === true,
212
+ }))));
213
+ server.tool("list_todo_steps", "The steps across the TENANT that are waiting on a human — every parked " +
214
+ "run, whatever it is parked on. This is the list you read to answer 'is " +
215
+ "anything stuck on me?' without knowing which run to look at. " +
216
+ "\n\nTHE RESPONSE IS ONE PAGE, NOT THE FULL LIST: " +
217
+ "{ items, nextCursor, pageSize, hasMore }. While hasMore is true you have " +
218
+ "NOT seen every waiting step — pass the response's nextCursor back as " +
219
+ "cursor and repeat until nextCursor is null. " +
220
+ "\n\nNote what the page bounds: the cursor walks the waiting RUNS, and " +
221
+ "one run can carry several waiting steps, so `items` may be LONGER than " +
222
+ "pageSize. That is not a bug and not an overflow — pageSize bounds what " +
223
+ "was read, not what came back. A fan-out can park thousands of items on " +
224
+ "one manual step at once, which is why this list is paged at all. " +
225
+ "\n\nread_run_waiting_on answers the same question for a run you already " +
226
+ "have in your hand.", {
227
+ limit: z
228
+ .number()
229
+ .int()
230
+ .optional()
231
+ .describe("Page size, over the waiting runs. Omit for the route's default."),
232
+ cursor: z
233
+ .string()
234
+ .optional()
235
+ .describe("Opaque continuation cursor from the previous response's nextCursor. " +
236
+ "Omit for the first page. Do not parse or construct one."),
237
+ }, async ({ limit, cursor }) => guard(async () => jsonResult(await client.get("/api/v1/runs/todo", { limit, cursor }))));
238
+ server.tool("list_run_session_memory", "List the files an agent wrote to SESSION MEMORY during a run — title, " +
239
+ "kind, tags, size and timestamp for each. Bodies are not included; fetch " +
240
+ "one with read_run_session_memory_file. " +
241
+ "\n\nThis is what an agent left itself between steps, and it is often the " +
242
+ "answer to 'why did it decide that?' when the trace shows the decision " +
243
+ "but not what it was reading. " +
244
+ "\n\nAn empty list is an answer: this run wrote nothing to session memory.", { runId: z.string().describe("The run's id.") }, async ({ runId }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/session-memory`))));
245
+ server.tool("read_run_session_memory_file", "Read ONE session-memory file's text, by the id from " +
246
+ "list_run_session_memory. The listing carries metadata and this carries " +
247
+ "the body — up to 200 files per run, so fetching all of them to read one " +
248
+ "is the mistake the split exists to prevent. " +
249
+ "\n\nThe file id is scoped to THIS run's session folder: one borrowed " +
250
+ "from another run is a 404, not someone else's file.", {
251
+ runId: z.string().describe("The run's id."),
252
+ fileId: z.string().describe("The file's id, from list_run_session_memory."),
253
+ }, async ({ runId, fileId }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/session-memory/${fileId}`))));
254
+ server.tool("read_run_outline", "A run's TABLE OF CONTENTS — everything that happened, at the depth it " +
255
+ "happened: the run, its steps, and the items a fan-out step handed out. " +
256
+ "Flat rows with parent pointers; nest them yourself. " +
257
+ "\n\nREAD THIS FIRST when you want to know the shape of a run. It carries " +
258
+ "no bodies, so its size follows the run's SHAPE rather than its content — " +
259
+ "a launch over four thousand items costs about what one over four costs, " +
260
+ "where read_run pays for the whole document. Then fetch only what you " +
261
+ "actually want to look at: read_run_value for a step value, " +
262
+ "read_run_invocation_messages for one agent's transcript. " +
263
+ "\n\n`itemCap` bounds how many items are LISTED per fan-out step. The rest " +
264
+ "are counted in that step's `counts.truncated` and live on the paged " +
265
+ "item-results surface — nothing is dropped in silence.", {
266
+ runId: z.string().describe("The run's id."),
267
+ itemCap: z
268
+ .number()
269
+ .int()
270
+ .optional()
271
+ .describe("Max items listed per fan-out step. Anything beyond it is counted in " +
272
+ "`counts.truncated`, not hidden."),
273
+ }, async ({ runId, itemCap }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/outline`, { item_cap: itemCap }))));
274
+ server.tool("read_run_value", "Fetch ONE large step value by its digest — the body behind a marker in " +
275
+ "read_run's `stepStates`. A run detail carries handles rather than " +
276
+ "megabytes; this is how you open one of them, when you have decided you " +
277
+ "need it. " +
278
+ "\n\nThe digest is scoped to THIS run: one you saw in another run is not " +
279
+ "readable here, and asking gives a 404 rather than someone else's value.", {
280
+ runId: z.string().describe("The run's id."),
281
+ digest: z
282
+ .string()
283
+ .describe("The value's digest, from the marker in read_run's `stepStates`."),
284
+ }, async ({ runId, digest }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/values/${digest}`))));
285
+ server.tool("read_run_invocation_messages", "Read ONE agent invocation's transcript — the conversation behind a row in " +
286
+ "read_run's `agentInvocations`, which lists each invocation with its " +
287
+ "metadata and a `messageCount` but not its messages. " +
288
+ "\n\nThis is the read for 'what did this agent actually say?'. Fetch the " +
289
+ "one invocation you are asking about: a run's transcripts together are " +
290
+ "routinely larger than everything else in it combined.", {
291
+ runId: z.string().describe("The run's id."),
292
+ invocationId: z
293
+ .string()
294
+ .describe("The invocation's id, from read_run's `agentInvocations`."),
295
+ }, async ({ runId, invocationId }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/invocations/${invocationId}/messages`))));
133
296
  server.tool("read_run_trace", "Read a run's chronological tool-call trace — each entry has the step, the " +
134
297
  "tool, its arguments, its output, and any error. This is what you read to " +
135
298
  "work out WHY a run behaved as it did.", { runId: z.string().describe("The run's id.") }, async ({ runId }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/trace`))));
136
299
  server.tool("read_run_cost", "Read a run's token and cost breakdown, per agent and model.", { runId: z.string().describe("The run's id.") }, async ({ runId }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/cost`))));
300
+ // ---- Why a run is parked, and what it did ------------------------------
301
+ server.tool("read_run_waiting_on", "Why a run is PARKED. A run in `waiting` or `input_required` is not stuck " +
302
+ "and not slow — it is holding for something, and this lists every pending " +
303
+ "wake-task targeting it: a question asked of a person, a timer, a callback " +
304
+ "that has not arrived. Read this before concluding a test run failed. " +
305
+ "\n\nAn EMPTY list is a real answer, not an error: the run may have every " +
306
+ "wake already resolved and be about to resume. " +
307
+ "\n\nWhen the answer is a question, answer_run_question is what unparks it.", {
308
+ runId: z.string().describe("The run's id."),
309
+ limit: z.number().int().optional().describe("How many to return. Default 50."),
310
+ }, async ({ runId, limit }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/waiting-on`, { limit }))));
311
+ server.tool("list_run_items", "One page of the ITEM RESULTS inside a launch — the rows a FOR EACH " +
312
+ "produced. This is what list_workflow_runs does NOT show: a launch over " +
313
+ "4,415 people is one entry there and 4,415 rows here. Each row's `id` is " +
314
+ "a real run you can read_run for that one item's detail. " +
315
+ "\n\nTHE RESPONSE IS ONE PAGE: { items, nextCursor, pageSize, hasMore }, " +
316
+ "20 by default and max 200. Follow nextCursor until it is null. " +
317
+ "\n\nFILTER WITH `outcome`, DO NOT FILTER THE PAGE. It is applied in the " +
318
+ "database: on a 4,415-item launch the twelve failures are scattered " +
319
+ "through the middle, so keeping the failed rows out of page one shows you " +
320
+ "none and reads as \"no failures\". For the totals alone use " +
321
+ "read_run_items_summary — it is one call instead of a walk.", {
322
+ runId: z.string().describe("The launch's run id."),
323
+ outcome: z
324
+ .enum(["all", "failed", "skipped"])
325
+ .optional()
326
+ .describe('Which items to return. "failed" covers items that never produced a ' +
327
+ 'result; "skipped" covers items a gate deliberately declined. ' +
328
+ 'Defaults to "all".'),
329
+ limit: z.number().int().optional().describe("Page size. Default 20, max 200."),
330
+ cursor: z
331
+ .string()
332
+ .optional()
333
+ .describe("Opaque continuation cursor from the previous response's nextCursor. " +
334
+ "Omit for the first page. Do not parse or construct one."),
335
+ }, async ({ runId, outcome, limit, cursor }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/items`, { outcome, limit, cursor }))));
336
+ server.tool("read_run_items_summary", "The roll-up over a launch's items — \"4,415 processed · 12 failed\" — in " +
337
+ "ONE call, with no paging. Ask this before list_run_items: it answers " +
338
+ "\"did anything fail?\" outright, where counting a page answers it wrongly. " +
339
+ "A launch that never fanned out reports zeroes.", { runId: z.string().describe("The launch's run id.") }, async ({ runId }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/items/summary`))));
340
+ server.tool("list_run_tasks", "Every task and child run descending from this run: for-each iterations " +
341
+ "still queued, delegated agent tasks, callback wake-tasks, and the " +
342
+ "iterations already promoted to runs of their own. Use it to see what a " +
343
+ "run set in motion beyond its own steps — a run can look idle while its " +
344
+ "children are doing all the work.", {
345
+ runId: z.string().describe("The run's id."),
346
+ limit: z.number().int().optional().describe("How many to return. Default 200."),
347
+ }, async ({ runId, limit }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/tasks`, { limit }))));
348
+ server.tool("read_run_for_each_progress", "Per-state counts for ONE fan-out batch on a run: total, pending, " +
349
+ "inProgress, succeeded, failed, deadLetter. This is how you watch a FOR " +
350
+ "EACH step advance while it is still running, instead of re-reading the " +
351
+ "whole run. Get the batchId from list_run_tasks or the step's state in " +
352
+ "read_run.", {
353
+ runId: z.string().describe("The run's id."),
354
+ batchId: z.string().describe("The FOR EACH batch's id."),
355
+ }, async ({ runId, batchId }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/for-each/${batchId}/progress`))));
356
+ // ---- Unparking a run ---------------------------------------------------
357
+ server.tool("answer_run_question", "Answer an `ask_user` step a run is parked on, so the run resumes. This is " +
358
+ "what makes \"start a run and see what it does\" finishable: without it a " +
359
+ "workflow that asks anything waits forever and a test never returns a " +
360
+ "verdict. Find the parked step with read_run_waiting_on or read_run. " +
361
+ "\n\nThe answer is recorded as the ANSWER A PERSON WOULD HAVE GIVEN and " +
362
+ "the run proceeds on it. On a run a human is depending on, that is their " +
363
+ "decision to make, not yours — answer your own test runs, and ask before " +
364
+ "answering someone else's. Returns the run's updated detail.", {
365
+ runId: z.string().describe("The run's id."),
366
+ stepId: z.string().describe("The suspended step's id, from read_run_waiting_on."),
367
+ answer: z.string().describe("The answer text the step is waiting for."),
368
+ }, async ({ runId, stepId, answer }) => guard(async () => jsonResult(await client.post(`/api/v1/runs/${runId}/steps/${stepId}/answer`, { answer }))));
369
+ server.tool("complete_run_step", "Complete a MANUAL or DECISION step a run is parked on, so the run " +
370
+ "resumes. Along with answer_run_question, this is what makes \"start a " +
371
+ "run and see what it does\" finishable — a workflow with a manual step " +
372
+ "otherwise waits forever and a test never returns a verdict. " +
373
+ "\n\nONE ROUTE, TWO VERY DIFFERENT ACTS. Know which you are doing: " +
374
+ "\n- On a DECISION step you are CHOOSING A BRANCH. Pass `selectedBranch`. " +
375
+ "That is a routing choice, the same kind of act as answering a question. " +
376
+ "\n- On a MANUAL step you are ASSERTING THAT HUMAN WORK HAPPENED. The " +
377
+ "platform then treats that as fact and everything downstream proceeds on " +
378
+ "it. Only do this when a person has told you the work is done, or on a " +
379
+ "test run of your own where nothing real depended on the step. Never to " +
380
+ "get a stuck run moving. " +
381
+ "\n\nFind the parked step with read_run_waiting_on. Returns the run's " +
382
+ "updated detail. Deciding a PLAN APPROVAL is a different thing again and " +
383
+ "is deliberately not available here — that step exists to get a human's " +
384
+ "review, and an agent approving it would often be approving its own plan.", {
385
+ runId: z.string().describe("The run's id."),
386
+ stepId: z.string().describe("The parked step's id, from read_run_waiting_on."),
387
+ selectedBranch: z
388
+ .string()
389
+ .optional()
390
+ .describe("For a DECISION step: which branch to take."),
391
+ output: z
392
+ .record(z.unknown())
393
+ .optional()
394
+ .describe("For a MANUAL step: the result the step should carry forward."),
395
+ structuredOutputs: z
396
+ .record(z.unknown())
397
+ .optional()
398
+ .describe("Values for the step's declared output schema, when it has one."),
399
+ confirm: z
400
+ .literal(true)
401
+ .describe("Must be true. Acknowledges that on a manual step you are asserting " +
402
+ "human work was done."),
403
+ }, async ({ runId, stepId, selectedBranch, output, structuredOutputs }) => guard(async () => jsonResult(await client.post(`/api/v1/runs/${runId}/steps/${stepId}/complete`, {
404
+ ...(selectedBranch !== undefined ? { selectedBranch } : {}),
405
+ ...(output !== undefined ? { output } : {}),
406
+ ...(structuredOutputs !== undefined ? { structuredOutputs } : {}),
407
+ }))));
408
+ server.tool("send_run_message", "Send a user turn to a CONVERSATION run that is waiting on one. The server " +
409
+ "resolves which step is parked, so unlike answer_run_question this takes " +
410
+ "no stepId. Same caution: the turn is recorded as a person's, so use it " +
411
+ "on runs you started. Returns the run's updated detail.", {
412
+ runId: z.string().describe("The conversation run's id."),
413
+ message: z.string().min(1).describe("The user turn to submit."),
414
+ }, async ({ runId, message }) => guard(async () => jsonResult(await client.post(`/api/v1/runs/${runId}/message`, { message }))));
137
415
  server.tool("read_runs_summary", "Counts of runs by state across the tenant (running, waiting, completed, " +
138
416
  "failed, expired, total).", {}, async () => guard(async () => jsonResult(await client.get("/api/v1/runs/summary"))));
139
417
  server.tool("archive_run", "Archive a run — hides it from the default run list without deleting it. " +
@@ -1 +1 @@
1
- {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/tools/runs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,OAAO,GAAG,CAAC;KACd,OAAO,CAAC,IAAI,CAAC;KACb,QAAQ,CAAC,oEAAoE,CAAC,CAAC;AAElF,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,MAAqB;IACvE,MAAM,CAAC,IAAI,CACT,oBAAoB,EACpB,uEAAuE;QACrE,uEAAuE;QACvE,2EAA2E;QAC3E,wEAAwE;QACxE,4EAA4E;QAC5E,8CAA8C,EAChD;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QACrD,YAAY,EAAE,CAAC;aACZ,MAAM,CA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,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,gBAAgB,KAAK,YAAY,CAAC,CAAC,CAAC,CACtF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,oEAAoE;QAClE,kEAAkE,EACpE;QACE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KAChF,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CACnB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CACvE,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,0EAA0E;QACxE,yEAAyE;QACzE,6EAA6E;QAC7E,wEAAwE,EAC1E;QACE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAC9E,OAAO,EAAE,OAAO;KACjB,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CACnB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CACtE,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Reading the tenant's secret catalogue.
3
+ *
4
+ * A connector points at a secret by id (`authConfig.secretId`), and the
5
+ * credential guard lets that id through — it is a locator, not a credential.
6
+ * Until now nothing let an agent FIND the id: the whole `/secrets` family was
7
+ * deny-listed, so wiring a connector ended in "ask a human to copy the id out
8
+ * of the UI". That is the gap these two tools close, and all they close.
9
+ *
10
+ * Reading is safe by construction on the backend: no secrets route ever returns
11
+ * a decrypted value, and both GETs are open to any authenticated caller,
12
+ * read-only tokens included (`backend/src/routes/secrets.py`). WRITES stay out
13
+ * of this connector — the backend refuses them from a service token, and the
14
+ * value-less half of that story is axonity-mcp#39 / axonity-flow#910.
15
+ *
16
+ * The one thing that is not safe by construction is `metadata`. It is stored
17
+ * unencrypted, returned verbatim, readable by every user in the tenant
18
+ * (axonity-flow#908), and after axonity-flow#890 an operator can put arbitrary
19
+ * handshake headers in it — an `Authorization: Basic …` is the obvious next
20
+ * use. So it is redacted on the way out: the shape of a handshake is what an
21
+ * agent needs, the credential inside it is not.
22
+ */
23
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
24
+ import type { AxonityClient } from "../client.js";
25
+ /**
26
+ * Redact credential-shaped entries out of a secret's `metadata`, and say so.
27
+ *
28
+ * Exported for testing. Anything that is not an object with a `metadata` key
29
+ * passes through untouched — the backend owns this response shape, and a
30
+ * connector that silently reshapes it is the drift this repo keeps closing.
31
+ */
32
+ export declare function redactSecretMetadata(response: unknown): unknown;
33
+ export declare function registerSecretTools(server: McpServer, client: AxonityClient): void;
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Reading the tenant's secret catalogue.
3
+ *
4
+ * A connector points at a secret by id (`authConfig.secretId`), and the
5
+ * credential guard lets that id through — it is a locator, not a credential.
6
+ * Until now nothing let an agent FIND the id: the whole `/secrets` family was
7
+ * deny-listed, so wiring a connector ended in "ask a human to copy the id out
8
+ * of the UI". That is the gap these two tools close, and all they close.
9
+ *
10
+ * Reading is safe by construction on the backend: no secrets route ever returns
11
+ * a decrypted value, and both GETs are open to any authenticated caller,
12
+ * read-only tokens included (`backend/src/routes/secrets.py`). WRITES stay out
13
+ * of this connector — the backend refuses them from a service token, and the
14
+ * value-less half of that story is axonity-mcp#39 / axonity-flow#910.
15
+ *
16
+ * The one thing that is not safe by construction is `metadata`. It is stored
17
+ * unencrypted, returned verbatim, readable by every user in the tenant
18
+ * (axonity-flow#908), and after axonity-flow#890 an operator can put arbitrary
19
+ * handshake headers in it — an `Authorization: Basic …` is the obvious next
20
+ * use. So it is redacted on the way out: the shape of a handshake is what an
21
+ * agent needs, the credential inside it is not.
22
+ */
23
+ import { z } from "zod";
24
+ import { redactCredentials } from "./credentials.js";
25
+ import { guard, jsonResult } from "./result.js";
26
+ /**
27
+ * Redact credential-shaped entries out of a secret's `metadata`, and say so.
28
+ *
29
+ * Exported for testing. Anything that is not an object with a `metadata` key
30
+ * passes through untouched — the backend owns this response shape, and a
31
+ * connector that silently reshapes it is the drift this repo keeps closing.
32
+ */
33
+ export function redactSecretMetadata(response) {
34
+ if (typeof response !== "object" || response === null || Array.isArray(response)) {
35
+ return response;
36
+ }
37
+ const source = response;
38
+ if (source.metadata === undefined || source.metadata === null)
39
+ return response;
40
+ const { value, redactedPaths } = redactCredentials(source.metadata);
41
+ if (redactedPaths.length === 0)
42
+ return response;
43
+ return {
44
+ ...source,
45
+ metadata: value,
46
+ // An omission the reader cannot see is worse than the omission itself.
47
+ metadataRedacted: {
48
+ paths: redactedPaths,
49
+ why: "A secret's metadata is stored unencrypted and is readable by every user " +
50
+ "in this tenant, so anything credential-shaped in it is withheld from " +
51
+ "the agent. Read these fields in Axonity → Settings → Secrets.",
52
+ },
53
+ };
54
+ }
55
+ export function registerSecretTools(server, client) {
56
+ server.tool("list_secrets", "List the tenant's secrets (id, name, description, authType, version). This " +
57
+ "is the catalogue of what EXISTS — no route in Axonity ever returns a " +
58
+ "secret's value, and this connector cannot create, change or delete one. " +
59
+ "Use it to find the id for a connector's `authConfig.secretId` instead of " +
60
+ "asking a human to copy one out of the UI.", {}, async () => guard(async () => jsonResult(await client.get("/api/v1/secrets"))));
61
+ server.tool("read_secret", "Read one secret's configuration: `authType`, `valueKeys` (WHICH keys are " +
62
+ "filled — never their values), `metadata` (connection config, e.g. a " +
63
+ "session_cookie handshake) and `version`. Check `valueKeys` before you wire " +
64
+ "a connector to a secret: an empty list means a human has not filled it in " +
65
+ "yet, and the connector will fail at run time, not at author time. " +
66
+ "Credential-shaped entries in `metadata` are withheld — see " +
67
+ "`metadataRedacted` in the response for which and why.", { secretId: z.string().describe("The secret's id (from list_secrets).") }, async ({ secretId }) => guard(async () => jsonResult(redactSecretMetadata(await client.get(`/api/v1/secrets/${secretId}`)))));
68
+ }
69
+ //# sourceMappingURL=secrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/tools/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAiB;IACpD,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,QAAmC,CAAC;IACnD,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;QAAE,OAAO,QAAQ,CAAC;IAE/E,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpE,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAEhD,OAAO;QACL,GAAG,MAAM;QACT,QAAQ,EAAE,KAAK;QACf,uEAAuE;QACvE,gBAAgB,EAAE;YAChB,KAAK,EAAE,aAAa;YACpB,GAAG,EACD,0EAA0E;gBAC1E,uEAAuE;gBACvE,+DAA+D;SAClE;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAqB;IAC1E,MAAM,CAAC,IAAI,CACT,cAAc,EACd,6EAA6E;QAC3E,uEAAuE;QACvE,0EAA0E;QAC1E,2EAA2E;QAC3E,2CAA2C,EAC7C,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAC/E,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,aAAa,EACb,2EAA2E;QACzE,sEAAsE;QACtE,6EAA6E;QAC7E,4EAA4E;QAC5E,oEAAoE;QACpE,6DAA6D;QAC7D,uDAAuD,EACzD,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC,EAAE,EACzE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CACrB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,oBAAoB,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC,CACtE,CACF,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Finding the workflows a sub-process step may call.
3
+ *
4
+ * Workflows can call each other (axonity-flow#898). Both halves of that live in
5
+ * the workflow DOCUMENT and are therefore already authorable over this
6
+ * connector: `add_trigger` with `typeId: "subprocess-invocation"` declares the
7
+ * callee's signature — in that one call, `parameters` included, since
8
+ * axonity-flow#961 S3 — and `add_step` with `type: "subprocess"` makes the
9
+ * call. What an agent could not do was find out WHICH workflow to call — the
10
+ * same gap the secret catalogue closed (#39): the platform can express the
11
+ * wiring, the agent cannot find the id.
12
+ *
13
+ * `GET /workflows/callable` answers it, and answers the harder half too: a
14
+ * workflow that CANNOT be called is listed with the reason rather than filtered
15
+ * out. An author hunting for a workflow that is right there is a support
16
+ * question; "here it is, and here is what to fix" is a two-second answer.
17
+ */
18
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
19
+ import type { AxonityClient } from "../client.js";
20
+ export declare function registerSubworkflowTools(server: McpServer, client: AxonityClient): void;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Finding the workflows a sub-process step may call.
3
+ *
4
+ * Workflows can call each other (axonity-flow#898). Both halves of that live in
5
+ * the workflow DOCUMENT and are therefore already authorable over this
6
+ * connector: `add_trigger` with `typeId: "subprocess-invocation"` declares the
7
+ * callee's signature — in that one call, `parameters` included, since
8
+ * axonity-flow#961 S3 — and `add_step` with `type: "subprocess"` makes the
9
+ * call. What an agent could not do was find out WHICH workflow to call — the
10
+ * same gap the secret catalogue closed (#39): the platform can express the
11
+ * wiring, the agent cannot find the id.
12
+ *
13
+ * `GET /workflows/callable` answers it, and answers the harder half too: a
14
+ * workflow that CANNOT be called is listed with the reason rather than filtered
15
+ * out. An author hunting for a workflow that is right there is a support
16
+ * question; "here it is, and here is what to fix" is a two-second answer.
17
+ */
18
+ import { z } from "zod";
19
+ import { guard, jsonResult } from "./result.js";
20
+ export function registerSubworkflowTools(server, client) {
21
+ server.tool("list_callable_workflows", "List the workflows a sub-process step may call, each with its INTERFACE: " +
22
+ "`parameters` (what to bind the calling step's inputs to, matched by name) " +
23
+ "and `outcomes` (the callee's end steps and the fields each carries — " +
24
+ "which end was reached is itself part of the answer). A workflow that " +
25
+ "cannot be called is listed too, with `callable: false` and a " +
26
+ "`blockedReason` — usually that it has never been published, or has no " +
27
+ "`subprocess-invocation` trigger. " +
28
+ "\n\nCall this BEFORE authoring a sub-process step. `validate_workflow` " +
29
+ "does check the target now — a missing one, a self-call, a target that is " +
30
+ "deleted, unpublished or not callable each have their own issue code — " +
31
+ "but it can only tell you AFTERWARDS that the workflow you picked was " +
32
+ "wrong. This is how you pick, and how you read the interface you are " +
33
+ "about to bind the calling step's inputs to.", {
34
+ exclude: z
35
+ .string()
36
+ .optional()
37
+ .describe("The workflow you are editing. A workflow cannot call itself — every " +
38
+ "run would spawn a child that reaches the same step again — so pass " +
39
+ "its id to keep it out of the list."),
40
+ }, async ({ exclude }) => guard(async () => jsonResult(await client.get("/api/v1/workflows/callable", exclude ? { exclude } : undefined))));
41
+ }
42
+ //# sourceMappingURL=subworkflows.js.map