oh-my-opencode 2.1.1 → 2.1.3
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 +37 -1
- package/README.ko.md +36 -2
- package/README.md +56 -29
- package/dist/auth/antigravity/project.d.ts +2 -13
- package/dist/auth/antigravity/types.d.ts +17 -4
- package/dist/config/schema.d.ts +2 -0
- package/dist/hooks/anthropic-auto-compact/index.d.ts +1 -1
- package/dist/hooks/anthropic-auto-compact/storage.d.ts +16 -0
- package/dist/hooks/anthropic-auto-compact/types.d.ts +10 -0
- package/dist/hooks/empty-message-sanitizer/index.d.ts +12 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/session-recovery/storage.d.ts +2 -0
- package/dist/index.js +1047 -626
- package/dist/tools/background-task/constants.d.ts +1 -1
- package/dist/tools/background-task/tools.d.ts +4 -2
- package/dist/tools/background-task/types.d.ts +2 -1
- package/dist/tools/index.d.ts +4 -2
- package/dist/tools/lsp/client.d.ts +1 -0
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -132,6 +132,19 @@ ultrathink を通じて自動的に動作させることもできますが、必
|
|
|
132
132
|
あなたがユーザーの oh-my-opencode 設定を支援する LLM エージェントなら、以下の手順に従ってください:
|
|
133
133
|
|
|
134
134
|
|
|
135
|
+
### ステップ 0: セットアップについてユーザーに尋ねる
|
|
136
|
+
|
|
137
|
+
OpenCode は様々なモデルをサポートしており、当プラグインは様々な最先端 LLM の使用を提案しています。そのため、ユーザーに以下の質問をする必要があります:
|
|
138
|
+
1. Claude Pro/Max のサブスクリプションをお持ちですか?お持ちでない場合、メインオーケストレーターモデルとして 'opencode/big-pickle' (glm 4.6 として知られる) を使用することになります (非推奨)。
|
|
139
|
+
-> ユーザーが「はい」と答えた場合、ToDo 追加: "ユーザーの Claude Pro/Max 認証設定"
|
|
140
|
+
-> ユーザーが「いいえ」と答えた場合、ToDo 追加: "oh-my-opencode.json の OmO エージェントモデルを opencode/big-pickle にオーバーライド"
|
|
141
|
+
2. ChatGPT のサブスクリプションをお持ちですか?お持ちでない場合、oracle エージェントに 32k thinking オプション付きの 'claude-opus-4-5' を使用することになります。
|
|
142
|
+
-> ユーザーが「はい」と答えた場合、ToDo 追加: "ユーザーの ChatGPT 認証設定"
|
|
143
|
+
-> ユーザーが「いいえ」と答えた場合、ToDo 追加: "oh-my-opencode.json の oracle エージェントモデルを 32k thinking 付きの claude-opus-4-5 にオーバーライド"
|
|
144
|
+
3. Gemini モデルを統合しますか?統合しない場合、美しいデザインを享受できません。
|
|
145
|
+
-> ユーザーが「はい」と答えた場合、ToDo 追加: "Google OAuth 設定"
|
|
146
|
+
-> ユーザーが「いいえ」と答えた場合、ToDo 追加: "oh-my-opencode.json の frontend-ui-ux-engineer エージェントモデルを 32k thinking 付きの claude-opus-4-5 にオーバーライド"
|
|
147
|
+
|
|
135
148
|
### ステップ 1: OpenCode インストール確認
|
|
136
149
|
|
|
137
150
|
```bash
|
|
@@ -147,6 +160,12 @@ OpenCode がインストールされていない場合は、[OpenCode インス
|
|
|
147
160
|
|
|
148
161
|
### ステップ 2: oh-my-opencode プラグイン設定
|
|
149
162
|
|
|
163
|
+
#### JSONC
|
|
164
|
+
- `~/.config/opencode/opencode.jsonc` が存在する場合は、そこで `oh-my-opencode` プラグインを追加してください。
|
|
165
|
+
|
|
166
|
+
#### JSON
|
|
167
|
+
- opencode.jsonc が存在しない場合は、以下のコマンドを実行して作成・登録してください。
|
|
168
|
+
|
|
150
169
|
```bash
|
|
151
170
|
mkdir -p ~/.config/opencode
|
|
152
171
|
|
|
@@ -255,6 +274,22 @@ opencode auth login
|
|
|
255
274
|
|
|
256
275
|
プラグインはデフォルトで完璧に動作します。推奨される `google_auth: true` 設定を除き、明示的な要求なしに他の設定を変更したり機能をオフにしないでください。
|
|
257
276
|
|
|
277
|
+
### セットアップの確認
|
|
278
|
+
|
|
279
|
+
このドキュメントをもう一度読み、すべて正しく完了したか考えてみてください。
|
|
280
|
+
|
|
281
|
+
### ユーザーに「おめでとうございます!🎉」と伝える
|
|
282
|
+
|
|
283
|
+
ユーザーに伝えてください:おめでとうございます!🎉 OhMyOpenCode のセットアップが完了しました!ターミナルで `opencode` と入力して使い始めてください。
|
|
284
|
+
|
|
285
|
+
そして、この Readme が提案するように、当プラグインが提案するカタログや機能を、あなたが想像できる素晴らしいユースケースの例とともにリストアップしてください。
|
|
286
|
+
|
|
287
|
+
### 複雑すぎますか?
|
|
288
|
+
|
|
289
|
+
これが全部大変に感じるなら、一つだけ覚えてください:**プロンプトに `ultrawork` という単語を含めてください。**
|
|
290
|
+
|
|
291
|
+
それだけです。エージェントが残りを全部自動で処理します。
|
|
292
|
+
|
|
258
293
|
</details>
|
|
259
294
|
|
|
260
295
|
|
|
@@ -474,6 +509,7 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
|
|
|
474
509
|
- **Background Notification**: バックグラウンドエージェントのタスクが完了すると通知を受け取ります。
|
|
475
510
|
- **Session Notification**: エージェントがアイドル状態になると OS 通知を送ります。macOS、Linux、Windows で動作します—エージェントが入力を待っている時を見逃しません。
|
|
476
511
|
- **Empty Task Response Detector**: Task ツールが空の応答を返すと検知します。既に空の応答が返ってきているのに、いつまでも待ち続ける状況を防ぎます。
|
|
512
|
+
- **Empty Message Sanitizer**: 空のチャットメッセージによるAPIエラーを防止します。送信前にメッセージ内容を自動的にサニタイズします。
|
|
477
513
|
- **Grep Output Truncator**: grep は山のようなテキストを返すことがあります。残りのコンテキストウィンドウに応じて動的に出力を切り詰めます—50% の余裕を維持し、最大 50k トークンに制限します。
|
|
478
514
|
- **Tool Output Truncator**: 同じ考え方をより広範囲に適用します。Grep、Glob、LSP ツール、AST-grep の出力を切り詰めます。一度の冗長な検索がコンテキスト全体を食いつぶすのを防ぎます。
|
|
479
515
|
|
|
@@ -612,7 +648,7 @@ OmO を無効化して元の build/plan エージェントを復元するには
|
|
|
612
648
|
}
|
|
613
649
|
```
|
|
614
650
|
|
|
615
|
-
利用可能なフック:`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`
|
|
651
|
+
利用可能なフック:`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`
|
|
616
652
|
|
|
617
653
|
### MCPs
|
|
618
654
|
|
package/README.ko.md
CHANGED
|
@@ -129,7 +129,18 @@ ultrathink 를 통해 자동으로 동작하게 할 수 있지만, 그렇지 않
|
|
|
129
129
|
당신이 사용자의 oh-my-opencode 설정을 돕는 LLM Agent라면, 다음 단계를 따르세요:
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
###
|
|
132
|
+
### 0단계: 사용자에게 설정에 대해 물어보세요.
|
|
133
|
+
|
|
134
|
+
OpenCode는 다양한 모델을 지원하며, 이 플러그인은 다양한 프론티어 LLM 사용을 제안합니다. 따라서 사용자에게 다음 질문을 해야 합니다:
|
|
135
|
+
1. Claude Pro/Max 구독이 있으신가요? 그렇지 않다면 메인 오케스트레이터 모델로 'opencode/big-pickle'(glm 4.6으로 알려짐)을 사용하게 됩니다 (권장하지 않음).
|
|
136
|
+
-> 사용자가 '예'라고 답하면, 할 일 추가: "사용자 Claude Pro/Max 인증 설정"
|
|
137
|
+
-> 사용자가 '아니오'라고 답하면, 할 일 추가: "oh-my-opencode.json의 OmO 에이전트 모델을 opencode/big-pickle로 재정의"
|
|
138
|
+
2. ChatGPT 구독이 있으신가요? 그렇지 않다면 oracle 에이전트에 32k thinking 옵션이 있는 'claude-opus-4-5'를 사용하게 됩니다.
|
|
139
|
+
-> 사용자가 '예'라고 답하면, 할 일 추가: "사용자 ChatGPT 인증 설정"
|
|
140
|
+
-> 사용자가 '아니오'라고 답하면, 할 일 추가: "oh-my-opencode.json의 oracle 에이전트 모델을 32k thinking이 있는 claude-opus-4-5로 재정의"
|
|
141
|
+
3. Gemini 모델을 통합하시겠습니까? 그렇지 않다면 아름다운 디자인을 즐길 수 없습니다.
|
|
142
|
+
-> 사용자가 '예'라고 답하면, 할 일 추가: "Google OAuth 설정"
|
|
143
|
+
-> 사용자가 '아니오'라고 답하면, 할 일 추가: "oh-my-opencode.json의 frontend-ui-ux-engineer 에이전트 모델을 32k thinking이 있는 claude-opus-4-5로 재정의"
|
|
133
144
|
|
|
134
145
|
### 1단계: OpenCode 설치 확인
|
|
135
146
|
|
|
@@ -146,6 +157,12 @@ OpenCode가 설치되어 있지 않다면, [OpenCode 설치 가이드](https://o
|
|
|
146
157
|
|
|
147
158
|
### 2단계: oh-my-opencode 플러그인 설정
|
|
148
159
|
|
|
160
|
+
#### JSONC
|
|
161
|
+
- `~/.config/opencode/opencode.jsonc`가 존재한다면, 그곳에 `oh-my-opencode` 플러그인을 추가하세요.
|
|
162
|
+
|
|
163
|
+
#### JSON
|
|
164
|
+
- opencode.jsonc가 없다면, 다음 명령어를 실행하여 생성하고 등록하세요.
|
|
165
|
+
|
|
149
166
|
```bash
|
|
150
167
|
mkdir -p ~/.config/opencode
|
|
151
168
|
|
|
@@ -254,6 +271,22 @@ opencode auth login
|
|
|
254
271
|
|
|
255
272
|
플러그인은 기본값으로 완벽하게 동작합니다. 권장 사항인 `google_auth: true` 설정을 제외하고는, 명시적인 요청 없이 다른 설정을 변경하거나 기능을 끄지 마세요.
|
|
256
273
|
|
|
274
|
+
### 설정 확인
|
|
275
|
+
|
|
276
|
+
이 문서를 다시 읽고, 모든 것이 올바르게 수행되었는지 생각해보세요.
|
|
277
|
+
|
|
278
|
+
### 사용자에게 '축하합니다! 🎉'라고 말하세요
|
|
279
|
+
|
|
280
|
+
사용자에게 말하세요: 축하합니다! 🎉 OhMyOpenCode 설정을 성공적으로 마쳤습니다! 터미널에 `opencode`를 입력하여 사용을 시작하세요.
|
|
281
|
+
|
|
282
|
+
그리고 이 리드미가 제안하듯, 우리 플러그인이 제안하는 카탈로그와 기능들을 나열하고, 당신이 상상할 수 있는 멋진 유스케이스 예시를 함께 제시하세요.
|
|
283
|
+
|
|
284
|
+
### 너무 복잡한가요?
|
|
285
|
+
|
|
286
|
+
이 모든 것이 벅차게 느껴진다면, 딱 하나만 기억하세요: **프롬프트에 `ultrawork` 라는 단어를 포함시키세요.**
|
|
287
|
+
|
|
288
|
+
그게 끝입니다. 에이전트가 알아서 나머지를 처리할 겁니다.
|
|
289
|
+
|
|
257
290
|
</details>
|
|
258
291
|
|
|
259
292
|
|
|
@@ -470,6 +503,7 @@ Oh My OpenCode는 다음 위치의 훅을 읽고 실행합니다:
|
|
|
470
503
|
- **Background Notification**: 백그라운드 에이전트 작업이 완료되면 알림을 받습니다.
|
|
471
504
|
- **Session Notification**: 에이전트가 대기 상태가 되면 OS 알림을 보냅니다. macOS, Linux, Windows에서 작동—에이전트가 입력을 기다릴 때 놓치지 마세요.
|
|
472
505
|
- **Empty Task Response Detector**: Task 도구가 빈 응답을 반환하면 감지합니다. 이미 빈 응답이 왔는데 무한정 기다리는 상황을 방지합니다.
|
|
506
|
+
- **Empty Message Sanitizer**: 빈 채팅 메시지로 인한 API 오류를 방지합니다. 전송 전 메시지 내용을 자동으로 정리합니다.
|
|
473
507
|
- **Grep Output Truncator**: grep은 산더미 같은 텍스트를 반환할 수 있습니다. 남은 컨텍스트 윈도우에 따라 동적으로 출력을 축소합니다—50% 여유 공간 유지, 최대 50k 토큰.
|
|
474
508
|
- **Tool Output Truncator**: 같은 아이디어, 더 넓은 범위. Grep, Glob, LSP 도구, AST-grep의 출력을 축소합니다. 한 번의 장황한 검색이 전체 컨텍스트를 잡아먹는 것을 방지합니다.
|
|
475
509
|
|
|
@@ -608,7 +642,7 @@ OmO를 비활성화하고 원래 build/plan 에이전트를 복원하려면:
|
|
|
608
642
|
}
|
|
609
643
|
```
|
|
610
644
|
|
|
611
|
-
사용 가능한 훅: `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`
|
|
645
|
+
사용 가능한 훅: `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`
|
|
612
646
|
|
|
613
647
|
### MCPs
|
|
614
648
|
|
package/README.md
CHANGED
|
@@ -129,10 +129,26 @@ Let the LLM Agent handle the grunt work. Paste this link and ask it to install a
|
|
|
129
129
|
<details>
|
|
130
130
|
<summary>Instructions for LLM Agents (click to expand)</summary>
|
|
131
131
|
|
|
132
|
-
If you're an LLM Agent helping set up oh-my-opencode,
|
|
132
|
+
If you're an LLM Agent helping set up oh-my-opencode, Welcome! You'll now help your user to install the best agent harness, OhMyOpenCode. Tell user this with greetings, with test 'oMoMoMoMo...'
|
|
133
133
|
|
|
134
|
+
follow these steps:
|
|
134
135
|
|
|
135
|
-
### Step
|
|
136
|
+
### Step 0: Ask user about the setup.
|
|
137
|
+
|
|
138
|
+
Since OpenCode Supports various models, and our plugin suggests various frontier LLMs. Thus, you must ask user, following questions:
|
|
139
|
+
1. Do you have a Claude Pro/Max Subscription? Otherwise, we'll use 'opencode/big-pickle' (known for glm 4.6) as a main orchestrator model (not recommended)
|
|
140
|
+
-> If user said yes, add ToDo: "Setup user Claude Pro/Max Auth"
|
|
141
|
+
-> If user said no, add ToDo: "Override OmO agent model on oh-my-opencode.json as opencode/big-pickle"
|
|
142
|
+
2. Do you have a ChatGPT Subscription? Otherwise, we'll use 'claude-opus-4-5' with 32k thinking option for oracle agent.
|
|
143
|
+
-> If user said yes, add ToDo: "Setup user ChatGPT Auth"
|
|
144
|
+
-> If user said no, add ToDo: "Override oracle agent model on oh-my-opencode.json as claude-opus-4-5 with 32k thinking"
|
|
145
|
+
3. Will you integrate Gemini models? Otherwise, you cannot enjoy the beautiful design.
|
|
146
|
+
-> If user said yes, add ToDo: "Setup Google OAuth"
|
|
147
|
+
-> If user said no, add ToDo: "Override frontend-ui-ux-engineer agent model on oh-my-opencode.json as claude-opus-4-5 with 32k thinking"
|
|
148
|
+
|
|
149
|
+
### Step 1: Install OpenCode, if not
|
|
150
|
+
|
|
151
|
+
Run following command to verify OpenCode Installation:
|
|
136
152
|
|
|
137
153
|
```bash
|
|
138
154
|
if command -v opencode &> /dev/null; then
|
|
@@ -143,10 +159,17 @@ else
|
|
|
143
159
|
fi
|
|
144
160
|
```
|
|
145
161
|
|
|
146
|
-
If OpenCode isn't installed, check the [OpenCode Installation Guide](https://opencode.ai/docs).
|
|
162
|
+
If OpenCode isn't installed, check the [OpenCode Installation Guide](https://opencode.ai/docs).
|
|
163
|
+
Spawn a subagent to handle installation and report back - to save context.
|
|
147
164
|
|
|
148
165
|
### Step 2: Configure oh-my-opencode Plugin
|
|
149
166
|
|
|
167
|
+
#### JSONC
|
|
168
|
+
- If `~/.config/opencode/opencode.jsonc` exists, work in there to add `oh-my-opencode` plugin
|
|
169
|
+
|
|
170
|
+
#### JSON
|
|
171
|
+
- If no opencode.jsonc exists, run following command to create and register it.
|
|
172
|
+
|
|
150
173
|
```bash
|
|
151
174
|
mkdir -p ~/.config/opencode
|
|
152
175
|
|
|
@@ -169,46 +192,39 @@ fi
|
|
|
169
192
|
|
|
170
193
|
```bash
|
|
171
194
|
opencode --version # Should be 1.0.132 or higher
|
|
172
|
-
cat ~/.config/opencode/opencode.json # Should contain "oh-my-opencode" in plugin array
|
|
195
|
+
cat ~/.config/opencode/opencode.json # Should contain "oh-my-opencode" in plugin array, or maybe check jsonc
|
|
173
196
|
```
|
|
174
197
|
|
|
175
198
|
### Step 4: Configure Authentication
|
|
176
199
|
|
|
177
|
-
|
|
200
|
+
As your todo, please configure authentication as user have answered to you.
|
|
201
|
+
Following is the configuration guides for each providers. Please use interactive terminal like tmux to do following:
|
|
178
202
|
|
|
179
|
-
####
|
|
203
|
+
#### Anthropic (Claude)
|
|
180
204
|
|
|
181
205
|
```bash
|
|
182
206
|
opencode auth login
|
|
183
|
-
# Provider: Select Anthropic
|
|
184
|
-
# Login method: Select Claude Pro/Max
|
|
207
|
+
# Interactive Terminal: find Provider: Select Anthropic
|
|
208
|
+
# Interactive Terminal: find Login method: Select Claude Pro/Max
|
|
185
209
|
# Guide user through OAuth flow in browser
|
|
186
210
|
# Wait for completion
|
|
187
211
|
# Verify success and confirm with user
|
|
188
212
|
```
|
|
189
213
|
|
|
190
|
-
####
|
|
191
|
-
|
|
192
|
-
First, enable Google auth in `~/.config/opencode/oh-my-opencode.json`:
|
|
193
|
-
|
|
194
|
-
```json
|
|
195
|
-
{
|
|
196
|
-
"google_auth": true
|
|
197
|
-
}
|
|
198
|
-
```
|
|
214
|
+
#### Google Gemini (Antigravity OAuth)
|
|
199
215
|
|
|
200
216
|
Then authenticate:
|
|
201
217
|
|
|
202
218
|
```bash
|
|
203
219
|
opencode auth login
|
|
204
|
-
# Provider: Select Google
|
|
205
|
-
# Login method: Select
|
|
206
|
-
# Guide user through OAuth flow in browser
|
|
220
|
+
# Interactive Terminal: find Provider: Select Google
|
|
221
|
+
# Interactive Terminal: find Login method: Select Google
|
|
222
|
+
# Guide user through OAuth flow in browser. You use tools like pbcopy or other equivalents depending on your OS, and tell user that you have copied the link and paste it to the browser
|
|
207
223
|
# Wait for completion
|
|
208
224
|
# Verify success and confirm with user
|
|
209
225
|
```
|
|
210
226
|
|
|
211
|
-
####
|
|
227
|
+
#### OpenAI (ChatGPT Plus/Pro)
|
|
212
228
|
|
|
213
229
|
First, add the opencode-openai-codex-auth plugin:
|
|
214
230
|
|
|
@@ -233,7 +249,7 @@ First, add the opencode-openai-codex-auth plugin:
|
|
|
233
249
|
|
|
234
250
|
Then run `cd ~/.config/opencode && bun i`. In `opencode.json`, use `"opencode-openai-codex-auth"` without the version suffix.
|
|
235
251
|
|
|
236
|
-
|
|
252
|
+
##### Model Configuration
|
|
237
253
|
You'll also need full model settings in `opencode.json`.
|
|
238
254
|
Read the [opencode-openai-codex-auth documentation](https://github.com/numman-ali/opencode-openai-codex-auth), copy provider/models config from [`config/full-opencode.json`](https://github.com/numman-ali/opencode-openai-codex-auth/blob/main/config/full-opencode.json), and merge carefully to avoid breaking the user's existing setup.
|
|
239
255
|
|
|
@@ -241,19 +257,29 @@ Then authenticate:
|
|
|
241
257
|
|
|
242
258
|
```bash
|
|
243
259
|
opencode auth login
|
|
244
|
-
# Provider: Select OpenAI
|
|
245
|
-
# Login method: Select ChatGPT Plus/Pro (Codex Subscription)
|
|
246
|
-
# Guide user through OAuth flow in browser
|
|
260
|
+
# Interactive Terminal: Provider: Select OpenAI
|
|
261
|
+
# Interactive Terminal: Login method: Select ChatGPT Plus/Pro (Codex Subscription)
|
|
262
|
+
# Interactive Terminal: Guide user through OAuth flow in browser
|
|
247
263
|
# Wait for completion
|
|
248
264
|
# Verify success and confirm with user
|
|
249
265
|
```
|
|
250
266
|
|
|
251
267
|
|
|
252
|
-
###
|
|
268
|
+
### Verify the setup
|
|
269
|
+
|
|
270
|
+
Read this document again, think about you have done everything correctly.
|
|
271
|
+
|
|
272
|
+
### Say 'Congratulations! 🎉' to the user
|
|
273
|
+
|
|
274
|
+
Say to user: Congratulations! 🎉 You have successfully set up OhMyOpenCode! Type `opencode` in your terminal to start using it.
|
|
275
|
+
|
|
276
|
+
And as our readme suggests, list some catalogs and the features that our plugin suggests- with some great usecase examples that you can imagine.
|
|
277
|
+
|
|
278
|
+
### Too Complicated?
|
|
253
279
|
|
|
254
|
-
|
|
280
|
+
If this all seems overwhelming, just remember one thing: **include the word `ultrawork` in your prompt**.
|
|
255
281
|
|
|
256
|
-
|
|
282
|
+
That's it. The agent will figure out the rest and handle everything automatically.
|
|
257
283
|
|
|
258
284
|
</details>
|
|
259
285
|
|
|
@@ -471,6 +497,7 @@ When agents thrive, you thrive. But I want to help you directly too.
|
|
|
471
497
|
- **Background Notification**: Get notified when background agent tasks complete.
|
|
472
498
|
- **Session Notification**: Sends OS notifications when agents go idle. Works on macOS, Linux, and Windows—never miss when your agent needs input.
|
|
473
499
|
- **Empty Task Response Detector**: Catches when Task tool returns nothing. Warns you about potential agent failures so you don't wait forever for a response that already came back empty.
|
|
500
|
+
- **Empty Message Sanitizer**: Prevents API errors from empty chat messages by automatically sanitizing message content before sending.
|
|
474
501
|
- **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.
|
|
475
502
|
- **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.
|
|
476
503
|
|
|
@@ -609,7 +636,7 @@ Disable specific built-in hooks via `disabled_hooks` in `~/.config/opencode/oh-m
|
|
|
609
636
|
}
|
|
610
637
|
```
|
|
611
638
|
|
|
612
|
-
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`
|
|
639
|
+
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`
|
|
613
640
|
|
|
614
641
|
### MCPs
|
|
615
642
|
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Antigravity project context management.
|
|
3
3
|
* Handles fetching GCP project ID via Google's loadCodeAssist API.
|
|
4
|
+
* For FREE tier users, onboards via onboardUser API to get server-assigned managed project ID.
|
|
5
|
+
* Reference: https://github.com/shekohex/opencode-google-antigravity-auth
|
|
4
6
|
*/
|
|
5
7
|
import type { AntigravityProjectContext } from "./types";
|
|
6
|
-
/**
|
|
7
|
-
* Fetch project context from Google's loadCodeAssist API.
|
|
8
|
-
* Extracts the cloudaicompanionProject from the response.
|
|
9
|
-
*
|
|
10
|
-
* @param accessToken - Valid OAuth access token
|
|
11
|
-
* @returns Project context with cloudaicompanionProject ID
|
|
12
|
-
*/
|
|
13
8
|
export declare function fetchProjectContext(accessToken: string): Promise<AntigravityProjectContext>;
|
|
14
|
-
/**
|
|
15
|
-
* Clear the project context cache.
|
|
16
|
-
* Call this when tokens are refreshed or invalidated.
|
|
17
|
-
*
|
|
18
|
-
* @param accessToken - Optional specific token to clear, or clears all if not provided
|
|
19
|
-
*/
|
|
20
9
|
export declare function clearProjectContextCache(accessToken?: string): void;
|
|
@@ -51,14 +51,27 @@ export interface AntigravityClientMetadata {
|
|
|
51
51
|
export interface AntigravityLoadCodeAssistRequest {
|
|
52
52
|
metadata: AntigravityClientMetadata;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
export interface AntigravityUserTier {
|
|
55
|
+
id?: string;
|
|
56
|
+
isDefault?: boolean;
|
|
57
|
+
userDefinedCloudaicompanionProject?: boolean;
|
|
58
|
+
}
|
|
57
59
|
export interface AntigravityLoadCodeAssistResponse {
|
|
58
|
-
/** Project ID - can be string or object with id field */
|
|
59
60
|
cloudaicompanionProject?: string | {
|
|
60
61
|
id: string;
|
|
61
62
|
};
|
|
63
|
+
currentTier?: {
|
|
64
|
+
id?: string;
|
|
65
|
+
};
|
|
66
|
+
allowedTiers?: AntigravityUserTier[];
|
|
67
|
+
}
|
|
68
|
+
export interface AntigravityOnboardUserPayload {
|
|
69
|
+
done?: boolean;
|
|
70
|
+
response?: {
|
|
71
|
+
cloudaicompanionProject?: {
|
|
72
|
+
id?: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
62
75
|
}
|
|
63
76
|
/**
|
|
64
77
|
* Request body format for Antigravity API calls
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export declare const HookNameSchema: z.ZodEnum<{
|
|
|
50
50
|
"auto-update-checker": "auto-update-checker";
|
|
51
51
|
"startup-toast": "startup-toast";
|
|
52
52
|
"keyword-detector": "keyword-detector";
|
|
53
|
+
"empty-message-sanitizer": "empty-message-sanitizer";
|
|
53
54
|
}>;
|
|
54
55
|
export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
55
56
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -606,6 +607,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
606
607
|
"auto-update-checker": "auto-update-checker";
|
|
607
608
|
"startup-toast": "startup-toast";
|
|
608
609
|
"keyword-detector": "keyword-detector";
|
|
610
|
+
"empty-message-sanitizer": "empty-message-sanitizer";
|
|
609
611
|
}>>>;
|
|
610
612
|
agents: z.ZodOptional<z.ZodObject<{
|
|
611
613
|
build: z.ZodOptional<z.ZodObject<{
|
|
@@ -7,6 +7,6 @@ export declare function createAnthropicAutoCompactHook(ctx: PluginInput): {
|
|
|
7
7
|
};
|
|
8
8
|
}) => Promise<void>;
|
|
9
9
|
};
|
|
10
|
-
export type { AutoCompactState, FallbackState, ParsedTokenLimitError } from "./types";
|
|
10
|
+
export type { AutoCompactState, FallbackState, ParsedTokenLimitError, TruncateState } from "./types";
|
|
11
11
|
export { parseAnthropicTokenLimitError } from "./parser";
|
|
12
12
|
export { executeCompact, getLastAssistant } from "./executor";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ToolResultInfo {
|
|
2
|
+
partPath: string;
|
|
3
|
+
partId: string;
|
|
4
|
+
messageID: string;
|
|
5
|
+
toolName: string;
|
|
6
|
+
outputSize: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function findToolResultsBySize(sessionID: string): ToolResultInfo[];
|
|
9
|
+
export declare function findLargestToolResult(sessionID: string): ToolResultInfo | null;
|
|
10
|
+
export declare function truncateToolResult(partPath: string): {
|
|
11
|
+
success: boolean;
|
|
12
|
+
toolName?: string;
|
|
13
|
+
originalSize?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function getTotalToolOutputSize(sessionID: string): number;
|
|
16
|
+
export declare function countTruncatedResults(sessionID: string): number;
|
|
@@ -14,11 +14,17 @@ export interface FallbackState {
|
|
|
14
14
|
revertAttempt: number;
|
|
15
15
|
lastRevertedMessageID?: string;
|
|
16
16
|
}
|
|
17
|
+
export interface TruncateState {
|
|
18
|
+
truncateAttempt: number;
|
|
19
|
+
lastTruncatedPartId?: string;
|
|
20
|
+
}
|
|
17
21
|
export interface AutoCompactState {
|
|
18
22
|
pendingCompact: Set<string>;
|
|
19
23
|
errorDataBySession: Map<string, ParsedTokenLimitError>;
|
|
20
24
|
retryStateBySession: Map<string, RetryState>;
|
|
21
25
|
fallbackStateBySession: Map<string, FallbackState>;
|
|
26
|
+
truncateStateBySession: Map<string, TruncateState>;
|
|
27
|
+
compactionInProgress: Set<string>;
|
|
22
28
|
}
|
|
23
29
|
export declare const RETRY_CONFIG: {
|
|
24
30
|
readonly maxAttempts: 2;
|
|
@@ -30,3 +36,7 @@ export declare const FALLBACK_CONFIG: {
|
|
|
30
36
|
readonly maxRevertAttempts: 3;
|
|
31
37
|
readonly minMessagesRequired: 2;
|
|
32
38
|
};
|
|
39
|
+
export declare const TRUNCATE_CONFIG: {
|
|
40
|
+
readonly maxTruncateAttempts: 10;
|
|
41
|
+
readonly minOutputSizeToTruncate: 1000;
|
|
42
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Message, Part } from "@opencode-ai/sdk";
|
|
2
|
+
interface MessageWithParts {
|
|
3
|
+
info: Message;
|
|
4
|
+
parts: Part[];
|
|
5
|
+
}
|
|
6
|
+
type MessagesTransformHook = {
|
|
7
|
+
"experimental.chat.messages.transform"?: (input: Record<string, never>, output: {
|
|
8
|
+
messages: MessageWithParts[];
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export declare function createEmptyMessageSanitizerHook(): MessagesTransformHook;
|
|
12
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -18,3 +18,4 @@ export { createAgentUsageReminderHook } from "./agent-usage-reminder";
|
|
|
18
18
|
export { createKeywordDetectorHook } from "./keyword-detector";
|
|
19
19
|
export { createNonInteractiveEnvHook } from "./non-interactive-env";
|
|
20
20
|
export { createInteractiveBashSessionHook } from "./interactive-bash-session";
|
|
21
|
+
export { createEmptyMessageSanitizerHook } from "./empty-message-sanitizer";
|
|
@@ -14,4 +14,6 @@ export declare function findMessagesWithThinkingOnly(sessionID: string): string[
|
|
|
14
14
|
export declare function findMessagesWithOrphanThinking(sessionID: string): string[];
|
|
15
15
|
export declare function prependThinkingPart(sessionID: string, messageID: string): boolean;
|
|
16
16
|
export declare function stripThinkingParts(messageID: string): boolean;
|
|
17
|
+
export declare function replaceEmptyTextParts(messageID: string, replacementText: string): boolean;
|
|
18
|
+
export declare function findMessagesWithEmptyTextParts(sessionID: string): string[];
|
|
17
19
|
export declare function findMessageByIndexNeedingThinking(sessionID: string, targetIndex: number): string | null;
|