@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.
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +25 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/mcp/tools.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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 () =>
|
|
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
|
-
|
|
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
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thingd/sdk",
|
|
3
|
-
"version": "0.93.
|
|
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.
|
|
74
|
+
"@thingd/native": "^0.93.7"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "tsc -p tsconfig.json",
|