myai-opencode 0.6.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/LICENSE +21 -0
- package/README.md +244 -0
- package/dist/agents/designer.d.ts +2 -0
- package/dist/agents/explorer.d.ts +2 -0
- package/dist/agents/fixer.d.ts +2 -0
- package/dist/agents/index.d.ts +22 -0
- package/dist/agents/librarian.d.ts +2 -0
- package/dist/agents/oracle.d.ts +2 -0
- package/dist/agents/orchestrator.d.ts +7 -0
- package/dist/background/background-manager.d.ts +131 -0
- package/dist/background/index.d.ts +2 -0
- package/dist/background/tmux-session-manager.d.ts +58 -0
- package/dist/cli/config-io.d.ts +21 -0
- package/dist/cli/config-manager.d.ts +4 -0
- package/dist/cli/custom-skills.d.ts +29 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +14342 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/paths.d.ts +7 -0
- package/dist/cli/providers.d.ts +79 -0
- package/dist/cli/skills.d.ts +35 -0
- package/dist/cli/system.d.ts +4 -0
- package/dist/cli/types.d.ts +34 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +12 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/loader.d.ts +26 -0
- package/dist/config/schema.d.ts +81 -0
- package/dist/config/utils.d.ts +10 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +6 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +28 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
- package/dist/hooks/auto-update-checker/index.d.ts +17 -0
- package/dist/hooks/auto-update-checker/types.d.ts +23 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/phase-reminder/index.d.ts +25 -0
- package/dist/hooks/post-read-nudge/index.d.ts +18 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +33076 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +6 -0
- package/dist/tools/ast-grep/cli.d.ts +15 -0
- package/dist/tools/ast-grep/constants.d.ts +25 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/index.d.ts +10 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +30 -0
- package/dist/tools/ast-grep/utils.d.ts +4 -0
- package/dist/tools/background.d.ts +13 -0
- package/dist/tools/grep/cli.d.ts +3 -0
- package/dist/tools/grep/constants.d.ts +18 -0
- package/dist/tools/grep/downloader.d.ts +3 -0
- package/dist/tools/grep/index.d.ts +5 -0
- package/dist/tools/grep/tools.d.ts +2 -0
- package/dist/tools/grep/types.d.ts +35 -0
- package/dist/tools/grep/utils.d.ts +2 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/lsp/client.d.ts +42 -0
- package/dist/tools/lsp/config.d.ts +4 -0
- package/dist/tools/lsp/constants.d.ts +8 -0
- package/dist/tools/lsp/index.d.ts +3 -0
- package/dist/tools/lsp/tools.d.ts +5 -0
- package/dist/tools/lsp/types.d.ts +28 -0
- package/dist/tools/lsp/utils.d.ts +21 -0
- package/dist/utils/agent-variant.d.ts +47 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/polling.d.ts +21 -0
- package/dist/utils/tmux.d.ts +32 -0
- package/dist/utils/zip-extractor.d.ts +1 -0
- package/package.json +68 -0
- package/src/skills/cartography/README.md +57 -0
- package/src/skills/cartography/SKILL.md +137 -0
- package/src/skills/cartography/scripts/cartographer.py +456 -0
- package/src/skills/cartography/scripts/test_cartographer.py +87 -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,244 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="img/team.png" alt="Pantheon agents" width="420">
|
|
3
|
+
<p><i>Six divine beings emerged from the dawn of code, each an immortal master of their craft await your command to forge order from chaos and build what was once thought impossible.</i></p>
|
|
4
|
+
<p><b>Multi Agent Suite</b> · Mix any models · Auto delegate tasks</p>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📦 Installation
|
|
10
|
+
|
|
11
|
+
### Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bunx oh-my-opencode-slim@latest install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then authenticate:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
opencode auth login
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Run `ping all agents` to verify everything works.
|
|
24
|
+
|
|
25
|
+
> **💡 Models are fully customizable.** Edit `~/.config/opencode/oh-my-opencode-slim.json` to assign any model to any agent.
|
|
26
|
+
|
|
27
|
+
### For LLM Agents
|
|
28
|
+
|
|
29
|
+
Paste this into any coding agent:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Install and configure by following the instructions here:
|
|
33
|
+
https://raw.githubusercontent.com/alvinunreal/oh-my-opencode-slim/refs/heads/master/README.md
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Detailed installation guide:** [docs/installation.md](docs/installation.md)
|
|
37
|
+
|
|
38
|
+
**Additional guides:**
|
|
39
|
+
- **[Antigravity Setup](docs/antigravity.md)** - Complete guide for Antigravity provider configuration
|
|
40
|
+
- **[Tmux Integration](docs/tmux-integration.md)** - Real-time agent monitoring with tmux
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🏛️ Meet the Pantheon
|
|
45
|
+
|
|
46
|
+
### 01. Orchestrator: The Embodiment Of Order
|
|
47
|
+
|
|
48
|
+
<table>
|
|
49
|
+
<tr>
|
|
50
|
+
<td width="30%" align="center" valign="top">
|
|
51
|
+
<img src="img/orchestrator.png" width="240" style="border-radius: 10px;">
|
|
52
|
+
<br><sub><i>Forged in the void of complexity.</i></sub>
|
|
53
|
+
</td>
|
|
54
|
+
<td width="70%" valign="top">
|
|
55
|
+
The Orchestrator was born when the first codebase collapsed under its own complexity. Neither god nor mortal would claim responsibility - so The Orchestrator emerged from the void, forging order from chaos. It determines the optimal path to any goal, balancing speed, quality, and cost. It guides the team, summoning the right specialist for each task and delegating to achieve the best possible outcome.
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
<tr>
|
|
59
|
+
<td colspan="2">
|
|
60
|
+
<b>Role:</b> <code>Master delegator and strategic coordinator</code>
|
|
61
|
+
</td>
|
|
62
|
+
</tr>
|
|
63
|
+
<tr>
|
|
64
|
+
<td colspan="2">
|
|
65
|
+
<b>Prompt:</b> <a href="src/agents/orchestrator.ts"><code>orchestrator.ts</code></a>
|
|
66
|
+
</td>
|
|
67
|
+
</tr>
|
|
68
|
+
<tr>
|
|
69
|
+
<td colspan="2">
|
|
70
|
+
<b>Recommended Models:</b> <code>kimi-for-coding/k2p5</code> <code>openai/gpt-5.2-codex</code>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
</table>
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### 02. Explorer: The Eternal Wanderer
|
|
78
|
+
|
|
79
|
+
<table>
|
|
80
|
+
<tr>
|
|
81
|
+
<td width="30%" align="center" valign="top">
|
|
82
|
+
<img src="img/explorer.png" width="240" style="border-radius: 10px;">
|
|
83
|
+
<br><sub><i>The wind that carries knowledge.</i></sub>
|
|
84
|
+
</td>
|
|
85
|
+
<td width="70%" valign="top">
|
|
86
|
+
The Explorer is an immortal wanderer who has traversed the corridors of a million codebases since the dawn of programming. Cursed with the gift of eternal curiosity, they cannot rest until every file is known, every pattern understood, every secret revealed. Legends say they once searched the entire internet in a single heartbeat. They are the wind that carries knowledge, the eyes that see all, the spirit that never sleeps.
|
|
87
|
+
</td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td colspan="2">
|
|
91
|
+
<b>Role:</b> <code>Codebase reconnaissance</code>
|
|
92
|
+
</td>
|
|
93
|
+
</tr>
|
|
94
|
+
<tr>
|
|
95
|
+
<td colspan="2">
|
|
96
|
+
<b>Prompt:</b> <a href="src/agents/explorer.ts"><code>explorer.ts</code></a>
|
|
97
|
+
</td>
|
|
98
|
+
</tr>
|
|
99
|
+
<tr>
|
|
100
|
+
<td colspan="2">
|
|
101
|
+
<b>Recommended Models:</b> <code>cerebras/zai-glm-4.7</code> <code>google/gemini-3-flash</code> <code>openai/gpt-5.1-codex-mini</code>
|
|
102
|
+
</td>
|
|
103
|
+
</tr>
|
|
104
|
+
</table>
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### 03. Oracle: The Guardian of Paths
|
|
109
|
+
|
|
110
|
+
<table>
|
|
111
|
+
<tr>
|
|
112
|
+
<td width="30%" align="center" valign="top">
|
|
113
|
+
<img src="img/oracle.png" width="240" style="border-radius: 10px;">
|
|
114
|
+
<br><sub><i>The voice at the crossroads.</i></sub>
|
|
115
|
+
</td>
|
|
116
|
+
<td width="70%" valign="top">
|
|
117
|
+
The Oracle stands at the crossroads of every architectural decision. They have walked every road, seen every destination, know every trap that lies ahead. When you stand at the precipice of a major refactor, they are the voice that whispers which way leads to ruin and which way leads to glory. They don't choose for you - they illuminate the path so you can choose wisely.
|
|
118
|
+
</td>
|
|
119
|
+
</tr>
|
|
120
|
+
<tr>
|
|
121
|
+
<td colspan="2">
|
|
122
|
+
<b>Role:</b> <code>Strategic advisor and debugger of last resort</code>
|
|
123
|
+
</td>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr>
|
|
126
|
+
<td colspan="2">
|
|
127
|
+
<b>Prompt:</b> <a href="src/agents/oracle.ts"><code>oracle.ts</code></a>
|
|
128
|
+
</td>
|
|
129
|
+
</tr>
|
|
130
|
+
<tr>
|
|
131
|
+
<td colspan="2">
|
|
132
|
+
<b>Recommended Models:</b> <code>openai/gpt-5.2-codex</code> <code>kimi-for-coding/k2p5</code>
|
|
133
|
+
</td>
|
|
134
|
+
</tr>
|
|
135
|
+
</table>
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
### 04. Librarian: The Weaver of Knowledge
|
|
140
|
+
|
|
141
|
+
<table>
|
|
142
|
+
<tr>
|
|
143
|
+
<td width="30%" align="center" valign="top">
|
|
144
|
+
<img src="img/librarian.png" width="240" style="border-radius: 10px;">
|
|
145
|
+
<br><sub><i>The weaver of understanding.</i></sub>
|
|
146
|
+
</td>
|
|
147
|
+
<td width="70%" valign="top">
|
|
148
|
+
The Librarian was forged when humanity realized that no single mind could hold all knowledge. They are the weaver who connects disparate threads of information into a tapestry of understanding. They traverse the infinite library of human knowledge, gathering insights from every corner and binding them into answers that transcend mere facts. What they return is not information - it's understanding.
|
|
149
|
+
</td>
|
|
150
|
+
</tr>
|
|
151
|
+
<tr>
|
|
152
|
+
<td colspan="2">
|
|
153
|
+
<b>Role:</b> <code>External knowledge retrieval</code>
|
|
154
|
+
</td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr>
|
|
157
|
+
<td colspan="2">
|
|
158
|
+
<b>Prompt:</b> <a href="src/agents/librarian.ts"><code>librarian.ts</code></a>
|
|
159
|
+
</td>
|
|
160
|
+
</tr>
|
|
161
|
+
<tr>
|
|
162
|
+
<td colspan="2">
|
|
163
|
+
<b>Recommended Models:</b> <code>google/gemini-3-flash</code> <code>openai/gpt-5.1-codex-mini</code>
|
|
164
|
+
</td>
|
|
165
|
+
</tr>
|
|
166
|
+
</table>
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### 05. Designer: The Guardian of Aesthetics
|
|
171
|
+
|
|
172
|
+
<table>
|
|
173
|
+
<tr>
|
|
174
|
+
<td width="30%" align="center" valign="top">
|
|
175
|
+
<img src="img/designer.png" width="240" style="border-radius: 10px;">
|
|
176
|
+
<br><sub><i>Beauty is essential.</i></sub>
|
|
177
|
+
</td>
|
|
178
|
+
<td width="70%" valign="top">
|
|
179
|
+
The Designer is an immortal guardian of beauty in a world that often forgets it matters. They have seen a million interfaces rise and fall, and they remember which ones were remembered and which were forgotten. They carry the sacred duty to ensure that every pixel serves a purpose, every animation tells a story, every interaction delights. Beauty is not optional - it's essential.
|
|
180
|
+
</td>
|
|
181
|
+
</tr>
|
|
182
|
+
<tr>
|
|
183
|
+
<td colspan="2">
|
|
184
|
+
<b>Role:</b> <code>UI/UX implementation and visual excellence</code>
|
|
185
|
+
</td>
|
|
186
|
+
</tr>
|
|
187
|
+
<tr>
|
|
188
|
+
<td colspan="2">
|
|
189
|
+
<b>Prompt:</b> <a href="src/agents/designer.ts"><code>designer.ts</code></a>
|
|
190
|
+
</td>
|
|
191
|
+
</tr>
|
|
192
|
+
<tr>
|
|
193
|
+
<td colspan="2">
|
|
194
|
+
<b>Recommended Models:</b> <code>google/gemini-3-flash</code>
|
|
195
|
+
</td>
|
|
196
|
+
</tr>
|
|
197
|
+
</table>
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### 06. Fixer: The Last Builder
|
|
202
|
+
|
|
203
|
+
<table>
|
|
204
|
+
<tr>
|
|
205
|
+
<td width="30%" align="center" valign="top">
|
|
206
|
+
<img src="img/fixer.png" width="240" style="border-radius: 10px;">
|
|
207
|
+
<br><sub><i>The final step between vision and reality.</i></sub>
|
|
208
|
+
</td>
|
|
209
|
+
<td width="70%" valign="top">
|
|
210
|
+
The Fixer is the last of a lineage of builders who once constructed the foundations of the digital world. When the age of planning and debating began, they remained - the ones who actually build. They carry the ancient knowledge of how to turn thought into thing, how to transform specification into implementation. They are the final step between vision and reality.
|
|
211
|
+
</td>
|
|
212
|
+
</tr>
|
|
213
|
+
<tr>
|
|
214
|
+
<td colspan="2">
|
|
215
|
+
<b>Role:</b> <code>Fast implementation specialist</code>
|
|
216
|
+
</td>
|
|
217
|
+
</tr>
|
|
218
|
+
<tr>
|
|
219
|
+
<td colspan="2">
|
|
220
|
+
<b>Prompt:</b> <a href="src/agents/fixer.ts"><code>fixer.ts</code></a>
|
|
221
|
+
</td>
|
|
222
|
+
</tr>
|
|
223
|
+
<tr>
|
|
224
|
+
<td colspan="2">
|
|
225
|
+
<b>Recommended Models:</b> <code>cerebras/zai-glm-4.7</code> <code>google/gemini-3-flash</code> <code>openai/gpt-5.1-codex-mini</code>
|
|
226
|
+
</td>
|
|
227
|
+
</tr>
|
|
228
|
+
</table>
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 📚 Documentation
|
|
233
|
+
|
|
234
|
+
- **[Quick Reference](docs/quick-reference.md)** - Presets, Skills, MCPs, Tools, Configuration
|
|
235
|
+
- **[Installation Guide](docs/installation.md)** - Detailed installation and troubleshooting
|
|
236
|
+
- **[Cartography Skill](docs/cartography.md)** - Custom skill for repository mapping + codemap generation
|
|
237
|
+
- **[Antigravity Setup](docs/antigravity.md)** - Complete guide for Antigravity provider configuration
|
|
238
|
+
- **[Tmux Integration](docs/tmux-integration.md)** - Real-time agent monitoring with tmux
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 📄 License
|
|
243
|
+
|
|
244
|
+
MIT
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
export declare function isSubagent(name: string): name is SubagentName;
|
|
7
|
+
/**
|
|
8
|
+
* Create all agent definitions with optional configuration overrides.
|
|
9
|
+
* Instantiates the orchestrator and all subagents, applying user config and defaults.
|
|
10
|
+
*
|
|
11
|
+
* @param config - Optional plugin configuration with agent overrides
|
|
12
|
+
* @returns Array of agent definitions (orchestrator first, then subagents)
|
|
13
|
+
*/
|
|
14
|
+
export declare function createAgents(config?: PluginConfig): AgentDefinition[];
|
|
15
|
+
/**
|
|
16
|
+
* Get agent configurations formatted for the OpenCode SDK.
|
|
17
|
+
* Converts agent definitions to SDK config format and applies classification metadata.
|
|
18
|
+
*
|
|
19
|
+
* @param config - Optional plugin configuration with agent overrides
|
|
20
|
+
* @returns Record mapping agent names to their SDK configurations
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAgentConfigs(config?: PluginConfig): Record<string, SDKAgentConfig>;
|
|
@@ -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, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Background Task Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages long-running AI agent tasks that execute in separate sessions.
|
|
5
|
+
* Background tasks run independently from the main conversation flow, allowing
|
|
6
|
+
* the user to continue working while tasks complete asynchronously.
|
|
7
|
+
*
|
|
8
|
+
* Key features:
|
|
9
|
+
* - Fire-and-forget launch (returns task_id immediately)
|
|
10
|
+
* - Creates isolated sessions for background work
|
|
11
|
+
* - Event-driven completion detection via session.status
|
|
12
|
+
* - Start queue with configurable concurrency limit
|
|
13
|
+
* - Supports task cancellation and result retrieval
|
|
14
|
+
*/
|
|
15
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
16
|
+
import type { BackgroundTaskConfig, PluginConfig } from '../config';
|
|
17
|
+
import type { TmuxConfig } from '../config/schema';
|
|
18
|
+
/**
|
|
19
|
+
* Represents a background task running in an isolated session.
|
|
20
|
+
* Tasks are tracked from creation through completion or failure.
|
|
21
|
+
*/
|
|
22
|
+
export interface BackgroundTask {
|
|
23
|
+
id: string;
|
|
24
|
+
sessionId?: string;
|
|
25
|
+
description: string;
|
|
26
|
+
agent: string;
|
|
27
|
+
status: 'pending' | 'starting' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
28
|
+
result?: string;
|
|
29
|
+
error?: string;
|
|
30
|
+
config: BackgroundTaskConfig;
|
|
31
|
+
parentSessionId: string;
|
|
32
|
+
startedAt: Date;
|
|
33
|
+
completedAt?: Date;
|
|
34
|
+
prompt: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Options for launching a new background task.
|
|
38
|
+
*/
|
|
39
|
+
export interface LaunchOptions {
|
|
40
|
+
agent: string;
|
|
41
|
+
prompt: string;
|
|
42
|
+
description: string;
|
|
43
|
+
parentSessionId: string;
|
|
44
|
+
}
|
|
45
|
+
export declare class BackgroundTaskManager {
|
|
46
|
+
private tasks;
|
|
47
|
+
private tasksBySessionId;
|
|
48
|
+
private client;
|
|
49
|
+
private directory;
|
|
50
|
+
private tmuxEnabled;
|
|
51
|
+
private config?;
|
|
52
|
+
private backgroundConfig;
|
|
53
|
+
private startQueue;
|
|
54
|
+
private activeStarts;
|
|
55
|
+
private maxConcurrentStarts;
|
|
56
|
+
private completionResolvers;
|
|
57
|
+
constructor(ctx: PluginInput, tmuxConfig?: TmuxConfig, config?: PluginConfig);
|
|
58
|
+
/**
|
|
59
|
+
* Launch a new background task (fire-and-forget).
|
|
60
|
+
*
|
|
61
|
+
* Phase A (sync): Creates task record and returns immediately.
|
|
62
|
+
* Phase B (async): Session creation and prompt sending happen in background.
|
|
63
|
+
*
|
|
64
|
+
* @param opts - Task configuration options
|
|
65
|
+
* @returns The created background task with pending status
|
|
66
|
+
*/
|
|
67
|
+
launch(opts: LaunchOptions): BackgroundTask;
|
|
68
|
+
/**
|
|
69
|
+
* Enqueue task for background start.
|
|
70
|
+
*/
|
|
71
|
+
private enqueueStart;
|
|
72
|
+
/**
|
|
73
|
+
* Process start queue with concurrency limit.
|
|
74
|
+
*/
|
|
75
|
+
private processQueue;
|
|
76
|
+
/**
|
|
77
|
+
* Start a task in the background (Phase B).
|
|
78
|
+
*/
|
|
79
|
+
private startTask;
|
|
80
|
+
/**
|
|
81
|
+
* Handle session.status events for completion detection.
|
|
82
|
+
* Uses session.status instead of deprecated session.idle.
|
|
83
|
+
*/
|
|
84
|
+
handleSessionStatus(event: {
|
|
85
|
+
type: string;
|
|
86
|
+
properties?: {
|
|
87
|
+
sessionID?: string;
|
|
88
|
+
status?: {
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Extract task result and mark complete.
|
|
95
|
+
*/
|
|
96
|
+
private extractAndCompleteTask;
|
|
97
|
+
/**
|
|
98
|
+
* Complete a task and notify waiting callers.
|
|
99
|
+
*/
|
|
100
|
+
private completeTask;
|
|
101
|
+
/**
|
|
102
|
+
* Send completion notification to parent session.
|
|
103
|
+
*/
|
|
104
|
+
private sendCompletionNotification;
|
|
105
|
+
/**
|
|
106
|
+
* Retrieve the current state of a background task.
|
|
107
|
+
*
|
|
108
|
+
* @param taskId - The task ID to retrieve
|
|
109
|
+
* @returns The task object, or null if not found
|
|
110
|
+
*/
|
|
111
|
+
getResult(taskId: string): BackgroundTask | null;
|
|
112
|
+
/**
|
|
113
|
+
* Wait for a task to complete.
|
|
114
|
+
*
|
|
115
|
+
* @param taskId - The task ID to wait for
|
|
116
|
+
* @param timeout - Maximum time to wait in milliseconds (0 = no timeout)
|
|
117
|
+
* @returns The completed task, or null if not found/timeout
|
|
118
|
+
*/
|
|
119
|
+
waitForCompletion(taskId: string, timeout?: number): Promise<BackgroundTask | null>;
|
|
120
|
+
/**
|
|
121
|
+
* Cancel one or all running background tasks.
|
|
122
|
+
*
|
|
123
|
+
* @param taskId - Optional task ID to cancel. If omitted, cancels all pending/running tasks.
|
|
124
|
+
* @returns Number of tasks cancelled
|
|
125
|
+
*/
|
|
126
|
+
cancel(taskId?: string): number;
|
|
127
|
+
/**
|
|
128
|
+
* Clean up all tasks.
|
|
129
|
+
*/
|
|
130
|
+
cleanup(): void;
|
|
131
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { TmuxConfig } from '../config/schema';
|
|
3
|
+
/**
|
|
4
|
+
* Event shape for session events
|
|
5
|
+
*/
|
|
6
|
+
interface SessionEvent {
|
|
7
|
+
type: string;
|
|
8
|
+
properties?: {
|
|
9
|
+
info?: {
|
|
10
|
+
id?: string;
|
|
11
|
+
parentID?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
};
|
|
14
|
+
sessionID?: string;
|
|
15
|
+
status?: {
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* TmuxSessionManager tracks child sessions and spawns/closes tmux panes for them.
|
|
22
|
+
*
|
|
23
|
+
* Uses session.status events for completion detection instead of polling.
|
|
24
|
+
*/
|
|
25
|
+
export declare class TmuxSessionManager {
|
|
26
|
+
private client;
|
|
27
|
+
private tmuxConfig;
|
|
28
|
+
private serverUrl;
|
|
29
|
+
private sessions;
|
|
30
|
+
private pollInterval?;
|
|
31
|
+
private enabled;
|
|
32
|
+
constructor(ctx: PluginInput, tmuxConfig: TmuxConfig);
|
|
33
|
+
/**
|
|
34
|
+
* Handle session.created events.
|
|
35
|
+
* Spawns a tmux pane for child sessions (those with parentID).
|
|
36
|
+
*/
|
|
37
|
+
onSessionCreated(event: SessionEvent): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Handle session.status events for completion detection.
|
|
40
|
+
* Uses session.status instead of deprecated session.idle.
|
|
41
|
+
*
|
|
42
|
+
* When a session becomes idle (completed), close its pane.
|
|
43
|
+
*/
|
|
44
|
+
onSessionStatus(event: SessionEvent): Promise<void>;
|
|
45
|
+
private startPolling;
|
|
46
|
+
private stopPolling;
|
|
47
|
+
/**
|
|
48
|
+
* Poll sessions for status updates (fallback for reliability).
|
|
49
|
+
* Also handles timeout and missing session detection.
|
|
50
|
+
*/
|
|
51
|
+
private pollSessions;
|
|
52
|
+
private closeSession;
|
|
53
|
+
/**
|
|
54
|
+
* Clean up all tracked sessions.
|
|
55
|
+
*/
|
|
56
|
+
cleanup(): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ConfigMergeResult, DetectedConfig, InstallConfig, OpenCodeConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Strip JSON comments (single-line // and multi-line) and trailing commas for JSONC support.
|
|
4
|
+
*/
|
|
5
|
+
export declare function stripJsonComments(json: string): string;
|
|
6
|
+
export declare function parseConfigFile(path: string): {
|
|
7
|
+
config: OpenCodeConfig | null;
|
|
8
|
+
error?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function parseConfig(path: string): {
|
|
11
|
+
config: OpenCodeConfig | null;
|
|
12
|
+
error?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Write config to file atomically.
|
|
16
|
+
*/
|
|
17
|
+
export declare function writeConfig(configPath: string, config: OpenCodeConfig): void;
|
|
18
|
+
export declare function addPluginToOpenCodeConfig(): Promise<ConfigMergeResult>;
|
|
19
|
+
export declare function writeLiteConfig(installConfig: InstallConfig): ConfigMergeResult;
|
|
20
|
+
export declare function disableDefaultAgents(): ConfigMergeResult;
|
|
21
|
+
export declare function detectCurrentConfig(): DetectedConfig;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom skill bundled in this repository.
|
|
3
|
+
* Unlike npx-installed skills, these are copied from src/skills/ to ~/.config/opencode/skills/
|
|
4
|
+
*/
|
|
5
|
+
export interface CustomSkill {
|
|
6
|
+
/** Skill name (folder name) */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Human-readable description */
|
|
9
|
+
description: string;
|
|
10
|
+
/** List of agents that should auto-allow this skill */
|
|
11
|
+
allowedAgents: string[];
|
|
12
|
+
/** Source path in this repo (relative to project root) */
|
|
13
|
+
sourcePath: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Registry of custom skills bundled in this repository.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CUSTOM_SKILLS: CustomSkill[];
|
|
19
|
+
/**
|
|
20
|
+
* Get the target directory for custom skills installation.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getCustomSkillsDir(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Install a custom skill by copying from src/skills/ to ~/.config/opencode/skills/
|
|
25
|
+
* @param skill - The custom skill to install
|
|
26
|
+
* @param projectRoot - Root directory of oh-my-opencode-slim project
|
|
27
|
+
* @returns True if installation succeeded, false otherwise
|
|
28
|
+
*/
|
|
29
|
+
export declare function installCustomSkill(skill: CustomSkill): boolean;
|