oh-my-opencode 2.7.3 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.ja.md +10 -4
  2. package/README.ko.md +10 -4
  3. package/README.md +10 -4
  4. package/README.zh-cn.md +10 -4
  5. package/dist/cli/ast-grep-napi.linux-x64-gnu-jfv8414z.node +0 -0
  6. package/dist/cli/ast-grep-napi.linux-x64-musl-8cj2e5cf.node +0 -0
  7. package/dist/cli/doctor/checks/auth.d.ts +7 -0
  8. package/dist/cli/doctor/checks/config.d.ts +8 -0
  9. package/dist/cli/doctor/checks/dependencies.d.ts +8 -0
  10. package/dist/cli/doctor/checks/dependencies.test.d.ts +1 -0
  11. package/dist/cli/doctor/checks/index.d.ts +10 -0
  12. package/dist/cli/doctor/checks/lsp.d.ts +8 -0
  13. package/dist/cli/doctor/checks/lsp.test.d.ts +1 -0
  14. package/dist/cli/doctor/checks/mcp.d.ts +6 -0
  15. package/dist/cli/doctor/checks/mcp.test.d.ts +1 -0
  16. package/dist/cli/doctor/checks/opencode.d.ts +10 -0
  17. package/dist/cli/doctor/checks/opencode.test.d.ts +1 -0
  18. package/dist/cli/doctor/checks/plugin.d.ts +4 -0
  19. package/dist/cli/doctor/checks/plugin.test.d.ts +1 -0
  20. package/dist/cli/doctor/checks/version.d.ts +4 -0
  21. package/dist/cli/doctor/checks/version.test.d.ts +1 -0
  22. package/dist/cli/doctor/constants.d.ts +39 -0
  23. package/dist/cli/doctor/formatter.d.ts +12 -0
  24. package/dist/cli/doctor/formatter.test.d.ts +1 -0
  25. package/dist/cli/doctor/index.d.ts +5 -0
  26. package/dist/cli/doctor/runner.d.ts +7 -0
  27. package/dist/cli/doctor/runner.test.d.ts +1 -0
  28. package/dist/cli/doctor/types.d.ts +91 -0
  29. package/dist/cli/index.js +14180 -76
  30. package/dist/config/index.d.ts +2 -2
  31. package/dist/config/schema.d.ts +96 -4
  32. package/dist/features/builtin-commands/templates/ralph-loop.d.ts +2 -0
  33. package/dist/features/builtin-commands/types.d.ts +1 -1
  34. package/dist/features/builtin-skills/index.d.ts +2 -0
  35. package/dist/features/builtin-skills/skills.d.ts +2 -0
  36. package/dist/features/builtin-skills/types.d.ts +13 -0
  37. package/dist/features/{claude-code-skill-loader → opencode-skill-loader}/index.d.ts +1 -0
  38. package/dist/features/opencode-skill-loader/loader.d.ts +41 -0
  39. package/dist/features/opencode-skill-loader/merger.d.ts +7 -0
  40. package/dist/features/opencode-skill-loader/types.d.ts +25 -0
  41. package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/executor.d.ts +1 -1
  42. package/dist/hooks/anthropic-context-window-limit-recovery/executor.test.d.ts +1 -0
  43. package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/index.d.ts +3 -2
  44. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.test.d.ts +1 -0
  45. package/dist/hooks/index.d.ts +2 -1
  46. package/dist/hooks/ralph-loop/constants.d.ts +5 -0
  47. package/dist/hooks/ralph-loop/index.d.ts +20 -0
  48. package/dist/hooks/ralph-loop/index.test.d.ts +1 -0
  49. package/dist/hooks/ralph-loop/storage.d.ts +6 -0
  50. package/dist/hooks/ralph-loop/types.d.ts +13 -0
  51. package/dist/hooks/think-mode/index.test.d.ts +1 -0
  52. package/dist/hooks/think-mode/switcher.d.ts +54 -1
  53. package/dist/hooks/think-mode/switcher.test.d.ts +1 -0
  54. package/dist/index.js +1287 -353
  55. package/dist/tools/index.d.ts +1 -0
  56. package/dist/tools/interactive-bash/constants.d.ts +1 -1
  57. package/dist/tools/look-at/constants.d.ts +1 -1
  58. package/dist/tools/lsp/utils.d.ts +1 -0
  59. package/dist/tools/skill/constants.d.ts +3 -0
  60. package/dist/tools/skill/index.d.ts +3 -0
  61. package/dist/tools/skill/tools.d.ts +10 -0
  62. package/dist/tools/skill/types.d.ts +20 -0
  63. package/dist/tools/slashcommand/types.d.ts +3 -3
  64. package/package.json +1 -1
  65. package/dist/features/claude-code-skill-loader/loader.d.ts +0 -3
  66. package/dist/features/claude-code-skill-loader/types.d.ts +0 -13
  67. /package/dist/{hooks/anthropic-auto-compact/executor.test.d.ts → cli/doctor/checks/auth.test.d.ts} +0 -0
  68. /package/dist/{hooks/anthropic-auto-compact/pruning-deduplication.test.d.ts → cli/doctor/checks/config.test.d.ts} +0 -0
  69. /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/parser.d.ts +0 -0
  70. /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-deduplication.d.ts +0 -0
  71. /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-executor.d.ts +0 -0
  72. /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-purge-errors.d.ts +0 -0
  73. /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-storage.d.ts +0 -0
  74. /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-supersede.d.ts +0 -0
  75. /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-types.d.ts +0 -0
  76. /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/storage.d.ts +0 -0
  77. /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/types.d.ts +0 -0
package/README.ja.md CHANGED
@@ -635,6 +635,12 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
635
635
 
636
636
  エージェントが活躍すれば、あなたも幸せになります。ですが、私はあなた自身も助けたいのです。
637
637
 
638
+ - **Ralph Loop**: タスクが完了するまで実行し続ける自己参照型開発ループ。Anthropic の Ralph Wiggum プラグインにインスパイアされています。**すべてのプログラミング言語をサポート。**
639
+ - `/ralph-loop "REST API を構築"` で開始するとエージェントが継続的に作業します
640
+ - `<promise>DONE</promise>` の出力で完了を検知
641
+ - 完了プロミスなしで停止すると自動再開
642
+ - 終了条件: 完了検知、最大反復回数到達(デフォルト 100)、または `/cancel-ralph`
643
+ - `oh-my-opencode.json` で設定: `{ "ralph_loop": { "enabled": true, "default_max_iterations": 100 } }`
638
644
  - **Keyword Detector**: プロンプト内のキーワードを自動検知して専門モードを有効化します:
639
645
  - `ultrawork` / `ulw`: 並列エージェントオーケストレーションによる最大パフォーマンスモード
640
646
  - `search` / `find` / `찾아` / `検索`: 並列 explore/librarian エージェントによる検索最大化
@@ -868,7 +874,7 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
868
874
  }
869
875
  ```
870
876
 
871
- 利用可能なフック:`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-auto-compact`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`
877
+ 利用可能なフック:`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`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `dcp-for-compaction`
872
878
 
873
879
  **`auto-update-checker`と`startup-toast`について**: `startup-toast` フックは `auto-update-checker` のサブ機能です。アップデートチェックは有効なまま起動トースト通知のみを無効化するには、`disabled_hooks` に `"startup-toast"` を追加してください。すべてのアップデートチェック機能(トーストを含む)を無効化するには、`"auto-update-checker"` を追加してください。
874
880
 
@@ -922,8 +928,7 @@ OpenCode でサポートされるすべての LSP 構成およびカスタム設
922
928
  "experimental": {
923
929
  "aggressive_truncation": true,
924
930
  "auto_resume": true,
925
- "truncate_all_tool_outputs": false,
926
- "dcp_on_compaction_failure": true
931
+ "truncate_all_tool_outputs": false
927
932
  }
928
933
  }
929
934
  ```
@@ -933,7 +938,8 @@ OpenCode でサポートされるすべての LSP 構成およびカスタム設
933
938
  | `aggressive_truncation` | `false` | トークン制限を超えた場合、ツール出力を積極的に切り詰めて制限内に収めます。デフォルトの切り詰めより積極的です。不十分な場合は要約/復元にフォールバックします。 |
934
939
  | `auto_resume` | `false` | thinking block エラーや thinking disabled violation からの回復成功後、自動的にセッションを再開します。最後のユーザーメッセージを抽出して続行します。 |
935
940
  | `truncate_all_tool_outputs` | `true` | プロンプトが長くなりすぎるのを防ぐため、コンテキストウィンドウの使用状況に基づいてすべてのツール出力を動的に切り詰めます。完全なツール出力が必要な場合は`false`に設定して無効化します。 |
936
- | `dcp_for_compaction` | `false` | 有効にすると、トークン制限エラー発生時にDCP(Dynamic Context Pruning)が最初に実行され、その後コンパクションが実行されます。DCPが不要なコンテキストを整理した後、すぐにコンパクションが進行します。トークン制限に達した際によりスマートな回復が必要な場合は有効にしてください。 |
941
+
942
+ **注意**: `dcp-for-compaction`(コンパクション用動的コンテキスト整理)はフックとして管理されるようになりました。デフォルトで有効で、`disabled_hooks: ["dcp-for-compaction"]`で無効化できます。
937
943
 
938
944
  **警告**:これらの機能は実験的であり、予期しない動作を引き起こす可能性があります。影響を理解した場合にのみ有効にしてください。
939
945
 
package/README.ko.md CHANGED
@@ -628,6 +628,12 @@ Oh My OpenCode는 다음 위치의 훅을 읽고 실행합니다:
628
628
 
629
629
  에이전트들이 행복해지면, 당신이 제일 행복해집니다, 그렇지만 저는 당신도 돕고싶습니다.
630
630
 
631
+ - **Ralph Loop**: 작업이 완료될 때까지 계속 실행되는 자기 참조 개발 루프. Anthropic의 Ralph Wiggum 플러그인에서 영감을 받았습니다. **모든 프로그래밍 언어 지원.**
632
+ - `/ralph-loop "REST API 구축"`으로 시작하면 에이전트가 지속적으로 작업합니다
633
+ - `<promise>DONE</promise>` 출력 시 완료로 감지
634
+ - 완료 프라미스 없이 멈추면 자동 재시작
635
+ - 종료 조건: 완료 감지, 최대 반복 도달 (기본 100회), 또는 `/cancel-ralph`
636
+ - `oh-my-opencode.json`에서 설정: `{ "ralph_loop": { "enabled": true, "default_max_iterations": 100 } }`
631
637
  - **Keyword Detector**: 프롬프트의 키워드를 자동 감지하여 전문 모드를 활성화합니다:
632
638
  - `ultrawork` / `ulw`: 병렬 에이전트 오케스트레이션으로 최대 성능 모드
633
639
  - `search` / `find` / `찾아` / `検索`: 병렬 explore/librarian 에이전트로 검색 극대화
@@ -865,7 +871,7 @@ Schema 자동 완성이 지원됩니다:
865
871
  }
866
872
  ```
867
873
 
868
- 사용 가능한 훅: `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-auto-compact`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`
874
+ 사용 가능한 훅: `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`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `dcp-for-compaction`
869
875
 
870
876
  **`auto-update-checker`와 `startup-toast`에 대한 참고사항**: `startup-toast` 훅은 `auto-update-checker`의 하위 기능입니다. 업데이트 확인은 유지하면서 시작 토스트 알림만 비활성화하려면 `disabled_hooks`에 `"startup-toast"`를 추가하세요. 모든 업데이트 확인 기능(토스트 포함)을 비활성화하려면 `"auto-update-checker"`를 추가하세요.
871
877
 
@@ -919,8 +925,7 @@ OpenCode 에서 지원하는 모든 LSP 구성 및 커스텀 설정 (opencode.js
919
925
  "experimental": {
920
926
  "aggressive_truncation": true,
921
927
  "auto_resume": true,
922
- "truncate_all_tool_outputs": false,
923
- "dcp_on_compaction_failure": true
928
+ "truncate_all_tool_outputs": false
924
929
  }
925
930
  }
926
931
  ```
@@ -930,7 +935,8 @@ OpenCode 에서 지원하는 모든 LSP 구성 및 커스텀 설정 (opencode.js
930
935
  | `aggressive_truncation` | `false` | 토큰 제한을 초과하면 도구 출력을 공격적으로 잘라내어 제한 내에 맞춥니다. 기본 truncation보다 더 공격적입니다. 부족하면 요약/복구로 fallback합니다. |
931
936
  | `auto_resume` | `false` | thinking block 에러나 thinking disabled violation으로부터 성공적으로 복구한 후 자동으로 세션을 재개합니다. 마지막 사용자 메시지를 추출하여 계속합니다. |
932
937
  | `truncate_all_tool_outputs` | `true` | 프롬프트가 너무 길어지는 것을 방지하기 위해 컨텍스트 윈도우 사용량에 따라 모든 도구 출력을 동적으로 잘라냅니다. 전체 도구 출력이 필요한 경우 `false`로 설정하여 비활성화하세요. |
933
- | `dcp_for_compaction` | `false` | 활성화하면, 토큰 제한 에러 발생 시 DCP(Dynamic Context Pruning)가 가장 먼저 실행되고, 그 다음 compaction이 실행됩니다. DCP가 불필요한 컨텍스트를 정리한 후 바로 compaction이 진행됩니다. 토큰 제한에 도달했을 때 더 스마트한 복구를 원하면 활성화하세요. |
938
+
939
+ **참고**: `dcp-for-compaction` (컴팩션용 동적 컨텍스트 정리)은 이제 훅으로 관리됩니다. 기본으로 활성화되어 있으며, `disabled_hooks: ["dcp-for-compaction"]`으로 비활성화할 수 있습니다.
934
940
 
935
941
  **경고**: 이 기능들은 실험적이며 예상치 못한 동작을 유발할 수 있습니다. 의미를 이해한 경우에만 활성화하세요.
936
942
 
package/README.md CHANGED
@@ -667,6 +667,12 @@ All toggles default to `true` (enabled). Omit the `claude_code` object for full
667
667
 
668
668
  When agents thrive, you thrive. But I want to help you directly too.
669
669
 
670
+ - **Ralph Loop**: Self-referential development loop that runs until task completion. Inspired by Anthropic's Ralph Wiggum plugin. **Supports all programming languages.**
671
+ - Start with `/ralph-loop "Build a REST API"` and let the agent work continuously
672
+ - Loop detects `<promise>DONE</promise>` to know when complete
673
+ - Auto-continues if agent stops without completion promise
674
+ - Ends when: completion detected, max iterations reached (default 100), or `/cancel-ralph`
675
+ - Configure in `oh-my-opencode.json`: `{ "ralph_loop": { "enabled": true, "default_max_iterations": 100 } }`
670
676
  - **Keyword Detector**: Automatically detects keywords in your prompts and activates specialized modes:
671
677
  - `ultrawork` / `ulw`: Maximum performance mode with parallel agent orchestration
672
678
  - `search` / `find` / `찾아` / `検索`: Maximized search effort with parallel explore and librarian agents
@@ -904,7 +910,7 @@ Disable specific built-in hooks via `disabled_hooks` in `~/.config/opencode/oh-m
904
910
  }
905
911
  ```
906
912
 
907
- 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-auto-compact`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`
913
+ 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`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `dcp-for-compaction`
908
914
 
909
915
  **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`.
910
916
 
@@ -958,8 +964,7 @@ Opt-in experimental features that may change or be removed in future versions. U
958
964
  "experimental": {
959
965
  "aggressive_truncation": true,
960
966
  "auto_resume": true,
961
- "truncate_all_tool_outputs": false,
962
- "dcp_on_compaction_failure": true
967
+ "truncate_all_tool_outputs": false
963
968
  }
964
969
  }
965
970
  ```
@@ -969,7 +974,8 @@ Opt-in experimental features that may change or be removed in future versions. U
969
974
  | `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. |
970
975
  | `auto_resume` | `false` | Automatically resumes session after successful recovery from thinking block errors or thinking disabled violations. Extracts the last user message and continues. |
