oh-my-opencode-slim 0.6.4 → 0.8.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/README.md +29 -2
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/orchestrator.d.ts +1 -1
- package/dist/background/background-manager.d.ts +44 -0
- package/dist/background/tmux-session-manager.d.ts +5 -0
- package/dist/cli/chutes-selection.d.ts +3 -0
- package/dist/cli/config-io.d.ts +5 -0
- package/dist/cli/config-manager.d.ts +8 -0
- package/dist/cli/dynamic-model-selection.d.ts +14 -0
- package/dist/cli/external-rankings.d.ts +8 -0
- package/dist/cli/index.js +2888 -166
- 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 +2 -0
- package/dist/cli/precedence-resolver.d.ts +16 -0
- package/dist/cli/providers.d.ts +127 -2
- 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/system.d.ts +2 -0
- package/dist/cli/types.d.ts +104 -0
- package/dist/config/constants.d.ts +2 -0
- package/dist/config/loader.d.ts +3 -2
- package/dist/config/schema.d.ts +119 -0
- package/dist/index.js +305 -71
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +8 -8
|
@@ -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;
|
package/dist/cli/paths.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ export declare function getOpenCodeConfigPaths(): string[];
|
|
|
3
3
|
export declare function getConfigJson(): string;
|
|
4
4
|
export declare function getConfigJsonc(): string;
|
|
5
5
|
export declare function getLiteConfig(): string;
|
|
6
|
+
export declare function getLiteConfigJsonc(): string;
|
|
7
|
+
export declare function getExistingLiteConfigPath(): string;
|
|
6
8
|
export declare function getExistingConfigPath(): string;
|
|
7
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;
|
package/dist/cli/providers.d.ts
CHANGED
|
@@ -27,10 +27,10 @@ export declare const MODEL_MAPPINGS: {
|
|
|
27
27
|
};
|
|
28
28
|
readonly openai: {
|
|
29
29
|
readonly orchestrator: {
|
|
30
|
-
readonly model: "openai/gpt-5.
|
|
30
|
+
readonly model: "openai/gpt-5.3-codex";
|
|
31
31
|
};
|
|
32
32
|
readonly oracle: {
|
|
33
|
-
readonly model: "openai/gpt-5.
|
|
33
|
+
readonly model: "openai/gpt-5.3-codex";
|
|
34
34
|
readonly variant: "high";
|
|
35
35
|
};
|
|
36
36
|
readonly librarian: {
|
|
@@ -50,6 +50,130 @@ export declare const MODEL_MAPPINGS: {
|
|
|
50
50
|
readonly variant: "low";
|
|
51
51
|
};
|
|
52
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-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
|
+
};
|
|
53
177
|
readonly 'zen-free': {
|
|
54
178
|
readonly orchestrator: {
|
|
55
179
|
readonly model: "opencode/big-pickle";
|
|
@@ -76,4 +200,5 @@ export declare const MODEL_MAPPINGS: {
|
|
|
76
200
|
};
|
|
77
201
|
};
|
|
78
202
|
};
|
|
203
|
+
export declare function generateAntigravityMixedPreset(config: InstallConfig, existingPreset?: Record<string, unknown>): Record<string, unknown>;
|
|
79
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
|
+
}
|
package/dist/cli/system.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export declare function resolveOpenCodePath(): string;
|
|
1
2
|
export declare function isOpenCodeInstalled(): Promise<boolean>;
|
|
2
3
|
export declare function isTmuxInstalled(): Promise<boolean>;
|
|
3
4
|
export declare function getOpenCodeVersion(): Promise<string | null>;
|
|
5
|
+
export declare function getOpenCodePath(): string | null;
|
|
4
6
|
export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
|
package/dist/cli/types.d.ts
CHANGED
|
@@ -3,9 +3,86 @@ export interface InstallArgs {
|
|
|
3
3
|
tui: boolean;
|
|
4
4
|
kimi?: BooleanArg;
|
|
5
5
|
openai?: BooleanArg;
|
|
6
|
+
anthropic?: BooleanArg;
|
|
7
|
+
copilot?: BooleanArg;
|
|
8
|
+
zaiPlan?: BooleanArg;
|
|
9
|
+
antigravity?: BooleanArg;
|
|
10
|
+
chutes?: BooleanArg;
|
|
6
11
|
tmux?: BooleanArg;
|
|
7
12
|
skills?: BooleanArg;
|
|
13
|
+
opencodeFree?: BooleanArg;
|
|
14
|
+
balancedSpend?: BooleanArg;
|
|
15
|
+
opencodeFreeModel?: string;
|
|
16
|
+
aaKey?: string;
|
|
17
|
+
openrouterKey?: string;
|
|
18
|
+
dryRun?: boolean;
|
|
19
|
+
modelsOnly?: boolean;
|
|
8
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
|
+
};
|
|
9
86
|
export interface OpenCodeConfig {
|
|
10
87
|
plugin?: string[];
|
|
11
88
|
provider?: Record<string, unknown>;
|
|
@@ -15,10 +92,32 @@ export interface OpenCodeConfig {
|
|
|
15
92
|
export interface InstallConfig {
|
|
16
93
|
hasKimi: boolean;
|
|
17
94
|
hasOpenAI: boolean;
|
|
95
|
+
hasAnthropic?: boolean;
|
|
96
|
+
hasCopilot?: boolean;
|
|
97
|
+
hasZaiPlan?: boolean;
|
|
98
|
+
hasAntigravity: boolean;
|
|
99
|
+
hasChutes?: boolean;
|
|
18
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;
|
|
19
114
|
hasTmux: boolean;
|
|
20
115
|
installSkills: boolean;
|
|
21
116
|
installCustomSkills: boolean;
|
|
117
|
+
setupMode: 'quick' | 'manual';
|
|
118
|
+
manualAgentConfigs?: Record<string, ManualAgentConfig>;
|
|
119
|
+
dryRun?: boolean;
|
|
120
|
+
modelsOnly?: boolean;
|
|
22
121
|
}
|
|
23
122
|
export interface ConfigMergeResult {
|
|
24
123
|
success: boolean;
|
|
@@ -29,6 +128,11 @@ export interface DetectedConfig {
|
|
|
29
128
|
isInstalled: boolean;
|
|
30
129
|
hasKimi: boolean;
|
|
31
130
|
hasOpenAI: boolean;
|
|
131
|
+
hasAnthropic?: boolean;
|
|
132
|
+
hasCopilot?: boolean;
|
|
133
|
+
hasZaiPlan?: boolean;
|
|
134
|
+
hasAntigravity: boolean;
|
|
135
|
+
hasChutes?: boolean;
|
|
32
136
|
hasOpencodeZen: boolean;
|
|
33
137
|
hasTmux: boolean;
|
|
34
138
|
}
|
|
@@ -3,10 +3,12 @@ export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle"
|
|
|
3
3
|
export declare const ORCHESTRATOR_NAME: "orchestrator";
|
|
4
4
|
export declare const ALL_AGENT_NAMES: readonly ["orchestrator", "explorer", "librarian", "oracle", "designer", "fixer"];
|
|
5
5
|
export type AgentName = (typeof ALL_AGENT_NAMES)[number];
|
|
6
|
+
export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly string[]>;
|
|
6
7
|
export declare const DEFAULT_MODELS: Record<AgentName, string>;
|
|
7
8
|
export declare const POLL_INTERVAL_MS = 500;
|
|
8
9
|
export declare const POLL_INTERVAL_SLOW_MS = 1000;
|
|
9
10
|
export declare const POLL_INTERVAL_BACKGROUND_MS = 2000;
|
|
10
11
|
export declare const DEFAULT_TIMEOUT_MS: number;
|
|
11
12
|
export declare const MAX_POLL_TIME_MS: number;
|
|
13
|
+
export declare const FALLBACK_FAILOVER_TIMEOUT_MS = 15000;
|
|
12
14
|
export declare const STABLE_POLLS_THRESHOLD = 3;
|
package/dist/config/loader.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ import { type PluginConfig } from './schema';
|
|
|
3
3
|
* Load plugin configuration from user and project config files, merging them appropriately.
|
|
4
4
|
*
|
|
5
5
|
* Configuration is loaded from two locations:
|
|
6
|
-
* 1. User config: ~/.config/opencode/oh-my-opencode-slim.json (or $XDG_CONFIG_HOME)
|
|
7
|
-
* 2. Project config: <directory>/.opencode/oh-my-opencode-slim.json
|
|
6
|
+
* 1. User config: ~/.config/opencode/oh-my-opencode-slim.jsonc or .json (or $XDG_CONFIG_HOME)
|
|
7
|
+
* 2. Project config: <directory>/.opencode/oh-my-opencode-slim.jsonc or .json
|
|
8
8
|
*
|
|
9
|
+
* JSONC format is preferred over JSON (allows comments and trailing commas).
|
|
9
10
|
* Project config takes precedence over user config. Nested objects (agents, tmux) are
|
|
10
11
|
* deep-merged, while top-level arrays are replaced entirely by project config.
|
|
11
12
|
*
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1,4 +1,54 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
declare const FALLBACK_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
|
|
3
|
+
declare const MANUAL_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
|
|
4
|
+
export declare const ManualAgentPlanSchema: z.ZodObject<{
|
|
5
|
+
primary: z.ZodString;
|
|
6
|
+
fallback1: z.ZodString;
|
|
7
|
+
fallback2: z.ZodString;
|
|
8
|
+
fallback3: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const ManualPlanSchema: z.ZodObject<{
|
|
11
|
+
orchestrator: z.ZodObject<{
|
|
12
|
+
primary: z.ZodString;
|
|
13
|
+
fallback1: z.ZodString;
|
|
14
|
+
fallback2: z.ZodString;
|
|
15
|
+
fallback3: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
oracle: z.ZodObject<{
|
|
18
|
+
primary: z.ZodString;
|
|
19
|
+
fallback1: z.ZodString;
|
|
20
|
+
fallback2: z.ZodString;
|
|
21
|
+
fallback3: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
designer: z.ZodObject<{
|
|
24
|
+
primary: z.ZodString;
|
|
25
|
+
fallback1: z.ZodString;
|
|
26
|
+
fallback2: z.ZodString;
|
|
27
|
+
fallback3: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
explorer: z.ZodObject<{
|
|
30
|
+
primary: z.ZodString;
|
|
31
|
+
fallback1: z.ZodString;
|
|
32
|
+
fallback2: z.ZodString;
|
|
33
|
+
fallback3: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
librarian: z.ZodObject<{
|
|
36
|
+
primary: z.ZodString;
|
|
37
|
+
fallback1: z.ZodString;
|
|
38
|
+
fallback2: z.ZodString;
|
|
39
|
+
fallback3: z.ZodString;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
fixer: z.ZodObject<{
|
|
42
|
+
primary: z.ZodString;
|
|
43
|
+
fallback1: z.ZodString;
|
|
44
|
+
fallback2: z.ZodString;
|
|
45
|
+
fallback3: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
export type ManualAgentName = (typeof MANUAL_AGENT_NAMES)[number];
|
|
49
|
+
export type ManualAgentPlan = z.infer<typeof ManualAgentPlanSchema>;
|
|
50
|
+
export type ManualPlan = z.infer<typeof ManualPlanSchema>;
|
|
51
|
+
export type FallbackAgentName = (typeof FALLBACK_AGENT_NAMES)[number];
|
|
2
52
|
export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
3
53
|
model: z.ZodOptional<z.ZodString>;
|
|
4
54
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -45,8 +95,65 @@ export declare const BackgroundTaskConfigSchema: z.ZodObject<{
|
|
|
45
95
|
maxConcurrentStarts: z.ZodDefault<z.ZodNumber>;
|
|
46
96
|
}, z.core.$strip>;
|
|
47
97
|
export type BackgroundTaskConfig = z.infer<typeof BackgroundTaskConfigSchema>;
|
|
98
|
+
export declare const FailoverConfigSchema: z.ZodObject<{
|
|
99
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
100
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
101
|
+
chains: z.ZodDefault<z.ZodObject<{
|
|
102
|
+
orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
|
+
designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
+
explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
106
|
+
librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
107
|
+
fixer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
108
|
+
}, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
export type FailoverConfig = z.infer<typeof FailoverConfigSchema>;
|
|
48
111
|
export declare const PluginConfigSchema: z.ZodObject<{
|
|
49
112
|
preset: z.ZodOptional<z.ZodString>;
|
|
113
|
+
scoringEngineVersion: z.ZodOptional<z.ZodEnum<{
|
|
114
|
+
v1: "v1";
|
|
115
|
+
"v2-shadow": "v2-shadow";
|
|
116
|
+
v2: "v2";
|
|
117
|
+
}>>;
|
|
118
|
+
balanceProviderUsage: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
manualPlan: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
orchestrator: z.ZodObject<{
|
|
121
|
+
primary: z.ZodString;
|
|
122
|
+
fallback1: z.ZodString;
|
|
123
|
+
fallback2: z.ZodString;
|
|
124
|
+
fallback3: z.ZodString;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
oracle: z.ZodObject<{
|
|
127
|
+
primary: z.ZodString;
|
|
128
|
+
fallback1: z.ZodString;
|
|
129
|
+
fallback2: z.ZodString;
|
|
130
|
+
fallback3: z.ZodString;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
designer: z.ZodObject<{
|
|
133
|
+
primary: z.ZodString;
|
|
134
|
+
fallback1: z.ZodString;
|
|
135
|
+
fallback2: z.ZodString;
|
|
136
|
+
fallback3: z.ZodString;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
explorer: z.ZodObject<{
|
|
139
|
+
primary: z.ZodString;
|
|
140
|
+
fallback1: z.ZodString;
|
|
141
|
+
fallback2: z.ZodString;
|
|
142
|
+
fallback3: z.ZodString;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
librarian: z.ZodObject<{
|
|
145
|
+
primary: z.ZodString;
|
|
146
|
+
fallback1: z.ZodString;
|
|
147
|
+
fallback2: z.ZodString;
|
|
148
|
+
fallback3: z.ZodString;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
fixer: z.ZodObject<{
|
|
151
|
+
primary: z.ZodString;
|
|
152
|
+
fallback1: z.ZodString;
|
|
153
|
+
fallback2: z.ZodString;
|
|
154
|
+
fallback3: z.ZodString;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
50
157
|
presets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
51
158
|
model: z.ZodOptional<z.ZodString>;
|
|
52
159
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -76,6 +183,18 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
76
183
|
background: z.ZodOptional<z.ZodObject<{
|
|
77
184
|
maxConcurrentStarts: z.ZodDefault<z.ZodNumber>;
|
|
78
185
|
}, z.core.$strip>>;
|
|
186
|
+
fallback: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
188
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
189
|
+
chains: z.ZodDefault<z.ZodObject<{
|
|
190
|
+
orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
191
|
+
oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
192
|
+
designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
193
|
+
explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
194
|
+
librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
195
|
+
fixer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
196
|
+
}, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
|
|
197
|
+
}, z.core.$strip>>;
|
|
79
198
|
}, z.core.$strip>;
|
|
80
199
|
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
81
200
|
export type { AgentName } from './constants';
|