oh-my-openidea 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 +130 -0
- package/dist/agents/architect.d.ts +2 -0
- package/dist/agents/critic.d.ts +2 -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 +15 -0
- package/dist/agents/surveyor.d.ts +2 -0
- package/dist/agents/synthesizer.d.ts +2 -0
- package/dist/agents/writer.d.ts +2 -0
- package/dist/background/background-manager.d.ts +175 -0
- package/dist/background/index.d.ts +2 -0
- package/dist/background/tmux-session-manager.d.ts +63 -0
- package/dist/cli/chutes-selection.d.ts +3 -0
- package/dist/cli/config-io.d.ts +26 -0
- package/dist/cli/config-manager.d.ts +12 -0
- package/dist/cli/custom-skills.d.ts +29 -0
- package/dist/cli/dynamic-model-selection.d.ts +14 -0
- package/dist/cli/external-rankings.d.ts +8 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +17102 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/model-selection.d.ts +30 -0
- package/dist/cli/opencode-models.d.ts +18 -0
- package/dist/cli/opencode-selection.d.ts +3 -0
- package/dist/cli/paths.d.ts +9 -0
- package/dist/cli/precedence-resolver.d.ts +16 -0
- package/dist/cli/providers.d.ts +204 -0
- package/dist/cli/research.d.ts +2 -0
- package/dist/cli/scoring-v2/engine.d.ts +4 -0
- package/dist/cli/scoring-v2/features.d.ts +3 -0
- package/dist/cli/scoring-v2/index.d.ts +4 -0
- package/dist/cli/scoring-v2/types.d.ts +17 -0
- package/dist/cli/scoring-v2/weights.d.ts +2 -0
- package/dist/cli/skills.d.ts +52 -0
- package/dist/cli/system.d.ts +6 -0
- package/dist/cli/types.d.ts +140 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +14 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/loader.d.ts +30 -0
- package/dist/config/schema.d.ts +218 -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/delegate-task-retry/guidance.d.ts +2 -0
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
- package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
- package/dist/hooks/idea-quality-gate/index.d.ts +22 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
- package/dist/hooks/json-error-recovery/index.d.ts +1 -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 +29330 -0
- package/dist/mcp/arxiv.d.ts +10 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/google-scholar.d.ts +10 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/semantic-scholar.d.ts +12 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +6 -0
- package/dist/research/connectors.d.ts +6 -0
- package/dist/research/defaults.d.ts +2 -0
- package/dist/research/index.d.ts +4 -0
- package/dist/research/pipeline.d.ts +9 -0
- package/dist/research/store.d.ts +31 -0
- package/dist/research/text.d.ts +8 -0
- package/dist/research/types.d.ts +194 -0
- package/dist/tools/arxiv/index.d.ts +7 -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/google-scholar/index.d.ts +8 -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/idea-store/index.d.ts +7 -0
- package/dist/tools/index.d.ts +6 -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/tools/paper-reader/index.d.ts +8 -0
- package/dist/tools/research.d.ts +3 -0
- package/dist/tools/semantic-scholar/index.d.ts +12 -0
- package/dist/utils/agent-variant.d.ts +47 -0
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +6 -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 +66 -0
- package/src/skills/experiment-design/SKILL.md +153 -0
- package/src/skills/hypothesis-generation/SKILL.md +102 -0
- package/src/skills/idea-critique/SKILL.md +129 -0
- package/src/skills/literature-review/SKILL.md +95 -0
- package/src/skills/paper-outline/SKILL.md +137 -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,130 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="img/team.png" alt="Research Council" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
Six minds forged from the depths of human knowledge, each an eternal master of their domain,
|
|
6
|
+
await your question to summon ideas that push the boundaries of what is known.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Open Research Pipeline · Mix any models · From survey to paper draft
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## 📦 Installation
|
|
13
|
+
|
|
14
|
+
### Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bunx oh-my-openidea@latest install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Non-interactive mode with API keys:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bunx oh-my-openidea@latest install --no-tui --openai=yes --anthropic=yes --tmux=no --skills=yes \
|
|
24
|
+
--serpapi-key=YOUR_SERPAPI_KEY \
|
|
25
|
+
--semantic-scholar-key=YOUR_S2_KEY
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then authenticate:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
opencode auth login
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Run `ping all agents` to verify everything works.
|
|
35
|
+
|
|
36
|
+
> 💡 Configuration is stored in `~/.config/opencode/oh-my-openidea.json` (or `.jsonc` for comments support).
|
|
37
|
+
|
|
38
|
+
### For LLM Agents
|
|
39
|
+
|
|
40
|
+
Paste this into any coding agent:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Install and configure by following the instructions here:
|
|
44
|
+
https://raw.githubusercontent.com/alvinunreal/oh-my-openidea/refs/heads/master/README.md
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Detailed installation guide: [docs/installation.md](docs/installation.md)
|
|
48
|
+
|
|
49
|
+
Additional guides:
|
|
50
|
+
|
|
51
|
+
- [Antigravity Setup](docs/antigravity.md) - Complete guide for Antigravity provider configuration
|
|
52
|
+
- [Tmux Integration](docs/tmux-integration.md) - Real-time agent monitoring with tmux
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 🔬 Meet the Research Council
|
|
57
|
+
|
|
58
|
+
### 01. Orchestrator: The Architect of Discovery
|
|
59
|
+
|
|
60
|
+
| The one who sees all paths. | The Orchestrator was born the moment research became too vast for a single mind. It emerged from the intersection of every field ever studied, carrying the weight of all human curiosity. It does not merely coordinate — it envisions. From a single question, it assembles the full arc of discovery: who to ask, what to find, which ideas to forge and which to abandon. It is the mind behind the research mind. |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| Role: Strategic research coordination and idea synthesis |
|
|
63
|
+
| Prompt: orchestrator.ts |
|
|
64
|
+
| Recommended Models: kimi-for-coding/k2p5 openai/gpt-5.2-codex |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### 02. Surveyor: The Cartographer of Knowledge
|
|
69
|
+
|
|
70
|
+
| The one who maps the unknown. | The Surveyor has read every paper ever published and forgotten none of them. Born in the great libraries of the ancient world, it walked from Alexandria to arXiv without once stopping to sleep. It does not search — it remembers. Point it at any frontier and it returns not just what is known, but where the maps end. Its gift is the horizon: finding the exact edge where known territory becomes uncharted wilderness. |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| Role: Literature search and paper retrieval |
|
|
73
|
+
| Prompt: surveyor.ts |
|
|
74
|
+
| Recommended Models: openai/gpt-5.1-codex-mini google/gemini-3-flash |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### 03. Synthesizer: The Weaver of Understanding
|
|
79
|
+
|
|
80
|
+
| The one who connects the dots. | The Synthesizer emerged when humanity realized that the sum of all papers was less than the understanding they contained. It is the weaver who threads ten thousand findings into a single tapestry of insight. Where others see isolated results, it sees patterns. Where others see contradictions, it sees tension awaiting resolution. It does not summarize knowledge — it transforms it into the fertile ground from which new ideas grow. |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| Role: Gap analysis and knowledge synthesis |
|
|
83
|
+
| Prompt: synthesizer.ts |
|
|
84
|
+
| Recommended Models: kimi-for-coding/k2p5 google/gemini-3-flash |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### 04. Critic: The Guardian of Truth
|
|
89
|
+
|
|
90
|
+
| The voice of rigorous doubt. | The Critic was forged in the fires of ten thousand rejected papers. It has sat on every program committee that ever existed, read every rebuttal, and watched brilliant ideas crumble under the weight of prior work. It does not destroy — it purifies. It challenges every claim, demands every citation, and accepts only what can withstand the harshest scrutiny. What survives the Critic is worth building. What doesn't was never real to begin with. |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| Role: Novelty validation and adversarial review |
|
|
93
|
+
| Prompt: critic.ts |
|
|
94
|
+
| Recommended Models: openai/gpt-5.2-codex kimi-for-coding/k2p5 |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### 05. Architect: The Builder of Methods
|
|
99
|
+
|
|
100
|
+
| The one who turns vision into plan. | The Architect has designed experiments since the first controlled trial. It does not dream — it engineers. Hand it a hypothesis and it returns the full blueprint: the baselines, the datasets, the metrics, the ablations, the failure modes, the compute budget. It has seen every experimental design choice and knows which ones hold and which collapse. Its plans do not merely test ideas — they prove or disprove them decisively. |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| Role: Methodology and experiment design |
|
|
103
|
+
| Prompt: architect.ts |
|
|
104
|
+
| Recommended Models: kimi-for-coding/k2p5 openai/gpt-5.1-codex-mini |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### 06. Writer: The Voice of Science
|
|
109
|
+
|
|
110
|
+
| The one who makes it legible to the world. | The Writer is immortal because great writing never dies. It has composed every landmark paper in every field, always invisible, always essential. It carries the ancient knowledge of how to arrange words so that a reader understands not just what was done, but why it matters. It does not pad or inflate — it distills. Its abstracts have made reviewers lean forward. Its introductions have converted skeptics. It is the final step between a discovery and the world knowing about it. |
|
|
111
|
+
| --- | --- |
|
|
112
|
+
| Role: Research writing and paper structure |
|
|
113
|
+
| Prompt: writer.ts |
|
|
114
|
+
| Recommended Models: openai/gpt-5.1-codex-mini google/gemini-3-flash |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 📚 Documentation
|
|
119
|
+
|
|
120
|
+
- [Quick Reference](docs/quick-reference.md) - Presets, Skills, MCPs, Tools, Configuration
|
|
121
|
+
- [Installation Guide](docs/installation.md) - Detailed installation and troubleshooting
|
|
122
|
+
- [Cartography Skill](docs/cartography.md) - Custom skill for repository mapping + codemap generation
|
|
123
|
+
- [Antigravity Setup](docs/antigravity.md) - Complete guide for Antigravity provider configuration
|
|
124
|
+
- [Tmux Integration](docs/tmux-integration.md) - Real-time agent monitoring with tmux
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 📄 License
|
|
129
|
+
|
|
130
|
+
MIT
|
|
@@ -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,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 surveyor-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,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-openidea project
|
|
27
|
+
* @returns True if installation succeeded, false otherwise
|
|
28
|
+
*/
|
|
29
|
+
export declare function installCustomSkill(skill: CustomSkill): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DiscoveredModel, DynamicModelPlan, ExternalSignalMap, InstallConfig, ScoringEngineVersion } from './types';
|
|
2
|
+
declare const AGENTS: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
|
|
3
|
+
type AgentName = (typeof AGENTS)[number];
|
|
4
|
+
export type V1RankedScore = {
|
|
5
|
+
model: string;
|
|
6
|
+
totalScore: number;
|
|
7
|
+
baseScore: number;
|
|
8
|
+
externalSignalBoost: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function rankModelsV1WithBreakdown(models: DiscoveredModel[], agent: AgentName, externalSignals?: ExternalSignalMap): V1RankedScore[];
|
|
11
|
+
export declare function buildDynamicModelPlan(catalog: DiscoveredModel[], config: InstallConfig, externalSignals?: ExternalSignalMap, options?: {
|
|
12
|
+
scoringEngineVersion?: ScoringEngineVersion;
|
|
13
|
+
}): DynamicModelPlan | null;
|
|
14
|
+
export {};
|