@thingd/cli 0.52.7 → 0.52.8
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/index.d.ts.map +1 -1
- package/dist/index.js +11 -3
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAQA,OAAO,EAUL,MAAM,EACN,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAQA,OAAO,EAUL,MAAM,EACN,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AASrB,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEjD,KAAK,YAAY,GAAG;IAClB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,KAAK,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AAE1C,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7B,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,YAAY,C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IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAEpF;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAElE"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/
|
|
|
8
8
|
import { SDK_VERSION, ThingD, } from "@thingd/sdk";
|
|
9
9
|
import pc from "picocolors";
|
|
10
10
|
import { runInteractiveCli } from "./interactive.js";
|
|
11
|
+
import { deriveRestUrl } from "./lib/cloud-api.js";
|
|
11
12
|
import { readCloudConfig, resolveCloudUrl } from "./lib/cloud-config.js";
|
|
12
13
|
import { logoLine } from "./logo.js";
|
|
13
14
|
import { runMcp } from "./mcp.js";
|
|
@@ -936,7 +937,7 @@ function buildMemoryEvent(parsed, type) {
|
|
|
936
937
|
export function resolveConnection(context) {
|
|
937
938
|
const url = stringFlag(context.parsed, "url") ?? context.env.THINGD_URL;
|
|
938
939
|
const path = url ?? stringFlag(context.parsed, "path") ?? context.env.THINGD_PATH ?? defaultThingdDbPath();
|
|
939
|
-
|
|
940
|
+
let cloud = isCloudPath(path);
|
|
940
941
|
let driver = parseDriver(stringFlag(context.parsed, "driver") ?? context.env.THINGD_DRIVER);
|
|
941
942
|
if (!driver) {
|
|
942
943
|
if (cloud) {
|
|
@@ -949,16 +950,23 @@ export function resolveConnection(context) {
|
|
|
949
950
|
driver = "memory";
|
|
950
951
|
}
|
|
951
952
|
}
|
|
953
|
+
if (driver === "cloud") {
|
|
954
|
+
cloud = true;
|
|
955
|
+
}
|
|
952
956
|
if (!cloud && path === defaultThingdDbPath()) {
|
|
953
957
|
ensureThingdDir();
|
|
954
958
|
}
|
|
955
959
|
// Fall back to saved cloud config when no explicit URL/token is provided
|
|
956
960
|
const cloudCfg = cloud && !url ? readCloudConfig() : null;
|
|
957
|
-
const resolvedAuthToken = stringFlag(context.parsed, "auth-token") ??
|
|
961
|
+
const resolvedAuthToken = stringFlag(context.parsed, "auth-token") ??
|
|
962
|
+
context.env.THINGD_AUTH_TOKEN ??
|
|
963
|
+
cloudCfg?.apiKey ??
|
|
964
|
+
cloudCfg?.token;
|
|
958
965
|
// Prefer instanceUrl (resolved MCP endpoint) over raw cloudCfg.url (API base)
|
|
959
966
|
const resolvedCloudUrl = cloudCfg ? resolveCloudUrl(cloudCfg) : undefined;
|
|
967
|
+
const effectiveCloudUrl = resolvedCloudUrl && driver === "cloud" ? deriveRestUrl(resolvedCloudUrl) : resolvedCloudUrl;
|
|
960
968
|
return {
|
|
961
|
-
path:
|
|
969
|
+
path: effectiveCloudUrl && !url ? effectiveCloudUrl : path,
|
|
962
970
|
driver,
|
|
963
971
|
authToken: resolvedAuthToken,
|
|
964
972
|
cloud,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thingd/cli",
|
|
3
|
-
"version": "0.52.
|
|
3
|
+
"version": "0.52.8",
|
|
4
4
|
"description": "CLI, Interactive TUI Dashboard, and MCP server for thingd — a fast object-first data engine for applications and AI agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://engine.thingd.cloud",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"cli-table3": "^0.6.5",
|
|
46
46
|
"picocolors": "^1.1.1",
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@thingd/sdk": "0.52.
|
|
48
|
+
"@thingd/sdk": "0.52.8"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=24.0.0"
|