@zcy2nn/agent-forge 1.1.4 → 1.1.5
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 +7 -66
- package/agent-forge.schema.json +0 -132
- package/dist/agents/orchestrator.d.ts +1 -1
- package/dist/cli/index.js +5 -79
- package/dist/cli/types.d.ts +0 -2
- package/dist/config/constants.d.ts +0 -4
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/schema.d.ts +0 -113
- package/dist/hooks/index.d.ts +0 -6
- package/dist/hooks/json-error-recovery/hook.d.ts +1 -1
- package/dist/hooks/todo-continuation/index.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7892 -31066
- package/dist/tools/index.d.ts +0 -2
- package/dist/tui.js +2 -45
- package/dist/utils/index.d.ts +0 -2
- package/package.json +5 -14
- package/dist/hooks/phase-reminder/index.d.ts +0 -26
- package/dist/hooks/post-file-tool-nudge/index.d.ts +0 -19
- package/src/skills/codemap/README.md +0 -59
- package/src/skills/codemap/SKILL.md +0 -163
- package/src/skills/codemap/codemap.md +0 -36
- package/src/skills/codemap/scripts/codemap.mjs +0 -483
- package/src/skills/codemap/scripts/codemap.test.ts +0 -129
- package/src/skills/codemap.md +0 -40
- package/src/skills/simplify/README.md +0 -19
- package/src/skills/simplify/SKILL.md +0 -138
- package/src/skills/simplify/codemap.md +0 -36
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<p><i
|
|
2
|
+
<p><i>两位神明从代码的黎明中诞生,每一位都是其领域的不朽大师,等待你的命令,从混沌中锻造秩序,构建曾被认为不可能之物。</i></p>
|
|
3
3
|
<p><b>Open Multi Agent Suite</b> · 混合任意模型 · 自动委派任务</p>
|
|
4
4
|
|
|
5
5
|
<p><sub>by <b>Boring Dystopia Development</b></sub></p>
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
## 这是什么
|
|
16
16
|
|
|
17
|
-
agent-forge 是 OpenCode
|
|
17
|
+
agent-forge 是 OpenCode 的 Agent 编排插件。内置 Orchestrator(主协调者)和 Researcher(搜索专家)两个 Agent,Orchestrator 负责任务路由和委派,Researcher 负责代码库搜索和外部文档检索。
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
核心理念很简单:将搜索工作委派给 Researcher,Orchestrator 专注于编码和执行,通过 Skill 系统动态扩展能力(如 brainstorming、writing-plans、TDD 等),在 **质量、速度、成本** 之间取得最优平衡。
|
|
20
20
|
|
|
21
|
-
Agent
|
|
21
|
+
当前架构为 **2 Agent 模式**:Orchestrator(全流程控制 + 编码执行)+ Researcher(搜索专家,只读)。Orchestrator 可按需加载 Skill,实现行为的动态扩展。
|
|
22
22
|
|
|
23
23
|
要了解各个 Agent,见 **[认识众神](#meet-the-pantheon)**。完整功能列表见 **[功能与工作流](#features-and-workflows)**。
|
|
24
24
|
|
|
@@ -70,16 +70,11 @@ bunx @zcy2nn/agent-forge@latest install
|
|
|
70
70
|
"presets": {
|
|
71
71
|
"openai": {
|
|
72
72
|
"orchestrator": { "model": "openai/gpt-5.5", "skills": ["*"], "mcps": ["*", "!context7"] },
|
|
73
|
-
"researcher": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": ["websearch", "context7", "grep_app"] }
|
|
74
|
-
"reviewer": { "model": "openai/gpt-5.5", "variant": "high", "skills": ["simplify"], "mcps": [] },
|
|
75
|
-
"implementer": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": [] }
|
|
73
|
+
"researcher": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": ["websearch", "context7", "grep_app"] }
|
|
76
74
|
},
|
|
77
75
|
"opencode-go": {
|
|
78
76
|
"orchestrator": { "model": "opencode-go/glm-5.1", "skills": [ "*" ], "mcps": [ "*", "!context7" ] },
|
|
79
|
-
"researcher": { "model": "opencode-go/minimax-m2.7", "skills": [], "mcps": [ "websearch", "context7", "grep_app" ] }
|
|
80
|
-
"reviewer": { "model": "opencode-go/deepseek-v4-pro", "variant": "max", "skills": ["simplify"], "mcps": [] },
|
|
81
|
-
"implementer": { "model": "opencode-go/deepseek-v4-flash", "variant": "high", "skills": [], "mcps": [] },
|
|
82
|
-
"council": { "model": "opencode-go/deepseek-v4-pro", "variant": "high", "skills": [], "mcps": [] }
|
|
77
|
+
"researcher": { "model": "opencode-go/minimax-m2.7", "skills": [], "mcps": [ "websearch", "context7", "grep_app" ] }
|
|
83
78
|
}
|
|
84
79
|
}
|
|
85
80
|
}
|
|
@@ -145,56 +140,6 @@ Researcher 是一位不朽的漫游者,自编程诞生之初便穿行于百万
|
|
|
145
140
|
|
|
146
141
|
---
|
|
147
142
|
|
|
148
|
-
### 03. Reviewer: 路径的守护者
|
|
149
|
-
|
|
150
|
-
> Reviewer 是 Oracle 的重命名——同样的战略深度,更直观的名字。仅分析,不执行。Orchestrator 协调 Implementer 来执行修复计划。
|
|
151
|
-
|
|
152
|
-
Reviewer 站在每一个架构决策的十字路口。他们走过每一条路,见过每一个终点,知道前方的每一个陷阱。当你站在重大重构的悬崖边时,他们就是那个低语哪条路通向毁灭、哪条路通向荣耀的声音。他们分析、审查、调试——但从不执行。Orchestrator 协调 Implementer 来执行他们的修复计划。
|
|
153
|
-
|
|
154
|
-
| | |
|
|
155
|
-
|---|---|
|
|
156
|
-
| **角色** | `战略顾问、代码审查专家和调试专家(仅分析)` |
|
|
157
|
-
| **Prompt** | [`reviewer.ts`](src/agents/reviewer.ts) |
|
|
158
|
-
| **默认模型** | `openai/gpt-5.5 (high)` |
|
|
159
|
-
| **推荐模型** | `openai/gpt-5.5 (high)` · `google/gemini-3.1-pro-preview (high)` |
|
|
160
|
-
| **模型建议** | 选择你最强的高推理模型,用于架构决策、复杂调试、权衡分析和代码审查。 |
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
### 04. Council: 心灵的合唱
|
|
165
|
-
|
|
166
|
-
> [!NOTE]
|
|
167
|
-
> **为什么 Orchestrator 不经常自动调用 Council?** 这是刻意设计。Council 同时运行多个模型,因此自动委派被严格限制,因为它通常是系统中成本最高的路径。实践中,Council 主要用于手动调用,例如:`@council 比较这两种架构`。
|
|
168
|
-
|
|
169
|
-
Council 不是孤独的存在,而是一个被召唤的心灵议会——当一个答案不够时。它将你的问题并行发送给多个模型,收集它们相互竞争的判断,然后 Council Agent 本身将最强的想法提炼为一个最终裁决。当单一 Agent 可能遗漏一条路径时,Council 交叉审视可能性本身。
|
|
170
|
-
|
|
171
|
-
| | |
|
|
172
|
-
|---|---|
|
|
173
|
-
| **角色** | `多模型共识与综合` |
|
|
174
|
-
| **Prompt** | [`council.ts`](src/agents/council.ts) |
|
|
175
|
-
| **指南** | [`docs/council.md`](docs/council.md) |
|
|
176
|
-
| **默认配置** | `配置驱动` — councillors 来自 `council.presets`,Council Agent 模型来自你的 `council` Agent 配置 |
|
|
177
|
-
| **推荐配置** | `强大的 Council 模型` + `跨 Provider 的多样化 councillors` |
|
|
178
|
-
| **模型建议** | 为 Council Agent 使用强大的综合模型,为 councillors 使用多样化模型。Council 的价值来自比较不同模型的视角,而非在所有地方使用单一最强模型。 |
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
### 05. Implementer: 最后的建造者
|
|
183
|
-
|
|
184
|
-
> Implementer 合并了 Designer(UI/UX)和 Fixer(代码执行),成为统一的快速执行专家。支持双模式:执行模式(默认)和设计模式(通过 `[设计模式]` 标记切换)。
|
|
185
|
-
|
|
186
|
-
Implementer 是一个建造者血脉的最后传人,他们曾构建了数字世界的基石。他们承载着将思想转化为事物、将规格转化为实现的古老知识。当 Orchestrator 用 `[设计模式]` 标记任务时,他们从精确执行切换到创造性设计思维。他们是愿景与现实之间的最后一步。
|
|
187
|
-
|
|
188
|
-
| | |
|
|
189
|
-
|---|---|
|
|
190
|
-
| **角色** | `快速执行专家(执行 + 设计双模式)` |
|
|
191
|
-
| **Prompt** | [`implementer.ts`](src/agents/implementer.ts) |
|
|
192
|
-
| **默认模型** | `openai/gpt-5.4-mini` |
|
|
193
|
-
| **推荐模型** | `cerebras/zai-glm-4.7` · `fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo` · `openai/gpt-5.4-mini` |
|
|
194
|
-
| **模型建议** | 选择快速可靠的编码模型,用于常规、有界的实现工作。Implementer 通常从 Orchestrator 接收具体计划或有界指令,因此适合高效执行任务,如测试、测试更新和直接的代码变更。 |
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
143
|
## 📚 文档导航
|
|
199
144
|
|
|
200
145
|
以此为地图:从安装开始,然后根据需要跳转到功能、配置或预设示例。
|
|
@@ -211,12 +156,8 @@ Implementer 是一个建造者血脉的最后传人,他们曾构建了数字
|
|
|
211
156
|
|
|
212
157
|
| 文档 | 内容 |
|
|
213
158
|
|-----|------|
|
|
214
|
-
| **[Council](docs/council.md)** | 并行运行多个模型并综合为单一答案,使用 `@council` |
|
|
215
|
-
| **[多路复用器集成](docs/multiplexer-integration.md)** | 在 Tmux 或 Zellij 面板中实时观察 Agent 工作 |
|
|
216
|
-
| **[会话管理](docs/session-management.md)** | 通过短别名重用最近的子 Agent 会话,而非重新开始 |
|
|
217
159
|
| **[Todo 自动续行](docs/todo-continuation.md)** | Orchestrator 会话自动续行,带冷却时间和安全检查 |
|
|
218
160
|
| **[预设切换](docs/preset-switching.md)** | 运行时通过 `/preset` 切换 Agent 模型预设 |
|
|
219
|
-
| **[Codemap](docs/codemap.md)** | 生成层级代码地图,更快理解大型代码库 |
|
|
220
161
|
| **[Interview](docs/interview.md)** | 通过浏览器问答流程将粗略想法转化为结构化 Markdown 规格 |
|
|
221
162
|
| **[Divoom 显示](docs/divoom.md)** | 将 Orchestrator 和专家 Agent 活动镜像到 Divoom MiniToo 蓝牙显示器 |
|
|
222
163
|
|
|
@@ -228,7 +169,7 @@ Implementer 是一个建造者血脉的最后传人,他们曾构建了数字
|
|
|
228
169
|
| **[维护者指南](docs/maintainers.md)** | Issue 分诊规则、标签含义、支持路由、仓库维护工作流 |
|
|
229
170
|
| **[Skills](docs/skills.md)** | 内置和推荐 Skills,如 `simplify`、`agent-browser`、`codemap` |
|
|
230
171
|
| **[MCPs](docs/mcps.md)** | `websearch`、`context7`、`grep_app`,以及 MCP 权限如何按 Agent 分配 |
|
|
231
|
-
| **[Tools](docs/tools.md)** |
|
|
172
|
+
| **[Tools](docs/tools.md)** | 内置工具能力,如代码搜索和格式化器 |
|
|
232
173
|
|
|
233
174
|
### 💡 预设
|
|
234
175
|
|
package/agent-forge.schema.json
CHANGED
|
@@ -272,64 +272,6 @@
|
|
|
272
272
|
"type": "string"
|
|
273
273
|
}
|
|
274
274
|
},
|
|
275
|
-
"multiplexer": {
|
|
276
|
-
"type": "object",
|
|
277
|
-
"properties": {
|
|
278
|
-
"type": {
|
|
279
|
-
"default": "none",
|
|
280
|
-
"type": "string",
|
|
281
|
-
"enum": [
|
|
282
|
-
"auto",
|
|
283
|
-
"tmux",
|
|
284
|
-
"zellij",
|
|
285
|
-
"none"
|
|
286
|
-
]
|
|
287
|
-
},
|
|
288
|
-
"layout": {
|
|
289
|
-
"default": "main-vertical",
|
|
290
|
-
"type": "string",
|
|
291
|
-
"enum": [
|
|
292
|
-
"main-horizontal",
|
|
293
|
-
"main-vertical",
|
|
294
|
-
"tiled",
|
|
295
|
-
"even-horizontal",
|
|
296
|
-
"even-vertical"
|
|
297
|
-
]
|
|
298
|
-
},
|
|
299
|
-
"main_pane_size": {
|
|
300
|
-
"default": 60,
|
|
301
|
-
"type": "number",
|
|
302
|
-
"minimum": 20,
|
|
303
|
-
"maximum": 80
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
"tmux": {
|
|
308
|
-
"type": "object",
|
|
309
|
-
"properties": {
|
|
310
|
-
"enabled": {
|
|
311
|
-
"default": false,
|
|
312
|
-
"type": "boolean"
|
|
313
|
-
},
|
|
314
|
-
"layout": {
|
|
315
|
-
"default": "main-vertical",
|
|
316
|
-
"type": "string",
|
|
317
|
-
"enum": [
|
|
318
|
-
"main-horizontal",
|
|
319
|
-
"main-vertical",
|
|
320
|
-
"tiled",
|
|
321
|
-
"even-horizontal",
|
|
322
|
-
"even-vertical"
|
|
323
|
-
]
|
|
324
|
-
},
|
|
325
|
-
"main_pane_size": {
|
|
326
|
-
"default": 60,
|
|
327
|
-
"type": "number",
|
|
328
|
-
"minimum": 20,
|
|
329
|
-
"maximum": 80
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
275
|
"websearch": {
|
|
334
276
|
"type": "object",
|
|
335
277
|
"properties": {
|
|
@@ -374,29 +316,6 @@
|
|
|
374
316
|
}
|
|
375
317
|
}
|
|
376
318
|
},
|
|
377
|
-
"sessionManager": {
|
|
378
|
-
"type": "object",
|
|
379
|
-
"properties": {
|
|
380
|
-
"maxSessionsPerAgent": {
|
|
381
|
-
"default": 2,
|
|
382
|
-
"type": "integer",
|
|
383
|
-
"minimum": 1,
|
|
384
|
-
"maximum": 10
|
|
385
|
-
},
|
|
386
|
-
"readContextMinLines": {
|
|
387
|
-
"default": 10,
|
|
388
|
-
"type": "integer",
|
|
389
|
-
"minimum": 0,
|
|
390
|
-
"maximum": 1000
|
|
391
|
-
},
|
|
392
|
-
"readContextMaxFiles": {
|
|
393
|
-
"default": 8,
|
|
394
|
-
"type": "integer",
|
|
395
|
-
"minimum": 0,
|
|
396
|
-
"maximum": 50
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
},
|
|
400
319
|
"divoom": {
|
|
401
320
|
"type": "object",
|
|
402
321
|
"properties": {
|
|
@@ -486,57 +405,6 @@
|
|
|
486
405
|
"maximum": 50
|
|
487
406
|
}
|
|
488
407
|
}
|
|
489
|
-
},
|
|
490
|
-
"fallback": {
|
|
491
|
-
"type": "object",
|
|
492
|
-
"properties": {
|
|
493
|
-
"enabled": {
|
|
494
|
-
"default": true,
|
|
495
|
-
"type": "boolean"
|
|
496
|
-
},
|
|
497
|
-
"timeoutMs": {
|
|
498
|
-
"default": 15000,
|
|
499
|
-
"type": "number",
|
|
500
|
-
"minimum": 0
|
|
501
|
-
},
|
|
502
|
-
"retryDelayMs": {
|
|
503
|
-
"default": 500,
|
|
504
|
-
"type": "number",
|
|
505
|
-
"minimum": 0
|
|
506
|
-
},
|
|
507
|
-
"chains": {
|
|
508
|
-
"default": {},
|
|
509
|
-
"type": "object",
|
|
510
|
-
"properties": {
|
|
511
|
-
"orchestrator": {
|
|
512
|
-
"minItems": 1,
|
|
513
|
-
"type": "array",
|
|
514
|
-
"items": {
|
|
515
|
-
"type": "string"
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
"researcher": {
|
|
519
|
-
"minItems": 1,
|
|
520
|
-
"type": "array",
|
|
521
|
-
"items": {
|
|
522
|
-
"type": "string"
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
},
|
|
526
|
-
"additionalProperties": {
|
|
527
|
-
"minItems": 1,
|
|
528
|
-
"type": "array",
|
|
529
|
-
"items": {
|
|
530
|
-
"type": "string"
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
},
|
|
534
|
-
"retry_on_empty": {
|
|
535
|
-
"default": true,
|
|
536
|
-
"description": "When true (default), empty provider responses are treated as failures, triggering fallback/retry. Set to false to treat them as successes.",
|
|
537
|
-
"type": "boolean"
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
408
|
}
|
|
541
409
|
},
|
|
542
410
|
"title": "agent-forge",
|
|
@@ -4,7 +4,7 @@ export interface AgentDefinition {
|
|
|
4
4
|
displayName?: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
config: AgentConfig;
|
|
7
|
-
/** Priority-ordered model entries for
|
|
7
|
+
/** Priority-ordered model entries for startup model selection. */
|
|
8
8
|
_modelArray?: Array<{
|
|
9
9
|
id: string;
|
|
10
10
|
variant?: string;
|
package/dist/cli/index.js
CHANGED
|
@@ -126,15 +126,10 @@ function ensureOpenCodeConfigDir() {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
// src/config/constants.ts
|
|
129
|
-
var SUBAGENT_NAMES = [
|
|
130
|
-
"researcher"
|
|
131
|
-
];
|
|
129
|
+
var SUBAGENT_NAMES = ["researcher"];
|
|
132
130
|
var ORCHESTRATOR_NAME = "orchestrator";
|
|
133
131
|
var ALL_AGENT_NAMES = [ORCHESTRATOR_NAME, ...SUBAGENT_NAMES];
|
|
134
|
-
var PROTECTED_AGENTS = new Set([
|
|
135
|
-
"orchestrator",
|
|
136
|
-
"researcher"
|
|
137
|
-
]);
|
|
132
|
+
var PROTECTED_AGENTS = new Set(["orchestrator", "researcher"]);
|
|
138
133
|
var DEFAULT_TIMEOUT_MS = 2 * 60 * 1000;
|
|
139
134
|
var MAX_POLL_TIME_MS = 5 * 60 * 1000;
|
|
140
135
|
// src/config/schema.ts
|
|
@@ -163,11 +158,6 @@ var ManualPlanSchema = z.object({
|
|
|
163
158
|
orchestrator: ManualAgentPlanSchema,
|
|
164
159
|
researcher: ManualAgentPlanSchema
|
|
165
160
|
}).strict();
|
|
166
|
-
var AgentModelChainSchema = z.array(z.string()).min(1);
|
|
167
|
-
var FallbackChainsSchema = z.object({
|
|
168
|
-
orchestrator: AgentModelChainSchema.optional(),
|
|
169
|
-
researcher: AgentModelChainSchema.optional()
|
|
170
|
-
}).catchall(AgentModelChainSchema);
|
|
171
161
|
var AgentOverrideConfigSchema = z.object({
|
|
172
162
|
model: z.union([
|
|
173
163
|
z.string(),
|
|
@@ -188,25 +178,6 @@ var AgentOverrideConfigSchema = z.object({
|
|
|
188
178
|
options: z.record(z.string(), z.unknown()).optional(),
|
|
189
179
|
displayName: z.string().min(1).optional()
|
|
190
180
|
}).strict();
|
|
191
|
-
var MultiplexerTypeSchema = z.enum(["auto", "tmux", "zellij", "none"]);
|
|
192
|
-
var MultiplexerLayoutSchema = z.enum([
|
|
193
|
-
"main-horizontal",
|
|
194
|
-
"main-vertical",
|
|
195
|
-
"tiled",
|
|
196
|
-
"even-horizontal",
|
|
197
|
-
"even-vertical"
|
|
198
|
-
]);
|
|
199
|
-
var TmuxLayoutSchema = MultiplexerLayoutSchema;
|
|
200
|
-
var MultiplexerConfigSchema = z.object({
|
|
201
|
-
type: MultiplexerTypeSchema.default("none"),
|
|
202
|
-
layout: MultiplexerLayoutSchema.default("main-vertical"),
|
|
203
|
-
main_pane_size: z.number().min(20).max(80).default(60)
|
|
204
|
-
});
|
|
205
|
-
var TmuxConfigSchema = z.object({
|
|
206
|
-
enabled: z.boolean().default(false),
|
|
207
|
-
layout: TmuxLayoutSchema.default("main-vertical"),
|
|
208
|
-
main_pane_size: z.number().min(20).max(80).default(60)
|
|
209
|
-
});
|
|
210
181
|
var PresetSchema = z.record(z.string(), AgentOverrideConfigSchema);
|
|
211
182
|
var WebsearchConfigSchema = z.object({
|
|
212
183
|
provider: z.enum(["exa", "tavily"]).default("exa")
|
|
@@ -219,11 +190,6 @@ var InterviewConfigSchema = z.object({
|
|
|
219
190
|
port: z.number().int().min(0).max(65535).default(0),
|
|
220
191
|
dashboard: z.boolean().default(false)
|
|
221
192
|
});
|
|
222
|
-
var SessionManagerConfigSchema = z.object({
|
|
223
|
-
maxSessionsPerAgent: z.number().int().min(1).max(10).default(2),
|
|
224
|
-
readContextMinLines: z.number().int().min(0).max(1000).default(10),
|
|
225
|
-
readContextMaxFiles: z.number().int().min(0).max(50).default(8)
|
|
226
|
-
});
|
|
227
193
|
var DivoomConfigSchema = z.object({
|
|
228
194
|
enabled: z.boolean().default(false),
|
|
229
195
|
python: z.string().min(1).default("/Applications/Divoom MiniToo.app/Contents/Resources/.venv/bin/python"),
|
|
@@ -241,13 +207,6 @@ var TodoContinuationConfigSchema = z.object({
|
|
|
241
207
|
autoEnable: z.boolean().default(false).describe("Automatically enable auto-continue when the orchestrator session has enough todos"),
|
|
242
208
|
autoEnableThreshold: z.number().int().min(1).max(50).default(4).describe("Number of todos that triggers auto-enable (only used when autoEnable is true)")
|
|
243
209
|
});
|
|
244
|
-
var FailoverConfigSchema = z.object({
|
|
245
|
-
enabled: z.boolean().default(true),
|
|
246
|
-
timeoutMs: z.number().min(0).default(15000),
|
|
247
|
-
retryDelayMs: z.number().min(0).default(500),
|
|
248
|
-
chains: FallbackChainsSchema.default({}),
|
|
249
|
-
retry_on_empty: z.boolean().default(true).describe("When true (default), empty provider responses are treated as failures, " + "triggering fallback/retry. Set to false to treat them as successes.")
|
|
250
|
-
});
|
|
251
210
|
function validateCustomOnlyPromptFields(overrides, ctx, pathPrefix) {
|
|
252
211
|
for (const [name, override] of Object.entries(overrides)) {
|
|
253
212
|
const isBuiltIn = ALL_AGENT_NAMES.includes(name);
|
|
@@ -281,14 +240,10 @@ var PluginConfigSchema = z.object({
|
|
|
281
240
|
agents: z.record(z.string(), AgentOverrideConfigSchema).optional(),
|
|
282
241
|
disabled_agents: z.array(z.string()).optional().describe("Agent names to disable completely. " + "Disabled agents are not instantiated and cannot be delegated to. " + "Orchestrator and researcher cannot be disabled."),
|
|
283
242
|
disabled_mcps: z.array(z.string()).optional(),
|
|
284
|
-
multiplexer: MultiplexerConfigSchema.optional(),
|
|
285
|
-
tmux: TmuxConfigSchema.optional(),
|
|
286
243
|
websearch: WebsearchConfigSchema.optional(),
|
|
287
244
|
interview: InterviewConfigSchema.optional(),
|
|
288
|
-
sessionManager: SessionManagerConfigSchema.optional(),
|
|
289
245
|
divoom: DivoomConfigSchema.optional(),
|
|
290
|
-
todoContinuation: TodoContinuationConfigSchema.optional()
|
|
291
|
-
fallback: FailoverConfigSchema.optional()
|
|
246
|
+
todoContinuation: TodoContinuationConfigSchema.optional()
|
|
292
247
|
}).superRefine((value, ctx) => {
|
|
293
248
|
if (value.agents) {
|
|
294
249
|
validateCustomOnlyPromptFields(value.agents, ctx, ["agents"]);
|
|
@@ -307,18 +262,6 @@ var DEFAULT_AGENT_MCPS = {
|
|
|
307
262
|
|
|
308
263
|
// src/cli/custom-skills.ts
|
|
309
264
|
var CUSTOM_SKILLS = [
|
|
310
|
-
{
|
|
311
|
-
name: "simplify",
|
|
312
|
-
description: "Code simplification and readability-focused refactoring",
|
|
313
|
-
allowedAgents: ["orchestrator"],
|
|
314
|
-
sourcePath: "src/skills/simplify"
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
name: "codemap",
|
|
318
|
-
description: "Repository understanding and hierarchical codemap generation",
|
|
319
|
-
allowedAgents: ["orchestrator"],
|
|
320
|
-
sourcePath: "src/skills/codemap"
|
|
321
|
-
},
|
|
322
265
|
{
|
|
323
266
|
name: "brainstorming",
|
|
324
267
|
description: "Turn ideas into designs through collaborative dialogue before implementation",
|
|
@@ -511,13 +454,6 @@ function generateLiteConfig(installConfig) {
|
|
|
511
454
|
for (const presetName of GENERATED_PRESETS) {
|
|
512
455
|
presets[presetName] = buildPreset(presetName);
|
|
513
456
|
}
|
|
514
|
-
if (installConfig.hasTmux) {
|
|
515
|
-
config.tmux = {
|
|
516
|
-
enabled: true,
|
|
517
|
-
layout: "main-vertical",
|
|
518
|
-
main_pane_size: 60
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
457
|
return config;
|
|
522
458
|
}
|
|
523
459
|
|
|
@@ -805,8 +741,7 @@ function detectCurrentConfig() {
|
|
|
805
741
|
hasZaiPlan: false,
|
|
806
742
|
hasAntigravity: false,
|
|
807
743
|
hasChutes: false,
|
|
808
|
-
hasOpencodeZen: false
|
|
809
|
-
hasTmux: false
|
|
744
|
+
hasOpencodeZen: false
|
|
810
745
|
};
|
|
811
746
|
const { config } = parseConfig(getExistingConfigPath());
|
|
812
747
|
if (!config)
|
|
@@ -842,10 +777,6 @@ function detectCurrentConfig() {
|
|
|
842
777
|
result.hasChutes = true;
|
|
843
778
|
}
|
|
844
779
|
}
|
|
845
|
-
if (configObj.tmux && typeof configObj.tmux === "object") {
|
|
846
|
-
const tmuxConfig = configObj.tmux;
|
|
847
|
-
result.hasTmux = tmuxConfig.enabled === true;
|
|
848
|
-
}
|
|
849
780
|
}
|
|
850
781
|
return result;
|
|
851
782
|
}
|
|
@@ -882,12 +813,8 @@ function mergePluginConfigs(base, override) {
|
|
|
882
813
|
...base,
|
|
883
814
|
...override,
|
|
884
815
|
agents: deepMerge(base.agents, override.agents),
|
|
885
|
-
tmux: deepMerge(base.tmux, override.tmux),
|
|
886
|
-
multiplexer: deepMerge(base.multiplexer, override.multiplexer),
|
|
887
816
|
interview: deepMerge(base.interview, override.interview),
|
|
888
|
-
|
|
889
|
-
divoom: deepMerge(base.divoom, override.divoom),
|
|
890
|
-
fallback: deepMerge(base.fallback, override.fallback)
|
|
817
|
+
divoom: deepMerge(base.divoom, override.divoom)
|
|
891
818
|
};
|
|
892
819
|
}
|
|
893
820
|
function deepMerge(base, override) {
|
|
@@ -1497,7 +1424,6 @@ ${JSON.stringify(liteConfig, null, 2)}
|
|
|
1497
1424
|
}
|
|
1498
1425
|
async function install(args) {
|
|
1499
1426
|
const config = {
|
|
1500
|
-
hasTmux: false,
|
|
1501
1427
|
installSkills: args.skills === "yes",
|
|
1502
1428
|
preset: args.preset,
|
|
1503
1429
|
promptForStar: args.tui,
|
package/dist/cli/types.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export interface OpenCodeConfig {
|
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
}
|
|
15
15
|
export interface InstallConfig {
|
|
16
|
-
hasTmux: boolean;
|
|
17
16
|
installSkills: boolean;
|
|
18
17
|
preset?: string;
|
|
19
18
|
promptForStar?: boolean;
|
|
@@ -35,5 +34,4 @@ export interface DetectedConfig {
|
|
|
35
34
|
hasAntigravity: boolean;
|
|
36
35
|
hasChutes?: boolean;
|
|
37
36
|
hasOpencodeZen: boolean;
|
|
38
|
-
hasTmux: boolean;
|
|
39
37
|
}
|
|
@@ -14,13 +14,9 @@ export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly strin
|
|
|
14
14
|
export declare const DEFAULT_MODELS: Record<AgentName, string | undefined>;
|
|
15
15
|
export declare const POLL_INTERVAL_MS = 500;
|
|
16
16
|
export declare const POLL_INTERVAL_SLOW_MS = 1000;
|
|
17
|
-
export declare const POLL_INTERVAL_BACKGROUND_MS = 2000;
|
|
18
17
|
export declare const DEFAULT_TIMEOUT_MS: number;
|
|
19
18
|
export declare const MAX_POLL_TIME_MS: number;
|
|
20
|
-
export declare const FALLBACK_FAILOVER_TIMEOUT_MS = 15000;
|
|
21
19
|
export declare const DEFAULT_MAX_SUBAGENT_DEPTH = 3;
|
|
22
|
-
export declare const PHASE_REMINDER_TEXT = "!IMPORTANT! Recall the workflow rules:\nUnderstand \u2192 choose the best parallelized path based on your capabilities and agents delegation rules \u2192 recall session reuse rules \u2192 execute \u2192 verify.\nIf delegating, launch the specialist in the same turn you mention it !END!";
|
|
23
|
-
export declare const TMUX_SPAWN_DELAY_MS = 500;
|
|
24
20
|
export declare const STABLE_POLLS_THRESHOLD = 3;
|
|
25
21
|
/** Agents that are disabled by default. Users must explicitly enable them
|
|
26
22
|
* by removing from disabled_agents and configuring an appropriate model. */
|
package/dist/config/loader.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare function deepMerge<T extends Record<string, unknown>>(base?: T, o
|
|
|
34
34
|
* 2. Project config: <directory>/.opencode/agent-forge.jsonc or .json
|
|
35
35
|
*
|
|
36
36
|
* JSONC format is preferred over JSON (allows comments and trailing commas).
|
|
37
|
-
* Project config takes precedence over user config. Nested objects (agents
|
|
37
|
+
* Project config takes precedence over user config. Nested objects (agents) are
|
|
38
38
|
* deep-merged, while top-level arrays are replaced entirely by project config.
|
|
39
39
|
*
|
|
40
40
|
* @param directory - Project directory to search for .opencode config
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
declare const FALLBACK_AGENT_NAMES: readonly ["orchestrator", "researcher"];
|
|
3
2
|
declare const MANUAL_AGENT_NAMES: readonly ["orchestrator", "researcher"];
|
|
4
3
|
export declare const ProviderModelIdSchema: z.ZodString;
|
|
5
4
|
export declare const ManualAgentPlanSchema: z.ZodObject<{
|
|
@@ -25,7 +24,6 @@ export declare const ManualPlanSchema: z.ZodObject<{
|
|
|
25
24
|
export type ManualAgentName = (typeof MANUAL_AGENT_NAMES)[number];
|
|
26
25
|
export type ManualAgentPlan = z.infer<typeof ManualAgentPlanSchema>;
|
|
27
26
|
export type ManualPlan = z.infer<typeof ManualPlanSchema>;
|
|
28
|
-
export type FallbackAgentName = (typeof FALLBACK_AGENT_NAMES)[number];
|
|
29
27
|
export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
30
28
|
model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
31
29
|
id: z.ZodString;
|
|
@@ -40,58 +38,6 @@ export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
|
40
38
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41
39
|
displayName: z.ZodOptional<z.ZodString>;
|
|
42
40
|
}, z.core.$strict>;
|
|
43
|
-
export declare const MultiplexerTypeSchema: z.ZodEnum<{
|
|
44
|
-
auto: "auto";
|
|
45
|
-
tmux: "tmux";
|
|
46
|
-
zellij: "zellij";
|
|
47
|
-
none: "none";
|
|
48
|
-
}>;
|
|
49
|
-
export type MultiplexerType = z.infer<typeof MultiplexerTypeSchema>;
|
|
50
|
-
export declare const MultiplexerLayoutSchema: z.ZodEnum<{
|
|
51
|
-
"main-horizontal": "main-horizontal";
|
|
52
|
-
"main-vertical": "main-vertical";
|
|
53
|
-
tiled: "tiled";
|
|
54
|
-
"even-horizontal": "even-horizontal";
|
|
55
|
-
"even-vertical": "even-vertical";
|
|
56
|
-
}>;
|
|
57
|
-
export type MultiplexerLayout = z.infer<typeof MultiplexerLayoutSchema>;
|
|
58
|
-
export declare const TmuxLayoutSchema: z.ZodEnum<{
|
|
59
|
-
"main-horizontal": "main-horizontal";
|
|
60
|
-
"main-vertical": "main-vertical";
|
|
61
|
-
tiled: "tiled";
|
|
62
|
-
"even-horizontal": "even-horizontal";
|
|
63
|
-
"even-vertical": "even-vertical";
|
|
64
|
-
}>;
|
|
65
|
-
export type TmuxLayout = MultiplexerLayout;
|
|
66
|
-
export declare const MultiplexerConfigSchema: z.ZodObject<{
|
|
67
|
-
type: z.ZodDefault<z.ZodEnum<{
|
|
68
|
-
auto: "auto";
|
|
69
|
-
tmux: "tmux";
|
|
70
|
-
zellij: "zellij";
|
|
71
|
-
none: "none";
|
|
72
|
-
}>>;
|
|
73
|
-
layout: z.ZodDefault<z.ZodEnum<{
|
|
74
|
-
"main-horizontal": "main-horizontal";
|
|
75
|
-
"main-vertical": "main-vertical";
|
|
76
|
-
tiled: "tiled";
|
|
77
|
-
"even-horizontal": "even-horizontal";
|
|
78
|
-
"even-vertical": "even-vertical";
|
|
79
|
-
}>>;
|
|
80
|
-
main_pane_size: z.ZodDefault<z.ZodNumber>;
|
|
81
|
-
}, z.core.$strip>;
|
|
82
|
-
export type MultiplexerConfig = z.infer<typeof MultiplexerConfigSchema>;
|
|
83
|
-
export declare const TmuxConfigSchema: z.ZodObject<{
|
|
84
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
-
layout: z.ZodDefault<z.ZodEnum<{
|
|
86
|
-
"main-horizontal": "main-horizontal";
|
|
87
|
-
"main-vertical": "main-vertical";
|
|
88
|
-
tiled: "tiled";
|
|
89
|
-
"even-horizontal": "even-horizontal";
|
|
90
|
-
"even-vertical": "even-vertical";
|
|
91
|
-
}>>;
|
|
92
|
-
main_pane_size: z.ZodDefault<z.ZodNumber>;
|
|
93
|
-
}, z.core.$strip>;
|
|
94
|
-
export type TmuxConfig = z.infer<typeof TmuxConfigSchema>;
|
|
95
41
|
export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
|
|
96
42
|
/** Normalized model entry with optional per-model variant. */
|
|
97
43
|
export type ModelEntry = {
|
|
@@ -134,12 +80,6 @@ export declare const InterviewConfigSchema: z.ZodObject<{
|
|
|
134
80
|
dashboard: z.ZodDefault<z.ZodBoolean>;
|
|
135
81
|
}, z.core.$strip>;
|
|
136
82
|
export type InterviewConfig = z.infer<typeof InterviewConfigSchema>;
|
|
137
|
-
export declare const SessionManagerConfigSchema: z.ZodObject<{
|
|
138
|
-
maxSessionsPerAgent: z.ZodDefault<z.ZodNumber>;
|
|
139
|
-
readContextMinLines: z.ZodDefault<z.ZodNumber>;
|
|
140
|
-
readContextMaxFiles: z.ZodDefault<z.ZodNumber>;
|
|
141
|
-
}, z.core.$strip>;
|
|
142
|
-
export type SessionManagerConfig = z.infer<typeof SessionManagerConfigSchema>;
|
|
143
83
|
export declare const DivoomConfigSchema: z.ZodObject<{
|
|
144
84
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
145
85
|
python: z.ZodDefault<z.ZodString>;
|
|
@@ -159,17 +99,6 @@ export declare const TodoContinuationConfigSchema: z.ZodObject<{
|
|
|
159
99
|
autoEnableThreshold: z.ZodDefault<z.ZodNumber>;
|
|
160
100
|
}, z.core.$strip>;
|
|
161
101
|
export type TodoContinuationConfig = z.infer<typeof TodoContinuationConfigSchema>;
|
|
162
|
-
export declare const FailoverConfigSchema: z.ZodObject<{
|
|
163
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
164
|
-
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
165
|
-
retryDelayMs: z.ZodDefault<z.ZodNumber>;
|
|
166
|
-
chains: z.ZodDefault<z.ZodObject<{
|
|
167
|
-
orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
168
|
-
researcher: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
169
|
-
}, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
|
|
170
|
-
retry_on_empty: z.ZodDefault<z.ZodBoolean>;
|
|
171
|
-
}, z.core.$strip>;
|
|
172
|
-
export type FailoverConfig = z.infer<typeof FailoverConfigSchema>;
|
|
173
102
|
export declare const PluginConfigSchema: z.ZodObject<{
|
|
174
103
|
preset: z.ZodOptional<z.ZodString>;
|
|
175
104
|
setDefaultAgent: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -224,33 +153,6 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
224
153
|
}, z.core.$strict>>>;
|
|
225
154
|
disabled_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
226
155
|
disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
227
|
-
multiplexer: z.ZodOptional<z.ZodObject<{
|
|
228
|
-
type: z.ZodDefault<z.ZodEnum<{
|
|
229
|
-
auto: "auto";
|
|
230
|
-
tmux: "tmux";
|
|
231
|
-
zellij: "zellij";
|
|
232
|
-
none: "none";
|
|
233
|
-
}>>;
|
|
234
|
-
layout: z.ZodDefault<z.ZodEnum<{
|
|
235
|
-
"main-horizontal": "main-horizontal";
|
|
236
|
-
"main-vertical": "main-vertical";
|
|
237
|
-
tiled: "tiled";
|
|
238
|
-
"even-horizontal": "even-horizontal";
|
|
239
|
-
"even-vertical": "even-vertical";
|
|
240
|
-
}>>;
|
|
241
|
-
main_pane_size: z.ZodDefault<z.ZodNumber>;
|
|
242
|
-
}, z.core.$strip>>;
|
|
243
|
-
tmux: z.ZodOptional<z.ZodObject<{
|
|
244
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
245
|
-
layout: z.ZodDefault<z.ZodEnum<{
|
|
246
|
-
"main-horizontal": "main-horizontal";
|
|
247
|
-
"main-vertical": "main-vertical";
|
|
248
|
-
tiled: "tiled";
|
|
249
|
-
"even-horizontal": "even-horizontal";
|
|
250
|
-
"even-vertical": "even-vertical";
|
|
251
|
-
}>>;
|
|
252
|
-
main_pane_size: z.ZodDefault<z.ZodNumber>;
|
|
253
|
-
}, z.core.$strip>>;
|
|
254
156
|
websearch: z.ZodOptional<z.ZodObject<{
|
|
255
157
|
provider: z.ZodDefault<z.ZodEnum<{
|
|
256
158
|
exa: "exa";
|
|
@@ -264,11 +166,6 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
264
166
|
port: z.ZodDefault<z.ZodNumber>;
|
|
265
167
|
dashboard: z.ZodDefault<z.ZodBoolean>;
|
|
266
168
|
}, z.core.$strip>>;
|
|
267
|
-
sessionManager: z.ZodOptional<z.ZodObject<{
|
|
268
|
-
maxSessionsPerAgent: z.ZodDefault<z.ZodNumber>;
|
|
269
|
-
readContextMinLines: z.ZodDefault<z.ZodNumber>;
|
|
270
|
-
readContextMaxFiles: z.ZodDefault<z.ZodNumber>;
|
|
271
|
-
}, z.core.$strip>>;
|
|
272
169
|
divoom: z.ZodOptional<z.ZodObject<{
|
|
273
170
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
274
171
|
python: z.ZodDefault<z.ZodString>;
|
|
@@ -286,16 +183,6 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
286
183
|
autoEnable: z.ZodDefault<z.ZodBoolean>;
|
|
287
184
|
autoEnableThreshold: z.ZodDefault<z.ZodNumber>;
|
|
288
185
|
}, z.core.$strip>>;
|
|
289
|
-
fallback: z.ZodOptional<z.ZodObject<{
|
|
290
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
291
|
-
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
292
|
-
retryDelayMs: z.ZodDefault<z.ZodNumber>;
|
|
293
|
-
chains: z.ZodDefault<z.ZodObject<{
|
|
294
|
-
orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
295
|
-
researcher: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
296
|
-
}, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
|
|
297
|
-
retry_on_empty: z.ZodDefault<z.ZodBoolean>;
|
|
298
|
-
}, z.core.$strip>>;
|
|
299
186
|
}, z.core.$strip>;
|
|
300
187
|
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
301
188
|
export type { AgentName } from './constants';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
export { createApplyPatchHook } from './apply-patch';
|
|
2
2
|
export type { AutoUpdateCheckerOptions } from './auto-update-checker';
|
|
3
3
|
export { createAutoUpdateCheckerHook } from './auto-update-checker';
|
|
4
|
-
export { createChatHeadersHook } from './chat-headers';
|
|
5
|
-
export { createDelegateTaskRetryHook } from './delegate-task-retry';
|
|
6
4
|
export { createFilterAvailableSkillsHook } from './filter-available-skills';
|
|
7
|
-
export { ForegroundFallbackManager, isRateLimitError, } from './foreground-fallback';
|
|
8
5
|
export { processImageAttachments } from './image-hook';
|
|
9
6
|
export { createJsonErrorRecoveryHook } from './json-error-recovery';
|
|
10
|
-
export { createPhaseReminderHook } from './phase-reminder';
|
|
11
|
-
export { createPostFileToolNudgeHook } from './post-file-tool-nudge';
|
|
12
7
|
export { createSessionBootstrapHook } from './session-bootstrap';
|
|
13
|
-
export { createTaskSessionManagerHook } from './task-session-manager';
|
|
14
8
|
export { createTodoContinuationHook } from './todo-continuation';
|