@xyagent/cli 1.1.0 → 1.1.1

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.0",
3
+ "version": "1.1.1",
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 -e 'import(process.cwd()+\"/src-ext/core/daemonRestart.mjs\").then(m=>m.kickstartDaemons()).catch(()=>{})'",
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
  },
@@ -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(() => {});