autowonder 0.3.29 → 0.3.30

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
@@ -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.29 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider qoder --model qmodel_latest --reasoning-effort medium --context-window 260000
9
+ npx -y autowonder@0.3.30 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.29 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider qodercn
12
+ npx -y autowonder@0.3.30 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 登录状态。
@@ -89,6 +89,8 @@ daemon 默认启用本地工作区 GC:启动 30 秒后开始检查,之后每
89
89
 
90
90
  任务包 `repos.json` 可为仓库声明继承来源 revision 的回退列表(`sourceRevisionFallbackRefs`):当派单要求的继承 revision 已无法解析为 commit(例如上游分支被删除或强推)时,runtime 会按该列表依次回退物化,命中后以回退 commit 作为该仓库本次使用的来源继续执行,并发出 `repo_source_revision_abandoned` 事件(含仓库、回退 commit 与原因)。只有「ref 无法解析」会触发回退——传输、权限、工作区归属与策略类失败不触发;声明了固定 base commit 的仓库不使用回退。该能力对执行机用户无新增参数或环境变量。来源 revision 产物里的 `checkoutVerification: "required"` 表示远端探测未能确认 HEAD(不等于 HEAD 未发布),下游应在开始验收前物化该精确 HEAD;旧消费方仍按原有远端校验逻辑处理。
91
91
 
92
+ 任务工作区里的仓库工作分支名按派单 ID、attempt 与仓库名确定性生成。仓库名不含可用 ref 字符时(例如纯非 ASCII 名称),runtime 改用基于仓库名的 SHA-256 摘要生成 `repo-<hex>` 后缀,保证分支名合法、稳定且不依赖仓库 URL。Windows 上物化重命名与 GC 清理不再对保留的父目录请求 DELETE 访问,也不再用字节数组承载 `FILE_DISPOSITION_INFORMATION_EX`(4 字节对齐导致的 `STATUS_DATATYPE_MISALIGNMENT`),因此重命名目标父目录不会再因访问冲突失败。
93
+
92
94
  任务工作区里的 Git 策略(是否允许提交/推送与工作区边界)由 runtime 安装的自包含钩子强制执行:默认策略不依赖 runtime 二进制或任务配置继续存在,因此历史任务残留不会让普通的 `git commit` / `git push` 失败,策略禁止时分别以退出码 `73` / `74` 拒绝提交与推送,提交还要求 HEAD 位于具名分支(detached 时以 `77` 拒绝)。安装是幂等的,只有确实声明了打包触发的仓库才会链式调用 runtime。daemon 启动时会在 15 秒预算内把本执行器历史 capsule 中可核对的旧版包装脚本迁移为这种自包含形式;模板、配置或元数据不完整的历史一律保留现场,不做全机扫描,也不恢复用户原有的 `hooksPath`。
93
95
 
94
96
  ## 中断派单恢复
@@ -103,9 +105,21 @@ daemon 重启或崩溃后重新接管未完成的派单时,runtime 不会直
103
105
 
104
106
  暂停也走同一条持久化回执链路:`TASK_PAUSED` 只有在服务端确认接受后才从结果 outbox 删除,未接受时保留并可重发;服务端再次下发同一派单的暂停指令时,runtime 直接从 capsule 中已落盘的暂停结果(`runtime-result.json`,先校验租户、工单、派单、attempt 与 checkpoint 回执)重放该回执,而不要求暂停协调器仍留在内存里等待,因此 daemon 重启或回执丢失都不会让等待该派单返工的一方永久挂起。
105
107
 
108
+ 派单回合以 Qoder 自报的 `cancelled the prompt` 结束、而 runtime 并未发起取消,且本轮既无助手输出也无工具/提问活动时,不再直接判为失败:runtime 最多做 2 次有界恢复,第二次改用新会话并重建同一 workflow 上下文,重试前按退避等待,期间的暂停请求仍即时生效。只要已产生输出或工具副作用、存在待处理插话,或取消来自外部上下文,就不会重试;由多次调用组合而成的回合也不会授权重放其前置轮次。
109
+
110
+ Qoder 取消会在失败历史里附带 runtime 侧上下文诊断(是否尝试过取消、上下文状态),随 telemetry 一起导出,用于区分「模型自行中止」与「真实取消」。该诊断对执行机用户无新增参数或环境变量。
111
+
112
+ ## 会话回合可靠性
113
+
114
+ conversation 回合只有在其结果成功、未被取消且取得 provider 返回的 session id 后,才把会话与该 session 绑定(工作目录内 `.autowonder-conversation-session.json`,含 provider、session id 与 system prompt 摘要)。此前「请求了某个 prompt」不等于 provider 真正采纳了它;绑定缺失、provider 变化、session 变化或 prompt 摘要变化都会重建会话并复用已保存历史。绑定写入失败只记日志,不会把已完成的工具副作用变成可重试的失败回合。对话历史也只在回合成功时追加。
115
+
116
+ 人工回答的投递与传输解耦:回答先落盘为 receipt,再进入有界的 ACK 队列(最多 512 条待发提示,写回执优先于发提示),发送失败不阻塞任务,也不起本地重试循环;服务端重投或回合结束后的 receiptOnly 查询以落盘 receipt 为准,冲突的回答只会得到拒绝提示,不会污染已存在的真实回执。等待人工回答超时或回合被取消时,runtime 通过回合上下文停止 provider,而不是回传 ACP「人工拒绝」;回答注册器不可用时回合直接以 FAILED 回执。
117
+
106
118
  ## 自动更新
