@thingd/cli 0.70.0 → 0.72.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 (62) hide show
  1. package/package.json +2 -2
  2. package/dist/commands/cloud.d.ts +0 -3
  3. package/dist/commands/cloud.d.ts.map +0 -1
  4. package/dist/commands/cloud.js +0 -648
  5. package/dist/commands/mcp-connect.d.ts +0 -3
  6. package/dist/commands/mcp-connect.d.ts.map +0 -1
  7. package/dist/commands/mcp-connect.js +0 -154
  8. package/dist/dashboard/public/assets/favicon-CgGFvG_0.svg +0 -4
  9. package/dist/dashboard/public/assets/index-C6PkDB7y.css +0 -1
  10. package/dist/dashboard/public/assets/index-CsLTLPTP.js +0 -4
  11. package/dist/dashboard/public/index.html +0 -19
  12. package/dist/dashboard/server.d.ts +0 -6
  13. package/dist/dashboard/server.d.ts.map +0 -1
  14. package/dist/dashboard/server.js +0 -663
  15. package/dist/data-movement.d.ts +0 -6
  16. package/dist/data-movement.d.ts.map +0 -1
  17. package/dist/data-movement.js +0 -475
  18. package/dist/doctor.d.ts +0 -3
  19. package/dist/doctor.d.ts.map +0 -1
  20. package/dist/doctor.js +0 -108
  21. package/dist/index.d.ts +0 -47
  22. package/dist/index.d.ts.map +0 -1
  23. package/dist/index.js +0 -1221
  24. package/dist/install.d.ts +0 -3
  25. package/dist/install.d.ts.map +0 -1
  26. package/dist/install.js +0 -229
  27. package/dist/interactive.d.ts +0 -2
  28. package/dist/interactive.d.ts.map +0 -1
  29. package/dist/interactive.js +0 -3036
  30. package/dist/lib/cloud-api.d.ts +0 -143
  31. package/dist/lib/cloud-api.d.ts.map +0 -1
  32. package/dist/lib/cloud-api.js +0 -207
  33. package/dist/lib/cloud-config.d.ts +0 -33
  34. package/dist/lib/cloud-config.d.ts.map +0 -1
  35. package/dist/lib/cloud-config.js +0 -42
  36. package/dist/lib/mcp-config-writer.d.ts +0 -26
  37. package/dist/lib/mcp-config-writer.d.ts.map +0 -1
  38. package/dist/lib/mcp-config-writer.js +0 -86
  39. package/dist/logo.d.ts +0 -3
  40. package/dist/logo.d.ts.map +0 -1
  41. package/dist/logo.js +0 -8
  42. package/dist/mcp/cluster.d.ts +0 -69
  43. package/dist/mcp/cluster.d.ts.map +0 -1
  44. package/dist/mcp/cluster.js +0 -304
  45. package/dist/mcp/config.d.ts +0 -14
  46. package/dist/mcp/config.d.ts.map +0 -1
  47. package/dist/mcp/config.js +0 -67
  48. package/dist/mcp/http.d.ts +0 -25
  49. package/dist/mcp/http.d.ts.map +0 -1
  50. package/dist/mcp/http.js +0 -597
  51. package/dist/mcp/index.d.ts +0 -5
  52. package/dist/mcp/index.d.ts.map +0 -1
  53. package/dist/mcp/index.js +0 -3
  54. package/dist/mcp-http.d.ts +0 -3
  55. package/dist/mcp-http.d.ts.map +0 -1
  56. package/dist/mcp-http.js +0 -42
  57. package/dist/mcp.d.ts +0 -3
  58. package/dist/mcp.d.ts.map +0 -1
  59. package/dist/mcp.js +0 -28
  60. package/dist/paths.d.ts +0 -4
  61. package/dist/paths.d.ts.map +0 -1
  62. package/dist/paths.js +0 -14
