oh-my-opencode-slim 0.5.3 → 0.5.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.md +83 -23
- package/dist/agents/coder.d.ts +2 -0
- package/dist/agents/designer.d.ts +2 -2
- package/dist/agents/document-writer.d.ts +4 -0
- package/dist/agents/explore.d.ts +2 -0
- package/dist/agents/explorer.d.ts +2 -2
- package/dist/agents/fixer.d.ts +2 -2
- package/dist/agents/frontend.d.ts +2 -0
- package/dist/agents/index.d.ts +5 -5
- package/dist/agents/index.test.d.ts +1 -0
- package/dist/agents/librarian.d.ts +2 -2
- package/dist/agents/multimodal.d.ts +2 -0
- package/dist/agents/oracle.d.ts +2 -2
- package/dist/agents/orchestrator.d.ts +2 -2
- package/dist/agents/planner.d.ts +2 -0
- package/dist/agents/scribe.d.ts +2 -0
- package/dist/agents/simplicity-reviewer.d.ts +4 -0
- package/dist/agents/specialist.d.ts +2 -0
- package/dist/background/background-manager.d.ts +4 -4
- package/dist/background/index.d.ts +2 -2
- package/dist/background/tmux-session-manager.d.ts +2 -2
- package/dist/cli/config-io.d.ts +1 -1
- package/dist/cli/config-manager.d.ts +4 -4
- package/dist/cli/config-manager.test.d.ts +1 -0
- package/dist/cli/index.js +46 -13
- package/dist/cli/install.d.ts +1 -1
- package/dist/cli/providers.d.ts +6 -6
- package/dist/cli/types.d.ts +1 -1
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/plan.d.ts +1 -0
- package/dist/config/constants.d.ts +1 -1
- package/dist/config/index.d.ts +3 -3
- package/dist/config/loader.d.ts +12 -1
- package/dist/config/loader.test.d.ts +1 -0
- package/dist/config/schema.d.ts +2 -2
- package/dist/features/background-manager.d.ts +34 -88
- package/dist/features/background-manager.test.d.ts +1 -0
- package/dist/features/index.d.ts +6 -2
- package/dist/features/tmux-session-manager.d.ts +40 -40
- package/dist/hooks/auto-slash-command/index.d.ts +33 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +1 -1
- package/dist/hooks/auto-update-checker/index.d.ts +3 -3
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/phase-reminder/index.d.ts +1 -1
- package/dist/hooks/plan-mode/index.d.ts +22 -0
- package/dist/hooks/planner-reminder/index.d.ts +25 -0
- package/dist/hooks/post-read-nudge/index.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5212 -5018
- package/dist/mcp/context7.d.ts +1 -1
- package/dist/mcp/grep-app.d.ts +1 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.test.d.ts +1 -0
- package/dist/mcp/types.d.ts +2 -2
- package/dist/mcp/websearch.d.ts +1 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/zip-extractor.d.ts +4 -1
- package/dist/tools/ast-grep/cli.d.ts +1 -1
- package/dist/tools/ast-grep/constants.d.ts +1 -1
- package/dist/tools/ast-grep/index.d.ts +8 -8
- package/dist/tools/ast-grep/napi.d.ts +42 -0
- package/dist/tools/ast-grep/tools.d.ts +1 -1
- package/dist/tools/ast-grep/types.d.ts +1 -1
- package/dist/tools/ast-grep/utils.d.ts +1 -1
- package/dist/tools/background.d.ts +4 -4
- package/dist/tools/call-omo-agent.d.ts +6 -0
- package/dist/tools/grep/cli.d.ts +2 -2
- package/dist/tools/grep/constants.d.ts +1 -1
- package/dist/tools/grep/index.d.ts +5 -5
- package/dist/tools/grep/tools.d.ts +1 -1
- package/dist/tools/grep/utils.d.ts +1 -1
- package/dist/tools/index.d.ts +6 -6
- package/dist/tools/lsp/client.d.ts +1 -1
- package/dist/tools/lsp/config.d.ts +1 -1
- package/dist/tools/lsp/constants.d.ts +2 -2
- package/dist/tools/lsp/index.d.ts +3 -3
- package/dist/tools/lsp/tools.d.ts +1 -1
- package/dist/tools/lsp/types.d.ts +5 -5
- package/dist/tools/lsp/utils.d.ts +4 -4
- package/dist/tools/quota/api.d.ts +1 -1
- package/dist/tools/skill/builtin.d.ts +2 -2
- package/dist/tools/skill/builtin.test.d.ts +1 -0
- package/dist/tools/skill/index.d.ts +3 -3
- package/dist/tools/skill/mcp-manager.d.ts +2 -2
- package/dist/tools/skill/mcp-manager.test.d.ts +1 -0
- package/dist/tools/skill/tools.d.ts +3 -3
- package/dist/tools/skill/types.d.ts +8 -8
- package/dist/utils/agent-variant.d.ts +1 -1
- package/dist/utils/agent-variant.test.d.ts +1 -0
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/session-utils.d.ts +10 -0
- package/dist/utils/session.d.ts +17 -0
- package/dist/utils/tmux.d.ts +1 -1
- package/package.json +6 -1
- package/dist/agents/prompts.d.ts +0 -17
- package/dist/agents/types.d.ts +0 -14
- package/dist/cli/model-mappings.d.ts +0 -25
- package/dist/shared/agent-variant.d.ts +0 -23
- package/dist/shared/binary-downloader.d.ts +0 -14
- package/dist/shared/formatters.d.ts +0 -7
- package/dist/shared/polling.d.ts +0 -23
- package/dist/shared/tmux.d.ts +0 -42
- package/dist/tools/lsp/protocol-parser.d.ts +0 -14
- package/dist/tools/lsp/text-editor.d.ts +0 -13
- package/dist/tools/shared/downloader-utils.d.ts +0 -46
package/README.md
CHANGED
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
- [🔌 **MCP Servers**](#mcp-servers)
|
|
53
53
|
- [⚙️ **Configuration**](#configuration)
|
|
54
54
|
- [Files You Edit](#files-you-edit)
|
|
55
|
+
- [Prompt Overriding](#prompt-overriding)
|
|
55
56
|
- [Plugin Config](#plugin-config-oh-my-opencode-slimjson)
|
|
56
57
|
- [Presets](#presets)
|
|
57
58
|
- [Option Reference](#option-reference)
|
|
@@ -281,38 +282,41 @@ Code implementation, refactoring, testing, verification. *Execute the plan - no
|
|
|
281
282
|
|
|
282
283
|
### Tmux Integration
|
|
283
284
|
|
|
284
|
-
> ⚠️ **
|
|
285
|
+
> ⚠️ **Temporary workaround:** Start OpenCode with `--port` to enable tmux integration. The port must match the `OPENCODE_PORT` environment variable (default: 4096). This is required until the upstream issue is resolved. [opencode#9099](https://github.com/anomalyco/opencode/issues/9099).
|
|
285
286
|
|
|
286
287
|
<img src="img/tmux.png" alt="Tmux Integration" width="800">
|
|
287
288
|
|
|
288
289
|
**Watch your agents work in real-time.** When the Orchestrator launches sub-agents or initiates background tasks, new tmux panes automatically spawn showing each agent's live progress. No more waiting in the dark.
|
|
289
290
|
|
|
290
|
-
####
|
|
291
|
+
#### Quick Setup
|
|
291
292
|
|
|
292
|
-
|
|
293
|
-
|--------------------------|----------------------|
|
|
294
|
-
| Fire off a background task, wait anxiously | See the agent thinking, searching, coding |
|
|
295
|
-
| "Is it stuck or just slow?" | Watch tool calls happen in real-time |
|
|
296
|
-
| Results appear out of nowhere | Follow the journey from question to answer |
|
|
297
|
-
| Debug by guessing | Debug by observation |
|
|
293
|
+
1. **Enable tmux integration** in `oh-my-opencode-slim.json` (see [Plugin Config](#plugin-config-oh-my-opencode-slimjson)).
|
|
298
294
|
|
|
299
|
-
|
|
295
|
+
```json
|
|
296
|
+
{
|
|
297
|
+
"tmux": {
|
|
298
|
+
"enabled": true,
|
|
299
|
+
"layout": "main-vertical",
|
|
300
|
+
"main_pane_size": 60
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
```
|
|
300
304
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
+
2. **Run OpenCode inside tmux**:
|
|
306
|
+
```bash
|
|
307
|
+
tmux
|
|
308
|
+
opencode --port 4096
|
|
309
|
+
```
|
|
305
310
|
|
|
306
|
-
|
|
311
|
+
Or use a custom port (must match `OPENCODE_PORT` env var):
|
|
312
|
+
```bash
|
|
313
|
+
tmux
|
|
314
|
+
export OPENCODE_PORT=5000
|
|
315
|
+
opencode --port 5000
|
|
316
|
+
```
|
|
307
317
|
|
|
308
|
-
|
|
318
|
+
This allows multiple OpenCode instances on different ports.
|
|
309
319
|
|
|
310
|
-
1. **Enable tmux integration** in `oh-my-opencode-slim.json` (see [Plugin Config](#plugin-config-oh-my-opencode-slimjson)).
|
|
311
|
-
2. **Run OpenCode inside tmux with port 4096**:
|
|
312
|
-
```bash
|
|
313
|
-
tmux
|
|
314
|
-
opencode --port 4096
|
|
315
|
-
```
|
|
316
320
|
|
|
317
321
|
#### Layout Options
|
|
318
322
|
|
|
@@ -324,8 +328,6 @@ Code implementation, refactoring, testing, verification. *Execute the plan - no
|
|
|
324
328
|
| `even-horizontal` | All panes side by side |
|
|
325
329
|
| `even-vertical` | All panes stacked vertically |
|
|
326
330
|
|
|
327
|
-
*See the [Option Reference](#option-reference) for detailed configuration.*
|
|
328
|
-
|
|
329
331
|
---
|
|
330
332
|
|
|
331
333
|
### Quota Tool
|
|
@@ -363,6 +365,8 @@ Language Server Protocol integration for code intelligence:
|
|
|
363
365
|
| `lsp_diagnostics` | Get errors/warnings from the language server |
|
|
364
366
|
| `lsp_rename` | Rename a symbol across all files |
|
|
365
367
|
|
|
368
|
+
> **Built-in LSP Servers:** OpenCode includes pre-configured LSP servers for 30+ languages (TypeScript, Python, Rust, Go, etc.). See the [official documentation](https://opencode.ai/docs/lsp/#built-in) for the full list and requirements.
|
|
369
|
+
|
|
366
370
|
---
|
|
367
371
|
|
|
368
372
|
### Code Search Tools
|
|
@@ -377,6 +381,14 @@ Fast code search and refactoring:
|
|
|
377
381
|
|
|
378
382
|
---
|
|
379
383
|
|
|
384
|
+
### Formatters
|
|
385
|
+
|
|
386
|
+
OpenCode automatically formats files after they're written or edited using language-specific formatters.
|
|
387
|
+
|
|
388
|
+
> **Built-in Formatters:** Includes support for Prettier, Biome, gofmt, rustfmt, ruff, and 20+ others. See the [official documentation](https://opencode.ai/docs/formatters/#built-in) for the complete list.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
380
392
|
## 🧩 Skills
|
|
381
393
|
|
|
382
394
|
Skills are specialized capabilities that agents can use. Each agent has a default set of skills, which you can override in the agent config.
|
|
@@ -460,6 +472,37 @@ You can disable specific MCP servers by adding them to the `disabled_mcps` array
|
|
|
460
472
|
|
|
461
473
|
---
|
|
462
474
|
|
|
475
|
+
### Prompt Overriding
|
|
476
|
+
|
|
477
|
+
You can customize agent prompts by creating markdown files in `~/.config/opencode/oh-my-opencode-slim/`:
|
|
478
|
+
|
|
479
|
+
| File | Purpose |
|
|
480
|
+
|------|---------|
|
|
481
|
+
| `{agent}.md` | Replaces the default prompt entirely |
|
|
482
|
+
| `{agent}_append.md` | Appends to the default prompt |
|
|
483
|
+
|
|
484
|
+
**Example:**
|
|
485
|
+
|
|
486
|
+
```
|
|
487
|
+
~/.config/opencode/oh-my-opencode-slim/
|
|
488
|
+
├── orchestrator.md # Custom orchestrator prompt
|
|
489
|
+
├── orchestrator_append.md # Append to default orchestrator prompt
|
|
490
|
+
├── explorer.md
|
|
491
|
+
├── explorer_append.md
|
|
492
|
+
└── ...
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
**Usage:**
|
|
496
|
+
|
|
497
|
+
- Create `{agent}.md` to completely replace an agent's default prompt
|
|
498
|
+
- Create `{agent}_append.md` to add custom instructions to the default prompt
|
|
499
|
+
- Both files can exist simultaneously - the replacement takes precedence
|
|
500
|
+
- If neither file exists, the default prompt is used
|
|
501
|
+
|
|
502
|
+
This allows you to fine-tune agent behavior without modifying the source code.
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
463
506
|
### Plugin Config (`oh-my-opencode-slim.json`)
|
|
464
507
|
|
|
465
508
|
The installer generates this file based on your providers. You can manually customize it to mix and match models.
|
|
@@ -526,6 +569,23 @@ The installer generates presets for different provider combinations. Switch betw
|
|
|
526
569
|
| `zen-free` | Free models (GLM-4.7 + Grok Code) |
|
|
527
570
|
| `antigravity-openai` | Mixed: Antigravity for most agents, OpenAI for Oracle |
|
|
528
571
|
|
|
572
|
+
#### Author's Preset
|
|
573
|
+
|
|
574
|
+
The author's personal configuration using Cerebras for the Orchestrator:
|
|
575
|
+
|
|
576
|
+
```json
|
|
577
|
+
{
|
|
578
|
+
"cerebras": {
|
|
579
|
+
"orchestrator": { "model": "cerebras/zai-glm-4.7", "skills": ["*"] },
|
|
580
|
+
"oracle": { "model": "openai/gpt-5.2-codex", "variant": "high", "skills": [] },
|
|
581
|
+
"librarian": { "model": "google/gemini-3-flash", "variant": "low", "skills": [] },
|
|
582
|
+
"explorer": { "model": "google/gemini-3-flash", "variant": "low", "skills": [] },
|
|
583
|
+
"designer": { "model": "google/gemini-3-flash", "variant": "medium", "skills": ["playwright"] },
|
|
584
|
+
"fixer": { "model": "google/gemini-3-flash", "variant": "low", "skills": [] }
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
```
|
|
588
|
+
|
|
529
589
|
**Environment Variable Override:**
|
|
530
590
|
|
|
531
591
|
You can override the preset using an environment variable:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AgentDefinition } from
|
|
2
|
-
export declare function createDesignerAgent(model: string): AgentDefinition;
|
|
1
|
+
import type { AgentDefinition } from './orchestrator';
|
|
2
|
+
export declare function createDesignerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AgentDefinition } from
|
|
2
|
-
export declare function createExplorerAgent(model: string): AgentDefinition;
|
|
1
|
+
import type { AgentDefinition } from './orchestrator';
|
|
2
|
+
export declare function createExplorerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
package/dist/agents/fixer.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AgentDefinition } from
|
|
2
|
-
export declare function createFixerAgent(model: string): AgentDefinition;
|
|
1
|
+
import type { AgentDefinition } from './orchestrator';
|
|
2
|
+
export declare function createFixerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AgentConfig as SDKAgentConfig } from
|
|
2
|
-
import {
|
|
3
|
-
import { type AgentDefinition } from
|
|
4
|
-
export type { AgentDefinition } from
|
|
5
|
-
export type SubagentName = typeof SUBAGENT_NAMES[number];
|
|
1
|
+
import type { AgentConfig as SDKAgentConfig } from '@opencode-ai/sdk';
|
|
2
|
+
import { type PluginConfig, SUBAGENT_NAMES } from '../config';
|
|
3
|
+
import { type AgentDefinition } from './orchestrator';
|
|
4
|
+
export type { AgentDefinition } from './orchestrator';
|
|
5
|
+
export type SubagentName = (typeof SUBAGENT_NAMES)[number];
|
|
6
6
|
export declare function isSubagent(name: string): name is SubagentName;
|
|
7
7
|
/**
|
|
8
8
|
* Create all agent definitions with optional configuration overrides.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AgentDefinition } from
|
|
2
|
-
export declare function createLibrarianAgent(model: string): AgentDefinition;
|
|
1
|
+
import type { AgentDefinition } from './orchestrator';
|
|
2
|
+
export declare function createLibrarianAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
package/dist/agents/oracle.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AgentDefinition } from
|
|
2
|
-
export declare function createOracleAgent(model: string): AgentDefinition;
|
|
1
|
+
import type { AgentDefinition } from './orchestrator';
|
|
2
|
+
export declare function createOracleAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AgentConfig } from
|
|
1
|
+
import type { AgentConfig } from '@opencode-ai/sdk';
|
|
2
2
|
export interface AgentDefinition {
|
|
3
3
|
name: string;
|
|
4
4
|
description?: string;
|
|
5
5
|
config: AgentConfig;
|
|
6
6
|
}
|
|
7
|
-
export declare function createOrchestratorAgent(model: string): AgentDefinition;
|
|
7
|
+
export declare function createOrchestratorAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* - Integrates with tmux for visual feedback (when enabled)
|
|
12
12
|
* - Supports task cancellation and result retrieval
|
|
13
13
|
*/
|
|
14
|
-
import type { PluginInput } from
|
|
15
|
-
import type {
|
|
16
|
-
import type {
|
|
14
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
15
|
+
import type { PluginConfig } from '../config';
|
|
16
|
+
import type { TmuxConfig } from '../config/schema';
|
|
17
17
|
/**
|
|
18
18
|
* Represents a background task running in an isolated session.
|
|
19
19
|
* Tasks are tracked from creation through completion or failure.
|
|
@@ -23,7 +23,7 @@ export interface BackgroundTask {
|
|
|
23
23
|
sessionId: string;
|
|
24
24
|
description: string;
|
|
25
25
|
agent: string;
|
|
26
|
-
status:
|
|
26
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
27
27
|
result?: string;
|
|
28
28
|
error?: string;
|
|
29
29
|
startedAt: Date;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { TmuxSessionManager } from
|
|
1
|
+
export { type BackgroundTask, BackgroundTaskManager, type LaunchOptions, } from './background-manager';
|
|
2
|
+
export { TmuxSessionManager } from './tmux-session-manager';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PluginInput } from
|
|
2
|
-
import type { TmuxConfig } from
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { TmuxConfig } from '../config/schema';
|
|
3
3
|
/**
|
|
4
4
|
* TmuxSessionManager tracks child sessions (created by OpenCode's Task tool)
|
|
5
5
|
* and spawns/closes tmux panes for them.
|
package/dist/cli/config-io.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConfigMergeResult, DetectedConfig, InstallConfig, OpenCodeConfig } from
|
|
1
|
+
import type { ConfigMergeResult, DetectedConfig, InstallConfig, OpenCodeConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Strip JSON comments (single-line // and multi-line) and trailing commas for JSONC support.
|
|
4
4
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from './config-io';
|
|
2
|
+
export * from './paths';
|
|
3
|
+
export * from './providers';
|
|
4
|
+
export * from './system';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cli/index.js
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
// src/cli/install.ts
|
|
5
5
|
import * as readline from "readline/promises";
|
|
6
6
|
|
|
7
|
+
// src/cli/config-io.ts
|
|
8
|
+
import {
|
|
9
|
+
copyFileSync,
|
|
10
|
+
existsSync as existsSync2,
|
|
11
|
+
readFileSync,
|
|
12
|
+
renameSync,
|
|
13
|
+
statSync,
|
|
14
|
+
writeFileSync
|
|
15
|
+
} from "fs";
|
|
16
|
+
|
|
7
17
|
// src/cli/paths.ts
|
|
8
18
|
import { existsSync, mkdirSync } from "fs";
|
|
9
19
|
import { homedir } from "os";
|
|
@@ -36,6 +46,7 @@ function ensureConfigDir() {
|
|
|
36
46
|
mkdirSync(configDir, { recursive: true });
|
|
37
47
|
}
|
|
38
48
|
}
|
|
49
|
+
|
|
39
50
|
// src/tools/skill/builtin.ts
|
|
40
51
|
var DEFAULT_AGENT_SKILLS = {
|
|
41
52
|
orchestrator: ["*"],
|
|
@@ -255,7 +266,9 @@ function generateLiteConfig(installConfig) {
|
|
|
255
266
|
]));
|
|
256
267
|
config.presets[providerName] = agents2;
|
|
257
268
|
}
|
|
258
|
-
const mixedAgents = {
|
|
269
|
+
const mixedAgents = {
|
|
270
|
+
...MODEL_MAPPINGS.antigravity
|
|
271
|
+
};
|
|
259
272
|
mixedAgents.oracle = { model: "openai/gpt-5.2-codex", variant: "high" };
|
|
260
273
|
const agents = Object.fromEntries(Object.entries(mixedAgents).map(([k, v]) => [
|
|
261
274
|
k,
|
|
@@ -278,6 +291,7 @@ function generateLiteConfig(installConfig) {
|
|
|
278
291
|
}
|
|
279
292
|
return config;
|
|
280
293
|
}
|
|
294
|
+
|
|
281
295
|
// src/cli/system.ts
|
|
282
296
|
async function isOpenCodeInstalled() {
|
|
283
297
|
try {
|
|
@@ -315,8 +329,8 @@ async function fetchLatestVersion(packageName) {
|
|
|
315
329
|
return null;
|
|
316
330
|
}
|
|
317
331
|
}
|
|
332
|
+
|
|
318
333
|
// src/cli/config-io.ts
|
|
319
|
-
import { existsSync as existsSync2, readFileSync, writeFileSync, statSync, renameSync, copyFileSync } from "fs";
|
|
320
334
|
var PACKAGE_NAME = "oh-my-opencode-slim";
|
|
321
335
|
function stripJsonComments(json) {
|
|
322
336
|
const commentPattern = /\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g;
|
|
@@ -339,7 +353,7 @@ function parseConfigFile(path) {
|
|
|
339
353
|
}
|
|
340
354
|
}
|
|
341
355
|
function parseConfig(path) {
|
|
342
|
-
|
|
356
|
+
const result = parseConfigFile(path);
|
|
343
357
|
if (result.config || result.error)
|
|
344
358
|
return result;
|
|
345
359
|
if (path.endsWith(".json")) {
|
|
@@ -354,7 +368,7 @@ function writeConfig(configPath, config) {
|
|
|
354
368
|
}
|
|
355
369
|
const tmpPath = `${configPath}.tmp`;
|
|
356
370
|
const bakPath = `${configPath}.bak`;
|
|
357
|
-
const content = JSON.stringify(config, null, 2)
|
|
371
|
+
const content = `${JSON.stringify(config, null, 2)}
|
|
358
372
|
`;
|
|
359
373
|
if (existsSync2(configPath)) {
|
|
360
374
|
copyFileSync(configPath, bakPath);
|
|
@@ -376,7 +390,11 @@ async function addPluginToOpenCodeConfig() {
|
|
|
376
390
|
try {
|
|
377
391
|
const { config: parsedConfig, error } = parseConfig(configPath);
|
|
378
392
|
if (error) {
|
|
379
|
-
return {
|
|
393
|
+
return {
|
|
394
|
+
success: false,
|
|
395
|
+
configPath,
|
|
396
|
+
error: `Failed to parse config: ${error}`
|
|
397
|
+
};
|
|
380
398
|
}
|
|
381
399
|
const config = parsedConfig ?? {};
|
|
382
400
|
const plugins = config.plugin ?? [];
|
|
@@ -399,7 +417,11 @@ async function addAuthPlugins(installConfig) {
|
|
|
399
417
|
ensureConfigDir();
|
|
400
418
|
const { config: parsedConfig, error } = parseConfig(configPath);
|
|
401
419
|
if (error) {
|
|
402
|
-
return {
|
|
420
|
+
return {
|
|
421
|
+
success: false,
|
|
422
|
+
configPath,
|
|
423
|
+
error: `Failed to parse config: ${error}`
|
|
424
|
+
};
|
|
403
425
|
}
|
|
404
426
|
const config = parsedConfig ?? {};
|
|
405
427
|
const plugins = config.plugin ?? [];
|
|
@@ -427,7 +449,11 @@ function addProviderConfig(installConfig) {
|
|
|
427
449
|
ensureConfigDir();
|
|
428
450
|
const { config: parsedConfig, error } = parseConfig(configPath);
|
|
429
451
|
if (error) {
|
|
430
|
-
return {
|
|
452
|
+
return {
|
|
453
|
+
success: false,
|
|
454
|
+
configPath,
|
|
455
|
+
error: `Failed to parse config: ${error}`
|
|
456
|
+
};
|
|
431
457
|
}
|
|
432
458
|
const config = parsedConfig ?? {};
|
|
433
459
|
if (installConfig.hasAntigravity) {
|
|
@@ -452,7 +478,7 @@ function writeLiteConfig(installConfig) {
|
|
|
452
478
|
const config = generateLiteConfig(installConfig);
|
|
453
479
|
const tmpPath = `${configPath}.tmp`;
|
|
454
480
|
const bakPath = `${configPath}.bak`;
|
|
455
|
-
const content = JSON.stringify(config, null, 2)
|
|
481
|
+
const content = `${JSON.stringify(config, null, 2)}
|
|
456
482
|
`;
|
|
457
483
|
if (existsSync2(configPath)) {
|
|
458
484
|
copyFileSync(configPath, bakPath);
|
|
@@ -474,7 +500,11 @@ function disableDefaultAgents() {
|
|
|
474
500
|
ensureConfigDir();
|
|
475
501
|
const { config: parsedConfig, error } = parseConfig(configPath);
|
|
476
502
|
if (error) {
|
|
477
|
-
return {
|
|
503
|
+
return {
|
|
504
|
+
success: false,
|
|
505
|
+
configPath,
|
|
506
|
+
error: `Failed to parse config: ${error}`
|
|
507
|
+
};
|
|
478
508
|
}
|
|
479
509
|
const config = parsedConfig ?? {};
|
|
480
510
|
const agent = config.agent ?? {};
|
|
@@ -587,10 +617,10 @@ function formatConfigSummary(config) {
|
|
|
587
617
|
lines.push(`${BOLD}Configuration Summary${RESET}`);
|
|
588
618
|
lines.push("");
|
|
589
619
|
lines.push(` ${BOLD}Preset:${RESET} ${BLUE}${preset}${RESET}`);
|
|
590
|
-
lines.push(` ${config.hasAntigravity ? SYMBOLS.check : DIM
|
|
591
|
-
lines.push(` ${config.hasOpenAI ? SYMBOLS.check : DIM
|
|
620
|
+
lines.push(` ${config.hasAntigravity ? SYMBOLS.check : `${DIM}\u25CB${RESET}`} Antigravity`);
|
|
621
|
+
lines.push(` ${config.hasOpenAI ? SYMBOLS.check : `${DIM}\u25CB${RESET}`} OpenAI`);
|
|
592
622
|
lines.push(` ${SYMBOLS.check} Opencode Zen (free models)`);
|
|
593
|
-
lines.push(` ${config.hasTmux ? SYMBOLS.check : DIM
|
|
623
|
+
lines.push(` ${config.hasTmux ? SYMBOLS.check : `${DIM}\u25CB${RESET}`} Tmux Integration`);
|
|
594
624
|
return lines.join(`
|
|
595
625
|
`);
|
|
596
626
|
}
|
|
@@ -631,7 +661,10 @@ async function askYesNo(rl, prompt, defaultValue = "no") {
|
|
|
631
661
|
return defaultValue;
|
|
632
662
|
}
|
|
633
663
|
async function runInteractiveMode(detected) {
|
|
634
|
-
const rl = readline.createInterface({
|
|
664
|
+
const rl = readline.createInterface({
|
|
665
|
+
input: process.stdin,
|
|
666
|
+
output: process.stdout
|
|
667
|
+
});
|
|
635
668
|
const totalQuestions = 2;
|
|
636
669
|
try {
|
|
637
670
|
console.log(`${BOLD}Question 1/${totalQuestions}:${RESET}`);
|
package/dist/cli/install.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallArgs } from
|
|
1
|
+
import type { InstallArgs } from './types';
|
|
2
2
|
export declare function install(args: InstallArgs): Promise<number>;
|
package/dist/cli/providers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InstallConfig } from
|
|
1
|
+
import type { InstallConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Provider configurations for Google models (via Antigravity auth plugin)
|
|
4
4
|
*/
|
|
@@ -6,7 +6,7 @@ export declare const GOOGLE_PROVIDER_CONFIG: {
|
|
|
6
6
|
google: {
|
|
7
7
|
name: string;
|
|
8
8
|
models: {
|
|
9
|
-
|
|
9
|
+
'gemini-3-pro-high': {
|
|
10
10
|
name: string;
|
|
11
11
|
thinking: boolean;
|
|
12
12
|
attachment: boolean;
|
|
@@ -19,7 +19,7 @@ export declare const GOOGLE_PROVIDER_CONFIG: {
|
|
|
19
19
|
output: string[];
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
'gemini-3-flash': {
|
|
23
23
|
name: string;
|
|
24
24
|
attachment: boolean;
|
|
25
25
|
limit: {
|
|
@@ -31,7 +31,7 @@ export declare const GOOGLE_PROVIDER_CONFIG: {
|
|
|
31
31
|
output: string[];
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
'claude-opus-4-5-thinking': {
|
|
35
35
|
name: string;
|
|
36
36
|
attachment: boolean;
|
|
37
37
|
limit: {
|
|
@@ -43,7 +43,7 @@ export declare const GOOGLE_PROVIDER_CONFIG: {
|
|
|
43
43
|
output: string[];
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
'claude-sonnet-4-5-thinking': {
|
|
47
47
|
name: string;
|
|
48
48
|
attachment: boolean;
|
|
49
49
|
limit: {
|
|
@@ -109,7 +109,7 @@ export declare const MODEL_MAPPINGS: {
|
|
|
109
109
|
readonly variant: "low";
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
|
-
readonly
|
|
112
|
+
readonly 'zen-free': {
|
|
113
113
|
readonly orchestrator: {
|
|
114
114
|
readonly model: "opencode/glm-4.7-free";
|
|
115
115
|
};
|
package/dist/cli/types.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderPlanCommand(args: string): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "fixer"];
|
|
2
2
|
export declare const ORCHESTRATOR_NAME: "orchestrator";
|
|
3
3
|
export declare const ALL_AGENT_NAMES: readonly ["orchestrator", "explorer", "librarian", "oracle", "designer", "fixer"];
|
|
4
|
-
export type AgentName = typeof ALL_AGENT_NAMES[number];
|
|
4
|
+
export type AgentName = (typeof ALL_AGENT_NAMES)[number];
|
|
5
5
|
export declare const DEFAULT_MODELS: Record<AgentName, string>;
|
|
6
6
|
export declare const POLL_INTERVAL_MS = 500;
|
|
7
7
|
export declare const POLL_INTERVAL_SLOW_MS = 1000;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export { loadAgentPrompt, loadPluginConfig } from './loader';
|
|
3
|
+
export * from './schema';
|
package/dist/config/loader.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PluginConfig } from
|
|
1
|
+
import { type PluginConfig } from './schema';
|
|
2
2
|
/**
|
|
3
3
|
* Load plugin configuration from user and project config files, merging them appropriately.
|
|
4
4
|
*
|
|
@@ -13,3 +13,14 @@ import { type PluginConfig } from "./schema";
|
|
|
13
13
|
* @returns Merged plugin configuration (empty object if no configs found)
|
|
14
14
|
*/
|
|
15
15
|
export declare function loadPluginConfig(directory: string): PluginConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Load custom prompt for an agent from the prompts directory.
|
|
18
|
+
* Checks for {agent}.md (replaces default) and {agent}_append.md (appends to default).
|
|
19
|
+
*
|
|
20
|
+
* @param agentName - Name of the agent (e.g., "orchestrator", "explorer")
|
|
21
|
+
* @returns Object with prompt and/or appendPrompt if files exist
|
|
22
|
+
*/
|
|
23
|
+
export declare function loadAgentPrompt(agentName: string): {
|
|
24
|
+
prompt?: string;
|
|
25
|
+
appendPrompt?: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
3
3
|
model: z.ZodOptional<z.ZodString>;
|
|
4
4
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -67,4 +67,4 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
67
67
|
}, z.core.$strip>>;
|
|
68
68
|
}, z.core.$strip>;
|
|
69
69
|
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
70
|
-
export type { AgentName } from
|
|
70
|
+
export type { AgentName } from './constants';
|