@axonity-ai/mcp 0.6.0 → 0.7.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 (50) hide show
  1. package/README.md +176 -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 +88 -0
  6. package/dist/contract.js +227 -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 +25 -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 +56 -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 +191 -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 +139 -9
  30. package/dist/tools/extras.js.map +1 -1
  31. package/dist/tools/register.d.ts +27 -0
  32. package/dist/tools/register.js +19 -1
  33. package/dist/tools/register.js.map +1 -1
  34. package/dist/tools/runs.d.ts +11 -0
  35. package/dist/tools/runs.js +169 -26
  36. package/dist/tools/runs.js.map +1 -1
  37. package/dist/tools/secrets.d.ts +33 -0
  38. package/dist/tools/secrets.js +69 -0
  39. package/dist/tools/secrets.js.map +1 -0
  40. package/dist/tools/subworkflows.d.ts +20 -0
  41. package/dist/tools/subworkflows.js +42 -0
  42. package/dist/tools/subworkflows.js.map +1 -0
  43. package/dist/tools/validation.js +74 -4
  44. package/dist/tools/validation.js.map +1 -1
  45. package/dist/tools/versions.d.ts +9 -0
  46. package/dist/tools/versions.js +36 -0
  47. package/dist/tools/versions.js.map +1 -1
  48. package/dist/tools/workflowMutations.js +44 -12
  49. package/dist/tools/workflowMutations.js.map +1 -1
  50. package/package.json +3 -1
@@ -3,8 +3,11 @@
3
3
  * streams, org structure). Unlike the other authored entities it is a
4
4
  * SINGLETON: one per tenant, addressed at `/api/v1/company` with no id, so it
5
5
  * has no list / create / delete / restore / discard routes. It is
6
- * version-controlled like the memory entities, and edited as a whole document
7
- * (a full-document PUT under optimistic locking), not field-by-field.
6
+ * version-controlled like the memory entities, and editable two ways: command
7
+ * mutations (`apply_company_mutation`, preferred — the backend validates each
8
+ * and threads the version) or a whole-document PUT (`update_company`). Workflow
9
+ * has had both for a long time; company was whole-document-only here even
10
+ * though `POST /api/v1/company/mutations` existed.
8
11
  *
9
12
  * Publishing: company is currently NOT a publish-approval entity type on the
10
13
  * backend, so there is no request_publish_company — a company change is
@@ -52,6 +55,57 @@ export function registerCompanyTools(server, client) {
52
55
  }, async ({ versionId, expectedVersion }) => guard(async () => jsonResult(await client.post(`/api/v1/company/versions/${versionId}/restore`, {
53
56
  expectedVersion,
54
57
  }))));
