oh-my-opencode 2.7.3 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +20 -10
- package/README.ko.md +20 -10
- package/README.md +16 -6
- package/README.zh-cn.md +20 -10
- package/dist/cli/ast-grep-napi.linux-x64-gnu-jfv8414z.node +0 -0
- package/dist/cli/ast-grep-napi.linux-x64-musl-8cj2e5cf.node +0 -0
- package/dist/cli/doctor/checks/auth.d.ts +7 -0
- package/dist/cli/doctor/checks/config.d.ts +8 -0
- package/dist/cli/doctor/checks/dependencies.d.ts +8 -0
- package/dist/cli/doctor/checks/dependencies.test.d.ts +1 -0
- package/dist/cli/doctor/checks/index.d.ts +10 -0
- package/dist/cli/doctor/checks/lsp.d.ts +8 -0
- package/dist/cli/doctor/checks/lsp.test.d.ts +1 -0
- package/dist/cli/doctor/checks/mcp.d.ts +6 -0
- package/dist/cli/doctor/checks/mcp.test.d.ts +1 -0
- package/dist/cli/doctor/checks/opencode.d.ts +10 -0
- package/dist/cli/doctor/checks/opencode.test.d.ts +1 -0
- package/dist/cli/doctor/checks/plugin.d.ts +4 -0
- package/dist/cli/doctor/checks/plugin.test.d.ts +1 -0
- package/dist/cli/doctor/checks/version.d.ts +4 -0
- package/dist/cli/doctor/checks/version.test.d.ts +1 -0
- package/dist/cli/doctor/constants.d.ts +39 -0
- package/dist/cli/doctor/formatter.d.ts +12 -0
- package/dist/cli/doctor/formatter.test.d.ts +1 -0
- package/dist/cli/doctor/index.d.ts +5 -0
- package/dist/cli/doctor/runner.d.ts +7 -0
- package/dist/cli/doctor/runner.test.d.ts +1 -0
- package/dist/cli/doctor/types.d.ts +91 -0
- package/dist/cli/index.js +14180 -76
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema.d.ts +98 -6
- package/dist/features/builtin-commands/templates/ralph-loop.d.ts +2 -0
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/builtin-skills/index.d.ts +2 -0
- package/dist/features/builtin-skills/skills.d.ts +2 -0
- package/dist/features/builtin-skills/types.d.ts +13 -0
- package/dist/features/{claude-code-skill-loader → opencode-skill-loader}/index.d.ts +1 -0
- package/dist/features/opencode-skill-loader/loader.d.ts +41 -0
- package/dist/features/opencode-skill-loader/merger.d.ts +7 -0
- package/dist/features/opencode-skill-loader/types.d.ts +25 -0
- package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/executor.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/executor.test.d.ts +1 -0
- package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/index.d.ts +3 -2
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.test.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/ralph-loop/constants.d.ts +5 -0
- package/dist/hooks/ralph-loop/index.d.ts +20 -0
- package/dist/hooks/ralph-loop/index.test.d.ts +1 -0
- package/dist/hooks/ralph-loop/storage.d.ts +6 -0
- package/dist/hooks/ralph-loop/types.d.ts +13 -0
- package/dist/hooks/think-mode/index.test.d.ts +1 -0
- package/dist/hooks/think-mode/switcher.d.ts +54 -1
- package/dist/hooks/think-mode/switcher.test.d.ts +1 -0
- package/dist/index.js +1290 -356
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/interactive-bash/constants.d.ts +1 -1
- package/dist/tools/look-at/constants.d.ts +1 -1
- package/dist/tools/lsp/utils.d.ts +1 -0
- package/dist/tools/skill/constants.d.ts +3 -0
- package/dist/tools/skill/index.d.ts +3 -0
- package/dist/tools/skill/tools.d.ts +10 -0
- package/dist/tools/skill/types.d.ts +20 -0
- package/dist/tools/slashcommand/types.d.ts +3 -3
- package/package.json +1 -1
- package/dist/features/claude-code-skill-loader/loader.d.ts +0 -3
- package/dist/features/claude-code-skill-loader/types.d.ts +0 -13
- /package/dist/{hooks/anthropic-auto-compact/executor.test.d.ts → cli/doctor/checks/auth.test.d.ts} +0 -0
- /package/dist/{hooks/anthropic-auto-compact/pruning-deduplication.test.d.ts → cli/doctor/checks/config.test.d.ts} +0 -0
- /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/parser.d.ts +0 -0
- /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-deduplication.d.ts +0 -0
- /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-executor.d.ts +0 -0
- /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-purge-errors.d.ts +0 -0
- /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-storage.d.ts +0 -0
- /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-supersede.d.ts +0 -0
- /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/pruning-types.d.ts +0 -0
- /package/dist/hooks/{anthropic-auto-compact → anthropic-context-window-limit-recovery}/storage.d.ts +0 -0
- /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`, `
|
|
877
|
+
利用可能なフック:`todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-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`
|
|
872
878
|
|
|
873
879
|
**`auto-update-checker`と`startup-toast`について**: `startup-toast` フックは `auto-update-checker` のサブ機能です。アップデートチェックは有効なまま起動トースト通知のみを無効化するには、`disabled_hooks` に `"startup-toast"` を追加してください。すべてのアップデートチェック機能(トーストを含む)を無効化するには、`"auto-update-checker"` を追加してください。
|
|
874
880
|
|
|
@@ -920,20 +926,24 @@ OpenCode でサポートされるすべての LSP 構成およびカスタム設
|
|
|
920
926
|
```json
|
|
921
927
|
{
|
|
922
928
|
"experimental": {
|
|
929
|
+
"tool_output_truncator": true,
|
|
930
|
+
"preemptive_compaction": true,
|
|
931
|
+
"truncate_all_tool_outputs": true,
|
|
923
932
|
"aggressive_truncation": true,
|
|
924
|
-
"auto_resume": true
|
|
925
|
-
"truncate_all_tool_outputs": false,
|
|
926
|
-
"dcp_on_compaction_failure": true
|
|
933
|
+
"auto_resume": true
|
|
927
934
|
}
|
|
928
935
|
}
|
|
929
936
|
```
|
|
930
937
|
|
|
931
|
-
| オプション
|
|
932
|
-
|
|
|
933
|
-
| `
|
|
934
|
-
| `
|
|
935
|
-
| `
|
|
936
|
-
| `
|
|
938
|
+
| オプション | デフォルト | 説明 |
|
|
939
|
+
| --------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
940
|
+
| `tool_output_truncator` | `false` | コンテキストウィンドウの使用状況に基づいてツール出力(Grep、Glob、LSP、AST-grepなど)を動的に切り詰めます。プロンプトが長くなりすぎるのを防ぎます。 |
|
|
941
|
+
| `preemptive_compaction` | `false` | トークン制限に達する前にセッションを事前にコンパクションします。デフォルトでコンテキストウィンドウ使用率80%で実行されます。 |
|
|
942
|
+
| `preemptive_compaction_threshold` | `0.80` | プリエンプティブコンパクションをトリガーする閾値(0.5-0.95)。`preemptive_compaction`が有効な場合のみ適用されます。 |
|
|
943
|
+
| `truncate_all_tool_outputs` | `false` | `tool_output_truncator`が有効な場合、ホワイトリストのツール(Grep、Glob、LSP、AST-grep)だけでなく、すべてのツール出力を切り詰めます。 |
|
|
944
|
+
| `aggressive_truncation` | `false` | トークン制限を超えた場合、ツール出力を積極的に切り詰めて制限内に収めます。デフォルトの切り詰めより積極的です。不十分な場合は要約/復元にフォールバックします。 |
|
|
945
|
+
| `auto_resume` | `false` | thinking block エラーや thinking disabled violation からの回復成功後、自動的にセッションを再開します。最後のユーザーメッセージを抽出して続行します。 |
|
|
946
|
+
| `dcp_for_compaction` | `false` | コンパクション用DCP(動的コンテキスト整理)を有効化 - トークン制限超過時に最初に実行されます。コンパクション前に重複したツール呼び出しと古いツール出力を整理します。 |
|
|
937
947
|
|
|
938
948
|
**警告**:これらの機能は実験的であり、予期しない動作を引き起こす可能性があります。影響を理解した場合にのみ有効にしてください。
|
|
939
949
|
|
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`, `
|
|
874
|
+
사용 가능한 훅: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-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`
|
|
869
875
|
|
|
870
876
|
**`auto-update-checker`와 `startup-toast`에 대한 참고사항**: `startup-toast` 훅은 `auto-update-checker`의 하위 기능입니다. 업데이트 확인은 유지하면서 시작 토스트 알림만 비활성화하려면 `disabled_hooks`에 `"startup-toast"`를 추가하세요. 모든 업데이트 확인 기능(토스트 포함)을 비활성화하려면 `"auto-update-checker"`를 추가하세요.
|
|
871
877
|
|
|
@@ -917,20 +923,24 @@ OpenCode 에서 지원하는 모든 LSP 구성 및 커스텀 설정 (opencode.js
|
|
|
917
923
|
```json
|
|
918
924
|
{
|
|
919
925
|
"experimental": {
|
|
926
|
+
"tool_output_truncator": true,
|
|
927
|
+
"preemptive_compaction": true,
|
|
928
|
+
"truncate_all_tool_outputs": true,
|
|
920
929
|
"aggressive_truncation": true,
|
|
921
|
-
"auto_resume": true
|
|
922
|
-
"truncate_all_tool_outputs": false,
|
|
923
|
-
"dcp_on_compaction_failure": true
|
|
930
|
+
"auto_resume": true
|
|
924
931
|
}
|
|
925
932
|
}
|
|
926
933
|
```
|
|
927
934
|
|
|
928
|
-
| 옵션
|
|
929
|
-
|
|
|
930
|
-
| `
|
|
931
|
-
| `
|
|
932
|
-
| `
|
|
933
|
-
| `
|
|
935
|
+
| 옵션 | 기본값 | 설명 |
|
|
936
|
+
| --------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
937
|
+
| `tool_output_truncator` | `false` | 컨텍스트 윈도우 사용량에 따라 도구 출력(Grep, Glob, LSP, AST-grep 등)을 동적으로 잘라냅니다. 프롬프트가 너무 길어지는 것을 방지합니다. |
|
|
938
|
+
| `preemptive_compaction` | `false` | 토큰 제한에 도달하기 전에 세션을 미리 컴팩션합니다. 기본적으로 컨텍스트 윈도우 사용량이 80%일 때 실행됩니다. |
|
|
939
|
+
| `preemptive_compaction_threshold` | `0.80` | 선제적 컴팩션을 트리거할 임계값 비율(0.5-0.95). `preemptive_compaction`이 활성화된 경우에만 적용됩니다. |
|
|
940
|
+
| `truncate_all_tool_outputs` | `false` | `tool_output_truncator`가 활성화된 경우, 화이트리스트 도구(Grep, Glob, LSP, AST-grep)만이 아닌 모든 도구 출력을 잘라냅니다. |
|
|
941
|
+
| `aggressive_truncation` | `false` | 토큰 제한을 초과하면 도구 출력을 공격적으로 잘라내어 제한 내에 맞춥니다. 기본 truncation보다 더 공격적입니다. 부족하면 요약/복구로 fallback합니다. |
|
|
942
|
+
| `auto_resume` | `false` | thinking block 에러나 thinking disabled violation으로부터 성공적으로 복구한 후 자동으로 세션을 재개합니다. 마지막 사용자 메시지를 추출하여 계속합니다. |
|
|
943
|
+
| `dcp_for_compaction` | `false` | 컴팩션용 DCP(동적 컨텍스트 정리) 활성화 - 토큰 제한 초과 시 먼저 실행됩니다. 컴팩션 전에 중복 도구 호출과 오래된 도구 출력을 정리합니다. |
|
|
934
944
|
|
|
935
945
|
**경고**: 이 기능들은 실험적이며 예상치 못한 동작을 유발할 수 있습니다. 의미를 이해한 경우에만 활성화하세요.
|
|
936
946
|
|
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`, `
|
|
913
|
+
Available hooks: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-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`
|
|
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
|
|
|
@@ -956,20 +962,24 @@ Opt-in experimental features that may change or be removed in future versions. U
|
|
|
956
962
|
```json
|
|
957
963
|
{
|
|
958
964
|
"experimental": {
|
|
965
|
+
"tool_output_truncator": true,
|
|
966
|
+
"preemptive_compaction": true,
|
|
967
|
+
"truncate_all_tool_outputs": true,
|
|
959
968
|
"aggressive_truncation": true,
|
|
960
|
-
"auto_resume": true
|
|
961
|
-
"truncate_all_tool_outputs": false,
|
|
962
|
-
"dcp_on_compaction_failure": true
|
|
969
|
+
"auto_resume": true
|
|
963
970
|
}
|
|
964
971
|
}
|
|
965
972
|
```
|
|
966
973
|
|
|
967
974
|
| Option | Default | Description |
|
|
968
975
|
| --------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
976
|
+
| `tool_output_truncator` | `false` | Enable dynamic truncation of tool outputs (Grep, Glob, LSP, AST-grep, etc.) based on context window usage. Prevents prompts from becoming too long. |
|
|
977
|
+
| `preemptive_compaction` | `false` | Compacts session proactively before hitting hard token limits. Runs at 80% context window usage by default. |
|
|
978
|
+
| `preemptive_compaction_threshold` | `0.80` | Threshold percentage (0.5-0.95) to trigger preemptive compaction. Only applies when `preemptive_compaction` is enabled. |
|
|
979
|
+
| `truncate_all_tool_outputs` | `false` | When `tool_output_truncator` is enabled, truncates ALL tool outputs instead of just whitelisted tools (Grep, Glob, LSP, AST-grep). |
|
|
969
980
|
| `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
981
|
| `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
|
-
| `
|
|
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. |
|
|
982
|
+
| `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. |
|
|
973
983
|
|
|
974
984
|
**Warning**: These features are experimental and may cause unexpected behavior. Enable only if you understand the implications.
|
|
975
985
|
|
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`、`
|
|
881
|
+
可关的 hook:`todo-continuation-enforcer`、`context-window-monitor`、`session-recovery`、`session-notification`、`comment-checker`、`grep-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`
|
|
876
882
|
|
|
877
883
|
**关于 `auto-update-checker` 和 `startup-toast`**: `startup-toast` hook 是 `auto-update-checker` 的子功能。若想保持更新检查但只禁用启动提示通知,在 `disabled_hooks` 中添加 `"startup-toast"`。若要禁用所有更新检查功能(包括提示),添加 `"auto-update-checker"`。
|
|
878
884
|
|
|
@@ -924,20 +930,24 @@ Oh My OpenCode 送你重构工具(重命名、代码操作)。
|
|
|
924
930
|
```json
|
|
925
931
|
{
|
|
926
932
|
"experimental": {
|
|
933
|
+
"tool_output_truncator": true,
|
|
934
|
+
"preemptive_compaction": true,
|
|
935
|
+
"truncate_all_tool_outputs": true,
|
|
927
936
|
"aggressive_truncation": true,
|
|
928
|
-
"auto_resume": true
|
|
929
|
-
"truncate_all_tool_outputs": false,
|
|
930
|
-
"dcp_on_compaction_failure": true
|
|
937
|
+
"auto_resume": true
|
|
931
938
|
}
|
|
932
939
|
}
|
|
933
940
|
```
|
|
934
941
|
|
|
935
|
-
| 选项
|
|
936
|
-
|
|
|
937
|
-
| `
|
|
938
|
-
| `
|
|
939
|
-
| `
|
|
940
|
-
| `
|
|
942
|
+
| 选项 | 默认值 | 说明 |
|
|
943
|
+
| --------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
944
|
+
| `tool_output_truncator` | `false` | 根据上下文窗口使用情况动态截断工具输出(Grep、Glob、LSP、AST-grep 等)。防止提示过长。 |
|
|
945
|
+
| `preemptive_compaction` | `false` | 在达到 token 限制之前主动压缩会话。默认在上下文窗口使用率达到 80% 时运行。 |
|
|
946
|
+
| `preemptive_compaction_threshold` | `0.80` | 触发预先压缩的阈值比例(0.5-0.95)。仅在 `preemptive_compaction` 启用时生效。 |
|
|
947
|
+
| `truncate_all_tool_outputs` | `false` | 当 `tool_output_truncator` 启用时,截断所有工具输出,而不仅仅是白名单工具(Grep、Glob、LSP、AST-grep)。 |
|
|
948
|
+
| `aggressive_truncation` | `false` | 超出 token 限制时,激进地截断工具输出以适应限制。比默认截断更激进。不够的话会回退到摘要/恢复。 |
|
|
949
|
+
| `auto_resume` | `false` | 从 thinking block 错误或 thinking disabled violation 成功恢复后,自动恢复会话。提取最后一条用户消息继续执行。 |
|
|
950
|
+
| `dcp_for_compaction` | `false` | 启用压缩用 DCP(动态上下文剪枝)- 在超出 token 限制时首先执行。在压缩前清理重复的工具调用和旧的工具输出。 |
|
|
941
951
|
|
|
942
952
|
**警告**:这些功能是实验性的,可能会导致意外行为。只有在理解其影响的情况下才启用。
|
|
943
953
|
|
|
Binary file
|
|
Binary file
|
|
@@ -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,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
|
+
}
|