package/dist/install.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { CliContext } from "./index.js";
2
- export declare function runInstall(context: CliContext): Promise<void>;
3
- //# sourceMappingURL=install.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAqB7C,wBAAsB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAwJnE"}
package/dist/install.js DELETED
@@ -1,229 +0,0 @@
1
- import { existsSync, realpathSync } from "node:fs";
2
- import { dirname, join, resolve } from "node:path";
3
- import { createInterface } from "node:readline/promises";
4
- import { fileURLToPath } from "node:url";
5
- import { NativeThingStore } from "@thingd/sdk";
6
- import pc from "picocolors";
7
- import { printMcpConfigJson, updateAntigravityConfig, updateClaudeDesktopConfig, } from "./lib/mcp-config-writer.js";
8
- import { defaultThingdDbPath, ensureThingdDir } from "./paths.js";
9
- async function askQuestion(query) {
10
- const rl = createInterface({
11
- input: process.stdin,
12
- output: process.stderr,
13
- });
14
- try {
15
- return await rl.question(query);
16
- }
17
- finally {
18
- rl.close();
19
- }
20
- }
21
- export async function runInstall(context) {
22
- const nodePath = process.execPath;
23
- const cliPath = resolveCliPath();
24
- const dbPathDefault = defaultThingdDbPath();
25
- const driverDefault = detectDriver();
26
- ensureThingdDir();
27
- const isRaw = context.parsed.booleans.has("raw") || context.parsed.flags.has("raw");
28
- const isClaude = context.parsed.booleans.has("claude") || context.parsed.flags.has("claude");
29
- const isCursor = context.parsed.booleans.has("cursor") || context.parsed.flags.has("cursor");
30
- const isAntigravity = context.parsed.booleans.has("antigravity") || context.parsed.flags.has("antigravity");
31
- if (!isRaw) {
32
- context.stderr.write(`\n${pc.bold("thingd install")}\n\n`);
33
- }
34
- let choice = "1";
35
- let dbPath = dbPathDefault;
36
- let driver = driverDefault;
37
- if (isRaw) {
38
- choice = "5";
39
- }
40
- else if (isClaude && isCursor && isAntigravity) {
41
- choice = "1";
42
- }
43
- else if (isClaude) {
44
- choice = "2";
45
- }
46
- else if (isCursor) {
47
- choice = "3";
48
- }
49
- else if (isAntigravity) {
50
- choice = "4";
51
- }
52
- else if (process.stdin.isTTY) {
53
- // 1. Where to install
54
- context.stderr.write(`${pc.bold("Where would you like to install the MCP configuration?")}\n`);
55
- context.stderr.write(` [1] Claude Desktop, Cursor & Antigravity (Default)\n`);
56
- context.stderr.write(` [2] Claude Desktop only\n`);
57
- context.stderr.write(` [3] Cursor only\n`);
58
- context.stderr.write(` [4] Antigravity only\n`);
59
- context.stderr.write(` [5] Print raw JSON configuration only\n\n`);
60
- const answerInstall = await askQuestion(`Select option [1-5] (default 1): `);
61
- choice = answerInstall.trim() || "1";
62
- context.stderr.write("\n");
63
- // 2. Database Path
64
- const answerPath = await askQuestion(`Database path (default ${pc.cyan(dbPathDefault)}): `);
65
- const chosenPath = answerPath.trim();
66
- if (chosenPath) {
67
- dbPath = chosenPath;
68
- }
69
- // 3. Driver
70
- const answerDriver = await askQuestion(`Driver [native / memory] (default ${pc.cyan(driverDefault)}): `);
71
- const chosenDriver = answerDriver.trim().toLowerCase();
72
- if (chosenDriver === "native" || chosenDriver === "memory") {
73
- driver = chosenDriver;
74
- }
75
- context.stderr.write("\n");
76
- }
77
- // Honor command line options if explicitly passed
78
- const cliPathOption = context.parsed.flags.get("path")?.at(-1);
79
- const cliDriverOption = context.parsed.flags.get("driver")?.at(-1);
80
- if (cliPathOption) {
81
- dbPath = cliPathOption;
82
- }
83
- if (cliDriverOption === "native" || cliDriverOption === "memory") {
84
- driver = cliDriverOption;
85
- }
86
- const globalBin = findGlobalBinPath();
87
- const config = globalBin
88
- ? {
89
- command: globalBin,
90
- args: ["mcp", "--path", dbPath, "--driver", driver],
91
- }
92
- : generateMcpConfig(nodePath, cliPath, dbPath, driver);
93
- if (!isRaw) {
94
- const hasNative = await NativeThingStore.isAvailable();
95
- const bindingStatus = hasNative
96
- ? pc.green("Available/Loaded")
97
- : pc.red("Unavailable/Not Found");
98
- context.stderr.write(` ${pc.bold("Configuration Details:")}\n`);
99
- context.stderr.write(` ${pc.green("✓")} Database path: ${pc.cyan(dbPath)}\n`);
100
- context.stderr.write(` ${pc.green("✓")} Driver: ${pc.cyan(driver)}\n`);
101
- context.stderr.write(` ${hasNative ? pc.green("✓") : pc.yellow("⚠")} Native Addon: ${bindingStatus}\n`);
102
- if (globalBin) {
103
- context.stderr.write(` ${pc.green("✓")} Command: ${pc.cyan(globalBin)}\n\n`);
104
- }
105
- else {
106
- context.stderr.write(` ${pc.green("✓")} Node: ${pc.cyan(nodePath)}\n`);
107
- context.stderr.write(` ${pc.green("✓")} CLI: ${pc.cyan(cliPath)}\n\n`);
108
- }
109
- }
110
- const showClaude = choice === "1" || choice === "2";
111
- const showCursor = choice === "1" || choice === "3";
112
- const showAntigravity = choice === "1" || choice === "4";
113
- const showRaw = choice === "5";
114
- if (showClaude) {
115
- const claudeResult = updateClaudeDesktopConfig(config);
116
- if (claudeResult.updated) {
117
- context.stderr.write(` ${pc.bold("Claude Desktop:")}\n`);
118
- context.stderr.write(` ${pc.green("✓")} Updated ${pc.cyan(claudeResult.path)}\n\n`);
119
- }
120
- else if (claudeResult.skipped) {
121
- context.stderr.write(` ${pc.bold("Claude Desktop:")}\n`);
122
- context.stderr.write(` ${pc.yellow("⊘")} Skipped: ${claudeResult.reason}\n\n`);
123
- }
124
- }
125
- if (showAntigravity) {
126
- const antigravityResult = updateAntigravityConfig(config);
127
- if (antigravityResult.updated) {
128
- context.stderr.write(` ${pc.bold("Antigravity IDE:")}\n`);
129
- context.stderr.write(` ${pc.green("✓")} Updated ${pc.cyan(antigravityResult.path)}\n\n`);
130
- }
131
- else if (antigravityResult.skipped) {
132
- context.stderr.write(` ${pc.bold("Antigravity IDE:")}\n`);
133
- context.stderr.write(` ${pc.yellow("⊘")} Skipped: ${antigravityResult.reason}\n\n`);
134
- }
135
- }
136
- if (showCursor) {
137
- context.stderr.write(` ${pc.bold("Cursor:")}\n`);
138
- context.stderr.write(` Paste this into Cursor Settings → Features → MCP → Add New MCP Server:\n\n`);
139
- context.stdout.write(`${printMcpConfigJson(config)}\n`);
140
- }
141
- if (showRaw) {
142
- context.stdout.write(`${printMcpConfigJson(config)}\n`);
143
- }
144
- if (choice === "1") {
145
- context.stderr.write(`\n Restart Claude Desktop or Antigravity to activate. Cursor activates immediately.\n\n`);
146
- }
147
- else if (choice === "2") {
148
- context.stderr.write(`\n Restart Claude Desktop to activate.\n\n`);
149
- }
150
- else if (choice === "3") {
151
- context.stderr.write(`\n Cursor activates immediately after pasting.\n\n`);
152
- }
153
- else if (choice === "4") {
154
- context.stderr.write(`\n Restart Antigravity IDE to activate.\n\n`);
155
- }
156
- }
157
- function findGlobalBinPath() {
158
- try {
159
- const cliPath = resolveCliPath();
160
- // In standard npm/nvm/pnpm global installations:
161
- // CLI is at <prefix>/lib/node_modules/thingd-cli/dist/index.js
162
- // Binary is at <prefix>/bin/thingd
163
- const candidate = resolve(cliPath, "../../../../../bin/thingd");
164
- if (existsSync(candidate)) {
165
- return candidate;
166
- }
167
- }
168
- catch {
169
- // Ignore
170
- }
171
- return null;
172
- }
173
- function resolveCliPath() {
174
- try {
175
- const currentFile = fileURLToPath(import.meta.url);
176
- const dir = dirname(currentFile);
177
- // In compiled dist folder: dist/install.js -> dist/index.js
178
- let candidate = join(dir, "index.js");
179
- if (existsSync(candidate)) {
180
- return realpathSync(candidate);
181
- }
182
- // In dev src folder: src/install.ts -> src/index.ts
183
- candidate = join(dir, "index.ts");
184
- if (existsSync(candidate)) {
185
- return realpathSync(candidate);
186
- }
187
- }
188
- catch {
189
- // Ignore and fallback
190
- }
191
- const scriptPath = process.argv[1];
192
- if (!scriptPath) {
193
- throw new Error("Could not detect thingd CLI path.");
194
- }
195
- try {
196
- return realpathSync(resolve(scriptPath));
197
- }
198
- catch {
199
- return resolve(scriptPath);
200
- }
201
- }
202
- function detectDriver() {
203
- try {
204
- // Check if the native .node binary exists relative to the CLI entry point.
205
- // When installed globally via npm, thingd-native is typically a sibling package.
206
- const cliDir = join(resolveCliPath(), "..", "..");
207
- const nativePaths = [
208
- join(cliDir, "node_modules", "@thingd/native", "dist", "thingd_native.node"),
209
- join(cliDir, "..", "thingd-native", "dist", "thingd_native.node"),
210
- ];
211
- for (const candidate of nativePaths) {
212
- if (existsSync(candidate)) {
213
- return "native";
214
- }
215
- }
216
- }
217
- catch {
218
- // Ignore detection errors.
219
- }
220
- // Default to native since most global installs will have it.
221
- // If it's not available, the SDK will produce a clear error at open time.
222
- return "native";
223
- }
224
- function generateMcpConfig(nodePath, cliPath, dbPath, driver) {
225
- return {
226
- command: nodePath,
227
- args: [cliPath, "mcp", "--path", dbPath, "--driver", driver],
228
- };
229
- }
@@ -1,2 +0,0 @@
1
- export declare function runInteractiveCli(): Promise<void>;
2
- //# sourceMappingURL=interactive.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAqxGA,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CA0FvD"}