@stigmer/mcp-server 3.11.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +4 -22
  2. package/cli/mcp-server-stigmer.js +11 -11
  3. package/config.d.ts +1 -5
  4. package/config.d.ts.map +1 -1
  5. package/config.js +2 -2
  6. package/config.js.map +1 -1
  7. package/domains/resourceuri.d.ts.map +1 -1
  8. package/domains/resourceuri.js +0 -1
  9. package/domains/resourceuri.js.map +1 -1
  10. package/domains/search/tools.d.ts.map +1 -1
  11. package/domains/search/tools.js +4 -5
  12. package/domains/search/tools.js.map +1 -1
  13. package/gen/agent.d.ts +1 -57
  14. package/gen/agent.d.ts.map +1 -1
  15. package/gen/agent.js +5 -28
  16. package/gen/agent.js.map +1 -1
  17. package/gen/environment.d.ts +1 -1
  18. package/gen/environment.d.ts.map +1 -1
  19. package/gen/environment.js +3 -3
  20. package/gen/environment.js.map +1 -1
  21. package/gen/mcpserver.d.ts +1 -1
  22. package/gen/mcpserver.d.ts.map +1 -1
  23. package/gen/mcpserver.js +7 -7
  24. package/gen/mcpserver.js.map +1 -1
  25. package/gen/workflow.d.ts +3 -3
  26. package/gen/workflow.d.ts.map +1 -1
  27. package/gen/workflow.js +34 -34
  28. package/gen/workflow.js.map +1 -1
  29. package/index.d.ts +1 -1
  30. package/index.d.ts.map +1 -1
  31. package/index.js +1 -1
  32. package/index.js.map +1 -1
  33. package/package.json +3 -3
  34. package/server.d.ts +6 -18
  35. package/server.d.ts.map +1 -1
  36. package/server.js +6 -36
  37. package/server.js.map +1 -1
  38. package/src/config.ts +3 -7
  39. package/src/domains/apply.integration.test.ts +3 -40
  40. package/src/domains/deletes.integration.test.ts +1 -25
  41. package/src/domains/reads.integration.test.ts +1 -18
  42. package/src/domains/resources.integration.test.ts +0 -18
  43. package/src/domains/resourceuri.test.ts +0 -2
  44. package/src/domains/resourceuri.ts +0 -1
  45. package/src/domains/search/search.integration.test.ts +3 -5
  46. package/src/domains/search/tools.ts +4 -5
  47. package/src/gen/agent.ts +5 -32
  48. package/src/gen/environment.ts +3 -3
  49. package/src/gen/mcpserver.ts +7 -7
  50. package/src/gen/workflow.ts +34 -34
  51. package/src/http.integration.test.ts +2 -3
  52. package/src/index.ts +0 -2
  53. package/src/server.ts +6 -36
  54. package/domains/datastores/apply.d.ts +0 -4
  55. package/domains/datastores/apply.d.ts.map +0 -1
  56. package/domains/datastores/apply.js +0 -28
  57. package/domains/datastores/apply.js.map +0 -1
  58. package/domains/datastores/delete.d.ts +0 -3
  59. package/domains/datastores/delete.d.ts.map +0 -1
  60. package/domains/datastores/delete.js +0 -38
  61. package/domains/datastores/delete.js.map +0 -1
  62. package/domains/datastores/fetch.d.ts +0 -3
  63. package/domains/datastores/fetch.d.ts.map +0 -1
  64. package/domains/datastores/fetch.js +0 -23
  65. package/domains/datastores/fetch.js.map +0 -1
  66. package/domains/datastores/resources.d.ts +0 -5
  67. package/domains/datastores/resources.d.ts.map +0 -1
  68. package/domains/datastores/resources.js +0 -16
  69. package/domains/datastores/resources.js.map +0 -1
  70. package/domains/datastores/tools.d.ts +0 -5
  71. package/domains/datastores/tools.d.ts.map +0 -1
  72. package/domains/datastores/tools.js +0 -46
  73. package/domains/datastores/tools.js.map +0 -1
  74. package/domains/records/calls.d.ts +0 -48
  75. package/domains/records/calls.d.ts.map +0 -1
  76. package/domains/records/calls.js +0 -118
  77. package/domains/records/calls.js.map +0 -1
  78. package/domains/records/errors.d.ts +0 -24
  79. package/domains/records/errors.d.ts.map +0 -1
  80. package/domains/records/errors.js +0 -79
  81. package/domains/records/errors.js.map +0 -1
  82. package/domains/records/tools.d.ts +0 -7
  83. package/domains/records/tools.d.ts.map +0 -1
  84. package/domains/records/tools.js +0 -139
  85. package/domains/records/tools.js.map +0 -1
  86. package/gen/datastore.d.ts +0 -861
  87. package/gen/datastore.d.ts.map +0 -1
  88. package/gen/datastore.js +0 -267
  89. package/gen/datastore.js.map +0 -1
  90. package/src/domains/datastores/apply.ts +0 -33
  91. package/src/domains/datastores/delete.ts +0 -47
  92. package/src/domains/datastores/fetch.ts +0 -32
  93. package/src/domains/datastores/resources.ts +0 -21
  94. package/src/domains/datastores/tools.ts +0 -76
  95. package/src/domains/records/calls.ts +0 -209
  96. package/src/domains/records/errors.ts +0 -98
  97. package/src/domains/records/records.integration.test.ts +0 -313
  98. package/src/domains/records/tools.ts +0 -210
  99. package/src/gen/datastore.ts +0 -264
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/domains/datastores/delete.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,EAAE;AACF,4EAA4E;AAC5E,0CAA0C;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4DAA4D,CAAC;AACxG,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,aAAqB,EACrB,KAAa,EACb,GAAW,EACX,IAAY;IAEZ,MAAM,IAAI,GAAG,cAAc,IAAI,aAAa,GAAG,GAAG,CAAC;IACnD,OAAO,aAAa,CAAC,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE;QAC1E,MAAM,KAAK,GAAG,YAAY,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;QAChE,IAAI,EAAU,CAAC;QACf,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,cAAc,CAC1C,EAAE,GAAG,EAAE,IAAI,EAAE,eAAe,CAAC,SAAS,EAAE,IAAI,EAAE,EAC9C,WAAW,CACZ,CAAC;YACF,EAAE,GAAG,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC;QACpC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;QAED,MAAM,OAAO,GAAG,YAAY,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC;QACpE,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;YACtE,OAAO,WAAW,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,3 +0,0 @@
1
- /** Retrieve a datastore by org and slug, returning its protojson representation. */
2
- export declare function fetchDatastore(serverAddress: string, token: string, org: string, slug: string): Promise<string>;
3
- //# sourceMappingURL=fetch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/domains/datastores/fetch.ts"],"names":[],"mappings":"AAaA,oFAAoF;AACpF,wBAAsB,cAAc,CAClC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAYjB"}
@@ -1,23 +0,0 @@
1
- // Datastore-definition read path: the single RPC both the get_datastore tool
2
- // and the datastore resource template delegate to. This is the *structure*
3
- // surface (collections, constraints, grants); living records are served by the
4
- // record tools (records/), whose agent-facing summary is describe_datastore.
5
- import { DatastoreSchema } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/api_pb";
6
- import { DatastoreQueryController } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/query_pb";
7
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
8
- import { withClient } from "../client.js";
9
- import { toProtoJson } from "../marshal.js";
10
- import { rpcError } from "../rpcerr.js";
11
- /** Retrieve a datastore by org and slug, returning its protojson representation. */
12
- export async function fetchDatastore(serverAddress, token, org, slug) {
13
- return withClient(DatastoreQueryController, serverAddress, token, async (client, callOptions) => {
14
- try {
15
- const datastore = await client.getByReference({ org, kind: ApiResourceKind.datastore, slug }, callOptions);
16
- return toProtoJson(DatastoreSchema, datastore);
17
- }
18
- catch (err) {
19
- throw rpcError(err, `datastore "${slug}" in org "${org}"`);
20
- }
21
- });
22
- }
23
- //# sourceMappingURL=fetch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/domains/datastores/fetch.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,6EAA6E;AAE7E,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,aAAqB,EACrB,KAAa,EACb,GAAW,EACX,IAAY;IAEZ,OAAO,UAAU,CAAC,wBAAwB,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE;QAC9F,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,cAAc,CAC3C,EAAE,GAAG,EAAE,IAAI,EAAE,eAAe,CAAC,SAAS,EAAE,IAAI,EAAE,EAC9C,WAAW,CACZ,CAAC;YACF,OAAO,WAAW,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,QAAQ,CAAC,GAAG,EAAE,cAAc,IAAI,aAAa,GAAG,GAAG,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import type { BackendTarget } from "../client.js";
3
- /** Register the datastore resource template; returns the registered resource names. */
4
- export declare function registerDatastoreResources(server: McpServer, target: BackendTarget): string[];
5
- //# sourceMappingURL=resources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/domains/datastores/resources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,uFAAuF;AACvF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,MAAM,EAAE,CAW7F"}
@@ -1,16 +0,0 @@
1
- // Datastore resource template (stigmer://datastores/{org}/{slug}).
2
- import { registerResource } from "../resourcehandler.js";
3
- import { fetchDatastore } from "./fetch.js";
4
- /** Register the datastore resource template; returns the registered resource names. */
5
- export function registerDatastoreResources(server, target) {
6
- registerResource(server, target, {
7
- name: "stigmer_datastore",
8
- title: "Stigmer Datastore",
9
- description: "Full definition of a Stigmer datastore (collections, constraints, grants), " +
10
- "identified by organization and slug.",
11
- template: "stigmer://datastores/{org}/{slug}",
12
- fetch: fetchDatastore,
13
- });
14
- return ["stigmer_datastore"];
15
- }
16
- //# sourceMappingURL=resources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../src/domains/datastores/resources.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAKnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,uFAAuF;AACvF,MAAM,UAAU,0BAA0B,CAAC,MAAiB,EAAE,MAAqB;IACjF,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE;QAC/B,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,6EAA6E;YAC7E,sCAAsC;QACxC,QAAQ,EAAE,mCAAmC;QAC7C,KAAK,EAAE,cAAc;KACtB,CAAC,CAAC;IACH,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC/B,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { type BackendTarget } from "../client.js";
3
- /** Register every Datastore-domain tool; returns the registered tool names. */
4
- export declare function registerDatastoreTools(server: McpServer, target: BackendTarget): string[];
5
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/domains/datastores/tools.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAMhE,+EAA+E;AAC/E,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,MAAM,EAAE,CA0DzF"}
@@ -1,46 +0,0 @@
1
- // MCP tools for the Datastore *definition* domain — the structure surface
2
- // (collections, fields, constraints, roles, grants). The record tools
3
- // (records/tools.ts) operate on the living data inside these structures;
4
- // before this domain existed, an assistant could insert records into a
5
- // datastore it had no way to create.
6
- import { z } from "zod";
7
- import { DatastoreInputShape } from "../../gen/datastore.js";
8
- import { resolveToken } from "../client.js";
9
- import { textOrError } from "../toolresult.js";
10
- import { applyDatastore } from "./apply.js";
11
- import { deleteDatastore } from "./delete.js";
12
- import { fetchDatastore } from "./fetch.js";
13
- /** Register every Datastore-domain tool; returns the registered tool names. */
14
- export function registerDatastoreTools(server, target) {
15
- server.registerTool("get_datastore", {
16
- description: "Get the full definition of a Stigmer datastore by its org and slug: collections, field " +
17
- "declarations, constraints, roles, and grants. For the record-facing view of the same " +
18
- "structure (allowed verbs, readable fields), use describe_datastore; for the data " +
19
- "itself, use the record tools.",
20
- inputSchema: {
21
- org: z.string().describe("Organization slug that owns the datastore (e.g. stigmer)."),
22
- slug: z
23
- .string()
24
- .describe("Datastore slug — the unique identifier within the org (e.g. clinic-bookings)."),
25
- },
26
- }, (args, extra) => textOrError(() => fetchDatastore(target.serverAddress, resolveToken(extra, target.apiKey), args.org, args.slug)));
27
- server.registerTool("apply_datastore", {
28
- description: "Create or update a Stigmer datastore definition (idempotent). The manifest is " +
29
- "authoritative for structure only — schema changes sync on apply (the server enforces " +
30
- "its additive-plus change rules), and records are never touched; use the record tools " +
31
- "to manage data.",
32
- inputSchema: DatastoreInputShape,
33
- }, (args, extra) => textOrError(() => applyDatastore(target.serverAddress, resolveToken(extra, target.apiKey), args)));
34
- server.registerTool("delete_datastore", {
35
- description: "Delete a Stigmer datastore by its org and slug, destroying its collections and all " +
36
- "records in them. This is irreversible. Returns the deleted datastore definition.",
37
- inputSchema: {
38
- org: z.string().describe("Organization slug that owns the datastore (e.g. stigmer)."),
39
- slug: z
40
- .string()
41
- .describe("Datastore slug — the unique identifier within the org (e.g. clinic-bookings)."),
42
- },
43
- }, (args, extra) => textOrError(() => deleteDatastore(target.serverAddress, resolveToken(extra, target.apiKey), args.org, args.slug)));
44
- return ["get_datastore", "apply_datastore", "delete_datastore"];
45
- }
46
- //# sourceMappingURL=tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/domains/datastores/tools.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,sEAAsE;AACtE,yEAAyE;AACzE,uEAAuE;AACvE,qCAAqC;AAGrC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAsB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,+EAA+E;AAC/E,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,MAAqB;IAC7E,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,WAAW,EACT,yFAAyF;YACzF,uFAAuF;YACvF,mFAAmF;YACnF,+BAA+B;QACjC,WAAW,EAAE;YACX,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;YACrF,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,QAAQ,CAAC,+EAA+E,CAAC;SAC7F;KACF,EACD,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACd,WAAW,CAAC,GAAG,EAAE,CACf,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAC9F,CACJ,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,WAAW,EACT,gFAAgF;YAChF,uFAAuF;YACvF,uFAAuF;YACvF,iBAAiB;QACnB,WAAW,EAAE,mBAAmB;KACjC,EACD,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACd,WAAW,CAAC,GAAG,EAAE,CACf,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAC/E,CACJ,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,WAAW,EACT,qFAAqF;YACrF,kFAAkF;QACpF,WAAW,EAAE;YACX,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;YACrF,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,QAAQ,CAAC,+EAA+E,CAAC;SAC7F;KACF,EACD,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACd,WAAW,CAAC,GAAG,EAAE,CACf,eAAe,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAC/F,CACJ,CAAC;IAEF,OAAO,CAAC,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAClE,CAAC"}
@@ -1,48 +0,0 @@
1
- /**
2
- * A filter condition as the model supplies it. `op` uses the natural
3
- * spelling "in" (the proto enum's `is_in` exists only because `in` is
4
- * reserved in Java/Python — a substrate detail the model never sees).
5
- */
6
- export interface ConditionArg {
7
- field: string;
8
- op: string;
9
- value?: string | number | boolean | null;
10
- values?: (string | number | boolean)[];
11
- }
12
- export interface FindArgs {
13
- datastore: string;
14
- org?: string;
15
- collection: string;
16
- conditions?: ConditionArg[];
17
- order_by?: {
18
- field: string;
19
- direction?: string;
20
- };
21
- limit?: number;
22
- offset?: number;
23
- }
24
- export declare function findRecords(serverAddress: string, token: string, args: FindArgs): Promise<string>;
25
- export declare function insertRecord(serverAddress: string, token: string, args: {
26
- datastore: string;
27
- org?: string;
28
- collection: string;
29
- record: Record<string, unknown>;
30
- }): Promise<string>;
31
- export declare function updateRecord(serverAddress: string, token: string, args: {
32
- datastore: string;
33
- org?: string;
34
- collection: string;
35
- id: string;
36
- fields: Record<string, unknown>;
37
- }): Promise<string>;
38
- export declare function deleteRecord(serverAddress: string, token: string, args: {
39
- datastore: string;
40
- org?: string;
41
- collection: string;
42
- id: string;
43
- }): Promise<string>;
44
- export declare function describeDatastore(serverAddress: string, token: string, args: {
45
- datastore: string;
46
- org?: string;
47
- }): Promise<string>;
48
- //# sourceMappingURL=calls.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../../src/domains/records/calls.ts"],"names":[],"mappings":"AAyCA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAgBD,wBAAsB,WAAW,CAC/B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,MAAM,CAAC,CAajB;AAED,wBAAsB,YAAY,CAChC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC7F,OAAO,CAAC,MAAM,CAAC,CAYjB;AAED,wBAAsB,YAAY,CAChC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,GACA,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED,wBAAsB,YAAY,CAChC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACxE,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC,OAAO,CAAC,MAAM,CAAC,CAQjB"}
@@ -1,118 +0,0 @@
1
- // Record-RPC invocations for the five record tools — 1:1 projections
2
- // of DatastoreRecordQueryController / DatastoreRecordCommandController
3
- // (DD-005: the tool layer adds no semantics; validation, grants,
4
- // scopes, constraints, and messages all live in record-RPC domain
5
- // logic on the control plane).
6
- //
7
- // One file for the five thin calls rather than the resource domains'
8
- // file-per-verb split: resource verbs each carry orchestration
9
- // (reference resolution, YAML parsing, two-step deletes); record calls
10
- // are each "build request, call, marshal" and the shared argument
11
- // mapping (filter/value building) is the only substance.
12
- import { create, fromJson } from "@bufbuild/protobuf";
13
- import { ValueSchema } from "@bufbuild/protobuf/wkt";
14
- import { DatastoreRecordCommandController, } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/record_command_pb";
15
- import { DatastoreRecordQueryController, } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/record_query_pb";
16
- import { DatastoreDescriptionSchema, DeleteRecordRequestSchema, DescribeDatastoreRequestSchema, FindRecordsRequestSchema, InsertRecordRequestSchema, RecordConditionOp, RecordConditionSchema, RecordEnvelopeSchema, RecordFilterSchema, RecordListSchema, RecordOrderBySchema, RecordSortDirection, UpdateRecordRequestSchema, } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/record_io_pb";
17
- import { withClient } from "../client.js";
18
- import { toProtoJson } from "../marshal.js";
19
- /** Model-facing operator spelling → proto enum. */
20
- const CONDITION_OPS = {
21
- eq: RecordConditionOp.eq,
22
- neq: RecordConditionOp.neq,
23
- gt: RecordConditionOp.gt,
24
- gte: RecordConditionOp.gte,
25
- lt: RecordConditionOp.lt,
26
- lte: RecordConditionOp.lte,
27
- in: RecordConditionOp.is_in,
28
- not_in: RecordConditionOp.not_in,
29
- is_null: RecordConditionOp.is_null,
30
- not_null: RecordConditionOp.not_null,
31
- };
32
- export async function findRecords(serverAddress, token, args) {
33
- const request = create(FindRecordsRequestSchema, {
34
- datastore: args.datastore,
35
- org: args.org ?? "",
36
- collection: args.collection,
37
- filter: buildFilter(args.conditions),
38
- orderBy: buildOrderBy(args.order_by),
39
- limit: args.limit ?? 0,
40
- offset: args.offset ?? 0,
41
- });
42
- return withClient(DatastoreRecordQueryController, serverAddress, token, async (client, opts) => toProtoJson(RecordListSchema, await client.findRecords(request, opts)));
43
- }
44
- export async function insertRecord(serverAddress, token, args) {
45
- const request = create(InsertRecordRequestSchema, {
46
- datastore: args.datastore,
47
- org: args.org ?? "",
48
- collection: args.collection,
49
- // google.protobuf.Struct fields are plain JSON objects in
50
- // protobuf-es v2 — no conversion.
51
- record: args.record,
52
- });
53
- return withClient(DatastoreRecordCommandController, serverAddress, token, async (client, opts) => toProtoJson(RecordEnvelopeSchema, await client.insertRecord(request, opts)));
54
- }
55
- export async function updateRecord(serverAddress, token, args) {
56
- const request = create(UpdateRecordRequestSchema, {
57
- datastore: args.datastore,
58
- org: args.org ?? "",
59
- collection: args.collection,
60
- id: args.id,
61
- fields: args.fields,
62
- });
63
- return withClient(DatastoreRecordCommandController, serverAddress, token, async (client, opts) => toProtoJson(RecordEnvelopeSchema, await client.updateRecord(request, opts)));
64
- }
65
- export async function deleteRecord(serverAddress, token, args) {
66
- const request = create(DeleteRecordRequestSchema, {
67
- datastore: args.datastore,
68
- org: args.org ?? "",
69
- collection: args.collection,
70
- id: args.id,
71
- });
72
- return withClient(DatastoreRecordCommandController, serverAddress, token, async (client, opts) => toProtoJson(RecordEnvelopeSchema, await client.deleteRecord(request, opts)));
73
- }
74
- export async function describeDatastore(serverAddress, token, args) {
75
- const request = create(DescribeDatastoreRequestSchema, {
76
- datastore: args.datastore,
77
- org: args.org ?? "",
78
- });
79
- return withClient(DatastoreRecordQueryController, serverAddress, token, async (client, opts) => toProtoJson(DatastoreDescriptionSchema, await client.describeDatastore(request, opts)));
80
- }
81
- /**
82
- * Build the typed AND-only filter (DD-005 SD-2). An unknown operator is
83
- * left unspecified for the server to reject with its own domain
84
- * message — the bridge never fabricates validation of its own.
85
- */
86
- function buildFilter(conditions) {
87
- if (conditions === undefined || conditions.length === 0) {
88
- return undefined;
89
- }
90
- return create(RecordFilterSchema, {
91
- conditions: conditions.map(buildCondition),
92
- });
93
- }
94
- function buildCondition(arg) {
95
- return create(RecordConditionSchema, {
96
- field: arg.field,
97
- op: CONDITION_OPS[arg.op] ?? RecordConditionOp.record_condition_op_unspecified,
98
- value: arg.value !== undefined ? scalarValue(arg.value) : undefined,
99
- values: (arg.values ?? []).map(scalarValue),
100
- });
101
- }
102
- function buildOrderBy(orderBy) {
103
- if (orderBy === undefined) {
104
- return undefined;
105
- }
106
- return create(RecordOrderBySchema, {
107
- field: orderBy.field,
108
- direction: orderBy.direction === "desc"
109
- ? RecordSortDirection.desc
110
- : orderBy.direction === "asc"
111
- ? RecordSortDirection.asc
112
- : RecordSortDirection.record_sort_direction_unspecified,
113
- });
114
- }
115
- function scalarValue(v) {
116
- return fromJson(ValueSchema, v);
117
- }
118
- //# sourceMappingURL=calls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calls.js","sourceRoot":"","sources":["../../../src/domains/records/calls.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,uEAAuE;AACvE,iEAAiE;AACjE,kEAAkE;AAClE,+BAA+B;AAC/B,EAAE;AACF,qEAAqE;AACrE,+DAA+D;AAC/D,uEAAuE;AACvE,kEAAkE;AAClE,yDAAyD;AAEzD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAmB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAc,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,gCAAgC,GACjC,MAAM,mEAAmE,CAAC;AAC3E,OAAO,EACL,8BAA8B,GAC/B,MAAM,iEAAiE,CAAC;AACzE,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,GAI1B,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC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,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;QACnE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CACnB,OAA0D;IAE1D,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,mBAAmB,EAAE;QACjC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS,KAAK,MAAM;YACrC,CAAC,CAAC,mBAAmB,CAAC,IAAI;YAC1B,CAAC,CAAC,OAAO,CAAC,SAAS,KAAK,KAAK;gBAC3B,CAAC,CAAC,mBAAmB,CAAC,GAAG;gBACzB,CAAC,CAAC,mBAAmB,CAAC,iCAAiC;KAC5D,CAAC,CAAC;AACL,CAAC;AAED,SAAS,WAAW,CAAC,CAAmC;IACtD,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAClC,CAAC"}
@@ -1,24 +0,0 @@
1
- import { ConnectError } from "@connectrpc/connect";
2
- import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
- /** The structured error payload record tools return for domain errors. */
4
- export interface RecordToolError {
5
- /** The server's relayable message, byte-for-byte. */
6
- error: string;
7
- /** gRPC status name in SCREAMING_SNAKE (e.g. ALREADY_EXISTS). */
8
- code: string;
9
- /** ErrorInfo reason (e.g. CONSTRAINT_VIOLATION), when present. */
10
- reason?: string;
11
- /** Violated constraint name from ErrorInfo metadata, when present. */
12
- constraint?: string;
13
- }
14
- /**
15
- * Run a record-tool body: a string payload becomes a text result; a
16
- * domain error becomes an isError JSON result carrying the verbatim
17
- * message + ErrorInfo companions; a transport error delegates to the
18
- * shared classifier. The records analog of ../toolresult.ts
19
- * textOrError, and the only try/catch in this domain.
20
- */
21
- export declare function recordResult(toolContext: string, produce: () => Promise<string>): Promise<CallToolResult>;
22
- /** Project a domain ConnectError into the structured tool payload. */
23
- export declare function domainError(ce: ConnectError): RecordToolError;
24
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/domains/records/errors.ts"],"names":[],"mappings":"AAeA,OAAO,EAAQ,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAkBzE,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAC7B,OAAO,CAAC,cAAc,CAAC,CAazB;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,GAAG,eAAe,CAoB7D"}
@@ -1,79 +0,0 @@
1
- // The records-domain error mapper (DD-005 SD-6) — a deliberate,
2
- // documented divergence from the shared ../rpcerr.ts.
3
- //
4
- // Record-RPC domain errors carry agent-relayable messages that are
5
- // cross-edition contract bytes (DD-002 SD-5): "that slot is already
6
- // booked", "you are not allowed to insert records in bookings". The
7
- // shared helper would rewrite them ("Check your API key permissions")
8
- // and discards google.rpc.ErrorInfo. Here the domain codes pass the
9
- // server's message through VERBATIM as isError JSON text
10
- // `{error, code, reason, constraint}` — reason/constraint extracted
11
- // from ErrorInfo — so the model can self-correct (retry another slot
12
- // on CONSTRAINT_VIOLATION; stop and relay on PERMISSION_DENIED).
13
- // Transport codes still delegate to the shared helper, whose advice is
14
- // right for them.
15
- import { Code, ConnectError } from "@connectrpc/connect";
16
- import { ErrorInfoSchema } from "@stigmer/protos/google/rpc/error_details_pb";
17
- import { rpcError } from "../rpcerr.js";
18
- import { errorResult, textResult } from "../toolresult.js";
19
- /**
20
- * The gRPC codes whose messages are the record-RPC domain contract
21
- * (DD-005 SD-6): declared constraint messages, fixed denial texts, and
22
- * domain validation — all written to be relayed to end users verbatim.
23
- */
24
- const DOMAIN_CODES = new Set([
25
- Code.PermissionDenied,
26
- Code.AlreadyExists,
27
- Code.FailedPrecondition,
28
- Code.InvalidArgument,
29
- Code.NotFound,
30
- ]);
31
- /**
32
- * Run a record-tool body: a string payload becomes a text result; a
33
- * domain error becomes an isError JSON result carrying the verbatim
34
- * message + ErrorInfo companions; a transport error delegates to the
35
- * shared classifier. The records analog of ../toolresult.ts
36
- * textOrError, and the only try/catch in this domain.
37
- */
38
- export async function recordResult(toolContext, produce) {
39
- try {
40
- return textResult(await produce());
41
- }
42
- catch (err) {
43
- const ce = ConnectError.from(err);
44
- if (DOMAIN_CODES.has(ce.code)) {
45
- return {
46
- content: [{ type: "text", text: JSON.stringify(domainError(ce)) }],
47
- isError: true,
48
- };
49
- }
50
- return errorResult(rpcError(ce, toolContext));
51
- }
52
- }
53
- /** Project a domain ConnectError into the structured tool payload. */
54
- export function domainError(ce) {
55
- const payload = {
56
- error: ce.rawMessage,
57
- code: grpcStatusName(ce.code),
58
- };
59
- // The record RPCs attach one google.rpc.ErrorInfo per domain error
60
- // (domain datastore.stigmer.ai); absence means an older server — the
61
- // message alone still carries the contract.
62
- const details = ce.findDetails(ErrorInfoSchema);
63
- if (details.length > 0) {
64
- const info = details[0];
65
- if (info.reason !== "") {
66
- payload.reason = info.reason;
67
- }
68
- const constraint = info.metadata["constraint"];
69
- if (constraint !== undefined && constraint !== "") {
70
- payload.constraint = constraint;
71
- }
72
- }
73
- return payload;
74
- }
75
- /** Connect's PascalCase code name → the gRPC SCREAMING_SNAKE status name. */
76
- function grpcStatusName(code) {
77
- return Code[code].replace(/([a-z0-9])([A-Z])/g, "$1_$2").toUpperCase();
78
- }
79
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/domains/records/errors.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,sDAAsD;AACtD,EAAE;AACF,mEAAmE;AACnE,oEAAoE;AACpE,oEAAoE;AACpE,sEAAsE;AACtE,oEAAoE;AACpE,yDAAyD;AACzD,oEAAoE;AACpE,qEAAqE;AACrE,iEAAiE;AACjE,uEAAuE;AACvE,kBAAkB;AAElB,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,YAAY,GAAsB,IAAI,GAAG,CAAC;IAC9C,IAAI,CAAC,gBAAgB;IACrB,IAAI,CAAC,aAAa;IAClB,IAAI,CAAC,kBAAkB;IACvB,IAAI,CAAC,eAAe;IACpB,IAAI,CAAC,QAAQ;CACd,CAAC,CAAC;AAcH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,WAAmB,EACnB,OAA8B;IAE9B,IAAI,CAAC;QACH,OAAO,UAAU,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,OAAO;gBACL,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ocol/sdk/server/mcp.js";
2
- import { type BackendTarget } from "../client.js";
3
- /** Which roster the tools are being registered on (see file header). */
4
- export type RecordToolAudience = "agent" | "direct";
5
- /** Register the five record tools for one audience; returns the tool names. */
6
- export declare function registerRecordTools(server: McpServer, target: BackendTarget, audience: RecordToolAudience): string[];
7
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/domains/records/tools.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAWhE,wEAAwE;AACxE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAyBpD,+EAA+E;AAC/E,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,kBAAkB,GAC3B,MAAM,EAAE,CA8IV"}
@@ -1,139 +0,0 @@
1
- // MCP tools for the Datastore record domain — the five agent-facing
2
- // record tools of DD-005: 1:1 projections of the record RPCs, with the
3
- // records-own error mapper (errors.ts) and honest MCP annotations (the
4
- // bridge's first use of annotations; the platform's own connect-time
5
- // classifier honors destructiveHint fail-closed for external clients,
6
- // while the runner-synthesized attachment is approval-free by
7
- // construction and never passes through that classifier).
8
- //
9
- // Two audiences, one definition (registered per roster):
10
- // - "agent" (the records-only roster the runner-synthesized
11
- // attachment connects to): NO `org` argument — a session-bound
12
- // caller's org is server-derived from the session, and an explicit
13
- // org is rejected (T05 R3), so offering the argument would only
14
- // invite rejected calls.
15
- // - "direct" (the main roster external MCP clients see): optional
16
- // `org`, which cloud direct principals must name (their credential
17
- // carries no ambient org — the DD-006 session-14 amendment). OSS
18
- // resolves an empty org to the local system org.
19
- // `partition` is deliberately NOT a tool argument for either audience
20
- // (DD-010: never from tool arguments); partition-explicit work is the
21
- // console/CLI/SDK surface.
22
- import { z } from "zod";
23
- import { resolveToken } from "../client.js";
24
- import { deleteRecord, describeDatastore, findRecords, insertRecord, updateRecord, } from "./calls.js";
25
- import { recordResult } from "./errors.js";
26
- const ENCODINGS = "Field value encodings: date YYYY-MM-DD, time HH:MM[:SS], timestamp RFC 3339 UTC " +
27
- "(e.g. 2026-07-21T04:30:00Z).";
28
- const scalar = z.union([z.string(), z.number(), z.boolean()]);
29
- const conditionShape = z.object({
30
- field: z
31
- .string()
32
- .describe("Declared field name, or a filterable system field (id, created_at, updated_at)."),
33
- op: z
34
- .enum(["eq", "neq", "gt", "gte", "lt", "lte", "in", "not_in", "is_null", "not_null"])
35
- .describe("Comparison operator. eq/neq/in/not_in for string and enum fields; " +
36
- "gt/gte/lt/lte for numeric and temporal fields; is_null/not_null for optional fields."),
37
- value: scalar
38
- .nullable()
39
- .optional()
40
- .describe("Comparison value for scalar operators, in the field's canonical encoding."),
41
- values: z.array(scalar).optional().describe("Comparison values for in / not_in."),
42
- });
43
- /** Register the five record tools for one audience; returns the tool names. */
44
- export function registerRecordTools(server, target, audience) {
45
- // The org argument exists only on the direct roster (file header).
46
- const orgShape = {};
47
- if (audience === "direct") {
48
- orgShape.org = z
49
- .string()
50
- .optional()
51
- .describe("Organization that owns the datastore. Required on Stigmer Cloud; " +
52
- "omit against a local backend.");
53
- }
54
- server.registerTool("describe_datastore", {
55
- description: "Describe a datastore: its collections, field declarations and encodings, constraint " +
56
- "messages, data partitions, and the verbs you are allowed to use per collection " +
57
- "(empty access means you are not allowed to touch that collection). A read verb may " +
58
- "carry readable_fields: reads then return only those fields, and only they may appear " +
59
- "in filter conditions and order_by (empty readable_fields means every field). Call " +
60
- `this before the first record operation against an unfamiliar datastore. ${ENCODINGS}`,
61
- inputSchema: {
62
- datastore: z.string().describe("Datastore slug (e.g. clinic)."),
63
- ...orgShape,
64
- },
65
- annotations: { readOnlyHint: true },
66
- }, (args, extra) => recordResult(`datastore "${args.datastore}"`, () => describeDatastore(target.serverAddress, resolveToken(extra, target.apiKey), args)));
67
- server.registerTool("find_records", {
68
- description: "Find records in a datastore collection with a typed filter (conditions are AND-combined). " +
69
- "Returns records plus total/limit/offset for paging. Results are ordered by created_at " +
70
- "descending unless order_by is given. Records carry only the fields your grant allows " +
71
- "(describe_datastore lists them as readable_fields); conditions and order_by on other " +
72
- `fields are rejected. ${ENCODINGS}`,
73
- inputSchema: {
74
- datastore: z.string().describe("Datastore slug (e.g. clinic)."),
75
- ...orgShape,
76
- collection: z.string().describe("Collection to query (e.g. bookings)."),
77
- conditions: z
78
- .array(conditionShape)
79
- .optional()
80
- .describe("Filter conditions, AND-combined. Omit to list all readable records."),
81
- order_by: z
82
- .object({
83
- field: z.string().describe("Field to sort by."),
84
- direction: z.enum(["asc", "desc"]).optional().describe("Sort direction (default asc)."),
85
- })
86
- .optional()
87
- .describe("Sort order. Omit for created_at descending with id tiebreak."),
88
- limit: z.number().int().optional().describe("Page size (default 25, max 100)."),
89
- offset: z.number().int().optional().describe("Records to skip for paging."),
90
- },
91
- annotations: { readOnlyHint: true },
92
- }, (args, extra) => recordResult(`records in "${args.datastore}/${args.collection}"`, () => findRecords(target.serverAddress, resolveToken(extra, target.apiKey), {
93
- ...args,
94
- conditions: args.conditions,
95
- })));
96
- server.registerTool("insert_record", {
97
- description: "Insert one record into a datastore collection. System fields (id, created_at, " +
98
- "updated_at, created_by) are server-stamped — never include them. Declared constraints " +
99
- "are enforced by the store; a violation returns the constraint's message verbatim " +
100
- "(e.g. a taken slot returns ALREADY_EXISTS — pick another, do not retry the same one). " +
101
- `When uncertain whether a record already exists, find first. ${ENCODINGS}`,
102
- inputSchema: {
103
- datastore: z.string().describe("Datastore slug (e.g. clinic)."),
104
- ...orgShape,
105
- collection: z.string().describe("Collection to insert into (e.g. bookings)."),
106
- record: z
107
- .record(z.unknown())
108
- .describe("Declared fields for the new record, in canonical encodings."),
109
- },
110
- }, (args, extra) => recordResult(`record in "${args.datastore}/${args.collection}"`, () => insertRecord(target.serverAddress, resolveToken(extra, target.apiKey), args)));
111
- server.registerTool("update_record", {
112
- description: "Update one record by id with a partial merge: only the supplied fields change, and an " +
113
- "explicit null clears a field. Constraints are re-evaluated on the merged result. " +
114
- `Returns the full updated record. ${ENCODINGS}`,
115
- inputSchema: {
116
- datastore: z.string().describe("Datastore slug (e.g. clinic)."),
117
- ...orgShape,
118
- collection: z.string().describe("Collection holding the record."),
119
- id: z.string().describe("Record id (from a previous find or insert)."),
120
- fields: z
121
- .record(z.unknown())
122
- .describe("Fields to merge. Explicit null clears a field; omitted fields keep their values."),
123
- },
124
- annotations: { idempotentHint: true },
125
- }, (args, extra) => recordResult(`record "${args.id}" in "${args.datastore}/${args.collection}"`, () => updateRecord(target.serverAddress, resolveToken(extra, target.apiKey), args)));
126
- server.registerTool("delete_record", {
127
- description: "Delete one record by id. Returns the deleted record. Record tools never delete " +
128
- "collections or datastores.",
129
- inputSchema: {
130
- datastore: z.string().describe("Datastore slug (e.g. clinic)."),
131
- ...orgShape,
132
- collection: z.string().describe("Collection holding the record."),
133
- id: z.string().describe("Record id (from a previous find or insert)."),
134
- },
135
- annotations: { destructiveHint: true, idempotentHint: true },
136
- }, (args, extra) => recordResult(`record "${args.id}" in "${args.datastore}/${args.collection}"`, () => deleteRecord(target.serverAddress, resolveToken(extra, target.apiKey), args)));
137
- return ["describe_datastore", "find_records", "insert_record", "update_record", "delete_record"];
138
- }
139
- //# sourceMappingURL=tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/domains/records/tools.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,uEAAuE;AACvE,uEAAuE;AACvE,qEAAqE;AACrE,sEAAsE;AACtE,8DAA8D;AAC9D,0DAA0D;AAC1D,EAAE;AACF,yDAAyD;AACzD,8DAA8D;AAC9D,mEAAmE;AACnE,uEAAuE;AACvE,oEAAoE;AACpE,6BAA6B;AAC7B,oEAAoE;AACpE,uEAAuE;AACvE,qEAAq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