ai-battle 0.1.8 → 0.2.0

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 +223 -78
  2. package/ai-battle.sh +59 -57
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  <h1 align="center">⚔️ ai-battle</h1>
2
2
 
3
3
  <p align="center">
4
- <strong>让多个 AI Agent 对同一问题进行结构化圆桌讨论</strong>
4
+ <strong>Structured roundtable discussions among multiple AI Agents</strong>
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
- 自动管理轮次 · 检测共识 · 保存全部记录
8
+ Auto-managed rounds · Consensus detection · Full session recording
9
9
  </p>
10
10
 
11
11
  <p align="center">
@@ -15,54 +15,58 @@
15
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow?style=flat-square" alt="MIT License" /></a>
16
16
  </p>
17
17
 
18
+ <p align="center">
19
+ <a href="#-中文文档">📖 中文文档</a>
20
+ </p>
21
+
18
22
  ---
19
23
 
20
24
  ## ✨ Features
21
25
 
22
26
  | Feature | Description |
23
27
  | :--- | :--- |
24
- | 🤖 **多 Agent 圆桌** | 支持 Claude / Codex / Gemini 自由组合 |
25
- | 🔁 **同类自辩** | 同一 Agent 可参加多席位(如 `gemini,gemini`) |
26
- | 🔨 **裁判模式** | 独立裁判每轮总结差异、自动检测共识、生成最终报告 |
27
- | 👁️ **上帝视角** | 每轮结束后人工注入补充信息引导讨论方向 |
28
- | 💾 **Session 录制** | 保存 Agent CLI 原始输出(stream-json / json / raw |
29
- | 🔄 **断点续讨** | 中断后自动恢复到上次轮次继续讨论 |
30
- | 🔌 **可扩展** | 实现 3 个函数 + 注册即可接入新 Agent |
28
+ | 🤖 **Multi-Agent Roundtable** | Mix and match Claude / Codex / Gemini freely |
29
+ | 🔁 **Self-Debate** | Same agent can take multiple seats (e.g. `gemini,gemini`) |
30
+ | 🔨 **Referee Mode** | Independent referee summarizes each round, detects consensus, generates final report |
31
+ | 👁️ **God Mode** | Inject supplementary instructions after each round to steer the discussion |
32
+ | 💾 **Session Recording** | Saves raw Agent CLI output (stream-json / json / raw) |
33
+ | 🔄 **Resume Support** | Automatically resumes from the last round after interruption |
34
+ | 🔌 **Extensible** | Implement 3 functions + register to add a new agent |
31
35
 
32
36
  ## 🚀 Quick Start
33
37
 
34
38
  ```bash
35
- # 创建讨论目录
39
+ # Create a discussion directory
36
40
  mkdir my-topic && cd my-topic
37
41
 
38
- # 写入问题
39
- echo "微服务 vs 单体架构的优缺点?" > problem.md
42
+ # Define the topic
43
+ echo "Microservices vs Monolith: pros and cons?" > problem.md
40
44
 
41
- # 启动讨论(自动拉取最新版)
45
+ # Start the discussion (auto-fetches latest version)
42
46
  npx ai-battle --agents claude,gemini --rounds 8
43
47
  ```
44
48
 
45
49
  ## 📦 Installation
46
50
 
47
- **推荐:无需安装,直接使用 npx**
51
+ **Recommended: No install needed, use npx directly**
48
52
 
49
53
  ```bash
50
54
  npx ai-battle --agents claude,gemini --rounds 5
51
55
  ```
52
56
 
53
- > npx 每次执行自动拉取最新版本,无需手动更新。
57
+ > npx fetches the latest version automatically — no manual updates required.
54
58
 
55
- **全局安装:**
59
+ **Global install:**
56
60
 
57
61
  ```bash
58
62
  npm install -g ai-battle
59
63
  ```
60
64
 
61
- ### 前置依赖
65
+ ### Prerequisites
62
66
 
63
67
  - `bash` 4+
64
68
  - [`jq`](https://jqlang.github.io/jq/)
65
- - Agent CLI 工具(至少安装 2 个):`claude` / `codex` / `gemini`
69
+ - At least 2 Agent CLI tools: `claude` / `codex` / `gemini`
66
70
 
67
71
  ## 📖 Usage
68
72
 
@@ -71,29 +75,29 @@ ai-battle [options]
71
75
  ai-battle help
72
76
  ```
73
77
 
74
- | 参数 | 说明 | 默认值 |
78
+ | Option | Description | Default |
75
79
  | :--- | :--- | :--- |
76
- | `--agents, -a <a1,a2>` | 选择参与的 Agent,支持同类 | `claude,codex` |
77
- | `--rounds, -r <N>` | 最大讨论轮次 | `10` |
78
- | `--god, -g` | 开启上帝视角(每轮可注入补充信息) | — |
79
- | `--referee [agent]` | 开启裁判模式(每轮总结 + 生成 SUMMARY.md | — |
80
+ | `--agents, -a <a1,a2>` | Select participating agents (supports same-type) | `claude,codex` |
81
+ | `--rounds, -r <N>` | Max discussion rounds | `10` |
82
+ | `--god, -g` | Enable god mode (inject info after each round) | — |
83
+ | `--referee [agent]` | Enable referee mode (per-round summary + SUMMARY.md) | — |
80
84
 
81
85
  ### 💡 Examples
82
86
 
83
87
  ```bash
84
- # 同类 Agent 自我辩论
88
+ # Same-type agent self-debate
85
89
  ai-battle --agents gemini,gemini
86
90
 
87
- # 三方圆桌讨论
91
+ # Three-way roundtable
88
92
  ai-battle --agents claude,codex,gemini --rounds 5
89
93
 
90
- # 裁判模式
94
+ # Referee mode
91
95
  ai-battle --agents claude,codex,gemini --referee --rounds 5
92
96
 
93
- # 指定 claude 做裁判
97
+ # Specify claude as referee
94
98
  ai-battle --agents codex,gemini --referee claude --rounds 5
95
99
 
96
- # 上帝视角 + 裁判
100
+ # God mode + Referee
97
101
  ai-battle --agents claude,codex --referee --god
98
102
  ```
99
103
 
@@ -110,52 +114,52 @@ sequenceDiagram
110
114
  U->>S: ai-battle --agents A,B --referee
111
115
 
112
116
  rect rgb(40, 40, 60)
113
- Note over S: 阶段 1: 初始化
114
- S->>S: 加载 .env / 检查 problem.md
115
- S->>A: check_A() 可用性检查
116
- S->>B: check_B() 可用性检查
117
+ Note over S: Phase 1: Initialize
118
+ S->>S: Load .env / Check problem.md
119
+ S->>A: check_A() availability
120
+ S->>B: check_B() availability
117
121
  end
118
122
 
119
123
  rect rgb(30, 50, 40)
120
- Note over S: Round 1: 并发独立思考
124
+ Note over S: Round 1: Concurrent independent thinking
121
125
  par
122
126
  S->>A: call_A(problem)
123
- A-->>S: 回复 A
127
+ A-->>S: Response A
124
128
  and
125
129
  S->>B: call_B(problem)
126
- B-->>S: 回复 B
130
+ B-->>S: Response B
127
131
  end
128
132
  end
129
133
 
130
134
  rect rgb(40, 40, 60)
131
- Note over S: Round 2+: 顺序交互
132
- loop 每个 Agent 依次发言
133
- S->>A: call_A(B 的上轮回复)
134
- A-->>S: 回复 A
135
- S->>B: call_B(A 的最新回复)
136
- B-->>S: 回复 B
135
+ Note over S: Round 2+: Sequential interaction
136
+ loop Each agent takes turn
137
+ S->>A: call_A(B's last response)
138
+ A-->>S: Response A
139
+ S->>B: call_B(A's latest response)
140
+ B-->>S: Response B
137
141
  end
138
142
 
139
- opt --referee 模式
140
- S->>R: call_referee(所有回复)
141
- R-->>S: 裁判总结 / CONSENSUS 判定
143
+ opt --referee mode
144
+ S->>R: call_referee(all responses)
145
+ R-->>S: Summary / CONSENSUS verdict
142
146
  end
143
147
 
144
- opt --god 模式
145
- S->>U: 请输入补充信息
146
- U-->>S: 上帝视角注入
148
+ opt --god mode
149
+ S->>U: Enter supplementary info
150
+ U-->>S: God mode injection
147
151
  end
148
152
  end
149
153
 
150
- alt 达成共识
151
- S->>S: 保存 consensus.md
152
- opt 裁判模式
154
+ alt Consensus reached
155
+ S->>S: Save consensus.md
156
+ opt Referee mode
153
157
  S->>R: generate_final_summary()
154
158
  R-->>S: SUMMARY.md
155
159
  end
156
- S->>U: 🎉 达成共识!
157
- else 未达成
158
- S->>U: 是否追加轮次?
160
+ S->>U: 🎉 Consensus reached!
161
+ else No consensus
162
+ S->>U: Add more rounds?
159
163
  end
160
164
  ```
161
165
 
@@ -171,31 +175,34 @@ sequenceDiagram
171
175
 
172
176
  ```text
173
177
  my-topic/
174
- ├── problem.md # 讨论问题(用户创建)
175
- ├── referee.md # 裁判自定义提示词(可选)
176
- ├── rounds/ # 讨论轮次记录
177
- ├── round_1_claude.md
178
- │ ├── round_1_gemini.md
179
- ├── referee_round_2.md # 裁判总结(--referee)
180
- └── god_round_1.md # 上帝注入(--god)
181
- ├── .sessions/ # Agent CLI 原始输出
182
- ├── consensus.md # 共识结论(如达成)
183
- ├── SUMMARY.md # 最终总结(裁判自动生成)
184
- ├── .debate.json # 状态配置
185
- └── .debate.log # 运行日志(tail -f 实时查看)
178
+ ├── problem.md # Discussion topic (user-created)
179
+ ├── referee.md # Custom referee prompt (optional)
180
+ ├── SUMMARY.md # Final summary (generated by referee)
181
+ ├── .env # Environment variables (auto-loaded)
182
+ └── .ai-battle/ # All runtime artifacts
183
+ ├── rounds/ # Per-round discussion records
184
+ ├── round_1_claude.md
185
+ ├── round_1_gemini.md
186
+ ├── referee_round_2.md # Referee summary (--referee)
187
+ │ └── god_round_1.md # God mode injection (--god)
188
+ ├── sessions/ # Raw Agent CLI output
189
+ ├── agents/ # Agent instruction files
190
+ ├── consensus.md # Consensus conclusion (if reached)
191
+ ├── config.json # Session config
192
+ └── battle.log # Full log (tail -f to watch live)
186
193
  ```
187
194
 
188
195
  ## 🔌 Extend Agent
189
196
 
190
- 只需实现 3 个函数并注册:
197
+ Implement 3 functions and register:
191
198
 
192
199
  ```bash
193
- # 1. 实现函数
194
- check_myagent() { ... } # 可用性检查,返回 0/1
195
- call_myagent() { ... } # 调用 Agent: $1=system_prompt $2=user_msg $3=session_tag
196
- generate_myagent_md() { ... } # 生成指令文件: $1=max_rounds $2=problem
200
+ # 1. Implement functions
201
+ check_myagent() { ... } # Availability check, return 0/1
202
+ call_myagent() { ... } # Call agent: $1=system_prompt $2=user_msg $3=session_tag
203
+ generate_myagent_md() { ... } # Generate instruction file: $1=max_rounds $2=problem
197
204
 
198
- # 2. 注册
205
+ # 2. Register
199
206
  register_agent "myagent"
200
207
  ```
201
208
 
@@ -206,10 +213,10 @@ register_agent "myagent"
206
213
 
207
214
  | Variable | Description |
208
215
  | :--- | :--- |
209
- | `ANTHROPIC_BASE_URL` | API 地址 |
210
- | `ANTHROPIC_AUTH_TOKEN` | 认证 Token |
211
- | `ANTHROPIC_DEFAULT_SONNET_MODEL` | 模型名称 |
212
- | `API_TIMEOUT_MS` | 超时时间(毫秒) |
216
+ | `ANTHROPIC_BASE_URL` | API endpoint |
217
+ | `ANTHROPIC_AUTH_TOKEN` | Auth token |
218
+ | `ANTHROPIC_DEFAULT_SONNET_MODEL` | Model name |
219
+ | `API_TIMEOUT_MS` | Timeout (ms) |
213
220
 
214
221
  </details>
215
222
 
@@ -218,7 +225,7 @@ register_agent "myagent"
218
225
 
219
226
  | Variable | Description | Default |
220
227
  | :--- | :--- | :--- |
221
- | `CODEX_MODEL` | Codex 模型 | `gpt-5.3-codex` |
228
+ | `CODEX_MODEL` | Model name | `gpt-5.3-codex` |
222
229
 
223
230
  </details>
224
231
 
@@ -227,14 +234,152 @@ register_agent "myagent"
227
234
 
228
235
  | Variable | Description |
229
236
  | :--- | :--- |
230
- | `GEMINI_API_KEY` | API Key(如需自定义) |
237
+ | `GEMINI_API_KEY` | API key |
231
238
 
232
239
  </details>
233
240
 
234
241
  ## 🤝 Contributing
235
242
 
236
- 欢迎提交 [Issue](https://github.com/Alfonsxh/ai-battle/issues) [Pull Request](https://github.com/Alfonsxh/ai-battle/pulls)
243
+ [Issues](https://github.com/Alfonsxh/ai-battle/issues) and [Pull Requests](https://github.com/Alfonsxh/ai-battle/pulls) are welcome!
237
244
 
238
245
  ## 📄 License
239
246
 
240
247
  [MIT](LICENSE) © [Alfons](https://github.com/Alfonsxh)
248
+
249
+ ---
250
+
251
+ # 📖 中文文档
252
+
253
+ ## ✨ 特性
254
+
255
+ | 特性 | 说明 |
256
+ | :--- | :--- |
257
+ | 🤖 **多 Agent 圆桌** | 支持 Claude / Codex / Gemini 自由组合 |
258
+ | 🔁 **同类自辩** | 同一 Agent 可参加多席位(如 `gemini,gemini`) |
259
+ | 🔨 **裁判模式** | 独立裁判每轮总结差异、自动检测共识、生成最终报告 |
260
+ | 👁️ **上帝视角** | 每轮结束后人工注入补充信息引导讨论方向 |
261
+ | 💾 **Session 录制** | 保存 Agent CLI 原始输出(stream-json / json / raw) |
262
+ | 🔄 **断点续讨** | 中断后自动恢复到上次轮次继续讨论 |
263
+ | 🔌 **可扩展** | 实现 3 个函数 + 注册即可接入新 Agent |
264
+
265
+ ## 🚀 快速开始
266
+
267
+ ```bash
268
+ # 创建讨论目录
269
+ mkdir my-topic && cd my-topic
270
+
271
+ # 写入问题
272
+ echo "微服务 vs 单体架构的优缺点?" > problem.md
273
+
274
+ # 启动讨论(自动拉取最新版)
275
+ npx ai-battle --agents claude,gemini --rounds 8
276
+ ```
277
+
278
+ ## 📦 安装
279
+
280
+ **推荐:无需安装,直接使用 npx**
281
+
282
+ ```bash
283
+ npx ai-battle --agents claude,gemini --rounds 5
284
+ ```
285
+
286
+ > npx 每次执行自动拉取最新版本,无需手动更新。
287
+
288
+ **全局安装:**
289
+
290
+ ```bash
291
+ npm install -g ai-battle
292
+ ```
293
+
294
+ ### 前置依赖
295
+
296
+ - `bash` 4+
297
+ - [`jq`](https://jqlang.github.io/jq/)
298
+ - Agent CLI 工具(至少安装 2 个):`claude` / `codex` / `gemini`
299
+
300
+ ## 📖 用法
301
+
302
+ ```
303
+ ai-battle [options]
304
+ ai-battle help
305
+ ```
306
+
307
+ | 参数 | 说明 | 默认值 |
308
+ | :--- | :--- | :--- |
309
+ | `--agents, -a <a1,a2>` | 选择参与的 Agent,支持同类 | `claude,codex` |
310
+ | `--rounds, -r <N>` | 最大讨论轮次 | `10` |
311
+ | `--god, -g` | 开启上帝视角(每轮可注入补充信息) | — |
312
+ | `--referee [agent]` | 开启裁判模式(每轮总结 + 生成 SUMMARY.md) | — |
313
+
314
+ ### 💡 示例
315
+
316
+ ```bash
317
+ # 同类 Agent 自我辩论
318
+ ai-battle --agents gemini,gemini
319
+
320
+ # 三方圆桌讨论
321
+ ai-battle --agents claude,codex,gemini --rounds 5
322
+
323
+ # 裁判模式
324
+ ai-battle --agents claude,codex,gemini --referee --rounds 5
325
+
326
+ # 指定 claude 做裁判
327
+ ai-battle --agents codex,gemini --referee claude --rounds 5
328
+
329
+ # 上帝视角 + 裁判
330
+ ai-battle --agents claude,codex --referee --god
331
+ ```
332
+
333
+ ## 📁 产出结构
334
+
335
+ ```text
336
+ my-topic/
337
+ ├── problem.md # 讨论问题(用户创建)
338
+ ├── referee.md # 裁判自定义提示词(可选)
339
+ ├── SUMMARY.md # 最终总结(裁判自动生成)
340
+ ├── .env # 环境变量(启动时自动加载)
341
+ └── .ai-battle/ # 所有运行时产物
342
+ ├── rounds/ # 讨论轮次记录
343
+ │ ├── round_1_claude.md
344
+ │ ├── round_1_gemini.md
345
+ │ ├── referee_round_2.md # 裁判总结(--referee)
346
+ │ └── god_round_1.md # 上帝注入(--god)
347
+ ├── sessions/ # Agent CLI 原始输出
348
+ ├── agents/ # Agent 指令文件
349
+ ├── consensus.md # 共识结论(如达成)
350
+ ├── config.json # 会话配置
351
+ └── battle.log # 运行日志(tail -f 实时查看)
352
+ ```
353
+
354
+ ## 🔌 扩展 Agent
355
+
356
+ 只需实现 3 个函数并注册:
357
+
358
+ ```bash
359
+ # 1. 实现函数
360
+ check_myagent() { ... } # 可用性检查,返回 0/1
361
+ call_myagent() { ... } # 调用 Agent: $1=system_prompt $2=user_msg $3=session_tag
362
+ generate_myagent_md() { ... } # 生成指令文件: $1=max_rounds $2=problem
363
+
364
+ # 2. 注册
365
+ register_agent "myagent"
366
+ ```
367
+
368
+ ## 🔑 环境变量
369
+
370
+ | 变量 | 说明 | 默认值 |
371
+ | :--- | :--- | :--- |
372
+ | `ANTHROPIC_BASE_URL` | Claude API 地址 | — |
373
+ | `ANTHROPIC_AUTH_TOKEN` | Claude 认证 Token | — |
374
+ | `ANTHROPIC_DEFAULT_SONNET_MODEL` | Claude 模型名称 | — |
375
+ | `API_TIMEOUT_MS` | Claude 超时时间(毫秒) | — |
376
+ | `CODEX_MODEL` | Codex 模型名称 | `gpt-5.3-codex` |
377
+ | `GEMINI_API_KEY` | Gemini API Key | — |
378
+
379
+ ## 🤝 参与贡献
380
+
381
+ 欢迎提交 [Issue](https://github.com/Alfonsxh/ai-battle/issues) 和 [Pull Request](https://github.com/Alfonsxh/ai-battle/pulls)!
382
+
383
+ ## 📄 许可
384
+
385
+ [MIT](LICENSE) © [Alfons](https://github.com/Alfonsxh)
package/ai-battle.sh CHANGED
@@ -1731,93 +1731,95 @@ finish_consensus() {
1731
1731
  cmd_help() {
1732
1732
  cat << HELP
1733
1733
 
1734
- ai-battle — AI 圆桌讨论工具 (v${VERSION})
1734
+ ai-battle — AI Roundtable Discussion Tool (v${VERSION})
1735
1735
 
1736
- 让多个 AI Agent 对同一问题进行结构化讨论,自动管理轮次、
1737
- 检测共识、保存全部讨论记录。
1736
+ Facilitate structured discussions among multiple AI Agents on a given
1737
+ topic. Automatically manages rounds, detects consensus, and saves all
1738
+ discussion records.
1738
1739
 
1739
- 前置条件:
1740
- 1. 确保参与讨论的 Agent CLI 工具已安装并可用
1741
- 2. 首次运行会自动弹出编辑器创建讨论问题
1740
+ Prerequisites:
1741
+ 1. Ensure the Agent CLI tools you want to use are installed and available
1742
+ 2. On first run, an editor will open to define the discussion topic
1742
1743
 
1743
- 依赖: jq, bash 4+, (可选) claude, codex, gemini
1744
+ Dependencies: jq, bash 4+, (optional) claude, codex, gemini
1744
1745
 
1745
- 用法:
1746
+ Usage:
1746
1747
  ai-battle [options]
1747
1748
  ai-battle help
1748
1749
 
1749
- 参数:
1750
- --agents, -a <a1,a2> 选择参与的 Agent(默认: claude,codex
1751
- 支持同类 Agent: --agents gemini,gemini
1752
- --rounds, -r <N> 最大讨论轮次(默认: 10
1753
- --god, -g 开启上帝视角(每轮结束后可注入补充信息)
1754
- --referee [agent] 开启裁判模式(每轮总结差异/检测共识,结束时生成最终总结)
1755
- 可选指定裁判使用的 Agent(默认: 第一个参与者)
1756
-
1757
- 已注册 Agent:
1758
- claude 通过 Claude CLI 调用 (需 claude 命令)
1759
- codex 通过 codex exec 调用 ( codex 命令)
1760
- gemini 通过 Gemini CLI 调用 ( gemini 命令)
1761
-
1762
- 使用示例:
1763
- # 快速开始(首次运行会自动弹出编辑器输入问题)
1750
+ Options:
1751
+ --agents, -a <a1,a2> Select participating agents (default: claude,codex)
1752
+ Supports same-type agents: --agents gemini,gemini
1753
+ --rounds, -r <N> Max discussion rounds (default: 10)
1754
+ --god, -g Enable god mode (inject instructions after each round)
1755
+ --referee [agent] Enable referee mode (summarize each round, detect
1756
+ consensus, generate final summary)
1757
+ Optionally specify the referee agent (default: first agent)
1758
+
1759
+ Registered Agents:
1760
+ claude Via Claude CLI (requires 'claude' command)
1761
+ codex Via codex exec (requires 'codex' command)
1762
+ gemini Via Gemini CLI (requires 'gemini' command)
1763
+
1764
+ Examples:
1765
+ # Quick start (editor opens to define the topic on first run)
1764
1766
  mkdir my-topic && cd my-topic
1765
1767
  ai-battle --agents claude,gemini --rounds 8
1766
1768
 
1767
- # 同类 Agent 自我辩论
1769
+ # Same-type agent self-debate
1768
1770
  ai-battle --agents gemini,gemini
1769
1771
 
1770
- # 三方圆桌讨论
1772
+ # Three-way roundtable
1771
1773
  ai-battle --agents claude,codex,gemini --rounds 5
1772
1774
 
1773
- # 裁判模式(每轮总结 + 结束时生成 SUMMARY.md
1775
+ # Referee mode (per-round summary + SUMMARY.md on completion)
1774
1776
  ai-battle --agents claude,codex,gemini --referee --rounds 5
1775
1777
 
1776
- # 指定 claude 做裁判
1778
+ # Specify claude as referee
1777
1779
  ai-battle --agents codex,gemini --referee claude --rounds 5
1778
1780
 
1779
- # 上帝视角(每轮可人工补充信息)
1781
+ # God mode (inject human input after each round)
1780
1782
  ai-battle --agents claude,codex --god
1781
1783
 
1782
- # 裁判 + 上帝视角
1784
+ # Referee + God mode
1783
1785
  ai-battle --agents claude,codex --referee --god
1784
1786
 
1785
- 产出文件:
1786
- .ai-battle/rounds/ 每轮讨论记录 (round_N_<agent>.md)
1787
- .ai-battle/rounds/referee_*.md 裁判总结记录 (--referee)
1788
- .ai-battle/rounds/god_*.md 上帝视角注入记录 (--god)
1789
- .ai-battle/sessions/ Agent CLI 原始输出记录
1790
- .ai-battle/consensus.md 共识结论(如达成)
1791
- .ai-battle/battle.log 完整日志
1792
- SUMMARY.md 最终总结 (裁判自动生成,输出到运行目录)
1793
-
1794
- 用户文件 (运行目录):
1795
- problem.md 讨论问题定义 (首次运行自动创建)
1796
- referee.md 裁判自定义提示词 (--referee 时可选)
1797
- .env 环境变量 (启动时自动加载)
1798
-
1799
- 扩展 Agent:
1800
- 在脚本中实现 check_<name>()call_<name>()generate_<name>_md()
1801
- 然后调用 register_agent "<name>"
1802
-
1803
- 环境变量:
1787
+ Output Files:
1788
+ .ai-battle/rounds/ Per-round records (round_N_<agent>.md)
1789
+ .ai-battle/rounds/referee_*.md Referee summaries (--referee)
1790
+ .ai-battle/rounds/god_*.md God mode injections (--god)
1791
+ .ai-battle/sessions/ Raw Agent CLI output
1792
+ .ai-battle/consensus.md Consensus conclusion (if reached)
1793
+ .ai-battle/battle.log Full log
1794
+ SUMMARY.md Final summary (generated by referee)
1795
+
1796
+ User Files (working directory):
1797
+ problem.md Discussion topic definition (auto-created on first run)
1798
+ referee.md Custom referee prompt (optional, for --referee)
1799
+ .env Environment variables (auto-loaded on startup)
1800
+
1801
+ Extending Agents:
1802
+ Implement check_<name>(), call_<name>(), generate_<name>_md()
1803
+ then call register_agent "<name>"
1804
+
1805
+ Environment Variables:
1804
1806
  Claude:
1805
- ANTHROPIC_BASE_URL API 地址
1806
- ANTHROPIC_AUTH_TOKEN 认证 Token
1807
- ANTHROPIC_DEFAULT_SONNET_MODEL 模型名称
1808
- API_TIMEOUT_MS 超时时间 (毫秒)
1807
+ ANTHROPIC_BASE_URL API endpoint
1808
+ ANTHROPIC_AUTH_TOKEN Auth token
1809
+ ANTHROPIC_DEFAULT_SONNET_MODEL Model name
1810
+ API_TIMEOUT_MS Timeout in milliseconds
1809
1811
 
1810
1812
  Codex:
1811
- CODEX_MODEL 模型名称 (默认: gpt-5.3-codex)
1813
+ CODEX_MODEL Model name (default: gpt-5.3-codex)
1812
1814
 
1813
1815
  Gemini:
1814
- GEMINI_API_KEY API Key (如需自定义)
1816
+ GEMINI_API_KEY API key (if custom endpoint needed)
1815
1817
 
1816
- 项目:
1818
+ Project:
1817
1819
  GitHub: https://github.com/Alfonsxh/ai-battle
1818
1820
  npm: https://www.npmjs.com/package/ai-battle
1819
- 作者: Alfons <alfonsxh@gmail.com>
1820
- 许可: MIT
1821
+ Author: Alfons <alfonsxh@gmail.com>
1822
+ License: MIT
1821
1823
 
1822
1824
  HELP
1823
1825
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-battle",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "让多个 AI Agent 对同一问题进行结构化圆桌讨论",
5
5
  "bin": {
6
6
  "ai-battle": "./ai-battle.sh"