@skylandnpm/octopus-proxy 0.1.35 → 0.1.39

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/README.md CHANGED
@@ -33,6 +33,31 @@ octopus-proxy doctor
33
33
  octopus-proxy restart
34
34
  ```
35
35
 
36
+ Claw 新建终端时若出现 `posix_spawnp failed.`,错误来自 Proxy 主机上的 PTY 启动。`node-pty 1.1.0` 的 macOS 预编译 `spawn-helper` 存在安装后缺少执行权限的[上游问题](https://github.com/microsoft/node-pty/issues/850);同一 macOS 版本的两台电脑也可能因安装方式、CPU 架构和安装目录不同而只有一台失败。
37
+
38
+ Proxy 在新建终端前检查实际加载的辅助程序,并自动补齐缺失的执行权限。`octopus-proxy doctor` 会显示辅助程序路径及当前 Node 架构,`doctor --fix` 可修复权限;检查独立于配置是否有效。若安装目录不允许当前账号修改,诊断会提示由安装账号修复或重新安装,不会自动提权。辅助程序缺失需重新安装;权限正常仍失败时,终端错误会显示 shell、工作目录、辅助程序路径和 Node 版本,供进一步核查。诊断应在发生错误的 Proxy 主机、同一 Node 安装环境下运行,之后执行 `octopus-proxy restart` 并在 Claw 新建终端。
39
+
40
+ 尚未升级到含此修复的 Proxy 时,可在出错的 Mac 上运行以下临时修复。它从实际 `octopus-proxy` 命令解析其 `node-pty` 依赖,只修复正在使用的辅助程序。运行时的 Node 应与 Proxy 服务一致;权限正常仍失败时,请保留输出继续排查。
41
+
42
+ ```sh
43
+ node - "$(command -v octopus-proxy)" <<'NODE'
44
+ const fs = require('node:fs');
45
+ const path = require('node:path');
46
+ const requireProxy = require('node:module').createRequire(fs.realpathSync(process.argv[2]));
47
+ const utils = requireProxy.resolve('node-pty/lib/utils.js');
48
+ const native = requireProxy(utils).loadNativeModule('pty');
49
+ const helper = path.resolve(path.dirname(utils), native.dir, 'spawn-helper');
50
+ const info = fs.statSync(helper);
51
+ if (!info.isFile()) throw new Error('spawn-helper 不是普通文件');
52
+ console.log({ helper, mode: (info.mode & 0o777).toString(8), arch: process.arch, node: process.version });
53
+ try { fs.accessSync(helper, fs.constants.X_OK); }
54
+ catch { fs.chmodSync(helper, (info.mode & 0o777) | 0o111); }
55
+ fs.accessSync(helper, fs.constants.X_OK);
56
+ console.log('spawn-helper 执行权限正常');
57
+ NODE
58
+ octopus-proxy restart
59
+ ```
60
+
36
61
  Claw 完成主机信任和账号认证后,通过端到端会话向 Proxy 发送只读 `runtime.snapshot` 命令。响应包含当前运行状态、Hub 和工具设置、授权项目路径,以及工具可提供的模型信息;机器人 Secret、工具密码和提供商凭据不会返回。工作区的“Proxy 信息”按钮可查看这些内容。
37
62
 
38
63
  Codex 和 ZCode 由 Proxy 按授权项目启动各自的 app-server,默认随 Proxy 自动启动;服务未就绪时也可在 Claw 点击“启动服务”。若命令不可执行或某个项目启动失败,工作区会显示失败项目及原因。修改命令路径或授权项目后,运行 `octopus-proxy restart` 使配置生效。
@@ -65,6 +90,18 @@ octopus-proxy onboard --tool pi
65
90
 
66
91
  协议和验证详情见 [Pi 接入说明](../../docs/pi-protocol-notes.md)。
67
92
 
93
+ ## 更新
94
+
95
+ 在交互式终端中运行:
96
+
97
+ ```sh
98
+ octopus-proxy update
99
+ ```
100
+
101
+ 命令通过 `npm view @skylandnpm/octopus-proxy@latest version` 查询最新版本。存在新版本时,输入 `y` 或 `yes` 确认覆盖安装;直接回车或输入其他内容会取消。确认后依次停止已安装的服务、使用 npm 全局安装查到的版本、重启服务,并校验安装版本和运行状态后反馈结果。配置、主机身份和已有服务定义会保留;未安装服务时仅更新 npm 包。
102
+
103
+ 更新失败时会尝试恢复原先运行的服务,并报告安装及恢复结果;包安装失败不保证旧版本文件完整保留。已安装新版本但重启失败时会单独提示,可运行 `octopus-proxy doctor` 和 `octopus-proxy logs` 排查。此命令用于 npm 全局安装,停止服务前会检查 npm 安装目录是否与当前命令一致;源码、本地安装或 Node.js 环境不一致时会中止并给出提示。
104
+
68
105
  ## 发布
69
106
 
70
107
  在 `apps/octopus-proxy` 目录执行 `npm run publish`:先递增 `package.json` 的补丁版本,再编译,最后发布。即使编译或发布失败,版本号也会保留递增结果,重试时继续递增。版本更新不会自动创建 Git 提交或标签。先登录有权发布 `@skylandnpm` 包的 npm 账号: