oh-my-opencode-slim 0.1.0
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/LICENSE +21 -0
- package/README.md +196 -0
- package/dist/agents/document-writer.d.ts +2 -0
- package/dist/agents/explore.d.ts +2 -0
- package/dist/agents/frontend.d.ts +2 -0
- package/dist/agents/index.d.ts +6 -0
- package/dist/agents/librarian.d.ts +2 -0
- package/dist/agents/multimodal.d.ts +2 -0
- package/dist/agents/oracle.d.ts +2 -0
- package/dist/agents/orchestrator.d.ts +7 -0
- package/dist/agents/simplicity-reviewer.d.ts +2 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/loader.d.ts +2 -0
- package/dist/config/schema.d.ts +22 -0
- package/dist/features/background-manager.d.ts +32 -0
- package/dist/features/index.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +26716 -0
- package/dist/tools/background.d.ts +3 -0
- package/dist/tools/call-omo-agent.d.ts +3 -0
- package/dist/tools/index.d.ts +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# oh-my-opencode-slim
|
|
2
|
+
|
|
3
|
+
A lightweight, powerful agent orchestration plugin for **OpenCode**. This is a slimmed-down fork of [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode), focused on core agent orchestration without the extra bells and whistles.
|
|
4
|
+
|
|
5
|
+
It transforms your AI assistant into a manager capable of delegating complex tasks to specialized sub-agents, running searches in the background, and managing multi-step workflows with ease.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
### For Humans
|
|
12
|
+
|
|
13
|
+
> **Prerequisite: [Bun](https://bun.sh/) is required**
|
|
14
|
+
|
|
15
|
+
1. **Install OpenCode** (if not already installed):
|
|
16
|
+
```bash
|
|
17
|
+
# Check if installed
|
|
18
|
+
opencode --version
|
|
19
|
+
|
|
20
|
+
# If not, see: https://opencode.ai/docs
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. **Add the plugin to your OpenCode config** (`~/.config/opencode/opencode.json`):
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"plugin": [
|
|
27
|
+
"oh-my-opencode-slim"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
3. **Verify setup**:
|
|
33
|
+
```bash
|
|
34
|
+
opencode
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### For LLM Agents
|
|
38
|
+
|
|
39
|
+
<details>
|
|
40
|
+
<summary>Instructions for LLM Agents (click to expand)</summary>
|
|
41
|
+
|
|
42
|
+
If you're an LLM Agent helping set up oh-my-opencode-slim, follow these steps:
|
|
43
|
+
|
|
44
|
+
#### Step 1: Check OpenCode Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
if command -v opencode &> /dev/null; then
|
|
48
|
+
echo "OpenCode $(opencode --version) is installed"
|
|
49
|
+
else
|
|
50
|
+
echo "OpenCode is not installed. Please install it first."
|
|
51
|
+
echo "Ref: https://opencode.ai/docs"
|
|
52
|
+
fi
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### Step 2: Add Plugin to Config
|
|
56
|
+
|
|
57
|
+
Edit `~/.config/opencode/opencode.json` and add `"oh-my-opencode-slim"` to the plugin array:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"plugin": [
|
|
62
|
+
"oh-my-opencode-slim"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### Step 3: Verify Setup
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
opencode --version # Should be 1.0.150 or higher
|
|
71
|
+
cat ~/.config/opencode/opencode.json # Should contain "oh-my-opencode-slim" in plugin array
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### Step 4: Configure Authentication
|
|
75
|
+
|
|
76
|
+
Add the Antigravity auth plugin to your config:
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"plugin": [
|
|
80
|
+
"oh-my-opencode-slim",
|
|
81
|
+
"opencode-antigravity-auth@latest"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Then authenticate:
|
|
87
|
+
```bash
|
|
88
|
+
opencode auth login
|
|
89
|
+
# Select Provider: Google
|
|
90
|
+
# Select Login method: OAuth with Google (Antigravity)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
</details>
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Architecture & Flow
|
|
98
|
+
|
|
99
|
+
The plugin follows a "Hub and Spoke" model:
|
|
100
|
+
|
|
101
|
+
1. **The Orchestrator (Hub)**: The main entry point for user requests. It analyzes the task and decides which specialized agents to call.
|
|
102
|
+
2. **Specialized Agents (Spokes)**: Domain-specific experts (e.g., UI/UX, Documentation, Architecture) that handle narrow tasks with high precision.
|
|
103
|
+
3. **Background Manager**: A robust engine that allows the Orchestrator to "fire and forget" tasks (like deep codebase searches or documentation research) while continuing to work on other parts of the problem.
|
|
104
|
+
|
|
105
|
+
### The Flow of a Request
|
|
106
|
+
|
|
107
|
+
1. **User Prompt**: "Refactor the auth logic and update the docs."
|
|
108
|
+
2. **Orchestrator**: Creates a TODO list.
|
|
109
|
+
3. **Delegation**:
|
|
110
|
+
- Launches an `@explore` background task to find all auth-related files.
|
|
111
|
+
- Launches a `@librarian` task to check the latest documentation for the auth library used.
|
|
112
|
+
4. **Integration**: Once background results are ready, the Orchestrator performs the refactor.
|
|
113
|
+
5. **Finalization**: Passes the changes to `@document-writer` to update the README.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Agents
|
|
118
|
+
|
|
119
|
+
| Agent | Role | Default Model | Best Used For |
|
|
120
|
+
| :--- | :--- | :--- | :--- |
|
|
121
|
+
| **orchestrator** | Manager | `google/antigravity-claude-opus-4-5-thinking-high` | Planning, task delegation, and overall coordination. |
|
|
122
|
+
| **oracle** | Architect | `openai/gpt-5.2-codex` | Complex debugging, architectural decisions, and code reviews. |
|
|
123
|
+
| **explore** | Searcher | `cerebras/zai-glm-4.6` | Fast codebase grep, finding patterns, and locating definitions. |
|
|
124
|
+
| **librarian** | Researcher | `google/gemini-3-flash` | External library docs, GitHub examples, and API research. |
|
|
125
|
+
| **frontend-ui-ux-engineer** | Designer | `google/gemini-3-flash` | Visual changes, CSS/styling, and React/Vue component polish. |
|
|
126
|
+
| **document-writer** | Scribe | `google/gemini-3-flash` | Technical documentation, READMEs, and inline code comments. |
|
|
127
|
+
| **multimodal-looker** | Visionary | `google/gemini-3-flash` | Analyzing screenshots, wireframes, or UI designs. |
|
|
128
|
+
| **code-simplicity-reviewer** | Minimalist | `google/antigravity-claude-opus-4-5-thinking-high` | Ruthless code simplification and YAGNI principle enforcement. |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Tools & Capabilities
|
|
133
|
+
|
|
134
|
+
### Background Tasks
|
|
135
|
+
|
|
136
|
+
The plugin provides three core tools to manage asynchronous work:
|
|
137
|
+
|
|
138
|
+
- `background_task`: Launches an agent in a new session.
|
|
139
|
+
- `sync=true`: Blocks until the agent finishes (ideal for quick sub-tasks).
|
|
140
|
+
- `sync=false`: Runs in the background (ideal for long searches or research).
|
|
141
|
+
- `background_output`: Fetches the result of a background task using its ID.
|
|
142
|
+
- `background_cancel`: Aborts running tasks if they are no longer needed.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Configuration
|
|
147
|
+
|
|
148
|
+
You can customize the behavior of the plugin via JSON configuration files.
|
|
149
|
+
|
|
150
|
+
### Configuration Files
|
|
151
|
+
|
|
152
|
+
The plugin looks for configuration in two places (and merges them):
|
|
153
|
+
|
|
154
|
+
1. **User Global**: `~/.config/opencode/oh-my-opencode-slim.json` (or OS equivalent)
|
|
155
|
+
2. **Project Local**: `./.opencode/oh-my-opencode-slim.json`
|
|
156
|
+
|
|
157
|
+
| Platform | User Config Path |
|
|
158
|
+
| :--- | :--- |
|
|
159
|
+
| **Windows** | `~/.config/opencode/oh-my-opencode-slim.json` or `%APPDATA%\opencode\oh-my-opencode-slim.json` |
|
|
160
|
+
| **macOS/Linux** | `~/.config/opencode/oh-my-opencode-slim.json` |
|
|
161
|
+
|
|
162
|
+
### Disabling Agents
|
|
163
|
+
|
|
164
|
+
You can disable specific agents using the `disabled_agents` array:
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"disabled_agents": ["multimodal-looker", "code-simplicity-reviewer"]
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Uninstallation
|
|
175
|
+
|
|
176
|
+
1. **Remove the plugin from your OpenCode config**:
|
|
177
|
+
|
|
178
|
+
Edit `~/.config/opencode/opencode.json` and remove `"oh-my-opencode-slim"` from the `plugin` array.
|
|
179
|
+
|
|
180
|
+
2. **Remove configuration files (optional)**:
|
|
181
|
+
```bash
|
|
182
|
+
rm -f ~/.config/opencode/oh-my-opencode-slim.json
|
|
183
|
+
rm -f .opencode/oh-my-opencode-slim.json
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Credits
|
|
189
|
+
|
|
190
|
+
This is a slimmed-down fork of [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) by [@code-yeongyu](https://github.com/code-yeongyu).
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## License
|
|
195
|
+
|
|
196
|
+
MIT
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentConfig } from "@opencode-ai/sdk";
|
|
2
|
+
import { type PluginConfig } from "../config";
|
|
3
|
+
import { type AgentDefinition } from "./orchestrator";
|
|
4
|
+
export type { AgentDefinition } from "./orchestrator";
|
|
5
|
+
export declare function createAgents(config?: PluginConfig): AgentDefinition[];
|
|
6
|
+
export declare function getAgentConfigs(config?: PluginConfig): Record<string, AgentConfig>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentConfig } from "@opencode-ai/sdk";
|
|
2
|
+
export interface AgentDefinition {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
config: AgentConfig;
|
|
6
|
+
}
|
|
7
|
+
export declare function createOrchestratorAgent(model: string, subAgents: AgentDefinition[]): AgentDefinition;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AgentConfigSchema: z.ZodObject<{
|
|
3
|
+
model: z.ZodOptional<z.ZodString>;
|
|
4
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
6
|
+
prompt_append: z.ZodOptional<z.ZodString>;
|
|
7
|
+
disable: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type AgentConfig = z.infer<typeof AgentConfigSchema>;
|
|
10
|
+
export declare const PluginConfigSchema: z.ZodObject<{
|
|
11
|
+
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
12
|
+
model: z.ZodOptional<z.ZodString>;
|
|
13
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
15
|
+
prompt_append: z.ZodOptional<z.ZodString>;
|
|
16
|
+
disable: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
}, z.core.$strip>>>;
|
|
18
|
+
disabled_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
21
|
+
export type AgentName = "orchestrator" | "oracle" | "librarian" | "explore" | "frontend-ui-ux-engineer" | "document-writer" | "multimodal-looker" | "code-simplicity-reviewer";
|
|
22
|
+
export declare const DEFAULT_MODELS: Record<AgentName, string>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export interface BackgroundTask {
|
|
3
|
+
id: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
description: string;
|
|
6
|
+
agent: string;
|
|
7
|
+
status: "pending" | "running" | "completed" | "failed";
|
|
8
|
+
result?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
startedAt: Date;
|
|
11
|
+
completedAt?: Date;
|
|
12
|
+
}
|
|
13
|
+
export interface LaunchOptions {
|
|
14
|
+
agent: string;
|
|
15
|
+
prompt: string;
|
|
16
|
+
description: string;
|
|
17
|
+
parentSessionId: string;
|
|
18
|
+
model?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class BackgroundTaskManager {
|
|
21
|
+
private tasks;
|
|
22
|
+
private client;
|
|
23
|
+
private directory;
|
|
24
|
+
private pollInterval?;
|
|
25
|
+
constructor(ctx: PluginInput);
|
|
26
|
+
launch(opts: LaunchOptions): Promise<BackgroundTask>;
|
|
27
|
+
getResult(taskId: string, block?: boolean, timeout?: number): Promise<BackgroundTask | null>;
|
|
28
|
+
cancel(taskId?: string): number;
|
|
29
|
+
private startPolling;
|
|
30
|
+
private pollAllTasks;
|
|
31
|
+
private pollTask;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BackgroundTaskManager, type BackgroundTask, type LaunchOptions } from "./background-manager";
|
package/dist/index.d.ts
ADDED