971
976
  | `truncate_all_tool_outputs` | `true` | Dynamically truncates ALL tool outputs based on context window usage to prevent prompts from becoming too long. Disable by setting to `false` if you need full tool outputs. |
972
- | `dcp_for_compaction` | `false` | When enabled, Dynamic Context Pruning (DCP) runs FIRST when token limit errors occur, before attempting compaction. DCP prunes redundant context, then compaction runs immediately. Enable this for smarter recovery when hitting token limits. |
977
+
978
+ **Note**: `dcp-for-compaction` (Dynamic Context Pruning for compaction) is now a hook, not an experimental feature. It's enabled by default and can be disabled via `disabled_hooks: ["dcp-for-compaction"]`.
973
979
 
974
980
  **Warning**: These features are experimental and may cause unexpected behavior. Enable only if you understand the implications.
975
981
 
package/README.zh-cn.md CHANGED
@@ -639,6 +639,12 @@ Oh My OpenCode 会扫这些地方:
639
639
 
640
640
  Agent 爽了,你自然也爽。但我还想直接让你爽。
641
641
 
642
+ - **Ralph 循环**:干到完事才停的自参照开发循环。灵感来自 Anthropic 的 Ralph Wiggum 插件。**支持所有编程语言。**
643
+ - `/ralph-loop "搞个 REST API"` 开始,Agent 就一直干
644
+ - 检测到 `<promise>DONE</promise>` 就算完事
645
+ - 没输出完成标记就停了?自动续上
646
+ - 停止条件:检测到完成、达到最大迭代(默认 100 次)、或 `/cancel-ralph`
647
+ - `oh-my-opencode.json` 配置:`{ "ralph_loop": { "enabled": true, "default_max_iterations": 100 } }`
642
648
  - **关键词检测器**:看到关键词自动切模式:
643
649
  - `ultrawork` / `ulw`:并行 Agent 编排,火力全开
644
650
  - `search` / `find` / `찾아` / `検索`:explore/librarian 并行搜索,掘地三尺
@@ -872,7 +878,7 @@ Sisyphus Agent 也能自定义:
872
878
  }
873
879
  ```
874
880
 
875
- 可关的 hook:`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-auto-compact`、`rules-injector`、`background-notification`、`auto-update-checker`、`startup-toast`、`keyword-detector`、`agent-usage-reminder`、`non-interactive-env`、`interactive-bash-session`、`empty-message-sanitizer`、`preemptive-compaction`、`compaction-context-injector`、`thinking-block-validator`、`claude-code-hooks`
881
+ 可关的 hook:`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`、`preemptive-compaction`、`compaction-context-injector`、`thinking-block-validator`、`claude-code-hooks`、`ralph-loop`、`dcp-for-compaction`
876
882
 
877
883
  **关于 `auto-update-checker` 和 `startup-toast`**: `startup-toast` hook 是 `auto-update-checker` 的子功能。若想保持更新检查但只禁用启动提示通知,在 `disabled_hooks` 中添加 `"startup-toast"`。若要禁用所有更新检查功能(包括提示),添加 `"auto-update-checker"`。
878
884
 
@@ -926,8 +932,7 @@ Oh My OpenCode 送你重构工具(重命名、代码操作)。
926
932
  "experimental": {
927
933
  "aggressive_truncation": true,
928
934
  "auto_resume": true,
929
- "truncate_all_tool_outputs": false,
930
- "dcp_on_compaction_failure": true
935
+ "truncate_all_tool_outputs": false
931
936
  }
932
937
  }
933
938
  ```
@@ -937,7 +942,8 @@ Oh My OpenCode 送你重构工具(重命名、代码操作)。
937
942
  | `aggressive_truncation` | `false` | 超出 token 限制时,激进地截断工具输出以适应限制。比默认截断更激进。不够的话会回退到摘要/恢复。 |
938
943
  | `auto_resume` | `false` | 从 thinking block 错误或 thinking disabled violation 成功恢复后,自动恢复会话。提取最后一条用户消息继续执行。 |
939
944
  | `truncate_all_tool_outputs` | `true` | 为防止提示过长,根据上下文窗口使用情况动态截断所有工具输出。如需完整工具输出,设置为 `false` 禁用此功能。 |
