oh-my-opencode-slim 2.0.0 → 2.0.2

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 (39) hide show
  1. package/README.ja-JP.md +69 -20
  2. package/README.ko-KR.md +66 -19
  3. package/README.md +72 -19
  4. package/README.zh-CN.md +78 -31
  5. package/dist/agents/orchestrator.d.ts +0 -2
  6. package/dist/cli/index.js +50 -37
  7. package/dist/config/agent-mcps.d.ts +0 -4
  8. package/dist/config/constants.d.ts +1 -7
  9. package/dist/config/council-schema.d.ts +0 -15
  10. package/dist/config/runtime-preset.d.ts +0 -1
  11. package/dist/config/schema.d.ts +2 -68
  12. package/dist/hooks/auto-update-checker/skill-sync.d.ts +9 -0
  13. package/dist/hooks/filter-available-skills/index.d.ts +1 -13
  14. package/dist/hooks/foreground-fallback/index.d.ts +1 -1
  15. package/dist/hooks/image-hook.d.ts +1 -13
  16. package/dist/hooks/index.d.ts +3 -2
  17. package/dist/hooks/phase-reminder/index.d.ts +10 -16
  18. package/dist/hooks/reflect/index.d.ts +13 -0
  19. package/dist/hooks/task-session-manager/index.d.ts +2 -16
  20. package/dist/hooks/types.d.ts +23 -0
  21. package/dist/index.js +391 -289
  22. package/dist/tui.js +16 -25
  23. package/dist/utils/agent-variant.d.ts +0 -40
  24. package/dist/utils/compat.d.ts +0 -1
  25. package/dist/utils/guards.d.ts +4 -0
  26. package/dist/utils/index.d.ts +1 -2
  27. package/dist/utils/logger.d.ts +1 -1
  28. package/dist/utils/task.d.ts +0 -2
  29. package/oh-my-opencode-slim.schema.json +2 -249
  30. package/package.json +1 -1
  31. package/src/skills/codemap.md +4 -1
  32. package/src/skills/reflect/SKILL.md +193 -0
  33. package/src/skills/worktrees/SKILL.md +164 -0
  34. package/dist/config/fallback-chains.d.ts +0 -1
  35. package/dist/hooks/apply-patch/patch.d.ts +0 -2
  36. package/dist/hooks/delegate-task-retry/guidance.d.ts +0 -2
  37. package/dist/hooks/delegate-task-retry/index.d.ts +0 -4
  38. package/dist/hooks/json-error-recovery/index.d.ts +0 -1
  39. package/dist/utils/env.d.ts +0 -1
package/README.zh-CN.md CHANGED
@@ -32,6 +32,29 @@ oh-my-opencode-slim 是一个用于 OpenCode 的智能体编排插件。它内
32
32
 
