oh-my-opencode 2.0.2 → 2.0.4
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.ko.md +60 -4
- package/README.md +60 -4
- package/dist/config/schema.d.ts +190 -2
- package/dist/hooks/auto-update-checker/constants.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/non-interactive-env/constants.d.ts +2 -0
- package/dist/hooks/non-interactive-env/index.d.ts +12 -0
- package/dist/hooks/non-interactive-env/types.d.ts +3 -0
- package/dist/hooks/session-recovery/storage.d.ts +1 -0
- package/dist/index.js +142 -63
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -466,7 +466,12 @@ Oh My OpenCode는 다음 위치의 훅을 읽고 실행합니다:
|
|
|
466
466
|
- **Anthropic Auto Compact**: Claude 모델이 토큰 제한에 도달하면 자동으로 세션을 요약하고 압축합니다. 수동 개입 없이 작업을 계속할 수 있습니다.
|
|
467
467
|
- **Session Recovery**: 세션 에러(누락된 도구 결과, thinking 블록 문제, 빈 메시지 등)에서 자동 복구합니다. 돌다가 세션이 망가지지 않습니다. 망가져도 복구됩니다.
|
|
468
468
|
- **Auto Update Checker**: oh-my-opencode의 새 버전이 출시되면 알림을 표시합니다.
|
|
469
|
+
- **Startup Toast**: OhMyOpenCode 로드 시 환영 메시지를 표시합니다. 세션을 제대로 시작하기 위한 작은 "oMoMoMo".
|
|
469
470
|
- **Background Notification**: 백그라운드 에이전트 작업이 완료되면 알림을 받습니다.
|
|
471
|
+
- **Session Notification**: 에이전트가 대기 상태가 되면 OS 알림을 보냅니다. macOS, Linux, Windows에서 작동—에이전트가 입력을 기다릴 때 놓치지 마세요.
|
|
472
|
+
- **Empty Task Response Detector**: Task 도구가 빈 응답을 반환하면 감지합니다. 이미 빈 응답이 왔는데 무한정 기다리는 상황을 방지합니다.
|
|
473
|
+
- **Grep Output Truncator**: grep은 산더미 같은 텍스트를 반환할 수 있습니다. 남은 컨텍스트 윈도우에 따라 동적으로 출력을 축소합니다—50% 여유 공간 유지, 최대 50k 토큰.
|
|
474
|
+
- **Tool Output Truncator**: 같은 아이디어, 더 넓은 범위. Grep, Glob, LSP 도구, AST-grep의 출력을 축소합니다. 한 번의 장황한 검색이 전체 컨텍스트를 잡아먹는 것을 방지합니다.
|
|
470
475
|
|
|
471
476
|
## 설정
|
|
472
477
|
|
|
@@ -516,6 +521,34 @@ Google Gemini 모델을 위한 내장 Antigravity OAuth를 활성화합니다:
|
|
|
516
521
|
|
|
517
522
|
각 에이전트에서 지원하는 옵션: `model`, `temperature`, `top_p`, `prompt`, `tools`, `disable`, `description`, `mode`, `color`, `permission`.
|
|
518
523
|
|
|
524
|
+
`OmO` (메인 오케스트레이터)와 `build` (기본 에이전트)도 동일한 옵션으로 설정을 오버라이드할 수 있습니다.
|
|
525
|
+
|
|
526
|
+
#### Permission 옵션
|
|
527
|
+
|
|
528
|
+
에이전트가 할 수 있는 작업을 세밀하게 제어합니다:
|
|
529
|
+
|
|
530
|
+
```json
|
|
531
|
+
{
|
|
532
|
+
"agents": {
|
|
533
|
+
"explore": {
|
|
534
|
+
"permission": {
|
|
535
|
+
"edit": "deny",
|
|
536
|
+
"bash": "ask",
|
|
537
|
+
"webfetch": "allow"
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
| Permission | 설명 | 값 |
|
|
545
|
+
|------------|------|-----|
|
|
546
|
+
| `edit` | 파일 편집 권한 | `ask` / `allow` / `deny` |
|
|
547
|
+
| `bash` | Bash 명령 실행 권한 | `ask` / `allow` / `deny` 또는 명령별: `{ "git": "allow", "rm": "deny" }` |
|
|
548
|
+
| `webfetch` | 웹 요청 권한 | `ask` / `allow` / `deny` |
|
|
549
|
+
| `doom_loop` | 무한 루프 감지 오버라이드 허용 | `ask` / `allow` / `deny` |
|
|
550
|
+
| `external_directory` | 프로젝트 루트 외부 파일 접근 | `ask` / `allow` / `deny` |
|
|
551
|
+
|
|
519
552
|
또는 ~/.config/opencode/oh-my-opencode.json 혹은 .opencode/oh-my-opencode.json 의 `disabled_agents` 를 사용하여 비활성화할 수 있습니다:
|
|
520
553
|
|
|
521
554
|
```json
|
|
@@ -528,19 +561,42 @@ Google Gemini 모델을 위한 내장 Antigravity OAuth를 활성화합니다:
|
|
|
528
561
|
|
|
529
562
|
### OmO Agent
|
|
530
563
|
|
|
531
|
-
|
|
564
|
+
활성화 시(기본값), OmO는 두 개의 primary 에이전트를 추가하고 내장 에이전트를 subagent로 강등합니다:
|
|
565
|
+
|
|
566
|
+
- **OmO**: Primary 오케스트레이터 에이전트 (Claude Opus 4.5)
|
|
567
|
+
- **OmO-Plan**: OpenCode plan 에이전트의 모든 설정을 런타임에 상속 (description에 "OhMyOpenCode version" 추가)
|
|
568
|
+
- **build**: subagent로 강등
|
|
569
|
+
- **plan**: subagent로 강등
|
|
570
|
+
|
|
571
|
+
OmO를 비활성화하고 원래 build/plan 에이전트를 복원하려면:
|
|
532
572
|
|
|
533
573
|
```json
|
|
534
574
|
{
|
|
535
575
|
"omo_agent": {
|
|
536
|
-
"
|
|
576
|
+
"disabled": true
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
다른 에이전트처럼 OmO와 OmO-Plan도 커스터마이징할 수 있습니다:
|
|
582
|
+
|
|
583
|
+
```json
|
|
584
|
+
{
|
|
585
|
+
"agents": {
|
|
586
|
+
"OmO": {
|
|
587
|
+
"model": "anthropic/claude-sonnet-4",
|
|
588
|
+
"temperature": 0.3
|
|
589
|
+
},
|
|
590
|
+
"OmO-Plan": {
|
|
591
|
+
"model": "openai/gpt-5.2"
|
|
592
|
+
}
|
|
537
593
|
}
|
|
538
594
|
}
|
|
539
595
|
```
|
|
540
596
|
|
|
541
597
|
| 옵션 | 기본값 | 설명 |
|
|
542
598
|
|------|--------|------|
|
|
543
|
-
| `
|
|
599
|
+
| `disabled` | `false` | `true`면 OmO 에이전트를 비활성화하고 원래 build/plan을 primary로 복원합니다. `false`(기본값)면 OmO와 OmO-Plan이 primary 에이전트가 됩니다. |
|
|
544
600
|
|
|
545
601
|
### Hooks
|
|
546
602
|
|
|
@@ -552,7 +608,7 @@ Google Gemini 모델을 위한 내장 Antigravity OAuth를 활성화합니다:
|
|
|
552
608
|
}
|
|
553
609
|
```
|
|
554
610
|
|
|
555
|
-
사용 가능한 훅: `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`
|
|
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`
|
|
556
612
|
|
|
557
613
|
### MCPs
|
|
558
614
|
|
package/README.md
CHANGED
|
@@ -467,7 +467,12 @@ When agents thrive, you thrive. But I want to help you directly too.
|
|
|
467
467
|
- **Anthropic Auto Compact**: When Claude models hit token limits, automatically summarizes and compacts the session—no manual intervention needed.
|
|
468
468
|
- **Session Recovery**: Automatically recovers from session errors (missing tool results, thinking block issues, empty messages). Sessions don't crash mid-run. Even if they do, they recover.
|
|
469
469
|
- **Auto Update Checker**: Notifies you when a new version of oh-my-opencode is available.
|
|
470
|
+
- **Startup Toast**: Shows a welcome message when OhMyOpenCode loads. A little "oMoMoMo" to start your session right.
|
|
470
471
|
- **Background Notification**: Get notified when background agent tasks complete.
|
|
472
|
+
- **Session Notification**: Sends OS notifications when agents go idle. Works on macOS, Linux, and Windows—never miss when your agent needs input.
|
|
473
|
+
- **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.
|
|
474
|
+
- **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
|
+
- **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.
|
|
471
476
|
|
|
472
477
|
## Configuration
|
|
473
478
|
|
|
@@ -517,6 +522,34 @@ Override built-in agent settings:
|
|
|
517
522
|
|
|
518
523
|
Each agent supports: `model`, `temperature`, `top_p`, `prompt`, `tools`, `disable`, `description`, `mode`, `color`, `permission`.
|
|
519
524
|
|
|
525
|
+
You can also override settings for `OmO` (the main orchestrator) and `build` (the default agent) using the same options.
|
|
526
|
+
|
|
527
|
+
#### Permission Options
|
|
528
|
+
|
|
529
|
+
Fine-grained control over what agents can do:
|
|
530
|
+
|
|
531
|
+
```json
|
|
532
|
+
{
|
|
533
|
+
"agents": {
|
|
534
|
+
"explore": {
|
|
535
|
+
"permission": {
|
|
536
|
+
"edit": "deny",
|
|
537
|
+
"bash": "ask",
|
|
538
|
+
"webfetch": "allow"
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
| Permission | Description | Values |
|
|
546
|
+
|------------|-------------|--------|
|
|
547
|
+
| `edit` | File editing permission | `ask` / `allow` / `deny` |
|
|
548
|
+
| `bash` | Bash command execution | `ask` / `allow` / `deny` or per-command: `{ "git": "allow", "rm": "deny" }` |
|
|
549
|
+
| `webfetch` | Web request permission | `ask` / `allow` / `deny` |
|
|
550
|
+
| `doom_loop` | Allow infinite loop detection override | `ask` / `allow` / `deny` |
|
|
551
|
+
| `external_directory` | Access files outside project root | `ask` / `allow` / `deny` |
|
|
552
|
+
|
|
520
553
|
Or disable via `disabled_agents` in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`:
|
|
521
554
|
|
|
522
555
|
```json
|
|
@@ -529,19 +562,42 @@ Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, `
|
|
|
529
562
|
|
|
530
563
|
### OmO Agent
|
|
531
564
|
|
|
532
|
-
|
|
565
|
+
When enabled (default), OmO adds two primary agents and demotes the built-in agents to subagents:
|
|
566
|
+
|
|
567
|
+
- **OmO**: Primary orchestrator agent (Claude Opus 4.5)
|
|
568
|
+
- **OmO-Plan**: Inherits all settings from OpenCode's plan agent at runtime (description appended with "OhMyOpenCode version")
|
|
569
|
+
- **build**: Demoted to subagent
|
|
570
|
+
- **plan**: Demoted to subagent
|
|
571
|
+
|
|
572
|
+
To disable OmO and restore the original build/plan agents:
|
|
533
573
|
|
|
534
574
|
```json
|
|
535
575
|
{
|
|
536
576
|
"omo_agent": {
|
|
537
|
-
"
|
|
577
|
+
"disabled": true
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
You can also customize OmO and OmO-Plan like other agents:
|
|
583
|
+
|
|
584
|
+
```json
|
|
585
|
+
{
|
|
586
|
+
"agents": {
|
|
587
|
+
"OmO": {
|
|
588
|
+
"model": "anthropic/claude-sonnet-4",
|
|
589
|
+
"temperature": 0.3
|
|
590
|
+
},
|
|
591
|
+
"OmO-Plan": {
|
|
592
|
+
"model": "openai/gpt-5.2"
|
|
593
|
+
}
|
|
538
594
|
}
|
|
539
595
|
}
|
|
540
596
|
```
|
|
541
597
|
|
|
542
598
|
| Option | Default | Description |
|
|
543
599
|
|--------|---------|-------------|
|
|
544
|
-
| `
|
|
600
|
+
| `disabled` | `false` | When `true`, disables OmO agents and restores original build/plan as primary. When `false` (default), OmO and OmO-Plan become primary agents. |
|
|
545
601
|
|
|
546
602
|
### Hooks
|
|
547
603
|
|
|
@@ -553,7 +609,7 @@ Disable specific built-in hooks via `disabled_hooks` in `~/.config/opencode/oh-m
|
|
|
553
609
|
}
|
|
554
610
|
```
|
|
555
611
|
|
|
556
|
-
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`
|
|
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`
|
|
557
613
|
|
|
558
614
|
### MCPs
|
|
559
615
|
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export declare const OverridableAgentNameSchema: z.ZodEnum<{
|
|
|
17
17
|
"document-writer": "document-writer";
|
|
18
18
|
"multimodal-looker": "multimodal-looker";
|
|
19
19
|
build: "build";
|
|
20
|
+
plan: "plan";
|
|
21
|
+
"OmO-Plan": "OmO-Plan";
|
|
20
22
|
}>;
|
|
21
23
|
export declare const AgentNameSchema: z.ZodEnum<{
|
|
22
24
|
OmO: "OmO";
|
|
@@ -31,6 +33,7 @@ export declare const HookNameSchema: z.ZodEnum<{
|
|
|
31
33
|
"comment-checker": "comment-checker";
|
|
32
34
|
"rules-injector": "rules-injector";
|
|
33
35
|
"agent-usage-reminder": "agent-usage-reminder";
|
|
36
|
+
"non-interactive-env": "non-interactive-env";
|
|
34
37
|
"todo-continuation-enforcer": "todo-continuation-enforcer";
|
|
35
38
|
"context-window-monitor": "context-window-monitor";
|
|
36
39
|
"session-recovery": "session-recovery";
|
|
@@ -140,6 +143,52 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
140
143
|
}>>;
|
|
141
144
|
}, z.core.$strip>>;
|
|
142
145
|
}, z.core.$strip>>;
|
|
146
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
model: z.ZodOptional<z.ZodString>;
|
|
148
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
151
|
+
tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
152
|
+
disable: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
+
description: z.ZodOptional<z.ZodString>;
|
|
154
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
155
|
+
subagent: "subagent";
|
|
156
|
+
primary: "primary";
|
|
157
|
+
all: "all";
|
|
158
|
+
}>>;
|
|
159
|
+
color: z.ZodOptional<z.ZodString>;
|
|
160
|
+
permission: z.ZodOptional<z.ZodObject<{
|
|
161
|
+
edit: z.ZodOptional<z.ZodEnum<{
|
|
162
|
+
allow: "allow";
|
|
163
|
+
deny: "deny";
|
|
164
|
+
ask: "ask";
|
|
165
|
+
}>>;
|
|
166
|
+
bash: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
167
|
+
allow: "allow";
|
|
168
|
+
deny: "deny";
|
|
169
|
+
ask: "ask";
|
|
170
|
+
}>, z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
171
|
+
allow: "allow";
|
|
172
|
+
deny: "deny";
|
|
173
|
+
ask: "ask";
|
|
174
|
+
}>>]>>;
|
|
175
|
+
webfetch: z.ZodOptional<z.ZodEnum<{
|
|
176
|
+
allow: "allow";
|
|
177
|
+
deny: "deny";
|
|
178
|
+
ask: "ask";
|
|
179
|
+
}>>;
|
|
180
|
+
doom_loop: z.ZodOptional<z.ZodEnum<{
|
|
181
|
+
allow: "allow";
|
|
182
|
+
deny: "deny";
|
|
183
|
+
ask: "ask";
|
|
184
|
+
}>>;
|
|
185
|
+
external_directory: z.ZodOptional<z.ZodEnum<{
|
|
186
|
+
allow: "allow";
|
|
187
|
+
deny: "deny";
|
|
188
|
+
ask: "ask";
|
|
189
|
+
}>>;
|
|
190
|
+
}, z.core.$strip>>;
|
|
191
|
+
}, z.core.$strip>>;
|
|
143
192
|
OmO: z.ZodOptional<z.ZodObject<{
|
|
144
193
|
model: z.ZodOptional<z.ZodString>;
|
|
145
194
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -186,6 +235,52 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
186
235
|
}>>;
|
|
187
236
|
}, z.core.$strip>>;
|
|
188
237
|
}, z.core.$strip>>;
|
|
238
|
+
"OmO-Plan": z.ZodOptional<z.ZodObject<{
|
|
239
|
+
model: z.ZodOptional<z.ZodString>;
|
|
240
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
243
|
+
tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
244
|
+
disable: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
+
description: z.ZodOptional<z.ZodString>;
|
|
246
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
247
|
+
subagent: "subagent";
|
|
248
|
+
primary: "primary";
|
|
249
|
+
all: "all";
|
|
250
|
+
}>>;
|
|
251
|
+
color: z.ZodOptional<z.ZodString>;
|
|
252
|
+
permission: z.ZodOptional<z.ZodObject<{
|
|
253
|
+
edit: z.ZodOptional<z.ZodEnum<{
|
|
254
|
+
allow: "allow";
|
|
255
|
+
deny: "deny";
|
|
256
|
+
ask: "ask";
|
|
257
|
+
}>>;
|
|
258
|
+
bash: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
259
|
+
allow: "allow";
|
|
260
|
+
deny: "deny";
|
|
261
|
+
ask: "ask";
|
|
262
|
+
}>, z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
263
|
+
allow: "allow";
|
|
264
|
+
deny: "deny";
|
|
265
|
+
ask: "ask";
|
|
266
|
+
}>>]>>;
|
|
267
|
+
webfetch: z.ZodOptional<z.ZodEnum<{
|
|
268
|
+
allow: "allow";
|
|
269
|
+
deny: "deny";
|
|
270
|
+
ask: "ask";
|
|
271
|
+
}>>;
|
|
272
|
+
doom_loop: z.ZodOptional<z.ZodEnum<{
|
|
273
|
+
allow: "allow";
|
|
274
|
+
deny: "deny";
|
|
275
|
+
ask: "ask";
|
|
276
|
+
}>>;
|
|
277
|
+
external_directory: z.ZodOptional<z.ZodEnum<{
|
|
278
|
+
allow: "allow";
|
|
279
|
+
deny: "deny";
|
|
280
|
+
ask: "ask";
|
|
281
|
+
}>>;
|
|
282
|
+
}, z.core.$strip>>;
|
|
283
|
+
}, z.core.$strip>>;
|
|
189
284
|
oracle: z.ZodOptional<z.ZodObject<{
|
|
190
285
|
model: z.ZodOptional<z.ZodString>;
|
|
191
286
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -471,7 +566,7 @@ export declare const ClaudeCodeConfigSchema: z.ZodObject<{
|
|
|
471
566
|
hooks: z.ZodOptional<z.ZodBoolean>;
|
|
472
567
|
}, z.core.$strip>;
|
|
473
568
|
export declare const OmoAgentConfigSchema: z.ZodObject<{
|
|
474
|
-
|
|
569
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
475
570
|
}, z.core.$strip>;
|
|
476
571
|
export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
477
572
|
$schema: z.ZodOptional<z.ZodString>;
|
|
@@ -493,6 +588,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
493
588
|
"comment-checker": "comment-checker";
|
|
494
589
|
"rules-injector": "rules-injector";
|
|
495
590
|
"agent-usage-reminder": "agent-usage-reminder";
|
|
591
|
+
"non-interactive-env": "non-interactive-env";
|
|
496
592
|
"todo-continuation-enforcer": "todo-continuation-enforcer";
|
|
497
593
|
"context-window-monitor": "context-window-monitor";
|
|
498
594
|
"session-recovery": "session-recovery";
|
|
@@ -556,6 +652,52 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
556
652
|
}>>;
|
|
557
653
|
}, z.core.$strip>>;
|
|
558
654
|
}, z.core.$strip>>;
|
|
655
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
656
|
+
model: z.ZodOptional<z.ZodString>;
|
|
657
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
658
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
659
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
660
|
+
tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
661
|
+
disable: z.ZodOptional<z.ZodBoolean>;
|
|
662
|
+
description: z.ZodOptional<z.ZodString>;
|
|
663
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
664
|
+
subagent: "subagent";
|
|
665
|
+
primary: "primary";
|
|
666
|
+
all: "all";
|
|
667
|
+
}>>;
|
|
668
|
+
color: z.ZodOptional<z.ZodString>;
|
|
669
|
+
permission: z.ZodOptional<z.ZodObject<{
|
|
670
|
+
edit: z.ZodOptional<z.ZodEnum<{
|
|
671
|
+
allow: "allow";
|
|
672
|
+
deny: "deny";
|
|
673
|
+
ask: "ask";
|
|
674
|
+
}>>;
|
|
675
|
+
bash: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
676
|
+
allow: "allow";
|
|
677
|
+
deny: "deny";
|
|
678
|
+
ask: "ask";
|
|
679
|
+
}>, z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
680
|
+
allow: "allow";
|
|
681
|
+
deny: "deny";
|
|
682
|
+
ask: "ask";
|
|
683
|
+
}>>]>>;
|
|
684
|
+
webfetch: z.ZodOptional<z.ZodEnum<{
|
|
685
|
+
allow: "allow";
|
|
686
|
+
deny: "deny";
|
|
687
|
+
ask: "ask";
|
|
688
|
+
}>>;
|
|
689
|
+
doom_loop: z.ZodOptional<z.ZodEnum<{
|
|
690
|
+
allow: "allow";
|
|
691
|
+
deny: "deny";
|
|
692
|
+
ask: "ask";
|
|
693
|
+
}>>;
|
|
694
|
+
external_directory: z.ZodOptional<z.ZodEnum<{
|
|
695
|
+
allow: "allow";
|
|
696
|
+
deny: "deny";
|
|
697
|
+
ask: "ask";
|
|
698
|
+
}>>;
|
|
699
|
+
}, z.core.$strip>>;
|
|
700
|
+
}, z.core.$strip>>;
|
|
559
701
|
OmO: z.ZodOptional<z.ZodObject<{
|
|
560
702
|
model: z.ZodOptional<z.ZodString>;
|
|
561
703
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -602,6 +744,52 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
602
744
|
}>>;
|
|
603
745
|
}, z.core.$strip>>;
|
|
604
746
|
}, z.core.$strip>>;
|
|
747
|
+
"OmO-Plan": z.ZodOptional<z.ZodObject<{
|
|
748
|
+
model: z.ZodOptional<z.ZodString>;
|
|
749
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
750
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
751
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
752
|
+
tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
753
|
+
disable: z.ZodOptional<z.ZodBoolean>;
|
|
754
|
+
description: z.ZodOptional<z.ZodString>;
|
|
755
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
756
|
+
subagent: "subagent";
|
|
757
|
+
primary: "primary";
|
|
758
|
+
all: "all";
|
|
759
|
+
}>>;
|
|
760
|
+
color: z.ZodOptional<z.ZodString>;
|
|
761
|
+
permission: z.ZodOptional<z.ZodObject<{
|
|
762
|
+
edit: z.ZodOptional<z.ZodEnum<{
|
|
763
|
+
allow: "allow";
|
|
764
|
+
deny: "deny";
|
|
765
|
+
ask: "ask";
|
|
766
|
+
}>>;
|
|
767
|
+
bash: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
768
|
+
allow: "allow";
|
|
769
|
+
deny: "deny";
|
|
770
|
+
ask: "ask";
|
|
771
|
+
}>, z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
772
|
+
allow: "allow";
|
|
773
|
+
deny: "deny";
|
|
774
|
+
ask: "ask";
|
|
775
|
+
}>>]>>;
|
|
776
|
+
webfetch: z.ZodOptional<z.ZodEnum<{
|
|
777
|
+
allow: "allow";
|
|
778
|
+
deny: "deny";
|
|
779
|
+
ask: "ask";
|
|
780
|
+
}>>;
|
|
781
|
+
doom_loop: z.ZodOptional<z.ZodEnum<{
|
|
782
|
+
allow: "allow";
|
|
783
|
+
deny: "deny";
|
|
784
|
+
ask: "ask";
|
|
785
|
+
}>>;
|
|
786
|
+
external_directory: z.ZodOptional<z.ZodEnum<{
|
|
787
|
+
allow: "allow";
|
|
788
|
+
deny: "deny";
|
|
789
|
+
ask: "ask";
|
|
790
|
+
}>>;
|
|
791
|
+
}, z.core.$strip>>;
|
|
792
|
+
}, z.core.$strip>>;
|
|
605
793
|
oracle: z.ZodOptional<z.ZodObject<{
|
|
606
794
|
model: z.ZodOptional<z.ZodString>;
|
|
607
795
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -888,7 +1076,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
888
1076
|
}, z.core.$strip>>;
|
|
889
1077
|
google_auth: z.ZodOptional<z.ZodBoolean>;
|
|
890
1078
|
omo_agent: z.ZodOptional<z.ZodObject<{
|
|
891
|
-
|
|
1079
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
892
1080
|
}, z.core.$strip>>;
|
|
893
1081
|
}, z.core.$strip>;
|
|
894
1082
|
export type OhMyOpenCodeConfig = z.infer<typeof OhMyOpenCodeConfigSchema>;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export { createBackgroundNotificationHook } from "./background-notification";
|
|
|
16
16
|
export { createAutoUpdateCheckerHook } from "./auto-update-checker";
|
|
17
17
|
export { createAgentUsageReminderHook } from "./agent-usage-reminder";
|
|
18
18
|
export { createKeywordDetectorHook } from "./keyword-detector";
|
|
19
|
+
export { createNonInteractiveEnvHook } from "./non-interactive-env";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export * from "./constants";
|
|
3
|
+
export * from "./types";
|
|
4
|
+
export declare function createNonInteractiveEnvHook(_ctx: PluginInput): {
|
|
5
|
+
"tool.execute.before": (input: {
|
|
6
|
+
tool: string;
|
|
7
|
+
sessionID: string;
|
|
8
|
+
callID: string;
|
|
9
|
+
}, output: {
|
|
10
|
+
args: Record<string, unknown>;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
};
|
|
@@ -10,6 +10,7 @@ export declare function findEmptyMessages(sessionID: string): string[];
|
|
|
10
10
|
export declare function findEmptyMessageByIndex(sessionID: string, targetIndex: number): string | null;
|
|
11
11
|
export declare function findFirstEmptyMessage(sessionID: string): string | null;
|
|
12
12
|
export declare function findMessagesWithThinkingBlocks(sessionID: string): string[];
|
|
13
|
+
export declare function findMessagesWithThinkingOnly(sessionID: string): string[];
|
|
13
14
|
export declare function findMessagesWithOrphanThinking(sessionID: string): string[];
|
|
14
15
|
export declare function prependThinkingPart(sessionID: string, messageID: string): boolean;
|
|
15
16
|
export declare function stripThinkingParts(messageID: string): boolean;
|
package/dist/index.js
CHANGED
|
@@ -1839,41 +1839,6 @@ var omoAgent = {
|
|
|
1839
1839
|
budgetTokens: 32000
|
|
1840
1840
|
},
|
|
1841
1841
|
maxTokens: 128000,
|
|
1842
|
-
tools: {
|
|
1843
|
-
read: true,
|
|
1844
|
-
write: true,
|
|
1845
|
-
edit: true,
|
|
1846
|
-
multiedit: true,
|
|
1847
|
-
patch: true,
|
|
1848
|
-
glob: true,
|
|
1849
|
-
grep: true,
|
|
1850
|
-
list: true,
|
|
1851
|
-
bash: true,
|
|
1852
|
-
batch: true,
|
|
1853
|
-
webfetch: true,
|
|
1854
|
-
websearch: true,
|
|
1855
|
-
codesearch: true,
|
|
1856
|
-
todowrite: true,
|
|
1857
|
-
todoread: true,
|
|
1858
|
-
task: true,
|
|
1859
|
-
lsp_hover: true,
|
|
1860
|
-
lsp_goto_definition: true,
|
|
1861
|
-
lsp_find_references: true,
|
|
1862
|
-
lsp_document_symbols: true,
|
|
1863
|
-
lsp_workspace_symbols: true,
|
|
1864
|
-
lsp_diagnostics: true,
|
|
1865
|
-
lsp_rename: true,
|
|
1866
|
-
lsp_prepare_rename: true,
|
|
1867
|
-
lsp_code_actions: true,
|
|
1868
|
-
lsp_code_action_resolve: true,
|
|
1869
|
-
lsp_servers: true,
|
|
1870
|
-
ast_grep_search: true,
|
|
1871
|
-
ast_grep_replace: true,
|
|
1872
|
-
skill: true,
|
|
1873
|
-
call_omo_agent: true,
|
|
1874
|
-
background_task: true,
|
|
1875
|
-
background_output: true
|
|
1876
|
-
},
|
|
1877
1842
|
prompt: OMO_SYSTEM_PROMPT,
|
|
1878
1843
|
color: "#00CED1"
|
|
1879
1844
|
};
|
|
@@ -3601,7 +3566,7 @@ async function sendNotification(ctx, p, title, message) {
|
|
|
3601
3566
|
await ctx.$`osascript -e ${'display notification "' + escapedMessage + '" with title "' + escapedTitle + '"'}`;
|
|
3602
3567
|
break;
|
|
3603
3568
|
case "linux":
|
|
3604
|
-
await ctx.$`notify-send ${escapedTitle} ${escapedMessage}
|
|
3569
|
+
await ctx.$`notify-send ${escapedTitle} ${escapedMessage}`.catch(() => {});
|
|
3605
3570
|
break;
|
|
3606
3571
|
case "win32":
|
|
3607
3572
|
await ctx.$`powershell -Command ${"[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('" + escapedMessage + "', '" + escapedTitle + "')"}`;
|
|
@@ -3914,7 +3879,7 @@ function findEmptyMessages(sessionID) {
|
|
|
3914
3879
|
}
|
|
3915
3880
|
function findEmptyMessageByIndex(sessionID, targetIndex) {
|
|
3916
3881
|
const messages = readMessages(sessionID);
|
|
3917
|
-
const indicesToTry = [targetIndex, targetIndex - 1];
|
|
3882
|
+
const indicesToTry = [targetIndex, targetIndex - 1, targetIndex - 2];
|
|
3918
3883
|
for (const idx of indicesToTry) {
|
|
3919
3884
|
if (idx < 0 || idx >= messages.length)
|
|
3920
3885
|
continue;
|
|
@@ -3939,6 +3904,23 @@ function findMessagesWithThinkingBlocks(sessionID) {
|
|
|
3939
3904
|
}
|
|
3940
3905
|
return result;
|
|
3941
3906
|
}
|
|
3907
|
+
function findMessagesWithThinkingOnly(sessionID) {
|
|
3908
|
+
const messages = readMessages(sessionID);
|
|
3909
|
+
const result = [];
|
|
3910
|
+
for (const msg of messages) {
|
|
3911
|
+
if (msg.role !== "assistant")
|
|
3912
|
+
continue;
|
|
3913
|
+
const parts = readParts(msg.id);
|
|
3914
|
+
if (parts.length === 0)
|
|
3915
|
+
continue;
|
|
3916
|
+
const hasThinking = parts.some((p) => THINKING_TYPES.has(p.type));
|
|
3917
|
+
const hasTextContent = parts.some(hasContent);
|
|
3918
|
+
if (hasThinking && !hasTextContent) {
|
|
3919
|
+
result.push(msg.id);
|
|
3920
|
+
}
|
|
3921
|
+
}
|
|
3922
|
+
return result;
|
|
3923
|
+
}
|
|
3942
3924
|
function findMessagesWithOrphanThinking(sessionID) {
|
|
3943
3925
|
const messages = readMessages(sessionID);
|
|
3944
3926
|
const result = [];
|
|
@@ -4107,24 +4089,29 @@ async function recoverThinkingDisabledViolation(_client, sessionID, _failedAssis
|
|
|
4107
4089
|
}
|
|
4108
4090
|
return anySuccess;
|
|
4109
4091
|
}
|
|
4092
|
+
var PLACEHOLDER_TEXT = "[user interrupted]";
|
|
4110
4093
|
async function recoverEmptyContentMessage(_client, sessionID, failedAssistantMsg, _directory, error) {
|
|
4111
4094
|
const targetIndex = extractMessageIndex(error);
|
|
4112
4095
|
const failedID = failedAssistantMsg.info?.id;
|
|
4096
|
+
const thinkingOnlyIDs = findMessagesWithThinkingOnly(sessionID);
|
|
4097
|
+
for (const messageID of thinkingOnlyIDs) {
|
|
4098
|
+
injectTextPart(sessionID, messageID, PLACEHOLDER_TEXT);
|
|
4099
|
+
}
|
|
4113
4100
|
if (targetIndex !== null) {
|
|
4114
4101
|
const targetMessageID = findEmptyMessageByIndex(sessionID, targetIndex);
|
|
4115
4102
|
if (targetMessageID) {
|
|
4116
|
-
return injectTextPart(sessionID, targetMessageID,
|
|
4103
|
+
return injectTextPart(sessionID, targetMessageID, PLACEHOLDER_TEXT);
|
|
4117
4104
|
}
|
|
4118
4105
|
}
|
|
4119
4106
|
if (failedID) {
|
|
4120
|
-
if (injectTextPart(sessionID, failedID,
|
|
4107
|
+
if (injectTextPart(sessionID, failedID, PLACEHOLDER_TEXT)) {
|
|
4121
4108
|
return true;
|
|
4122
4109
|
}
|
|
4123
4110
|
}
|
|
4124
4111
|
const emptyMessageIDs = findEmptyMessages(sessionID);
|
|
4125
|
-
let anySuccess =
|
|
4112
|
+
let anySuccess = thinkingOnlyIDs.length > 0;
|
|
4126
4113
|
for (const messageID of emptyMessageIDs) {
|
|
4127
|
-
if (injectTextPart(sessionID, messageID,
|
|
4114
|
+
if (injectTextPart(sessionID, messageID, PLACEHOLDER_TEXT)) {
|
|
4128
4115
|
anySuccess = true;
|
|
4129
4116
|
}
|
|
4130
4117
|
}
|
|
@@ -7014,17 +7001,25 @@ function getUserConfigDir() {
|
|
|
7014
7001
|
}
|
|
7015
7002
|
var USER_CONFIG_DIR = getUserConfigDir();
|
|
7016
7003
|
var USER_OPENCODE_CONFIG = path3.join(USER_CONFIG_DIR, "opencode", "opencode.json");
|
|
7004
|
+
var USER_OPENCODE_CONFIG_JSONC = path3.join(USER_CONFIG_DIR, "opencode", "opencode.jsonc");
|
|
7017
7005
|
|
|
7018
7006
|
// src/hooks/auto-update-checker/checker.ts
|
|
7019
7007
|
function isLocalDevMode(directory) {
|
|
7020
7008
|
return getLocalDevPath(directory) !== null;
|
|
7021
7009
|
}
|
|
7022
7010
|
function stripJsonComments(json) {
|
|
7023
|
-
return json.replace(
|
|
7011
|
+
return json.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (m, g) => g ? "" : m).replace(/,(\s*[}\]])/g, "$1");
|
|
7012
|
+
}
|
|
7013
|
+
function getConfigPaths(directory) {
|
|
7014
|
+
return [
|
|
7015
|
+
path4.join(directory, ".opencode", "opencode.json"),
|
|
7016
|
+
path4.join(directory, ".opencode", "opencode.jsonc"),
|
|
7017
|
+
USER_OPENCODE_CONFIG,
|
|
7018
|
+
USER_OPENCODE_CONFIG_JSONC
|
|
7019
|
+
];
|
|
7024
7020
|
}
|
|
7025
7021
|
function getLocalDevPath(directory) {
|
|
7026
|
-
const
|
|
7027
|
-
for (const configPath of [projectConfig, USER_OPENCODE_CONFIG]) {
|
|
7022
|
+
for (const configPath of getConfigPaths(directory)) {
|
|
7028
7023
|
try {
|
|
7029
7024
|
if (!fs4.existsSync(configPath))
|
|
7030
7025
|
continue;
|
|
@@ -7033,7 +7028,11 @@ function getLocalDevPath(directory) {
|
|
|
7033
7028
|
const plugins = config.plugin ?? [];
|
|
7034
7029
|
for (const entry of plugins) {
|
|
7035
7030
|
if (entry.startsWith("file://") && entry.includes(PACKAGE_NAME)) {
|
|
7036
|
-
|
|
7031
|
+
try {
|
|
7032
|
+
return fileURLToPath(entry);
|
|
7033
|
+
} catch {
|
|
7034
|
+
return entry.replace("file://", "");
|
|
7035
|
+
}
|
|
7037
7036
|
}
|
|
7038
7037
|
}
|
|
7039
7038
|
} catch {
|
|
@@ -7080,8 +7079,7 @@ function getLocalDevVersion(directory) {
|
|
|
7080
7079
|
}
|
|
7081
7080
|
}
|
|
7082
7081
|
function findPluginEntry(directory) {
|
|
7083
|
-
const
|
|
7084
|
-
for (const configPath of [projectConfig, USER_OPENCODE_CONFIG]) {
|
|
7082
|
+
for (const configPath of getConfigPaths(directory)) {
|
|
7085
7083
|
try {
|
|
7086
7084
|
if (!fs4.existsSync(configPath))
|
|
7087
7085
|
continue;
|
|
@@ -7455,7 +7453,7 @@ TELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.
|
|
|
7455
7453
|
## WORKFLOW
|
|
7456
7454
|
1. Analyze the request and identify required capabilities
|
|
7457
7455
|
2. Spawn exploration/librarian agents via background_task in PARALLEL (10+ if needed)
|
|
7458
|
-
3. Use
|
|
7456
|
+
3. Always Use Plan agent with gathered context to create detailed work breakdown
|
|
7459
7457
|
4. Execute with continuous verification against original requirements
|
|
7460
7458
|
|
|
7461
7459
|
</ultrawork-mode>
|
|
@@ -7543,6 +7541,38 @@ function createKeywordDetectorHook() {
|
|
|
7543
7541
|
}
|
|
7544
7542
|
};
|
|
7545
7543
|
}
|
|
7544
|
+
// src/hooks/non-interactive-env/constants.ts
|
|
7545
|
+
var HOOK_NAME = "non-interactive-env";
|
|
7546
|
+
var NON_INTERACTIVE_ENV = {
|
|
7547
|
+
CI: "true",
|
|
7548
|
+
DEBIAN_FRONTEND: "noninteractive",
|
|
7549
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
7550
|
+
GCM_INTERACTIVE: "never",
|
|
7551
|
+
HOMEBREW_NO_AUTO_UPDATE: "1"
|
|
7552
|
+
};
|
|
7553
|
+
|
|
7554
|
+
// src/hooks/non-interactive-env/index.ts
|
|
7555
|
+
function createNonInteractiveEnvHook(_ctx) {
|
|
7556
|
+
return {
|
|
7557
|
+
"tool.execute.before": async (input, output) => {
|
|
7558
|
+
if (input.tool.toLowerCase() !== "bash") {
|
|
7559
|
+
return;
|
|
7560
|
+
}
|
|
7561
|
+
const command = output.args.command;
|
|
7562
|
+
if (!command) {
|
|
7563
|
+
return;
|
|
7564
|
+
}
|
|
7565
|
+
output.args.env = {
|
|
7566
|
+
...output.args.env,
|
|
7567
|
+
...NON_INTERACTIVE_ENV
|
|
7568
|
+
};
|
|
7569
|
+
log(`[${HOOK_NAME}] Set non-interactive environment variables`, {
|
|
7570
|
+
sessionID: input.sessionID,
|
|
7571
|
+
env: NON_INTERACTIVE_ENV
|
|
7572
|
+
});
|
|
7573
|
+
}
|
|
7574
|
+
};
|
|
7575
|
+
}
|
|
7546
7576
|
// src/auth/antigravity/constants.ts
|
|
7547
7577
|
var ANTIGRAVITY_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com";
|
|
7548
7578
|
var ANTIGRAVITY_CLIENT_SECRET = "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";
|
|
@@ -9696,7 +9726,7 @@ function loadJsonFile(path6) {
|
|
|
9696
9726
|
return null;
|
|
9697
9727
|
}
|
|
9698
9728
|
}
|
|
9699
|
-
function
|
|
9729
|
+
function getConfigPaths2() {
|
|
9700
9730
|
const cwd = process.cwd();
|
|
9701
9731
|
return {
|
|
9702
9732
|
project: join31(cwd, ".opencode", "oh-my-opencode.json"),
|
|
@@ -9705,7 +9735,7 @@ function getConfigPaths() {
|
|
|
9705
9735
|
};
|
|
9706
9736
|
}
|
|
9707
9737
|
function loadAllConfigs() {
|
|
9708
|
-
const paths =
|
|
9738
|
+
const paths = getConfigPaths2();
|
|
9709
9739
|
const configs = new Map;
|
|
9710
9740
|
const project2 = loadJsonFile(paths.project);
|
|
9711
9741
|
if (project2)
|
|
@@ -20728,10 +20758,10 @@ function _property(property, schema, params) {
|
|
|
20728
20758
|
...normalizeParams(params)
|
|
20729
20759
|
});
|
|
20730
20760
|
}
|
|
20731
|
-
function _mime(
|
|
20761
|
+
function _mime(types11, params) {
|
|
20732
20762
|
return new $ZodCheckMimeType({
|
|
20733
20763
|
check: "mime_type",
|
|
20734
|
-
mime:
|
|
20764
|
+
mime: types11,
|
|
20735
20765
|
...normalizeParams(params)
|
|
20736
20766
|
});
|
|
20737
20767
|
}
|
|
@@ -22641,7 +22671,7 @@ var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
|
|
|
22641
22671
|
ZodType.init(inst, def);
|
|
22642
22672
|
inst.min = (size, params) => inst.check(_minSize(size, params));
|
|
22643
22673
|
inst.max = (size, params) => inst.check(_maxSize(size, params));
|
|
22644
|
-
inst.mime = (
|
|
22674
|
+
inst.mime = (types11, params) => inst.check(_mime(Array.isArray(types11) ? types11 : [types11], params));
|
|
22645
22675
|
});
|
|
22646
22676
|
function file(params) {
|
|
22647
22677
|
return _file(ZodFile, params);
|
|
@@ -25606,7 +25636,9 @@ var BuiltinAgentNameSchema = exports_external.enum([
|
|
|
25606
25636
|
]);
|
|
25607
25637
|
var OverridableAgentNameSchema = exports_external.enum([
|
|
25608
25638
|
"build",
|
|
25639
|
+
"plan",
|
|
25609
25640
|
"OmO",
|
|
25641
|
+
"OmO-Plan",
|
|
25610
25642
|
"oracle",
|
|
25611
25643
|
"librarian",
|
|
25612
25644
|
"explore",
|
|
@@ -25632,7 +25664,8 @@ var HookNameSchema = exports_external.enum([
|
|
|
25632
25664
|
"auto-update-checker",
|
|
25633
25665
|
"startup-toast",
|
|
25634
25666
|
"keyword-detector",
|
|
25635
|
-
"agent-usage-reminder"
|
|
25667
|
+
"agent-usage-reminder",
|
|
25668
|
+
"non-interactive-env"
|
|
25636
25669
|
]);
|
|
25637
25670
|
var AgentOverrideConfigSchema = exports_external.object({
|
|
25638
25671
|
model: exports_external.string().optional(),
|
|
@@ -25648,7 +25681,9 @@ var AgentOverrideConfigSchema = exports_external.object({
|
|
|
25648
25681
|
});
|
|
25649
25682
|
var AgentOverridesSchema = exports_external.object({
|
|
25650
25683
|
build: AgentOverrideConfigSchema.optional(),
|
|
25684
|
+
plan: AgentOverrideConfigSchema.optional(),
|
|
25651
25685
|
OmO: AgentOverrideConfigSchema.optional(),
|
|
25686
|
+
"OmO-Plan": AgentOverrideConfigSchema.optional(),
|
|
25652
25687
|
oracle: AgentOverrideConfigSchema.optional(),
|
|
25653
25688
|
librarian: AgentOverrideConfigSchema.optional(),
|
|
25654
25689
|
explore: AgentOverrideConfigSchema.optional(),
|
|
@@ -25664,7 +25699,7 @@ var ClaudeCodeConfigSchema = exports_external.object({
|
|
|
25664
25699
|
hooks: exports_external.boolean().optional()
|
|
25665
25700
|
});
|
|
25666
25701
|
var OmoAgentConfigSchema = exports_external.object({
|
|
25667
|
-
|
|
25702
|
+
disabled: exports_external.boolean().optional()
|
|
25668
25703
|
});
|
|
25669
25704
|
var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
25670
25705
|
$schema: exports_external.string().optional(),
|
|
@@ -25686,11 +25721,32 @@ function getUserConfigDir2() {
|
|
|
25686
25721
|
}
|
|
25687
25722
|
return process.env.XDG_CONFIG_HOME || path6.join(os4.homedir(), ".config");
|
|
25688
25723
|
}
|
|
25724
|
+
var AGENT_NAME_MAP = {
|
|
25725
|
+
omo: "OmO",
|
|
25726
|
+
build: "build",
|
|
25727
|
+
oracle: "oracle",
|
|
25728
|
+
librarian: "librarian",
|
|
25729
|
+
explore: "explore",
|
|
25730
|
+
"frontend-ui-ux-engineer": "frontend-ui-ux-engineer",
|
|
25731
|
+
"document-writer": "document-writer",
|
|
25732
|
+
"multimodal-looker": "multimodal-looker"
|
|
25733
|
+
};
|
|
25734
|
+
function normalizeAgentNames(agents) {
|
|
25735
|
+
const normalized = {};
|
|
25736
|
+
for (const [key, value] of Object.entries(agents)) {
|
|
25737
|
+
const normalizedKey = AGENT_NAME_MAP[key.toLowerCase()] ?? key;
|
|
25738
|
+
normalized[normalizedKey] = value;
|
|
25739
|
+
}
|
|
25740
|
+
return normalized;
|
|
25741
|
+
}
|
|
25689
25742
|
function loadConfigFromPath2(configPath) {
|
|
25690
25743
|
try {
|
|
25691
25744
|
if (fs6.existsSync(configPath)) {
|
|
25692
25745
|
const content = fs6.readFileSync(configPath, "utf-8");
|
|
25693
25746
|
const rawConfig = JSON.parse(content);
|
|
25747
|
+
if (rawConfig.agents && typeof rawConfig.agents === "object") {
|
|
25748
|
+
rawConfig.agents = normalizeAgentNames(rawConfig.agents);
|
|
25749
|
+
}
|
|
25694
25750
|
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
25695
25751
|
if (!result.success) {
|
|
25696
25752
|
log(`Config validation error in ${configPath}:`, result.error.issues);
|
|
@@ -25775,6 +25831,7 @@ var OhMyOpenCodePlugin = async (ctx) => {
|
|
|
25775
25831
|
}) : null;
|
|
25776
25832
|
const keywordDetector = isHookEnabled("keyword-detector") ? createKeywordDetectorHook() : null;
|
|
25777
25833
|
const agentUsageReminder = isHookEnabled("agent-usage-reminder") ? createAgentUsageReminderHook(ctx) : null;
|
|
25834
|
+
const nonInteractiveEnv = isHookEnabled("non-interactive-env") ? createNonInteractiveEnvHook(ctx) : null;
|
|
25778
25835
|
updateTerminalTitle({ sessionId: "main" });
|
|
25779
25836
|
const backgroundManager = new BackgroundManager(ctx);
|
|
25780
25837
|
const backgroundNotificationHook = isHookEnabled("background-notification") ? createBackgroundNotificationHook(backgroundManager) : null;
|
|
@@ -25798,14 +25855,35 @@ var OhMyOpenCodePlugin = async (ctx) => {
|
|
|
25798
25855
|
const builtinAgents = createBuiltinAgents(pluginConfig.disabled_agents, pluginConfig.agents);
|
|
25799
25856
|
const userAgents = pluginConfig.claude_code?.agents ?? true ? loadUserAgents() : {};
|
|
25800
25857
|
const projectAgents = pluginConfig.claude_code?.agents ?? true ? loadProjectAgents() : {};
|
|
25801
|
-
const
|
|
25802
|
-
|
|
25803
|
-
...
|
|
25804
|
-
|
|
25805
|
-
|
|
25806
|
-
|
|
25807
|
-
|
|
25808
|
-
|
|
25858
|
+
const isOmoEnabled = pluginConfig.omo_agent?.disabled !== true;
|
|
25859
|
+
if (isOmoEnabled && builtinAgents.OmO) {
|
|
25860
|
+
const { name: _planName, ...planConfigWithoutName } = config3.agent?.plan ?? {};
|
|
25861
|
+
const omoPlanOverride = pluginConfig.agents?.["OmO-Plan"];
|
|
25862
|
+
const omoPlanBase = {
|
|
25863
|
+
...builtinAgents.OmO,
|
|
25864
|
+
...planConfigWithoutName,
|
|
25865
|
+
description: `${config3.agent?.plan?.description ?? "Plan agent"} (OhMyOpenCode version)`,
|
|
25866
|
+
color: config3.agent?.plan?.color ?? "#6495ED"
|
|
25867
|
+
};
|
|
25868
|
+
const omoPlanConfig = omoPlanOverride ? deepMerge(omoPlanBase, omoPlanOverride) : omoPlanBase;
|
|
25869
|
+
config3.agent = {
|
|
25870
|
+
OmO: builtinAgents.OmO,
|
|
25871
|
+
"OmO-Plan": omoPlanConfig,
|
|
25872
|
+
...Object.fromEntries(Object.entries(builtinAgents).filter(([k]) => k !== "OmO")),
|
|
25873
|
+
...userAgents,
|
|
25874
|
+
...projectAgents,
|
|
25875
|
+
...config3.agent,
|
|
25876
|
+
build: { ...config3.agent?.build, mode: "subagent" },
|
|
25877
|
+
plan: { ...config3.agent?.plan, mode: "subagent" }
|
|
25878
|
+
};
|
|
25879
|
+
} else {
|
|
25880
|
+
config3.agent = {
|
|
25881
|
+
...builtinAgents,
|
|
25882
|
+
...userAgents,
|
|
25883
|
+
...projectAgents,
|
|
25884
|
+
...config3.agent
|
|
25885
|
+
};
|
|
25886
|
+
}
|
|
25809
25887
|
config3.tools = {
|
|
25810
25888
|
...config3.tools
|
|
25811
25889
|
};
|
|
@@ -25946,6 +26024,7 @@ var OhMyOpenCodePlugin = async (ctx) => {
|
|
|
25946
26024
|
},
|
|
25947
26025
|
"tool.execute.before": async (input, output) => {
|
|
25948
26026
|
await claudeCodeHooks["tool.execute.before"](input, output);
|
|
26027
|
+
await nonInteractiveEnv?.["tool.execute.before"](input, output);
|
|
25949
26028
|
await commentChecker?.["tool.execute.before"](input, output);
|
|
25950
26029
|
if (input.sessionID === getMainSessionID()) {
|
|
25951
26030
|
updateTerminalTitle({
|