@axonity-ai/mcp 0.17.1 → 0.20.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 +105 -37
- package/dist/errors.js +45 -11
- package/dist/errors.js.map +1 -1
- package/dist/generated/listFilters.js +23 -1
- package/dist/generated/listFilters.js.map +1 -1
- package/dist/index.js +208 -26
- package/dist/index.js.map +1 -1
- package/dist/tools/access.d.ts +19 -0
- package/dist/tools/access.js +71 -0
- package/dist/tools/access.js.map +1 -0
- package/dist/tools/applications.d.ts +24 -0
- package/dist/tools/applications.js +145 -0
- package/dist/tools/applications.js.map +1 -0
- package/dist/tools/concepts.js +68 -3
- package/dist/tools/concepts.js.map +1 -1
- package/dist/tools/conventions.d.ts +2 -2
- package/dist/tools/conventions.js +105 -38
- package/dist/tools/conventions.js.map +1 -1
- package/dist/tools/dataSources.d.ts +5 -5
- package/dist/tools/dataSources.js +10 -9
- package/dist/tools/dataSources.js.map +1 -1
- package/dist/tools/dataTables.js +7 -5
- package/dist/tools/dataTables.js.map +1 -1
- package/dist/tools/entityContract.d.ts +44 -0
- package/dist/tools/entityContract.js +90 -0
- package/dist/tools/entityContract.js.map +1 -0
- package/dist/tools/extras.js +40 -2
- package/dist/tools/extras.js.map +1 -1
- package/dist/tools/knowledgeGraph.d.ts +28 -0
- package/dist/tools/knowledgeGraph.js +126 -0
- package/dist/tools/knowledgeGraph.js.map +1 -0
- package/dist/tools/queries.d.ts +18 -0
- package/dist/tools/queries.js +70 -0
- package/dist/tools/queries.js.map +1 -0
- package/dist/tools/triggers.js +69 -79
- package/dist/tools/triggers.js.map +1 -1
- package/dist/tools/validation.js +21 -3
- package/dist/tools/validation.js.map +1 -1
- package/dist/tools/workflowMutations.d.ts +18 -0
- package/dist/tools/workflowMutations.js +61 -5
- package/dist/tools/workflowMutations.js.map +1 -1
- package/package.json +1 -1
|
@@ -241,6 +241,16 @@ has run cleanly once, at its current version.
|
|
|
241
241
|
|
|
242
242
|
## Per entity — what to create, and what "complete" means
|
|
243
243
|
|
|
244
|
+
**The platform's live create contract wins.** \`get_entity_authoring_contract\`
|
|
245
|
+
reads this deploy's own contract per entity — required fields, allowed values,
|
|
246
|
+
and the rules a publication checks — generated from the code that enforces
|
|
247
|
+
them, with a \`rulesVersion\`. The notes below are kept by hand in this
|
|
248
|
+
connector: guidance on order and on what "complete" means, SUBORDINATE to that
|
|
249
|
+
contract. Where they disagree, the contract is right and this text is behind.
|
|
250
|
+
On a deploy that does not serve it yet the tool says so; then the platform's
|
|
251
|
+
refusal on save or publish (and \`get_publish_release\`'s readiness) is the
|
|
252
|
+
authority, not these notes.
|
|
253
|
+
|
|
244
254
|
Build in dependency order: a thing you will REFERENCE must exist before the
|
|
245
255
|
thing that references it. So: tools and output-schemas first, then agents (which
|
|
246
256
|
list tool ids), then workflows (whose steps name agents and tools), then
|
|
@@ -251,7 +261,7 @@ made any time before you attach them.
|
|
|
251
261
|
- Required: \`name\`. Also: \`description\`, \`type\`, \`inputSchema\`,
|
|
252
262
|
\`outputSchema\`, \`implementation\`, \`authConfig\`, \`surfacing\`.
|
|
253
263
|
- \`type\`: \`"function"\` (default) | \`"connector"\` | \`"validator"\` |
|
|
254
|
-
\`"evaluator"\`. \`surfacing\`: \`"always"\` (in the agent's tool list) |
|
|
264
|
+
\`"evaluator"\` | \`"executor"\`. \`surfacing\`: \`"always"\` (in the agent's tool list) |
|
|
255
265
|
\`"on_demand"\`.
|
|
256
266
|
- \`inputSchema\` / \`outputSchema\` are JSON-Schema objects describing the tool's
|
|
257
267
|
params and result. Set them — an agent binds to a tool by its declared I/O; a
|
|
@@ -270,6 +280,23 @@ made any time before you attach them.
|
|
|
270
280
|
or ""); a human fills the secret in Axonity. Test with
|
|
271
281
|
\`execute_stored_connector\` (uses the real, server-side-decrypted secret;
|
|
272
282
|
you see only the result).
|
|
283
|
+
- **\`implementation.effect\` is required to PUBLISH**: \`"reads"\` (fetches,
|
|
284
|
+
looks something up) or \`"acts"\` (sends, writes, starts something). A
|
|
285
|
+
draft saves without it; the publish approval refuses it ("Set the
|
|
286
|
+
connector's side effects … before publishing"). Set it at create time,
|
|
287
|
+
so the human approving is not the first to find out.
|
|
288
|
+
- **An answer that is a file**: \`responseMapping: { "type": "file",
|
|
289
|
+
"filename": "{{filename}}" }\` keeps the bytes as a file of the run and
|
|
290
|
+
returns its reference \`{ fileId, filename, contentType, sizeBytes }\` —
|
|
291
|
+
the shape an upload has, so Digitize documents reads it and a
|
|
292
|
+
sub-workflow's file parameter takes it. \`filename\` is optional (the
|
|
293
|
+
far end's \`Content-Disposition\` name, else \`document\`) and may use
|
|
294
|
+
the inputs. No \`responseTransform\` with a file answer. Outside a run
|
|
295
|
+
(\`execute_stored_connector\`) nothing is stored: you see name and size.
|
|
296
|
+
- **executor** — runs a command on a registered executor (a program on
|
|
297
|
+
the customer's side). The save refuses a tool that names no executor or a
|
|
298
|
+
command that executor does not know; \`list_executors\` and
|
|
299
|
+
\`list_executor_commands\` say what exists.
|
|
273
300
|
- **validator / evaluator** — a constrained kind, and \`implementation\` takes
|
|
274
301
|
ONE OF TWO shapes. Either \`{"builtin": "validators.<name>"}\`, naming a
|
|
275
302
|
house predicate — look at the tenant's existing validator/evaluator tools
|
|
@@ -311,6 +338,15 @@ made any time before you attach them.
|
|
|
311
338
|
- \`replace_workflow_document\` — a full-document atomic PUT.
|
|
312
339
|
- The document is a graph: \`steps.all[]\` (each \`{ id, type, name, ... }\`) and
|
|
313
340
|
\`steps.edges[]\` (each \`{ id, from, to, type? }\`) plus \`triggers\`.
|
|
341
|
+
- A step's GOAL is read from a different place per step type: an \`agent\`
|
|
342
|
+
step's \`contract.goal\`, a \`manual\` or \`automation\` step's
|
|
343
|
+
\`config.goal\`. Written in the other place it is stored and read by nobody,
|
|
344
|
+
and the validator keeps reporting \`step_no_goal\`.
|
|
345
|
+
- After every \`apply_workflow_mutations\` / \`replace_workflow_document\` the
|
|
346
|
+
connector runs \`validate_workflow\` on the stored workflow and returns its
|
|
347
|
+
verdict as \`validation\`. Report those issues as they are. Green there means
|
|
348
|
+
every PLATFORM check passed — none of them asks whether the editor can draw
|
|
349
|
+
the document, so open it in the editor before you call it done.
|
|
314
350
|
- WHICH VALUES a step's \`type\` and a trigger's \`typeId\` may hold is answered
|
|
315
351
|
by \`get_workflow_authoring_spec\`, read live from this deploy. This guide
|
|
316
352
|
does not list them, on purpose: it used to name nine step types where seven
|
|
@@ -345,8 +381,9 @@ made any time before you attach them.
|
|
|
345
381
|
then wire with the \`attach_*\` tools — see Wiring.
|
|
346
382
|
- A reference doc has NO kind any more. What used to be a semantic note lives
|
|
347
383
|
in the model itself: a word is a concept (\`create_concept\`), a table card
|
|
348
|
-
is the table's description and grain, a source query is
|
|
349
|
-
\`
|
|
384
|
+
is the table's description and grain, a source query is a query of its
|
|
385
|
+
own (\`create_query\`, the table's \`fillingQueryId\`), an example question
|
|
386
|
+
is a measure's \`questions\`. The
|
|
350
387
|
platform refuses \`semanticKind\`, \`semanticDetails\`, \`subjectTableId\`
|
|
351
388
|
and \`subjectSourceId\` on a reference doc, and says where each one went.
|
|
352
389
|
Building the SEMANTIC MODEL? Read \`axonity_semantic_conventions\` first —
|
|
@@ -383,8 +420,10 @@ A validator is a GATE on a submitted output: it runs after an agent produces a
|
|
|
383
420
|
result and can refuse it. Specs are written in two places and carry the same
|
|
384
421
|
key names in both — \`permissions.outputValidators\` on an agent, and
|
|
385
422
|
\`validators\` inside an output_schema's \`schemaBody\`. The backend's OpenAPI
|
|
386
|
-
description of \`schemaBody\` is the source for the full contract
|
|
387
|
-
|
|
423
|
+
description of \`schemaBody\` is the source for the full contract, and the
|
|
424
|
+
platform's live contract (\`get_entity_authoring_contract\`, output_schema)
|
|
425
|
+
wins over this section where this deploy serves it. What follows is the part
|
|
426
|
+
you cannot author without, checked against the platform and SUBORDINATE to both.
|
|
388
427
|
|
|
389
428
|
- A spec names its check in ONE of two ways, and each brings its own binding:
|
|
390
429
|
- \`function\` — a shipped predicate (e.g. \`validators.min_length\`), bound
|
|
@@ -727,14 +766,15 @@ a document to find out what the platform did.
|
|
|
727
766
|
## Triggers
|
|
728
767
|
- A published workflow still does nothing until it has a trigger. A trigger has
|
|
729
768
|
TWO halves, and drawing one on the canvas is only the first.
|
|
730
|
-
- **A schedule
|
|
731
|
-
the firing row is brought into line
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
769
|
+
- **A schedule and a conditional start are reconciled for you.** Draw them in
|
|
770
|
+
the document, publish, and the firing row is brought into line: created,
|
|
771
|
+
updated, and removed when the element is gone. A deploy does the same and
|
|
772
|
+
brings new ones in switched off.
|
|
773
|
+
- **A webhook is NOT.** Its row must be created separately —
|
|
774
|
+
\`create_webhook_trigger\` — and publishing will not create one. A webhook
|
|
775
|
+
drawn and published with no row is an endpoint that does not exist; the
|
|
776
|
+
validator says so with \`trigger_not_wired\`, a WARNING, so the publish still
|
|
777
|
+
goes through. Take the warning seriously: nothing else will tell you.
|
|
738
778
|
- Trigger deletes are HARD deletes — no restore. Webhook tokens are shown once
|
|
739
779
|
at create/rotate and are never retrievable; hand them straight to your human
|
|
740
780
|
and never store one in an entity field.
|
|
@@ -751,26 +791,44 @@ a document to find out what the platform did.
|
|
|
751
791
|
- \`list_all_cron_schedules\` answers "what runs tonight?" across the tenant;
|
|
752
792
|
\`reconcile_cron_schedules\` answers "is that actually what runs?". The second
|
|
753
793
|
reports rather than tidying silently and never arms something switched off.
|
|
754
|
-
- **A conditional
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
\`
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
794
|
+
- **A conditional start is authored in the workflow, on the trigger element.**
|
|
795
|
+
Its \`typeId\` is \`"conditional-poll"\`, its \`id\` MUST be a UUID (the
|
|
796
|
+
platform cannot make a row for any other id), and everything it does lives
|
|
797
|
+
on its \`config\`: \`conditionText\`, \`repeatIntervalMinutes\`, and the
|
|
798
|
+
CHECK — \`checkKind\` with that kind's settings. Write it with
|
|
799
|
+
\`apply_workflow_mutations\` (\`add_trigger\`, or \`update_trigger\`, which
|
|
800
|
+
REPLACES \`config\` whole — read it, change it, send all of it). Publishing
|
|
801
|
+
copies it onto the row \`list_conditional_triggers\` shows.
|
|
802
|
+
\`create_conditional_trigger\` is not the normal path, and the platform
|
|
803
|
+
refuses a check sent to it or to \`update_conditional_trigger\`: "A
|
|
804
|
+
conditional start's check is set on the start in the workflow, and takes
|
|
805
|
+
effect when the workflow is published."
|
|
806
|
+
- **A conditional start without a CHECK starts the workflow every beat.** It
|
|
807
|
+
wakes on its interval and, with no \`checkKind\`, runs regardless of whether
|
|
808
|
+
there was anything to do — a mailbox on fifteen minutes then makes
|
|
809
|
+
ninety-six empty runs a day. Read \`checkKind\` in
|
|
810
|
+
\`list_conditional_triggers\` before assuming a start has one.
|
|
811
|
+
- \`checkKind: "automatic"\` decides with no model, before a run exists. Its
|
|
812
|
+
settings on \`config\` are \`plan\` (the steps of an automation step, each
|
|
813
|
+
with a \`toolId\`), \`outputs\` (what the plan produces — not worked out by
|
|
814
|
+
an agent) and \`startsWhen\` (rules \`{ field, op, value }\` of a decision's
|
|
815
|
+
rule table, where \`field\` names one of those outputs). A look that cannot
|
|
816
|
+
be made — a broken tool, a rule on an output nothing produces — is a fault,
|
|
817
|
+
never a start.
|
|
818
|
+
- \`checkKind: "agent"\` is for a condition that needs judgement: the beat
|
|
819
|
+
becomes a run whose first step asks the agent named by \`config.agentId\`
|
|
820
|
+
(else the workflow's owner); it stays out of the Runs list until the answer
|
|
821
|
+
is yes. Settings: \`agentId\`, \`toolIds\`, \`inputs\`, \`reasoningLevel\`.
|
|
822
|
+
- Do not pre-validate a check here. \`validate_workflow\` judges it
|
|
823
|
+
(\`conditional_check_invalid\`) with the same function the dispatcher runs
|
|
824
|
+
when the start fires, and the refusal says what to change.
|
|
825
|
+
- **Removing \`checkKind\` does NOT take a check off.** A \`config\` without it
|
|
826
|
+
is read as a start written before checks existed, and the row keeps the
|
|
827
|
+
check it has. There is no way to return a start to "every beat" today; say
|
|
828
|
+
so to your human rather than looking for a route to the row.
|
|
829
|
+
- Publishing also switches every start of the workflow back ON. An
|
|
830
|
+
\`update_conditional_trigger({ enabled: false })\` lasts until the next
|
|
831
|
+
publish of that workflow.
|
|
774
832
|
|
|
775
833
|
## Evaluating what you built
|
|
776
834
|
- There is no findings endpoint and no evaluator entity. To judge a run, read it:
|
|
@@ -970,6 +1028,15 @@ the rows; the rows come from \`read_data_table\`.
|
|
|
970
1028
|
the box, call \`list_toolbox_dependent_tools\` — it names the tools that would
|
|
971
1029
|
start failing at run time with a bare 401.
|
|
972
1030
|
|
|
1031
|
+
## Who may read what
|
|
1032
|
+
Every policy, skill, reference doc and table carries a label: \`level\`
|
|
1033
|
+
(public, internal, confidential) and \`audienceIds\`, whom it is meant for. An
|
|
1034
|
+
agent and a workflow carry a \`clearance\`; so does your token, and you read
|
|
1035
|
+
with it. Look audience ids up with \`list_audiences\` — never guess one, and
|
|
1036
|
+
compare on id, never on name. \`level: null\` makes a thing readable by nobody.
|
|
1037
|
+
Narrowing a label is always allowed; widening it is a colleague's act, never
|
|
1038
|
+
yours.
|
|
1039
|
+
|
|
973
1040
|
## Tenant
|
|
974
1041
|
- Your token fixes the tenant. You cannot act across tenants; never send a
|
|
975
1042
|
tenant id in a body.
|
|
@@ -1013,7 +1080,7 @@ const SEMANTIC_KNOWLEDGE_UNAVAILABLE = "## Semantic knowledge — NOT AVAILABLE\
|
|
|
1013
1080
|
"The rules for writing the semantic layer could not be read from this deploy " +
|
|
1014
1081
|
`(\`GET ${SEMANTIC_KNOWLEDGE_ROUTE}\`). This connector does not carry a copy ` +
|
|
1015
1082
|
"of them. Do not build the semantic model — no concept, no measure, no " +
|
|
1016
|
-
"
|
|
1083
|
+
"query — until they can be read: call " +
|
|
1017
1084
|
"`axonity_semantic_conventions` again, and if it still fails, report it " +
|
|
1018
1085
|
"rather than deciding what the knowledge should say yourself.";
|
|
1019
1086
|
/**
|
|
@@ -1077,9 +1144,9 @@ is the window ending at the end of the period asked for; a running total per
|
|
|
1077
1144
|
month is the standing at the end of each month, never their sum. A fact kept
|
|
1078
1145
|
per month is not asked per week (\`grain_too_fine\`).
|
|
1079
1146
|
|
|
1080
|
-
**Row logic belongs in the
|
|
1081
|
-
per row (net = gross − discount) is a column, added to
|
|
1082
|
-
\`
|
|
1147
|
+
**Row logic belongs in the query that fills the table, not in a measure.** A
|
|
1148
|
+
value per row (net = gross − discount) is a column, added to that query's
|
|
1149
|
+
\`sql\` and described like any other column. A measure is computed
|
|
1083
1150
|
per question — period, grain, split, filters — and is never stored.
|
|
1084
1151
|
|
|
1085
1152
|
**How a number is computed.** Each leaf is aggregated on its own table, over
|
|
@@ -1129,7 +1196,7 @@ export function registerConventions(server, client) {
|
|
|
1129
1196
|
],
|
|
1130
1197
|
}));
|
|
1131
1198
|
server.tool("axonity_semantic_conventions", "Read BEFORE building a workspace's semantic model: the tables with " +
|
|
1132
|
-
"
|
|
1199
|
+
"the queries that fill them and their grain, the measures, and the concepts that say " +
|
|
1133
1200
|
"what a word or a number means. Returns this deploy's rules for writing " +
|
|
1134
1201
|
"it: what a concept owes, what a measure's description and questions " +
|
|
1135
1202
|
"must say, and what a table's grain must say about one row. Read live " +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/tools/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAMH,MAAM,CAAC,MAAM,WAAW,GAAG
|
|
1
|
+
{"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/tools/conventions.ts"],"names":[],"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AAI,EAAE,CAAC,CAAC;QACX,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC,MAAM,CAAC,EAAE,CAAC;KACrF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
* shows, and duplicating a dashboard.
|
|
11
11
|
*
|
|
12
12
|
* **There are no sync tools any more.** A sync was a separate object beside
|
|
13
|
-
* the table it filled
|
|
14
|
-
* `provenance
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
17
|
-
*
|
|
13
|
+
* the table it filled. The semantic model first made it the table's own
|
|
14
|
+
* `provenance`; axonity-flow#2013 then moved the source, SQL and grain into a
|
|
15
|
+
* named query (tools/queries.ts), leaving the table its `filledBy`,
|
|
16
|
+
* `fillingQueryId` and `rhythm`. Running a fill early is `refresh_data_table`
|
|
17
|
+
* (tools/dataTables.ts). A measure is no longer
|
|
18
18
|
* a field on a table either: it is its own versioned entity (`create_measure`
|
|
19
19
|
* and the rest of the generic family).
|
|
20
20
|
*
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
* shows, and duplicating a dashboard.
|
|
11
11
|
*
|
|
12
12
|
* **There are no sync tools any more.** A sync was a separate object beside
|
|
13
|
-
* the table it filled
|
|
14
|
-
* `provenance
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
17
|
-
*
|
|
13
|
+
* the table it filled. The semantic model first made it the table's own
|
|
14
|
+
* `provenance`; axonity-flow#2013 then moved the source, SQL and grain into a
|
|
15
|
+
* named query (tools/queries.ts), leaving the table its `filledBy`,
|
|
16
|
+
* `fillingQueryId` and `rhythm`. Running a fill early is `refresh_data_table`
|
|
17
|
+
* (tools/dataTables.ts). A measure is no longer
|
|
18
18
|
* a field on a table either: it is its own versioned entity (`create_measure`
|
|
19
19
|
* and the rest of the generic family).
|
|
20
20
|
*
|
|
@@ -57,14 +57,15 @@ export function registerDataSourceTools(server, client) {
|
|
|
57
57
|
"query. `containerWord` is what this warehouse calls the container " +
|
|
58
58
|
"(\"dataset\" on BigQuery, \"schema\" on PostgreSQL). Column types are " +
|
|
59
59
|
"the warehouse's own names, passed through. Read this before writing a " +
|
|
60
|
-
"query
|
|
60
|
+
"query, rather than guessing table names. " +
|
|
61
61
|
"On a source restricted to `policy.allowedDatasets` it reads those " +
|
|
62
62
|
"datasets one by one, so it answers even when the key may not list " +
|
|
63
63
|
"the whole project.", { id: SOURCE_ID }, async ({ id }) => guard(async () => jsonResult(await client.get(`${SOURCES}/${id}/schema`))));
|
|
64
64
|
server.tool("query_data_source", "Run a READ-ONLY SQL query against the warehouse and get the rows back. " +
|
|
65
65
|
"For looking — checking what a warehouse table holds, trying the " +
|
|
66
|
-
"
|
|
67
|
-
"it a
|
|
66
|
+
"statement before it becomes a query. To fill a table regularly, make " +
|
|
67
|
+
"it a query (create_query, try it with test_query) and point the table " +
|
|
68
|
+
"at it: `filledBy: \"query\"`, `fillingQueryId`, `rhythm`. " +
|
|
68
69
|
"\n\nTHE ROWS ARE CAPPED. `truncated: true` means rows were left out: " +
|
|
69
70
|
"`rowCount` is what came back, `totalRows` is what matched. Never report " +
|
|
70
71
|
"a count or a total off a truncated answer — aggregate in the SQL " +
|
|
@@ -86,7 +87,7 @@ export function registerDataSourceTools(server, client) {
|
|
|
86
87
|
.int()
|
|
87
88
|
.optional()
|
|
88
89
|
.describe("How many rows you want back. Clamped by the platform — a bigger " +
|
|
89
|
-
"answer belongs in a table
|
|
90
|
+
"answer belongs in a table filled by a query, not in a response."),
|
|
90
91
|
}, async ({ id, sql, maxRows }) => guard(async () => jsonResult(await client.post(`${SOURCES}/${id}/query`, {
|
|
91
92
|
sql,
|
|
92
93
|
...(maxRows !== undefined ? { maxRows } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSources.js","sourceRoot":"","sources":["../../src/tools/dataSources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ANGED
|
@@ -159,17 +159,19 @@ export function registerDataTableTools(server, client) {
|
|
|
159
159
|
// The page envelope is forwarded WHOLE — unwrapping to `items` would
|
|
160
160
|
// rebuild the silent truncation this tool exists to avoid.
|
|
161
161
|
jsonResult(await client.get(`${BASE}/${tableId}/rows`, { q, limit, cursor }))));
|
|
162
|
-
server.tool("refresh_data_table", "Fill a table from its
|
|
163
|
-
"
|
|
164
|
-
"
|
|
162
|
+
server.tool("refresh_data_table", "Fill a table from its query NOW instead of at its next scheduled time " +
|
|
163
|
+
"— or at all, for a table with no `rhythm`, which fills only when " +
|
|
164
|
+
"asked. Replaces run_data_source_sync: what fills a table is the query " +
|
|
165
|
+
"its `fillingQueryId` names, not a separate sync. " +
|
|
165
166
|
"\n\nTHIS DOES NOT WAIT FOR THE RESULT. The query can take tens of " +
|
|
166
167
|
"seconds, so the platform brings the table's next fill forward and its " +
|
|
167
168
|
"scheduler runs it. The response is the table, with `fill.nextAt` set " +
|
|
168
169
|
"to now. To see how it went, read_data_table again after a moment: " +
|
|
169
170
|
"`fill.lastAt`, `fill.lastRowCount` and `fill.lastError` describe the " +
|
|
170
171
|
"run. " +
|
|
171
|
-
"\n\nRefused with a 422 when the table
|
|
172
|
-
"
|
|
172
|
+
"\n\nRefused with a 422 when the table is not filled by a query " +
|
|
173
|
+
"(`filledBy` is `author` or `workflow`) — its rows come from a workflow " +
|
|
174
|
+
"or an author, and there is nothing to run.", { id: z.string().describe("The table's id.") }, async ({ id }) => guard(async () => jsonResult(await client.post(`${BASE}/${id}/refresh`))));
|
|
173
175
|
server.tool("list_data_table_tools", "Which tools this table yields, and which of them a RUN can actually " +
|
|
174
176
|
"reach. Read-only. " +
|
|
175
177
|
"\n\nA published table mints its own CRUD tools, so giving an agent " +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataTables.js","sourceRoot":"","sources":["../../src/tools/dataTables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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E,yEAAyE;QACzE,4CAA4C,EAC9C,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,EAC9C,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CACf,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAC5E,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,sEAAsE;QACpE,oBAAoB;QACpB,qEAAqE;QACrE,yEAAyE;QACzE,oEAAoE;QACpE,qEAAqE;QACrE,0EAA0E;QAC1E,2DAA2D;QAC3D,mEAAmE;QACnE,sEAAsE;QACtE,wEAAwE;QACxE,wEAAwE;QACxE,4DAA4D;QAC5D,mEAAmE;QACnE,qCAAqC,EACvC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,EAC9C,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CACf,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CACzE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform's create contract per entity kind, read live (axonity-mcp#95,
|
|
3
|
+
* axonity-flow#2103, merged as axonity-flow#2104).
|
|
4
|
+
*
|
|
5
|
+
* The rules for creating a tool, a connector, an agent, a table — required
|
|
6
|
+
* fields, allowed values, what a publication checks — were kept as prose in
|
|
7
|
+
* this connector (`conventions.ts`, the tool descriptions). A rule added on the
|
|
8
|
+
* platform then stayed missing here: since axonity-flow#1997 a connector must
|
|
9
|
+
* declare `implementation.effect` before it can be published, and nothing in
|
|
10
|
+
* this connector said so. An agent built a connector by the guide and the
|
|
11
|
+
* human's approval refused it.
|
|
12
|
+
*
|
|
13
|
+
* For workflows that problem is already solved: `get_workflow_authoring_spec`
|
|
14
|
+
* reads `GET /workflows/operations`, generated from the registry that enforces
|
|
15
|
+
* it. This is the same move for every other kind:
|
|
16
|
+
*
|
|
17
|
+
* GET /api/v1/authoring/entity-contracts?kinds=tool,agent
|
|
18
|
+
* → { kinds: string[], contracts: { <kind>: {...} }, rulesVersion: string }
|
|
19
|
+
*
|
|
20
|
+
* `kinds` is ONE comma-separated query parameter, filtered by the platform; an
|
|
21
|
+
* unknown kind is the platform's 422, which names the known ones — passed on as
|
|
22
|
+
* the error it is, not re-judged here. `rulesVersion` covers the whole
|
|
23
|
+
* catalogue whatever `kinds` was. Authenticated like every route; a read-only
|
|
24
|
+
* service token is enough. The answer is passed through unchanged.
|
|
25
|
+
*
|
|
26
|
+
* FEATURE-DETECTED, NEVER SUBSTITUTED. A backend older than the route answers
|
|
27
|
+
* 404 (or 405). Then the tool says so in words — it does not fall back to the
|
|
28
|
+
* hand-kept notes in `axonity_conventions`, because those notes are exactly
|
|
29
|
+
* what drifted. Any other failure is reported as the error it is.
|
|
30
|
+
*/
|
|
31
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
32
|
+
import type { AxonityClient } from "../client.js";
|
|
33
|
+
/** Where this deploy serves its per-kind create contracts (axonity-flow#2103). */
|
|
34
|
+
export declare const ENTITY_CONTRACT_ROUTE = "/api/v1/authoring/entity-contracts";
|
|
35
|
+
/** Said when the deploy does not serve the route. Not a fallback. */
|
|
36
|
+
export declare const ENTITY_CONTRACT_UNAVAILABLE: string;
|
|
37
|
+
/** What the tool answers: the live contract, the not-served notice, or the error. */
|
|
38
|
+
export declare function readEntityContract(client: AxonityClient, kinds?: string[]): Promise<{
|
|
39
|
+
content: {
|
|
40
|
+
type: "text";
|
|
41
|
+
text: string;
|
|
42
|
+
}[];
|
|
43
|
+
}>;
|
|
44
|
+
export declare function registerEntityContractTools(server: McpServer, client: AxonityClient): void;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform's create contract per entity kind, read live (axonity-mcp#95,
|
|
3
|
+
* axonity-flow#2103, merged as axonity-flow#2104).
|
|
4
|
+
*
|
|
5
|
+
* The rules for creating a tool, a connector, an agent, a table — required
|
|
6
|
+
* fields, allowed values, what a publication checks — were kept as prose in
|
|
7
|
+
* this connector (`conventions.ts`, the tool descriptions). A rule added on the
|
|
8
|
+
* platform then stayed missing here: since axonity-flow#1997 a connector must
|
|
9
|
+
* declare `implementation.effect` before it can be published, and nothing in
|
|
10
|
+
* this connector said so. An agent built a connector by the guide and the
|
|
11
|
+
* human's approval refused it.
|
|
12
|
+
*
|
|
13
|
+
* For workflows that problem is already solved: `get_workflow_authoring_spec`
|
|
14
|
+
* reads `GET /workflows/operations`, generated from the registry that enforces
|
|
15
|
+
* it. This is the same move for every other kind:
|
|
16
|
+
*
|
|
17
|
+
* GET /api/v1/authoring/entity-contracts?kinds=tool,agent
|
|
18
|
+
* → { kinds: string[], contracts: { <kind>: {...} }, rulesVersion: string }
|
|
19
|
+
*
|
|
20
|
+
* `kinds` is ONE comma-separated query parameter, filtered by the platform; an
|
|
21
|
+
* unknown kind is the platform's 422, which names the known ones — passed on as
|
|
22
|
+
* the error it is, not re-judged here. `rulesVersion` covers the whole
|
|
23
|
+
* catalogue whatever `kinds` was. Authenticated like every route; a read-only
|
|
24
|
+
* service token is enough. The answer is passed through unchanged.
|
|
25
|
+
*
|
|
26
|
+
* FEATURE-DETECTED, NEVER SUBSTITUTED. A backend older than the route answers
|
|
27
|
+
* 404 (or 405). Then the tool says so in words — it does not fall back to the
|
|
28
|
+
* hand-kept notes in `axonity_conventions`, because those notes are exactly
|
|
29
|
+
* what drifted. Any other failure is reported as the error it is.
|
|
30
|
+
*/
|
|
31
|
+
import { z } from "zod";
|
|
32
|
+
import { AxonityApiError } from "../errors.js";
|
|
33
|
+
import { errorResult, jsonResult } from "./result.js";
|
|
34
|
+
/** Where this deploy serves its per-kind create contracts (axonity-flow#2103). */
|
|
35
|
+
export const ENTITY_CONTRACT_ROUTE = "/api/v1/authoring/entity-contracts";
|
|
36
|
+
/** Said when the deploy does not serve the route. Not a fallback. */
|
|
37
|
+
export const ENTITY_CONTRACT_UNAVAILABLE = "## Entity create contracts — NOT AVAILABLE on this deploy\n\n" +
|
|
38
|
+
`This backend does not serve \`GET ${ENTITY_CONTRACT_ROUTE}\` ` +
|
|
39
|
+
"(axonity-flow#2103): it is older than the live contract. This connector " +
|
|
40
|
+
"carries no copy of it. The per-entity notes in `axonity_conventions` are " +
|
|
41
|
+
"kept by hand and may be behind the platform — they are guidance, not the " +
|
|
42
|
+
"contract. Until this deploy serves it, the authority is the platform's own " +
|
|
43
|
+
"answer: the refusal on save, `validate_workflow`, and the readiness of " +
|
|
44
|
+
"`request_publish_*` / `get_publish_release`. Tell your human which " +
|
|
45
|
+
"environment this token points at if you need the contract.";
|
|
46
|
+
/** What the tool answers: the live contract, the not-served notice, or the error. */
|
|
47
|
+
export async function readEntityContract(client, kinds) {
|
|
48
|
+
const wanted = (kinds ?? []).map((k) => k.trim()).filter((k) => k !== "");
|
|
49
|
+
try {
|
|
50
|
+
return jsonResult(wanted.length === 0
|
|
51
|
+
? await client.get(ENTITY_CONTRACT_ROUTE)
|
|
52
|
+
: await client.get(ENTITY_CONTRACT_ROUTE, { kinds: wanted.join(",") }));
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
if (err instanceof AxonityApiError && (err.status === 404 || err.status === 405)) {
|
|
56
|
+
return {
|
|
57
|
+
content: [{ type: "text", text: ENTITY_CONTRACT_UNAVAILABLE }],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return errorResult(err);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function registerEntityContractTools(server, client) {
|
|
64
|
+
server.tool("get_entity_authoring_contract", "Read this deploy's CREATE CONTRACT per entity kind from the platform " +
|
|
65
|
+
"itself — tools (each type's `implementation`, connectors included), " +
|
|
66
|
+
"agents, personas, knowledge, schemas, tables, toolboxes, secrets and " +
|
|
67
|
+
"starts. Answers `{ kinds, contracts, rulesVersion }`: per kind the " +
|
|
68
|
+
"`create` and `update` fields (name, required, type, allowed values, " +
|
|
69
|
+
"shape, and `refused` with where the value is authored instead), and " +
|
|
70
|
+
"`publish.rules` — what stops it from going live, each with a `code` " +
|
|
71
|
+
"and the platform's own message (e.g. a connector without " +
|
|
72
|
+
"`implementation.effect`). Generated from the schemas and checks that " +
|
|
73
|
+
"enforce it. `rulesVersion` covers the whole catalogue: while it is " +
|
|
74
|
+
"unchanged there is nothing to re-read. " +
|
|
75
|
+
"\n\nREAD IT BEFORE YOU CREATE an entity whose rules you have not checked " +
|
|
76
|
+
"this session. Where it disagrees with `axonity_conventions` or a tool " +
|
|
77
|
+
"description, it is right and they are behind. The workflow document's " +
|
|
78
|
+
"own vocabulary is in `get_workflow_authoring_spec`. " +
|
|
79
|
+
"\n\nThe whole catalogue is large; pass `kinds` for the ones you need. " +
|
|
80
|
+
"`kinds` in the answer lists every kind this deploy serves. On a backend " +
|
|
81
|
+
"that does not serve the route yet, the tool SAYS SO instead of " +
|
|
82
|
+
"returning a copy.", {
|
|
83
|
+
kinds: z
|
|
84
|
+
.array(z.string())
|
|
85
|
+
.optional()
|
|
86
|
+
.describe('Kinds to return, e.g. ["tool", "agent"]. Omit for every kind. An ' +
|
|
87
|
+
"unknown kind is refused by the platform with the list of known ones."),
|
|
88
|
+
}, async ({ kinds }) => readEntityContract(client, kinds));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=entityContract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityContract.js","sourceRoot":"","sources":["../../src/tools/entityContract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAAE,CAAC,EAAE,M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C;aACxE,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,MAAqB;IAClF,MAAM,CAAC,IAAI,CACT,+BAA+B,EAC/B,uEAAuE;QACrE,sEAAsE;QACtE,uEAAuE;QACvE,qEAAqE;QACrE,sEAAsE;QACtE,sEAAsE;QACtE,sEAAsE;QACtE,2DAA2D;QAC3D,uEAAuE;QACvE,qEAAqE;QACrE,yCAAyC;QACzC,2EAA2E;QAC3E,wEAAwE;QACxE,wEAAwE;QACxE,sDAAsD;QACtD,wEAAwE;QACxE,0EAA0E;QAC1E,iEAAiE;QACjE,mBAAmB,EACrB;QACE,KAAK,EAAE,CAAC;aACL,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CACP,mEAAmE;YACjE,sEAAsE,CACzE;KACJ,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CACvD,CAAC;AACJ,CAAC"}
|
package/dist/tools/extras.js
CHANGED
|
@@ -42,10 +42,47 @@ const CONNECTOR_SHAPE = "\n\nSHAPE OF `implementation` — `headers` and `queryP
|
|
|
42
42
|
'string>" }`. Use `{{name}}` in a value to fill it from the tool\'s input. ' +
|
|
43
43
|
"Any other shape cannot run: the connector saves and then fails when " +
|
|
44
44
|
"called, with an error that does not point here.";
|
|
45
|
+
/**
|
|
46
|
+
* Two rules the platform enforces on a connector that the shape above does not
|
|
47
|
+
* say (axonity-mcp#95).
|
|
48
|
+
*
|
|
49
|
+
* `implementation.effect` (axonity-flow#1997): a draft saves without it, and
|
|
50
|
+
* the publish approval then refuses it ("Cannot publish connector: Set the
|
|
51
|
+
* connector's side effects …", `version_service.publish_tool`). An agent that
|
|
52
|
+
* builds a connector from this description used to make one that failed at the
|
|
53
|
+
* human's approval, not at its own save.
|
|
54
|
+
*
|
|
55
|
+
* `responseMapping.type: "file"` (axonity-flow#2079): the answer is kept as a
|
|
56
|
+
* file of the run, not parsed. Without this sentence the only mappings an agent
|
|
57
|
+
* knew were the parsing ones.
|
|
58
|
+
*
|
|
59
|
+
* Kept short on purpose: the platform's live contract
|
|
60
|
+
* (`get_entity_authoring_contract`, axonity-flow#2103) is the authority, and
|
|
61
|
+
* this is guidance until every deploy serves it.
|
|
62
|
+
*/
|
|
63
|
+
const CONNECTOR_EFFECT_AND_FILE = "\n\nDECLARE WHAT IT DOES — `implementation.effect`: `\"reads\"` (fetches, " +
|
|
64
|
+
"looks something up) or `\"acts\"` (sends, writes, starts something). A " +
|
|
65
|
+
"draft saves without it, but a connector WITHOUT `effect` CANNOT BE " +
|
|
66
|
+
"PUBLISHED: the approval is refused with \"Set the connector's side " +
|
|
67
|
+
"effects … before publishing\". Set it when you create the connector." +
|
|
68
|
+
"\n\nAN ANSWER THAT IS A FILE — `implementation.responseMapping: " +
|
|
69
|
+
'{ "type": "file", "filename": "{{filename}}" }`. The bytes are kept as a ' +
|
|
70
|
+
"file of the run and the connector returns its reference, `{ fileId, " +
|
|
71
|
+
"filename, contentType, sizeBytes }` — the shape an upload has, so Digitize " +
|
|
72
|
+
"documents reads it and a sub-workflow's file parameter takes it. " +
|
|
73
|
+
"`filename` is optional and may use the inputs (`{{name}}`); without it the " +
|
|
74
|
+
"far end's `Content-Disposition` name is used, else `document`. A file " +
|
|
75
|
+
"answer takes no `responseTransform`. Outside a run (e.g. " +
|
|
76
|
+
"`execute_stored_connector`) nothing is stored and you see only the name " +
|
|
77
|
+
"and size. The other mappings (`jmespath` with an `expression`, or `full`) " +
|
|
78
|
+
"parse the answer as data." +
|
|
79
|
+
"\n\nThe platform's own create contract, when this deploy serves it, is " +
|
|
80
|
+
"`get_entity_authoring_contract` — it wins over this description.";
|
|
45
81
|
export function registerConnectorTools(server, client) {
|
|
46
82
|
server.tool("create_connector", "Create a connector draft (a tool of type 'connector'). Do NOT put real " +
|
|
47
83
|
"credentials in authConfig — use placeholders; a human fills secrets in Axonity." +
|
|
48
|
-
CONNECTOR_SHAPE
|
|
84
|
+
CONNECTOR_SHAPE +
|
|
85
|
+
CONNECTOR_EFFECT_AND_FILE, {
|
|
49
86
|
fields: z
|
|
50
87
|
.record(z.unknown())
|
|
51
88
|
.describe("Connector fields (name, description, implementation, authConfig)."),
|
|
@@ -55,7 +92,8 @@ export function registerConnectorTools(server, client) {
|
|
|
55
92
|
}));
|
|
56
93
|
server.tool("update_connector", "Update a connector draft (a tool of type 'connector'). Read it first for its " +
|
|
57
94
|
"version; keep authConfig as placeholders only." +
|
|
58
|
-
CONNECTOR_SHAPE
|
|
95
|
+
CONNECTOR_SHAPE +
|
|
96
|
+
CONNECTOR_EFFECT_AND_FILE, {
|
|
59
97
|
id: z.string().describe("The connector (tool) id."),
|
|
60
98
|
expectedVersion: z.number().int().describe("Version last read — 409 if stale."),
|
|
61
99
|
fields: z.record(z.unknown()).describe("Fields to change (camelCase)."),
|