58
+ server.tool("create_company_major_version", "Cut a new NAMED major version of the company document — \"Save As\" for " +
59
+ "the current draft, so a milestone is findable by name instead of by " +
60
+ "hunting through checkpoints. Takes no id (singleton). This does NOT " +
61
+ "publish: what is live stays live until a human approves a " +
62
+ "request_publish_company.", {
63
+ name: z
64
+ .string()
65
+ .min(1)
66
+ .max(255)
67
+ .describe('What to call this release, e.g. "Q3 operating model".'),
68
+ description: z
69
+ .string()
70
+ .optional()
71
+ .describe("A longer note on what this version represents."),
72
+ }, async ({ name, description }) => guard(async () => jsonResult(await client.post("/api/v1/company/versions", {
73
+ name,
74
+ ...(description ? { description } : {}),
75
+ }))));
76
+ server.tool("ensure_company_major_version", "Make sure the company document has a working draft major version, " +
77
+ "creating an unnamed one if it has none. IDEMPOTENT — safe to call before " +
78
+ "a run of edits; when one already exists nothing changes. Returns the " +
79
+ "draft's major version number and name.", {}, async () => guard(async () => jsonResult(await client.post("/api/v1/company/versions/ensure"))));
80
+ server.tool("apply_company_mutation", "Apply ONE structural command to the company document — the validated, " +
81
+ "version-safe way to change its layers, value streams, stages and " +
82
+ "capabilities, and to link workflows to them. Prefer this over " +
83
+ "update_company: that route is a whole-document PUT, which is the same " +
84
+ "reason apply_workflow_mutations is preferred for a workflow. Read the " +
85
+ "company first for its version. " +
86
+ "\n\nOne command per call — this route has no batch form, unlike the " +
87
+ "workflow one. Apply a sequence yourself, using the version each response " +
88
+ "returns as the next call's expectedVersion. " +
89
+ "\n\nWHICH COMMANDS EXIST is not listed here and this connector keeps no " +
90
+ "copy: unlike workflows, company has no catalogue route to read, so a " +
91
+ "wrong `type` is a 422 that names every value the route accepts. Read " +
92
+ "that error rather than guessing twice.", {
93
+ type: z
94
+ .string()
95
+ .describe("The command name. A value this deploy does not accept comes back as " +
96
+ "a 422 listing the ones it does."),
97
+ payload: z
98
+ .record(z.unknown())
99
+ .describe("The command's arguments (camelCase keys)."),
100
+ expectedVersion: z
101
+ .number()
102
+ .int()
103
+ .describe("The version you last read — rejected with 409 if stale."),
104
+ }, async ({ type, payload, expectedVersion }) => guard(async () => jsonResult(await client.post("/api/v1/company/mutations", {
105
+ type,
106
+ payload,
107
+ expectedVersion,
108
+ }))));
55
109
  server.tool("name_company_major_version", "Give one of the company document's major versions a name — label a release " +
56
110
  "so it is easy to find in history. Targets a MAJOR version by its integer " +
57
111
  "number (from list_company_versions), not a checkpoint or a versionId. Like " +
@@ -1 +1 @@
1
- {"version":3,"file":"company.js","sourceRoot":"","sources":["../../src/tools/company.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAA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ACD,KAAK,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,CAC/B,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,MAAM,MAAM,CAAC,KAAK,CAAC,kCAAkC,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAC/E,CACF,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,yBAAyB,EACzB,6EAA6E;QAC3E,4EAA4E;QAC5E,4EAA4E;QAC5E,0EAA0E;QAC1E,yEAAyE;QACzE,QAAQ,EACV;QACE,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,wDAAwD,CAAC;KACtE,EACD,KAAK,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAC1B,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,MAAM,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE;QAC7C,UAAU,EAAE,SAAS;QACrB,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAC,CACH,CACF,CACJ,CAAC;AACJ,CAAC"}
@@ -12,6 +12,22 @@
12
12
  * and the enums quoted below to a vendored snapshot of that schema, so a drift
13
13
  * between this prose and the backend fails CI rather than misleading an agent.
14
14
  * Keep enum lists in this doc in step with what that test asserts.
15
+ *
16
+ * BETTER STILL, DO NOT QUOTE A LIST AT ALL. Four vocabularies used to live here
17
+ * and every one of them drifted: the mutation commands (#32/#44), and then the
18
+ * step types, trigger types and schedule-rule shapes — this guide named nine
19
+ * step types where seven validate. All four are now read from
20
+ * `get_workflow_authoring_spec`, generated by the backend from the registries
21
+ * that ENFORCE them, and this document states none of those LISTS. A pinned
22
+ * list fails CI when it drifts; a list you never wrote cannot. When you are
23
+ * about to write out a set of accepted values here, point at the spec instead —
24
+ * `test/conformance.test.ts` asserts the absence.
25
+ *
26
+ * Naming ONE value to state behaviour is a different thing and stays: that
27
+ * `typeId: "subprocess-invocation"` is what makes a workflow callable is not
28
+ * something the catalogue can say — it can only say the id exists. The line is
29
+ * the one #44 drew: a mention is guidance, an enumeration is a claim about what
30
+ * exists, and it is the claim that goes stale.
15
31
  */
16
32
  import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
17
33
  export declare function registerConventions(server: McpServer): void;
@@ -12,6 +12,22 @@
12
12
  * and the enums quoted below to a vendored snapshot of that schema, so a drift
13
13
  * between this prose and the backend fails CI rather than misleading an agent.
14
14
  * Keep enum lists in this doc in step with what that test asserts.
15
+ *
16
+ * BETTER STILL, DO NOT QUOTE A LIST AT ALL. Four vocabularies used to live here
17
+ * and every one of them drifted: the mutation commands (#32/#44), and then the
18
+ * step types, trigger types and schedule-rule shapes — this guide named nine
19
+ * step types where seven validate. All four are now read from
20
+ * `get_workflow_authoring_spec`, generated by the backend from the registries
21
+ * that ENFORCE them, and this document states none of those LISTS. A pinned
22
+ * list fails CI when it drifts; a list you never wrote cannot. When you are
23
+ * about to write out a set of accepted values here, point at the spec instead —
24
+ * `test/conformance.test.ts` asserts the absence.
25
+ *
26
+ * Naming ONE value to state behaviour is a different thing and stays: that
27
+ * `typeId: "subprocess-invocation"` is what makes a workflow callable is not
28
+ * something the catalogue can say — it can only say the id exists. The line is
29
+ * the one #44 drew: a mention is guidance, an enumeration is a claim about what
30
+ * exists, and it is the claim that goes stale.
15
31
  */
16
32
  const CONVENTIONS = `# Authoring conventions for Axonity entities
17
33
 
@@ -138,10 +154,14 @@ has run cleanly once, at its current version.
138
154
  undeclared OR MISSPELLED key is a 422 that names it, not a silent drop. So
139
155
  spelling matters and you get told when it is wrong — good. Other entities are
140
156
  more lenient and may drop an unknown key silently; never rely on that.
141
- - \`agent.tags\` is not cosmetic: it drives which policies apply to the agent at
142
- runtime. An untagged agent looks correct everywhere in the UI and silently
143
- skips policies scoped to those tags. If you create or update an agent that
144
- should be governed by a policy, check its tags match what the policy expects.
157
+ - \`agent.tags\` is a free label for grouping and reporting. It GATES NOTHING —
158
+ what reaches an agent's prompt is a LINK (\`attach_policy_to_agent\`), visible
159
+ in a table a human can read and edit. A role-tag gate on a policy used to
160
+ decide that invisibly and is refused outright now: sending
161
+ \`activation.tags\` to \`create_policy\`/\`update_policy\` is a 422. The two
162
+ surviving gates, \`activation.tools\` and \`activation.delegation\`, each say
163
+ something a link cannot — "only on turns where this agent holds this tool",
164
+ and "only when (not) delegated".
145
165
 
146
166
  ## After you write, verify
147
167
  - A 200 means the request was accepted, NOT that it did what you meant. Re-read
@@ -162,6 +182,19 @@ has run cleanly once, at its current version.
162
182
  (\`read_run\` / \`read_run_trace\` / \`read_run_cost\`). Note it runs the PUBLISHED
163
183
  workflow and really executes (cost, connector side effects), so publish first,
164
184
  and only test-run when a human is expecting it.
185
+ - Read \`read_workflow_trigger_parameters\` first and pass \`triggerId\`: a
186
+ workflow can have several starts, each with different fields, and omitting
187
+ it fires whichever comes first. Never send a parameter marked \`pinned\` —
188
+ the author owns that value and it is overwritten anyway.
189
+ - **A run can park instead of finishing.** A step that asks a question waits
190
+ for an answer, so "it never came back" usually means "it is waiting on you".
191
+ \`read_run_waiting_on\` says what for; \`answer_run_question\` (or
192
+ \`send_run_message\` on a conversation run) resumes it. Answer your own test
193
+ runs; on a run a human is depending on, the answer is theirs to give.
194
+ - A FOR EACH launch is not one result. \`read_run_items_summary\` is the
195
+ roll-up ("4,415 processed · 12 failed") and \`list_run_items\` the rows —
196
+ with \`outcome: "failed"\`, because the failures are scattered and filtering
197
+ page one finds none of them.
165
198
  - A LIST is not the whole list. \`list_workflow_runs\` returns a page —
166
199
  \`{ items, nextCursor, pageSize, hasMore }\`, 20 by default — so counting or
167
200
  concluding from page one while \`hasMore\` is true is how you answer confidently
@@ -230,8 +263,8 @@ made any time before you attach them.
230
263
  - \`capabilityTier\`: \`economy\` | \`standard\` (default) | \`smart\` | \`reasoning\`
231
264
  - \`creativityTier\`: \`low\` | \`medium\` (default) | \`high\`
232
265
  - \`learningMode\`: \`none\` (default) | \`adaptive\` | \`strict\`
233
- - \`avatar\`, \`tags\` (role tags — see Field shape; set them or policies silently
234
- skip the agent), \`canOwnProcess\` (bool; must be true for an agent to own a
266
+ - \`avatar\`, \`tags\` (free labels for grouping — they gate nothing; see Field
267
+ shape), \`canOwnProcess\` (bool; must be true for an agent to own a
235
268
  workflow step's flow), \`episodicMemoryEnabled\` (bool).
236
269
  - \`permissions\` (object): \`planning\`, \`delegation\`, \`verboseOutput\` (bools);
237
270
  \`outputValidators\` / \`exposedValidatorTools\` (snake_case specs, see Field
@@ -249,9 +282,14 @@ made any time before you attach them.
249
282
  (preferred: the backend validates each and threads the version), or
250
283
  - \`replace_workflow_document\` — a full-document atomic PUT.
251
284
  - The document is a graph: \`steps.all[]\` (each \`{ id, type, name, ... }\`) and
252
- \`steps.edges[]\` (each \`{ id, from, to, type? }\`) plus \`triggers\`. Step
253
- \`type\` is one of: \`manual\`, \`agent\`, \`automation\`, \`subprocess\`,
254
- \`connector\`, \`decision\`, \`loop\`, \`for_each\`, \`end\`.
285
+ \`steps.edges[]\` (each \`{ id, from, to, type? }\`) plus \`triggers\`.
286
+ - WHICH VALUES a step's \`type\` and a trigger's \`typeId\` may hold is answered
287
+ by \`get_workflow_authoring_spec\`, read live from this deploy. This guide
288
+ does not list them, on purpose: it used to name nine step types where seven
289
+ validate, and a list nobody could read is a list that goes wrong. The spec
290
+ also lists the types you may NOT author, each with the reason and how to
291
+ express that intention instead — so reaching for one gets you an answer
292
+ rather than a \`step_invalid_type\`.
255
293
  - Referential integrity is enforced: step and trigger ids must be unique, and
256
294
  every edge \`from\`/\`to\` must reference an id that exists in the document
257
295
  (\`from\` may be a trigger or step; \`to\` must be a step). A dangling edge is a
@@ -321,13 +359,18 @@ DELETE a link and do NOT touch the entity body:
321
359
  - reference_doc → agent: \`attach_reference_to_agent\` (agents only — there is no
322
360
  workflow-scoped reference-doc route).
323
361
  - VERIFY every one of these with the read-back before \`request_publish_*\`:
324
- \`list_agent_skills\`, \`list_agent_policies\`, \`list_agent_reference_docs\`.
325
- This is not optional politeness — because a link lives OUTSIDE the entity body,
326
- \`read_agent\` will not show it, so the read-back is the only way to tell an
327
- attach that landed from one that silently did nothing. (Mechanism A is
328
- different: those ids ARE in the body, so re-reading the agent proves them.
329
- \`attach_skill_to_workflow\` has no read-back — the backend has no list route
330
- for it.)
362
+ \`list_agent_skills\`, \`list_agent_policies\`, \`list_agent_reference_docs\`,
363
+ and \`list_workflow_skills\` for the workflow-scoped variant. This is not
364
+ optional politeness — because a link lives OUTSIDE the entity body,
365
+ \`read_agent\` / \`read_workflow\` will not show it, so the read-back is the
366
+ only way to tell an attach that landed from one that silently did nothing.
367
+ (Mechanism A is different: those ids ARE in the body, so re-reading the agent
368
+ proves them.)
369
+ - The three agent read-backs also take \`workflowId\`. With it you get the
370
+ COMPOSED runtime view — what this agent's prompt actually assembles inside
371
+ that workflow, with a \`linkSource\` per row saying WHY each item is there (an
372
+ explicit link, tenant-wide, or scoped to the workflow). Without it you see the
373
+ agent on its own, which is not what a run assembles.
331
374
 
332
375
  **C) Reference an id INSIDE the workflow document** (this is how agents and tools
333
376
  get "into" a workflow — there is no attach route for it):
@@ -407,6 +450,41 @@ The connector never carries a secret across: \`authConfig\` stays placeholders i
407
450
  the new tenant too, and a human fills the real value there.
408
451
 
409
452
  ## Structural workflow edits
453
+ - **Start by reading the spec.** \`get_workflow_authoring_spec\` returns FOUR
454
+ lists this deploy generates from its own registries: the mutation commands,
455
+ the trigger types, the step types (including the ones you may not author, with
456
+ the reason), and the schedule-rule shapes with a working example each. Neither
457
+ this guide nor the tool descriptions restate any of those lists: a list kept
458
+ in the connector is right only by maintenance, and it has been wrong twice
459
+ already, both times in the direction that costs an agent a 422 on something it
460
+ was told to use. Pass \`types\` for the live payload schema of a command you
461
+ are about to write.
462
+ - **The payload schemas describe themselves.** What may go inside
463
+ \`parameters\`, \`inputs\`, \`outputs\` and \`contract\` is IN those schemas —
464
+ including the fact that a bound input DERIVES its contract from the output it
465
+ reads. Ask the spec for the command's \`types\` rather than looking for prose
466
+ about the shape here; there deliberately is none.
467
+ - **One thing the schemas do not make obvious: which KEY carries the value's
468
+ type, because it is not the same key everywhere.**
469
+ - A TRIGGER PARAMETER and a WORKFLOW CONSTANT use \`type\`.
470
+ - A step INPUT or OUTPUT uses \`kind\`.
471
+ - Where a field carries a nested \`schema\` object, \`schema.kind\` is what
472
+ wins.
473
+
474
+ This asymmetry is real, not a typo to normalise: the shapes came from
475
+ different surfaces, and normalising them would make one reader wrong. The
476
+ VALUES differ too — \`get_workflow_authoring_spec\` returns one list per key
477
+ (\`parameterTypes\`, \`outputKinds\`, \`schemaFieldKinds\`), and they are not
478
+ interchangeable: only one knows \`constant\`, and they disagree on how to
479
+ spell a yes/no. Read the list that matches the shape you are writing; this
480
+ guide does not restate them, for the same reason it restates no other list.
481
+
482
+ Writing \`kind\` on a trigger parameter is not a 422; it is a key nothing
483
+ reads, so the value silently falls back to text and the workflow runs with
484
+ the wrong thing. Check which of the three you are writing before you write it.
485
+ - \`rulesVersion\` in that response is a content hash over all four lists. While
486
+ it is unchanged there is nothing to re-fetch; re-read the spec when it changes,
487
+ or when a mutation fails with a 422 suggesting your idea of a command is stale.
410
488
  - \`apply_workflow_mutations\` takes a LIST of commands and applies them in order,
411
489
  threading the version for you — pass the version you read, not one per command.
412
490
  - It is NOT transactional. If command N fails, the ones before it stay applied;
@@ -429,11 +507,41 @@ the new tenant too, and a human fills the real value there.
429
507
  required, and \`id\`, \`type\`, \`config\`, \`contract\`, \`inputs\` and
430
508
  \`outputs\` are accepted next to them. No follow-up \`update_step\` is needed
431
509
  just to fill the step in.
510
+ - \`add_trigger\` does the same for a trigger: \`parameters\` and \`outputs\`
511
+ go in that call. This is what makes a callable workflow declarable in one
512
+ mutation, since a trigger's parameter list IS its signature.
432
513
  - \`add_edge\` takes the document's own \`from\`/\`to\` as well as
433
514
  \`fromStepId\`/\`toStepId\`, and keeps an \`id\` you supply.
434
515
  - An unknown or misspelled key is a 422 naming it, not a silent drop — so
435
516
  spelling matters and you are told when it is wrong.
436
517
 
518
+ ## Constants — values the AUTHOR owns
519
+ A constant is applied on EVERY run whichever trigger fired, and it OVERWRITES
520
+ whatever a caller sent. That is deliberate: a field the operator's form does not
521
+ show must not become an injection point for anyone who learns its name.
522
+ - Set them with the \`set_workflow_constants\` command. It replaces the WHOLE
523
+ list, the way \`advanced_edit\` replaces steps and edges — read the list, edit
524
+ it, write it back. There is no per-constant command, because a constant's
525
+ identity is its name and renaming is the common edit.
526
+ - Every entry needs a \`name\`: it is what a step binds to and how the run
527
+ payload keys it. A nameless entry is refused rather than stored, because at
528
+ run time it would simply be skipped.
529
+ - **A constant with no value blocks publishing.** \`constant_without_value\` is
530
+ an error, not a warning, and it names the constant. It has to be: an entry
531
+ with no value was never written into the run at all, so the workflow validated
532
+ clean, published, and ran without it.
533
+ - ABSENCE, not falsiness. \`0\`, \`""\`, \`false\` and \`[]\` are values and pass.
534
+ - The value lives in \`defaultValue\`. On a constant that is not a fallback —
535
+ it IS the value, written on every run. A constant carries no \`required\`
536
+ (nobody is being asked to fill it in) and needs no flag saying it is one.
537
+ - **A trigger parameter can be pinned the same way**, and the platform reads
538
+ TWO spellings: \`constant: true\`, or the older \`type: "constant"\`. Both
539
+ mean the author owns it and the caller must not send it, so treat a parameter
540
+ carrying either as off-limits when you build \`triggerInput\`.
541
+ \`read_workflow_trigger_parameters\` collapses both into \`pinned\`, on the
542
+ workflow's constants and on each start's parameters — read that rather than
543
+ checking the two spellings yourself.
544
+
437
545
  ## Two platform invariants that look like bugs
438
546
  Both are deliberate, both run after EVERY edit, and both now report themselves in
439
547
  the mutation response under \`systemAdjustments\` — so you no longer have to diff
@@ -458,11 +566,24 @@ a document to find out what the platform did.
458
566
  - Pass exactly one. Before telling a human a workflow is ready, check
459
567
  \`catalogChecked\` — a green structural verdict is the easiest thing to
460
568
  over-read.
569
+ - Read the \`issues\` rather than only \`launchable\`: the validator now reports
570
+ a sub-process call with no target, one pointing at itself, one whose target
571
+ is deleted or was never published or has no invocation trigger, a constant
572
+ with no value, and a trigger drawn on the canvas that nothing is wired to.
573
+ Some of those are warnings and still let a workflow publish — read the
574
+ \`severity\`, and read the \`code\`, which is stable where the message is not.
461
575
 
462
576
  ## Triggers
463
- - A published workflow still does nothing until it has a trigger. Add one with
464
- \`create_cron_schedule\`, \`create_webhook_trigger\`, or
465
- \`create_conditional_trigger\`.
577
+ - A published workflow still does nothing until it has a trigger. A trigger has
578
+ TWO halves, and drawing one on the canvas is only the first.
579
+ - **A schedule is reconciled for you.** Draw it in the document, publish, and
580
+ the firing row is brought into line. That is the exception.
581
+ - **A webhook or conditional trigger is NOT.** Its row must be created
582
+ separately — \`create_webhook_trigger\` / \`create_conditional_trigger\` —
583
+ and publishing will not create one. A webhook drawn and published with no row
584
+ is an endpoint that does not exist; the validator says so with
585
+ \`trigger_not_wired\`, a WARNING, so the publish still goes through. Take the
586
+ warning seriously: nothing else will tell you.
466
587
  - Trigger deletes are HARD deletes — no restore. Webhook tokens are shown once
467
588
  at create/rotate and are never retrievable; hand them straight to your human
468
589
  and never store one in an entity field.
@@ -474,11 +595,62 @@ a document to find out what the platform did.
474
595
  - Runs are the only thing with a real archive state — \`archive_run\` is
475
596
  reversible, \`bulk_delete_runs\` is not.
476
597
 
598
+ ## Subworkflows — one workflow calling another
599
+ Both halves live in the workflow DOCUMENT, so both are ordinary
600
+ \`apply_workflow_mutations\` work. There is no separate "link" route.
601
+ - **To make a workflow callable**, give it a trigger with
602
+ \`typeId: "subprocess-invocation"\` (\`add_trigger\`) whose \`parameters\` are
603
+ what a caller must pass. That list IS the signature — there is no other place
604
+ to declare it. \`parameters\` goes in the \`add_trigger\` call itself; you do
605
+ not need a follow-up \`update_trigger\`. For what a parameter may contain, ask
606
+ \`get_workflow_authoring_spec\` for \`add_trigger\`'s payload schema rather
607
+ than a shape written down here.
608
+ - **It must also be PUBLISHED.** The catalogue reads the published document, so
609
+ a draft-only workflow comes back \`callable: false\` with "Never published".
610
+ Authoring the caller first and publishing the callee later is a run-time
611
+ failure waiting to happen.
612
+ - **To call it**, add a step with \`type: "subprocess"\` and
613
+ \`config: { targetWorkflowId, ownerAgentId }\` — both required, both workflow/
614
+ agent ids. Bind the step's \`inputs\` by NAME to the callee's \`parameters\`;
615
+ that is the whole mapping, there is no separate argument block.
616
+ - \`config.waitForCompletion\` is **IGNORED** if you write it. Drawing a step
617
+ after this one already means "after", so waiting is implied. The one thing the
618
+ graph cannot say is fire-and-forget: \`config.fireAndForget: true\`, and then
619
+ nothing downstream may depend on the result.
620
+ - \`config.errorStrategy\` ("fail" | "skip") is only honoured when the step
621
+ ITERATES (\`config.iteration.enabled\`). On a single call "skip" would report
622
+ a failed child as success, so it is forced to fail-fast.
623
+ - **A workflow cannot call itself** — every run would spawn a child that reaches
624
+ the same step again. Pass \`exclude: <the workflow you are editing>\` to
625
+ \`list_callable_workflows\` and it is kept out of the list.
626
+ - **What comes back** is the callee's \`outcomes\`: its end steps, each with the
627
+ fields bound into it. WHICH end was reached is itself part of the answer.
628
+ - **\`validate_workflow\` checks this now.** A missing target, a workflow
629
+ calling itself, a target that is deleted, never published, or has no
630
+ invocation trigger — each has its own issue code, and the ones that resolve to
631
+ nothing are errors that block publishing. Still run
632
+ \`list_callable_workflows\` BEFORE you author the step: it is how you pick a
633
+ target and see the interface you are binding to, where the validator only
634
+ tells you afterwards that the one you picked was wrong.
635
+
477
636
  ## Secrets
478
637
  - Never handle a real credential. A connector's \`authConfig\` takes placeholders
479
638
  only ("{{ MY_SECRET }}" or ""); a human fills the real value in Axonity. This
480
639
  is enforced — a write carrying something that looks like a real secret is
481
640
  rejected before it leaves this connector.
641
+ - You CAN read the catalogue: \`list_secrets\` (id, name, authType) and
642
+ \`read_secret\`. That is how you get the id for a connector's
643
+ \`authConfig.secretId\` — do not ask a human to copy one out of the UI.
644
+ - Before you wire a connector to a secret, check \`valueKeys\` on
645
+ \`read_secret\`. An empty list means nobody has filled the secret in yet: the
646
+ connector will author fine and fail at RUN time. Say so to your human, with the
647
+ secret's name, rather than reporting the wiring as done.
648
+ - You cannot create, change or delete a secret. That is a human act in Axonity →
649
+ Settings → Secrets, and the backend refuses it from this connector's token.
650
+ - A secret's \`metadata\` (connection config, e.g. a session_cookie handshake)
651
+ comes back with credential-shaped entries withheld, listed under
652
+ \`metadataRedacted\`. If you need one of those values, a human reads it in
653
+ Axonity — do not try another route to it.
482
654
 
483
655
  ## Tenant
484
656
  - Your token fixes the tenant. You cannot act across tenants; never send a
@@ -1 +1 @@
1
- {"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/tools/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsdnB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,2EAA2E;QACzE,2EAA2E;QAC3E,2EAA2E;QAC3E,4EAA4E;QAC5E,uEAAuE;QACvE,kBAAkB,EACpB,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,kBAAkB,EACpB,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAC1E,CAAC;AACJ,CAAC"}
@@ -25,6 +25,26 @@ export declare function isPlaceholder(value: unknown): boolean;
25
25
  * Exported for testing; `assertPlaceholderCredentials` is the enforcement point.
26
26
  */
27
27
  export declare function findCredentialViolations(value: unknown, path?: string): string[];
28
+ /** What a redacted leaf is replaced with. Names where the real value lives. */
29
+ export declare const REDACTION = "[redacted by the connector \u2014 read it in Axonity]";
30
+ export interface Redaction {
31
+ /** The input with every credential-ish leaf replaced by `REDACTION`. */
32
+ value: unknown;
33
+ /** Where a replacement happened, e.g. `metadata.handshakeHeaders.Authorization`. */
34
+ redactedPaths: string[];
35
+ }
36
+ /**
37
+ * The mirror image of `findCredentialViolations`: same walk, same rules, but it
38
+ * rewrites what it finds instead of throwing. For data coming BACK from Axonity.
39
+ *
40
+ * A secret's `metadata` is stored unencrypted and returned verbatim by a route
41
+ * every user in the tenant can call (axonity-flow#908), and the handshake form
42
+ * invites an `Authorization` header straight into it. Returning that to an agent
43
+ * would put a real credential in its context through the one surface built on
44
+ * the promise that values never leave the server — so the structure comes back
45
+ * (an agent needs to see WHICH fields a handshake has) and the credential does not.
46
+ */
47
+ export declare function redactCredentials(value: unknown, path?: string): Redaction;
28
48
  /**
29
49
  * Throw if a connector's fields carry anything that looks like a real
30
50
  * credential. Safe to call with any tool's fields — it is a no-op when there is
@@ -84,6 +84,47 @@ export function findCredentialViolations(value, path = "authConfig") {
84
84
  walk(value, path, false);
85
85
  return findings;
86
86
  }
87
+ /** What a redacted leaf is replaced with. Names where the real value lives. */
88
+ export const REDACTION = "[redacted by the connector — read it in Axonity]";
89
+ /**
90
+ * The mirror image of `findCredentialViolations`: same walk, same rules, but it
91
+ * rewrites what it finds instead of throwing. For data coming BACK from Axonity.
92
+ *
93
+ * A secret's `metadata` is stored unencrypted and returned verbatim by a route
94
+ * every user in the tenant can call (axonity-flow#908), and the handshake form
95
+ * invites an `Authorization` header straight into it. Returning that to an agent
96
+ * would put a real credential in its context through the one surface built on
97
+ * the promise that values never leave the server — so the structure comes back
98
+ * (an agent needs to see WHICH fields a handshake has) and the credential does not.
99
+ */
100
+ export function redactCredentials(value, path = "metadata") {
101
+ const redactedPaths = [];
102
+ const walk = (node, at, keyIsCredential) => {
103
+ if (Array.isArray(node)) {
104
+ return node.map((item, i) => walk(item, `${at}[${i}]`, keyIsCredential));
105
+ }
106
+ if (node !== null && typeof node === "object") {
107
+ const out = {};
108
+ for (const [key, child] of Object.entries(node)) {
109
+ out[key] = walk(child, `${at}.${key}`, isCredentialKey(key));
110
+ }
111
+ return out;
112
+ }
113
+ if (typeof node === "string" && SECRET_PATTERNS.some(([, re]) => re.test(node))) {
114
+ redactedPaths.push(at);
115
+ return REDACTION;
116
+ }
117
+ // A credential-named leaf goes whatever its type — but a placeholder or an
118
+ // empty string is not a credential, and blanking it would hide that the
119
+ // field is unfilled, which is exactly what a reader is checking for.
120
+ if (keyIsCredential && !isPlaceholder(node)) {
121
+ redactedPaths.push(at);
122
+ return REDACTION;
123
+ }
124
+ return node;
125
+ };
126
+ return { value: walk(value, path, false), redactedPaths };
127
+ }
87
128
  /**
88
129
  * Throw if a connector's fields carry anything that looks like a real
89
130
  * credential. Safe to call with any tool's fields — it is a no-op when there is
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/tools/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mFAAmF;AACnF,MAAM,cAAc,GAClB,oGAAoG,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,cAAc,GAClB,2EAA2E,CAAC;AAE9E,uEAAuE;AACvE,MAAM,eAAe,GAAuB;IAC1C,CAAC,mBAAmB,EAAE,oCAAoC,CAAC;IAC3D,CAAC,mBAAmB,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OAAO,SAAS,CAAC;QACnB,CAAC;QAED,2EAA2E;QAC3E,wEAAwE;QACxE,qEAAqE;QACrE,IAAI,eAAe,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5C,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAA+B;IAC1E,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACrC,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,IAAI;QAAE,OAAO;IAE5D,MAAM,QAAQ,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;IACtD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAElC,MAAM,IAAI,KAAK,CACb,4EAA4E;QAC1E,uEAAuE;QACvE,kDAAkD,QAAQ;aACvD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;aACtB,IAAI,CAAC,IAAI,CAAC,EAAE,CAClB,CAAC;AACJ,CAAC"}
@@ -16,6 +16,23 @@ export declare function registerConnectorTools(server: McpServer, client: Axonit
16
16
  /** Keep the envelope, project the rows down to identity. */
17
17
  export declare function projectLinkRows(response: Record<string, unknown>, rowsKey: string): Record<string, unknown>;
18
18
  export declare function registerAttachTools(server: McpServer, client: AxonityClient): void;
19
+ /**
20
+ * "What breaks if I change this" — the reverse look-up, for both halves of the
21
+ * catalogue (axonity-flow#845 S5 and #961 S8).
22
+ *
23
+ * A shared library item is edited on the assumption that someone knows what
24
+ * uses it. Three items could answer that agent-first; the rest of the catalogue
25
+ * could not answer it at all, and there a broken reference stops a RUN rather
26
+ * than merely thinning a prompt. The only way to find out was to validate every
27
+ * workflow in the tenant and see where it went wrong.
28
+ *
29
+ * It was never queryable because these are not rows in a join table: they are
30
+ * keys inside a JSON document, and per entity in more than one place — an agent
31
+ * is a step OWNER and the `ownerAgentId` of a subprocess step; a tool appears in
32
+ * a step contract, in a plan activity, and on an automation step's config. The
33
+ * backend answers through one reader for exactly that reason.
34
+ */
35
+ export declare function registerDependencyTools(server: McpServer, client: AxonityClient): void;
19
36
  /**
20
37
  * Small standalone tools that don't fit any of the other groupings: the
21
38
  * system-tools catalog (read-only — there is no grant/revoke route; enabling