oh-my-opencode 3.0.0-beta.7 → 3.0.0-beta.9

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 (71) hide show
  1. package/README.ja.md +6 -13
  2. package/README.md +20 -25
  3. package/README.zh-cn.md +18 -20
  4. package/bin/oh-my-opencode.js +80 -0
  5. package/bin/platform.js +38 -0
  6. package/bin/platform.test.ts +148 -0
  7. package/dist/agents/orchestrator-sisyphus.d.ts +2 -2
  8. package/dist/agents/prometheus-prompt.d.ts +1 -1
  9. package/dist/agents/sisyphus-junior.d.ts +1 -1
  10. package/dist/agents/utils.d.ts +3 -3
  11. package/dist/cli/config-manager.d.ts +9 -1
  12. package/dist/cli/doctor/checks/opencode.d.ts +5 -1
  13. package/dist/cli/index.js +292 -156
  14. package/dist/config/schema.d.ts +205 -211
  15. package/dist/features/background-agent/concurrency.d.ts +17 -0
  16. package/dist/features/background-agent/manager.d.ts +29 -5
  17. package/dist/features/background-agent/types.d.ts +3 -1
  18. package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
  19. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
  20. package/dist/features/claude-code-session-state/state.d.ts +2 -1
  21. package/dist/features/context-injector/index.d.ts +1 -1
  22. package/dist/features/hook-message-injector/index.d.ts +1 -1
  23. package/dist/features/opencode-skill-loader/skill-content.d.ts +11 -0
  24. package/dist/features/skill-mcp-manager/manager.d.ts +10 -0
  25. package/dist/features/task-toast-manager/index.d.ts +1 -1
  26. package/dist/features/task-toast-manager/manager.d.ts +2 -1
  27. package/dist/features/task-toast-manager/types.d.ts +5 -0
  28. package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
  29. package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +1 -1
  30. package/dist/hooks/anthropic-context-window-limit-recovery/index.d.ts +1 -2
  31. package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +0 -5
  32. package/dist/hooks/comment-checker/cli.d.ts +0 -1
  33. package/dist/hooks/comment-checker/cli.test.d.ts +1 -0
  34. package/dist/hooks/compaction-context-injector/index.d.ts +7 -1
  35. package/dist/hooks/delegate-task-retry/index.d.ts +24 -0
  36. package/dist/hooks/delegate-task-retry/index.test.d.ts +1 -0
  37. package/dist/hooks/index.d.ts +1 -2
  38. package/dist/hooks/prometheus-md-only/constants.d.ts +1 -1
  39. package/dist/index.js +3688 -2120
  40. package/dist/shared/agent-tool-restrictions.d.ts +7 -0
  41. package/dist/shared/index.d.ts +4 -0
  42. package/dist/shared/opencode-version.d.ts +6 -3
  43. package/dist/shared/permission-compat.d.ts +22 -9
  44. package/dist/shared/session-cursor.d.ts +13 -0
  45. package/dist/shared/session-cursor.test.d.ts +1 -0
  46. package/dist/shared/shell-env.d.ts +41 -0
  47. package/dist/shared/shell-env.test.d.ts +1 -0
  48. package/dist/shared/system-directive.d.ts +31 -0
  49. package/dist/tools/{sisyphus-task → delegate-task}/constants.d.ts +1 -1
  50. package/dist/tools/{sisyphus-task → delegate-task}/index.d.ts +1 -1
  51. package/dist/tools/{sisyphus-task → delegate-task}/tools.d.ts +2 -2
  52. package/dist/tools/delegate-task/tools.test.d.ts +1 -0
  53. package/dist/tools/{sisyphus-task → delegate-task}/types.d.ts +2 -2
  54. package/dist/tools/index.d.ts +1 -1
  55. package/dist/tools/interactive-bash/constants.d.ts +1 -1
  56. package/dist/tools/look-at/tools.d.ts +7 -0
  57. package/dist/tools/look-at/tools.test.d.ts +1 -0
  58. package/dist/tools/lsp/client.d.ts +0 -3
  59. package/dist/tools/lsp/config.test.d.ts +1 -0
  60. package/dist/tools/lsp/index.d.ts +1 -1
  61. package/dist/tools/lsp/tools.d.ts +0 -1
  62. package/dist/tools/lsp/types.d.ts +0 -33
  63. package/dist/tools/lsp/utils.d.ts +1 -4
  64. package/dist/tools/skill/types.d.ts +3 -0
  65. package/package.json +18 -3
  66. package/postinstall.mjs +43 -0
  67. package/dist/hooks/empty-message-sanitizer/index.d.ts +0 -12
  68. package/dist/hooks/preemptive-compaction/constants.d.ts +0 -3
  69. package/dist/hooks/preemptive-compaction/index.d.ts +0 -24
  70. package/dist/hooks/preemptive-compaction/types.d.ts +0 -17
  71. /package/dist/{tools/sisyphus-task/tools.test.d.ts → features/claude-code-session-state/state.test.d.ts} +0 -0
