wayang-ai 0.8.4 → 0.9.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.
Files changed (3) hide show
  1. package/README.md +44 -1
  2. package/dist/cli.js +8224 -5197
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -31,7 +31,7 @@ Complex AI workflows need more than a single chat. Wayang acts as an intelligent
31
31
  - **Multi-Worker Parallelism** — Multiple Workers run simultaneously with configurable concurrency limits
32
32
  - **Rich TUI** — Ink-powered (React for CLI) interface with streaming output, slash commands, and keyboard shortcuts
33
33
  - **Session Recovery** — `wayang --resume` restores interrupted sessions with automatic crash cleanup
34
- - **Extensible Workers** — Built-in Puppet Worker and Claude Code Worker; plug in custom third-party Workers
34
+ - **Extensible Workers** — Built-in Puppet Worker and Claude Code Worker; plug in custom third-party Workers. 0.9.0 起亦可通过 ACP 接入 codebuddy / opencode。
35
35
  - **Headless Server + RPC** — `wayang server` runs the orchestration core as a headless process driven over a JSON-RPC-style stdio protocol; the TUI is a thin client on the same protocol (WebSocket reserved for the upcoming WebUI)
36
36
  - **Context Compression** — Automatic compact to prevent token overflow
37
37
 
@@ -134,6 +134,49 @@ wayang --resume --all # list all sessions to pick
134
134
  `--home-dir <path>` still works as a deprecated alias of `--wayang-root`
135
135
  (identical semantics; the CLI warns once when it is used).
136
136
 
137
+ ## ACP Worker(外部 Agent 接入,0.9.0+)
138
+
139
+ 0.9.0 起,Wayang 支持通过 ACP(Agent Client Protocol)接入外部 agent CLI(codebuddy、opencode),与内置 puppet worker 并存,统一由 Controller 调度。
140
+
141
+ ### 前置条件
142
+
143
+ - codebuddy CLI:安装并完成登录后用 `codebuddy --version` 确认(实测 2.180.0)。
144
+ - opencode CLI:安装并完成配置后用 `opencode --version` 确认(实测 2.2.5)。
145
+
146
+ ### 配置示例
147
+
148
+ 在 `~/.wayang.config.json` 的 `workers` 中加入:
149
+
150
+ ```json
151
+ "workers": {
152
+ "codebuddy": { "type": "codebuddy-acp", "description": "Tencent CodeBuddy Code (ACP)", "capabilities": ["code","refactor","shell"] },
153
+ "opencode": { "type": "opencode-acp", "description": "OpenCode (ACP)", "capabilities": ["code","refactor","shell"] }
154
+ }
155
+ ```
156
+
157
+ ### 启动方式
158
+
159
+ 默认分别以 `codebuddy --acp` / `opencode acp` 启动;如需覆盖,可用 `command` / `args` / `env` 三个字段(不必展开全部),例如给 opencode 子进程注入环境变量:
160
+
161
+ ```json
162
+ "env": { "HTTPS_PROXY": "http://127.0.0.1:7890" }
163
+ ```
164
+
165
+ ### 权限闸
166
+
167
+ ACP worker 的工具调用会经 wayang 的权限闸(`decideToolAccess` + 任务级审批记忆),敏感或越界操作会弹出审批。特别注意 opencode:它自身默认权限是全放行,wayang 默认给它注入 ask-all 的 `OPENCODE_CONFIG`(写入会话目录),把裁决权收回;可用 `"protocol": { "gatePermissions": false }` 关闭,但那样 opencode 的工具操作**不经 wayang 审批**;若父进程已有 `OPENCODE_CONFIG`,wayang 不覆盖并会告警。
168
+
169
+ ### 能力与限制
170
+
171
+ - ACP worker 没有 `update_progress` / `done` 工具,进度与收尾由协议层事件映射处理。
172
+ - `chat_worker` 的消息在回合边界交付,回合内不实时送达。
173
+ - 敏感操作会发起 permission request,Controller 需用 `respond_permission` 处理。
174
+ - 被用户拒绝时任务以 `Permission denied by user: <tool>` 失败(真取消才标记为 `Aborted`)。
175
+
176
+ ### 参考文档
177
+
178
+ 设计文档见 `docs/design/acp/`:03 providers、04 permissions、05 config、07 readiness。
179
+
137
180
  ## Skills
138
181
 
139
182
  **Skills** are on-demand expertise packages (Anthropic-style `SKILL.md` + optional resource scripts) that any agent — Controller or Worker — can load at runtime via the `use_skill` tool. Skills are discovered once at startup and shared across all agents through the in-memory registry.