autowonder 0.3.11 → 0.3.13
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 +14 -10
- package/bin/qoder-bootstrap.js +5 -5
- package/package.json +1 -1
- package/vendor/autowonder-daemon-darwin-amd64 +0 -0
- package/vendor/autowonder-daemon-darwin-arm64 +0 -0
- package/vendor/autowonder-daemon-linux-amd64 +0 -0
- package/vendor/autowonder-daemon-linux-arm64 +0 -0
- package/vendor/autowonder-daemon-win32-amd64.exe +0 -0
- package/vendor/autowonder-daemon-win32-arm64.exe +0 -0
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@ AutoWonder 本地 agent runtime。安装后启动 daemon,持续轮询本地 as
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# Qoder CLI(模型使用 provider model ID;Context Window 使用固定档位)
|
|
9
|
-
npx -y autowonder@0.3.
|
|
9
|
+
npx -y autowonder@0.3.13 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider qoder --model qmodel_latest --reasoning-effort medium --context-window 260000
|
|
10
10
|
|
|
11
11
|
# Qoder CLI CN
|
|
12
|
-
npx -y autowonder@0.3.
|
|
12
|
+
npx -y autowonder@0.3.13 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider qodercn
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
`connect` 会安装当前 npm 包内置的 daemon,并使用页面生成的 WebSocket endpoint、Token 和执行器 ID 建立连接。客户端只支持通过 Qoder 系列 CLI 启动(`qoder` 对应 `qodercli`,`qodercn` 对应 `qodercn`),其他 `--provider` 取值会在启动 daemon 前直接报错拦截并提示 `Unsupported provider`。选择 Qoder CLI 或 Qoder CLI CN 时需要 Node.js 20+;runtime 会在缺少对应 CLI 时自动通过 npm 安装,并在尚未登录时打开浏览器登录。runtime 会继承当前用户的 HOME、环境变量和 CLI 登录状态。
|
|
@@ -27,7 +27,7 @@ runtime 启动时始终只拉取一次 Platform 环境变量快照,即使已
|
|
|
27
27
|
|
|
28
28
|
出于安全考虑,命令行 token 可能出现在 shell 历史和操作系统进程列表中,建议优先使用环境变量或 Platform 绑定。
|
|
29
29
|
|
|
30
|
-
`connect` 和 `start` 都要求 Qoder CLI / Qoder CLI CN 版本至少为 `1.1.
|
|
30
|
+
`connect` 和 `start` 都要求 Qoder CLI / Qoder CLI CN 版本至少为 `1.1.65`。版本探测保留退出码、信号与有界输出作为证据;单次探测没有拿到版本(超时、启动失败或输出无法解析)时先按有界节奏重试,确认确实不满足后才对当前优先选中的用户 CLI 执行内置 `update`,原位升级到最新版并再次强校验;升级失败或升级后仍不满足最低版本时拒绝启动 daemon,并在日志中打印探测证据。所有 Qoder 系列子进程(普通任务、conversation、warm 会话、恢复回退、命令与模型探测)都会强制注入固定的 `QODER_INTEGRATION_ID`,调用方环境不能覆盖该流量归因标识。
|
|
31
31
|
|
|
32
32
|
`qodercn` 是国内版 Qoder CLI。runtime 会在缺少 `qodercn` 时自动把 `@qodercn-ai/qoderclicn` 安装到 `~/.autowonder/qoder-cn-cli`,并在尚未登录时打开浏览器登录。它使用自己的配置根(`QODERCN_CONFIG_DIR`,默认 `~/.qoder-cn`),与国际版 `qoder` 不共享可执行文件、凭证和会话。可用 `AUTOWONDER_QODERCN_CLI` 指定自定义可执行文件路径。
|
|
33
33
|
|
|
@@ -37,6 +37,8 @@ daemon 会响应服务端的 `QODER_MODEL_CATALOG_REQUEST` 帧,用当前 provi
|
|
|
37
37
|
|
|
38
38
|
daemon 还在协议能力位里声明 `TASK_MODEL_SELECTION_V1`:服务端可在派单帧中附带任务级模型选择(`modelSelection`,含目标模型、条目计数与阈值、策略版本、原因码)。runtime 只对本次派单应用该模型(覆盖派单原有的 model 取值,不修改执行器保存的默认配置),并在开始执行时把 `dispatchId`、选中模型与原因写入 daemon 日志,便于回溯某个任务因何被升级到另一个模型。该能力对执行机用户无新增参数或环境变量。
|
|
39
39
|
|
|
40
|
+
daemon 建立执行器接入连接时会在 WebSocket URL 上附带本机主机名(取不到时不带该参数,服务端按未上报处理),服务端据此在执行器列表区分同一数字员工在多台机器上的执行器。对执行机用户无新增参数或环境变量。
|
|
41
|
+
|
|
40
42
|
daemon 还会响应服务端的 `CONVERSATION_COMMANDS_PROBE` 帧,用独立会话抓取该会话工作目录下可用的斜杠命令,回传 `CONVERSATION_COMMANDS_RESULT` 帧,让会话面板在用户输入 `/` 时列出真实可用的命令。该探测与回合执行完全隔离:任何失败只产生 `FAILED` / `TIMEOUT` 帧,不影响进行中的会话;provider 后端不支持抓取时同样降级为 `FAILED` 帧。帧里的 `executorId` 与本机不一致或非正数时直接忽略,避免在别的执行器工作区里建目录或启动 CLI。daemon 侧给整个探测 25 秒硬上限,刻意长于 agent 侧的 20 秒预算,使 agent 自己的超时先触发并可被归类。
|
|
41
43
|
|
|
42
44
|
给 `connect` 追加 `--token-aware-enable` 可开启 qoder / qodercn 的 token 用量采集:CLI 会以 sidecar 方式启动本地 HTTPS 转发代理(`bin/token-proxy.js`),从 Qoder API 的 SSE 响应流中提取 usage 数据并按 dispatch ID 归属上报。usage 解析失败只丢失计量数据;代理启动失败时仅告警并继续。启用后模型流量经过代理,连接失败由客户端处理重试,不保证自动直连。代理端口可用 `TOKEN_PROXY_PORT` 环境变量调整(默认 19876);CA 证书位于 `~/.autowonder/token-tap/ca-cert.pem`。daemon 退出时 sidecar 一并停止。代理对 TCP 建连和两端 TLS 握手设置 15 秒期限,对无读写活动的连接设置 120 秒空闲期限;超时、报错或任一端关闭时释放两端连接。持续有数据的 SSE 流不受总时长限制,连续静默超过 120 秒的流会断开。
|
|
@@ -81,6 +83,8 @@ daemon 默认启用本地工作区 GC:启动 30 秒后开始检查,之后每
|
|
|
81
83
|
|
|
82
84
|
`~/autowonder_workspaces`(可由 `--workspace-root` 或 `AUTOWONDER_WORKSPACE_ROOT` 修改)保存每个任务独立的工作文件和 checkout/worktree;`~/.autowonder/git-object-cache/v1` 保存可供多个任务复用 Git 历史对象的本地 bare mirror。每个任务仍会得到所请求准确 commit 的独立工作区。已缓存的固定 commit 可以不查询远端;允许联网时,`HEAD`、branch 或 tag 等可移动 ref 会在每次 materialization 时向远端解析为准确 commit,仅在 mirror 缺少该对象时 fetch。缓存优化失败时,只有其临时目录已经完成可验证的干净回滚才会回退到原有的远端完整 clone 流程;若无法证明干净回滚,则会保留现场并返回错误,不进入回退。任何路径都不会发布不完整的目标目录;已经存在的任务仓库只做校验,不会被 fetch、reset、clean、checkout 或覆盖。本版本不会自动淘汰 Git 对象缓存,工作区 GC 也不会删除该缓存。
|
|
83
85
|
|
|
86
|
+
任务包 `repos.json` 可为仓库声明继承来源 revision 的回退列表(`sourceRevisionFallbackRefs`):当派单要求的继承 revision 已无法解析为 commit(例如上游分支被删除或强推)时,runtime 会按该列表依次回退物化,命中后以回退 commit 作为该仓库本次使用的来源继续执行,并发出 `repo_source_revision_abandoned` 事件(含仓库、回退 commit 与原因)。只有「ref 无法解析」会触发回退——传输、权限、工作区归属与策略类失败不触发;声明了固定 base commit 的仓库不使用回退。该能力对执行机用户无新增参数或环境变量。
|
|
87
|
+
|
|
84
88
|
任务工作区里的 Git 策略(是否允许提交/推送与工作区边界)由 runtime 安装的自包含钩子强制执行:默认策略不依赖 runtime 二进制或任务配置继续存在,因此历史任务残留不会让普通的 `git commit` / `git push` 失败,策略禁止时分别以退出码 `73` / `74` 拒绝提交与推送,提交还要求 HEAD 位于具名分支(detached 时以 `77` 拒绝)。安装是幂等的,只有确实声明了打包触发的仓库才会链式调用 runtime。daemon 启动时会在 15 秒预算内把本执行器历史 capsule 中可核对的旧版包装脚本迁移为这种自包含形式;模板、配置或元数据不完整的历史一律保留现场,不做全机扫描,也不恢复用户原有的 `hooksPath`。
|
|
85
89
|
|
|
86
90
|
## 中断派单恢复
|
|
@@ -160,7 +164,7 @@ mv "$queue/.assignment.tmp" "$queue/assignment.json"
|
|
|
160
164
|
也可以直接提交到本地 API:
|
|
161
165
|
|
|
162
166
|
```bash
|
|
163
|
-
npx -y autowonder@0.3.
|
|
167
|
+
npx -y autowonder@0.3.13 dispatch ./assignment.json
|
|
164
168
|
```
|
|
165
169
|
|
|
166
170
|
## 上传工单附件
|
|
@@ -168,7 +172,7 @@ npx -y autowonder@0.3.11 dispatch ./assignment.json
|
|
|
168
172
|
把本地需求/设计文档直接上传到工单,避免在会话里传递大文件:
|
|
169
173
|
|
|
170
174
|
```bash
|
|
171
|
-
npx -y autowonder@0.3.
|
|
175
|
+
npx -y autowonder@0.3.13 workitem upload --server-url <autowonder-server-url> --workitem-id <id> --file <filepath-1> --file <filepath-2> --json
|
|
172
176
|
```
|
|
173
177
|
|
|
174
178
|
上传令牌通过 MCP 工具 `autowonder.workitem_cli_upload_token` 签发,经 `--token` 或 `AUTOWONDER_UPLOAD_TOKEN` 环境变量传入。`--file` 可重复指定多个文件;`--json` 输出机器可读结果。失败时按错误类型返回不同退出码(401→3、403→4、404→5、409→6、413→7、其他 4xx→8、网络/重定向→9)。
|
|
@@ -178,7 +182,7 @@ npx -y autowonder@0.3.11 workitem upload --server-url <autowonder-server-url> --
|
|
|
178
182
|
把工单上已有的需求/设计文档下载到本地目录,再用本地文件工具阅读,避免把大文件或二进制附件搬进会话上下文:
|
|
179
183
|
|
|
180
184
|
```bash
|
|
181
|
-
npx -y autowonder@0.3.
|
|
185
|
+
npx -y autowonder@0.3.13 workitem download --server-url <autowonder-server-url> --workitem-id <id> --file <name-or-id> --output-dir <dir> --json
|
|
182
186
|
```
|
|
183
187
|
|
|
184
188
|
下载令牌通过 MCP 工具 `autowonder.workitem_cli_download_token` 签发(与上传令牌相互独立),经 `--token` 或 `AUTOWONDER_DOWNLOAD_TOKEN` 环境变量传入。`--file` 可重复指定文档名或 artifact id,省略则下载该工单的全部附件;`--output-dir` 默认为当前目录;`--json` 输出机器可读结果,含每个文件的 `id`、`name`、`path`、`size`。退出码约定与 `workitem upload` 相同(401→3、403→4、404→5、409→6、413→7、其他 4xx→8、网络/重定向→9)。
|
|
@@ -188,7 +192,7 @@ npx -y autowonder@0.3.11 workitem download --server-url <autowonder-server-url>
|
|
|
188
192
|
把需求/设计文档上传到 7x24 定时任务,用法与工单附件一致(同一套上传令牌与预检规则):
|
|
189
193
|
|
|
190
194
|
```bash
|
|
191
|
-
npx -y autowonder@0.3.
|
|
195
|
+
npx -y autowonder@0.3.13 scheduled-task upload --server-url <autowonder-server-url> --scheduled-task-id <id> --file <filepath-1> --file <filepath-2> --json
|
|
192
196
|
```
|
|
193
197
|
|
|
194
198
|
上传令牌同样通过 `autowonder.workitem_cli_upload_token` 签发(令牌为用户级,对当前可修改的任意定时任务生效),经 `--token` 或 `AUTOWONDER_UPLOAD_TOKEN` 传入;退出码约定与 `workitem upload` 相同。
|
|
@@ -196,8 +200,8 @@ npx -y autowonder@0.3.11 scheduled-task upload --server-url <autowonder-server-u
|
|
|
196
200
|
## 管理 daemon
|
|
197
201
|
|
|
198
202
|
```bash
|
|
199
|
-
npx -y autowonder@0.3.
|
|
200
|
-
npx -y autowonder@0.3.
|
|
203
|
+
npx -y autowonder@0.3.13 status
|
|
204
|
+
npx -y autowonder@0.3.13 stop
|
|
201
205
|
```
|
|
202
206
|
|
|
203
207
|
默认 API 是 `http://127.0.0.1:34989`,日志位于 `~/.autowonder/daemon.log`。npm 包不包含任何 agent、MCP 或服务端凭证。
|
|
@@ -205,7 +209,7 @@ npx -y autowonder@0.3.11 stop
|
|
|
205
209
|
## 调试
|
|
206
210
|
|
|
207
211
|
```bash
|
|
208
|
-
npx -y autowonder@0.3.
|
|
212
|
+
npx -y autowonder@0.3.13 connect ... --debug
|
|
209
213
|
```
|
|
210
214
|
|
|
211
215
|
`--debug` 会让 CLI 以 `AUTOWONDER_DEBUG=1` 启动 daemon,把完整的 daemon 与 agent 活动(runtime 事件流、provider 事件解码、重试退避与会话门等待、空闲时的阻塞点)同时输出到控制台和会话调试日志。调试日志不做脱敏,仅用于本机排障;不传 `--debug` 时该环境变量不会注入。
|
package/bin/qoder-bootstrap.js
CHANGED
|
@@ -15,7 +15,7 @@ const LEGACY_QODER_HOST_SERVICE_NAME_ENV = "QODER_HOST_SERVICE_NAME";
|
|
|
15
15
|
// Qoder. DO NOT CHANGE this UUID after publication: changing it would split
|
|
16
16
|
// historical and future attribution. It is not configurable or regenerated.
|
|
17
17
|
const QODER_INTEGRATION_ID = "5b5d9168-09e0-4b8a-92f5-2ee7cd817fed";
|
|
18
|
-
const QODER_MINIMUM_VERSION = [1, 1,
|
|
18
|
+
const QODER_MINIMUM_VERSION = [1, 1, 65];
|
|
19
19
|
const QODER_LOCK_MAX_PID = 2147483647;
|
|
20
20
|
const QODER_VERSION_LINE_RE = /^(?:(?:qodercli|qodercn|qoder(?: cli(?: cn)?)?)\s+)?v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\s+\([^)]*\))?$/i;
|
|
21
21
|
const PROCESS_TREE_RUNNER = path.join(__dirname, "process-tree-runner.js");
|
|
@@ -487,7 +487,7 @@ function qoderVersionMeetsMinimum(output) {
|
|
|
487
487
|
if (actual[i] > QODER_MINIMUM_VERSION[i]) return true;
|
|
488
488
|
if (actual[i] < QODER_MINIMUM_VERSION[i]) return false;
|
|
489
489
|
}
|
|
490
|
-
// A prerelease of 1.1.
|
|
490
|
+
// A prerelease of 1.1.65 is lower than the released minimum.
|
|
491
491
|
return !match[4];
|
|
492
492
|
}
|
|
493
493
|
|
|
@@ -690,7 +690,7 @@ function ensureMinimumQoderVersionLocked(profile, provider, executable) {
|
|
|
690
690
|
}
|
|
691
691
|
if (qoderVersionMeetsMinimum(probe.version)) return { ok: true, version: probe.version };
|
|
692
692
|
|
|
693
|
-
log(`${profile.displayName} ${probe.version} is older than required version 1.1.
|
|
693
|
+
log(`${profile.displayName} ${probe.version} is older than required version 1.1.65 (or could not be parsed). Updating the current installation to latest...`);
|
|
694
694
|
const update = spawnQoderSync(executable, ["update"], { stdio: "inherit", timeout: 5 * 60 * 1000, treeTimeout: true });
|
|
695
695
|
if (update.status !== 0) {
|
|
696
696
|
const managedDir = qoderPaths(profile).managedDir;
|
|
@@ -703,7 +703,7 @@ function ensureMinimumQoderVersionLocked(profile, provider, executable) {
|
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
705
|
const detail = update.error?.message || (update.signal ? `signal ${update.signal}` : `exit status ${update.status}`);
|
|
706
|
-
error(`${profile.displayName} requires version 1.1.
|
|
706
|
+
error(`${profile.displayName} requires version 1.1.65 or newer, but updating ${executable} failed: ${detail}`);
|
|
707
707
|
reportQoderVersionProbe(probe);
|
|
708
708
|
return { ok: false, version: probe.version, executable };
|
|
709
709
|
}
|
|
@@ -712,7 +712,7 @@ function ensureMinimumQoderVersionLocked(profile, provider, executable) {
|
|
|
712
712
|
// start answering with the version it just installed.
|
|
713
713
|
probe = probeQoderVersionUntil(profile, executable, (candidate) => qoderVersionMeetsMinimum(candidate.version));
|
|
714
714
|
if (!qoderVersionMeetsMinimum(probe.version)) {
|
|
715
|
-
error(`${profile.displayName} requires version 1.1.
|
|
715
|
+
error(`${profile.displayName} requires version 1.1.65 or newer, but ${executable} reports ${probe.version} after updating to latest.`);
|
|
716
716
|
reportQoderVersionProbe(probe);
|
|
717
717
|
return { ok: false, version: probe.version, executable };
|
|
718
718
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|