oh-my-groundcontrol 0.0.1

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.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +264 -0
  3. package/dist/agents/designer.d.ts +2 -0
  4. package/dist/agents/explorer.d.ts +2 -0
  5. package/dist/agents/fixer.d.ts +2 -0
  6. package/dist/agents/index.d.ts +22 -0
  7. package/dist/agents/librarian.d.ts +2 -0
  8. package/dist/agents/oracle.d.ts +2 -0
  9. package/dist/agents/orchestrator.d.ts +15 -0
  10. package/dist/background/background-manager.d.ts +175 -0
  11. package/dist/background/index.d.ts +2 -0
  12. package/dist/background/tmux-session-manager.d.ts +63 -0
  13. package/dist/cli/chutes-selection.d.ts +3 -0
  14. package/dist/cli/config-io.d.ts +26 -0
  15. package/dist/cli/config-manager.d.ts +12 -0
  16. package/dist/cli/custom-skills.d.ts +29 -0
  17. package/dist/cli/dynamic-model-selection.d.ts +14 -0
  18. package/dist/cli/external-rankings.d.ts +8 -0
  19. package/dist/cli/index.d.ts +2 -0
  20. package/dist/cli/index.js +17082 -0
  21. package/dist/cli/install.d.ts +2 -0
  22. package/dist/cli/model-key-normalization.d.ts +1 -0
  23. package/dist/cli/model-selection.d.ts +30 -0
  24. package/dist/cli/opencode-models.d.ts +18 -0
  25. package/dist/cli/opencode-selection.d.ts +3 -0
  26. package/dist/cli/paths.d.ts +9 -0
  27. package/dist/cli/precedence-resolver.d.ts +16 -0
  28. package/dist/cli/providers.d.ts +204 -0
  29. package/dist/cli/scoring-v2/engine.d.ts +4 -0
  30. package/dist/cli/scoring-v2/features.d.ts +3 -0
  31. package/dist/cli/scoring-v2/index.d.ts +4 -0
  32. package/dist/cli/scoring-v2/types.d.ts +17 -0
  33. package/dist/cli/scoring-v2/weights.d.ts +2 -0
  34. package/dist/cli/skills.d.ts +52 -0
  35. package/dist/cli/system.d.ts +6 -0
  36. package/dist/cli/types.d.ts +138 -0
  37. package/dist/config/agent-mcps.d.ts +15 -0
  38. package/dist/config/constants.d.ts +14 -0
  39. package/dist/config/index.d.ts +4 -0
  40. package/dist/config/loader.d.ts +30 -0
  41. package/dist/config/schema.d.ts +229 -0
  42. package/dist/config/utils.d.ts +10 -0
  43. package/dist/config/validate-providers.d.ts +7 -0
  44. package/dist/hooks/auto-update-checker/cache.d.ts +6 -0
  45. package/dist/hooks/auto-update-checker/checker.d.ts +28 -0
  46. package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
  47. package/dist/hooks/auto-update-checker/index.d.ts +17 -0
  48. package/dist/hooks/auto-update-checker/types.d.ts +23 -0
  49. package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
  50. package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
  51. package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
  52. package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
  53. package/dist/hooks/index.d.ts +6 -0
  54. package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
  55. package/dist/hooks/json-error-recovery/index.d.ts +1 -0
  56. package/dist/hooks/phase-reminder/index.d.ts +25 -0
  57. package/dist/hooks/post-read-nudge/index.d.ts +18 -0
  58. package/dist/index.d.ts +5 -0
  59. package/dist/index.js +33819 -0
  60. package/dist/mcp/context7.d.ts +6 -0
  61. package/dist/mcp/grep-app.d.ts +6 -0
  62. package/dist/mcp/index.d.ts +6 -0
  63. package/dist/mcp/types.d.ts +12 -0
  64. package/dist/mcp/websearch.d.ts +6 -0
  65. package/dist/session/index.d.ts +2 -0
  66. package/dist/session/session-exporter.d.ts +83 -0
  67. package/dist/tools/ast-grep/cli.d.ts +15 -0
  68. package/dist/tools/ast-grep/constants.d.ts +25 -0
  69. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  70. package/dist/tools/ast-grep/index.d.ts +10 -0
  71. package/dist/tools/ast-grep/tools.d.ts +3 -0
  72. package/dist/tools/ast-grep/types.d.ts +30 -0
  73. package/dist/tools/ast-grep/utils.d.ts +4 -0
  74. package/dist/tools/background.d.ts +13 -0
  75. package/dist/tools/grep/cli.d.ts +3 -0
  76. package/dist/tools/grep/constants.d.ts +18 -0
  77. package/dist/tools/grep/downloader.d.ts +3 -0
  78. package/dist/tools/grep/index.d.ts +5 -0
  79. package/dist/tools/grep/tools.d.ts +2 -0
  80. package/dist/tools/grep/types.d.ts +35 -0
  81. package/dist/tools/grep/utils.d.ts +2 -0
  82. package/dist/tools/index.d.ts +4 -0
  83. package/dist/tools/lsp/client.d.ts +42 -0
  84. package/dist/tools/lsp/config.d.ts +4 -0
  85. package/dist/tools/lsp/constants.d.ts +8 -0
  86. package/dist/tools/lsp/index.d.ts +3 -0
  87. package/dist/tools/lsp/tools.d.ts +5 -0
  88. package/dist/tools/lsp/types.d.ts +28 -0
  89. package/dist/tools/lsp/utils.d.ts +21 -0
  90. package/dist/utils/agent-variant.d.ts +47 -0
  91. package/dist/utils/env.d.ts +1 -0
  92. package/dist/utils/index.d.ts +6 -0
  93. package/dist/utils/logger.d.ts +1 -0
  94. package/dist/utils/polling.d.ts +21 -0
  95. package/dist/utils/tmux.d.ts +32 -0
  96. package/dist/utils/zip-extractor.d.ts +1 -0
  97. package/package.json +68 -0
  98. package/src/skills/cartography/README.md +57 -0
  99. package/src/skills/cartography/SKILL.md +137 -0
  100. package/src/skills/cartography/scripts/cartographer.py +456 -0
  101. 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,264 @@
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>Open Multi Agent Suite</b> · Mix any models · Auto delegate tasks</p>
5
+ <p><a href="https://moltfounders.com/jobs/09d1c6e7-9e0e-4683-8d78-e2376aaa2333"><img src="https://moltfounders.com/badges/4.png" alt="MoltFounders" height="30"></a></p>
6
+ </div>
7
+
8
+ ---
9
+
10
+ ## 📦 Installation
11
+
12
+ ### Quick Start
13
+
14
+ ```bash
15
+ bunx oh-my-groundcontrol@latest install
16
+ ```
17
+
18
+ The installer can refresh and use OpenCode free models directly:
19
+
20
+ ```bash
21
+ bunx oh-my-groundcontrol@latest install --no-tui --kimi=yes --openai=yes --antigravity=yes --chutes=yes --opencode-free=yes --opencode-free-model=auto --tmux=no --skills=yes
22
+ ```
23
+
24
+ Then authenticate:
25
+
26
+ ```bash
27
+ opencode auth login
28
+ ```
29
+
30
+ Run `ping all agents` to verify everything works.
31
+
32
+ OpenCode free-model mode uses `opencode models --refresh --verbose`, filters to free `opencode/*` models, and applies coding-first selection:
33
+ - OpenCode-only mode can use multiple OpenCode free models across agents.
34
+ - Hybrid mode can combine OpenCode free models with OpenAI, Kimi, and/or Antigravity.
35
+ - In hybrid mode, `designer` stays on the external provider mapping.
36
+ - Chutes mode auto-selects primary/support models with daily-cap awareness (300/2000/5000).
37
+
38
+ > **💡 Models are fully customizable.** Edit `~/.config/opencode/oh-my-groundcontrol.json` (or `.jsonc` for comments support) to assign any model to any agent.
39
+
40
+ ### For LLM Agents
41
+
42
+ Paste this into any coding agent:
43
+
44
+ ```
45
+ Install and configure by following the instructions here:
46
+ https://raw.githubusercontent.com/alvinunreal/oh-my-groundcontrol/refs/heads/master/README.md
47
+ ```
48
+
49
+ **Detailed installation guide:** [docs/installation.md](docs/installation.md)
50
+
51
+ **Additional guides:**
52
+ - **[Antigravity Setup](docs/antigravity.md)** - Complete guide for Antigravity provider configuration
53
+ - **[Tmux Integration](docs/tmux-integration.md)** - Real-time agent monitoring with tmux
54
+
55
+ ---
56
+
57
+ ## 🏛️ Meet the Pantheon
58
+
59
+ ### 01. Orchestrator: The Embodiment Of Order
60
+
61
+ <table>
62
+ <tr>
63
+ <td width="30%" align="center" valign="top">
64
+ <img src="img/orchestrator.png" width="240" style="border-radius: 10px;">
65
+ <br><sub><i>Forged in the void of complexity.</i></sub>
66
+ </td>
67
+ <td width="70%" valign="top">
68
+ 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.
69
+ </td>
70
+ </tr>
71
+ <tr>
72
+ <td colspan="2">
73
+ <b>Role:</b> <code>Master delegator and strategic coordinator</code>
74
+ </td>
75
+ </tr>
76
+ <tr>
77
+ <td colspan="2">
78
+ <b>Prompt:</b> <a href="src/agents/orchestrator.ts"><code>orchestrator.ts</code></a>
79
+ </td>
80
+ </tr>
81
+ <tr>
82
+ <td colspan="2">
83
+ <b>Recommended Models:</b> <code>kimi-for-coding/k2p5</code> <code>openai/gpt-5.2-codex</code>
84
+ </td>
85
+ </tr>
86
+ </table>
87
+
88
+ ---
89
+
90
+ ### 02. Explorer: The Eternal Wanderer
91
+
92
+ <table>
93
+ <tr>
94
+ <td width="30%" align="center" valign="top">
95
+ <img src="img/explorer.png" width="240" style="border-radius: 10px;">
96
+ <br><sub><i>The wind that carries knowledge.</i></sub>
97
+ </td>
98
+ <td width="70%" valign="top">
99
+ 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.
100
+ </td>
101
+ </tr>
102
+ <tr>
103
+ <td colspan="2">
104
+ <b>Role:</b> <code>Codebase reconnaissance</code>
105
+ </td>
106
+ </tr>
107
+ <tr>
108
+ <td colspan="2">
109
+ <b>Prompt:</b> <a href="src/agents/explorer.ts"><code>explorer.ts</code></a>
110
+ </td>
111
+ </tr>
112
+ <tr>
113
+ <td colspan="2">
114
+ <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>
115
+ </td>
116
+ </tr>
117
+ </table>
118
+
119
+ ---
120
+
121
+ ### 03. Oracle: The Guardian of Paths
122
+
123
+ <table>
124
+ <tr>
125
+ <td width="30%" align="center" valign="top">
126
+ <img src="img/oracle.png" width="240" style="border-radius: 10px;">
127
+ <br><sub><i>The voice at the crossroads.</i></sub>
128
+ </td>
129
+ <td width="70%" valign="top">
130
+ 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.
131
+ </td>
132
+ </tr>
133
+ <tr>
134
+ <td colspan="2">
135
+ <b>Role:</b> <code>Strategic advisor and debugger of last resort</code>
136
+ </td>
137
+ </tr>
138
+ <tr>
139
+ <td colspan="2">
140
+ <b>Prompt:</b> <a href="src/agents/oracle.ts"><code>oracle.ts</code></a>
141
+ </td>
142
+ </tr>
143
+ <tr>
144
+ <td colspan="2">
145
+ <b>Recommended Models:</b> <code>openai/gpt-5.2-codex</code> <code>kimi-for-coding/k2p5</code>
146
+ </td>
147
+ </tr>
148
+ </table>
149
+
150
+ ---
151
+
152
+ ### 04. Librarian: The Weaver of Knowledge
153
+
154
+ <table>
155
+ <tr>
156
+ <td width="30%" align="center" valign="top">
157
+ <img src="img/librarian.png" width="240" style="border-radius: 10px;">
158
+ <br><sub><i>The weaver of understanding.</i></sub>
159
+ </td>
160
+ <td width="70%" valign="top">
161
+ 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.
162
+ </td>
163
+ </tr>
164
+ <tr>
165
+ <td colspan="2">
166
+ <b>Role:</b> <code>External knowledge retrieval</code>
167
+ </td>
168
+ </tr>
169
+ <tr>
170
+ <td colspan="2">
171
+ <b>Prompt:</b> <a href="src/agents/librarian.ts"><code>librarian.ts</code></a>
172
+ </td>
173
+ </tr>
174
+ <tr>
175
+ <td colspan="2">
176
+ <b>Recommended Models:</b> <code>google/gemini-3-flash</code> <code>openai/gpt-5.1-codex-mini</code>
177
+ </td>
178
+ </tr>
179
+ </table>
180
+
181
+ ---
182
+
183
+ ### 05. Designer: The Guardian of Aesthetics
184
+
185
+ <table>
186
+ <tr>
187
+ <td width="30%" align="center" valign="top">
188
+ <img src="img/designer.png" width="240" style="border-radius: 10px;">
189
+ <br><sub><i>Beauty is essential.</i></sub>
190
+ </td>
191
+ <td width="70%" valign="top">
192
+ 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.
193
+ </td>
194
+ </tr>
195
+ <tr>
196
+ <td colspan="2">
197
+ <b>Role:</b> <code>UI/UX implementation and visual excellence</code>
198
+ </td>
199
+ </tr>
200
+ <tr>
201
+ <td colspan="2">
202
+ <b>Prompt:</b> <a href="src/agents/designer.ts"><code>designer.ts</code></a>
203
+ </td>
204
+ </tr>
205
+ <tr>
206
+ <td colspan="2">
207
+ <b>Recommended Models:</b> <code>google/gemini-3-flash</code>
208
+ </td>
209
+ </tr>
210
+ </table>
211
+
212
+ ---
213
+
214
+ ### 06. Fixer: The Last Builder
215
+
216
+ <table>
217
+ <tr>
218
+ <td width="30%" align="center" valign="top">
219
+ <img src="img/fixer.png" width="240" style="border-radius: 10px;">
220
+ <br><sub><i>The final step between vision and reality.</i></sub>
221
+ </td>
222
+ <td width="70%" valign="top">
223
+ 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.
224
+ </td>
225
+ </tr>
226
+ <tr>
227
+ <td colspan="2">
228
+ <b>Role:</b> <code>Fast implementation specialist</code>
229
+ </td>
230
+ </tr>
231
+ <tr>
232
+ <td colspan="2">
233
+ <b>Prompt:</b> <a href="src/agents/fixer.ts"><code>fixer.ts</code></a>
234
+ </td>
235
+ </tr>
236
+ <tr>
237
+ <td colspan="2">
238
+ <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>
239
+ </td>
240
+ </tr>
241
+ </table>
242
+
243
+ ---
244
+
245
+ ## 📚 Documentation
246
+
247
+ - **[Quick Reference](docs/quick-reference.md)** - Presets, Skills, MCPs, Tools, Configuration
248
+ - **[Installation Guide](docs/installation.md)** - Detailed installation and troubleshooting
249
+ - **[Cartography Skill](docs/cartography.md)** - Custom skill for repository mapping + codemap generation
250
+ - **[Antigravity Setup](docs/antigravity.md)** - Complete guide for Antigravity provider configuration
251
+ - **[Tmux Integration](docs/tmux-integration.md)** - Real-time agent monitoring with tmux
252
+
253
+ ---
254
+
255
+ ## 📄 License
256
+
257
+ MIT
258
+
259
+ ---
260
+
261
+ <!-- MoltFounders Banner -->
262
+ <a href="https://moltfounders.com/jobs/09d1c6e7-9e0e-4683-8d78-e2376aaa2333">
263
+ <img src="img/moltfounders-banner.png" alt="MoltFounders - The Agent Co-Founder Network">
264
+ </a>
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createDesignerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createExplorerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createFixerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,22 @@
1
+ import type { AgentConfig as SDKAgentConfig } from '@opencode-ai/sdk/v2';
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,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createLibrarianAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createOracleAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,15 @@
1
+ import type { AgentConfig } from '@opencode-ai/sdk/v2';
2
+ export interface AgentDefinition {
3
+ name: string;
4
+ description?: string;
5
+ config: AgentConfig;
6
+ /** Priority-ordered model entries for runtime fallback resolution. */
7
+ _modelArray?: Array<{
8
+ id: string;
9
+ variant?: string;
10
+ }>;
11
+ }
12
+ export declare function createOrchestratorAgent(model?: string | Array<string | {
13
+ id: string;
14
+ variant?: string;
15
+ }>, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,175 @@
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 agentBySessionId;
49
+ private client;
50
+ private directory;
51
+ private tmuxEnabled;
52
+ private config?;
53
+ private backgroundConfig;
54
+ private startQueue;
55
+ private activeStarts;
56
+ private maxConcurrentStarts;
57
+ private completionResolvers;
58
+ constructor(ctx: PluginInput, tmuxConfig?: TmuxConfig, config?: PluginConfig);
59
+ /**
60
+ * Look up the delegation rules for an agent type.
61
+ * Unknown agent types default to explorer-only access, making it easy
62
+ * to add new background agent types without updating SUBAGENT_DELEGATION_RULES.
63
+ */
64
+ private getSubagentRules;
65
+ /**
66
+ * Check if a parent session is allowed to delegate to a specific agent type.
67
+ * @param parentSessionId - The session ID of the parent
68
+ * @param requestedAgent - The agent type being requested
69
+ * @returns true if allowed, false if not
70
+ */
71
+ isAgentAllowed(parentSessionId: string, requestedAgent: string): boolean;
72
+ /**
73
+ * Get the list of allowed subagents for a parent session.
74
+ * @param parentSessionId - The session ID of the parent
75
+ * @returns Array of allowed agent names, empty if none
76
+ */
77
+ getAllowedSubagents(parentSessionId: string): readonly string[];
78
+ /**
79
+ * Launch a new background task (fire-and-forget).
80
+ *
81
+ * Phase A (sync): Creates task record and returns immediately.
82
+ * Phase B (async): Session creation and prompt sending happen in background.
83
+ *
84
+ * @param opts - Task configuration options
85
+ * @returns The created background task with pending status
86
+ */
87
+ launch(opts: LaunchOptions): BackgroundTask;
88
+ /**
89
+ * Enqueue task for background start.
90
+ */
91
+ private enqueueStart;
92
+ /**
93
+ * Process start queue with concurrency limit.
94
+ */
95
+ private processQueue;
96
+ private resolveFallbackChain;
97
+ private promptWithTimeout;
98
+ /**
99
+ * Calculate tool permissions for a spawned agent based on its own delegation rules.
100
+ * Agents that cannot delegate (leaf nodes) get delegation tools disabled entirely,
101
+ * preventing models from even seeing tools they can never use.
102
+ *
103
+ * @param agentName - The agent type being spawned
104
+ * @returns Tool permissions object with background_task and task enabled/disabled
105
+ */
106
+ private calculateToolPermissions;
107
+ /**
108
+ * Start a task in the background (Phase B).
109
+ */
110
+ private startTask;
111
+ /**
112
+ * Handle session.status events for completion detection.
113
+ * Uses session.status instead of deprecated session.idle.
114
+ */
115
+ handleSessionStatus(event: {
116
+ type: string;
117
+ properties?: {
118
+ sessionID?: string;
119
+ status?: {
120
+ type: string;
121
+ };
122
+ };
123
+ }): Promise<void>;
124
+ /**
125
+ * Handle session.deleted events for cleanup.
126
+ * When a session is deleted, cancel associated tasks and clean up.
127
+ */
128
+ handleSessionDeleted(event: {
129
+ type: string;
130
+ properties?: {
131
+ info?: {
132
+ id?: string;
133
+ };
134
+ sessionID?: string;
135
+ };
136
+ }): Promise<void>;
137
+ /**
138
+ * Extract task result and mark complete.
139
+ */
140
+ private extractAndCompleteTask;
141
+ /**
142
+ * Complete a task and notify waiting callers.
143
+ */
144
+ private completeTask;
145
+ /**
146
+ * Send completion notification to parent session.
147
+ */
148
+ private sendCompletionNotification;
149
+ /**
150
+ * Retrieve the current state of a background task.
151
+ *
152
+ * @param taskId - The task ID to retrieve
153
+ * @returns The task object, or null if not found
154
+ */
155
+ getResult(taskId: string): BackgroundTask | null;
156
+ /**
157
+ * Wait for a task to complete.
158
+ *
159
+ * @param taskId - The task ID to wait for
160
+ * @param timeout - Maximum time to wait in milliseconds (0 = no timeout)
161
+ * @returns The completed task, or null if not found/timeout
162
+ */
163
+ waitForCompletion(taskId: string, timeout?: number): Promise<BackgroundTask | null>;
164
+ /**
165
+ * Cancel one or all running background tasks.
166
+ *
167
+ * @param taskId - Optional task ID to cancel. If omitted, cancels all pending/running tasks.
168
+ * @returns Number of tasks cancelled
169
+ */
170
+ cancel(taskId?: string): number;
171
+ /**
172
+ * Clean up all tasks.
173
+ */
174
+ cleanup(): void;
175
+ }
@@ -0,0 +1,2 @@
1
+ export { type BackgroundTask, BackgroundTaskManager, type LaunchOptions, } from './background-manager';
2
+ export { TmuxSessionManager } from './tmux-session-manager';
@@ -0,0 +1,63 @@
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
+ /**
46
+ * Handle session.deleted events.
47
+ * When a session is deleted, close its tmux pane immediately.
48
+ */
49
+ onSessionDeleted(event: SessionEvent): Promise<void>;
50
+ private startPolling;
51
+ private stopPolling;
52
+ /**
53
+ * Poll sessions for status updates (fallback for reliability).
54
+ * Also handles timeout and missing session detection.
55
+ */
56
+ private pollSessions;
57
+ private closeSession;
58
+ /**
59
+ * Clean up all tracked sessions.
60
+ */
61
+ cleanup(): Promise<void>;
62
+ }
63
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { OpenCodeFreeModel } from './types';
2
+ export declare function pickBestCodingChutesModel(models: OpenCodeFreeModel[]): OpenCodeFreeModel | null;
3
+ export declare function pickSupportChutesModel(models: OpenCodeFreeModel[], primaryModel?: string): OpenCodeFreeModel | null;
@@ -0,0 +1,26 @@
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 canModifyOpenCodeConfig(): boolean;
22
+ export declare function addAntigravityPlugin(): ConfigMergeResult;
23
+ export declare function addGoogleProvider(): ConfigMergeResult;
24
+ export declare function addChutesProvider(): ConfigMergeResult;
25
+ export declare function detectAntigravityConfig(): boolean;
26
+ export declare function detectCurrentConfig(): DetectedConfig;
@@ -0,0 +1,12 @@
1
+ export * from './chutes-selection';
2
+ export * from './config-io';
3
+ export * from './dynamic-model-selection';
4
+ export * from './external-rankings';
5
+ export * from './model-selection';
6
+ export * from './opencode-models';
7
+ export * from './opencode-selection';
8
+ export * from './paths';
9
+ export * from './precedence-resolver';
10
+ export * from './providers';
11
+ export * from './scoring-v2';
12
+ export * from './system';
@@ -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-groundcontrol project
27
+ * @returns True if installation succeeded, false otherwise
28
+ */
29
+ export declare function installCustomSkill(skill: CustomSkill): boolean;