@thingd/cli 0.41.3 → 0.42.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/dashboard/server.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/dashboard/server.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAqErD,wBAAsB,oBAAoB,CACxC,iBAAiB,EAAE,iBAAiB,EACpC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,MAAM,EAAE,OAAO,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CA6b7E"}
|
package/dist/dashboard/server.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createRequire } from "node:module";
|
|
|
4
4
|
import { dirname, extname, join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { handleRestRequest, ThingD } from "@thingd/sdk";
|
|
7
|
+
import { readCloudConfig } from "../lib/cloud-config.js";
|
|
7
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
9
|
const __dirname = dirname(__filename);
|
|
9
10
|
const _require = createRequire(__filename);
|
|
@@ -118,20 +119,22 @@ export async function startDashboardServer(connectionOptions, port) {
|
|
|
118
119
|
sendError(res, 400, "Fields 'path' and 'driver' are required.");
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
122
|
+
const cloudMode = isCloudPath(path);
|
|
123
|
+
const resolvedToken = authToken || (cloudMode ? readCloudConfig()?.token : undefined);
|
|
121
124
|
// Safely shut down the old db instance
|
|
122
125
|
await db.close();
|
|
123
126
|
// Spawn new db connection dynamically
|
|
124
127
|
db = await ThingD.open({
|
|
125
128
|
path,
|
|
126
|
-
url:
|
|
129
|
+
url: cloudMode ? path : undefined,
|
|
127
130
|
driver,
|
|
128
|
-
authToken,
|
|
131
|
+
authToken: resolvedToken,
|
|
129
132
|
});
|
|
130
133
|
activeOptions = {
|
|
131
134
|
path,
|
|
132
135
|
driver,
|
|
133
|
-
authToken,
|
|
134
|
-
cloud:
|
|
136
|
+
authToken: resolvedToken,
|
|
137
|
+
cloud: cloudMode,
|
|
135
138
|
};
|
|
136
139
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
137
140
|
res.end(JSON.stringify({ success: true, path, driver }));
|
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,EASL,MAAM,EACN,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAQA,OAAO,EASL,MAAM,EACN,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAQrB,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,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,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,C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,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrF;AAyFD,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,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 { ThingD, } from "@thingd/sdk";
|
|
9
9
|
import pc from "picocolors";
|
|
10
10
|
import { runInteractiveCli } from "./interactive.js";
|
|
11
|
+
import { readCloudConfig } from "./lib/cloud-config.js";
|
|
11
12
|
import { logoLine } from "./logo.js";
|
|
12
13
|
import { runMcp } from "./mcp.js";
|
|
13
14
|
import { defaultThingdDbPath, ensureThingdDir } from "./paths.js";
|
|
@@ -849,10 +850,13 @@ export function resolveConnection(context) {
|
|
|
849
850
|
if (!cloud && path === defaultThingdDbPath()) {
|
|
850
851
|
ensureThingdDir();
|
|
851
852
|
}
|
|
853
|
+
// Fall back to saved cloud config when no explicit URL/token is provided
|
|
854
|
+
const cloudCfg = cloud && !url ? readCloudConfig() : null;
|
|
855
|
+
const resolvedAuthToken = stringFlag(context.parsed, "auth-token") ?? context.env.THINGD_AUTH_TOKEN ?? cloudCfg?.token;
|
|
852
856
|
return {
|
|
853
|
-
path,
|
|
857
|
+
path: cloudCfg?.url && !url ? cloudCfg.url : path,
|
|
854
858
|
driver,
|
|
855
|
-
authToken:
|
|
859
|
+
authToken: resolvedAuthToken,
|
|
856
860
|
cloud,
|
|
857
861
|
};
|
|
858
862
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AA6wDA,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAkCvD"}
|
package/dist/interactive.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as path from "node:path";
|
|
|
6
6
|
import readline from "node:readline";
|
|
7
7
|
import { ThingD } from "@thingd/sdk";
|
|
8
8
|
import pc from "picocolors";
|
|
9
|
+
import { readCloudConfig } from "./lib/cloud-config.js";
|
|
9
10
|
import { logoText } from "./logo.js";
|
|
10
11
|
// ── Helpers ──────────────────────────────────────────────────────────
|
|
11
12
|
function highlightJson(val) {
|
|
@@ -1531,11 +1532,21 @@ async function handleConnect(node) {
|
|
|
1531
1532
|
}
|
|
1532
1533
|
const selectedDriver = node.ref.driver;
|
|
1533
1534
|
if (selectedDriver === "native" || selectedDriver === "cloud") {
|
|
1535
|
+
const cloudCfg = selectedDriver === "cloud" ? readCloudConfig() : null;
|
|
1534
1536
|
openForm(`Connect to ${selectedDriver}`, [
|
|
1535
1537
|
...(selectedDriver === "cloud"
|
|
1536
1538
|
? [
|
|
1537
|
-
{
|
|
1538
|
-
|
|
1539
|
+
{
|
|
1540
|
+
id: "url",
|
|
1541
|
+
label: "Cloud URL",
|
|
1542
|
+
value: cloudCfg?.url ?? "http://localhost:3000",
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
id: "token",
|
|
1546
|
+
label: "Bearer Token (optional)",
|
|
1547
|
+
isSecret: true,
|
|
1548
|
+
value: cloudCfg?.token ?? "",
|
|
1549
|
+
},
|
|
1539
1550
|
]
|
|
1540
1551
|
: [
|
|
1541
1552
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thingd/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
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.
|
|
48
|
+
"@thingd/sdk": "0.42.0"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=24.0.0"
|