@axonity-ai/mcp 0.15.0 → 0.17.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 +44 -24
- package/dist/contract.js +2 -0
- package/dist/contract.js.map +1 -1
- package/dist/generated/listFilters.js +8 -0
- package/dist/generated/listFilters.js.map +1 -1
- package/dist/index.js +97 -17
- package/dist/index.js.map +1 -1
- package/dist/tools/concepts.d.ts +27 -0
- package/dist/tools/concepts.js +122 -0
- package/dist/tools/concepts.js.map +1 -0
- package/dist/tools/conventions.d.ts +9 -1
- package/dist/tools/conventions.js +68 -14
- package/dist/tools/conventions.js.map +1 -1
- package/dist/tools/dataSources.d.ts +19 -13
- package/dist/tools/dataSources.js +58 -106
- package/dist/tools/dataSources.js.map +1 -1
- package/dist/tools/dataTables.js +11 -0
- package/dist/tools/dataTables.js.map +1 -1
- package/dist/tools/measureFormula.d.ts +46 -0
- package/dist/tools/measureFormula.js +239 -0
- package/dist/tools/measureFormula.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,8 +55,8 @@ was kept here. A conformance test asserts their absence.
|
|
|
55
55
|
|
|
56
56
|
### The generic entity family
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
persona, output_schema, prompt_snippet, flow, data_table** — share one shape,
|
|
58
|
+
Twelve entities — **workflow, agent, tool, skill, policy, reference_doc,
|
|
59
|
+
persona, output_schema, prompt_snippet, flow, data_table, measure** — share one shape,
|
|
60
60
|
though not every entity gets every verb (see the per-entity notes below for the
|
|
61
61
|
exceptions):
|
|
62
62
|
|
|
@@ -255,17 +255,13 @@ across these routes — the tool parameter names say which.
|
|
|
255
255
|
would yield), `toolId` (whether a row exists) and `isLive` (whether a run
|
|
256
256
|
can reach it) separately — an author who ticked "may add rows" and has not
|
|
257
257
|
published has granted nothing yet.
|
|
258
|
-
- **
|
|
259
|
-
`
|
|
260
|
-
|
|
261
|
-
measures over those tables
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
"Only administrators can perform this action" to a token today. The tools
|
|
266
|
-
say so in their descriptions, and the error says *administrator only*
|
|
267
|
-
rather than the usual "your token is read-only" — the opposite advice.
|
|
268
|
-
Reads, dashboards and measures are open to a member.
|
|
258
|
+
- **The semantic model** (`data_source`, `data_table` with provenance,
|
|
259
|
+
`table_relationship`, `measure`, concepts, `dashboard`): a workspace
|
|
260
|
+
connects a warehouse such as BigQuery, dynamic tables are filled from it on
|
|
261
|
+
a schedule, measures define the numbers over those tables, concepts say
|
|
262
|
+
what each word and number means, and dashboards show the measures. Read
|
|
263
|
+
`axonity_semantic_conventions` before building one — the platform serves
|
|
264
|
+
those rules.
|
|
269
265
|
- `list_data_source_drivers` first: each warehouse's `configFields` are the
|
|
270
266
|
keys `create_data_source` takes in `config`, so nothing about BigQuery is
|
|
271
267
|
hard-coded here and a new warehouse works without a connector release.
|
|
@@ -273,17 +269,41 @@ across these routes — the tool parameter names say which.
|
|
|
273
269
|
at it by `secretId`.
|
|
274
270
|
- `test_data_source` answers `{ ok, message }` — a failure is an answer, not
|
|
275
271
|
an error. `read_data_source_schema` reads the warehouse's catalogue for
|
|
276
|
-
free
|
|
277
|
-
|
|
278
|
-
refused, a 502 is the
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
`
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
272
|
+
free, dataset by dataset on a source limited to `allowedDatasets`.
|
|
273
|
+
`query_data_source` runs read-only SQL with capped rows (`truncated` says
|
|
274
|
+
when rows were left out); a 422 is the query being refused, a 502 is the
|
|
275
|
+
warehouse.
|
|
276
|
+
- **There is no sync object.** A dynamic table carries its own
|
|
277
|
+
`provenance` — `{ sourceId, sql, grain, keyColumns, mode, cron, timezone,
|
|
278
|
+
enabled }` — on `create_data_table` / `update_data_table`, so a changed
|
|
279
|
+
query is published like a changed column. `refresh_data_table` fills it
|
|
280
|
+
now instead of at its next turn (it does not wait for the result; read
|
|
281
|
+
the table's `fill` afterwards).
|
|
282
|
+
- **A measure is its own versioned entity**: the generic family plus the
|
|
283
|
+
version tools, `request_publish_measure`, and `list_measure_live_versions`.
|
|
284
|
+
It names the concept it means in `concept`, and the questions it answers
|
|
285
|
+
in `questions`. `read_measure_design` now returns a table's columns and
|
|
286
|
+
time axis only; `list_measures({ tableId })` says which measures read it.
|
|
287
|
+
- **A measure is one formula**, `definition.expression`:
|
|
288
|
+
`sum(orders.amount)`, `[revenue_d2c] + [revenue_retail]`,
|
|
289
|
+
`divide([cm1], [net_revenue])`. `get_measure_formula_spec` is the only
|
|
290
|
+
list of its words — the platform's own, the one its editor shows — and
|
|
291
|
+
with `includeWorkspace: true` also this workspace's measures, tables and
|
|
292
|
+
columns. `validate_measure` checks a formula without saving it and answers
|
|
293
|
+
with every problem by code. `read_measure` returns the formula as text
|
|
294
|
+
beside the stored tree and the aggregations it folds down to. The fields
|
|
295
|
+
from before the formula (`tableId`, `clearTable`, `aggregation`,
|
|
296
|
+
`column`, `numerator`, `denominator`) are refused with `legacy_field`.
|
|
297
|
+
- **Concepts**: `list_concepts`, `create_concept`, `update_concept`,
|
|
298
|
+
`delete_concept` — kind (concept, state, metric, rule), name, meaning,
|
|
299
|
+
synonyms, what it refers to, owner. They are rows of one table the
|
|
300
|
+
platform keeps per workspace, so they are published with
|
|
301
|
+
`request_publish_data_table` on the `tableId` every write returns.
|
|
302
|
+
- Reading numbers: `query_measures` (up to 40 questions, each answered on
|
|
303
|
+
its own, measures named by their handle), `list_measure_rows` (a list
|
|
304
|
+
tile). Plus `duplicate_dashboard`.
|
|
305
|
+
- A reference doc has no `semanticKind` any more; the platform refuses it
|
|
306
|
+
and the other retired fields and says where each one went.
|
|
287
307
|
- `list_deleted_prompt_snippets` calls `/api/v1/prompt-snippets/deleted`; the
|
|
288
308
|
backend returns it as `{ items: [... ] }`, and the tool forwards that response
|
|
289
309
|
unchanged.
|
package/dist/contract.js
CHANGED
|
@@ -90,6 +90,8 @@ export const PROBE_VARIANTS = [
|
|
|
90
90
|
// validate_workflow — exactly one of the two, never both.
|
|
91
91
|
{ document: undefined },
|
|
92
92
|
{ workflowId: undefined },
|
|
93
|
+
// get_measure_formula_spec — the workspace's vocabulary only when asked.
|
|
94
|
+
{ includeWorkspace: true },
|
|
93
95
|
];
|
|
94
96
|
/**
|
|
95
97
|
* Every route this build's tools call, found by replaying them.
|
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAoB/D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAA4B;IACjD,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG;IAChF,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IACzE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;IAC1E,YAAY,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG;IAC/D,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,EAAE,qBAAqB,EA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,CAAC,CAAC,CAAC,SAAS,CAAC;IAE9E,GAAG,CACD,uCAAuC,OAAO,CAAC,MAAM,iBAAiB;QACpE,oBAAoB;QACpB,cAAc,KAAK,KAAK,WAAW,QAAQ,OAAO,CAAC,MAAM,IAAI;QAC7D,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5D,0EAA0E;QAC1E,kEAAkE;QAClE,8DAA8D,CACjE,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -110,5 +110,13 @@ export const LIST_FILTERS = {
|
|
|
110
110
|
description: "Only relationships that touch this table, on either side. The way to answer \"what does this table join to\" without walking every page.",
|
|
111
111
|
},
|
|
112
112
|
],
|
|
113
|
+
"measure": [
|
|
114
|
+
{
|
|
115
|
+
arg: "tableId",
|
|
116
|
+
query: "tableId",
|
|
117
|
+
type: "string",
|
|
118
|
+
description: "Only the measures that read this table — what a table page shows.",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
113
121
|
};
|
|
114
122
|
//# sourceMappingURL=listFilters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listFilters.js","sourceRoot":"","sources":["../../src/generated/listFilters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,CAAC,MAAM,YAAY,GAAiC;IACxD,UAAU,EAAE;QACV;YACE,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,sGAAsG;SACzG;QACD;YACE,GAAG,EAAE,cAAc;YACnB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kFAAkF;SACrF;KACF;IACD,OAAO,EAAE;QACP;YACE,GAAG,EAAE,eAAe;YACpB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,S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I;SAC7I;KACF;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"listFilters.js","sourceRoot":"","sources":["../../src/generated/listFilters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,CAAC,MAAM,YAAY,GAAiC;IACxD,UAAU,EAAE;QACV;YACE,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,sGAAsG;SACzG;QACD;YACE,GAAG,EAAE,cAAc;YACnB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kFAAkF;SACrF;KACF;IACD,OAAO,EAAE;QACP;YACE,GAAG,EAAE,eAAe;YACpB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,SAAS;YACf,WAAW,EACT,uNAAuN;SAC1N;KACF;IACD,QAAQ,EAAE;QACR;YACE,GAAG,EAAE,OAAO;YACZ,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,0PAA0P;SAC7P;QACD;YACE,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,uGAAuG;SAC1G;KACF;IACD,eAAe,EAAE;QACf;YACE,GAAG,EAAE,OAAO;YACZ,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,0PAA0P;SAC7P;QACD;YACE,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,uGAAuG;SAC1G;KACF;IACD,gBAAgB,EAAE;QAChB;YACE,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,SAAS;YACf,WAAW,EACT,oKAAoK;SACvK;KACF;IACD,YAAY,EAAE;QACZ;YACE,GAAG,EAAE,MAAM;YACX,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,gOAAgO;SACnO;QACD;YACE,GAAG,EAAE,QAAQ;YACb,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,2JAA2J;SAC9J;QACD;YACE,GAAG,EAAE,WAAW;YAChB,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,SAAS;YACf,WAAW,EACT,0GAA0G;SAC7G;KACF;IACD,aAAa,EAAE;QACb;YACE,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,SAAS;YACf,WAAW,EACT,4FAA4F;SAC/F;KACF;IACD,oBAAoB,EAAE;QACpB;YACE,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,0IAA0I;SAC7I;KACF;IACD,SAAS,EAAE;QACT;YACE,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,mEAAmE;SACtE;KACF;CACF,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -23,13 +23,15 @@ import { AxonityClient } from "./client.js";
|
|
|
23
23
|
import { loadConfig } from "./config.js";
|
|
24
24
|
import { reportContractSkew } from "./contract.js";
|
|
25
25
|
import { registerConventions } from "./tools/conventions.js";
|
|
26
|
-
import {
|
|
26
|
+
import { registerDashboardTools, registerDataSourceTools, registerMeasureTools, } from "./tools/dataSources.js";
|
|
27
27
|
import { registerDataTableTools } from "./tools/dataTables.js";
|
|
28
|
+
import { assertFormulaShape, registerMeasureFormulaTools } from "./tools/measureFormula.js";
|
|
28
29
|
import { assertPlaceholderCredentials } from "./tools/credentials.js";
|
|
29
30
|
import { registerAttachTools, registerCatalogTools, registerConnectorTools, registerDependencyTools, registerPersonaTools, } from "./tools/extras.js";
|
|
30
31
|
import { registerAuthoringSpecTools } from "./tools/authoringSpec.js";
|
|
31
32
|
import { registerCompanyTools } from "./tools/company.js";
|
|
32
33
|
import { registerComponentTools } from "./tools/components.js";
|
|
34
|
+
import { registerConceptTools } from "./tools/concepts.js";
|
|
33
35
|
import { registerOperationsTools } from "./tools/operations.js";
|
|
34
36
|
import { registerPromptPlacementTools } from "./tools/promptPlacement.js";
|
|
35
37
|
import { LIST_FILTERS } from "./generated/listFilters.js";
|
|
@@ -42,6 +44,60 @@ import { registerTriggerTools } from "./tools/triggers.js";
|
|
|
42
44
|
import { registerApprovalTools, registerExecutionTools, registerValidationTools, } from "./tools/validation.js";
|
|
43
45
|
import { registerVersionTools } from "./tools/versions.js";
|
|
44
46
|
import { registerWorkflowMutations } from "./tools/workflowMutations.js";
|
|
47
|
+
const PROVENANCE_NOTE = "WHERE THE ROWS COME FROM — `provenance`, for a dynamic table filled from " +
|
|
48
|
+
"a warehouse. It replaces the old data-source sync: there is no separate " +
|
|
49
|
+
"sync object any more, so create_data_source_sync / run_data_source_sync " +
|
|
50
|
+
"do not exist. `provenance` is " +
|
|
51
|
+
"`{ sourceId, sql, grain, keyColumns?, mode?, cron, timezone?, enabled? }`: " +
|
|
52
|
+
"`sourceId` the data source; `sql` the query whose RESULT fills the table " +
|
|
53
|
+
"(try it first with query_data_source); `grain` what ONE ROW of that " +
|
|
54
|
+
"result is, as a sentence (\"one row per month per country\") — " +
|
|
55
|
+
"mandatory, it decides what the table can be asked for ever after; " +
|
|
56
|
+
"`keyColumns` which columns identify a row for `mode: \"upsert\"` (the " +
|
|
57
|
+
"default — `append` takes no key); `cron` when it runs, read in " +
|
|
58
|
+
"`timezone` (default UTC); `enabled: false` pauses it. A table with " +
|
|
59
|
+
"provenance has no other filler — a workflow may not also write its " +
|
|
60
|
+
"rows. It is part of the table's design, so a changed query is published " +
|
|
61
|
+
"through request_publish_data_table like a changed column. To fill it " +
|
|
62
|
+
"now rather than at its next turn: refresh_data_table. " +
|
|
63
|
+
"\n\nMEASURES ARE NOT ON THE TABLE. A measure is its own entity " +
|
|
64
|
+
"(create_measure); a table carries only its `timeAxis` " +
|
|
65
|
+
"(`{ column, grain }`), which every measure over it reads.";
|
|
66
|
+
/**
|
|
67
|
+
* What writing a measure takes (axonity-flow#1908). The contract, not a manual:
|
|
68
|
+
* the words of the formula are in get_measure_formula_spec and nowhere else.
|
|
69
|
+
*/
|
|
70
|
+
const MEASURE_NOTE = "READ get_measure_formula_spec FIRST; never write a function, operator or " +
|
|
71
|
+
"grain from memory. A measure is ONE formula, `definition.expression`, " +
|
|
72
|
+
"as text or as the stored tree. Four kinds, one grammar: " +
|
|
73
|
+
"\n- a BASE aggregates one COLUMN of one table: " +
|
|
74
|
+
"`sum(orders.amount) where orders.channel = 'd2c'`. It reads a column, " +
|
|
75
|
+
"never a calculation per row — a value per row belongs in the table's " +
|
|
76
|
+
"source query (`provenance.sql`), as a column of its own; " +
|
|
77
|
+
"\n- a DERIVED measure computes with other measures by name: " +
|
|
78
|
+
"`[revenue_d2c] + [revenue_retail]`, `divide([cm1], [net_revenue])`, " +
|
|
79
|
+
"`divide([revenue_d2c], [net_revenue] ignore orders.channel)` for a share " +
|
|
80
|
+
"of the total. Two fact tables may meet in one number; they are never " +
|
|
81
|
+
"joined; " +
|
|
82
|
+
"\n- TIME (`shift`, `to_date`, `rolling`) and CUMULATIVE (`running`): " +
|
|
83
|
+
"use them only where the spec marks them `available`. " +
|
|
84
|
+
"\n\nBuild bottom-up: the base measures first, each with its `quantity` " +
|
|
85
|
+
"(what it counts: EUR, customers, orders), then the derived ones; " +
|
|
86
|
+
"validate_measure before every save, and publish from the bottom up. " +
|
|
87
|
+
"\n\nFields: `label` (what a tile shows), `description` (what the number " +
|
|
88
|
+
"means — mandatory, an agent reads it to decide whether this is the " +
|
|
89
|
+
"number asked for), `definition`, `concept` (the NAME of the concept this " +
|
|
90
|
+
"number means — it must exist, create_concept first, and a derived " +
|
|
91
|
+
"measure needs one too), `questions` (what it answers, in the words " +
|
|
92
|
+
"someone would ask) and optionally `name`, the handle — derived from the " +
|
|
93
|
+
"label when omitted and unique in the workspace. `definition` is " +
|
|
94
|
+
"`{ expression, quantity?, format?, direction?, target?, watchMargin? }`; " +
|
|
95
|
+
"`quantity` is derived for a formula over measures. " +
|
|
96
|
+
"\n\nThe fields from before the formula — `tableId`, `clearTable`, " +
|
|
97
|
+
"`definition.aggregation`, `column`, `numerator`, `denominator` — are " +
|
|
98
|
+
"refused with `legacy_field`. " +
|
|
99
|
+
"\n\nIt is a DRAFT until published: request_publish_measure. Only a " +
|
|
100
|
+
"published measure gives a certified number.";
|
|
45
101
|
/**
|
|
46
102
|
* The entities the connector covers. Core entities (C4), memory entities (C5)
|
|
47
103
|
* — skills, policies, reference docs — which have the same draft→publish
|
|
@@ -143,18 +199,42 @@ const ENTITIES = [
|
|
|
143
199
|
label: "tables (authored reference data agents and decisions read)",
|
|
144
200
|
deleteVersionParam: "expected_version",
|
|
145
201
|
listPaging: { defaultPageSize: 20, maxPageSize: 200 },
|
|
146
|
-
|
|
202
|
+
createNote: PROVENANCE_NOTE,
|
|
203
|
+
updateWarning: PROVENANCE_NOTE +
|
|
204
|
+
" Sending `provenance` replaces it whole; `clearProvenance: true` " +
|
|
205
|
+
"takes the source away and leaves the rows that are there. " +
|
|
206
|
+
"\n\n`rows` AND `columns` ARE WHOLE-COLLECTION FIELDS: sending either " +
|
|
147
207
|
"REPLACES it entirely. Passing one row in `rows` does not append it — it " +
|
|
148
208
|
"deletes every other row in the table. To change content, use " +
|
|
149
209
|
"add_data_table_row / update_data_table_row / delete_data_table_row, " +
|
|
150
210
|
"which address a single row and cannot destroy the rest. Use `rows` here " +
|
|
151
211
|
"only when you genuinely mean to replace the whole content.",
|
|
152
212
|
},
|
|
213
|
+
{
|
|
214
|
+
// A measure was a field on a table; the semantic model (axonity-flow#1881
|
|
215
|
+
// S12, #1841) made it an entity of its own, in the same order and spelling
|
|
216
|
+
// as a table's routes — so the whole family, versions and publish request
|
|
217
|
+
// included, comes from the registrars with no code of its own.
|
|
218
|
+
singular: "measure",
|
|
219
|
+
basePath: "/api/v1/measures",
|
|
220
|
+
updateMethod: "PUT",
|
|
221
|
+
label: "measures (the agreed definition of one number in the model)",
|
|
222
|
+
deleteVersionParam: "expectedVersion",
|
|
223
|
+
listPaging: { defaultPageSize: 20, maxPageSize: 200 },
|
|
224
|
+
// read_measure is in tools/measureFormula.ts: it asks the platform to
|
|
225
|
+
// write the stored tree back as formula text, which a plain GET cannot.
|
|
226
|
+
readable: false,
|
|
227
|
+
guardFields: assertFormulaShape,
|
|
228
|
+
createNote: MEASURE_NOTE,
|
|
229
|
+
updateWarning: MEASURE_NOTE +
|
|
230
|
+
" `tableId` and `clearTable` are gone: a measure has no home table, " +
|
|
231
|
+
"the tables it reads follow from its formula. Sending `definition` " +
|
|
232
|
+
"replaces it whole, so send the `expression` with it.",
|
|
233
|
+
},
|
|
153
234
|
// The three below arrived with axonity-flow#1849 (axonity-mcp#78). None is
|
|
154
235
|
// versioned or publish-approved: a change is live the moment it is saved, so
|
|
155
236
|
// there is no draft to discard and no request_publish_*. Each lists one page
|
|
156
|
-
// on the shared cursor
|
|
157
|
-
// only — see `ADMIN_ONLY` in tools/dataSources.ts.
|
|
237
|
+
// on the shared cursor.
|
|
158
238
|
{
|
|
159
239
|
singular: "data_source",
|
|
160
240
|
basePath: "/api/v1/data-sources",
|
|
@@ -173,14 +253,13 @@ const ENTITIES = [
|
|
|
173
253
|
"`policy` holds the limits every query is held to " +
|
|
174
254
|
"(maxBytesBilled, maxSeconds, allowedDatasets, forbiddenDatasets, " +
|
|
175
255
|
"personalColumns, dateFilters); all are empty by default. " +
|
|
176
|
-
"\n\nThen test_data_source to see whether it answers. A
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
|
|
180
|
-
updateWarning: "NO DRAFT: this changes the live source, which every
|
|
256
|
+
"\n\nThen test_data_source to see whether it answers. A table is " +
|
|
257
|
+
"filled from this source through its own `provenance.sourceId` " +
|
|
258
|
+
"(create_data_table) — not through a sync, and not through a " +
|
|
259
|
+
"reference doc.",
|
|
260
|
+
updateWarning: "NO DRAFT: this changes the live source, which every table it fills and every query " +
|
|
181
261
|
"uses at once. `config` and `policy` are replaced WHOLE when sent — " +
|
|
182
|
-
"read first and send the complete block."
|
|
183
|
-
ADMIN_ONLY,
|
|
262
|
+
"read first and send the complete block.",
|
|
184
263
|
},
|
|
185
264
|
{
|
|
186
265
|
singular: "table_relationship",
|
|
@@ -197,18 +276,16 @@ const ENTITIES = [
|
|
|
197
276
|
"many-to-many, it has no safe join) and an optional `description`. A " +
|
|
198
277
|
"declaration that would make a total ambiguous — a second path between " +
|
|
199
278
|
"the same two tables, say — is refused with a 422 that says why. Read " +
|
|
200
|
-
"the sentence; it is the point."
|
|
201
|
-
ADMIN_ONLY,
|
|
279
|
+
"the sentence; it is the point.",
|
|
202
280
|
updateWarning: "Only `verified` (somebody checked that the keys really match) and " +
|
|
203
281
|
"`description` can change. To change the columns, delete and declare " +
|
|
204
|
-
"it again."
|
|
205
|
-
ADMIN_ONLY,
|
|
282
|
+
"it again.",
|
|
206
283
|
},
|
|
207
284
|
{
|
|
208
285
|
singular: "dashboard",
|
|
209
286
|
basePath: "/api/v1/dashboards",
|
|
210
287
|
updateMethod: "PUT",
|
|
211
|
-
label: "dashboards (tiles of measures over the workspace's
|
|
288
|
+
label: "dashboards (tiles of measures over the workspace's model)",
|
|
212
289
|
publishable: false,
|
|
213
290
|
hasDiscardDraft: false,
|
|
214
291
|
deleteVersionParam: "expected_version",
|
|
@@ -216,7 +293,7 @@ const ENTITIES = [
|
|
|
216
293
|
createNote: "Fields: `name`, `description`, `visibility` (\"workspace\", the " +
|
|
217
294
|
"default — everyone sees it — or \"private\") and `layout`, the " +
|
|
218
295
|
"sections of tiles; omit it for an empty dashboard. A tile names a " +
|
|
219
|
-
"measure by
|
|
296
|
+
"measure by its name (list_measures). The layout is " +
|
|
220
297
|
"checked when saved and a refusal names what is wrong.",
|
|
221
298
|
updateWarning: "NO DRAFT: a saved dashboard is what everyone it is shared with sees. " +
|
|
222
299
|
"`layout` is replaced WHOLE when sent — read first and send it complete.",
|
|
@@ -255,6 +332,7 @@ const VERSIONED = [
|
|
|
255
332
|
basePath: "/api/v1/data-tables",
|
|
256
333
|
publishedPath: "versions",
|
|
257
334
|
},
|
|
335
|
+
{ singular: "measure", basePath: "/api/v1/measures", publishedPath: "versions" },
|
|
258
336
|
];
|
|
259
337
|
export function registerAll(server, client) {
|
|
260
338
|
registerConventions(server, client);
|
|
@@ -291,7 +369,9 @@ export function registerAll(server, client) {
|
|
|
291
369
|
registerDataTableTools(server, client);
|
|
292
370
|
registerDataSourceTools(server, client);
|
|
293
371
|
registerMeasureTools(server, client);
|
|
372
|
+
registerMeasureFormulaTools(server, client);
|
|
294
373
|
registerDashboardTools(server, client);
|
|
374
|
+
registerConceptTools(server, client);
|
|
295
375
|
registerComponentTools(server, client);
|
|
296
376
|
}
|
|
297
377
|
export function buildServer(client) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,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ACnD,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,GAAG,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concepts — what a word means in this workspace, written once (axonity-mcp#81,
|
|
3
|
+
* the connector half of axonity-flow#1881 S3 / #1877).
|
|
4
|
+
*
|
|
5
|
+
* A concept is NOT a new entity type. The entries are rows of one table the
|
|
6
|
+
* platform keeps for the workspace, created with the first entry. So the
|
|
7
|
+
* lifecycle a concept inherits — draft, approval, versions, history — is that
|
|
8
|
+
* table's, and publishing the definitions is `request_publish_data_table` on
|
|
9
|
+
* the `tableId` every write here returns. No `request_publish_concept` exists,
|
|
10
|
+
* because there is no such entity to publish.
|
|
11
|
+
*
|
|
12
|
+
* What these four tools add over the generic row tools is the reason the
|
|
13
|
+
* platform built the route: the fields are fixed and each has a sentence that
|
|
14
|
+
* says what belongs in it. A blind cell dictionary would hand an agent the
|
|
15
|
+
* column names and none of that.
|
|
16
|
+
*
|
|
17
|
+
* Tool names follow the platform's word, `concept`, rather than "term": a
|
|
18
|
+
* measure points at one through a field called `concept`, and two names for
|
|
19
|
+
* one thing is the drift the semantic model exists to remove.
|
|
20
|
+
*
|
|
21
|
+
* Writes take no `expectedVersion`. That is the route's contract, the same as
|
|
22
|
+
* a table row write: a single addressed operation the service applies under
|
|
23
|
+
* its own lock.
|
|
24
|
+
*/
|
|
25
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
26
|
+
import type { AxonityClient } from "../client.js";
|
|
27
|
+
export declare function registerConceptTools(server: McpServer, client: AxonityClient): void;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concepts — what a word means in this workspace, written once (axonity-mcp#81,
|
|
3
|
+
* the connector half of axonity-flow#1881 S3 / #1877).
|
|
4
|
+
*
|
|
5
|
+
* A concept is NOT a new entity type. The entries are rows of one table the
|
|
6
|
+
* platform keeps for the workspace, created with the first entry. So the
|
|
7
|
+
* lifecycle a concept inherits — draft, approval, versions, history — is that
|
|
8
|
+
* table's, and publishing the definitions is `request_publish_data_table` on
|
|
9
|
+
* the `tableId` every write here returns. No `request_publish_concept` exists,
|
|
10
|
+
* because there is no such entity to publish.
|
|
11
|
+
*
|
|
12
|
+
* What these four tools add over the generic row tools is the reason the
|
|
13
|
+
* platform built the route: the fields are fixed and each has a sentence that
|
|
14
|
+
* says what belongs in it. A blind cell dictionary would hand an agent the
|
|
15
|
+
* column names and none of that.
|
|
16
|
+
*
|
|
17
|
+
* Tool names follow the platform's word, `concept`, rather than "term": a
|
|
18
|
+
* measure points at one through a field called `concept`, and two names for
|
|
19
|
+
* one thing is the drift the semantic model exists to remove.
|
|
20
|
+
*
|
|
21
|
+
* Writes take no `expectedVersion`. That is the route's contract, the same as
|
|
22
|
+
* a table row write: a single addressed operation the service applies under
|
|
23
|
+
* its own lock.
|
|
24
|
+
*/
|
|
25
|
+
import { z } from "zod";
|
|
26
|
+
import { guard, jsonResult } from "./result.js";
|
|
27
|
+
const BASE = "/api/v1/concepts";
|
|
28
|
+
const KIND = z
|
|
29
|
+
.enum(["concept", "state", "metric", "rule"])
|
|
30
|
+
.describe("`concept`: one of the company's own words and what it means here. " +
|
|
31
|
+
"`state`: when something counts as being in that state (\"lost\", " +
|
|
32
|
+
"\"active\"). `metric`: what a number means and what it is PER — the " +
|
|
33
|
+
"calculation is a measure, this is the sentence that says CAC is per " +
|
|
34
|
+
"customer. `rule`: a sentence that always applies.");
|
|
35
|
+
const NAME = z
|
|
36
|
+
.string()
|
|
37
|
+
.describe('The word as people here say it — "Active customer", not ' +
|
|
38
|
+
'"cust_active_flag". One entry per word; other words go in synonyms.');
|
|
39
|
+
const MEANING = z
|
|
40
|
+
.string()
|
|
41
|
+
.describe("One or two sentences, INCLUDING WHAT IT IS NOT. The exclusions are what " +
|
|
42
|
+
'stop an agent guessing: "at least one D2C order in the month — not a ' +
|
|
43
|
+
'trial customer, and not simply anyone who has not churned".');
|
|
44
|
+
const SYNONYMS = z
|
|
45
|
+
.array(z.string())
|
|
46
|
+
.describe('Other words people use for exactly this, so a question that says ' +
|
|
47
|
+
'"subscribers" finds it. A synonym may belong to only ONE concept in ' +
|
|
48
|
+
"the workspace.");
|
|
49
|
+
const REFERS_TO = z
|
|
50
|
+
.string()
|
|
51
|
+
.describe("What in the model this is about, in one of four forms: " +
|
|
52
|
+
"`measure:active_clients`, `table:orders_monthly`, " +
|
|
53
|
+
"`column:orders_monthly.country`, `value:orders_monthly.status=lost`. " +
|
|
54
|
+
"It must exist. Empty for a word that is not in the model yet.");
|
|
55
|
+
const OWNER = z
|
|
56
|
+
.string()
|
|
57
|
+
.describe('Who to ask when this definition is disputed — a role or a person, "CGO". ' +
|
|
58
|
+
"Approval says it may go live; this says whose it is.");
|
|
59
|
+
const SCOPE = z
|
|
60
|
+
.string()
|
|
61
|
+
.describe("For a `rule` only: where it applies. Empty is the whole model; " +
|
|
62
|
+
"otherwise `table:orders_monthly` or `column:orders_monthly.net_revenue`.");
|
|
63
|
+
const PUBLISHING = "\n\nNOT LIVE UNTIL PUBLISHED. The concepts live in one table, and every " +
|
|
64
|
+
"write answers with its `tableId`; request_publish_data_table on that id " +
|
|
65
|
+
"is what makes them count for a certified answer.";
|
|
66
|
+
export function registerConceptTools(server, client) {
|
|
67
|
+
server.tool("list_concepts", "This workspace's concepts — what each of its own words means — one page " +
|
|
68
|
+
"at a time. Read-only. " +
|
|
69
|
+
"\n\nTHE RESPONSE IS ONE PAGE: { items, nextCursor, pageSize, hasMore }. " +
|
|
70
|
+
"While hasMore is true you have not seen them all — pass nextCursor " +
|
|
71
|
+
"back as cursor. `q` matches any field, synonyms included, across the " +
|
|
72
|
+
"whole list before the page is cut: \"is there already a concept for " +
|
|
73
|
+
"X\" is one call. Do that before create_concept; a word belongs to one " +
|
|
74
|
+
"concept only. " +
|
|
75
|
+
"\n\nAn empty first page means the workspace has written none yet — not " +
|
|
76
|
+
"an error.", {
|
|
77
|
+
q: z.string().optional().describe("Keep only concepts with a field containing this text."),
|
|
78
|
+
limit: z.number().int().optional().describe("Page size; clamped to 200."),
|
|
79
|
+
cursor: z
|
|
80
|
+
.string()
|
|
81
|
+
.optional()
|
|
82
|
+
.describe("nextCursor from the previous page. Omit for the first. Never build one."),
|
|
83
|
+
}, async ({ q, limit, cursor }) => guard(async () => jsonResult(await client.get(BASE, { q, limit, cursor }))));
|
|
84
|
+
server.tool("create_concept", "Write one concept: what a word means here, once, with an owner. The " +
|
|
85
|
+
"list it lives in is created with the first one. " +
|
|
86
|
+
"\n\nRead axonity_semantic_conventions first for what a good one says. " +
|
|
87
|
+
"A measure points at a concept by its `name` (create_measure's " +
|
|
88
|
+
"`concept`), so write the concept before the measure that means it." +
|
|
89
|
+
PUBLISHING, {
|
|
90
|
+
kind: KIND,
|
|
91
|
+
name: NAME,
|
|
92
|
+
meaning: MEANING,
|
|
93
|
+
owner: OWNER,
|
|
94
|
+
synonyms: SYNONYMS.optional(),
|
|
95
|
+
refersTo: REFERS_TO.optional(),
|
|
96
|
+
scope: SCOPE.optional(),
|
|
97
|
+
}, async (fields) => guard(async () => jsonResult(await client.post(BASE, fields))));
|
|
98
|
+
server.tool("update_concept", "Change named fields of one concept; the fields you do not send keep " +
|
|
99
|
+
"their values. Sending `\"\"` or `[]` is a real edit — it clears that " +
|
|
100
|
+
"field." +
|
|
101
|
+
PUBLISHING, {
|
|
102
|
+
id: z.string().describe("The concept's id (from list_concepts)."),
|
|
103
|
+
kind: KIND.optional(),
|
|
104
|
+
name: NAME.optional(),
|
|
105
|
+
meaning: MEANING.optional(),
|
|
106
|
+
owner: OWNER.optional(),
|
|
107
|
+
synonyms: SYNONYMS.optional(),
|
|
108
|
+
refersTo: REFERS_TO.optional(),
|
|
109
|
+
scope: SCOPE.optional(),
|
|
110
|
+
}, async ({ id, ...changes }) => guard(async () => jsonResult(await client.patch(`${BASE}/${id}`, changes))));
|
|
111
|
+
server.tool("delete_concept", "Remove one concept from the working list. The removed entry rides back " +
|
|
112
|
+
"in the response. Every published version still carries it — so an " +
|
|
113
|
+
"answer that leaned on it can still say so — until the list is " +
|
|
114
|
+
"published again without it." +
|
|
115
|
+
PUBLISHING, {
|
|
116
|
+
id: z.string().describe("The concept's id."),
|
|
117
|
+
confirm: z
|
|
118
|
+
.literal(true)
|
|
119
|
+
.describe("Must be true. Acknowledges the definition is removed from the draft."),
|
|
120
|
+
}, async ({ id }) => guard(async () => jsonResult(await client.del(`${BASE}/${id}`))));
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=concepts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concepts.js","sourceRoot":"","sources":["../../src/tools/concepts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAEhC,MAAM,IAAI,GAAG,CAAC;KACX,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC5C,QAAQ,CACP,oEAAoE;IAClE,mEAAmE;IACnE,sEAAsE;IACtE,sEAAsE;IACtE,mDAAmD,CACtD,CAAC;AACJ,MAAM,IAAI,GAAG,CAAC;KACX,MAAM,EAAE;KACR,QAAQ,CACP,0DAA0D;IACxD,qEAAqE,CACxE,CAAC;AACJ,MAAM,OAAO,GAAG,CAAC;KACd,MAAM,EAAE;KACR,QAAQ,CACP,0EAA0E;IACxE,uEAAuE;IACvE,6DAA6D,CAChE,CAAC;AACJ,MAAM,QAAQ,GAAG,C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