oh-my-opencode-medium 0.8.2
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 +284 -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/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 +17077 -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/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 +138 -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 +217 -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/chat-headers.d.ts +16 -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/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 +26 -0
- package/dist/hooks/post-read-nudge/index.d.ts +18 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +33970 -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/skills/loader.d.ts +13 -0
- package/dist/skills/register.d.ts +2 -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/env.d.ts +1 -0
- package/dist/utils/frontmatter.d.ts +15 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/internal-initiator.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 +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/src/skills/loader.test.ts +452 -0
- package/src/skills/loader.ts +300 -0
- package/src/skills/register.test.ts +55 -0
- package/src/skills/register.ts +15 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildModelKeyAliases(input: string): string[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ModelSelectionCandidate {
|
|
2
|
+
model: string;
|
|
3
|
+
status?: 'alpha' | 'beta' | 'deprecated' | 'active';
|
|
4
|
+
contextLimit?: number;
|
|
5
|
+
outputLimit?: number;
|
|
6
|
+
reasoning?: boolean;
|
|
7
|
+
toolcall?: boolean;
|
|
8
|
+
attachment?: boolean;
|
|
9
|
+
tags?: string[];
|
|
10
|
+
meta?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export interface RankedModel<T extends ModelSelectionCandidate> {
|
|
13
|
+
candidate: T;
|
|
14
|
+
score: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SelectionOptions<T extends ModelSelectionCandidate> {
|
|
17
|
+
excludeModels?: string[];
|
|
18
|
+
tieBreaker?: (left: T, right: T) => number;
|
|
19
|
+
}
|
|
20
|
+
export type ScoreFunction<T extends ModelSelectionCandidate> = (candidate: T) => number;
|
|
21
|
+
export interface RoleScoring<T extends ModelSelectionCandidate> {
|
|
22
|
+
primary: ScoreFunction<T>;
|
|
23
|
+
support: ScoreFunction<T>;
|
|
24
|
+
}
|
|
25
|
+
export declare function rankModels<T extends ModelSelectionCandidate>(models: T[], scoreFn: ScoreFunction<T>, options?: SelectionOptions<T>): RankedModel<T>[];
|
|
26
|
+
export declare function pickBestModel<T extends ModelSelectionCandidate>(models: T[], scoreFn: ScoreFunction<T>, options?: SelectionOptions<T>): T | null;
|
|
27
|
+
export declare function pickPrimaryAndSupport<T extends ModelSelectionCandidate>(models: T[], scoring: RoleScoring<T>, preferredPrimaryModel?: string): {
|
|
28
|
+
primary: T | null;
|
|
29
|
+
support: T | null;
|
|
30
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DiscoveredModel, OpenCodeFreeModel } from './types';
|
|
2
|
+
export declare function parseOpenCodeModelsVerboseOutput(output: string, providerFilter?: string, freeOnly?: boolean): DiscoveredModel[];
|
|
3
|
+
export declare function discoverModelCatalog(): Promise<{
|
|
4
|
+
models: DiscoveredModel[];
|
|
5
|
+
error?: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function discoverOpenCodeFreeModels(): Promise<{
|
|
8
|
+
models: OpenCodeFreeModel[];
|
|
9
|
+
error?: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function discoverProviderFreeModels(providerID: string): Promise<{
|
|
12
|
+
models: OpenCodeFreeModel[];
|
|
13
|
+
error?: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function discoverProviderModels(providerID: string): Promise<{
|
|
16
|
+
models: DiscoveredModel[];
|
|
17
|
+
error?: string;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OpenCodeFreeModel } from './types';
|
|
2
|
+
export declare function pickBestCodingOpenCodeModel(models: OpenCodeFreeModel[]): OpenCodeFreeModel | null;
|
|
3
|
+
export declare function pickSupportOpenCodeModel(models: OpenCodeFreeModel[], primaryModel?: string): OpenCodeFreeModel | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function getConfigDir(): string;
|
|
2
|
+
export declare function getOpenCodeConfigPaths(): string[];
|
|
3
|
+
export declare function getConfigJson(): string;
|
|
4
|
+
export declare function getConfigJsonc(): string;
|
|
5
|
+
export declare function getLiteConfig(): string;
|
|
6
|
+
export declare function getLiteConfigJsonc(): string;
|
|
7
|
+
export declare function getExistingLiteConfigPath(): string;
|
|
8
|
+
export declare function getExistingConfigPath(): string;
|
|
9
|
+
export declare function ensureConfigDir(): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentResolutionProvenance } from './types';
|
|
2
|
+
export interface AgentLayerInput {
|
|
3
|
+
agentName: string;
|
|
4
|
+
openCodeDirectOverride?: string;
|
|
5
|
+
manualUserPlan?: string[];
|
|
6
|
+
pinnedModel?: string;
|
|
7
|
+
dynamicRecommendation?: string[];
|
|
8
|
+
providerFallbackPolicy?: string[];
|
|
9
|
+
systemDefault: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ResolvedAgentLayerResult {
|
|
12
|
+
model: string;
|
|
13
|
+
chain: string[];
|
|
14
|
+
provenance: AgentResolutionProvenance;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveAgentWithPrecedence(input: AgentLayerInput): ResolvedAgentLayerResult;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { InstallConfig } from './types';
|
|
2
|
+
export declare const MODEL_MAPPINGS: {
|
|
3
|
+
readonly kimi: {
|
|
4
|
+
readonly orchestrator: {
|
|
5
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
6
|
+
};
|
|
7
|
+
readonly oracle: {
|
|
8
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
9
|
+
readonly variant: "high";
|
|
10
|
+
};
|
|
11
|
+
readonly librarian: {
|
|
12
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
13
|
+
readonly variant: "low";
|
|
14
|
+
};
|
|
15
|
+
readonly explorer: {
|
|
16
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
17
|
+
readonly variant: "low";
|
|
18
|
+
};
|
|
19
|
+
readonly designer: {
|
|
20
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
21
|
+
readonly variant: "medium";
|
|
22
|
+
};
|
|
23
|
+
readonly fixer: {
|
|
24
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
25
|
+
readonly variant: "low";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
readonly openai: {
|
|
29
|
+
readonly orchestrator: {
|
|
30
|
+
readonly model: "openai/gpt-5.3-codex";
|
|
31
|
+
};
|
|
32
|
+
readonly oracle: {
|
|
33
|
+
readonly model: "openai/gpt-5.3-codex";
|
|
34
|
+
readonly variant: "high";
|
|
35
|
+
};
|
|
36
|
+
readonly librarian: {
|
|
37
|
+
readonly model: "openai/gpt-5.1-codex-mini";
|
|
38
|
+
readonly variant: "low";
|
|
39
|
+
};
|
|
40
|
+
readonly explorer: {
|
|
41
|
+
readonly model: "openai/gpt-5.1-codex-mini";
|
|
42
|
+
readonly variant: "low";
|
|
43
|
+
};
|
|
44
|
+
readonly designer: {
|
|
45
|
+
readonly model: "openai/gpt-5.1-codex-mini";
|
|
46
|
+
readonly variant: "medium";
|
|
47
|
+
};
|
|
48
|
+
readonly fixer: {
|
|
49
|
+
readonly model: "openai/gpt-5.1-codex-mini";
|
|
50
|
+
readonly variant: "low";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly anthropic: {
|
|
54
|
+
readonly orchestrator: {
|
|
55
|
+
readonly model: "anthropic/claude-opus-4-6";
|
|
56
|
+
};
|
|
57
|
+
readonly oracle: {
|
|
58
|
+
readonly model: "anthropic/claude-opus-4-6";
|
|
59
|
+
readonly variant: "high";
|
|
60
|
+
};
|
|
61
|
+
readonly librarian: {
|
|
62
|
+
readonly model: "anthropic/claude-sonnet-4-5";
|
|
63
|
+
readonly variant: "low";
|
|
64
|
+
};
|
|
65
|
+
readonly explorer: {
|
|
66
|
+
readonly model: "anthropic/claude-haiku-4-5";
|
|
67
|
+
readonly variant: "low";
|
|
68
|
+
};
|
|
69
|
+
readonly designer: {
|
|
70
|
+
readonly model: "anthropic/claude-sonnet-4-5";
|
|
71
|
+
readonly variant: "medium";
|
|
72
|
+
};
|
|
73
|
+
readonly fixer: {
|
|
74
|
+
readonly model: "anthropic/claude-sonnet-4-5";
|
|
75
|
+
readonly variant: "low";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
readonly copilot: {
|
|
79
|
+
readonly orchestrator: {
|
|
80
|
+
readonly model: "github-copilot/grok-code-fast-1";
|
|
81
|
+
};
|
|
82
|
+
readonly oracle: {
|
|
83
|
+
readonly model: "github-copilot/grok-code-fast-1";
|
|
84
|
+
readonly variant: "high";
|
|
85
|
+
};
|
|
86
|
+
readonly librarian: {
|
|
87
|
+
readonly model: "github-copilot/grok-code-fast-1";
|
|
88
|
+
readonly variant: "low";
|
|
89
|
+
};
|
|
90
|
+
readonly explorer: {
|
|
91
|
+
readonly model: "github-copilot/grok-code-fast-1";
|
|
92
|
+
readonly variant: "low";
|
|
93
|
+
};
|
|
94
|
+
readonly designer: {
|
|
95
|
+
readonly model: "github-copilot/grok-code-fast-1";
|
|
96
|
+
readonly variant: "medium";
|
|
97
|
+
};
|
|
98
|
+
readonly fixer: {
|
|
99
|
+
readonly model: "github-copilot/grok-code-fast-1";
|
|
100
|
+
readonly variant: "low";
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
readonly 'zai-plan': {
|
|
104
|
+
readonly orchestrator: {
|
|
105
|
+
readonly model: "zai-coding-plan/glm-4.7";
|
|
106
|
+
};
|
|
107
|
+
readonly oracle: {
|
|
108
|
+
readonly model: "zai-coding-plan/glm-4.7";
|
|
109
|
+
readonly variant: "high";
|
|
110
|
+
};
|
|
111
|
+
readonly librarian: {
|
|
112
|
+
readonly model: "zai-coding-plan/glm-4.7";
|
|
113
|
+
readonly variant: "low";
|
|
114
|
+
};
|
|
115
|
+
readonly explorer: {
|
|
116
|
+
readonly model: "zai-coding-plan/glm-4.7";
|
|
117
|
+
readonly variant: "low";
|
|
118
|
+
};
|
|
119
|
+
readonly designer: {
|
|
120
|
+
readonly model: "zai-coding-plan/glm-4.7";
|
|
121
|
+
readonly variant: "medium";
|
|
122
|
+
};
|
|
123
|
+
readonly fixer: {
|
|
124
|
+
readonly model: "zai-coding-plan/glm-4.7";
|
|
125
|
+
readonly variant: "low";
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
readonly antigravity: {
|
|
129
|
+
readonly orchestrator: {
|
|
130
|
+
readonly model: "google/antigravity-gemini-3-flash";
|
|
131
|
+
};
|
|
132
|
+
readonly oracle: {
|
|
133
|
+
readonly model: "google/antigravity-gemini-3.1-pro";
|
|
134
|
+
};
|
|
135
|
+
readonly librarian: {
|
|
136
|
+
readonly model: "google/antigravity-gemini-3-flash";
|
|
137
|
+
readonly variant: "low";
|
|
138
|
+
};
|
|
139
|
+
readonly explorer: {
|
|
140
|
+
readonly model: "google/antigravity-gemini-3-flash";
|
|
141
|
+
readonly variant: "low";
|
|
142
|
+
};
|
|
143
|
+
readonly designer: {
|
|
144
|
+
readonly model: "google/antigravity-gemini-3-flash";
|
|
145
|
+
readonly variant: "medium";
|
|
146
|
+
};
|
|
147
|
+
readonly fixer: {
|
|
148
|
+
readonly model: "google/antigravity-gemini-3-flash";
|
|
149
|
+
readonly variant: "low";
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
readonly chutes: {
|
|
153
|
+
readonly orchestrator: {
|
|
154
|
+
readonly model: "chutes/kimi-k2.5";
|
|
155
|
+
};
|
|
156
|
+
readonly oracle: {
|
|
157
|
+
readonly model: "chutes/kimi-k2.5";
|
|
158
|
+
readonly variant: "high";
|
|
159
|
+
};
|
|
160
|
+
readonly librarian: {
|
|
161
|
+
readonly model: "chutes/minimax-m2.1";
|
|
162
|
+
readonly variant: "low";
|
|
163
|
+
};
|
|
164
|
+
readonly explorer: {
|
|
165
|
+
readonly model: "chutes/minimax-m2.1";
|
|
166
|
+
readonly variant: "low";
|
|
167
|
+
};
|
|
168
|
+
readonly designer: {
|
|
169
|
+
readonly model: "chutes/kimi-k2.5";
|
|
170
|
+
readonly variant: "medium";
|
|
171
|
+
};
|
|
172
|
+
readonly fixer: {
|
|
173
|
+
readonly model: "chutes/minimax-m2.1";
|
|
174
|
+
readonly variant: "low";
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
readonly 'zen-free': {
|
|
178
|
+
readonly orchestrator: {
|
|
179
|
+
readonly model: "opencode/big-pickle";
|
|
180
|
+
};
|
|
181
|
+
readonly oracle: {
|
|
182
|
+
readonly model: "opencode/big-pickle";
|
|
183
|
+
readonly variant: "high";
|
|
184
|
+
};
|
|
185
|
+
readonly librarian: {
|
|
186
|
+
readonly model: "opencode/big-pickle";
|
|
187
|
+
readonly variant: "low";
|
|
188
|
+
};
|
|
189
|
+
readonly explorer: {
|
|
190
|
+
readonly model: "opencode/big-pickle";
|
|
191
|
+
readonly variant: "low";
|
|
192
|
+
};
|
|
193
|
+
readonly designer: {
|
|
194
|
+
readonly model: "opencode/big-pickle";
|
|
195
|
+
readonly variant: "medium";
|
|
196
|
+
};
|
|
197
|
+
readonly fixer: {
|
|
198
|
+
readonly model: "opencode/big-pickle";
|
|
199
|
+
readonly variant: "low";
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
export declare function generateAntigravityMixedPreset(config: InstallConfig, existingPreset?: Record<string, unknown>): Record<string, unknown>;
|
|
204
|
+
export declare function generateLiteConfig(installConfig: InstallConfig): Record<string, unknown>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DiscoveredModel, ExternalSignalMap } from '../types';
|
|
2
|
+
import type { ScoredCandidate, ScoringAgentName } from './types';
|
|
3
|
+
export declare function scoreCandidateV2(model: DiscoveredModel, agent: ScoringAgentName, externalSignals?: ExternalSignalMap): ScoredCandidate;
|
|
4
|
+
export declare function rankModelsV2(models: DiscoveredModel[], agent: ScoringAgentName, externalSignals?: ExternalSignalMap): ScoredCandidate[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DiscoveredModel, ExternalSignalMap } from '../types';
|
|
2
|
+
import type { FeatureVector, ScoringAgentName } from './types';
|
|
3
|
+
export declare function extractFeatureVector(model: DiscoveredModel, agent: ScoringAgentName, externalSignals?: ExternalSignalMap): FeatureVector;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DiscoveredModel, ExternalSignalMap } from '../types';
|
|
2
|
+
export type ScoreFeatureName = 'status' | 'context' | 'output' | 'versionBonus' | 'reasoning' | 'toolcall' | 'attachment' | 'quality' | 'coding' | 'latencyPenalty' | 'pricePenalty';
|
|
3
|
+
export type FeatureVector = Record<ScoreFeatureName, number>;
|
|
4
|
+
export type FeatureWeights = Record<ScoreFeatureName, number>;
|
|
5
|
+
export type ScoringAgentName = 'orchestrator' | 'oracle' | 'designer' | 'explorer' | 'librarian' | 'fixer';
|
|
6
|
+
export interface ScoringContext {
|
|
7
|
+
agent: ScoringAgentName;
|
|
8
|
+
externalSignals?: ExternalSignalMap;
|
|
9
|
+
}
|
|
10
|
+
export interface ScoredCandidate {
|
|
11
|
+
model: DiscoveredModel;
|
|
12
|
+
totalScore: number;
|
|
13
|
+
scoreBreakdown: {
|
|
14
|
+
features: FeatureVector;
|
|
15
|
+
weighted: FeatureVector;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A recommended skill to install via `npx skills add`.
|
|
3
|
+
*/
|
|
4
|
+
export interface RecommendedSkill {
|
|
5
|
+
/** Human-readable name for prompts */
|
|
6
|
+
name: string;
|
|
7
|
+
/** GitHub repo URL for `npx skills add` */
|
|
8
|
+
repo: string;
|
|
9
|
+
/** Skill name within the repo (--skill flag) */
|
|
10
|
+
skillName: string;
|
|
11
|
+
/** List of agents that should auto-allow this skill */
|
|
12
|
+
allowedAgents: string[];
|
|
13
|
+
/** Description shown to user during install */
|
|
14
|
+
description: string;
|
|
15
|
+
/** Optional commands to run after the skill is added */
|
|
16
|
+
postInstallCommands?: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A skill that is managed externally (e.g. user-installed) and needs
|
|
20
|
+
* permission grants but is NOT installed by this plugin's CLI.
|
|
21
|
+
*/
|
|
22
|
+
export interface PermissionOnlySkill {
|
|
23
|
+
/** Skill name — must match the name OpenCode uses for permission checks */
|
|
24
|
+
name: string;
|
|
25
|
+
/** List of agents that should auto-allow this skill */
|
|
26
|
+
allowedAgents: string[];
|
|
27
|
+
/** Human-readable description (for documentation only) */
|
|
28
|
+
description: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* List of recommended skills.
|
|
32
|
+
* Add new skills here to include them in the installation flow.
|
|
33
|
+
*/
|
|
34
|
+
export declare const RECOMMENDED_SKILLS: RecommendedSkill[];
|
|
35
|
+
/**
|
|
36
|
+
* Skills managed externally (not installed by this plugin's CLI).
|
|
37
|
+
* Entries here only affect agent permission grants — nothing is installed.
|
|
38
|
+
*/
|
|
39
|
+
export declare const PERMISSION_ONLY_SKILLS: PermissionOnlySkill[];
|
|
40
|
+
/**
|
|
41
|
+
* Install a skill using `npx skills add`.
|
|
42
|
+
* @param skill - The skill to install
|
|
43
|
+
* @returns True if installation succeeded, false otherwise
|
|
44
|
+
*/
|
|
45
|
+
export declare function installSkill(skill: RecommendedSkill): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Get permission presets for a specific agent based on recommended skills.
|
|
48
|
+
* @param agentName - The name of the agent
|
|
49
|
+
* @param skillList - Optional explicit list of skills to allow (overrides recommendations)
|
|
50
|
+
* @returns Permission rules for the skill permission type
|
|
51
|
+
*/
|
|
52
|
+
export declare function getSkillPermissionsForAgent(agentName: string, skillList?: string[]): Record<string, 'allow' | 'ask' | 'deny'>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function resolveOpenCodePath(): string;
|
|
2
|
+
export declare function isOpenCodeInstalled(): Promise<boolean>;
|
|
3
|
+
export declare function isTmuxInstalled(): Promise<boolean>;
|
|
4
|
+
export declare function getOpenCodeVersion(): Promise<string | null>;
|
|
5
|
+
export declare function getOpenCodePath(): string | null;
|
|
6
|
+
export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
export type BooleanArg = 'yes' | 'no';
|
|
2
|
+
export interface InstallArgs {
|
|
3
|
+
tui: boolean;
|
|
4
|
+
kimi?: BooleanArg;
|
|
5
|
+
openai?: BooleanArg;
|
|
6
|
+
anthropic?: BooleanArg;
|
|
7
|
+
copilot?: BooleanArg;
|
|
8
|
+
zaiPlan?: BooleanArg;
|
|
9
|
+
antigravity?: BooleanArg;
|
|
10
|
+
chutes?: BooleanArg;
|
|
11
|
+
tmux?: BooleanArg;
|
|
12
|
+
skills?: BooleanArg;
|
|
13
|
+
opencodeFree?: BooleanArg;
|
|
14
|
+
balancedSpend?: BooleanArg;
|
|
15
|
+
opencodeFreeModel?: string;
|
|
16
|
+
aaKey?: string;
|
|
17
|
+
openrouterKey?: string;
|
|
18
|
+
dryRun?: boolean;
|
|
19
|
+
modelsOnly?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface OpenCodeFreeModel {
|
|
22
|
+
providerID: string;
|
|
23
|
+
model: string;
|
|
24
|
+
name: string;
|
|
25
|
+
status: 'alpha' | 'beta' | 'deprecated' | 'active';
|
|
26
|
+
contextLimit: number;
|
|
27
|
+
outputLimit: number;
|
|
28
|
+
reasoning: boolean;
|
|
29
|
+
toolcall: boolean;
|
|
30
|
+
attachment: boolean;
|
|
31
|
+
dailyRequestLimit?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface DiscoveredModel {
|
|
34
|
+
providerID: string;
|
|
35
|
+
model: string;
|
|
36
|
+
name: string;
|
|
37
|
+
status: 'alpha' | 'beta' | 'deprecated' | 'active';
|
|
38
|
+
contextLimit: number;
|
|
39
|
+
outputLimit: number;
|
|
40
|
+
reasoning: boolean;
|
|
41
|
+
toolcall: boolean;
|
|
42
|
+
attachment: boolean;
|
|
43
|
+
dailyRequestLimit?: number;
|
|
44
|
+
costInput?: number;
|
|
45
|
+
costOutput?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface DynamicAgentAssignment {
|
|
48
|
+
model: string;
|
|
49
|
+
variant?: string;
|
|
50
|
+
}
|
|
51
|
+
export type ScoringEngineVersion = 'v1' | 'v2-shadow' | 'v2';
|
|
52
|
+
export type ResolutionLayerName = 'opencode-direct-override' | 'manual-user-plan' | 'pinned-model' | 'dynamic-recommendation' | 'provider-fallback-policy' | 'system-default';
|
|
53
|
+
export interface AgentResolutionProvenance {
|
|
54
|
+
winnerLayer: ResolutionLayerName;
|
|
55
|
+
winnerModel: string;
|
|
56
|
+
}
|
|
57
|
+
export interface DynamicPlanScoringMeta {
|
|
58
|
+
engineVersionApplied: 'v1' | 'v2';
|
|
59
|
+
shadowCompared: boolean;
|
|
60
|
+
diffs?: Record<string, {
|
|
61
|
+
v1TopModel?: string;
|
|
62
|
+
v2TopModel?: string;
|
|
63
|
+
}>;
|
|
64
|
+
}
|
|
65
|
+
export interface DynamicModelPlan {
|
|
66
|
+
agents: Record<string, DynamicAgentAssignment>;
|
|
67
|
+
chains: Record<string, string[]>;
|
|
68
|
+
provenance?: Record<string, AgentResolutionProvenance>;
|
|
69
|
+
scoring?: DynamicPlanScoringMeta;
|
|
70
|
+
}
|
|
71
|
+
export interface ExternalModelSignal {
|
|
72
|
+
qualityScore?: number;
|
|
73
|
+
codingScore?: number;
|
|
74
|
+
latencySeconds?: number;
|
|
75
|
+
inputPricePer1M?: number;
|
|
76
|
+
outputPricePer1M?: number;
|
|
77
|
+
source: 'artificial-analysis' | 'openrouter' | 'merged';
|
|
78
|
+
}
|
|
79
|
+
export type ExternalSignalMap = Record<string, ExternalModelSignal>;
|
|
80
|
+
export type ManualAgentConfig = {
|
|
81
|
+
primary: string;
|
|
82
|
+
fallback1: string;
|
|
83
|
+
fallback2: string;
|
|
84
|
+
fallback3: string;
|
|
85
|
+
};
|
|
86
|
+
export interface OpenCodeConfig {
|
|
87
|
+
plugin?: string[];
|
|
88
|
+
provider?: Record<string, unknown>;
|
|
89
|
+
agent?: Record<string, unknown>;
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
}
|
|
92
|
+
export interface InstallConfig {
|
|
93
|
+
hasKimi: boolean;
|
|
94
|
+
hasOpenAI: boolean;
|
|
95
|
+
hasAnthropic?: boolean;
|
|
96
|
+
hasCopilot?: boolean;
|
|
97
|
+
hasZaiPlan?: boolean;
|
|
98
|
+
hasAntigravity: boolean;
|
|
99
|
+
hasChutes?: boolean;
|
|
100
|
+
hasOpencodeZen: boolean;
|
|
101
|
+
useOpenCodeFreeModels?: boolean;
|
|
102
|
+
preferredOpenCodeModel?: string;
|
|
103
|
+
selectedOpenCodePrimaryModel?: string;
|
|
104
|
+
selectedOpenCodeSecondaryModel?: string;
|
|
105
|
+
availableOpenCodeFreeModels?: OpenCodeFreeModel[];
|
|
106
|
+
selectedChutesPrimaryModel?: string;
|
|
107
|
+
selectedChutesSecondaryModel?: string;
|
|
108
|
+
availableChutesModels?: DiscoveredModel[];
|
|
109
|
+
dynamicModelPlan?: DynamicModelPlan;
|
|
110
|
+
scoringEngineVersion?: ScoringEngineVersion;
|
|
111
|
+
artificialAnalysisApiKey?: string;
|
|
112
|
+
openRouterApiKey?: string;
|
|
113
|
+
balanceProviderUsage?: boolean;
|
|
114
|
+
hasTmux: boolean;
|
|
115
|
+
installSkills: boolean;
|
|
116
|
+
installCustomSkills: boolean;
|
|
117
|
+
setupMode: 'quick' | 'manual';
|
|
118
|
+
manualAgentConfigs?: Record<string, ManualAgentConfig>;
|
|
119
|
+
dryRun?: boolean;
|
|
120
|
+
modelsOnly?: boolean;
|
|
121
|
+
}
|
|
122
|
+
export interface ConfigMergeResult {
|
|
123
|
+
success: boolean;
|
|
124
|
+
configPath: string;
|
|
125
|
+
error?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface DetectedConfig {
|
|
128
|
+
isInstalled: boolean;
|
|
129
|
+
hasKimi: boolean;
|
|
130
|
+
hasOpenAI: boolean;
|
|
131
|
+
hasAnthropic?: boolean;
|
|
132
|
+
hasCopilot?: boolean;
|
|
133
|
+
hasZaiPlan?: boolean;
|
|
134
|
+
hasAntigravity: boolean;
|
|
135
|
+
hasChutes?: boolean;
|
|
136
|
+
hasOpencodeZen: boolean;
|
|
137
|
+
hasTmux: boolean;
|
|
138
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AgentName, type PluginConfig } from '.';
|
|
2
|
+
/** Default MCPs per agent - "*" means all MCPs, "!item" excludes specific MCPs */
|
|
3
|
+
export declare const DEFAULT_AGENT_MCPS: Record<AgentName, string[]>;
|
|
4
|
+
/**
|
|
5
|
+
* Parse a list with wildcard and exclusion syntax.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseList(items: string[], allAvailable: string[]): string[];
|
|
8
|
+
/**
|
|
9
|
+
* Get available MCP names from schema and config.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getAvailableMcpNames(config?: PluginConfig): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Get the MCP list for an agent (from config or defaults).
|
|
14
|
+
*/
|
|
15
|
+
export declare function getAgentMcpList(agentName: string, config?: PluginConfig): string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const AGENT_ALIASES: Record<string, string>;
|
|
2
|
+
export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "fixer"];
|
|
3
|
+
export declare const ORCHESTRATOR_NAME: "orchestrator";
|
|
4
|
+
export declare const ALL_AGENT_NAMES: readonly ["orchestrator", "explorer", "librarian", "oracle", "designer", "fixer"];
|
|
5
|
+
export type AgentName = (typeof ALL_AGENT_NAMES)[number];
|
|
6
|
+
export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly string[]>;
|
|
7
|
+
export declare const DEFAULT_MODELS: Record<AgentName, string | undefined>;
|
|
8
|
+
export declare const POLL_INTERVAL_MS = 500;
|
|
9
|
+
export declare const POLL_INTERVAL_SLOW_MS = 1000;
|
|
10
|
+
export declare const POLL_INTERVAL_BACKGROUND_MS = 2000;
|
|
11
|
+
export declare const DEFAULT_TIMEOUT_MS: number;
|
|
12
|
+
export declare const MAX_POLL_TIME_MS: number;
|
|
13
|
+
export declare const FALLBACK_FAILOVER_TIMEOUT_MS = 15000;
|
|
14
|
+
export declare const STABLE_POLLS_THRESHOLD = 3;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type PluginConfig } from './schema';
|
|
2
|
+
/**
|
|
3
|
+
* Load plugin configuration from user and project config files, merging them appropriately.
|
|
4
|
+
*
|
|
5
|
+
* Configuration is loaded from two locations:
|
|
6
|
+
* 1. User config: ~/.config/opencode/oh-my-opencode-medium.jsonc or .json (or $XDG_CONFIG_HOME)
|
|
7
|
+
* 2. Project config: <directory>/.opencode/oh-my-opencode-medium.jsonc or .json
|
|
8
|
+
*
|
|
9
|
+
* JSONC format is preferred over JSON (allows comments and trailing commas).
|
|
10
|
+
* Project config takes precedence over user config. Nested objects (agents, tmux) are
|
|
11
|
+
* deep-merged, while top-level arrays are replaced entirely by project config.
|
|
12
|
+
*
|
|
13
|
+
* @param directory - Project directory to search for .opencode config
|
|
14
|
+
* @returns Merged plugin configuration (empty object if no configs found)
|
|
15
|
+
*/
|
|
16
|
+
export declare function loadPluginConfig(directory: string): PluginConfig;
|
|
17
|
+
/**
|
|
18
|
+
* Load custom prompt for an agent from the prompts directory.
|
|
19
|
+
* Checks for {agent}.md (replaces default) and {agent}_append.md (appends to default).
|
|
20
|
+
* If preset is provided and safe for paths, it first checks {preset}/ subdirectory,
|
|
21
|
+
* then falls back to the root prompts directory.
|
|
22
|
+
*
|
|
23
|
+
* @param agentName - Name of the agent (e.g., "orchestrator", "explorer")
|
|
24
|
+
* @param preset - Optional preset name for preset-scoped prompt lookup
|
|
25
|
+
* @returns Object with prompt and/or appendPrompt if files exist
|
|
26
|
+
*/
|
|
27
|
+
export declare function loadAgentPrompt(agentName: string, preset?: string): {
|
|
28
|
+
prompt?: string;
|
|
29
|
+
appendPrompt?: string;
|
|
30
|
+
};
|