@dinoxx/dinox-cli 3.5.1 → 3.5.2
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/chunks/{bbc-SOUVA3A6.js → bbc-4TIRPEBV.js} +5 -5
- package/dist/chunks/{bohaishibei-TVAYDZ3S.js → bohaishibei-EX6INEG5.js} +2 -2
- package/dist/chunks/chunk-5CW5EUY2.js +51 -0
- package/dist/chunks/{chunk-7A5QISPG.js → chunk-5PEY5B37.js} +11 -1
- package/dist/chunks/{chunk-DAAFMTWB.js → chunk-AN2ITAJN.js} +5 -3
- package/dist/chunks/{chunk-QAH7TABU.js → chunk-DOSP6XQF.js} +8 -8
- package/dist/chunks/{chunk-XS7NHAXR.js → chunk-H5UR7S2R.js} +2 -2
- package/dist/chunks/{chunk-P23BS2ST.js → chunk-HMUFG5WK.js} +7 -7
- package/dist/chunks/{chunk-QT4ENEZI.js → chunk-M6FIMSYZ.js} +25 -25
- package/dist/chunks/{chunk-2WWLGTAU.js → chunk-RNLNMEKF.js} +6 -6
- package/dist/chunks/{chunk-TDUVFINJ.js → chunk-TZLGLLK5.js} +20 -20
- package/dist/chunks/{chunk-6IZ3X5JD.js → chunk-YNKFRBWM.js} +5 -5
- package/dist/chunks/{cookies-UUQZXH4R.js → cookies-ZP3VKFTD.js} +2 -2
- package/dist/chunks/{doubanGroup-Z22HXP4S.js → doubanGroup-LLHGOW7X.js} +10 -10
- package/dist/chunks/{ensure-N3OQUDZR.js → ensure-47DNFVVW.js} +5 -5
- package/dist/chunks/{execute-KKPBFABB.js → execute-Y4DBR55R.js} +4 -4
- package/dist/chunks/{install-VBMWNPO6.js → install-KRIISHHQ.js} +7 -4
- package/dist/chunks/{jike-H5FM2OLZ.js → jike-W5D7DZYK.js} +5 -5
- package/dist/chunks/{mcp-YGMXLQEU.js → mcp-OYA5MRME.js} +11 -7
- package/dist/chunks/{mcpServer-3V6BVYYT.js → mcpServer-XWTPPDHL.js} +9 -9
- package/dist/chunks/paths-LTGNGPAN.js +11 -0
- package/dist/chunks/{run-FCVNSKGO.js → run-4ZQDJIGP.js} +46 -46
- package/dist/chunks/{runCli-KZ3EAIQT.js → runCli-BYMX6VDC.js} +8 -8
- package/dist/chunks/runtimeRecord-GBZAJ7Q4.js +18 -0
- package/dist/chunks/{setup-EPCEVJVM.js → setup-5HZIQ4GV.js} +6 -6
- package/dist/chunks/{threads-P3QZA3KN.js → threads-MTSDJXGW.js} +5 -5
- package/dist/chunks/{web-SQX7IMO7.js → web-BTDVSI5Z.js} +5 -5
- package/dist/chunks/{weibo-A7RZJLAH.js → weibo-7UTH5JTP.js} +9 -9
- package/dist/chunks/{xiaoheihe-LCWXGLYD.js → xiaoheihe-AB5PNLWT.js} +2 -2
- package/dist/dinox.js +6 -6
- package/dist/dsh-plugin/lib/client.js +2 -2
- package/dist/dsh-plugin/lib/index.js +55 -13
- package/dist/dsh-plugin/package.json +2 -3
- package/dist/editor-ui/mcp-app.html +1 -1
- package/package.json +1 -1
- package/dist/dsh-plugin/runtime.json +0 -5
- package/dist/chunks/{bilibili-V4XVW33T.js → bilibili-JNZVAIRS.js} +7 -7
- package/dist/chunks/{chunk-MWVB6SDC.js → chunk-HLKHDPSU.js} +3 -3
- package/dist/chunks/{chunk-YFGDTC2F.js → chunk-O2AWYZW4.js} +3 -3
- package/dist/chunks/{chunk-YX4SIEVS.js → chunk-YLLVX4IU.js} +3 -3
- package/dist/chunks/{douyin-PIWFZHK7.js → douyin-XQCFVXTX.js} +3 -3
- package/dist/chunks/{instagram-4W4HCWJN.js → instagram-7MHMSJIU.js} +3 -3
- package/dist/chunks/{twitter-WNBOJELM.js → twitter-GPYVL35I.js} +3 -3
- package/dist/chunks/{wechat-WKYZGRG5.js → wechat-RSD3QNSJ.js} +3 -3
- package/dist/chunks/{xiaoyuzhou-OGIWFABL.js → xiaoyuzhou-JJMM3EUH.js} +3 -3
|
@@ -1,9 +1,52 @@
|
|
|
1
1
|
// src/integrations/dsh/host.ts
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
4
|
-
import
|
|
3
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2, statSync } from "node:fs";
|
|
4
|
+
import path3 from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
|
|
7
|
+
// src/editor/runtimeRecord.ts
|
|
8
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
9
|
+
import path2 from "node:path";
|
|
10
|
+
|
|
11
|
+
// src/config/paths.ts
|
|
12
|
+
import os from "node:os";
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
function resolveConfigHome() {
|
|
15
|
+
if (process.env.DINOX_CONFIG_DIR) {
|
|
16
|
+
return process.env.DINOX_CONFIG_DIR;
|
|
17
|
+
}
|
|
18
|
+
if (process.platform === "win32") {
|
|
19
|
+
return process.env.APPDATA ?? path.join(os.homedir(), "AppData", "Roaming");
|
|
20
|
+
}
|
|
21
|
+
if (process.platform === "darwin") {
|
|
22
|
+
return path.join(os.homedir(), "Library", "Application Support");
|
|
23
|
+
}
|
|
24
|
+
return process.env.XDG_CONFIG_HOME ?? path.join(os.homedir(), ".config");
|
|
25
|
+
}
|
|
26
|
+
function getConfigDir() {
|
|
27
|
+
return path.join(resolveConfigHome(), "dinox");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/editor/runtimeRecord.ts
|
|
31
|
+
var EDITOR_RUNTIME_FILE = "editor-runtime.json";
|
|
32
|
+
function editorRuntimeFile(configDir = getConfigDir()) {
|
|
33
|
+
return path2.join(configDir, EDITOR_RUNTIME_FILE);
|
|
34
|
+
}
|
|
35
|
+
function readEditorRuntime(file = editorRuntimeFile()) {
|
|
36
|
+
try {
|
|
37
|
+
const value = JSON.parse(readFileSync(file, "utf8"));
|
|
38
|
+
const out = {};
|
|
39
|
+
if (typeof value.node === "string" && existsSync(value.node)) out.node = value.node;
|
|
40
|
+
if (typeof value.cli === "string" && existsSync(value.cli)) out.cli = value.cli;
|
|
41
|
+
return out;
|
|
42
|
+
} catch {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function isPlainNode(versions = process.versions) {
|
|
47
|
+
return !("electron" in versions);
|
|
48
|
+
}
|
|
49
|
+
|
|
7
50
|
// src/integrations/dsh/mcpClient.ts
|
|
8
51
|
import { spawn } from "node:child_process";
|
|
9
52
|
var PROTOCOL_VERSION = "2025-06-18";
|
|
@@ -205,20 +248,18 @@ var MAX_WAIT_MS = 25e3;
|
|
|
205
248
|
var METHOD_NAME = /^[A-Za-z]{1,40}$/;
|
|
206
249
|
var HOST_ONLY_METHODS = /* @__PURE__ */ new Set(["watchOpens"]);
|
|
207
250
|
var SESSION_META_KEY = "dinox.ai/editorSession";
|
|
208
|
-
function resolveRuntime(pluginLib =
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const node = env.DINOX_EDITOR_NODE || (recorded.node && existsSync(recorded.node) ? recorded.node : process.execPath);
|
|
216
|
-
const cli = env.DINOX_EDITOR_CLI || (recorded.cli && existsSync(recorded.cli) ? recorded.cli : fallbackCli);
|
|
251
|
+
function resolveRuntime(pluginLib = path3.dirname(fileURLToPath(import.meta.url)), env = process.env, recordFile = editorRuntimeFile(), versions = process.versions) {
|
|
252
|
+
const recorded = readEditorRuntime(recordFile);
|
|
253
|
+
const legacy = readEditorRuntime(path3.join(pluginLib, "..", "runtime.json"));
|
|
254
|
+
const adjacent = path3.resolve(pluginLib, "..", "..", "dinox.js");
|
|
255
|
+
const cli = env.DINOX_EDITOR_CLI || (existsSync2(adjacent) ? adjacent : recorded.cli ?? legacy.cli ?? adjacent);
|
|
256
|
+
const prefixNode = path3.resolve(path3.dirname(cli), "..", "..", "..", "..", "..", "bin", "node");
|
|
257
|
+
const node = env.DINOX_EDITOR_NODE || recorded.node || legacy.node || (isPlainNode(versions) ? process.execPath : existsSync2(prefixNode) ? prefixNode : "node");
|
|
217
258
|
return { node, cli };
|
|
218
259
|
}
|
|
219
260
|
var log = (message2) => console.error(`[dinox-editor] ${message2}`);
|
|
220
261
|
function cliVersionReader(cli) {
|
|
221
|
-
const file =
|
|
262
|
+
const file = path3.join(path3.dirname(cli), "..", "package.json");
|
|
222
263
|
let stamp = -1;
|
|
223
264
|
let version = null;
|
|
224
265
|
return () => {
|
|
@@ -226,7 +267,7 @@ function cliVersionReader(cli) {
|
|
|
226
267
|
const mtime = statSync(file).mtimeMs;
|
|
227
268
|
if (mtime !== stamp) {
|
|
228
269
|
stamp = mtime;
|
|
229
|
-
const parsed = JSON.parse(
|
|
270
|
+
const parsed = JSON.parse(readFileSync2(file, "utf8"));
|
|
230
271
|
version = typeof parsed.version === "string" ? parsed.version : null;
|
|
231
272
|
}
|
|
232
273
|
} catch {
|
|
@@ -244,6 +285,7 @@ function apply(ctx, options = {}) {
|
|
|
244
285
|
ctx.effect(() => disposeTools);
|
|
245
286
|
const client = options.client ?? (() => {
|
|
246
287
|
const runtime = resolveRuntime();
|
|
288
|
+
write(`starting ${runtime.cli} with ${runtime.node}`);
|
|
247
289
|
return new McpStdioClient({
|
|
248
290
|
command: runtime.node,
|
|
249
291
|
args: [runtime.cli, "editor", "mcp", "--session", "dsh"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dinox-editor-dsh",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Dinox note editor for DeepSeek Harness Desktop (built by @dinoxx/dinox-cli)",
|
|
6
6
|
"type": "module",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"lib/",
|
|
16
|
-
"cordis.patch.yml"
|
|
17
|
-
"runtime.json"
|
|
16
|
+
"cordis.patch.yml"
|
|
18
17
|
],
|
|
19
18
|
"dsh": {
|
|
20
19
|
"client": {
|