@xyagent/cli 1.1.0 → 1.1.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyagent/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Relay-first CLI for pairing and bridging OpenClaw gateway traffic",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build:plugin": "node scripts/build-openclaw-plugin.mjs",
|
|
25
25
|
"prepublishOnly": "node scripts/build-openclaw-plugin.mjs",
|
|
26
|
-
"postinstall": "node
|
|
26
|
+
"postinstall": "node src-ext/postinstall.mjs",
|
|
27
27
|
"test": "node --test --test-concurrency=1 'test/**/*.test.mjs'",
|
|
28
28
|
"test:coverage": "node --test --experimental-test-coverage test/tunnel/core.test.mjs"
|
|
29
29
|
},
|
|
@@ -37,4 +37,4 @@
|
|
|
37
37
|
"qrcode": "^1.5.4",
|
|
38
38
|
"qrcode-terminal": "^0.12.0"
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
}
|
|
@@ -17,8 +17,11 @@ import path from "node:path";
|
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
18
18
|
|
|
19
19
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
// 🔴 动态 import 必须传 file:// URL 而不是拼出来的绝对路径:Windows 上
|
|
21
|
+
// `C:\...` 的盘符会被 ESM 加载器当 URL scheme(ERR_UNSUPPORTED_ESM_URL_SCHEME),
|
|
22
|
+
// 且这是**顶层 await**——炸了会拖垮整个 CLI 启动(2026-08-18 Windows 真机复现)。
|
|
20
23
|
const TOML = await import(
|
|
21
|
-
|
|
24
|
+
new URL("../../src-shared/vendor/smol-toml/dist/index.js", import.meta.url).href
|
|
22
25
|
);
|
|
23
26
|
|
|
24
27
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// npm postinstall 入口(openspec m-20260817-windows-runtime-parity 追加修复)。
|
|
2
|
+
//
|
|
3
|
+
// 🔴 为什么是独立文件而不是 package.json 里的 `node -e '...'` 内联:
|
|
4
|
+
// 内联版用单引号包 JS 代码,Windows 上 npm 跑生命周期脚本走 cmd.exe,
|
|
5
|
+
// 单引号不是引号 —— 代码带着字面引号被 node 当模块路径解析,postinstall
|
|
6
|
+
// 必然 exit 1,进而把整个 `npm i -g @xyagent/cli` 判为安装失败
|
|
7
|
+
// (2026-08-18 Windows 真机复现;macOS 的 sh 认单引号所以从未暴露)。
|
|
8
|
+
// 脚本文件零引号问题,且放在 src-ext/ 下(package.json files 白名单已包含)。
|
|
9
|
+
//
|
|
10
|
+
// 行为与原内联版完全一致:best-effort 重启守护进程,任何失败都吞掉 ——
|
|
11
|
+
// postinstall 绝不能因此把安装本身搞失败。
|
|
12
|
+
import("./core/daemonRestart.mjs")
|
|
13
|
+
.then((m) => m.kickstartDaemons())
|
|
14
|
+
.catch(() => {});
|
|
@@ -22,8 +22,9 @@ import fs from "node:fs/promises";
|
|
|
22
22
|
|
|
23
23
|
import { fileURLToPath } from "node:url";
|
|
24
24
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
25
|
+
// file:// URL 而非绝对路径(Windows 盘符会被 ESM 当 scheme,见 codexTrust.mjs 同款注释)
|
|
25
26
|
const TOML = await import(
|
|
26
|
-
|
|
27
|
+
new URL("../../../src-shared/vendor/smol-toml/dist/index.js", import.meta.url).href
|
|
27
28
|
);
|
|
28
29
|
|
|
29
30
|
export const fileExtension = "toml";
|
|
@@ -24,8 +24,9 @@ import fs from "node:fs/promises";
|
|
|
24
24
|
|
|
25
25
|
import { fileURLToPath } from "node:url";
|
|
26
26
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
27
|
+
// file:// URL 而非绝对路径(Windows 盘符会被 ESM 当 scheme,见 codexTrust.mjs 同款注释)
|
|
27
28
|
const YAML = await import(
|
|
28
|
-
|
|
29
|
+
new URL("../../../src-shared/vendor/yaml/dist/index.js", import.meta.url).href
|
|
29
30
|
);
|
|
30
31
|
|
|
31
32
|
export const fileExtension = "yaml";
|