@thingd/sdk 0.93.6 → 0.93.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAW7D,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,CAAC,EAAE,qBAAqB,GAAG,KAAK,CAAC;IACtC,SAAS,CAAC,EAAE,yBAAyB,CAAC;CACvC,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,0BAA+B,GACvC,IAAI,CA05CN"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAW7D,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,CAAC,EAAE,qBAAqB,GAAG,KAAK,CAAC;IACtC,SAAS,CAAC,EAAE,yBAAyB,CAAC;CACvC,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,0BAA+B,GACvC,IAAI,CAg7CN"}
package/dist/mcp/tools.js CHANGED
@@ -40,12 +40,21 @@ export function registerThingdTools(server, db, options = {}) {
40
40
  openWorldHint: false,
41
41
  },
42
42
  }, async ({ query, collections, limit, filter }) => {
43
- if (collections) {
44
- for (const c of collections) {
45
- assertCollectionAllowed(c);
43
+ let effectiveCollections = collections;
44
+ if (allowlist) {
45
+ if (allowlist.size === 0) {
46
+ return jsonResult([]);
47
+ }
48
+ if (collections && collections.length > 0) {
49
+ for (const c of collections) {
50
+ assertCollectionAllowed(c);
51
+ }
52
+ }
53
+ else {
54
+ effectiveCollections = [...allowlist];
46
55
  }
47
56
  }
48
- return jsonResult(await db.search(query, { collections, limit, filter }));
57
+ return jsonResult(await db.search(query, { collections: effectiveCollections, limit, filter }));
49
58
  });
50
59
  server.registerTool("thing_get", {
51
60
  title: "Get Object",
@@ -496,7 +505,10 @@ export function registerThingdTools(server, db, options = {}) {
496
505
  idempotentHint: true,
497
506
  openWorldHint: false,
498
507
  },
499
- }, async () => jsonResult(await db.listCollections()));
508
+ }, async () => {
509
+ const collections = await db.listCollections();
510
+ return jsonResult(allowlist ? collections.filter((name) => allowlist.has(name)) : collections);
511
+ });
500
512
  server.registerTool("thing_list_streams", {
501
513
  title: "List Streams",
502
514
  description: "List all event stream names in the store. Returns an array of stream name strings. Use this to discover available event streams before listing or appending events.",
@@ -843,7 +855,11 @@ export function registerThingdTools(server, db, options = {}) {
843
855
  if (collection) {
844
856
  assertCollectionAllowed(collection);
845
857
  }
846
- return jsonResult(await db.schema(collection));
858
+ const schemas = await db.schema(collection);
859
+ if (allowlist) {
860
+ return jsonResult(schemas.filter((entry) => allowlist.has(entry.name)));
861
+ }
862
+ return jsonResult(schemas);
847
863
  });
848
864
  server.registerTool("thing_schema_validate", {
849
865
  title: "Validate Schema File",
@@ -883,6 +899,9 @@ export function registerThingdTools(server, db, options = {}) {
883
899
  openWorldHint: false,
884
900
  },
885
901
  }, async ({ question, collection }) => {
902
+ if (allowlist) {
903
+ throw new Error("NLQ is unavailable when an MCP collection allowlist is configured.");
904
+ }
886
905
  return jsonResult(await db.nlq.query(question, { collection }));
887
906
  });
888
907
  // ── Scheduler tools ──
package/dist/version.d.ts CHANGED
@@ -2,5 +2,5 @@
2
2
  * The published version of the thingd SDK.
3
3
  * Updated automatically by Release Please during the release PR process.
4
4
  */
5
- export declare const SDK_VERSION = "0.93.6";
5
+ export declare const SDK_VERSION = "0.93.7";
6
6
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * The published version of the thingd SDK.
3
3
  * Updated automatically by Release Please during the release PR process.
4
4
  */
5
- export const SDK_VERSION = "0.93.6"; // x-release-please-version
5
+ export const SDK_VERSION = "0.93.7"; // x-release-please-version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thingd/sdk",
3
- "version": "0.93.6",
3
+ "version": "0.93.7",
4
4
  "description": "A fast object-first data engine for applications and AI agents.",
5
5
  "type": "module",
6
6
  "author": "Sayan Mohsin",
@@ -71,7 +71,7 @@
71
71
  "zod": "^4.6.7"
72
72
  },
73
73
  "optionalDependencies": {
74
- "@thingd/native": "^0.93.6"
74
+ "@thingd/native": "^0.93.7"
75
75
  },
76
76
  "scripts": {
77
77
  "build": "tsc -p tsconfig.json",