107
119
 
108
- daemon 不会自行追新:后台自动更新策略默认关闭,且没有环境变量可以重新开启,因此 daemon 不会主动查询 npm 的 `autowonder/latest`、下载、安装或重启。版本由平台决定,见下文的服务端指定版本升级;没有服务端升级指令时,即使本地配置了更短的检查周期也不会产生任何 npm 请求。
120
+ 本桥接版本仍以 `autowonder` 发布,命令和二进制身份保持不变;平台触发升级时,版本元数据及 tarball 从 `@alicloud/autowonder` 获取(最新版本查询使用 `latest`,指定版本查询使用对应版本号)。先让旧客户端升级到旧包中的桥接版本,再发布并指派版本号更高的组织包;新包未发布或查询失败时保留当前版本,不回退查询旧包。组织包必须延续递增版本号,不能用 `0.0.1` 替代已安装的 `0.3.x`。此变更不启用后台自动检查。
121
+
122
+ daemon 不会自行追新:后台自动更新策略默认关闭,且没有环境变量可以重新开启,因此 daemon 不会主动查询 npm 的 `@alicloud/autowonder/latest`、下载、安装或重启。版本由平台决定,见下文的服务端指定版本升级;没有服务端升级指令时,即使本地配置了更短的检查周期也不会产生任何 npm 请求。
109
123
 
110
124
  升级能力与后台策略是两件事:标准安装的正式版 daemon 仍会初始化升级器并在心跳里上报远程升级能力,因此平台可以下发指定版本的升级指令。收到 `EXECUTOR_UPGRADE`(或 `EXECUTOR_RESTART` 且 `update=true`)后,daemon 才会按指令解析 npm tarball、校验 SHA-512 SRI、包版本和平台二进制;只有在没有运行/恢复任务且结果 outbox 已收到服务端确认时,才会暂停接单、原子切换二进制并重启。启动失败会恢复上一个二进制。
111
125
 
@@ -181,7 +195,7 @@ mv "$queue/.assignment.tmp" "$queue/assignment.json"
181
195
  也可以直接提交到本地 API:
182
196
 
183
197
  ```bash
184
- npx -y autowonder@0.3.29 dispatch ./assignment.json
198
+ npx -y autowonder@0.3.30 dispatch ./assignment.json
185
199
  ```
186
200
 
187
201
  ## 上传工单附件
@@ -189,7 +203,7 @@ npx -y autowonder@0.3.29 dispatch ./assignment.json
189
203
  把本地需求/设计文档直接上传到工单,避免在会话里传递大文件:
190
204
 
191
205
  ```bash
192
- npx -y autowonder@0.3.29 workitem upload --server-url <autowonder-server-url> --workitem-id <id> --file <filepath-1> --file <filepath-2> --json
206
+ npx -y autowonder@0.3.30 workitem upload --server-url <autowonder-server-url> --workitem-id <id> --file <filepath-1> --file <filepath-2> --json
193
207
  ```
194
208
 
195
209
  上传令牌通过 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)。
@@ -199,7 +213,7 @@ npx -y autowonder@0.3.29 workitem upload --server-url <autowonder-server-url> --
199
213
  把工单上已有的需求/设计文档下载到本地目录,再用本地文件工具阅读,避免把大文件或二进制附件搬进会话上下文:
200
214
 
201
215
  ```bash
202
- npx -y autowonder@0.3.29 workitem download --server-url <autowonder-server-url> --workitem-id <id> --file <name-or-id> --output-dir <dir> --json
216
+ npx -y autowonder@0.3.30 workitem download --server-url <autowonder-server-url> --workitem-id <id> --file <name-or-id> --output-dir <dir> --json
203
217
  ```