package/README.ja.md CHANGED
@@ -548,11 +548,7 @@ Ask @explore for the policy on this feature
548
548
  あなたがエディタで使っているその機能、他のエージェントは触ることができません。
549
549
  最高の同僚に最高の道具を渡してください。これでリファクタリングも、ナビゲーションも、分析も、エージェントが適切に行えるようになります。
550
550
 
551
- - **lsp_goto_definition**: シンボル定義へジャンプ
552
- - **lsp_find_references**: ワークスペース全体で使用箇所を検索
553
- - **lsp_symbols**: ファイルからシンボルを取得 (scope='document') またはワークスペース全体を検索 (scope='workspace')
554
551
  - **lsp_diagnostics**: ビルド前にエラー/警告を取得
555
- - **lsp_servers**: 利用可能な LSP サーバー一覧
556
552
  - **lsp_prepare_rename**: 名前変更操作の検証
557
553
  - **lsp_rename**: ワークスペース全体でシンボル名を変更
558
554
  - **ast_grep_search**: AST 認識コードパターン検索 (25言語対応)
@@ -1000,7 +996,7 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
1000
996
  }
1001
997
  ```
1002
998
 
1003
- 利用可能なフック:`todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `preemptive-compaction`
999
+ 利用可能なフック:`todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `preemptive-compaction`
1004
1000
 
1005
1001
  **`auto-update-checker`と`startup-toast`について**: `startup-toast` フックは `auto-update-checker` のサブ機能です。アップデートチェックは有効なまま起動トースト通知のみを無効化するには、`disabled_hooks` に `"startup-toast"` を追加してください。すべてのアップデートチェック機能(トーストを含む)を無効化するには、`"auto-update-checker"` を追加してください。
1006
1002
 
@@ -1051,7 +1047,6 @@ OpenCode でサポートされるすべての LSP 構成およびカスタム設
1051
1047
  ```json