33
33
  要了解智能体本身,请参阅 **[认识众神殿](#meet-the-pantheon)**。如需了解完整特性集,请参阅下方的 **[特性与工作流](#features-and-workflows)**。
34
34
 
35
+ ### 用户怎么说
36
+
37
+ > “任务管理轻松从 5/10 提升到了 8-9/10。Orchestrator 会派出
38
+ > Fixer 和 Explorer,而我仍然可以在同一个会话里继续和 Orchestrator
39
+ > 对话与规划。现在整个体验顺滑多了。”
40
+ >
41
+ > \- `vipor_idk`
42
+
43
+ > “我已经为了这个 omo-slim beta 版本抛弃了所有自己的 harness,
44
+ > 也完全没有回头或怀念。做得很好,在我看来方向都非常正确。”
45
+ >
46
+ > \- `stephanschielke`
47
+
48
+ > “我很喜欢 omo-slim,已经无法想象不用它来运行 opencode。
49
+ > 我喜欢可以拼出一个由各种模型组成的 Frankenstein……
50
+ > 这让整个设置变成了一头猛兽。”
51
+ >
52
+ > \- `Capital-One3039`
53
+
54
+ > “它显著改善了我的工作流……现在运行得非常顺畅,我很喜欢。”
55
+ >
56
+ > \- `xenstar1`
57
+
35
58
  ### 快速开始
36
59
 
37
60
  将此提示词复制并粘贴到您的 LLM 智能体中(例如 Claude Code、AmpCode、Cursor 等):
@@ -48,7 +71,9 @@ bunx oh-my-opencode-slim@latest install
48
71
 
49
72
  ### 入门指南
50
73
 
51
- 安装程序会同时生成 OpenAI 和 OpenCode Go 的预设(Preset),默认启用 OpenAI 预设。OpenAI 使用变体感知路由:`openai/gpt-5.5` (medium) 作为工作流管理器/调度模型,`openai/gpt-5.5` (high) 作为 Oracle 模型,`openai/gpt-5.5` (low) 作为 Fixer 模型,并使用 `openai/gpt-5.4-mini` 变体模型作为响应更快速、针对具体任务的智能体模型。若要在安装过程中激活 OpenCode Go 预设,请运行 `bunx oh-my-opencode-slim@latest install --preset=opencode-go` 或在安装后修改 `~/.config/opencode/oh-my-opencode-slim.json` 文件中的默认预设名称。
74
+ 安装程序会同时生成 OpenAI 和 OpenCode Go 预设,默认启用 OpenAI
75
+
76
+ 要在安装期间启用 OpenCode Go,请运行 `bunx oh-my-opencode-slim@latest install --preset=opencode-go`,或在安装后修改 `~/.config/opencode/oh-my-opencode-slim.json` 中的默认预设名称。
52
77
 
53
78
  然后:
54
79
 
@@ -63,14 +88,15 @@ bunx oh-my-opencode-slim@latest install
63
88
  opencode models --refresh
64
89
  ```
65
90
  3. **打开您的插件配置文件**,路径为 `~/.config/opencode/oh-my-opencode-slim.json`
66
- 或者在使用自定义 OpenCode 配置目录时打开
67
- `$OPENCODE_CONFIG_DIR/oh-my-opencode-slim.json`
68
91
 
69
92
  4. **为您要分配的每个智能体更新模型配置**
70
93
 
71
94
  > [!TIP]
72
95
  > **建议**了解后台编排的工作原理。**[编排者提示词 (Orchestrator prompt)](https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/agents/orchestrator.ts#L28)** 包含调度规则、专家路由逻辑,以及何时应把工作分配给后台智能体的阈值。您始终可以通过以下方式手动委派任务:`@智能体名称 <任务内容>`
73
96
 
97
+ > [!TIP]
98
+ > 由于后台智能体现在是默认工作流,**强烈建议**启用并配置 **[Multiplexer Integration](docs/multiplexer-integration.md)**。它会自动在专用的 Tmux 或 Zellij 窗格中打开每个智能体,让您在 Orchestrator 继续协调会话时,实时跟进各个专家智能体的工作。
99
+
74
100
  默认生成的配置包含 `openai` 和 `opencode-go` 两个预设:
75
101
 
76
102
  ```jsonc
@@ -103,10 +129,6 @@ bunx oh-my-opencode-slim@latest install
103
129
 
104
130
  要使用自定义模型提供商或混合提供商配置,请参阅 **[配置指南 (docs/configuration.md)](docs/configuration.md)** 以获取完整参考。如果您需要即插即用的起点,请查看 **[作者的预设配置 (docs/authors-preset.md)](docs/authors-preset.md)** 和 **[$30 预设配置 (docs/thirty-dollars-preset.md)](docs/thirty-dollars-preset.md)**(`$30` 预设是性价比最高的便宜配置方案)。
105
131
 
106
- 配置指南还介绍了如何通过 `agents.<name>` 定义自定义子智能体,您可以在其中为委派定义普通 `prompt` 和 `orchestratorPrompt` 块。
107
-
108
- 有关模型推荐,请参阅下方列出的每个智能体推荐模型。
109
-
110
132
  ### ✅ 验证您的安装
111
133
 
112
134
  在完成安装与认证后,请验证所有智能体是否已正确配置并能够响应:
@@ -137,6 +159,8 @@ V2 将 oh-my-opencode-slim 变成了以调度器为核心的多智能体工作
137
159
  - **[后台智能体](#后台智能体)** — Orchestrator 现在会把专家作为后台任务派发,跟踪任务/会话 ID,等待完成事件,并在继续之前整合结果。
138
160
  - **[Companion](#companion)** — 可选的浮动桌面窗口会显示当前活跃的智能体,包括并行运行的后台专家。
139
161
  - **[Deepwork](#deepwork)** — 面向大型、多文件、高风险或分阶段编码工作的结构化工作流,使用持久化计划文件和 Oracle 评审关卡。
162
+ - **[Reflect](#reflect)** — 回顾重复出现的工作模式,并建议可复用的 skill、智能体、命令、配置规则、提示词规则或项目 playbook。
163
+ - **[Worktrees](#worktrees)** — 将 Git worktree 作为隔离编码通道管理,并为复杂、高风险或并行任务提供安全协议。
140
164
  - **[oh-my-opencode-slim Skill](#oh-my-opencode-slim-skill)** — 随包提供的配置技能,可安全调优模型、提示词、自定义智能体、MCP 访问、预设和插件行为。
141
165
 
142
166
  #### 后台智能体
@@ -174,6 +198,32 @@ Deepwork 适用于重型编码会话:大范围重构、多阶段功能、高
174
198
 
175
199
  何时使用以及工作流如何运行,请参阅 **[Skills](docs/skills.md#deepwork)**。
176
200
 
201
+ #### Reflect
202
+
203
+ Reflect 帮助 Orchestrator 从重复出现的工作流摩擦中学习。它会回顾近期工作和现有资产,然后建议最小且有用的改进:skill、自定义智能体、命令、配置规则、提示词规则、MCP 权限变更或项目 playbook。如果证据不足,它应建议什么都不创建。
204
+
205
+ 直接使用:
206
+
207
+ ```text
208
+ /reflect
209
+ /reflect release workflow and checks
210
+ ```
211
+
212
+ 也可以使用自然语言提示:
213
+
214
+ ```text
215
+ reflect on my recent workflows
216
+ find repeated work worth turning into reusable instructions
217
+ ```
218
+
219
+ 完整工作流和安全规则见 **[Skills](docs/skills.md#reflect)**。
220
+
221
+ #### Worktrees
222
+
223
+ Worktrees 将 Git worktree 作为安全、隔离的编码通道管理,默认位于 `.slim/worktrees/<slug>/`。Orchestrator 负责这些通道的生命周期,在 `.slim/worktrees.json` 中跟踪状态,在通道内调度专家智能体,并在修改 Git 状态前要求明确确认。
224
+
225
+ 安全协议见 **[Skills](docs/skills.md#worktrees)**。
226
+
177
227
  #### oh-my-opencode-slim Skill
178
228
 
179
229
  内置的 `oh-my-opencode-slim` skill 可帮助 Orchestrator 配置和改进插件本身。可用于模型调优、自定义智能体、提示词覆盖、skill/MCP 权限、预设、可选智能体、后台编排以及反复出现的工作流摩擦。
@@ -530,46 +580,43 @@ Deepwork 适用于重型编码会话:大范围重构、多阶段功能、高
530
580
 
531
581
  ## 📚 文档
532
582
 
533
- 请将本节用作引导地图:从安装开始,然后根据您的需求跳转到功能、配置或示例预设。
534
-
535
- ### 🚀 从这里开始
536
-
537
- | 文档 | 涵盖内容 |
538
- |-----|----------------|
539
- | **[安装指南 (docs/installation.md)](docs/installation.md)** | 安装插件、使用 CLI 标志、重置配置以及排查安装故障 |
583
+ 请将本节作为地图:先从安装开始,再根据需要跳转到特性、配置或示例预设。
540
584
 
541
- <a id="特性与工作流"></a>
585
+ <a id="features-and-workflows"></a>
542
586
 
543
587
  ### ✨ 特性与工作流
544
588
 
545
589
  | 文档 | 涵盖内容 |
546
590
  |-----|----------------|
547
- | **[Council (议会) (docs/council.md)](docs/council.md)** | 使用 `@council` 并行运行多个模型并合成单一答案 |
548
- | **[多路复用器集成 (docs/multiplexer-integration.md)](docs/multiplexer-integration.md)** | Tmux Zellij 窗格中实时观看智能体的工作过程 |
549
- | **[会话管理 (docs/session-management.md)](docs/session-management.md)** | 使用短别名复用最近的子智能体会话,而不是重新开始 |
550
- | **[运行时预设切换 (docs/preset-switching.md)](docs/preset-switching.md)** | 在运行时使用 `/preset` 切换智能体模型预设 |
551
- | **[自定义智能体 (docs/configuration.md#custom-agents)](docs/configuration.md#custom-agents)** | 自定义专家智能体:配置独特的提示词、模型、MCP 权限和编排者委派规则 |
552
- | **[代码地图 (Codemap) (docs/codemap.md)](docs/codemap.md)** | 生成层级代码地图,快速理解大型代码库 |
553
- | **[克隆依赖 (Clonedeps) (docs/clonedeps.md)](docs/clonedeps.md)** | 将选定的依赖源码克隆到被忽略的本地工作区中以供检查 |
554
- | **[访谈式生成 (Interview) (docs/interview.md)](docs/interview.md)** | 通过基于浏览器的问答流,将粗糙的想法转变为结构化的 Markdown 规范文档 |
591
+ | **[Council](docs/council.md)** | 使用 `@council` 并行运行多个模型并合成单一答案 |
592
+ | **[自定义智能体](docs/configuration.md#custom-agents)** | 使用自定义提示词、模型、MCP 访问和 Orchestrator 委派规则定义自己的专家 |
593
+ | **[多路复用器集成](docs/multiplexer-integration.md)** | Tmux 或 Zellij 窗格中实时观看智能体工作 |
594
+ | **[Codemap](docs/codemap.md)** | 生成层级代码地图,更快理解大型代码库 |
595
+ | **[Clonedeps](docs/clonedeps.md)** | 将选定的依赖源码克隆到被忽略的本地工作区中以供检查 |
596
+ | **[Worktrees](docs/worktrees.md)** | 使用 `.slim/worktrees/` 通道进行隔离的并行或高风险编码工作 |
597
+ | **[预设切换](docs/preset-switching.md)** | 使用 `/preset` 在运行时切换智能体模型预设 |
598
+ | **[Interview](docs/interview.md)** | 通过基于浏览器的问答流程,将粗略想法转成结构化 markdown 规格 |
599
+ | **[Companion](docs/companion.md)** | 用于解析、帮助和类型信息的浮动窗口 companion |
555
600
 
556
601
  ### ⚙️ 配置与参考
557
602
 
558
603
  | 文档 | 涵盖内容 |
559
604
  |-----|----------------|
560
- | **[配置指南 (docs/configuration.md)](docs/configuration.md)** | 配置文件位置、JSONC 支持、提示词覆盖以及完整的选项参考 |
561
- | **[维护者指南 (docs/maintainers.md)](docs/maintainers.md)** | 问题分流规则、标签含义、支持路由以及仓库维护工作流 |
562
- | **[技能列表 (Skills) (docs/skills.md)](docs/skills.md)** | 捆绑的技能,如 `simplify`、`codemap` `clonedeps` |
563
- | **[MCP 服务 (docs/mcps.md)](docs/mcps.md)** | `websearch`、`context7`、`gh_grep` 以及每个智能体的 MCP 权限工作机制 |
564
- | **[工具说明 (docs/tools.md)](docs/tools.md)** | 内置工具能力,如 `webfetch`、LSP 工具、代码搜索和格式化工具 |
605
+ | **[安装指南](docs/installation.md)** | 安装插件、使用 CLI 标志、重置配置并排查设置问题 |
606
+ | **[配置](docs/configuration.md)** | 配置文件位置、JSONC 支持、提示词覆盖和完整选项参考 |
607
+ | **[后台编排](docs/background-orchestration.md)** | 围绕原生后台子智能体构建的调度器优先 Orchestrator 模型 |
608
+ | **[维护者指南](docs/maintainers.md)** | issue 分流规则、标签含义、支持路由和仓库维护工作流 |
609
+ | **[Skills](docs/skills.md)** | `simplify`、`codemap`、`clonedeps`、`deepwork`、`reflect`、`worktrees` `oh-my-opencode-slim` 等捆绑技能 |
610
+ | **[MCPs](docs/mcps.md)** | `websearch`、`context7`、`gh_grep` 以及每个智能体的 MCP 权限机制 |
611
+ | **[Tools](docs/tools.md)** | `webfetch`、LSP 工具、代码搜索和格式化工具等内置工具能力 |
565
612
 
566
613
  ### 💡 预设配置
567
614
 
568
615
  | 文档 | 涵盖内容 |
569
616
  |-----|----------------|
570
- | **[作者的预设配置 (docs/authors-preset.md)](docs/authors-preset.md)** | 作者日常使用的混合服务商配置方案 |
571
- | **[$30 预设配置 (docs/thirty-dollars-preset.md)](docs/thirty-dollars-preset.md)** | 每月约 30 美元的预算型混合服务商配置方案 |
572
- | **[OpenCode Go 预设 (docs/opencode-go-preset.md)](docs/opencode-go-preset.md)** | 安装程序生成的捆绑 `opencode-go` 预设配置 |
617
+ | **[作者的预设配置](docs/authors-preset.md)** | 作者日常使用的混合服务商配置方案 |
618
+ | **[$30 预设配置](docs/thirty-dollars-preset.md)** | 每月约 30 美元的预算型混合服务商配置方案 |
619
+ | **[OpenCode Go 预设](docs/opencode-go-preset.md)** | 安装程序生成的捆绑 `opencode-go` 预设 |
573
620
 
574
621
  ---
575
622
 
@@ -22,8 +22,6 @@ export declare function resolvePrompt(base: string, customPrompt?: string, custo
22
22
  * @returns The complete orchestrator prompt string
23
23
  */
24
24
  export declare function buildOrchestratorPrompt(disabledAgents?: Set<string>): string;
25
- /** @deprecated Use buildOrchestratorPrompt() instead */
26
- export declare const ORCHESTRATOR_PROMPT: string;
27
25
  export declare function createOrchestratorAgent(model?: string | Array<string | {
28
26
  id: string;
29
27
  variant?: string;
package/dist/cli/index.js CHANGED
@@ -21,7 +21,6 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
21
21
  // src/utils/compat.ts
22
22
  var exports_compat = {};
23
23
  __export(exports_compat, {
24
- isBun: () => isBun,
25
24
  crossWrite: () => crossWrite,
26
25
  crossSpawn: () => crossSpawn
27
26
  });
@@ -72,10 +71,7 @@ function crossSpawn(command, options) {
72
71
  async function crossWrite(path, data) {
73
72
  await fsWriteFile(path, Buffer.from(data));
74
73
  }
75
- var isBun;
76
- var init_compat = __esm(() => {
77
- isBun = typeof globalThis.Bun !== "undefined";
78
- });
74
+ var init_compat = () => {};
79
75
 
80
76
  // src/utils/zip-extractor.ts
81
77
  var exports_zip_extractor = {};
@@ -181,6 +177,7 @@ import {
181
177
  mkdirSync as mkdirSync3,
182
178
  readFileSync,
183
179
  renameSync,
180
+ rmSync,
184
181
  statSync as statSync2,
185
182
  writeFileSync
186
183
  } from "node:fs";
@@ -305,11 +302,11 @@ var SUBAGENT_NAMES = [
305
302
  "council",
306
303
  "councillor"
307
304
  ];
308
- var ORCHESTRATOR_NAME = "orchestrator";
309
- var ALL_AGENT_NAMES = [ORCHESTRATOR_NAME, ...SUBAGENT_NAMES];
305
+ var ALL_AGENT_NAMES = ["orchestrator", ...SUBAGENT_NAMES];
310
306
  var PROTECTED_AGENTS = new Set(["orchestrator", "councillor"]);
311
- var DEFAULT_TIMEOUT_MS = 2 * 60 * 1000;
312
307
  var MAX_POLL_TIME_MS = 5 * 60 * 1000;
308
+ var PHASE_REMINDER_TEXT = `!IMPORTANT! Scheduler workflow: plan lanes/dependencies → dispatch background specialists → track task IDs → wait for hook-driven completion → reconcile terminal results → verify. Do not poll running jobs, consume running-job output, or advance dependent work. !END!`;
309
+ var PHASE_REMINDER = `<internal_reminder>${PHASE_REMINDER_TEXT}</internal_reminder>`;
313
310
  // src/config/council-schema.ts
314
311
  import { z } from "zod";
315
312
  var ModelIdSchema = z.string().regex(/^[^/\s]+\/[^\s]+$/, 'Expected provider/model format (e.g. "openai/gpt-5.4-mini")');
@@ -356,17 +353,11 @@ var CouncilConfigSchema = z.object({
356
353
  default_preset: z.string().default("default"),
357
354
  councillor_execution_mode: CouncillorExecutionModeSchema.describe('Execution mode for councillors. "serial" runs them one at a time (required for single-model systems). "parallel" runs them concurrently (default, faster for multi-model systems).'),
358
355
  councillor_retries: z.number().int().min(0).max(5).default(3).describe("Number of retry attempts for councillors that return empty responses " + "(e.g. due to provider rate limiting). Default: 3 retries."),
359
- master: z.unknown().optional().describe("DEPRECATED — ignored. Council agent synthesizes directly."),
360
- master_timeout: z.unknown().optional().describe('DEPRECATED — ignored. Use "timeout" instead.'),
361
- master_fallback: z.unknown().optional().describe("DEPRECATED — ignored. No separate master session.")
356
+ master: z.unknown().optional().describe("DEPRECATED — ignored. Council agent synthesizes directly.")
362
357
  }).transform((data) => {
363
358
  const deprecated = [];
364
359
  if (data.master !== undefined)
365
360
  deprecated.push("master");
366
- if (data.master_timeout !== undefined)
367
- deprecated.push("master_timeout");
368
- if (data.master_fallback !== undefined)
369
- deprecated.push("master_fallback");
370
361
  const legacyMasterModel = typeof data.master === "object" && data.master !== null && "model" in data.master && typeof data.master.model === "string" ? data.master.model : undefined;
371
362
  return {
372
363
  presets: data.presets,
@@ -408,15 +399,6 @@ var ManualPlanSchema = z2.object({
408
399
  librarian: ManualAgentPlanSchema,
409
400
  fixer: ManualAgentPlanSchema
410
401
  }).strict();
411
- var AgentModelChainSchema = z2.array(z2.string()).min(1);
412
- var FallbackChainsSchema = z2.object({
413
- orchestrator: AgentModelChainSchema.optional(),
414
- oracle: AgentModelChainSchema.optional(),
415
- designer: AgentModelChainSchema.optional(),
416
- explorer: AgentModelChainSchema.optional(),
417
- librarian: AgentModelChainSchema.optional(),
418
- fixer: AgentModelChainSchema.optional()
419
- }).catchall(AgentModelChainSchema);
420
402
  var AgentOverrideConfigSchema = z2.object({
421
403
  model: z2.union([
422
404
  z2.string(),
@@ -479,9 +461,8 @@ var FailoverConfigSchema = z2.object({
479
461
  enabled: z2.boolean().default(true),
480
462
  timeoutMs: z2.number().min(0).default(15000),
481
463
  retryDelayMs: z2.number().min(0).default(500),
482
- chains: FallbackChainsSchema.default({}),
483
464
  retry_on_empty: z2.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.")
484
- });
465
+ }).strict();
485
466
  var CompanionConfigSchema = z2.object({
486
467
  enabled: z2.boolean().optional(),
487
468
  position: z2.enum(["bottom-right", "bottom-left", "top-right", "top-left"]).optional(),
@@ -512,10 +493,7 @@ function validateCustomOnlyPromptFields(overrides, ctx, pathPrefix) {
512
493
  var PluginConfigSchema = z2.object({
513
494
  preset: z2.string().optional(),
514
495
  setDefaultAgent: z2.boolean().optional(),
515
- scoringEngineVersion: z2.enum(["v1", "v2-shadow", "v2"]).optional(),
516
- balanceProviderUsage: z2.boolean().optional(),
517
496
  autoUpdate: z2.boolean().optional().describe("Disable automatic installation of plugin updates when false. Defaults to true."),
518
- manualPlan: ManualPlanSchema.optional(),
519
497
  presets: z2.record(z2.string(), PresetSchema).optional(),
520
498
  agents: z2.record(z2.string(), AgentOverrideConfigSchema).optional(),
521
499
  disabled_agents: z2.array(z2.string()).optional().describe("Agent names to disable completely. " + "Disabled agents are not instantiated and cannot be delegated to. " + "Orchestrator and council internal agents (councillor) cannot be disabled. " + "By default, 'observer' is disabled. Remove it from this list and configure a vision-capable model to enable."),
@@ -586,11 +564,23 @@ var CUSTOM_SKILLS = [
586
564
  allowedAgents: ["orchestrator"],
587
565
  sourcePath: "src/skills/deepwork"
588
566
  },
567
+ {
568
+ name: "reflect",
569
+ description: "Review repeated work and suggest reusable workflow improvements",
570
+ allowedAgents: ["orchestrator"],
571
+ sourcePath: "src/skills/reflect"
572
+ },
589
573
  {
590
574
  name: "oh-my-opencode-slim",
591
575
  description: "Configure, customize, and safely improve oh-my-opencode-slim setups",
592
576
  allowedAgents: ["orchestrator"],
593
577
  sourcePath: "src/skills/oh-my-opencode-slim"
578
+ },
579
+ {
580
+ name: "worktrees",
581
+ description: "Manage Git worktrees as OMO safe isolated coding lanes for complex/risky/parallel work",
582
+ allowedAgents: ["orchestrator"],
583
+ sourcePath: "src/skills/worktrees"
594
584
  }
595
585
  ];
596
586
  function getCustomSkillsDir() {
@@ -850,6 +840,20 @@ function getPinnedVersionFromConfig() {
850
840
  } catch {}
851
841
  return;
852
842
  }
843
+ function getRequestedPackageTag(packageRoot) {
844
+ const normalizedPath = normalizePathForMatch(packageRoot);
845
+ const marker = `/bunx-`;
846
+ const markerIndex = normalizedPath.lastIndexOf(marker);
847
+ if (markerIndex === -1)
848
+ return;
849
+ const bunxSegment = normalizedPath.slice(markerIndex + marker.length).split("/")[0];
850
+ const packagePrefix = `${PACKAGE_NAME}@`;
851
+ const packageIndex = bunxSegment.lastIndexOf(packagePrefix);
852
+ if (packageIndex === -1)
853
+ return;
854
+ const tag = bunxSegment.slice(packageIndex + packagePrefix.length);
855
+ return tag || undefined;
856
+ }
853
857
  function getVersionFromPackageRoot(packageRoot) {
854
858
  try {
855
859
  const packageJsonPath = join3(packageRoot, "package.json");
@@ -884,6 +888,14 @@ function writeOpenCodePluginCacheManifest(cacheDir, version = "latest") {
884
888
  };
885
889
  }
886
890
  }
891
+ function removeOpenCodePluginCacheArtifacts(cacheDir) {
892
+ rmSync(join3(cacheDir, "node_modules", PACKAGE_NAME), {
893
+ recursive: true,
894
+ force: true
895
+ });
896
+ rmSync(join3(cacheDir, "bun.lock"), { force: true });
897
+ rmSync(join3(cacheDir, "bun.lockb"), { force: true });
898
+ }
887
899
  function verifyOpenCodePluginCache(cacheDir) {
888
900
  const pluginPackageJsonPath = join3(cacheDir, "node_modules", PACKAGE_NAME, "package.json");
889
901
  if (!existsSync3(pluginPackageJsonPath)) {
@@ -922,7 +934,8 @@ async function warmOpenCodePluginCache() {
922
934
  }
923
935
  const pinnedVersion = getPinnedVersionFromConfig();
924
936
  const runningVersion = getVersionFromPackageRoot(packageRoot);
925
- const cacheVersion = pinnedVersion ?? runningVersion;
937
+ const requestedTag = getRequestedPackageTag(packageRoot);
938
+ const cacheVersion = pinnedVersion ?? requestedTag ?? runningVersion;
926
939
  const cacheDir = getOpenCodePluginCacheDir(cacheVersion);
927
940
  try {
928
941
  mkdirSync3(cacheDir, { recursive: true });
@@ -936,6 +949,7 @@ async function warmOpenCodePluginCache() {
936
949
  const manifestError = writeOpenCodePluginCacheManifest(cacheDir, cacheVersion);
937
950
  if (manifestError)
938
951
  return manifestError;
952
+ removeOpenCodePluginCacheArtifacts(cacheDir);
939
953
  try {
940
954
  const proc = crossSpawn(["bun", "install", "--ignore-scripts"], {
941
955
  cwd: cacheDir,
@@ -1576,13 +1590,13 @@ import {
1576
1590
  mkdirSync as mkdirSync5,
1577
1591
  mkdtempSync,
1578
1592
  renameSync as renameSync2,
1579
- rmSync,
1593
+ rmSync as rmSync2,
1580
1594
  writeFileSync as writeFileSync3
1581
1595
  } from "node:fs";
1582
1596
  import { homedir as homedir4, tmpdir } from "node:os";
1583
1597
  import * as path2 from "node:path";
1584
- var COMPANION_VERSION = "0.1.0";
1585
- var COMPANION_TAG = "companion-v0.1.0";
1598
+ var COMPANION_VERSION = "0.1.2";
1599
+ var COMPANION_TAG = "companion-v0.1.2";
1586
1600
  var GITHUB_REPO = "alvinunreal/oh-my-opencode-slim";
1587
1601
  function getCompanionTarget() {
1588
1602
  const p = process.platform;
@@ -1590,8 +1604,6 @@ function getCompanionTarget() {
1590
1604
  if (p === "darwin") {
1591
1605
  if (a === "arm64")
1592
1606
  return "aarch64-apple-darwin";
1593
- if (a === "x64")
1594
- return "x86_64-apple-darwin";
1595
1607
  } else if (p === "linux") {
1596
1608
  if (a === "x64")
1597
1609
  return "x86_64-unknown-linux-gnu";
@@ -1702,7 +1714,7 @@ async function installCompanion(config) {
1702
1714
  } finally {
1703
1715
  if (tempDir) {
1704
1716
  try {
1705
- rmSync(tempDir, { recursive: true, force: true });
1717
+ rmSync2(tempDir, { recursive: true, force: true });
1706
1718
  } catch {}
1707
1719
  }
1708
1720
  }
@@ -1976,8 +1988,9 @@ ${block}
1976
1988
  return { enabledNow: false, configuredTarget: target };
1977
1989
  }
1978
1990
  async function shouldInstallCompanion(config) {
1979
- if (config.companion === "yes")
1991
+ if (config.companion === "yes") {
1980
1992
  return true;
1993
+ }
1981
1994
  if (config.companion === "no")
1982
1995
  return false;
1983
1996
  if (config.dryRun) {
@@ -5,10 +5,6 @@ export declare const DEFAULT_AGENT_MCPS: Record<AgentName, string[]>;
5
5
  * Parse a list with wildcard and exclusion syntax.
6
6
  */
7
7
  export declare function parseList(items: string[], allAvailable: string[]): string[];
8
- /**
9
- * Get available MCP names from schema and config.
10
- */
11
- export declare function getAvailableMcpNames(config?: PluginConfig): string[];
12
8
  /**
13
9
  * Get the MCP list for an agent (from config or defaults).
14
10
  */
@@ -1,26 +1,20 @@
1
1
  export declare const AGENT_ALIASES: Record<string, string>;
2
2
  export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "fixer", "observer", "council", "councillor"];
3
- export declare const ORCHESTRATOR_NAME: "orchestrator";
4
3
  export declare const ALL_AGENT_NAMES: readonly ["orchestrator", "explorer", "librarian", "oracle", "designer", "fixer", "observer", "council", "councillor"];
5
4
  export type AgentName = (typeof ALL_AGENT_NAMES)[number];
6
- export declare const ORCHESTRATABLE_AGENTS: readonly ["explorer", "librarian", "oracle", "designer", "fixer", "observer", "council"];
7
5
  /** Agents that cannot be disabled even if listed in disabled_agents config. */
8
6
  export declare const PROTECTED_AGENTS: Set<string>;
9
7
  /**
10
8
  * Get the list of orchestratable agents, excluding any disabled agents.
11
9
  * This is used for delegation validation at runtime.
12
10
  */
13
- export declare function getOrchestratableAgents(disabledAgents?: Set<string>): string[];
14
- export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly string[]>;
15
11
  export declare const DEFAULT_MODELS: Record<AgentName, string | undefined>;
16
12
  export declare const POLL_INTERVAL_MS = 500;
17
- export declare const POLL_INTERVAL_SLOW_MS = 1000;
18
13
  export declare const POLL_INTERVAL_BACKGROUND_MS = 2000;
19
- export declare const DEFAULT_TIMEOUT_MS: number;
20
14
  export declare const MAX_POLL_TIME_MS: number;
21
- export declare const FALLBACK_FAILOVER_TIMEOUT_MS = 15000;
22
15
  export declare const DEFAULT_MAX_SUBAGENT_DEPTH = 3;
23
16
  export declare const PHASE_REMINDER_TEXT = "!IMPORTANT! Scheduler workflow: plan lanes/dependencies \u2192 dispatch background specialists \u2192 track task IDs \u2192 wait for hook-driven completion \u2192 reconcile terminal results \u2192 verify. Do not poll running jobs, consume running-job output, or advance dependent work. !END!";
17
+ export declare const PHASE_REMINDER = "<internal_reminder>!IMPORTANT! Scheduler workflow: plan lanes/dependencies \u2192 dispatch background specialists \u2192 track task IDs \u2192 wait for hook-driven completion \u2192 reconcile terminal results \u2192 verify. Do not poll running jobs, consume running-job output, or advance dependent work. !END!</internal_reminder>";
24
18
  export declare const WRITABLE_FILE_OPERATIONS_RULES = "**File Operations Rules**:\n- Prefer dedicated file tools for normal code work: glob/grep/ast_grep_search for discovery, read for file contents, and edit/write/apply_patch for targeted source changes.\n- Use bash for execution and automation: git, package managers, tests, builds, scripts, diagnostics, and shell-native filesystem operations.\n- Shell is acceptable for bulk or mechanical filesystem changes when it is clearer or safer than many individual edits (for example: truncate generated logs, remove build artifacts, batch rename/move files), especially when the user explicitly asks for that shell operation.\n- Before destructive or broad shell operations, verify the target set and quote paths. Prefer a dry-run/listing first when practical.\n- Do not use cat/head/tail/sed/awk only to read code into context; use read/grep unless a shell pipeline is genuinely the better diagnostic.";
25
19
  export declare const READONLY_FILE_OPERATIONS_RULES = "**File Operations Rules**:\n- READ-ONLY: inspect and report; do not modify files.\n- Prefer dedicated file tools for codebase inspection: glob/grep/ast_grep_search for discovery and read for file contents.\n- Bash is allowed for non-mutating diagnostics and shell-native inspection when it is the clearest tool, but not for modifying files.\n- Do not use cat/head/tail/sed/awk only to read code into context; use read/grep unless a shell pipeline is genuinely the better diagnostic.";
26
20
  export declare const NO_SHELL_READONLY_FILE_OPERATIONS_RULES = "**File Operations Rules**:\n- READ-ONLY: inspect and report; do not modify files.\n- Use glob/grep/ast_grep_search for discovery and read for file contents.\n- Do not use bash or shell commands.";
@@ -69,8 +69,6 @@ export declare const CouncilConfigSchema: z.ZodPipe<z.ZodObject<{
69
69
  }>>;
70
70
  councillor_retries: z.ZodDefault<z.ZodNumber>;
71
71
  master: z.ZodOptional<z.ZodUnknown>;
72
- master_timeout: z.ZodOptional<z.ZodUnknown>;
73
- master_fallback: z.ZodOptional<z.ZodUnknown>;
74
72
  }, z.core.$strip>, z.ZodTransform<{
75
73
  presets: Record<string, Record<string, {
76
74
  model: string;
@@ -94,22 +92,9 @@ export declare const CouncilConfigSchema: z.ZodPipe<z.ZodObject<{
94
92
  councillor_execution_mode: "parallel" | "serial";
95
93
  councillor_retries: number;
96
94
  master?: unknown;
97
- master_timeout?: unknown;
98
- master_fallback?: unknown;
99
95
  }>>;
100
96
  export type CouncilConfig = z.infer<typeof CouncilConfigSchema>;
101
97
  export type CouncillorExecutionMode = z.infer<typeof CouncillorExecutionModeSchema>;
102
- /**
103
- * A sensible default council configuration that users can copy into their
104
- * opencode.jsonc. Provides a 3-councillor preset using common models.
105
- *
106
- * Users should replace models with ones they have access to.
107
- *
108
- * ```jsonc
109
- * "council": DEFAULT_COUNCIL_CONFIG
110
- * ```
111
- */
112
- export declare const DEFAULT_COUNCIL_CONFIG: z.input<typeof CouncilConfigSchema>;
113
98
  /**
114
99
  * Result of a council session.
115
100
  */
@@ -9,4 +9,3 @@ export declare function setActiveRuntimePreset(name: string | null): void;
9
9
  export declare function getActiveRuntimePreset(): string | null;
10
10
  export declare function getPreviousRuntimePreset(): string | null;
11
11
  export declare function setActiveRuntimePresetWithPrevious(name: string | null): void;
12
- export declare function rollbackRuntimePreset(previous: string | null): void;
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- declare const FALLBACK_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
3
2
  declare const MANUAL_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
4
3
  export declare const ProviderModelIdSchema: z.ZodString;
5
4
  export declare const ManualAgentPlanSchema: z.ZodObject<{
@@ -49,7 +48,6 @@ export declare const ManualPlanSchema: z.ZodObject<{
49
48
  export type ManualAgentName = (typeof MANUAL_AGENT_NAMES)[number];
50
49
  export type ManualAgentPlan = z.infer<typeof ManualAgentPlanSchema>;
51
50
  export type ManualPlan = z.infer<typeof ManualPlanSchema>;
52
- export type FallbackAgentName = (typeof FALLBACK_AGENT_NAMES)[number];
53
51
  export declare const AgentOverrideConfigSchema: z.ZodObject<{
54
52
  model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
55
53
  id: z.ZodString;
@@ -177,16 +175,8 @@ export declare const FailoverConfigSchema: z.ZodObject<{
177
175
  enabled: z.ZodDefault<z.ZodBoolean>;
178
176
  timeoutMs: z.ZodDefault<z.ZodNumber>;
179
177
  retryDelayMs: z.ZodDefault<z.ZodNumber>;
180
- chains: z.ZodDefault<z.ZodObject<{
181
- orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
- oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
183
- designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
184
- explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
185
- librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
186
- fixer: z.ZodOptional<z.ZodArray<z.ZodString>>;
187
- }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
188
178
  retry_on_empty: z.ZodDefault<z.ZodBoolean>;
189
- }, z.core.$strip>;
179
+ }, z.core.$strict>;
190
180
  export type FailoverConfig = z.infer<typeof FailoverConfigSchema>;
191
181
  export declare const CompanionConfigSchema: z.ZodObject<{
192
182
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -206,51 +196,7 @@ export type CompanionConfig = z.infer<typeof CompanionConfigSchema>;
206
196
  export declare const PluginConfigSchema: z.ZodObject<{
207
197
  preset: z.ZodOptional<z.ZodString>;
208
198
  setDefaultAgent: z.ZodOptional<z.ZodBoolean>;
209
- scoringEngineVersion: z.ZodOptional<z.ZodEnum<{
210
- v1: "v1";
211
- "v2-shadow": "v2-shadow";
212
- v2: "v2";
213
- }>>;
214
- balanceProviderUsage: z.ZodOptional<z.ZodBoolean>;
215
199
  autoUpdate: z.ZodOptional<z.ZodBoolean>;
216
- manualPlan: z.ZodOptional<z.ZodObject<{
217
- orchestrator: z.ZodObject<{
218
- primary: z.ZodString;
219
- fallback1: z.ZodString;
220
- fallback2: z.ZodString;
221
- fallback3: z.ZodString;
222
- }, z.core.$strip>;
223
- oracle: z.ZodObject<{
224
- primary: z.ZodString;
225
- fallback1: z.ZodString;
226
- fallback2: z.ZodString;
227
- fallback3: z.ZodString;
228
- }, z.core.$strip>;
229
- designer: z.ZodObject<{
230
- primary: z.ZodString;
231
- fallback1: z.ZodString;
232
- fallback2: z.ZodString;
233
- fallback3: z.ZodString;
234
- }, z.core.$strip>;
235
- explorer: z.ZodObject<{
236
- primary: z.ZodString;
237
- fallback1: z.ZodString;
238
- fallback2: z.ZodString;
239
- fallback3: z.ZodString;
240
- }, z.core.$strip>;
241
- librarian: z.ZodObject<{
242
- primary: z.ZodString;
243
- fallback1: z.ZodString;
244
- fallback2: z.ZodString;
245
- fallback3: z.ZodString;
246
- }, z.core.$strip>;
247
- fixer: z.ZodObject<{
248
- primary: z.ZodString;
249
- fallback1: z.ZodString;
250
- fallback2: z.ZodString;
251
- fallback3: z.ZodString;
252
- }, z.core.$strip>;
253
- }, z.core.$strict>>;
254
200
  presets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
255
201
  model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
256
202
  id: z.ZodString;
@@ -334,16 +280,8 @@ export declare const PluginConfigSchema: z.ZodObject<{
334
280
  enabled: z.ZodDefault<z.ZodBoolean>;
335
281
  timeoutMs: z.ZodDefault<z.ZodNumber>;
336
282
  retryDelayMs: z.ZodDefault<z.ZodNumber>;
337
- chains: z.ZodDefault<z.ZodObject<{
338
- orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
339
- oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
340
- designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
341
- explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
342
- librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
343
- fixer: z.ZodOptional<z.ZodArray<z.ZodString>>;
344
- }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
345
283
  retry_on_empty: z.ZodDefault<z.ZodBoolean>;
346
- }, z.core.$strip>>;
284
+ }, z.core.$strict>>;
347
285
  council: z.ZodOptional<z.ZodPipe<z.ZodObject<{
348
286
  presets: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>, z.ZodTransform<Record<string, {
349
287
  model: string;
@@ -358,8 +296,6 @@ export declare const PluginConfigSchema: z.ZodObject<{
358
296
  }>>;
359
297
  councillor_retries: z.ZodDefault<z.ZodNumber>;
360
298
  master: z.ZodOptional<z.ZodUnknown>;
361
- master_timeout: z.ZodOptional<z.ZodUnknown>;
362
- master_fallback: z.ZodOptional<z.ZodUnknown>;
363
299
  }, z.core.$strip>, z.ZodTransform<{
364
300
  presets: Record<string, Record<string, {
365
301
  model: string;
@@ -383,8 +319,6 @@ export declare const PluginConfigSchema: z.ZodObject<{
383
319
  councillor_execution_mode: "parallel" | "serial";
384
320
  councillor_retries: number;
385
321
  master?: unknown;
386
- master_timeout?: unknown;
387
- master_fallback?: unknown;
388
322
  }>>>;
389
323
  companion: z.ZodOptional<z.ZodObject<{
390
324
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -0,0 +1,9 @@
1
+ export interface SkillSyncResult {
2
+ installed: string[];
3
+ skippedExisting: string[];
4
+ failed: string[];
5
+ }
6
+ /**
7
+ * Synchronizes bundled skills from the newly installed package root to OpenCode config skills directory.
8
+ */
9
+ export declare function syncBundledSkillsFromPackage(packageRoot: string): SkillSyncResult;
@@ -5,19 +5,7 @@
5
5
  */
6
6
  import type { PluginInput } from '@opencode-ai/plugin';
7
7
  import { type PluginConfig } from '../../config';
8
- interface MessageInfo {
9
- role: string;
10
- agent?: string;
11
- }
12
- interface MessagePart {
13
- type: string;
14
- text?: string;
15
- [key: string]: unknown;
16
- }
17
- interface MessageWithParts {
18
- info: MessageInfo;
19
- parts: MessagePart[];
20
- }
8
+ import type { MessageWithParts } from '../types';
21
9
  type SkillRule = 'allow' | 'ask' | 'deny';
22
10
  declare function filterAvailableSkillsText(text: string, permissionRules: Record<string, SkillRule>): string;
23
11
  /**
@@ -20,7 +20,7 @@ export declare function isRateLimitError(error: unknown): boolean;
20
20
  * Manages runtime model fallback for foreground agent sessions.
21
21
  *
22
22
  * Constructed at plugin init with the ordered fallback chains for each agent
23
- * (built from _modelArray entries merged with fallback.chains config).
23
+ * (built from _modelArray entries in agents.<name>.model).
24
24
  */
25
25
  export declare class ForegroundFallbackManager {
26
26
  private readonly client;