@axonity-ai/mcp 0.1.0 → 0.3.2
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 +172 -24
- package/dist/client.d.ts +11 -2
- package/dist/client.js +28 -10
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +53 -10
- package/dist/errors.js +163 -19
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.js +135 -4
- package/dist/index.js.map +1 -1
- package/dist/tools/company.d.ts +16 -0
- package/dist/tools/company.js +81 -0
- package/dist/tools/company.js.map +1 -0
- package/dist/tools/conventions.d.ts +10 -4
- package/dist/tools/conventions.js +389 -23
- package/dist/tools/conventions.js.map +1 -1
- package/dist/tools/credentials.d.ts +34 -0
- package/dist/tools/credentials.js +106 -0
- package/dist/tools/credentials.js.map +1 -0
- package/dist/tools/extras.d.ts +14 -5
- package/dist/tools/extras.js +85 -40
- package/dist/tools/extras.js.map +1 -1
- package/dist/tools/promptPlacement.d.ts +15 -0
- package/dist/tools/promptPlacement.js +99 -0
- package/dist/tools/promptPlacement.js.map +1 -0
- package/dist/tools/register.d.ts +67 -10
- package/dist/tools/register.js +77 -22
- package/dist/tools/register.js.map +1 -1
- package/dist/tools/runs.d.ts +14 -0
- package/dist/tools/runs.js +103 -0
- package/dist/tools/runs.js.map +1 -0
- package/dist/tools/triggers.d.ts +13 -0
- package/dist/tools/triggers.js +128 -0
- package/dist/tools/triggers.js.map +1 -0
- package/dist/tools/validation.d.ts +13 -0
- package/dist/tools/validation.js +116 -0
- package/dist/tools/validation.js.map +1 -0
- package/dist/tools/versions.d.ts +37 -0
- package/dist/tools/versions.js +104 -0
- package/dist/tools/versions.js.map +1 -0
- package/dist/tools/workflowMutations.d.ts +22 -0
- package/dist/tools/workflowMutations.js +118 -23
- package/dist/tools/workflowMutations.js.map +1 -1
- package/package.json +2 -2
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkCH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,eAAe,GAA2B,IAAI,GAAG,CAAC;IAC7D,kBAAkB;IAClB,cAAc;IACd,8BAA8B;CAC/B,CAAC,CAAC;AAUH,mFAAmF;AACnF,SAAS,UAAU,CAAC,IAAa;IAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IACvF,MAAM,CAAC,GAAG,IAA+B,CAAC;IAC1C,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;QAC9D,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QACrD,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACrE,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QAC5C,gBAAgB,EAAE,kBAAkB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;KAC3E,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,MAAe;IAC5C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IA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,cAAc,CAAC,MAAc,EAAE,IAAc;IAC3D,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAE7B,QAAQ,GAAG,EAAE,IAAI,EAAE,CAAC;QAClB,KAAK,kBAAkB;YACrB,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACxC,KAAK,oBAAoB;YACvB,OAAO,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAC1C,KAAK,WAAW;YACd,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACjC,KAAK,cAAc;YACjB,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,WAAW,CAAC;QACjB,KAAK,wBAAwB;YAC3B,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,GAAG;YACN,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,GAAG;YACN,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;QAClC,KAAK,GAAG;YACN,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACjC,KAAK,GAAG;YACN,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACxC;YACE,OAAO,IAAI,eAAe,CACxB,UAAU,CAAC,+BAA+B,MAAM,IAAI,EAAE,IAAI,CAAC,EAC3D,MAAM,EACN,IAAI,EACJ,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,SAAS,CACf,CAAC;IACN,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,4 +17,25 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
19
19
|
import { AxonityClient } from "./client.js";
|
|
20
|
+
/**
|
|
21
|
+
* Register the whole tool surface onto a server. Split out from `buildServer`
|
|
22
|
+
* so a test can drive the real registration against a recording server — e.g.
|
|
23
|
+
* to assert no tool ever targets a deny-listed route (publish/approve/secret/…).
|
|
24
|
+
* `ServerLike` is the minimal `.tool()` surface both `McpServer` and a test
|
|
25
|
+
* double satisfy.
|
|
26
|
+
*/
|
|
27
|
+
type ServerLike = Pick<McpServer, "tool">;
|
|
28
|
+
export declare function registerAll(server: ServerLike, client: AxonityClient): void;
|
|
20
29
|
export declare function buildServer(client: AxonityClient): McpServer;
|
|
30
|
+
/**
|
|
31
|
+
* True when this module is the process entry point.
|
|
32
|
+
*
|
|
33
|
+
* `import.meta.url` is realpath-resolved and percent-encoded, so it can't be
|
|
34
|
+
* compared against a hand-built `file://${argv[1]}` string: npm installs the bin
|
|
35
|
+
* as a symlink (`node_modules/.bin/axonity-mcp`), which is how `npx` runs it, and
|
|
36
|
+
* paths with spaces encode differently. Both mismatches used to leave the server
|
|
37
|
+
* silently unstarted. Resolve argv[1] the same way before comparing.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isEntryPoint(moduleUrl: string, argv1: string | undefined): boolean;
|
|
40
|
+
export declare function assertNoExtraArguments(argv: string[]): void;
|
|
41
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -15,13 +15,22 @@
|
|
|
15
15
|
* tenant + scope on every call. Publishing is human-approved and lands in a
|
|
16
16
|
* later slice (C3) — this connector never publishes directly.
|
|
17
17
|
*/
|
|
18
|
+
import { realpathSync } from "node:fs";
|
|
19
|
+
import { pathToFileURL } from "node:url";
|
|
18
20
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
19
21
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
20
22
|
import { AxonityClient } from "./client.js";
|
|
21
23
|
import { loadConfig } from "./config.js";
|
|
22
24
|
import { registerConventions } from "./tools/conventions.js";
|
|
23
|
-
import {
|
|
25
|
+
import { assertPlaceholderCredentials } from "./tools/credentials.js";
|
|
26
|
+
import { registerAttachTools, registerCatalogTools, registerConnectorTools, registerPersonaTools, } from "./tools/extras.js";
|
|
27
|
+
import { registerCompanyTools } from "./tools/company.js";
|
|
28
|
+
import { registerPromptPlacementTools } from "./tools/promptPlacement.js";
|
|
24
29
|
import { registerEntityTools } from "./tools/register.js";
|
|
30
|
+
import { registerRunTools } from "./tools/runs.js";
|
|
31
|
+
import { registerTriggerTools } from "./tools/triggers.js";
|
|
32
|
+
import { registerApprovalTools, registerExecutionTools, registerValidationTools, } from "./tools/validation.js";
|
|
33
|
+
import { registerVersionTools } from "./tools/versions.js";
|
|
25
34
|
import { registerWorkflowMutations } from "./tools/workflowMutations.js";
|
|
26
35
|
/**
|
|
27
36
|
* The entities the connector covers. Core entities (C4) plus memory
|
|
@@ -34,51 +43,138 @@ const ENTITIES = [
|
|
|
34
43
|
basePath: "/api/v1/workflows",
|
|
35
44
|
updateMethod: "PATCH",
|
|
36
45
|
label: "workflows (business processes)",
|
|
46
|
+
deleteVersionParam: "expectedVersion",
|
|
37
47
|
},
|
|
38
48
|
{
|
|
39
49
|
singular: "agent",
|
|
40
50
|
basePath: "/api/v1/agents",
|
|
41
51
|
updateMethod: "PUT",
|
|
42
52
|
label: "agents",
|
|
53
|
+
deleteVersionParam: "expectedVersion",
|
|
43
54
|
},
|
|
44
55
|
{
|
|
45
56
|
singular: "tool",
|
|
46
57
|
basePath: "/api/v1/tools",
|
|
47
58
|
updateMethod: "PUT",
|
|
48
59
|
label: "tools (functions, connectors, validators, evaluators)",
|
|
60
|
+
// A connector is just a tool, so create_tool/update_tool can carry an
|
|
61
|
+
// authConfig too — they get the same credential guard as create_connector.
|
|
62
|
+
guardFields: assertPlaceholderCredentials,
|
|
63
|
+
deleteVersionParam: "expectedVersion",
|
|
49
64
|
},
|
|
50
65
|
{
|
|
51
66
|
singular: "skill",
|
|
52
67
|
basePath: "/api/v1/skills",
|
|
53
68
|
updateMethod: "PUT",
|
|
54
69
|
label: "skills (reusable know-how for agents)",
|
|
70
|
+
deleteVersionParam: "expected_version",
|
|
55
71
|
},
|
|
56
72
|
{
|
|
57
73
|
singular: "policy",
|
|
58
74
|
basePath: "/api/v1/policies",
|
|
59
75
|
updateMethod: "PUT",
|
|
60
76
|
label: "policies (rules and guardrails for agents)",
|
|
77
|
+
plural: "policies",
|
|
78
|
+
deleteVersionParam: "expected_version",
|
|
61
79
|
},
|
|
62
80
|
{
|
|
63
81
|
singular: "reference_doc",
|
|
64
82
|
basePath: "/api/v1/reference-docs",
|
|
65
83
|
updateMethod: "PUT",
|
|
66
84
|
label: "reference docs (background knowledge for agents)",
|
|
85
|
+
deleteVersionParam: "expected_version",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
singular: "output_schema",
|
|
89
|
+
basePath: "/api/v1/output-schemas",
|
|
90
|
+
updateMethod: "PUT",
|
|
91
|
+
label: "output schemas (reusable step/agent output contracts)",
|
|
92
|
+
// Now fully version-controlled and in the publish-approval gateway
|
|
93
|
+
// alongside the memory entities — no longer live-on-write.
|
|
94
|
+
deleteVersionParam: "expected_version",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
singular: "persona",
|
|
98
|
+
basePath: "/api/v1/personas",
|
|
99
|
+
updateMethod: "PUT",
|
|
100
|
+
label: "personas (an agent's character, 1:1 with the agent)",
|
|
101
|
+
// Created only through its agent (create_agent_persona) — there is no
|
|
102
|
+
// standalone POST /api/v1/personas.
|
|
103
|
+
creatable: false,
|
|
104
|
+
deleteVersionParam: "expected_version",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
singular: "prompt_snippet",
|
|
108
|
+
basePath: "/api/v1/prompt-snippets",
|
|
109
|
+
updateMethod: "PATCH",
|
|
110
|
+
label: "prompt snippets (reusable prompt fragments)",
|
|
111
|
+
deleteVersionParam: "expectedVersion",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
singular: "flow",
|
|
115
|
+
basePath: "/api/v1/flows",
|
|
116
|
+
updateMethod: "PATCH",
|
|
117
|
+
label: "flows (reusable workflow fragments)",
|
|
118
|
+
deleteVersionParam: "expectedVersion",
|
|
67
119
|
},
|
|
68
120
|
];
|
|
69
|
-
|
|
70
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Entities with version history. Every authored entity here exposes the
|
|
123
|
+
* `/versions*` routes, `flow` included (verified against the backend:
|
|
124
|
+
* `/api/v1/flows/{id}/versions…`), so all ten get the version tools.
|
|
125
|
+
*/
|
|
126
|
+
const VERSIONED = [
|
|
127
|
+
{ singular: "workflow", basePath: "/api/v1/workflows", publishedPath: "entity" },
|
|
128
|
+
{ singular: "agent", basePath: "/api/v1/agents", publishedPath: "entity" },
|
|
129
|
+
{ singular: "tool", basePath: "/api/v1/tools", publishedPath: "entity" },
|
|
130
|
+
{ singular: "skill", basePath: "/api/v1/skills", publishedPath: "versions" },
|
|
131
|
+
{ singular: "policy", basePath: "/api/v1/policies", publishedPath: "versions" },
|
|
132
|
+
{
|
|
133
|
+
singular: "reference_doc",
|
|
134
|
+
basePath: "/api/v1/reference-docs",
|
|
135
|
+
publishedPath: "versions",
|
|
136
|
+
},
|
|
137
|
+
{ singular: "persona", basePath: "/api/v1/personas", publishedPath: "versions" },
|
|
138
|
+
{
|
|
139
|
+
singular: "output_schema",
|
|
140
|
+
basePath: "/api/v1/output-schemas",
|
|
141
|
+
publishedPath: "versions",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
singular: "prompt_snippet",
|
|
145
|
+
basePath: "/api/v1/prompt-snippets",
|
|
146
|
+
publishedPath: "versions",
|
|
147
|
+
},
|
|
148
|
+
{ singular: "flow", basePath: "/api/v1/flows", publishedPath: "entity" },
|
|
149
|
+
];
|
|
150
|
+
export function registerAll(server, client) {
|
|
71
151
|
registerConventions(server);
|
|
72
152
|
for (const def of ENTITIES) {
|
|
73
153
|
registerEntityTools(server, client, def);
|
|
74
154
|
}
|
|
155
|
+
for (const def of VERSIONED) {
|
|
156
|
+
registerVersionTools(server, client, def);
|
|
157
|
+
}
|
|
75
158
|
registerWorkflowMutations(server, client);
|
|
159
|
+
registerValidationTools(server, client);
|
|
160
|
+
registerExecutionTools(server, client);
|
|
161
|
+
registerApprovalTools(server, client);
|
|
162
|
+
registerTriggerTools(server, client);
|
|
163
|
+
registerRunTools(server, client);
|
|
76
164
|
registerPersonaTools(server, client);
|
|
77
165
|
registerConnectorTools(server, client);
|
|
78
166
|
registerAttachTools(server, client);
|
|
167
|
+
registerCatalogTools(server, client);
|
|
168
|
+
registerPromptPlacementTools(server, client);
|
|
169
|
+
registerCompanyTools(server, client);
|
|
170
|
+
}
|
|
171
|
+
export function buildServer(client) {
|
|
172
|
+
const server = new McpServer({ name: "axonity", version: "0.1.0" });
|
|
173
|
+
registerAll(server, client);
|
|
79
174
|
return server;
|
|
80
175
|
}
|
|
81
176
|
async function main() {
|
|
177
|
+
assertNoExtraArguments(process.argv.slice(2));
|
|
82
178
|
const config = loadConfig();
|
|
83
179
|
const client = new AxonityClient(config);
|
|
84
180
|
const server = buildServer(client);
|
|
@@ -87,8 +183,43 @@ async function main() {
|
|
|
87
183
|
// Log to stderr — stdout is the MCP channel and must stay clean.
|
|
88
184
|
console.error(`Axonity MCP connector ready (${config.apiUrl}).`);
|
|
89
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* True when this module is the process entry point.
|
|
188
|
+
*
|
|
189
|
+
* `import.meta.url` is realpath-resolved and percent-encoded, so it can't be
|
|
190
|
+
* compared against a hand-built `file://${argv[1]}` string: npm installs the bin
|
|
191
|
+
* as a symlink (`node_modules/.bin/axonity-mcp`), which is how `npx` runs it, and
|
|
192
|
+
* paths with spaces encode differently. Both mismatches used to leave the server
|
|
193
|
+
* silently unstarted. Resolve argv[1] the same way before comparing.
|
|
194
|
+
*/
|
|
195
|
+
export function isEntryPoint(moduleUrl, argv1) {
|
|
196
|
+
if (!argv1)
|
|
197
|
+
return false;
|
|
198
|
+
try {
|
|
199
|
+
return moduleUrl === pathToFileURL(realpathSync(argv1)).href;
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
// argv[1] isn't a readable path (e.g. `node --eval`); not our entry point.
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
export function assertNoExtraArguments(argv) {
|
|
207
|
+
if (argv.length === 0)
|
|
208
|
+
return;
|
|
209
|
+
throw new Error([
|
|
210
|
+
"This MCP server does not accept command-line arguments.",
|
|
211
|
+
"Usage:",
|
|
212
|
+
" axonity-mcp",
|
|
213
|
+
"",
|
|
214
|
+
"Pass configuration through environment variables instead:",
|
|
215
|
+
" AXONITY_TOKEN (required): the service token.",
|
|
216
|
+
" AXONITY_API_URL (optional): API base URL.",
|
|
217
|
+
"",
|
|
218
|
+
`Received arguments: ${argv.join(" ")}`,
|
|
219
|
+
].join("\n"));
|
|
220
|
+
}
|
|
90
221
|
// Only run when executed directly (not when imported by tests).
|
|
91
|
-
if (import.meta.url
|
|
222
|
+
if (isEntryPoint(import.meta.url, process.argv[1])) {
|
|
92
223
|
main().catch((err) => {
|
|
93
224
|
console.error("Axonity MCP connector failed to start:", err);
|
|
94
225
|
process.exit(1);
|
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,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,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AA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,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnD,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,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The company entity — a tenant's single company document (mission, value
|
|
3
|
+
* streams, org structure). Unlike the other authored entities it is a
|
|
4
|
+
* SINGLETON: one per tenant, addressed at `/api/v1/company` with no id, so it
|
|
5
|
+
* has no list / create / delete / restore / discard routes. It is
|
|
6
|
+
* version-controlled like the memory entities, and edited as a whole document
|
|
7
|
+
* (a full-document PUT under optimistic locking), not field-by-field.
|
|
8
|
+
*
|
|
9
|
+
* Publishing: company is currently NOT a publish-approval entity type on the
|
|
10
|
+
* backend, so there is no request_publish_company — a company change is
|
|
11
|
+
* published directly by a human/admin in Axonity. (Tracked in axonity-flow: the
|
|
12
|
+
* decision on whether company joins the approval queue.)
|
|
13
|
+
*/
|
|
14
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
15
|
+
import type { AxonityClient } from "../client.js";
|
|
16
|
+
export declare function registerCompanyTools(server: McpServer, client: AxonityClient): void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The company entity — a tenant's single company document (mission, value
|
|
3
|
+
* streams, org structure). Unlike the other authored entities it is a
|
|
4
|
+
* SINGLETON: one per tenant, addressed at `/api/v1/company` with no id, so it
|
|
5
|
+
* has no list / create / delete / restore / discard routes. It is
|
|
6
|
+
* version-controlled like the memory entities, and edited as a whole document
|
|
7
|
+
* (a full-document PUT under optimistic locking), not field-by-field.
|
|
8
|
+
*
|
|
9
|
+
* Publishing: company is currently NOT a publish-approval entity type on the
|
|
10
|
+
* backend, so there is no request_publish_company — a company change is
|
|
11
|
+
* published directly by a human/admin in Axonity. (Tracked in axonity-flow: the
|
|
12
|
+
* decision on whether company joins the approval queue.)
|
|
13
|
+
*/
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
import { guard, jsonResult } from "./result.js";
|
|
16
|
+
export function registerCompanyTools(server, client) {
|
|
17
|
+
server.tool("read_company", "Read this tenant's company document (its current draft and version). There " +
|
|
18
|
+
"is one company per tenant — no id. Read it before you update, to get the " +
|
|
19
|
+
"version for optimistic locking.", {}, async () => guard(async () => jsonResult(await client.get("/api/v1/company"))));
|
|
20
|
+
server.tool("read_company_published", "Read the LIVE published company document — what the runtime uses, as opposed " +
|
|
21
|
+
"to the draft read_company returns. Diff the two to see what a publish would change.", {}, async () => guard(async () => jsonResult(await client.get("/api/v1/company/published"))));
|
|
22
|
+
server.tool("update_company", "Save the company draft as a WHOLE document (full-document PUT, not a field " +
|
|
23
|
+
"merge). Read it first for its version; on a 409 conflict re-read and retry. " +
|
|
24
|
+
"This writes the draft only — a human publishes it in Axonity (company is " +
|
|
25
|
+
"not part of the request_publish_* approval flow).", {
|
|
26
|
+
expectedVersion: z
|
|
27
|
+
.number()
|
|
28
|
+
.int()
|
|
29
|
+
.describe("The version you last read — rejected with 409 if stale."),
|
|
30
|
+
document: z
|
|
31
|
+
.record(z.unknown())
|
|
32
|
+
.describe("The complete company document to persist (as read_company returns it)."),
|
|
33
|
+
}, async ({ expectedVersion, document }) => guard(async () => jsonResult(await client.put("/api/v1/company", { expectedVersion, document }))));
|
|
34
|
+
server.tool("list_company_versions", "List the company document's version history — checkpoints and major versions.", {
|
|
35
|
+
type: z
|
|
36
|
+
.enum(["checkpoint", "major", "all"])
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Which kind to list. Defaults to all."),
|
|
39
|
+
limit: z.number().int().min(1).max(200).optional().describe("Default 50."),
|
|
40
|
+
offset: z.number().int().min(0).optional().describe("Default 0."),
|
|
41
|
+
}, async ({ type, limit, offset }) => guard(async () => jsonResult(await client.get("/api/v1/company/versions", { type, limit, offset }))));
|
|
42
|
+
server.tool("read_company_version", "Read one historical company version by its CHECKPOINT NUMBER (the integer " +
|
|
43
|
+
"`version` from list_company_versions), including its document.", { version: z.number().int().describe("The integer checkpoint number, e.g. 3.") }, async ({ version }) => guard(async () => jsonResult(await client.get(`/api/v1/company/versions/${version}`))));
|
|
44
|
+
server.tool("restore_company_version", "Roll the company draft back to an earlier version. Takes the versionId (a " +
|
|
45
|
+
"UUID from list_company_versions), not the checkpoint number. Changes only " +
|
|
46
|
+
"the draft; what is live stays live until a human publishes.", {
|
|
47
|
+
versionId: z.string().describe("The version row's UUID."),
|
|
48
|
+
expectedVersion: z
|
|
49
|
+
.number()
|
|
50
|
+
.int()
|
|
51
|
+
.describe("The draft version you last read — 409 if stale."),
|
|
52
|
+
}, async ({ versionId, expectedVersion }) => guard(async () => jsonResult(await client.post(`/api/v1/company/versions/${versionId}/restore`, {
|
|
53
|
+
expectedVersion,
|
|
54
|
+
}))));
|
|
55
|
+
server.tool("name_company_major_version", "Give one of the company document's major versions a name — label a release " +
|
|
56
|
+
"so it is easy to find in history. Targets a MAJOR version by its integer " +
|
|
57
|
+
"number (from list_company_versions), not a checkpoint or a versionId. Like " +
|
|
58
|
+
"everything else on this singleton it takes no id. This only renames; it " +
|
|
59
|
+
"does not create, publish, or roll anything back.", {
|
|
60
|
+
majorVersion: z
|
|
61
|
+
.number()
|
|
62
|
+
.int()
|
|
63
|
+
.describe("The major version's integer number, e.g. 2."),
|
|
64
|
+
name: z.string().min(1).max(255).describe("The new name for that major version."),
|
|
65
|
+
}, async ({ majorVersion, name }) => guard(async () => jsonResult(await client.patch(`/api/v1/company/versions/major/${majorVersion}`, { name }))));
|
|
66
|
+
server.tool("request_publish_company", "Request that the company document be published. Like request_publish_* for " +
|
|
67
|
+
"every other entity, this does NOT publish — it creates a pending approval " +
|
|
68
|
+
"a human approves in Axonity. Company is a singleton, so unlike the others " +
|
|
69
|
+
"this takes NO id: the server resolves the one company from your tenant. " +
|
|
70
|
+
"(Direct company publish is closed to service tokens — this is the only " +
|
|
71
|
+
"path.)", {
|
|
72
|
+
changeSummary: z
|
|
73
|
+
.string()
|
|
74
|
+
.optional()
|
|
75
|
+
.describe("A short note for the approver on what changed and why."),
|
|
76
|
+
}, async ({ changeSummary }) => guard(async () => jsonResult(await client.post("/api/v1/publish-approvals", {
|
|
77
|
+
entityType: "company",
|
|
78
|
+
...(changeSummary ? { changeSummary } : {}),
|
|
79
|
+
}))));
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=company.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company.js","sourceRoot":"","sources":["../../src/tools/company.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,MAAqB;IAErB,MAAM,CAAC,IAAI,CACT,cAAc,EACd,6EAA6E;QAC3E,2EAA2E;QAC3E,iCAAiC,EACnC,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAC/E,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,+EAA+E;QAC7E,qFAAqF,EACvF,EAAE,EACF,KAAK,IAAI,EAAE,CACT,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAC/E,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,gBAAgB,EAChB,6EAA6E;QAC3E,8E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CAC/B,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,MAAM,MAAM,CAAC,KAAK,CAAC,kCAAkC,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAC/E,CACF,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,yBAAyB,EACzB,6EAA6E;QAC3E,4EAA4E;QAC5E,4EAA4E;QAC5E,0EAA0E;QAC1E,yEAAyE;QACzE,QAAQ,EACV;QACE,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,wDAAwD,CAAC;KACtE,EACD,KAAK,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAC1B,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,MAAM,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE;QAC7C,UAAU,EAAE,SAAS;QACrB,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAC,CACH,CACF,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
* The `axonity_conventions` guidance tool.
|
|
3
3
|
*
|
|
4
4
|
* An external agent needs the same authoring rules the internal Builder team
|
|
5
|
-
* carries, or its drafts will be low quality. This is
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* carries, or its drafts will be low quality. This is agent-facing GUIDANCE:
|
|
6
|
+
* build order, "complete when…" bars, wiring, and the prompt-placement / Memory
|
|
7
|
+
* V2 model — the parts a schema can't express.
|
|
8
|
+
*
|
|
9
|
+
* The hard facts it references (field names, enum values, required-ness) are NOT
|
|
10
|
+
* a second source of truth: the backend OpenAPI schema is authoritative
|
|
11
|
+
* (axonity-flow#722, Option 1). `test/conformance.test.ts` pins the routes here
|
|
12
|
+
* and the enums quoted below to a vendored snapshot of that schema, so a drift
|
|
13
|
+
* between this prose and the backend fails CI rather than misleading an agent.
|
|
14
|
+
* Keep enum lists in this doc in step with what that test asserts.
|
|
9
15
|
*/
|
|
10
16
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
17
|
export declare function registerConventions(server: McpServer): void;
|