1052
1048
  {
1053
1049
  "experimental": {
1054
- "preemptive_compaction_threshold": 0.85,
1055
1050
  "truncate_all_tool_outputs": true,
1056
1051
  "aggressive_truncation": true,
1057
1052
  "auto_resume": true
@@ -1059,13 +1054,11 @@ OpenCode でサポートされるすべての LSP 構成およびカスタム設
1059
1054
  }
1060
1055
  ```
1061
1056
 
1062
- | オプション | デフォルト | 説明 |
1063
- | --------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1064
- | `preemptive_compaction_threshold` | `0.85` | プリエンプティブコンパクションをトリガーする閾値(0.5-0.95)。`preemptive-compaction` フックはデフォルトで有効です。このオプションで閾値をカスタマイズできます。 |
1065
- | `truncate_all_tool_outputs` | `false` | ホワイトリストのツール(Grep、Glob、LSP、AST-grep)だけでなく、すべてのツール出力を切り詰めます。Tool output truncator はデフォルトで有効です - `disabled_hooks`で無効化できます。 |
1066
- | `aggressive_truncation` | `false` | トークン制限を超えた場合、ツール出力を積極的に切り詰めて制限内に収めます。デフォルトの切り詰めより積極的です。不十分な場合は要約/復元にフォールバックします。 |
1067
- | `auto_resume` | `false` | thinking block エラーや thinking disabled violation からの回復成功後、自動的にセッションを再開します。最後のユーザーメッセージを抽出して続行します。 |
1068
- | `dcp_for_compaction` | `false` | コンパクション用DCP(動的コンテキスト整理)を有効化 - トークン制限超過時に最初に実行されます。コンパクション前に重複したツール呼び出しと古いツール出力を整理します。 |
1057
+ | オプション | デフォルト | 説明 |
1058
+ | --------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1059
+ | `truncate_all_tool_outputs` | `false` | ホワイトリストのツール(Grep、Glob、LSP、AST-grep)だけでなく、すべてのツール出力を切り詰めます。Tool output truncator はデフォルトで有効です - `disabled_hooks`で無効化できます。 |
1060
+ | `aggressive_truncation` | `false` | トークン制限を超えた場合、ツール出力を積極的に切り詰めて制限内に収めます。デフォルトの切り詰めより積極的です。不十分な場合は要約/復元にフォールバックします。 |
1061
+ | `auto_resume` | `false` | thinking block エラーや thinking disabled violation からの回復成功後、自動的にセッションを再開します。最後のユーザーメッセージを抽出して続行します。 |
1069
1062
 
1070
1063
  **警告**:これらの機能は実験的であり、予期しない動作を引き起こす可能性があります。影響を理解した場合にのみ有効にしてください。
1071
1064
 
package/README.md CHANGED
@@ -5,8 +5,8 @@
5
5
 
6
6
  > [!TIP]
7
7
  >
8
- > [![The Orchestrator is now available in beta.](./.github/assets/orchestrator-sisyphus.png?v=3)](https://github.com/code-yeongyu/oh-my-opencode/releases/tag/v3.0.0-beta.1)
9
- > > **The Orchestrator is now available in beta. Use `oh-my-opencode@3.0.0-beta.6` to install it.**
8
+ > [![The Orchestrator is now available in beta.](./.github/assets/orchestrator-sisyphus.png?v=3)](https://github.com/code-yeongyu/oh-my-opencode/releases/tag/v3.0.0-beta.7)
9
+ > > **The Orchestrator is now available in beta. Use `oh-my-opencode@3.0.0-beta.7` to install it.**
10
10
  >
11
11
  > Be with us!
12
12
  >
@@ -261,12 +261,14 @@ If you don't want all this, as mentioned, you can just pick and choose specific
261
261
  Run the interactive installer:
262
262
 
263
263
  ```bash
264
- bunx oh-my-opencode install
265
- # or use npx if bunx doesn't work
266
264
  npx oh-my-opencode install
265
+ # or with bun
266
+ bunx oh-my-opencode install
267
267
  ```
268
268
 
269
- > **Note for Ubuntu/Debian users**: If you installed Bun via Snap (`/snap/bin/bun`), `bunx` will fail with "script not found" due to Snap's sandboxing. Either use `npx` instead, or reinstall Bun via the official installer: `curl -fsSL https://bun.sh/install | bash`
269
+ > **Note**: The CLI ships with standalone binaries for all major platforms. No runtime (Bun/Node.js) is required for CLI execution after installation.
270
+ >
271
+ > **Supported platforms**: macOS (ARM64, x64), Linux (x64, ARM64, Alpine/musl), Windows (x64)
270
272
 
271
273
  Follow the prompts to configure your Claude, ChatGPT, and Gemini subscriptions. After installation, authenticate your providers as instructed.
272
274
 
@@ -575,17 +577,13 @@ Syntax highlighting, autocomplete, refactoring, navigation, analysis—and now a
575
577
  The features in your editor? Other agents can't touch them.
576
578
  Hand your best tools to your best colleagues. Now they can properly refactor, navigate, and analyze.
577
579
 
578
- - **lsp_goto_definition**: Jump to symbol definition
579
- - **lsp_find_references**: Find all usages across workspace
580
- - **lsp_symbols**: Get symbols from file (scope='document') or search across workspace (scope='workspace')
581
580
  - **lsp_diagnostics**: Get errors/warnings before build
582
- - **lsp_servers**: List available LSP servers
583
581
  - **lsp_prepare_rename**: Validate rename operation
584
582
  - **lsp_rename**: Rename symbol across workspace
585
583
  - **ast_grep_search**: AST-aware code pattern search (25 languages)
586
584
  - **ast_grep_replace**: AST-aware code replacement
587
585
  - **call_omo_agent**: Spawn specialized explore/librarian agents. Supports `run_in_background` parameter for async execution.
588
- - **sisyphus_task**: Category-based task delegation with specialized agents. Supports pre-configured categories (visual, business-logic) or direct agent targeting. Use `background_output` to retrieve results and `background_cancel` to cancel tasks. See [Categories](#categories).
586
+ - **delegate_task**: Category-based task delegation with specialized agents. Supports pre-configured categories (visual, business-logic) or direct agent targeting. Use `background_output` to retrieve results and `background_cancel` to cancel tasks. See [Categories](#categories).
589
587
 
590
588
  #### Session Management
591
589
 
@@ -924,7 +922,7 @@ Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, `
924
922
  Oh My OpenCode includes built-in skills that provide additional capabilities:
925
923
 
926
924
  - **playwright**: Browser automation with Playwright MCP. Use for web scraping, testing, screenshots, and browser interactions.
927
- - **git-master**: Git expert for atomic commits, rebase/squash, and history search (blame, bisect, log -S). STRONGLY RECOMMENDED: Use with `sisyphus_task(category='quick', skills=['git-master'], ...)` to save context.
925
+ - **git-master**: Git expert for atomic commits, rebase/squash, and history search (blame, bisect, log -S). STRONGLY RECOMMENDED: Use with `delegate_task(category='quick', skills=['git-master'], ...)` to save context.
928
926
 
929
927
  Disable built-in skills via `disabled_skills` in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`:
930
928
 
@@ -1063,7 +1061,7 @@ Configure concurrency limits for background agent tasks. This controls how many
1063
1061
 
1064
1062
  ### Categories
1065
1063
 
1066
- Categories enable domain-specific task delegation via the `sisyphus_task` tool. Each category applies runtime presets (model, temperature, prompt additions) when calling the `Sisyphus-Junior` agent.
1064
+ Categories enable domain-specific task delegation via the `delegate_task` tool. Each category applies runtime presets (model, temperature, prompt additions) when calling the `Sisyphus-Junior` agent.
1067
1065
 
1068
1066
  **Default Categories:**
1069
1067
 
@@ -1075,12 +1073,12 @@ Categories enable domain-specific task delegation via the `sisyphus_task` tool.
1075
1073
  **Usage:**
1076
1074
 
1077
1075
  ```
1078
- // Via sisyphus_task tool
1079
- sisyphus_task(category="visual", prompt="Create a responsive dashboard component")
1080
- sisyphus_task(category="business-logic", prompt="Design the payment processing flow")
1076
+ // Via delegate_task tool
1077
+ delegate_task(category="visual", prompt="Create a responsive dashboard component")
1078
+ delegate_task(category="business-logic", prompt="Design the payment processing flow")
1081
1079
 
1082
1080
  // Or target a specific agent directly
1083
- sisyphus_task(agent="oracle", prompt="Review this architecture")
1081
+ delegate_task(agent="oracle", prompt="Review this architecture")
1084
1082
  ```
1085
1083
 
1086
1084
  **Custom Categories:**
@@ -1115,7 +1113,7 @@ Disable specific built-in hooks via `disabled_hooks` in `~/.config/opencode/oh-m
1115
1113
  }
1116
1114
  ```
1117
1115
 
1118
- Available hooks: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `preemptive-compaction`
1116
+ Available hooks: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `preemptive-compaction`
1119
1117
 
1120
1118
  **Note on `auto-update-checker` and `startup-toast`**: The `startup-toast` hook is a sub-feature of `auto-update-checker`. To disable only the startup toast notification while keeping update checking enabled, add `"startup-toast"` to `disabled_hooks`. To disable all update checking features (including the toast), add `"auto-update-checker"` to `disabled_hooks`.
1121
1119
 
@@ -1167,7 +1165,6 @@ Opt-in experimental features that may change or be removed in future versions. U
1167
1165
  ```json
1168
1166
  {
1169
1167
  "experimental": {
1170
- "preemptive_compaction_threshold": 0.85,
1171
1168
  "truncate_all_tool_outputs": true,
1172
1169
  "aggressive_truncation": true,
1173
1170
  "auto_resume": true
@@ -1175,13 +1172,11 @@ Opt-in experimental features that may change or be removed in future versions. U
1175
1172
  }
1176
1173
  ```
1177
1174
 
1178
- | Option | Default | Description |
1179
- | --------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1180
- | `preemptive_compaction_threshold` | `0.85` | Threshold percentage (0.5-0.95) to trigger preemptive compaction. The `preemptive-compaction` hook is enabled by default; this option customizes the threshold. |
1181
- | `truncate_all_tool_outputs` | `false` | Truncates ALL tool outputs instead of just whitelisted tools (Grep, Glob, LSP, AST-grep). Tool output truncator is enabled by default - disable via `disabled_hooks`. |
1182
- | `aggressive_truncation` | `false` | When token limit is exceeded, aggressively truncates tool outputs to fit within limits. More aggressive than the default truncation behavior. Falls back to summarize/revert if insufficient. |
1183
- | `auto_resume` | `false` | Automatically resumes session after successful recovery from thinking block errors or thinking disabled violations. Extracts the last user message and continues. |
1184
- | `dcp_for_compaction` | `false` | Enable DCP (Dynamic Context Pruning) for compaction - runs first when token limit exceeded. Prunes duplicate tool calls and old tool outputs before running compaction. |
1175
+ | Option | Default | Description |
1176
+ | --------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1177
+ | `truncate_all_tool_outputs` | `false` | Truncates ALL tool outputs instead of just whitelisted tools (Grep, Glob, LSP, AST-grep). Tool output truncator is enabled by default - disable via `disabled_hooks`. |
1178
+ | `aggressive_truncation` | `false` | When token limit is exceeded, aggressively truncates tool outputs to fit within limits. More aggressive than the default truncation behavior. Falls back to summarize/revert if insufficient. |
1179
+ | `auto_resume` | `false` | Automatically resumes session after successful recovery from thinking block errors or thinking disabled violations. Extracts the last user message and continues. |
1185
1180
 
1186
1181
  **Warning**: These features are experimental and may cause unexpected behavior. Enable only if you understand the implications.
1187
1182
 
package/README.zh-cn.md CHANGED
@@ -252,6 +252,11 @@
252
252
 
253
253
  ### 面向人类用户
254
254
 
255
+ > **⚠️ 先决条件:需要安装 Bun**
256
+ >
257
+ > 此工具**需要系统中已安装 [Bun](https://bun.sh/)** 才能运行。
258
+ > 即使使用 `npx` 运行安装程序,底层运行时仍依赖于 Bun。
259
+
255
260
  运行交互式安装程序:
256
261
 
257
262
  ```bash
@@ -569,17 +574,13 @@ gh repo star code-yeongyu/oh-my-opencode
569
574
  你编辑器中的功能?其他智能体无法触及。
570
575
  把你最好的工具交给你最好的同事。现在它们可以正确地重构、导航和分析。
571
576
 
572
- - **lsp_goto_definition**:跳转到符号定义
573
- - **lsp_find_references**:查找工作区中的所有使用
574
- - **lsp_symbols**:从文件获取符号 (scope='document') 或在工作区中搜索 (scope='workspace')
575
577
  - **lsp_diagnostics**:在构建前获取错误/警告
576
- - **lsp_servers**:列出可用的 LSP 服务器
577
578
  - **lsp_prepare_rename**:验证重命名操作
578
579
  - **lsp_rename**:在工作区中重命名符号
579
580
  - **ast_grep_search**:AST 感知的代码模式搜索(25 种语言)
580
581
  - **ast_grep_replace**:AST 感知的代码替换
581
582
  - **call_omo_agent**:生成专业的 explore/librarian 智能体。支持 `run_in_background` 参数进行异步执行。
582
- - **sisyphus_task**:基于类别的任务委派,使用专业智能体。支持预配置的类别(visual、business-logic)或直接指定智能体。使用 `background_output` 检索结果,使用 `background_cancel` 取消任务。参见[类别](#类别)。
583
+ - **delegate_task**:基于类别的任务委派,使用专业智能体。支持预配置的类别(visual、business-logic)或直接指定智能体。使用 `background_output` 检索结果,使用 `background_cancel` 取消任务。参见[类别](#类别)。
583
584
 
584
585
  #### 会话管理
585
586
 
@@ -930,7 +931,7 @@ Oh My OpenCode 从以下位置读取和执行钩子:
930
931
  Oh My OpenCode 包含提供额外功能的内置技能:
931
932
 
932
933
  - **playwright**:使用 Playwright MCP 进行浏览器自动化。用于网页抓取、测试、截图和浏览器交互。
933
- - **git-master**:Git 专家,用于原子提交、rebase/squash 和历史搜索(blame、bisect、log -S)。**强烈推荐**:与 `sisyphus_task(category='quick', skills=['git-master'], ...)` 一起使用以节省上下文。
934
+ - **git-master**:Git 专家,用于原子提交、rebase/squash 和历史搜索(blame、bisect、log -S)。**强烈推荐**:与 `delegate_task(category='quick', skills=['git-master'], ...)` 一起使用以节省上下文。
934
935
 
935
936
  通过 `~/.config/opencode/oh-my-opencode.json` 或 `.opencode/oh-my-opencode.json` 中的 `disabled_skills` 禁用内置技能:
936
937
 
@@ -1069,7 +1070,7 @@ Oh My OpenCode 包含提供额外功能的内置技能:
1069
1070
 
1070
1071
  ### 类别
1071
1072
 
1072
- 类别通过 `sisyphus_task` 工具实现领域特定的任务委派。每个类别预配置一个专业的 `Sisyphus-Junior-{category}` 智能体,带有优化的模型设置和提示。
1073
+ 类别通过 `delegate_task` 工具实现领域特定的任务委派。每个类别预配置一个专业的 `Sisyphus-Junior-{category}` 智能体,带有优化的模型设置和提示。
1073
1074
 
1074
1075
  **默认类别:**
1075
1076
 
@@ -1081,12 +1082,12 @@ Oh My OpenCode 包含提供额外功能的内置技能:
1081
1082
  **使用方法:**
1082
1083
 
1083
1084
  ```
1084
- // 通过 sisyphus_task 工具
1085
- sisyphus_task(category="visual", prompt="创建一个响应式仪表板组件")
1086
- sisyphus_task(category="business-logic", prompt="设计支付处理流程")
1085
+ // 通过 delegate_task 工具
1086
+ delegate_task(category="visual", prompt="创建一个响应式仪表板组件")
1087
+ delegate_task(category="business-logic", prompt="设计支付处理流程")
1087
1088
 
1088
1089
  // 或直接指定特定智能体
1089
- sisyphus_task(agent="oracle", prompt="审查这个架构")
1090
+ delegate_task(agent="oracle", prompt="审查这个架构")
1090
1091
  ```
1091
1092
 
1092
1093
  **自定义类别:**
@@ -1121,7 +1122,7 @@ sisyphus_task(agent="oracle", prompt="审查这个架构")
1121
1122
  }
1122
1123
  ```
1123
1124
 
1124
- 可用钩子:`todo-continuation-enforcer`、`context-window-monitor`、`session-recovery`、`session-notification`、`comment-checker`、`grep-output-truncator`、`tool-output-truncator`、`directory-agents-injector`、`directory-readme-injector`、`empty-task-response-detector`、`think-mode`、`anthropic-context-window-limit-recovery`、`rules-injector`、`background-notification`、`auto-update-checker`、`startup-toast`、`keyword-detector`、`agent-usage-reminder`、`non-interactive-env`、`interactive-bash-session`、`empty-message-sanitizer`、`compaction-context-injector`、`thinking-block-validator`、`claude-code-hooks`、`ralph-loop`、`preemptive-compaction`
1125
+ 可用钩子:`todo-continuation-enforcer`、`context-window-monitor`、`session-recovery`、`session-notification`、`comment-checker`、`grep-output-truncator`、`tool-output-truncator`、`directory-agents-injector`、`directory-readme-injector`、`empty-task-response-detector`、`think-mode`、`anthropic-context-window-limit-recovery`、`rules-injector`、`background-notification`、`auto-update-checker`、`startup-toast`、`keyword-detector`、`agent-usage-reminder`、`non-interactive-env`、`interactive-bash-session`、`compaction-context-injector`、`thinking-block-validator`、`claude-code-hooks`、`ralph-loop`、`preemptive-compaction`
1125
1126
 
1126
1127
  **关于 `auto-update-checker` 和 `startup-toast` 的说明**:`startup-toast` 钩子是 `auto-update-checker` 的子功能。要仅禁用启动 toast 通知而保持更新检查启用,在 `disabled_hooks` 中添加 `"startup-toast"`。要禁用所有更新检查功能(包括 toast),在 `disabled_hooks` 中添加 `"auto-update-checker"`。
1127
1128
 
@@ -1173,7 +1174,6 @@ Oh My OpenCode 添加了重构工具(重命名、代码操作)。
1173
1174
  ```json
1174
1175
  {
1175
1176
  "experimental": {
1176
- "preemptive_compaction_threshold": 0.85,
1177
1177
  "truncate_all_tool_outputs": true,
1178
1178
  "aggressive_truncation": true,
1179
1179
  "auto_resume": true
@@ -1181,13 +1181,11 @@ Oh My OpenCode 添加了重构工具(重命名、代码操作)。
1181
1181
  }
1182
1182
  ```
1183
1183
 
1184
- | 选项 | 默认 | 描述 |
1185
- | --------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1186
- | `preemptive_compaction_threshold` | `0.85` | 触发预防性压缩的阈值百分比(0.5-0.95)。`preemptive-compaction` 钩子默认启用;此选项自定义阈值。 |
1187
- | `truncate_all_tool_outputs` | `false` | 截断所有工具输出而不仅仅是白名单工具(Grep、Glob、LSP、AST-grep)。工具输出截断器默认启用——通过 `disabled_hooks` 禁用。 |
1188
- | `aggressive_truncation` | `false` | 当超过 token 限制时,积极截断工具输出以适应限制。比默认截断行为更激进。如果不足以满足,则回退到总结/恢复。 |
1189
- | `auto_resume` | `false` | 从思考块错误或禁用思考违规成功恢复后自动恢复会话。提取最后一条用户消息并继续。 |
1190
- | `dcp_for_compaction` | `false` | 为压缩启用 DCP(动态上下文修剪)——当超过 token 限制时首先运行。在运行压缩之前修剪重复的工具调用和旧的工具输出。 |
1184
+ | 选项 | 默认 | 描述 |
1185
+ | --------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
1186
+ | `truncate_all_tool_outputs` | `false` | 截断所有工具输出而不仅仅是白名单工具(Grep、Glob、LSP、AST-grep)。工具输出截断器默认启用——通过 `disabled_hooks` 禁用。 |
1187
+ | `aggressive_truncation` | `false` | 当超过 token 限制时,积极截断工具输出以适应限制。比默认截断行为更激进。如果不足以满足,则回退到总结/恢复。 |
1188
+ | `auto_resume` | `false` | 从思考块错误或禁用思考违规成功恢复后自动恢复会话。提取最后一条用户消息并继续。 |
1191
1189
 
1192
1190
  **警告**:这些功能是实验性的,可能导致意外行为。只有在理解其影响后才启用。
1193
1191
 
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env node
2
+ // bin/oh-my-opencode.js
3
+ // Wrapper script that detects platform and spawns the correct binary
4
+
5
+ import { spawnSync } from "node:child_process";
6
+ import { createRequire } from "node:module";
7
+ import { getPlatformPackage, getBinaryPath } from "./platform.js";
8
+
9
+ const require = createRequire(import.meta.url);
10
+
11
+ /**
12
+ * Detect libc family on Linux
13
+ * @returns {string | null} 'glibc', 'musl', or null if detection fails
14
+ */
15
+ function getLibcFamily() {
16
+ if (process.platform !== "linux") {
17
+ return undefined; // Not needed on non-Linux
18
+ }
19
+
20
+ try {
21
+ const detectLibc = require("detect-libc");
22
+ return detectLibc.familySync();
23
+ } catch {
24
+ // detect-libc not available
25
+ return null;
26
+ }
27
+ }
28
+
29
+ function main() {
30
+ const { platform, arch } = process;
31
+ const libcFamily = getLibcFamily();
32
+
33
+ // Get platform package name
34
+ let pkg;
35
+ try {
36
+ pkg = getPlatformPackage({ platform, arch, libcFamily });
37
+ } catch (error) {
38
+ console.error(`\noh-my-opencode: ${error.message}\n`);
39
+ process.exit(1);
40
+ }
41
+
42
+ // Resolve binary path
43
+ const binRelPath = getBinaryPath(pkg, platform);
44
+
45
+ let binPath;
46
+ try {
47
+ binPath = require.resolve(binRelPath);
48
+ } catch {
49
+ console.error(`\noh-my-opencode: Platform binary not installed.`);
50
+ console.error(`\nYour platform: ${platform}-${arch}${libcFamily === "musl" ? "-musl" : ""}`);
51
+ console.error(`Expected package: ${pkg}`);
52
+ console.error(`\nTo fix, run:`);
53
+ console.error(` npm install ${pkg}\n`);
54
+ process.exit(1);
55
+ }
56
+
57
+ // Spawn the binary
58
+ const result = spawnSync(binPath, process.argv.slice(2), {
59
+ stdio: "inherit",
60
+ });
61
+
62
+ // Handle spawn errors
63
+ if (result.error) {
64
+ console.error(`\noh-my-opencode: Failed to execute binary.`);
65
+ console.error(`Error: ${result.error.message}\n`);
66
+ process.exit(2);
67
+ }
68
+
69
+ // Handle signals
70
+ if (result.signal) {
71
+ const signalNum = result.signal === "SIGTERM" ? 15 :
72
+ result.signal === "SIGKILL" ? 9 :
73
+ result.signal === "SIGINT" ? 2 : 1;
74
+ process.exit(128 + signalNum);
75
+ }
76
+
77
+ process.exit(result.status ?? 1);
78
+ }
79
+
80
+ main();
@@ -0,0 +1,38 @@
1
+ // bin/platform.js
2
+ // Shared platform detection module - used by wrapper and postinstall
3
+
4
+ /**
5
+ * Get the platform-specific package name
6
+ * @param {{ platform: string, arch: string, libcFamily?: string | null }} options
7
+ * @returns {string} Package name like "oh-my-opencode-darwin-arm64"
8
+ * @throws {Error} If libc cannot be detected on Linux
9
+ */
10
+ export function getPlatformPackage({ platform, arch, libcFamily }) {
11
+ let suffix = "";
12
+ if (platform === "linux") {
13
+ if (libcFamily === null || libcFamily === undefined) {
14
+ throw new Error(
15
+ "Could not detect libc on Linux. " +
16
+ "Please ensure detect-libc is installed or report this issue."
17
+ );
18
+ }
19
+ if (libcFamily === "musl") {
20
+ suffix = "-musl";
21
+ }
22
+ }
23
+
24
+ // Map platform names: win32 -> windows (for package name)
25
+ const os = platform === "win32" ? "windows" : platform;
26
+ return `oh-my-opencode-${os}-${arch}${suffix}`;
27
+ }
28
+
29
+ /**
30
+ * Get the path to the binary within a platform package
31
+ * @param {string} pkg Package name
32
+ * @param {string} platform Process platform
33
+ * @returns {string} Relative path like "oh-my-opencode-darwin-arm64/bin/oh-my-opencode"
34
+ */
35
+ export function getBinaryPath(pkg, platform) {
36
+ const ext = platform === "win32" ? ".exe" : "";
37
+ return `${pkg}/bin/oh-my-opencode${ext}`;
38
+ }
@@ -0,0 +1,148 @@
1
+ // bin/platform.test.ts
2
+ import { describe, expect, test } from "bun:test";
3
+ import { getPlatformPackage, getBinaryPath } from "./platform.js";
4
+
5
+ describe("getPlatformPackage", () => {
6
+ // #region Darwin platforms
7
+ test("returns darwin-arm64 for macOS ARM64", () => {
8
+ // #given macOS ARM64 platform
9
+ const input = { platform: "darwin", arch: "arm64" };
10
+
11
+ // #when getting platform package
12
+ const result = getPlatformPackage(input);
13
+
14
+ // #then returns correct package name
15
+ expect(result).toBe("oh-my-opencode-darwin-arm64");
16
+ });
17
+
18
+ test("returns darwin-x64 for macOS Intel", () => {
19
+ // #given macOS x64 platform
20
+ const input = { platform: "darwin", arch: "x64" };
21
+
22
+ // #when getting platform package
23
+ const result = getPlatformPackage(input);
24
+
25
+ // #then returns correct package name
26
+ expect(result).toBe("oh-my-opencode-darwin-x64");
27
+ });
28
+ // #endregion
29
+
30
+ // #region Linux glibc platforms
31
+ test("returns linux-x64 for Linux x64 with glibc", () => {
32
+ // #given Linux x64 with glibc
33
+ const input = { platform: "linux", arch: "x64", libcFamily: "glibc" };
34
+
35
+ // #when getting platform package
36
+ const result = getPlatformPackage(input);
37
+
38
+ // #then returns correct package name
39
+ expect(result).toBe("oh-my-opencode-linux-x64");
40
+ });
41
+
42
+ test("returns linux-arm64 for Linux ARM64 with glibc", () => {
43
+ // #given Linux ARM64 with glibc
44
+ const input = { platform: "linux", arch: "arm64", libcFamily: "glibc" };
45
+
46
+ // #when getting platform package
47
+ const result = getPlatformPackage(input);
48
+
49
+ // #then returns correct package name
50
+ expect(result).toBe("oh-my-opencode-linux-arm64");
51
+ });
52
+ // #endregion
53
+
54
+ // #region Linux musl platforms
55
+ test("returns linux-x64-musl for Alpine x64", () => {
56
+ // #given Linux x64 with musl (Alpine)
57
+ const input = { platform: "linux", arch: "x64", libcFamily: "musl" };
58
+
59
+ // #when getting platform package
60
+ const result = getPlatformPackage(input);
61
+
62
+ // #then returns correct package name with musl suffix
63
+ expect(result).toBe("oh-my-opencode-linux-x64-musl");
64
+ });
65
+
66
+ test("returns linux-arm64-musl for Alpine ARM64", () => {
67
+ // #given Linux ARM64 with musl (Alpine)
68
+ const input = { platform: "linux", arch: "arm64", libcFamily: "musl" };
69
+
70
+ // #when getting platform package
71
+ const result = getPlatformPackage(input);
72
+
73
+ // #then returns correct package name with musl suffix
74
+ expect(result).toBe("oh-my-opencode-linux-arm64-musl");
75
+ });
76
+ // #endregion
77
+
78
+ // #region Windows platform
79
+ test("returns windows-x64 for Windows", () => {
80
+ // #given Windows x64 platform (win32 is Node's platform name)
81
+ const input = { platform: "win32", arch: "x64" };
82
+
83
+ // #when getting platform package
84
+ const result = getPlatformPackage(input);
85
+
86
+ // #then returns correct package name with 'windows' not 'win32'
87
+ expect(result).toBe("oh-my-opencode-windows-x64");
88
+ });
89
+ // #endregion
90
+
91
+ // #region Error cases
92
+ test("throws error for Linux with null libcFamily", () => {
93
+ // #given Linux platform with null libc detection
94
+ const input = { platform: "linux", arch: "x64", libcFamily: null };
95
+
96
+ // #when getting platform package
97
+ // #then throws descriptive error
98
+ expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
99
+ });
100
+
101
+ test("throws error for Linux with undefined libcFamily", () => {
102
+ // #given Linux platform with undefined libc
103
+ const input = { platform: "linux", arch: "x64", libcFamily: undefined };
104
+
105
+ // #when getting platform package
106
+ // #then throws descriptive error
107
+ expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
108
+ });
109
+ // #endregion
110
+ });
111
+
112
+ describe("getBinaryPath", () => {
113
+ test("returns path without .exe for Unix platforms", () => {
114
+ // #given Unix platform package
115
+ const pkg = "oh-my-opencode-darwin-arm64";
116
+ const platform = "darwin";
117
+
118
+ // #when getting binary path
119
+ const result = getBinaryPath(pkg, platform);
120
+
121
+ // #then returns path without extension
122
+ expect(result).toBe("oh-my-opencode-darwin-arm64/bin/oh-my-opencode");
123
+ });
124
+
125
+ test("returns path with .exe for Windows", () => {
126
+ // #given Windows platform package
127
+ const pkg = "oh-my-opencode-windows-x64";
128
+ const platform = "win32";
129
+
130
+ // #when getting binary path
131
+ const result = getBinaryPath(pkg, platform);
132
+
133
+ // #then returns path with .exe extension
134
+ expect(result).toBe("oh-my-opencode-windows-x64/bin/oh-my-opencode.exe");
135
+ });
136
+
137
+ test("returns path without .exe for Linux", () => {
138
+ // #given Linux platform package
139
+ const pkg = "oh-my-opencode-linux-x64";
140
+ const platform = "linux";
141
+
142
+ // #when getting binary path
143
+ const result = getBinaryPath(pkg, platform);
144
+
145
+ // #then returns path without extension
146
+ expect(result).toBe("oh-my-opencode-linux-x64/bin/oh-my-opencode");
147
+ });
148
+ });