204
218
 
205
219
  下载令牌通过 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)。
@@ -209,7 +223,7 @@ npx -y autowonder@0.3.29 workitem download --server-url <autowonder-server-url>
209
223
  把需求/设计文档上传到 7x24 定时任务,用法与工单附件一致(同一套上传令牌与预检规则):
210
224
 
211
225
  ```bash
212
- npx -y autowonder@0.3.29 scheduled-task upload --server-url <autowonder-server-url> --scheduled-task-id <id> --file <filepath-1> --file <filepath-2> --json
226
+ npx -y autowonder@0.3.30 scheduled-task upload --server-url <autowonder-server-url> --scheduled-task-id <id> --file <filepath-1> --file <filepath-2> --json
213
227
  ```
214
228
 
215
229
  上传令牌同样通过 `autowonder.workitem_cli_upload_token` 签发(令牌为用户级,对当前可修改的任意定时任务生效),经 `--token` 或 `AUTOWONDER_UPLOAD_TOKEN` 传入;退出码约定与 `workitem upload` 相同。
@@ -217,8 +231,8 @@ npx -y autowonder@0.3.29 scheduled-task upload --server-url <autowonder-server-u
217
231
  ## 管理 daemon
218
232
 
219
233
  ```bash
220
- npx -y autowonder@0.3.29 status
221
- npx -y autowonder@0.3.29 stop
234
+ npx -y autowonder@0.3.30 status
235
+ npx -y autowonder@0.3.30 stop
222
236
  ```
223
237
 
224
238
  默认 API 是 `http://127.0.0.1:34989`,日志位于 `~/.autowonder/daemon.log`。npm 包不包含任何 agent、MCP 或服务端凭证。
@@ -241,9 +255,11 @@ daemon 内置独立于工作区 GC 的保留清扫:默认每小时运行一次
241
255
  ## 调试
242
256
 
243
257
  ```bash
244
- npx -y autowonder@0.3.29 connect ... --debug
258
+ npx -y autowonder@0.3.30 connect ... --debug
245
259
  ```
246
260
 
247
261
  `--debug` 会让 CLI 以 `AUTOWONDER_DEBUG=1` 启动 daemon,把完整的 daemon 与 agent 活动(runtime 事件流、provider 事件解码、重试退避与会话门等待、空闲时的阻塞点)同时输出到控制台和会话调试日志。调试日志不做脱敏,仅用于本机排障;不传 `--debug` 时该环境变量不会注入。
248
262
 
263
+ daemon 把仅用于展示的事件(`text`、`thinking`、`log`、`thinking_started`、`thinking_completed`)放进有界单协程队列(4096 条 / 16 MiB,关闭时最多等待 5 秒排水),与业务事件处理隔离:展示通道变慢或阻塞不会拖住工具、卡片、回执等业务控制事件。排队溢出或未送达只计入丢失量,并以 `provider_observation_delivery_summary` 事件和结果里的 `observationLoss` 元数据上报。诊断/日志写入失败不会把已成功的业务执行变成投递失败,完成边界后的 diagnostic flush 错误也不会凭空创建 completion 投递所有权。该机制对执行机用户无新增参数或环境变量。
264
+
249
265
  `--debug` 之外还有一条由服务端驱动的班组调试日志采集通道,两者互不依赖。runtime 在 `protocolFeatures` 中声明 `DEBUG_LOG_V1`,服务端只会给声明了该能力位的 runtime 下发 `debugLog` 策略;策略在打包时冻结进 assignment(`enabled` / `maxBytes` / `uploadUrl`),执行期不再变化。开启后 runtime 会把本轮完整调试日志写到 capsule 内,单轮硬上限默认 200MB(可由 `debugLog.maxBytes` 覆盖),所在卷剩余空间低于 2GB 时停止写入,单条记录超过 8MB 会被截断并打标记。它是旁路设计:写入队列满时丢行而不反压任务热路径,收尾等待最多 5 秒。回合结束时按 `DIRECT`(对象存储预签名 PUT)或 `RELAY`(服务端中转)通道上传,结果以 `debugLog` 段附在 `TASK_RESULT` 上(`status` 为 `UPLOADED` / `FAILED`,含字节数与 SHA-256);报告里的错误文本会把 URL 查询串替换为 `<redacted>`,避免执行器令牌或对象存储签名外泄。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autowonder",
3
- "version": "0.3.29",
3
+ "version": "0.3.30",
4
4
  "description": "AutoWonder local runtime — execute AI agent dispatch packages on your machine",
5
5
  "bin": {
6
6
  "autowonder": "bin/cli.js"