oh-my-opencode 2.6.2 → 2.7.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 +81 -5
- package/README.ko.md +84 -5
- package/README.md +20 -4
- package/README.zh-cn.md +85 -5
- package/dist/auth/antigravity/project.d.ts +1 -0
- package/dist/auth/antigravity/token.d.ts +17 -20
- package/dist/auth/antigravity/types.d.ts +19 -0
- package/dist/cli/index.js +10 -4
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema.d.ts +16 -2
- package/dist/features/builtin-commands/commands.d.ts +2 -0
- package/dist/features/builtin-commands/index.d.ts +2 -0
- package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +6 -0
- package/dist/google-auth.js +152 -22
- package/dist/hooks/comment-checker/cli.d.ts +2 -1
- package/dist/hooks/comment-checker/index.d.ts +2 -1
- package/dist/hooks/todo-continuation-enforcer.test.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1398 -681
- package/dist/shared/data-path.d.ts +6 -7
- package/dist/tools/ast-grep/constants.d.ts +0 -1
- package/dist/tools/lsp/client.d.ts +1 -2
- package/dist/tools/lsp/config.d.ts +2 -9
- package/dist/tools/lsp/constants.d.ts +1 -0
- package/dist/tools/lsp/types.d.ts +25 -0
- package/dist/tools/lsp/utils.d.ts +4 -1
- package/dist/tools/session-manager/storage.d.ts +5 -5
- package/dist/tools/session-manager/utils.d.ts +3 -3
- package/package.json +2 -2
package/README.ja.md
CHANGED
|
@@ -390,14 +390,47 @@ gh repo star code-yeongyu/oh-my-opencode
|
|
|
390
390
|
</details>
|
|
391
391
|
|
|
392
392
|
|
|
393
|
+
## アンインストール
|
|
394
|
+
|
|
395
|
+
oh-my-opencode を削除するには:
|
|
396
|
+
|
|
397
|
+
1. **OpenCode 設定からプラグインを削除**
|
|
398
|
+
|
|
399
|
+
`~/.config/opencode/opencode.json` (または `opencode.jsonc`) を編集し、`plugin` 配列から `"oh-my-opencode"` を削除します:
|
|
400
|
+
|
|
401
|
+
```bash
|
|
402
|
+
# jq を使用する例
|
|
403
|
+
jq '.plugin = [.plugin[] | select(. != "oh-my-opencode")]' \
|
|
404
|
+
~/.config/opencode/opencode.json > /tmp/oc.json && \
|
|
405
|
+
mv /tmp/oc.json ~/.config/opencode/opencode.json
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
2. **設定ファイルの削除 (オプション)**
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
# ユーザー設定を削除
|
|
412
|
+
rm -f ~/.config/opencode/oh-my-opencode.json
|
|
413
|
+
|
|
414
|
+
# プロジェクト設定を削除 (存在する場合)
|
|
415
|
+
rm -f .opencode/oh-my-opencode.json
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
3. **削除の確認**
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
opencode --version
|
|
422
|
+
# プラグインがロードされなくなっているはずです
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
|
|
393
426
|
## 機能
|
|
394
427
|
|
|
395
428
|
### Agents: あなたの新しいチームメイト
|
|
396
429
|
|
|
397
430
|
- **Sisyphus** (`anthropic/claude-opus-4-5`): **デフォルトエージェントです。** OpenCode のための強力な AI オーケストレーターです。専門のサブエージェントを活用して、複雑なタスクを計画、委任、実行します。バックグラウンドタスクへの委任と Todo ベースのワークフローを重視します。最大の推論能力を発揮するため、Claude Opus 4.5 と拡張思考 (32k token budget) を使用します。
|
|
398
431
|
- **oracle** (`openai/gpt-5.2`): アーキテクチャ、コードレビュー、戦略立案のための専門アドバイザー。GPT-5.2 の卓越した論理的推論と深い分析能力を活用します。AmpCode からインスピレーションを得ました。
|
|
399
|
-
- **librarian** (`anthropic/claude-sonnet-4-5`): マルチリポジトリ分析、ドキュメント検索、実装例の調査を担当。Claude Sonnet 4.5 を使用して、深いコードベース理解と GitHub リサーチ、根拠に基づいた回答を提供します。AmpCode からインスピレーションを得ました。
|
|
400
|
-
- **explore** (`opencode/grok-code`): 高速なコードベース探索、ファイルパターンマッチング。Claude
|
|
432
|
+
- **librarian** (`anthropic/claude-sonnet-4-5` または `google/gemini-3-flash`): マルチリポジトリ分析、ドキュメント検索、実装例の調査を担当。Antigravity 認証が設定されている場合は Gemini 3 Flash を使用し、それ以外は Claude Sonnet 4.5 を使用して、深いコードベース理解と GitHub リサーチ、根拠に基づいた回答を提供します。AmpCode からインスピレーションを得ました。
|
|
433
|
+
- **explore** (`opencode/grok-code`、`google/gemini-3-flash`、または `anthropic/claude-haiku-4-5`): 高速なコードベース探索、ファイルパターンマッチング。Antigravity 認証が設定されている場合は Gemini 3 Flash を使用し、Claude max20 が利用可能な場合は Haiku を使用し、それ以外は Grok を使います。Claude Code からインスピレーションを得ました。
|
|
401
434
|
- **frontend-ui-ux-engineer** (`google/gemini-3-pro-preview`): 開発者に転身したデザイナーという設定です。素晴らしい UI を作ります。美しく独創的な UI コードを生成することに長けた Gemini を使用します。
|
|
402
435
|
- **document-writer** (`google/gemini-3-pro-preview`): テクニカルライティングの専門家という設定です。Gemini は文筆家であり、流れるような文章を書きます。
|
|
403
436
|
- **multimodal-looker** (`google/gemini-3-flash`): 視覚コンテンツ解釈のための専門エージェント。PDF、画像、図表を分析して情報を抽出します。
|
|
@@ -457,6 +490,19 @@ Ask @explore for the policy on this feature
|
|
|
457
490
|
- **ast_grep_search**: AST 認識コードパターン検索 (25言語対応)
|
|
458
491
|
- **ast_grep_replace**: AST 認識コード置換
|
|
459
492
|
|
|
493
|
+
#### セッション管理
|
|
494
|
+
|
|
495
|
+
OpenCode セッション履歴をナビゲートおよび検索するためのツール:
|
|
496
|
+
|
|
497
|
+
- **session_list**: 日付およびリミットでフィルタリングしながらすべての OpenCode セッションを一覧表示
|
|
498
|
+
- **session_read**: 特定のセッションからメッセージと履歴を読み取る
|
|
499
|
+
- **session_search**: セッションメッセージ全体を全文検索
|
|
500
|
+
- **session_info**: セッションに関するメタデータと統計情報を取得
|
|
501
|
+
|
|
502
|
+
これらのツールにより、エージェントは以前の会話を参照し、セッション間の継続性を維持できます。
|
|
503
|
+
|
|
504
|
+
- **call_omo_agent**: 専門的な explore/librarian エージェントを起動。非同期実行のための `run_in_background` パラメータをサポート。
|
|
505
|
+
|
|
460
506
|
#### Context Is All You Need
|
|
461
507
|
- **Directory AGENTS.md / README.md Injector**: ファイルを読み込む際、`AGENTS.md` と `README.md` の内容を自動的に注入します。ファイルディレクトリからプロジェクトルートまで遡り、パス上の **すべて** の `AGENTS.md` ファイルを収集します。ネストされたディレクトリごとの指示をサポートします:
|
|
462
508
|
```
|
|
@@ -619,7 +665,7 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
|
|
|
619
665
|
|
|
620
666
|
| プラットフォーム | ユーザー設定パス |
|
|
621
667
|
|------------------|------------------|
|
|
622
|
-
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (
|
|
668
|
+
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (推奨) または `%APPDATA%\opencode\oh-my-opencode.json` (fallback) |
|
|
623
669
|
| **macOS/Linux** | `~/.config/opencode/oh-my-opencode.json` |
|
|
624
670
|
|
|
625
671
|
スキーマ自動補完がサポートされています:
|
|
@@ -630,6 +676,36 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
|
|
|
630
676
|
}
|
|
631
677
|
```
|
|
632
678
|
|
|
679
|
+
### JSONC のサポート
|
|
680
|
+
|
|
681
|
+
`oh-my-opencode` 設定ファイルは JSONC (コメント付き JSON) をサポートしています:
|
|
682
|
+
- 行コメント: `// コメント`
|
|
683
|
+
- ブロックコメント: `/* コメント */`
|
|
684
|
+
- 末尾のカンマ: `{ "key": "value", }`
|
|
685
|
+
|
|
686
|
+
`oh-my-opencode.jsonc` と `oh-my-opencode.json` の両方が存在する場合、`.jsonc` が優先されます。
|
|
687
|
+
|
|
688
|
+
**コメント付きの例:**
|
|
689
|
+
|
|
690
|
+
```jsonc
|
|
691
|
+
{
|
|
692
|
+
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
|
|
693
|
+
|
|
694
|
+
// Antigravity OAuth 経由で Google Gemini を有効にする
|
|
695
|
+
"google_auth": false,
|
|
696
|
+
|
|
697
|
+
/* エージェントのオーバーライド - 特定のタスクに合わせてモデルをカスタマイズ */
|
|
698
|
+
"agents": {
|
|
699
|
+
"oracle": {
|
|
700
|
+
"model": "openai/gpt-5.2" // 戦略的な推論のための GPT
|
|
701
|
+
},
|
|
702
|
+
"explore": {
|
|
703
|
+
"model": "opencode/grok-code" // 探索のための高速かつ無料のモデル
|
|
704
|
+
},
|
|
705
|
+
},
|
|
706
|
+
}
|
|
707
|
+
```
|
|
708
|
+
|
|
633
709
|
### Google Auth
|
|
634
710
|
|
|
635
711
|
**推奨**: 外部の [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) プラグインを使用してください。マルチアカウントロードバランシング、より多くのモデル(Antigravity 経由の Claude を含む)、活発なメンテナンスを提供します。[インストール > Google Gemini](#42-google-gemini-antigravity-oauth) を参照。
|
|
@@ -792,7 +868,7 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
|
|
|
792
868
|
}
|
|
793
869
|
```
|
|
794
870
|
|
|
795
|
-
利用可能なフック:`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`
|
|
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`
|
|
796
872
|
|
|
797
873
|
**`auto-update-checker`と`startup-toast`について**: `startup-toast` フックは `auto-update-checker` のサブ機能です。アップデートチェックは有効なまま起動トースト通知のみを無効化するには、`disabled_hooks` に `"startup-toast"` を追加してください。すべてのアップデートチェック機能(トーストを含む)を無効化するには、`"auto-update-checker"` を追加してください。
|
|
798
874
|
|
|
@@ -857,7 +933,7 @@ OpenCode でサポートされるすべての LSP 構成およびカスタム設
|
|
|
857
933
|
| `aggressive_truncation` | `false` | トークン制限を超えた場合、ツール出力を積極的に切り詰めて制限内に収めます。デフォルトの切り詰めより積極的です。不十分な場合は要約/復元にフォールバックします。 |
|
|
858
934
|
| `auto_resume` | `false` | thinking block エラーや thinking disabled violation からの回復成功後、自動的にセッションを再開します。最後のユーザーメッセージを抽出して続行します。 |
|
|
859
935
|
| `truncate_all_tool_outputs` | `true` | プロンプトが長くなりすぎるのを防ぐため、コンテキストウィンドウの使用状況に基づいてすべてのツール出力を動的に切り詰めます。完全なツール出力が必要な場合は`false`に設定して無効化します。 |
|
|
860
|
-
| `
|
|
936
|
+
| `dcp_for_compaction` | `false` | 有効にすると、トークン制限エラー発生時にDCP(Dynamic Context Pruning)が最初に実行され、その後コンパクションが実行されます。DCPが不要なコンテキストを整理した後、すぐにコンパクションが進行します。トークン制限に達した際によりスマートな回復が必要な場合は有効にしてください。 |
|
|
861
937
|
|
|
862
938
|
**警告**:これらの機能は実験的であり、予期しない動作を引き起こす可能性があります。影響を理解した場合にのみ有効にしてください。
|
|
863
939
|
|
package/README.ko.md
CHANGED
|
@@ -387,14 +387,47 @@ gh repo star code-yeongyu/oh-my-opencode
|
|
|
387
387
|
</details>
|
|
388
388
|
|
|
389
389
|
|
|
390
|
+
## 언인스톨
|
|
391
|
+
|
|
392
|
+
oh-my-opencode를 제거하려면:
|
|
393
|
+
|
|
394
|
+
1. **OpenCode 설정에서 플러그인 제거**
|
|
395
|
+
|
|
396
|
+
`~/.config/opencode/opencode.json` (또는 `opencode.jsonc`)를 편집하여 `plugin` 배열에서 `"oh-my-opencode"`를 제거합니다:
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
# jq 사용 예시
|
|
400
|
+
jq '.plugin = [.plugin[] | select(. != "oh-my-opencode")]' \
|
|
401
|
+
~/.config/opencode/opencode.json > /tmp/oc.json && \
|
|
402
|
+
mv /tmp/oc.json ~/.config/opencode/opencode.json
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
2. **설정 파일 삭제 (선택 사항)**
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
# 사용자 설정 삭제
|
|
409
|
+
rm -f ~/.config/opencode/oh-my-opencode.json
|
|
410
|
+
|
|
411
|
+
# 프로젝트 설정 삭제 (존재하는 경우)
|
|
412
|
+
rm -f .opencode/oh-my-opencode.json
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
3. **제거 확인**
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
opencode --version
|
|
419
|
+
# 플러그인이 더 이상 로드되지 않아야 합니다
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
|
|
390
423
|
## 기능
|
|
391
424
|
|
|
392
425
|
### Agents: 당신의 새로운 팀원들
|
|
393
426
|
|
|
394
427
|
- **Sisyphus** (`anthropic/claude-opus-4-5`): **기본 에이전트입니다.** OpenCode를 위한 강력한 AI 오케스트레이터입니다. 전문 서브에이전트를 활용하여 복잡한 작업을 계획, 위임, 실행합니다. 백그라운드 태스크 위임과 todo 기반 워크플로우를 강조합니다. 최대 추론 능력을 위해 Claude Opus 4.5와 확장된 사고(32k 버짓)를 사용합니다.
|
|
395
428
|
- **oracle** (`openai/gpt-5.2`): 아키텍처, 코드 리뷰, 전략 수립을 위한 전문가 조언자. GPT-5.2의 뛰어난 논리적 추론과 깊은 분석 능력을 활용합니다. AmpCode 에서 영감을 받았습니다.
|
|
396
|
-
- **librarian** (`anthropic/claude-sonnet-4-5`): 멀티 레포 분석, 문서 조회, 구현 예제 담당. Claude Sonnet 4.5를 사용하여 깊은 코드베이스 이해와 GitHub 조사, 근거 기반의 답변을 제공합니다. AmpCode 에서 영감을 받았습니다.
|
|
397
|
-
- **explore** (`opencode/grok-code`): 빠른 코드베이스 탐색, 파일 패턴 매칭.
|
|
429
|
+
- **librarian** (`anthropic/claude-sonnet-4-5` 또는 `google/gemini-3-flash`): 멀티 레포 분석, 문서 조회, 구현 예제 담당. Antigravity 인증이 설정된 경우 Gemini 3 Flash를 사용하고, 그렇지 않으면 Claude Sonnet 4.5를 사용하여 깊은 코드베이스 이해와 GitHub 조사, 근거 기반의 답변을 제공합니다. AmpCode 에서 영감을 받았습니다.
|
|
430
|
+
- **explore** (`opencode/grok-code`, `google/gemini-3-flash`, 또는 `anthropic/claude-haiku-4-5`): 빠른 코드베이스 탐색, 파일 패턴 매칭. Antigravity 인증이 설정된 경우 Gemini 3 Flash를 사용하고, Claude max20이 있으면 Haiku를 사용하며, 그 외에는 Grok을 씁니다. Claude Code 에서 영감을 받았습니다.
|
|
398
431
|
- **frontend-ui-ux-engineer** (`google/gemini-3-pro-preview`): 개발자로 전향한 디자이너라는 설정을 갖고 있습니다. 멋진 UI를 만듭니다. 아름답고 창의적인 UI 코드를 생성하는 데 탁월한 Gemini를 사용합니다.
|
|
399
432
|
- **document-writer** (`google/gemini-3-pro-preview`): 기술 문서 전문가라는 설정을 갖고 있습니다. Gemini 는 문학가입니다. 글을 기가막히게 씁니다.
|
|
400
433
|
- **multimodal-looker** (`google/gemini-3-flash`): 시각적 콘텐츠 해석을 위한 전문 에이전트. PDF, 이미지, 다이어그램을 분석하여 정보를 추출합니다.
|
|
@@ -450,6 +483,18 @@ Syntax Highlighting, Autocomplete, Refactoring, Navigation, Analysis, 그리고
|
|
|
450
483
|
- **lsp_code_action_resolve**: 코드 액션 적용
|
|
451
484
|
- **ast_grep_search**: AST 인식 코드 패턴 검색 (25개 언어)
|
|
452
485
|
- **ast_grep_replace**: AST 인식 코드 교체
|
|
486
|
+
- **call_omo_agent**: 전문 explore/librarian 에이전트를 생성합니다. 비동기 실행을 위한 `run_in_background` 파라미터를 지원합니다.
|
|
487
|
+
|
|
488
|
+
#### 세션 관리 (Session Management)
|
|
489
|
+
|
|
490
|
+
OpenCode 세션 히스토리를 탐색하고 검색하기 위한 도구들입니다:
|
|
491
|
+
|
|
492
|
+
- **session_list**: 날짜 및 개수 제한 필터링을 포함한 모든 OpenCode 세션 목록 조회
|
|
493
|
+
- **session_read**: 특정 세션의 메시지 및 히스토리 읽기
|
|
494
|
+
- **session_search**: 세션 메시지 전체 텍스트 검색
|
|
495
|
+
- **session_info**: 세션에 대한 메타데이터 및 통계 정보 조회
|
|
496
|
+
|
|
497
|
+
이 도구들을 통해 에이전트는 이전 대화를 참조하고 세션 간의 연속성을 유지할 수 있습니다.
|
|
453
498
|
|
|
454
499
|
#### Context is all you need.
|
|
455
500
|
- **Directory AGENTS.md / README.md Injector**: 파일을 읽을 때 `AGENTS.md`, `README.md` 내용을 자동으로 주입합니다. 파일 디렉토리부터 프로젝트 루트까지 탐색하며, 경로 상의 **모든** `AGENTS.md` 파일을 수집합니다. 중첩된 디렉토리별 지침을 지원합니다:
|
|
@@ -602,6 +647,10 @@ Oh My OpenCode는 다음 위치의 훅을 읽고 실행합니다:
|
|
|
602
647
|
- **Empty Message Sanitizer**: 빈 채팅 메시지로 인한 API 오류를 방지합니다. 전송 전 메시지 내용을 자동으로 정리합니다.
|
|
603
648
|
- **Grep Output Truncator**: grep은 산더미 같은 텍스트를 반환할 수 있습니다. 남은 컨텍스트 윈도우에 따라 동적으로 출력을 축소합니다—50% 여유 공간 유지, 최대 50k 토큰.
|
|
604
649
|
- **Tool Output Truncator**: 같은 아이디어, 더 넓은 범위. Grep, Glob, LSP 도구, AST-grep의 출력을 축소합니다. 한 번의 장황한 검색이 전체 컨텍스트를 잡아먹는 것을 방지합니다.
|
|
650
|
+
- **선제적 압축 (Preemptive Compaction)**: 세션 토큰 한계에 도달하기 전에 선제적으로 세션을 압축합니다. 문제가 발생하기 전에 미리 실행됩니다.
|
|
651
|
+
- **압축 컨텍스트 주입기 (Compaction Context Injector)**: 세션 압축 중에 중요한 컨텍스트(AGENTS.md, 현재 디렉토리 정보 등)를 유지하여 중요한 상태를 잃지 않도록 합니다.
|
|
652
|
+
- **사고 블록 검증기 (Thinking Block Validator)**: 사고(thinking) 블록의 형식이 올바른지 검증하여 잘못된 형식으로 인한 API 오류를 방지합니다.
|
|
653
|
+
- **Claude Code 훅 (Claude Code Hooks)**: Claude Code의 settings.json에 설정된 훅을 실행합니다. PreToolUse/PostToolUse/UserPromptSubmit/Stop 이벤트를 지원하는 호환성 레이어입니다.
|
|
605
654
|
|
|
606
655
|
## 설정
|
|
607
656
|
|
|
@@ -613,7 +662,7 @@ Oh My OpenCode는 다음 위치의 훅을 읽고 실행합니다:
|
|
|
613
662
|
|
|
614
663
|
| 플랫폼 | 사용자 설정 경로 |
|
|
615
664
|
|--------|------------------|
|
|
616
|
-
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (
|
|
665
|
+
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (권장) 또는 `%APPDATA%\opencode\oh-my-opencode.json` (fallback) |
|
|
617
666
|
| **macOS/Linux** | `~/.config/opencode/oh-my-opencode.json` |
|
|
618
667
|
|
|
619
668
|
Schema 자동 완성이 지원됩니다:
|
|
@@ -624,6 +673,36 @@ Schema 자동 완성이 지원됩니다:
|
|
|
624
673
|
}
|
|
625
674
|
```
|
|
626
675
|
|
|
676
|
+
### JSONC 지원
|
|
677
|
+
|
|
678
|
+
`oh-my-opencode` 설정 파일은 JSONC(주석이 포함된 JSON)를 지원합니다:
|
|
679
|
+
- 한 줄 주석: `// 주석`
|
|
680
|
+
- 블록 주석: `/* 주석 */`
|
|
681
|
+
- 후행 콤마(Trailing commas): `{ "key": "value", }`
|
|
682
|
+
|
|
683
|
+
`oh-my-opencode.jsonc`와 `oh-my-opencode.json` 파일이 모두 존재할 경우, `.jsonc` 파일이 우선순위를 갖습니다.
|
|
684
|
+
|
|
685
|
+
**주석이 포함된 예시:**
|
|
686
|
+
|
|
687
|
+
```jsonc
|
|
688
|
+
{
|
|
689
|
+
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
|
|
690
|
+
|
|
691
|
+
// Antigravity OAuth를 통해 Google Gemini 활성화
|
|
692
|
+
"google_auth": false,
|
|
693
|
+
|
|
694
|
+
/* 에이전트 오버라이드 - 특정 작업에 대한 모델 커스터마이징 */
|
|
695
|
+
"agents": {
|
|
696
|
+
"oracle": {
|
|
697
|
+
"model": "openai/gpt-5.2" // 전략적 추론을 위한 GPT
|
|
698
|
+
},
|
|
699
|
+
"explore": {
|
|
700
|
+
"model": "opencode/grok-code" // 탐색을 위한 빠르고 무료인 모델
|
|
701
|
+
},
|
|
702
|
+
},
|
|
703
|
+
}
|
|
704
|
+
```
|
|
705
|
+
|
|
627
706
|
### Google Auth
|
|
628
707
|
|
|
629
708
|
**권장**: 외부 [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) 플러그인을 사용하세요. 멀티 계정 로드밸런싱, 더 많은 모델(Antigravity를 통한 Claude 포함), 활발한 유지보수를 제공합니다. [설치 > Google Gemini](#42-google-gemini-antigravity-oauth) 참조.
|
|
@@ -786,7 +865,7 @@ Schema 자동 완성이 지원됩니다:
|
|
|
786
865
|
}
|
|
787
866
|
```
|
|
788
867
|
|
|
789
|
-
사용 가능한 훅: `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`
|
|
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`
|
|
790
869
|
|
|
791
870
|
**`auto-update-checker`와 `startup-toast`에 대한 참고사항**: `startup-toast` 훅은 `auto-update-checker`의 하위 기능입니다. 업데이트 확인은 유지하면서 시작 토스트 알림만 비활성화하려면 `disabled_hooks`에 `"startup-toast"`를 추가하세요. 모든 업데이트 확인 기능(토스트 포함)을 비활성화하려면 `"auto-update-checker"`를 추가하세요.
|
|
792
871
|
|
|
@@ -851,7 +930,7 @@ OpenCode 에서 지원하는 모든 LSP 구성 및 커스텀 설정 (opencode.js
|
|
|
851
930
|
| `aggressive_truncation` | `false` | 토큰 제한을 초과하면 도구 출력을 공격적으로 잘라내어 제한 내에 맞춥니다. 기본 truncation보다 더 공격적입니다. 부족하면 요약/복구로 fallback합니다. |
|
|
852
931
|
| `auto_resume` | `false` | thinking block 에러나 thinking disabled violation으로부터 성공적으로 복구한 후 자동으로 세션을 재개합니다. 마지막 사용자 메시지를 추출하여 계속합니다. |
|
|
853
932
|
| `truncate_all_tool_outputs` | `true` | 프롬프트가 너무 길어지는 것을 방지하기 위해 컨텍스트 윈도우 사용량에 따라 모든 도구 출력을 동적으로 잘라냅니다. 전체 도구 출력이 필요한 경우 `false`로 설정하여 비활성화하세요. |
|
|
854
|
-
| `
|
|
933
|
+
| `dcp_for_compaction` | `false` | 활성화하면, 토큰 제한 에러 발생 시 DCP(Dynamic Context Pruning)가 가장 먼저 실행되고, 그 다음 compaction이 실행됩니다. DCP가 불필요한 컨텍스트를 정리한 후 바로 compaction이 진행됩니다. 토큰 제한에 도달했을 때 더 스마트한 복구를 원하면 활성화하세요. |
|
|
855
934
|
|
|
856
935
|
**경고**: 이 기능들은 실험적이며 예상치 못한 동작을 유발할 수 있습니다. 의미를 이해한 경우에만 활성화하세요.
|
|
857
936
|
|
package/README.md
CHANGED
|
@@ -465,8 +465,8 @@ To remove oh-my-opencode:
|
|
|
465
465
|
|
|
466
466
|
- **Sisyphus** (`anthropic/claude-opus-4-5`): **The default agent.** A powerful AI orchestrator for OpenCode. Plans, delegates, and executes complex tasks using specialized subagents with aggressive parallel execution. Emphasizes background task delegation and todo-driven workflow. Uses Claude Opus 4.5 with extended thinking (32k budget) for maximum reasoning capability.
|
|
467
467
|
- **oracle** (`openai/gpt-5.2`): Architecture, code review, strategy. Uses GPT-5.2 for its stellar logical reasoning and deep analysis. Inspired by AmpCode.
|
|
468
|
-
- **librarian** (`anthropic/claude-sonnet-4-5`): Multi-repo analysis, doc lookup, implementation examples. Uses Claude Sonnet 4.5 for deep codebase understanding and GitHub research with evidence-based answers. Inspired by AmpCode.
|
|
469
|
-
- **explore** (`opencode/grok-code`): Fast codebase exploration and pattern matching.
|
|
468
|
+
- **librarian** (`anthropic/claude-sonnet-4-5` or `google/gemini-3-flash`): Multi-repo analysis, doc lookup, implementation examples. Uses Gemini 3 Flash when Antigravity auth is configured, otherwise Claude Sonnet 4.5 for deep codebase understanding and GitHub research with evidence-based answers. Inspired by AmpCode.
|
|
469
|
+
- **explore** (`opencode/grok-code`, `google/gemini-3-flash`, or `anthropic/claude-haiku-4-5`): Fast codebase exploration and pattern matching. Uses Gemini 3 Flash when Antigravity auth is configured, Haiku when Claude max20 is available, otherwise Grok. Inspired by Claude Code.
|
|
470
470
|
- **frontend-ui-ux-engineer** (`google/gemini-3-pro-high`): A designer turned developer. Builds gorgeous UIs. Gemini excels at creative, beautiful UI code.
|
|
471
471
|
- **document-writer** (`google/gemini-3-flash`): Technical writing expert. Gemini is a wordsmith—writes prose that flows.
|
|
472
472
|
- **multimodal-looker** (`google/gemini-3-flash`): Visual content specialist. Analyzes PDFs, images, diagrams to extract information.
|
|
@@ -522,6 +522,18 @@ Hand your best tools to your best colleagues. Now they can properly refactor, na
|
|
|
522
522
|
- **lsp_code_action_resolve**: Apply code action
|
|
523
523
|
- **ast_grep_search**: AST-aware code pattern search (25 languages)
|
|
524
524
|
- **ast_grep_replace**: AST-aware code replacement
|
|
525
|
+
- **call_omo_agent**: Spawn specialized explore/librarian agents. Supports `run_in_background` parameter for async execution.
|
|
526
|
+
|
|
527
|
+
#### Session Management
|
|
528
|
+
|
|
529
|
+
Tools to navigate and search your OpenCode session history:
|
|
530
|
+
|
|
531
|
+
- **session_list**: List all OpenCode sessions with filtering by date and limit
|
|
532
|
+
- **session_read**: Read messages and history from a specific session
|
|
533
|
+
- **session_search**: Full-text search across session messages
|
|
534
|
+
- **session_info**: Get metadata and statistics about a session
|
|
535
|
+
|
|
536
|
+
These tools enable agents to reference previous conversations and maintain continuity across sessions.
|
|
525
537
|
|
|
526
538
|
#### Context Is All You Need
|
|
527
539
|
- **Directory AGENTS.md / README.md Injector**: Auto-injects `AGENTS.md` and `README.md` when reading files. Walks from file directory to project root, collecting **all** `AGENTS.md` files along the path. Supports nested directory-specific instructions:
|
|
@@ -674,6 +686,10 @@ When agents thrive, you thrive. But I want to help you directly too.
|
|
|
674
686
|
- **Empty Message Sanitizer**: Prevents API errors from empty chat messages by automatically sanitizing message content before sending.
|
|
675
687
|
- **Grep Output Truncator**: Grep can return mountains of text. This dynamically truncates output based on your remaining context window—keeps 50% headroom, caps at 50k tokens.
|
|
676
688
|
- **Tool Output Truncator**: Same idea, broader scope. Truncates output from Grep, Glob, LSP tools, and AST-grep. Prevents one verbose search from eating your entire context.
|
|
689
|
+
- **Preemptive Compaction**: Compacts session proactively before hitting hard token limits. Runs before you get into trouble.
|
|
690
|
+
- **Compaction Context Injector**: Preserves critical context (AGENTS.md, current directory info) during session compaction so you don't lose important state.
|
|
691
|
+
- **Thinking Block Validator**: Validates thinking blocks to ensure proper formatting and prevent API errors from malformed thinking content.
|
|
692
|
+
- **Claude Code Hooks**: Executes hooks from Claude Code's settings.json - this is the compatibility layer that runs PreToolUse/PostToolUse/UserPromptSubmit/Stop hooks.
|
|
677
693
|
|
|
678
694
|
## Configuration
|
|
679
695
|
|
|
@@ -888,7 +904,7 @@ Disable specific built-in hooks via `disabled_hooks` in `~/.config/opencode/oh-m
|
|
|
888
904
|
}
|
|
889
905
|
```
|
|
890
906
|
|
|
891
|
-
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`
|
|
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`
|
|
892
908
|
|
|
893
909
|
**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`.
|
|
894
910
|
|
|
@@ -953,7 +969,7 @@ Opt-in experimental features that may change or be removed in future versions. U
|
|
|
953
969
|
| `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. |
|
|
954
970
|
| `auto_resume` | `false` | Automatically resumes session after successful recovery from thinking block errors or thinking disabled violations. Extracts the last user message and continues. |
|
|
955
971
|
| `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. |
|
|
956
|
-
| `
|
|
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. |
|
|
957
973
|
|
|
958
974
|
**Warning**: These features are experimental and may cause unexpected behavior. Enable only if you understand the implications.
|
|
959
975
|
|
package/README.zh-cn.md
CHANGED
|
@@ -398,14 +398,47 @@ gh repo star code-yeongyu/oh-my-opencode
|
|
|
398
398
|
</details>
|
|
399
399
|
|
|
400
400
|
|
|
401
|
+
## 卸载
|
|
402
|
+
|
|
403
|
+
要移除 oh-my-opencode:
|
|
404
|
+
|
|
405
|
+
1. **从 OpenCode 配置中移除插件**
|
|
406
|
+
|
|
407
|
+
编辑 `~/.config/opencode/opencode.json` (或 `opencode.jsonc`),从 `plugin` 数组中移除 `"oh-my-opencode"`:
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
# 使用 jq 的示例
|
|
411
|
+
jq '.plugin = [.plugin[] | select(. != "oh-my-opencode")]' \
|
|
412
|
+
~/.config/opencode/opencode.json > /tmp/oc.json && \
|
|
413
|
+
mv /tmp/oc.json ~/.config/opencode/opencode.json
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
2. **删除配置文件 (可选)**
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
# 删除用户配置
|
|
420
|
+
rm -f ~/.config/opencode/oh-my-opencode.json
|
|
421
|
+
|
|
422
|
+
# 删除项目配置 (如果存在)
|
|
423
|
+
rm -f .opencode/oh-my-opencode.json
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
3. **确认移除**
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
opencode --version
|
|
430
|
+
# 插件不应再被加载
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
|
|
401
434
|
## 功能
|
|
402
435
|
|
|
403
436
|
### Agents:你的神队友
|
|
404
437
|
|
|
405
438
|
- **Sisyphus** (`anthropic/claude-opus-4-5`):**默认 Agent。** OpenCode 专属的强力 AI 编排器。指挥专业子 Agent 搞定复杂任务。主打后台任务委派和 Todo 驱动。用 Claude Opus 4.5 加上扩展思考(32k token 预算),智商拉满。
|
|
406
439
|
- **oracle** (`openai/gpt-5.2`):架构师、代码审查员、战略家。GPT-5.2 的逻辑推理和深度分析能力不是盖的。致敬 AmpCode。
|
|
407
|
-
- **librarian** (`anthropic/claude-sonnet-4-5`)
|
|
408
|
-
- **explore** (`opencode/grok-code`)
|
|
440
|
+
- **librarian** (`anthropic/claude-sonnet-4-5` 或 `google/gemini-3-flash`):多仓库分析、查文档、找示例。配置 Antigravity 认证时使用 Gemini 3 Flash,否则使用 Claude Sonnet 4.5 深入理解代码库,GitHub 调研,给出的答案都有据可查。致敬 AmpCode。
|
|
441
|
+
- **explore** (`opencode/grok-code`、`google/gemini-3-flash` 或 `anthropic/claude-haiku-4-5`):极速代码库扫描、模式匹配。配置 Antigravity 认证时使用 Gemini 3 Flash,Claude max20 可用时使用 Haiku,否则用 Grok。致敬 Claude Code。
|
|
409
442
|
- **frontend-ui-ux-engineer** (`google/gemini-3-pro-preview`):设计师出身的程序员。UI 做得那是真漂亮。Gemini 写这种创意美观的代码是一绝。
|
|
410
443
|
- **document-writer** (`google/gemini-3-pro-preview`):技术写作专家。Gemini 文笔好,写出来的东西读着顺畅。
|
|
411
444
|
- **multimodal-looker** (`google/gemini-3-flash`):视觉内容专家。PDF、图片、图表,看一眼就知道里头有啥。
|
|
@@ -461,6 +494,18 @@ OhMyOpenCode 让这些成为可能。
|
|
|
461
494
|
- **lsp_code_action_resolve**:应用代码操作
|
|
462
495
|
- **ast_grep_search**:AST 感知代码搜索(支持 25 种语言)
|
|
463
496
|
- **ast_grep_replace**:AST 感知代码替换
|
|
497
|
+
- **call_omo_agent**: 产生专门的 explore/librarian Agent。支持用于异步执行的 `run_in_background` 参数。
|
|
498
|
+
|
|
499
|
+
#### 会话管理 (Session Management)
|
|
500
|
+
|
|
501
|
+
用于导航和搜索 OpenCode 会话历史的工具:
|
|
502
|
+
|
|
503
|
+
- **session_list**: 列出所有 OpenCode 会话,支持按日期和数量限制进行过滤
|
|
504
|
+
- **session_read**: 读取特定会话的消息和历史记录
|
|
505
|
+
- **session_search**: 在会话消息中进行全文搜索
|
|
506
|
+
- **session_info**: 获取有关会话的元数据和统计信息
|
|
507
|
+
|
|
508
|
+
这些工具使 Agent 能够引用之前的对话并保持跨会话的连续性。
|
|
464
509
|
|
|
465
510
|
#### 上下文就是一切 (Context is all you need)
|
|
466
511
|
- **Directory AGENTS.md / README.md 注入器**:读文件时自动把 `AGENTS.md` 和 `README.md` 塞进去。从当前目录一路往上找,路径上**所有** `AGENTS.md` 全都带上。支持嵌套指令:
|
|
@@ -620,7 +665,12 @@ Agent 爽了,你自然也爽。但我还想直接让你爽。
|
|
|
620
665
|
|
|
621
666
|
配置文件(优先级从高到低):
|
|
622
667
|
1. `.opencode/oh-my-opencode.json`(项目级)
|
|
623
|
-
2.
|
|
668
|
+
2. 用户配置(按平台):
|
|
669
|
+
|
|
670
|
+
| 平台 | 用户配置路径 |
|
|
671
|
+
|----------|------------------|
|
|
672
|
+
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (首选) 或 `%APPDATA%\opencode\oh-my-opencode.json` (备选) |
|
|
673
|
+
| **macOS/Linux** | `~/.config/opencode/oh-my-opencode.json` |
|
|
624
674
|
|
|
625
675
|
支持 Schema 自动补全:
|
|
626
676
|
|
|
@@ -630,6 +680,36 @@ Agent 爽了,你自然也爽。但我还想直接让你爽。
|
|
|
630
680
|
}
|
|
631
681
|
```
|
|
632
682
|
|
|
683
|
+
### JSONC 支持
|
|
684
|
+
|
|
685
|
+
`oh-my-opencode` 配置文件支持 JSONC(带注释的 JSON):
|
|
686
|
+
- 行注释:`// 注释`
|
|
687
|
+
- 块注释:`/* 注释 */`
|
|
688
|
+
- 尾随逗号:`{ "key": "value", }`
|
|
689
|
+
|
|
690
|
+
当 `oh-my-opencode.jsonc` 和 `oh-my-opencode.json` 文件同时存在时,`.jsonc` 优先。
|
|
691
|
+
|
|
692
|
+
**带注释的示例:**
|
|
693
|
+
|
|
694
|
+
```jsonc
|
|
695
|
+
{
|
|
696
|
+
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
|
|
697
|
+
|
|
698
|
+
// 通过 Antigravity OAuth 启用 Google Gemini
|
|
699
|
+
"google_auth": false,
|
|
700
|
+
|
|
701
|
+
/* Agent 覆盖 - 为特定任务自定义模型 */
|
|
702
|
+
"agents": {
|
|
703
|
+
"oracle": {
|
|
704
|
+
"model": "openai/gpt-5.2" // 用于战略推理的 GPT
|
|
705
|
+
},
|
|
706
|
+
"explore": {
|
|
707
|
+
"model": "opencode/grok-code" // 快速且免费的搜索模型
|
|
708
|
+
},
|
|
709
|
+
},
|
|
710
|
+
}
|
|
711
|
+
```
|
|
712
|
+
|
|
633
713
|
### Google Auth
|
|
634
714
|
|
|
635
715
|
**强推**:用外部 [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) 插件。多账号负载均衡、更多模型(包括 Antigravity 版 Claude)、有人维护。看 [安装 > Google Gemini](#42-google-gemini-antigravity-oauth)。
|
|
@@ -792,7 +872,7 @@ Sisyphus Agent 也能自定义:
|
|
|
792
872
|
}
|
|
793
873
|
```
|
|
794
874
|
|
|
795
|
-
可关的 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`
|
|
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`
|
|
796
876
|
|
|
797
877
|
**关于 `auto-update-checker` 和 `startup-toast`**: `startup-toast` hook 是 `auto-update-checker` 的子功能。若想保持更新检查但只禁用启动提示通知,在 `disabled_hooks` 中添加 `"startup-toast"`。若要禁用所有更新检查功能(包括提示),添加 `"auto-update-checker"`。
|
|
798
878
|
|
|
@@ -857,7 +937,7 @@ Oh My OpenCode 送你重构工具(重命名、代码操作)。
|
|
|
857
937
|
| `aggressive_truncation` | `false` | 超出 token 限制时,激进地截断工具输出以适应限制。比默认截断更激进。不够的话会回退到摘要/恢复。 |
|
|
858
938
|
| `auto_resume` | `false` | 从 thinking block 错误或 thinking disabled violation 成功恢复后,自动恢复会话。提取最后一条用户消息继续执行。 |
|
|
859
939
|
| `truncate_all_tool_outputs` | `true` | 为防止提示过长,根据上下文窗口使用情况动态截断所有工具输出。如需完整工具输出,设置为 `false` 禁用此功能。 |
|
|
860
|
-
| `
|
|
940
|
+
| `dcp_for_compaction` | `false` | 启用后,当发生 token 限制错误时,DCP(动态上下文剪枝)首先运行,然后立即执行压缩。DCP 清理不必要的上下文后,压缩立即进行。当达到 token 限制时需要更智能的恢复请启用此选项。 |
|
|
861
941
|
|
|
862
942
|
**警告**:这些功能是实验性的,可能会导致意外行为。只有在理解其影响的情况下才启用。
|
|
863
943
|
|
|
@@ -7,3 +7,4 @@
|
|
|
7
7
|
import type { AntigravityProjectContext } from "./types";
|
|
8
8
|
export declare function fetchProjectContext(accessToken: string): Promise<AntigravityProjectContext>;
|
|
9
9
|
export declare function clearProjectContextCache(accessToken?: string): void;
|
|
10
|
+
export declare function invalidateProjectContextByRefreshToken(_refreshToken: string): void;
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Antigravity token management utilities.
|
|
3
|
-
* Handles token expiration checking, refresh, and storage format parsing.
|
|
4
|
-
*/
|
|
5
1
|
import type { AntigravityRefreshParts, AntigravityTokenExchangeResult, AntigravityTokens } from "./types";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
export declare class AntigravityTokenRefreshError extends Error {
|
|
3
|
+
code?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
status: number;
|
|
6
|
+
statusText: string;
|
|
7
|
+
responseBody?: string;
|
|
8
|
+
constructor(options: {
|
|
9
|
+
message: string;
|
|
10
|
+
code?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
status: number;
|
|
13
|
+
statusText: string;
|
|
14
|
+
responseBody?: string;
|
|
15
|
+
});
|
|
16
|
+
get isInvalidGrant(): boolean;
|
|
17
|
+
get isNetworkError(): boolean;
|
|
18
|
+
}
|
|
13
19
|
export declare function isTokenExpired(tokens: AntigravityTokens): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Refresh an access token using a refresh token.
|
|
16
|
-
* Exchanges the refresh token for a new access token via Google's OAuth endpoint.
|
|
17
|
-
*
|
|
18
|
-
* @param refreshToken - The refresh token to use
|
|
19
|
-
* @param clientId - Optional custom client ID (defaults to ANTIGRAVITY_CLIENT_ID)
|
|
20
|
-
* @param clientSecret - Optional custom client secret (defaults to ANTIGRAVITY_CLIENT_SECRET)
|
|
21
|
-
* @returns Token exchange result with new access token, or throws on error
|
|
22
|
-
*/
|
|
23
20
|
export declare function refreshAccessToken(refreshToken: string, clientId?: string, clientSecret?: string): Promise<AntigravityTokenExchangeResult>;
|
|
24
21
|
/**
|
|
25
22
|
* Parse a stored token string into its component parts.
|
|
@@ -184,3 +184,22 @@ export interface AntigravityRefreshParts {
|
|
|
184
184
|
projectId?: string;
|
|
185
185
|
managedProjectId?: string;
|
|
186
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* OAuth error payload from Google
|
|
189
|
+
* Google returns errors in multiple formats, this handles all of them
|
|
190
|
+
*/
|
|
191
|
+
export interface OAuthErrorPayload {
|
|
192
|
+
error?: string | {
|
|
193
|
+
status?: string;
|
|
194
|
+
code?: string;
|
|
195
|
+
message?: string;
|
|
196
|
+
};
|
|
197
|
+
error_description?: string;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Parsed OAuth error with normalized fields
|
|
201
|
+
*/
|
|
202
|
+
export interface ParsedOAuthError {
|
|
203
|
+
code?: string;
|
|
204
|
+
description?: string;
|
|
205
|
+
}
|
package/dist/cli/index.js
CHANGED
|
@@ -2244,7 +2244,7 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
2244
2244
|
var require_package = __commonJS((exports, module) => {
|
|
2245
2245
|
module.exports = {
|
|
2246
2246
|
name: "oh-my-opencode",
|
|
2247
|
-
version: "2.
|
|
2247
|
+
version: "2.7.0",
|
|
2248
2248
|
description: "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
|
|
2249
2249
|
main: "dist/index.js",
|
|
2250
2250
|
types: "dist/index.d.ts",
|
|
@@ -2297,7 +2297,7 @@ var require_package = __commonJS((exports, module) => {
|
|
|
2297
2297
|
"@ast-grep/cli": "^0.40.0",
|
|
2298
2298
|
"@ast-grep/napi": "^0.40.0",
|
|
2299
2299
|
"@clack/prompts": "^0.11.0",
|
|
2300
|
-
"@code-yeongyu/comment-checker": "^0.6.
|
|
2300
|
+
"@code-yeongyu/comment-checker": "^0.6.1",
|
|
2301
2301
|
"@openauthjs/openauth": "^0.4.3",
|
|
2302
2302
|
"@opencode-ai/plugin": "^1.0.162",
|
|
2303
2303
|
"@opencode-ai/sdk": "^1.0.162",
|
|
@@ -3907,9 +3907,15 @@ function generateOmoConfig(installConfig) {
|
|
|
3907
3907
|
const agents = {};
|
|
3908
3908
|
if (!installConfig.hasClaude) {
|
|
3909
3909
|
agents["Sisyphus"] = { model: "opencode/big-pickle" };
|
|
3910
|
+
}
|
|
3911
|
+
if (installConfig.hasGemini) {
|
|
3912
|
+
agents["librarian"] = { model: "google/gemini-3-flash" };
|
|
3913
|
+
agents["explore"] = { model: "google/gemini-3-flash" };
|
|
3914
|
+
} else if (installConfig.hasClaude && installConfig.isMax20) {
|
|
3915
|
+
agents["explore"] = { model: "anthropic/claude-haiku-4-5" };
|
|
3916
|
+
} else {
|
|
3910
3917
|
agents["librarian"] = { model: "opencode/big-pickle" };
|
|
3911
|
-
|
|
3912
|
-
agents["librarian"] = { model: "opencode/big-pickle" };
|
|
3918
|
+
agents["explore"] = { model: "opencode/big-pickle" };
|
|
3913
3919
|
}
|
|
3914
3920
|
if (!installConfig.hasChatGPT) {
|
|
3915
3921
|
agents["oracle"] = {
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { OhMyOpenCodeConfigSchema, AgentOverrideConfigSchema, AgentOverridesSchema, McpNameSchema, AgentNameSchema, HookNameSchema, SisyphusAgentConfigSchema, ExperimentalConfigSchema, } from "./schema";
|
|
2
|
-
export type { OhMyOpenCodeConfig, AgentOverrideConfig, AgentOverrides, McpName, AgentName, HookName, SisyphusAgentConfig, ExperimentalConfig, DynamicContextPruningConfig, } from "./schema";
|
|
1
|
+
export { OhMyOpenCodeConfigSchema, AgentOverrideConfigSchema, AgentOverridesSchema, McpNameSchema, AgentNameSchema, HookNameSchema, BuiltinCommandNameSchema, SisyphusAgentConfigSchema, ExperimentalConfigSchema, } from "./schema";
|
|
2
|
+
export type { OhMyOpenCodeConfig, AgentOverrideConfig, AgentOverrides, McpName, AgentName, HookName, BuiltinCommandName, SisyphusAgentConfig, ExperimentalConfig, DynamicContextPruningConfig, } from "./schema";
|