@axonity-ai/mcp 0.25.0 → 0.27.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.
- package/README.md +71 -42
- package/dist/contract.d.ts +14 -2
- package/dist/contract.js +30 -10
- package/dist/contract.js.map +1 -1
- package/dist/errors.d.ts +14 -4
- package/dist/errors.js +45 -15
- package/dist/errors.js.map +1 -1
- package/dist/generated/listFilters.d.ts +1 -1
- package/dist/generated/listFilters.js +2 -2
- package/dist/generated/listFilters.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +50 -22
- package/dist/index.js.map +1 -1
- package/dist/tools/authoringSpec.js +7 -2
- package/dist/tools/authoringSpec.js.map +1 -1
- package/dist/tools/conventions.d.ts +1 -1
- package/dist/tools/conventions.js +160 -86
- package/dist/tools/conventions.js.map +1 -1
- package/dist/tools/dataTables.js +3 -2
- package/dist/tools/dataTables.js.map +1 -1
- package/dist/tools/entityContract.js +5 -3
- package/dist/tools/entityContract.js.map +1 -1
- package/dist/tools/extras.d.ts +15 -5
- package/dist/tools/extras.js +71 -19
- package/dist/tools/extras.js.map +1 -1
- package/dist/tools/register.d.ts +14 -3
- package/dist/tools/register.js +3 -1
- package/dist/tools/register.js.map +1 -1
- package/dist/tools/runs.js +132 -58
- package/dist/tools/runs.js.map +1 -1
- package/dist/tools/validation.d.ts +5 -4
- package/dist/tools/validation.js +38 -19
- package/dist/tools/validation.js.map +1 -1
- package/dist/tools/versions.d.ts +1 -1
- package/package.json +1 -1
package/dist/tools/extras.js
CHANGED
|
@@ -1,31 +1,66 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Secondary MCP tools:
|
|
3
|
-
*
|
|
4
|
-
* by-agent read have no equivalent generic route), connectors (a tool
|
|
5
|
-
* subtype), attaching memory to a target, and a few standalone one-offs.
|
|
2
|
+
* Secondary MCP tools: an agent's persona, connectors (a tool subtype),
|
|
3
|
+
* attaching memory to a target, and a few standalone one-offs.
|
|
6
4
|
*
|
|
7
5
|
* These use routes with shapes that don't fit the generic entity registrar:
|
|
8
|
-
*
|
|
6
|
+
* the persona is a field of its agent, connectors are a tool with
|
|
9
7
|
* `type: "connector"` and MUST NOT carry real credentials, and attach/detach
|
|
10
8
|
* is a path-only link.
|
|
11
9
|
*/
|
|
12
10
|
import { z } from "zod";
|
|
13
11
|
import { assertPlaceholderCredentials } from "./credentials.js";
|
|
14
12
|
import { detachResult, guard, jsonResult } from "./result.js";
|
|
13
|
+
/**
|
|
14
|
+
* The persona is the agent's `persona` field (axonity-flow#2176): the
|
|
15
|
+
* character text every prompt of the agent opens with, published with the
|
|
16
|
+
* agent. The persona entity, its own id, versions, drafts and approvals are
|
|
17
|
+
* gone, and so are the persona routes the tools called (21 persona operations
|
|
18
|
+
* left the API; 19 of them had a tool here).
|
|
19
|
+
*
|
|
20
|
+
* These two tools stay as the migration path: an agent that knows them lands
|
|
21
|
+
* on the field instead of on a 404 it would read as "no such id". Everything
|
|
22
|
+
* else about a persona is the agent's: its history is the agent's versions,
|
|
23
|
+
* it goes live with `request_publish_agent`.
|
|
24
|
+
*/
|
|
15
25
|
export function registerPersonaTools(server, client) {
|
|
16
|
-
server.tool("read_agent_persona", "Read an agent's persona
|
|
17
|
-
"
|
|
18
|
-
|
|
26
|
+
server.tool("read_agent_persona", "Read an agent's persona: the character text every prompt of this agent " +
|
|
27
|
+
"opens with. It is the agent's `persona` field (also in `read_agent`), " +
|
|
28
|
+
"returned here with the agent's `version`, which `create_agent_persona` " +
|
|
29
|
+
"and `update_agent` take as `expectedVersion`. `persona` is null or `\"\"` " +
|
|
30
|
+
"when the agent has none (null: never set; `\"\"`: removed). Replaces " +
|
|
31
|
+
"`read_persona`, `read_persona_published`, `read_persona_version`, " +
|
|
32
|
+
"`list_persona_versions`, `list_deleted_persona_versions`, " +
|
|
33
|
+
"`list_personas` and `list_deleted_personas`: a persona has no id, " +
|
|
34
|
+
"versions or list of its own any more.", { agentId: z.string().describe("The agent's id.") }, async ({ agentId }) => guard(async () => {
|
|
35
|
+
const agent = (await client.get(`/api/v1/agents/${agentId}`));
|
|
36
|
+
return jsonResult({
|
|
37
|
+
agentId,
|
|
38
|
+
persona: agent.persona ?? null,
|
|
39
|
+
version: agent.version,
|
|
40
|
+
});
|
|
41
|
+
}));
|
|
42
|
+
server.tool("create_agent_persona", "Set an agent's persona: who the agent is, in its own words — the " +
|
|
43
|
+
"character text every prompt of this agent opens with. It writes the " +
|
|
44
|
+
"agent's `persona` field on its draft (the same as `update_agent` with " +
|
|
45
|
+
"`{ persona }`) and goes live with the agent (`request_publish_agent`). " +
|
|
46
|
+
"Setting it again replaces it. Read the agent first (`read_agent` or " +
|
|
47
|
+
"`read_agent_persona`) for `expectedVersion`; on a 409, re-read and retry. " +
|
|
48
|
+
"There is no separate name or status: a persona is only its text. To " +
|
|
49
|
+
"remove it, send `\"\"`; on update_agent `null` changes nothing. Replaces " +
|
|
50
|
+
"`update_persona`, `delete_persona`, `restore_persona`, " +
|
|
51
|
+
"`discard_persona_draft`, `create_persona_major_version`, " +
|
|
52
|
+
"`ensure_persona_major_version`, `name_persona_major_version`, " +
|
|
53
|
+
"`delete_persona_version`, `restore_persona_version`, " +
|
|
54
|
+
"`restore_deleted_persona_version` and `request_publish_persona`: the " +
|
|
55
|
+
"persona's history is the agent's versions, and it goes live with " +
|
|
56
|
+
"`request_publish_agent`.", {
|
|
19
57
|
agentId: z.string().describe("The agent's id."),
|
|
20
|
-
|
|
21
|
-
.
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// from the "persona" EntityDef in index.ts — identical PUT semantics to what
|
|
27
|
-
// used to be hand-written here. Only the agent-scoped create/read above are
|
|
28
|
-
// bespoke, because personas have no standalone create route.
|
|
58
|
+
expectedVersion: z
|
|
59
|
+
.number()
|
|
60
|
+
.int()
|
|
61
|
+
.describe("The agent's current `version`, from read_agent or read_agent_persona."),
|
|
62
|
+
persona: z.string().describe("The character text, as the agent should read it."),
|
|
63
|
+
}, async ({ agentId, expectedVersion, persona }) => guard(async () => jsonResult(await client.put(`/api/v1/agents/${agentId}`, { expectedVersion, persona }))));
|
|
29
64
|
}
|
|
30
65
|
/**
|
|
31
66
|
* The shape `implementation` must have for a connector to run.
|
|
@@ -56,6 +91,11 @@ const CONNECTOR_SHAPE = "\n\nSHAPE OF `implementation` — `headers` and `queryP
|
|
|
56
91
|
* file of the run, not parsed. Without this sentence the only mappings an agent
|
|
57
92
|
* knew were the parsing ones.
|
|
58
93
|
*
|
|
94
|
+
* `sha256` in the reference (axonity-flow#2299): the hash stored with the
|
|
95
|
+
* bytes, settled from storage where a reference enters a run, so a workflow
|
|
96
|
+
* can recognise a file it already processed. Which value counts is said here
|
|
97
|
+
* because a caller-written hash would silently skip a new document.
|
|
98
|
+
*
|
|
59
99
|
* Kept short on purpose: the platform's live contract
|
|
60
100
|
* (`get_entity_authoring_contract`, axonity-flow#2103) is the authority, and
|
|
61
101
|
* this is guidance until every deploy serves it.
|
|
@@ -68,8 +108,20 @@ const CONNECTOR_EFFECT_AND_FILE = "\n\nDECLARE WHAT IT DOES — `implementation.
|
|
|
68
108
|
"\n\nAN ANSWER THAT IS A FILE — `implementation.responseMapping: " +
|
|
69
109
|
'{ "type": "file", "filename": "{{filename}}" }`. The bytes are kept as a ' +
|
|
70
110
|
"file of the run and the connector returns its reference, `{ fileId, " +
|
|
71
|
-
"filename, contentType, sizeBytes }` — the shape an upload has, so
|
|
72
|
-
"documents reads it and a sub-workflow's file parameter takes it. " +
|
|
111
|
+
"filename, contentType, sizeBytes, sha256 }` — the shape an upload has, so " +
|
|
112
|
+
"Digitize documents reads it and a sub-workflow's file parameter takes it. " +
|
|
113
|
+
"`sha256` is the hex SHA-256 of the bytes, computed once when the file was " +
|
|
114
|
+
"stored; the same bytes have the same value under any name, so compare it " +
|
|
115
|
+
"to recognise a file that was already processed. Only a reference in a " +
|
|
116
|
+
"declared file parameter (`file`, or a list of `file`) is checked against " +
|
|
117
|
+
"storage: where one enters a run (a manual, API or MCP start, a " +
|
|
118
|
+
"sub-workflow call) its fields are settled from storage. A reference to a " +
|
|
119
|
+
"file the run may not read keeps what the caller wrote and carries no " +
|
|
120
|
+
"`sha256` — at a webhook, cron or conditional start, each of them. A " +
|
|
121
|
+
"reference anywhere else (an `object` field, an undeclared key) is not " +
|
|
122
|
+
"checked and keeps any `sha256` the caller wrote. Digitize documents " +
|
|
123
|
+
"always answers the stored `sha256` per file it read. So compare only the " +
|
|
124
|
+
"value on a declared file parameter or on Digitize's entry. " +
|
|
73
125
|
"`filename` is optional and may use the inputs (`{{name}}`); without it the " +
|
|
74
126
|
"far end's `Content-Disposition` name is used, else `document`. A file " +
|
|
75
127
|
"answer takes no `responseTransform`. Outside a run (e.g. " +
|
package/dist/tools/extras.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extras.js","sourceRoot":"","sources":["../../src/tools/extras.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,MAAqB;IAErB,MAAM,CAAC,IAAI,CACT,oBAAoB,EACpB,8EAA8E;QAC5E,sCAAsC,EACxC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,EACnD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CACpB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,kBAAkB,OAAO,UAAU,CAAC,CAAC,CAClE,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,0EA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C,CAAC,EAAE,EAC9E,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CACvB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,qBAAqB,UAAU,EAAE,CAAC,CAAC,CAChE,CACJ,CAAC;AACJ,CAAC"}
|
package/dist/tools/register.d.ts
CHANGED
|
@@ -54,6 +54,14 @@ export interface EntityDef {
|
|
|
54
54
|
updateMethod: "PUT" | "PATCH";
|
|
55
55
|
/** One-line human description of the entity, for the tool docs. */
|
|
56
56
|
label: string;
|
|
57
|
+
/**
|
|
58
|
+
* The field names `create_<entity>`'s `fields` example shows. Default
|
|
59
|
+
* `["name", "description"]`. Set it where the create body lacks one of
|
|
60
|
+
* those — the agent body is strict, and an example key it does not know is a
|
|
61
|
+
* 422 for whoever copies it. A test holds every example to the create
|
|
62
|
+
* body's schema.
|
|
63
|
+
*/
|
|
64
|
+
createExample?: string[];
|
|
57
65
|
/**
|
|
58
66
|
* Optional pre-write check on the caller's fields, applied to `create_*` and
|
|
59
67
|
* `update_*`. Throws to reject. Used to run the connector credential guard on
|
|
@@ -62,7 +70,7 @@ export interface EntityDef {
|
|
|
62
70
|
guardFields?: (fields: Record<string, unknown>) => void;
|
|
63
71
|
/**
|
|
64
72
|
* Whether `request_publish_<entity>` is generated. Default true, and true for
|
|
65
|
-
* every current entity
|
|
73
|
+
* every current entity (flow included): each is a valid `entityType` for a
|
|
66
74
|
* publish approval on the backend (`ApprovalEntityType`). Set false only for a
|
|
67
75
|
* future entity that genuinely cannot be publish-approved.
|
|
68
76
|
*/
|
|
@@ -73,7 +81,10 @@ export interface EntityDef {
|
|
|
73
81
|
* rather than shipping `list_policys`.
|
|
74
82
|
*/
|
|
75
83
|
plural?: string;
|
|
76
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Whether `create_<entity>` is generated. Default true. False for an entity
|
|
86
|
+
* created only through a parent, which then needs its own create tool.
|
|
87
|
+
*/
|
|
77
88
|
creatable?: boolean;
|
|
78
89
|
/**
|
|
79
90
|
* Whether `read_<entity>` is generated. Default true, and true for every
|
|
@@ -88,7 +99,7 @@ export interface EntityDef {
|
|
|
88
99
|
* an entity with no lifecycle routes. The two spellings are a real backend
|
|
89
100
|
* inconsistency, not a typo: `expectedVersion` (workflow, agent, tool,
|
|
90
101
|
* prompt_snippet, flow) vs `expected_version` (skill, policy, reference_doc,
|
|
91
|
-
* output_schema
|
|
102
|
+
* output_schema).
|
|
92
103
|
*/
|
|
93
104
|
deleteVersionParam?: "expectedVersion" | "expected_version";
|
|
94
105
|
/**
|
package/dist/tools/register.js
CHANGED
|
@@ -103,7 +103,9 @@ export function registerEntityTools(server, client, def) {
|
|
|
103
103
|
fields: z
|
|
104
104
|
.record(z.unknown())
|
|
105
105
|
.describe(`The ${singular}'s fields as a JSON object (camelCase keys), e.g. ` +
|
|
106
|
-
`{ "name"
|
|
106
|
+
`{ ${(def.createExample ?? ["name", "description"])
|
|
107
|
+
.map((k) => `"${k}": "…"`)
|
|
108
|
+
.join(", ")} }.`),
|
|
107
109
|
}, async ({ fields }) => guard(async () => {
|
|
108
110
|
guardFields?.(fields);
|
|
109
111
|
return jsonResult(await client.post(basePath, fields));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/tools/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,+EAA+E;AAC/E,MAAM,OAAO,GAAG,CAAC;KACd,OAAO,CAAC,IAAI,CAAC;KACb,QAAQ,CAAC,gEAAgE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/tools/register.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AAE,EAAE,EAAE,EAAE,CACf,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,EAAE,gBAAgB,CAAC,CAAC,CACjE,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,MAAM,CAAC,IAAI,CACT,mBAAmB,QAAQ,EAAE,EAC7B,kBAAkB,QAAQ,+CAA+C;QACvE,sEAAsE;QACtE,wCAAwC;QACxC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACnD;QACE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,QAAQ,QAAQ,CAAC;QAChD,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,wDAAwD,CAAC;KACtE,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAC9B,KAAK,CAAC,KAAK,IAAI,EAAE;QACf,IAAI,QAAQ,KAAK,UAAU;YAAE,MAAM,wBAAwB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACxE,OAAO,UAAU,CACf,MAAM,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE;YAC7C,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,EAAE;YACZ,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5C,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC"}
|
package/dist/tools/runs.js
CHANGED
|
@@ -51,8 +51,9 @@ export function registerRunTools(server, client) {
|
|
|
51
51
|
"triggerId that does not exist is a 422 listing the ones that do, never a " +
|
|
52
52
|
"quiet fallback to a different start. " +
|
|
53
53
|
"\n\nA run may PARK on a step that asks a question instead of finishing. " +
|
|
54
|
-
"
|
|
55
|
-
"send_run_message are how it moves
|
|
54
|
+
"list_todo_steps lists the step it waits on (each item carries its runId " +
|
|
55
|
+
"and stepId); answer_run_question and send_run_message are how it moves " +
|
|
56
|
+
"again. " +
|
|
56
57
|
"\n\nA chat with the Dashboard Analyst is not a workflow run: start one " +
|
|
57
58
|
"with start_conversation.", {
|
|
58
59
|
workflowId: z.string().describe("The workflow's id."),
|
|
@@ -91,7 +92,8 @@ export function registerRunTools(server, client) {
|
|
|
91
92
|
return jsonResult({ deleted: true, runId });
|
|
92
93
|
}));
|
|
93
94
|
server.tool("list_runs", "List workflow runs across the tenant, newest first. Archived runs are " +
|
|
94
|
-
"excluded unless includeArchived is true
|
|
95
|
+
"excluded unless includeArchived is true, and the platform's own work " +
|
|
96
|
+
"(labelled `isPlatform`) unless includePlatform is true. To list runs of ONE workflow, " +
|
|
95
97
|
"use list_workflow_runs instead — this route has no workflow filter." +
|
|
96
98
|
"\n\nTHE RESPONSE IS ONE PAGE, NOT THE FULL LIST: " +
|
|
97
99
|
"{ items, nextCursor, pageSize, hasMore }. Default page size is 20, max " +
|
|
@@ -104,8 +106,10 @@ export function registerRunTools(server, client) {
|
|
|
104
106
|
"is a cursor and not an offset: an offset window under that rate skips " +
|
|
105
107
|
"and repeats rows between pages. Never build a cursor — echo back the " +
|
|
106
108
|
"one you were given. " +
|
|
107
|
-
"\n\
|
|
108
|
-
"
|
|
109
|
+
"\n\nLike list_workflow_runs, the per-item runs of a FOR EACH are NOT here: " +
|
|
110
|
+
"a launch over 4,415 items is ONE row. The item results live inside their " +
|
|
111
|
+
"launch — list_run_items for the rows, read_run_for_each_progress for the " +
|
|
112
|
+
"counts. " +
|
|
109
113
|
"\n\nCONVERSATIONS ARE NOT HERE. A chat about a dashboard with the " +
|
|
110
114
|
"Dashboard Analyst is a run of kind `conversation`; this tool asks the " +
|
|
111
115
|
"route for workflow runs only. list_conversations lists the chats — " +
|
|
@@ -118,6 +122,12 @@ export function registerRunTools(server, client) {
|
|
|
118
122
|
createdAfter: z.string().optional().describe("ISO date lower bound."),
|
|
119
123
|
createdBefore: z.string().optional().describe("ISO date upper bound."),
|
|
120
124
|
includeArchived: z.boolean().optional().describe("Defaults to false."),
|
|
125
|
+
includePlatform: z
|
|
126
|
+
.boolean()
|
|
127
|
+
.optional()
|
|
128
|
+
.describe("Also the platform's own work (Maintain knowledge, Learn from a run), " +
|
|
129
|
+
"each row labelled `isPlatform`. Defaults to false: left out, those " +
|
|
130
|
+
"runs are not in the list."),
|
|
121
131
|
limit: z
|
|
122
132
|
.number()
|
|
123
133
|
.int()
|
|
@@ -129,11 +139,12 @@ export function registerRunTools(server, client) {
|
|
|
129
139
|
.optional()
|
|
130
140
|
.describe("Opaque continuation cursor from the previous response's nextCursor. " +
|
|
131
141
|
"Omit for the first page. Do not parse or construct one."),
|
|
132
|
-
}, async ({ status, createdAfter, createdBefore, includeArchived, limit, cursor }) => guard(async () => jsonResult(await client.get("/api/v1/runs", {
|
|
142
|
+
}, async ({ status, createdAfter, createdBefore, includeArchived, includePlatform, limit, cursor }) => guard(async () => jsonResult(await client.get("/api/v1/runs", {
|
|
133
143
|
status,
|
|
134
144
|
created_after: createdAfter,
|
|
135
145
|
created_before: createdBefore,
|
|
136
146
|
include_archived: includeArchived,
|
|
147
|
+
include_platform: includePlatform,
|
|
137
148
|
limit,
|
|
138
149
|
cursor,
|
|
139
150
|
}))));
|
|
@@ -226,9 +237,34 @@ export function registerRunTools(server, client) {
|
|
|
226
237
|
}, async ({ runId, includeSnapshot }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}`, {
|
|
227
238
|
includeSnapshot: includeSnapshot === true,
|
|
228
239
|
}))));
|
|
229
|
-
server.tool("list_todo_steps", "The steps across the TENANT that are waiting on a
|
|
230
|
-
"
|
|
231
|
-
"
|
|
240
|
+
server.tool("list_todo_steps", "The steps across the TENANT that are waiting on a person — one item per " +
|
|
241
|
+
"step. This is the list you read to answer 'is anything stuck on me?' " +
|
|
242
|
+
"without knowing which run to look at. " +
|
|
243
|
+
"\n\nWHAT IS AN ITEM: a step of a run that is `waiting` or " +
|
|
244
|
+
"`input_required`, not archived and not a conversation, that waits for " +
|
|
245
|
+
"one of four things (`todoType`): `ask_user` — an agent asked a question " +
|
|
246
|
+
"that is not answered; `plan_approval` — a plan waits for a decision; " +
|
|
247
|
+
"`manual_step` or `decision` — the step type says a person does it. NOT " +
|
|
248
|
+
"items: a debug pause (`phase_control`) or any other step without one of " +
|
|
249
|
+
"those reasons, and a question already answered whose run has not " +
|
|
250
|
+
"resumed yet (the answer is on its way). A conversation waits for its " +
|
|
251
|
+
"person in the chat, not here. " +
|
|
252
|
+
"\n\nWHOSE IT IS: each item belongs to one agent or to none (`agentId`). " +
|
|
253
|
+
"A question or a plan belongs to the agent that asked (the agent of the " +
|
|
254
|
+
"step's latest orchestrator call; with none on record, the workflow's " +
|
|
255
|
+
"owner). A manual step or a decision belongs to the workflow's owner " +
|
|
256
|
+
"(none when the workflow has no live owner or is deleted). None for the " +
|
|
257
|
+
"budget question the platform itself asked under the old budget rule " +
|
|
258
|
+
"(marked `budget_pause` in the question's state), and for every step of " +
|
|
259
|
+
"a run the run history hides (a hidden platform workflow). Pass " +
|
|
260
|
+
"`agentId` for that agent's items only — the items its \"Needs you\" " +
|
|
261
|
+
"counts; an agent of another workspace has none. Without it the list " +
|
|
262
|
+
"shows every item, those on no agent included. " +
|
|
263
|
+
"\n\nEach item also carries `askedAt` (when the agent asked; null for an " +
|
|
264
|
+
"item that is not a question) and `groupKey`: equal for literally equal " +
|
|
265
|
+
"questions — same workflow, same step, question text equal character " +
|
|
266
|
+
"for character — so they can be shown once. Each is still answered on " +
|
|
267
|
+
"its own run. Null for an item without a question. " +
|
|
232
268
|
"\n\nTHE RESPONSE IS ONE PAGE, NOT THE FULL LIST: " +
|
|
233
269
|
"{ items, nextCursor, pageSize, hasMore }. While hasMore is true you have " +
|
|
234
270
|
"NOT seen every waiting step — pass the response's nextCursor back as " +
|
|
@@ -237,9 +273,13 @@ export function registerRunTools(server, client) {
|
|
|
237
273
|
"one run can carry several waiting steps, so `items` may be LONGER than " +
|
|
238
274
|
"pageSize. That is not a bug and not an overflow — pageSize bounds what " +
|
|
239
275
|
"was read, not what came back. A fan-out can park thousands of items on " +
|
|
240
|
-
"one manual step at once, which is why this list is paged at all. " +
|
|
241
|
-
"
|
|
242
|
-
"
|
|
276
|
+
"one manual step at once, which is why this list is paged at all. Without " +
|
|
277
|
+
"agentId a run read may hold no item, so a page can also be shorter than " +
|
|
278
|
+
"pageSize, even empty, while hasMore is true; with agentId only the runs " +
|
|
279
|
+
"holding an item of that agent are walked. " +
|
|
280
|
+
"\n\nread_run_waiting_on is a different read: the pending wake-tasks of " +
|
|
281
|
+
"one run you already have (a timer; an answer, a chat message or a " +
|
|
282
|
+
"callback's result on its way). An open question has no wake-task.", {
|
|
243
283
|
limit: z
|
|
244
284
|
.number()
|
|
245
285
|
.int()
|
|
@@ -250,7 +290,12 @@ export function registerRunTools(server, client) {
|
|
|
250
290
|
.optional()
|
|
251
291
|
.describe("Opaque continuation cursor from the previous response's nextCursor. " +
|
|
252
292
|
"Omit for the first page. Do not parse or construct one."),
|
|
253
|
-
|
|
293
|
+
agentId: z
|
|
294
|
+
.string()
|
|
295
|
+
.optional()
|
|
296
|
+
.describe("An agent's id (a UUID): only the items that belong to that agent. " +
|
|
297
|
+
"Omit for every item in the tenant."),
|
|
298
|
+
}, async ({ limit, cursor, agentId }) => guard(async () => jsonResult(await client.get("/api/v1/runs/todo", { limit, cursor, agentId }))));
|
|
254
299
|
server.tool("list_run_session_memory", "List the files an agent wrote to SESSION MEMORY during a run — title, " +
|
|
255
300
|
"kind, tags, size and timestamp for each. Bodies are not included; fetch " +
|
|
256
301
|
"one with read_run_session_memory_file. " +
|
|
@@ -362,11 +407,21 @@ export function registerRunTools(server, client) {
|
|
|
362
407
|
// ---- Why a run is parked, and what it did ------------------------------
|
|
363
408
|
server.tool("read_run_waiting_on", "Why a run is PARKED. A run in `waiting` or `input_required` is not stuck " +
|
|
364
409
|
"and not slow — it is holding for something, and this lists every pending " +
|
|
365
|
-
"wake-task targeting it: a
|
|
366
|
-
"
|
|
410
|
+
"wake-task targeting it: a timer, or an answer, a chat message or a " +
|
|
411
|
+
"callback's result on its way (a callback row appears only once the work " +
|
|
412
|
+
"behind it has finished). Read this before concluding a test run failed. " +
|
|
413
|
+
"\n\nA step that waits on a PERSON — an open question, a plan, a manual or " +
|
|
414
|
+
"a decision step — has NO wake-task and is not here: a question's wake-task " +
|
|
415
|
+
"is planted only once someone answers it. Those steps are on " +
|
|
416
|
+
"list_todo_steps (with their runId and stepId), and in read_run as a step " +
|
|
417
|
+
"whose status is `waiting_for_input` and whose `waitReason` says why. " +
|
|
418
|
+
"\n\nA run waiting on a FOR EACH batch, or on a callback whose work is " +
|
|
419
|
+
"still running, has no wake-task here either: the batch waits as a marker " +
|
|
420
|
+
"on its step (watch it with read_run_for_each_progress), and the running " +
|
|
421
|
+
"work is a task in list_run_tasks. " +
|
|
367
422
|
"\n\nAn EMPTY list is a real answer, not an error: the run may have every " +
|
|
368
|
-
"wake already resolved and be about to resume
|
|
369
|
-
"
|
|
423
|
+
"wake already resolved and be about to resume, or it waits on something " +
|
|
424
|
+
"with no wake-task — a person, a FOR EACH batch, a callback still running.", {
|
|
370
425
|
runId: z.string().describe("The run's id."),
|
|
371
426
|
limit: z.number().int().optional().describe("How many to return. Default 50."),
|
|
372
427
|
}, async ({ runId, limit }) => guard(async () => jsonResult(await client.get(`/api/v1/runs/${runId}/waiting-on`, { limit }))));
|
|
@@ -419,13 +474,13 @@ export function registerRunTools(server, client) {
|
|
|
419
474
|
server.tool("answer_run_question", "Answer an `ask_user` step a run is parked on, so the run resumes. This is " +
|
|
420
475
|
"what makes \"start a run and see what it does\" finishable: without it a " +
|
|
421
476
|
"workflow that asks anything waits forever and a test never returns a " +
|
|
422
|
-
"verdict. Find the parked step with
|
|
477
|
+
"verdict. Find the parked step with list_todo_steps or read_run. " +
|
|
423
478
|
"\n\nThe answer is recorded as the ANSWER A PERSON WOULD HAVE GIVEN and " +
|
|
424
479
|
"the run proceeds on it. On a run a human is depending on, that is their " +
|
|
425
480
|
"decision to make, not yours — answer your own test runs, and ask before " +
|
|
426
481
|
"answering someone else's. Returns the run's updated detail.", {
|
|
427
482
|
runId: z.string().describe("The run's id."),
|
|
428
|
-
stepId: z.string().describe("The suspended step's id, from
|
|
483
|
+
stepId: z.string().describe("The suspended step's id, from list_todo_steps or read_run."),
|
|
429
484
|
answer: z.string().describe("The answer text the step is waiting for."),
|
|
430
485
|
}, async ({ runId, stepId, answer }) => guard(async () => jsonResult(await client.post(`/api/v1/runs/${runId}/steps/${stepId}/answer`, { answer }))));
|
|
431
486
|
server.tool("complete_run_step", "Complete a MANUAL or DECISION step a run is parked on, so the run " +
|
|
@@ -440,12 +495,12 @@ export function registerRunTools(server, client) {
|
|
|
440
495
|
"it. Only do this when a person has told you the work is done, or on a " +
|
|
441
496
|
"test run of your own where nothing real depended on the step. Never to " +
|
|
442
497
|
"get a stuck run moving. " +
|
|
443
|
-
"\n\nFind the parked step with
|
|
498
|
+
"\n\nFind the parked step with list_todo_steps or read_run. Returns the run's " +
|
|
444
499
|
"updated detail. Deciding a PLAN APPROVAL is a different thing again and " +
|
|
445
500
|
"is deliberately not available here — that step exists to get a human's " +
|
|
446
501
|
"review, and an agent approving it would often be approving its own plan.", {
|
|
447
502
|
runId: z.string().describe("The run's id."),
|
|
448
|
-
stepId: z.string().describe("The parked step's id, from
|
|
503
|
+
stepId: z.string().describe("The parked step's id, from list_todo_steps or read_run."),
|
|
449
504
|
selectedBranch: z
|
|
450
505
|
.string()
|
|
451
506
|
.optional()
|
|
@@ -486,11 +541,13 @@ export function registerRunTools(server, client) {
|
|
|
486
541
|
// A chat about a dashboard is a run of kind `conversation` with no workflow;
|
|
487
542
|
// list_runs asks for kind=workflow only. Two backend routes list these chats
|
|
488
543
|
// and neither does everything, so list_conversations picks one per call:
|
|
489
|
-
// - GET /conversations?dashboardId= — one dashboard
|
|
544
|
+
// - GET /conversations?dashboardId= — one dashboard, with status,
|
|
545
|
+
// createdAfter/createdBefore and q (axonity-flow#2331); no archive filter.
|
|
490
546
|
// - GET /runs?kind=conversation — every dashboard the person can see, with
|
|
491
|
-
// status, created_after/created_before and include_archived
|
|
492
|
-
//
|
|
493
|
-
// local refusal rather than a quiet drop
|
|
547
|
+
// status, created_after/created_before and include_archived; no text filter.
|
|
548
|
+
// What one route has and the other has not (includeArchived with a
|
|
549
|
+
// dashboard, q without one) is a local refusal rather than a quiet drop.
|
|
550
|
+
// Both routes return
|
|
494
551
|
// only the token holder's own dashboard chats; the Builder chat never
|
|
495
552
|
// appears (test/denyList.ts says why it stays out).
|
|
496
553
|
server.tool("list_conversations", "List conversations with the Dashboard Analyst, newest first. Use it to " +
|
|
@@ -500,21 +557,22 @@ export function registerRunTools(server, client) {
|
|
|
500
557
|
"\n\nTWO WAYS TO ASK, because the backend has two lists and neither " +
|
|
501
558
|
"does both: " +
|
|
502
559
|
"\n- With `dashboardId`: the chats about that one dashboard — the history " +
|
|
503
|
-
"its chat window shows
|
|
504
|
-
"
|
|
560
|
+
"its chat window shows — filtered by `status`, `createdAfter`/`createdBefore` " +
|
|
561
|
+
"and `q` (text in the opening question) before the page is cut " +
|
|
562
|
+
"(axonity-flow#2331). Archived chats are left out. A value this list " +
|
|
563
|
+
"cannot read is a 422 with the reason. " +
|
|
505
564
|
"\n- Without `dashboardId`: the chats about EVERY dashboard the person can " +
|
|
506
565
|
"still see, filtered by `status`, `createdAfter`/`createdBefore` and " +
|
|
507
566
|
"`includeArchived` in the database before the page is cut — so \"which " +
|
|
508
567
|
"chats failed last week?\" is one page, not a walk. " +
|
|
509
|
-
"\
|
|
510
|
-
"
|
|
511
|
-
"
|
|
512
|
-
"
|
|
513
|
-
"\n\nWHAT CANNOT BE FILTERED AT ALL: who opened the chat
|
|
514
|
-
"
|
|
515
|
-
"
|
|
516
|
-
"
|
|
517
|
-
"every row across all pages. " +
|
|
568
|
+
"\nWhat one list has and the other has not is refused here rather than " +
|
|
569
|
+
"half-applied: `includeArchived` with `dashboardId`, and `q` without it. " +
|
|
570
|
+
"The two lists read a bare `createdBefore` date differently; see that " +
|
|
571
|
+
"argument. " +
|
|
572
|
+
"\n\nWHAT CANNOT BE FILTERED AT ALL: who opened the chat. Both lists " +
|
|
573
|
+
"return only the chats opened by the person this connector's token " +
|
|
574
|
+
"belongs to (who minted it) — a colleague's chat in the app is never " +
|
|
575
|
+
"listed. " +
|
|
518
576
|
"\n\nEach row: `id` (the run id), `question` (the opening question, null " +
|
|
519
577
|
"when the chat was opened without one), `dashboardId`, `status`, " +
|
|
520
578
|
"`createdAt`/`startedAt`/`completedAt`, `createdByName`. The tile a " +
|
|
@@ -533,7 +591,7 @@ export function registerRunTools(server, client) {
|
|
|
533
591
|
.min(1)
|
|
534
592
|
.optional()
|
|
535
593
|
.describe("Only the chats about this dashboard, from list_dashboards. Cannot be " +
|
|
536
|
-
"combined with
|
|
594
|
+
"combined with includeArchived."),
|
|
537
595
|
status: z
|
|
538
596
|
.string()
|
|
539
597
|
.optional()
|
|
@@ -541,25 +599,36 @@ export function registerRunTools(server, client) {
|
|
|
541
599
|
"A conversation's own statuses: `idle` = answered, waiting for the " +
|
|
542
600
|
"next question (NOT `completed`: an answered chat never reaches it); " +
|
|
543
601
|
"`running` = the analyst is working on a turn; `failed`; " +
|
|
544
|
-
"`completed` only once a chat was ended.
|
|
545
|
-
"refused — it just matches nothing, so an
|
|
546
|
-
"misspelt status
|
|
602
|
+
"`completed` only once a chat was ended. Without dashboardId an " +
|
|
603
|
+
"unknown status is not refused — it just matches nothing, so an " +
|
|
604
|
+
"empty page may mean a misspelt status; with dashboardId it is a " +
|
|
605
|
+
"422. Omit for all."),
|
|
547
606
|
createdAfter: z
|
|
548
607
|
.string()
|
|
549
608
|
.optional()
|
|
550
609
|
.describe("ISO date or datetime lower bound on when the chat started (a bare " +
|
|
551
610
|
"date is midnight at its start, so that day is included), e.g. " +
|
|
552
|
-
'"2026-11-01". Without dashboardId
|
|
611
|
+
'"2026-11-01". Without dashboardId, a value the backend cannot ' +
|
|
553
612
|
"parse is IGNORED, not refused — the list then comes back unfiltered " +
|
|
554
|
-
"by it, so send a plain ISO date."
|
|
613
|
+
"by it, so send a plain ISO date. With dashboardId it is a 422, and " +
|
|
614
|
+
"a date-time without an offset is read as UTC."),
|
|
555
615
|
createdBefore: z
|
|
556
616
|
.string()
|
|
557
617
|
.optional()
|
|
558
|
-
.describe("ISO date or datetime upper bound, inclusive of that MOMENT.
|
|
618
|
+
.describe("ISO date or datetime upper bound, inclusive of that MOMENT. The two " +
|
|
619
|
+
"lists read a bare date differently. Without dashboardId a bare " +
|
|
559
620
|
'date means midnight at its start, so "2026-11-03" EXCLUDES the ' +
|
|
560
621
|
'chats of 3 November itself: for "up to and including 3 November" ' +
|
|
561
|
-
'send "2026-11-04" or "2026-11-03T23:59:59"
|
|
562
|
-
"
|
|
622
|
+
'send "2026-11-04" or "2026-11-03T23:59:59"; an unparseable value is ' +
|
|
623
|
+
"silently ignored. With dashboardId a bare date means the END of that " +
|
|
624
|
+
"day, so createdAfter = createdBefore = one date is that day's chats; " +
|
|
625
|
+
"an unparseable value is a 422. A date-time is exact on both."),
|
|
626
|
+
q: z
|
|
627
|
+
.string()
|
|
628
|
+
.optional()
|
|
629
|
+
.describe("With dashboardId only: the chats whose opening question contains this " +
|
|
630
|
+
"text, ignoring case and the spaces around it. Taken literally: % and " +
|
|
631
|
+
"_ match themselves."),
|
|
563
632
|
includeArchived: z
|
|
564
633
|
.boolean()
|
|
565
634
|
.optional()
|
|
@@ -575,25 +644,30 @@ export function registerRunTools(server, client) {
|
|
|
575
644
|
.optional()
|
|
576
645
|
.describe("Opaque continuation cursor from the previous response's nextCursor. " +
|
|
577
646
|
"Omit for the first page. Do not parse or construct one."),
|
|
578
|
-
}, async ({ dashboardId, status, createdAfter, createdBefore, includeArchived, limit, cursor }) => guard(async () => {
|
|
647
|
+
}, async ({ dashboardId, status, createdAfter, createdBefore, q, includeArchived, limit, cursor }) => guard(async () => {
|
|
579
648
|
// The page envelope is forwarded WHOLE on both routes, as list_runs
|
|
580
649
|
// does (#37).
|
|
581
650
|
if (dashboardId !== undefined) {
|
|
582
|
-
|
|
651
|
+
if (includeArchived !== undefined) {
|
|
652
|
+
throw new Error("list_conversations: includeArchived cannot be combined with " +
|
|
653
|
+
"dashboardId — the backend's per-dashboard list leaves archived " +
|
|
654
|
+
"chats out and has no such filter. Leave dashboardId out to " +
|
|
655
|
+
"include them, and keep the rows whose dashboardId matches.");
|
|
656
|
+
}
|
|
657
|
+
return jsonResult(await client.get("/api/v1/conversations", {
|
|
658
|
+
dashboardId,
|
|
583
659
|
status,
|
|
584
660
|
createdAfter,
|
|
585
661
|
createdBefore,
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}
|
|
596
|
-
return jsonResult(await client.get("/api/v1/conversations", { dashboardId, limit, cursor }));
|
|
662
|
+
q,
|
|
663
|
+
limit,
|
|
664
|
+
cursor,
|
|
665
|
+
}));
|
|
666
|
+
}
|
|
667
|
+
if (q !== undefined) {
|
|
668
|
+
throw new Error("list_conversations: `q` needs dashboardId — only the per-dashboard " +
|
|
669
|
+
"list filters on the question's text. Without a dashboard, read " +
|
|
670
|
+
"`question` on every row across all pages.");
|
|
597
671
|
}
|
|
598
672
|
return jsonResult(await client.get("/api/v1/runs", {
|
|
599
673
|
kind: "conversation",
|