940
- | `dcp_for_compaction` | `false` | 启用后,当发生 token 限制错误时,DCP(动态上下文剪枝)首先运行,然后立即执行压缩。DCP 清理不必要的上下文后,压缩立即进行。当达到 token 限制时需要更智能的恢复请启用此选项。 |
945
+
946
+ **注意**: `dcp-for-compaction`(压缩用动态上下文剪枝)现在作为 hook 管理。默认启用,可通过 `disabled_hooks: ["dcp-for-compaction"]` 禁用。
941
947
 
942
948
  **警告**:这些功能是实验性的,可能会导致意外行为。只有在理解其影响的情况下才启用。
943
949
 
@@ -0,0 +1,7 @@
1
+ import type { CheckResult, CheckDefinition, AuthProviderInfo, AuthProviderId } from "../types";
2
+ export declare function getAuthProviderInfo(providerId: AuthProviderId): AuthProviderInfo;
3
+ export declare function checkAuthProvider(providerId: AuthProviderId): Promise<CheckResult>;
4
+ export declare function checkAnthropicAuth(): Promise<CheckResult>;
5
+ export declare function checkOpenAIAuth(): Promise<CheckResult>;
6
+ export declare function checkGoogleAuth(): Promise<CheckResult>;
7
+ export declare function getAuthCheckDefinitions(): CheckDefinition[];
@@ -0,0 +1,8 @@
1
+ import type { CheckResult, CheckDefinition, ConfigInfo } from "../types";
2
+ export declare function validateConfig(configPath: string): {
3
+ valid: boolean;
4
+ errors: string[];
5
+ };
6
+ export declare function getConfigInfo(): ConfigInfo;
7
+ export declare function checkConfigValidity(): Promise<CheckResult>;
8
+ export declare function getConfigCheckDefinition(): CheckDefinition;
@@ -0,0 +1,8 @@
1
+ import type { CheckResult, CheckDefinition, DependencyInfo } from "../types";
2
+ export declare function checkAstGrepCli(): Promise<DependencyInfo>;
3
+ export declare function checkAstGrepNapi(): DependencyInfo;
4
+ export declare function checkCommentChecker(): Promise<DependencyInfo>;
5
+ export declare function checkDependencyAstGrepCli(): Promise<CheckResult>;
6
+ export declare function checkDependencyAstGrepNapi(): Promise<CheckResult>;
7
+ export declare function checkDependencyCommentChecker(): Promise<CheckResult>;
8
+ export declare function getDependencyCheckDefinitions(): CheckDefinition[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { CheckDefinition } from "../types";
2
+ export * from "./opencode";
3
+ export * from "./plugin";
4
+ export * from "./config";
5
+ export * from "./auth";
6
+ export * from "./dependencies";
7
+ export * from "./lsp";
8
+ export * from "./mcp";
9
+ export * from "./version";
10
+ export declare function getAllCheckDefinitions(): CheckDefinition[];
@@ -0,0 +1,8 @@
1
+ import type { CheckResult, CheckDefinition, LspServerInfo } from "../types";
2
+ export declare function getLspServersInfo(): Promise<LspServerInfo[]>;
3
+ export declare function getLspServerStats(servers: LspServerInfo[]): {
4
+ installed: number;
5
+ total: number;
6
+ };
7
+ export declare function checkLspServers(): Promise<CheckResult>;
8
+ export declare function getLspCheckDefinition(): CheckDefinition;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { CheckResult, CheckDefinition, McpServerInfo } from "../types";
2
+ export declare function getBuiltinMcpInfo(): McpServerInfo[];
3
+ export declare function getUserMcpInfo(): McpServerInfo[];
4
+ export declare function checkBuiltinMcpServers(): Promise<CheckResult>;
5
+ export declare function checkUserMcpServers(): Promise<CheckResult>;
6
+ export declare function getMcpCheckDefinitions(): CheckDefinition[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { CheckResult, CheckDefinition, OpenCodeInfo } from "../types";
2
+ export declare function findOpenCodeBinary(): Promise<{
3
+ binary: string;
4
+ path: string;
5
+ } | null>;
6
+ export declare function getOpenCodeVersion(binary: string): Promise<string | null>;
7
+ export declare function compareVersions(current: string, minimum: string): boolean;
8
+ export declare function getOpenCodeInfo(): Promise<OpenCodeInfo>;
9
+ export declare function checkOpenCodeInstallation(): Promise<CheckResult>;
10
+ export declare function getOpenCodeCheckDefinition(): CheckDefinition;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { CheckResult, CheckDefinition, PluginInfo } from "../types";
2
+ export declare function getPluginInfo(): PluginInfo;
3
+ export declare function checkPluginRegistration(): Promise<CheckResult>;
4
+ export declare function getPluginCheckDefinition(): CheckDefinition;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { CheckResult, CheckDefinition, VersionCheckInfo } from "../types";
2
+ export declare function getVersionInfo(): Promise<VersionCheckInfo>;
3
+ export declare function checkVersionStatus(): Promise<CheckResult>;
4
+ export declare function getVersionCheckDefinition(): CheckDefinition;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,39 @@
1
+ export declare const SYMBOLS: {
2
+ readonly check: string;
3
+ readonly cross: string;
4
+ readonly warn: string;
5
+ readonly info: string;
6
+ readonly arrow: string;
7
+ readonly bullet: string;
8
+ readonly skip: string;
9
+ };
10
+ export declare const STATUS_COLORS: {
11
+ readonly pass: import("picocolors/types").Formatter;
12
+ readonly fail: import("picocolors/types").Formatter;
13
+ readonly warn: import("picocolors/types").Formatter;
14
+ readonly skip: import("picocolors/types").Formatter;
15
+ };
16
+ export declare const CHECK_IDS: {
17
+ readonly OPENCODE_INSTALLATION: "opencode-installation";
18
+ readonly PLUGIN_REGISTRATION: "plugin-registration";
19
+ readonly CONFIG_VALIDATION: "config-validation";
20
+ readonly AUTH_ANTHROPIC: "auth-anthropic";
21
+ readonly AUTH_OPENAI: "auth-openai";
22
+ readonly AUTH_GOOGLE: "auth-google";
23
+ readonly DEP_AST_GREP_CLI: "dep-ast-grep-cli";
24
+ readonly DEP_AST_GREP_NAPI: "dep-ast-grep-napi";
25
+ readonly DEP_COMMENT_CHECKER: "dep-comment-checker";
26
+ readonly LSP_SERVERS: "lsp-servers";
27
+ readonly MCP_BUILTIN: "mcp-builtin";
28
+ readonly MCP_USER: "mcp-user";
29
+ readonly VERSION_STATUS: "version-status";
30
+ };
31
+ export declare const CHECK_NAMES: Record<string, string>;
32
+ export declare const CATEGORY_NAMES: Record<string, string>;
33
+ export declare const EXIT_CODES: {
34
+ readonly SUCCESS: 0;
35
+ readonly FAILURE: 1;
36
+ };
37
+ export declare const MIN_OPENCODE_VERSION = "1.0.150";
38
+ export declare const PACKAGE_NAME = "oh-my-opencode";
39
+ export declare const OPENCODE_BINARIES: readonly ["opencode", "opencode-desktop"];
@@ -0,0 +1,12 @@
1
+ import type { CheckResult, DoctorSummary, CheckCategory, DoctorResult } from "./types";
2
+ export declare function formatStatusSymbol(status: CheckResult["status"]): string;
3
+ export declare function formatCheckResult(result: CheckResult, verbose: boolean): string;
4
+ export declare function formatCategoryHeader(category: CheckCategory): string;
5
+ export declare function formatSummary(summary: DoctorSummary): string;
6
+ export declare function formatHeader(): string;
7
+ export declare function formatFooter(summary: DoctorSummary): string;
8
+ export declare function formatProgress(current: number, total: number, name: string): string;
9
+ export declare function formatJsonOutput(result: DoctorResult): string;
10
+ export declare function formatDetails(details: string[]): string;
11
+ export declare function formatBox(content: string, title?: string): string;
12
+ export declare function formatHelpSuggestions(results: CheckResult[]): string[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { DoctorOptions } from "./types";
2
+ export declare function doctor(options?: DoctorOptions): Promise<number>;
3
+ export * from "./types";
4
+ export { runDoctor } from "./runner";
5
+ export { formatJsonOutput } from "./formatter";
@@ -0,0 +1,7 @@
1
+ import type { DoctorOptions, DoctorResult, CheckDefinition, CheckResult, DoctorSummary, CheckCategory } from "./types";
2
+ export declare function runCheck(check: CheckDefinition): Promise<CheckResult>;
3
+ export declare function calculateSummary(results: CheckResult[], duration: number): DoctorSummary;
4
+ export declare function determineExitCode(results: CheckResult[]): number;
5
+ export declare function filterChecksByCategory(checks: CheckDefinition[], category?: CheckCategory): CheckDefinition[];
6
+ export declare function groupChecksByCategory(checks: CheckDefinition[]): Map<CheckCategory, CheckDefinition[]>;
7
+ export declare function runDoctor(options: DoctorOptions): Promise<DoctorResult>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,91 @@
1
+ export type CheckStatus = "pass" | "fail" | "warn" | "skip";
2
+ export interface CheckResult {
3
+ name: string;
4
+ status: CheckStatus;
5
+ message: string;
6
+ details?: string[];
7
+ duration?: number;
8
+ }
9
+ export type CheckFunction = () => Promise<CheckResult>;
10
+ export type CheckCategory = "installation" | "configuration" | "authentication" | "dependencies" | "tools" | "updates";
11
+ export interface CheckDefinition {
12
+ id: string;
13
+ name: string;
14
+ category: CheckCategory;
15
+ check: CheckFunction;
16
+ critical?: boolean;
17
+ }
18
+ export interface DoctorOptions {
19
+ verbose?: boolean;
20
+ json?: boolean;
21
+ category?: CheckCategory;
22
+ }
23
+ export interface DoctorSummary {
24
+ total: number;
25
+ passed: number;
26
+ failed: number;
27
+ warnings: number;
28
+ skipped: number;
29
+ duration: number;
30
+ }
31
+ export interface DoctorResult {
32
+ results: CheckResult[];
33
+ summary: DoctorSummary;
34
+ exitCode: number;
35
+ }
36
+ export interface OpenCodeInfo {
37
+ installed: boolean;
38
+ version: string | null;
39
+ path: string | null;
40
+ binary: "opencode" | "opencode-desktop" | null;
41
+ }
42
+ export interface PluginInfo {
43
+ registered: boolean;
44
+ configPath: string | null;
45
+ entry: string | null;
46
+ isPinned: boolean;
47
+ pinnedVersion: string | null;
48
+ }
49
+ export interface ConfigInfo {
50
+ exists: boolean;
51
+ path: string | null;
52
+ format: "json" | "jsonc" | null;
53
+ valid: boolean;
54
+ errors: string[];
55
+ }
56
+ export type AuthProviderId = "anthropic" | "openai" | "google";
57
+ export interface AuthProviderInfo {
58
+ id: AuthProviderId;
59
+ name: string;
60
+ pluginInstalled: boolean;
61
+ configured: boolean;
62
+ error?: string;
63
+ }
64
+ export interface DependencyInfo {
65
+ name: string;
66
+ required: boolean;
67
+ installed: boolean;
68
+ version: string | null;
69
+ path: string | null;
70
+ installHint?: string;
71
+ }
72
+ export interface LspServerInfo {
73
+ id: string;
74
+ installed: boolean;
75
+ extensions: string[];
76
+ source: "builtin" | "config" | "plugin";
77
+ }
78
+ export interface McpServerInfo {
79
+ id: string;
80
+ type: "builtin" | "user";
81
+ enabled: boolean;
82
+ valid: boolean;
83
+ error?: string;
84
+ }
85
+ export interface VersionCheckInfo {
86
+ currentVersion: string | null;
87
+ latestVersion: string | null;
88
+ isUpToDate: boolean;
89
+ isLocalDev: boolean;
90
+ isPinned: boolean;
91
+ }