@hasna/switcher 0.1.1 → 0.1.3
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 +146 -7
- package/dist/aider-args.d.ts +7 -0
- package/dist/aider-config.d.ts +6 -0
- package/dist/auth.d.ts +3 -0
- package/dist/cli/index.js +7548 -2558
- package/dist/cli.d.ts +2 -0
- package/dist/cline-backend.d.ts +7 -0
- package/dist/codex-model-policy.d.ts +65 -0
- package/dist/credentials.d.ts +5 -5
- package/dist/direct-launch.d.ts +3 -3
- package/dist/domain.d.ts +320 -50
- package/dist/dsh-args.d.ts +5 -0
- package/dist/gemini-bridge.d.ts +6 -0
- package/dist/gemini-config.d.ts +12 -0
- package/dist/gemini-model-policy.d.ts +56 -0
- package/dist/generated/api.d.ts +220 -21
- package/dist/harness-arguments.d.ts +1 -0
- package/dist/harness-installation.d.ts +19 -0
- package/dist/harness-types.d.ts +10 -0
- package/dist/harnesses.d.ts +5 -2
- package/dist/hermes-backend.d.ts +19 -0
- package/dist/hermes-model-policy.d.ts +30 -0
- package/dist/index.js +136 -43
- package/dist/inference-gateway.d.ts +24 -0
- package/dist/kilo-config.d.ts +13 -0
- package/dist/kilo.d.ts +5 -0
- package/dist/launcher.d.ts +12 -6
- package/dist/mcp/index.js +139 -55
- package/dist/model-policy-schema.d.ts +137 -0
- package/dist/model-policy.d.ts +31 -0
- package/dist/native-model-policy.d.ts +23 -0
- package/dist/omp-backend.d.ts +7 -0
- package/dist/opencode-model-policy.d.ts +33 -0
- package/dist/opencode2-config.d.ts +3 -3
- package/dist/ori-backend.d.ts +2 -2
- package/dist/ori-model-policy.d.ts +8 -0
- package/dist/presets.d.ts +11 -10
- package/dist/sdk.d.ts +279 -38
- package/dist/sdk.js +136 -43
- package/dist/serve/index.js +1306 -125
- package/docs/MODEL-POLICY.md +82 -0
- package/openapi.json +973 -14
- package/package.json +14 -3
package/dist/domain.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
import { type RoutingEvent } from "./model-policy-schema";
|
|
3
|
+
export { modelPolicySchema, routingEventSchema, routingEventsSchema } from "./model-policy-schema";
|
|
4
|
+
export type { ModelPolicy, RoutingEvent } from "./model-policy-schema";
|
|
5
|
+
export type { AuthStyle } from "./auth";
|
|
6
|
+
export declare const VERSION = "0.1.3";
|
|
7
|
+
export declare const harnessSchema: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
|
|
8
|
+
export declare const protocolSchema: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
|
|
5
9
|
export declare const idSchema: z.ZodString;
|
|
6
10
|
export declare function endpoint(value: string): string;
|
|
7
11
|
export declare const modelSchema: z.ZodObject<{
|
|
@@ -14,6 +18,7 @@ export declare const modelSchema: z.ZodObject<{
|
|
|
14
18
|
inputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
19
|
outputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16
20
|
supportedParameters: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
|
+
supportedGenerationMethods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
22
|
}, "strict", z.ZodTypeAny, {
|
|
18
23
|
id: string;
|
|
19
24
|
name: string;
|
|
@@ -24,6 +29,7 @@ export declare const modelSchema: z.ZodObject<{
|
|
|
24
29
|
inputModalities?: string[] | undefined;
|
|
25
30
|
outputModalities?: string[] | undefined;
|
|
26
31
|
supportedParameters?: string[] | undefined;
|
|
32
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
27
33
|
}, {
|
|
28
34
|
id: string;
|
|
29
35
|
name: string;
|
|
@@ -34,17 +40,18 @@ export declare const modelSchema: z.ZodObject<{
|
|
|
34
40
|
inputModalities?: string[] | undefined;
|
|
35
41
|
outputModalities?: string[] | undefined;
|
|
36
42
|
supportedParameters?: string[] | undefined;
|
|
43
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
37
44
|
}>;
|
|
38
45
|
export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
39
46
|
id: z.ZodString;
|
|
40
47
|
name: z.ZodString;
|
|
41
48
|
baseUrl: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
42
|
-
protocol: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat"]>;
|
|
49
|
+
protocol: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
|
|
43
50
|
credentialEnv: z.ZodOptional<z.ZodString>;
|
|
44
|
-
authStyle: z.ZodDefault<z.ZodEnum<["bearer", "x-api-key"]>>;
|
|
51
|
+
authStyle: z.ZodDefault<z.ZodEnum<["bearer", "x-api-key", "api-key"]>>;
|
|
45
52
|
catalogBaseUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
46
|
-
catalogFormat: z.ZodOptional<z.ZodEnum<["openai", "ollama", "mistral", "together", "fireworks", "dashscope", "none"]>>;
|
|
47
|
-
catalogAuthStyle: z.ZodOptional<z.ZodEnum<["bearer", "x-api-key", "none"]>>;
|
|
53
|
+
catalogFormat: z.ZodOptional<z.ZodEnum<["openai", "ollama", "mistral", "together", "fireworks", "dashscope", "gemini", "none"]>>;
|
|
54
|
+
catalogAuthStyle: z.ZodOptional<z.ZodEnum<["bearer", "x-api-key", "api-key", "none"]>>;
|
|
48
55
|
catalogCredentialEnv: z.ZodOptional<z.ZodString>;
|
|
49
56
|
catalogAccountId: z.ZodOptional<z.ZodString>;
|
|
50
57
|
modelsPath: z.ZodDefault<z.ZodString>;
|
|
@@ -58,6 +65,7 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
58
65
|
inputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
59
66
|
outputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
60
67
|
supportedParameters: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
68
|
+
supportedGenerationMethods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
61
69
|
}, "strict", z.ZodTypeAny, {
|
|
62
70
|
id: string;
|
|
63
71
|
name: string;
|
|
@@ -68,6 +76,7 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
68
76
|
inputModalities?: string[] | undefined;
|
|
69
77
|
outputModalities?: string[] | undefined;
|
|
70
78
|
supportedParameters?: string[] | undefined;
|
|
79
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
71
80
|
}, {
|
|
72
81
|
id: string;
|
|
73
82
|
name: string;
|
|
@@ -78,13 +87,14 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
78
87
|
inputModalities?: string[] | undefined;
|
|
79
88
|
outputModalities?: string[] | undefined;
|
|
80
89
|
supportedParameters?: string[] | undefined;
|
|
90
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
81
91
|
}>, "many">>;
|
|
82
92
|
}, "strict", z.ZodTypeAny, {
|
|
83
93
|
id: string;
|
|
84
94
|
name: string;
|
|
85
95
|
baseUrl: string;
|
|
86
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
87
|
-
authStyle: "bearer" | "x-api-key";
|
|
96
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
97
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
88
98
|
modelsPath: string;
|
|
89
99
|
manualModels: {
|
|
90
100
|
id: string;
|
|
@@ -96,23 +106,24 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
96
106
|
inputModalities?: string[] | undefined;
|
|
97
107
|
outputModalities?: string[] | undefined;
|
|
98
108
|
supportedParameters?: string[] | undefined;
|
|
109
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
99
110
|
}[];
|
|
100
111
|
credentialEnv?: string | undefined;
|
|
101
112
|
catalogBaseUrl?: string | undefined;
|
|
102
|
-
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none" | undefined;
|
|
103
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none" | undefined;
|
|
113
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
114
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
104
115
|
catalogCredentialEnv?: string | undefined;
|
|
105
116
|
catalogAccountId?: string | undefined;
|
|
106
117
|
}, {
|
|
107
118
|
id: string;
|
|
108
119
|
name: string;
|
|
109
120
|
baseUrl: string;
|
|
110
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
121
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
111
122
|
credentialEnv?: string | undefined;
|
|
112
|
-
authStyle?: "bearer" | "x-api-key" | undefined;
|
|
123
|
+
authStyle?: "bearer" | "x-api-key" | "api-key" | undefined;
|
|
113
124
|
catalogBaseUrl?: string | undefined;
|
|
114
|
-
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none" | undefined;
|
|
115
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none" | undefined;
|
|
125
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
126
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
116
127
|
catalogCredentialEnv?: string | undefined;
|
|
117
128
|
catalogAccountId?: string | undefined;
|
|
118
129
|
modelsPath?: string | undefined;
|
|
@@ -126,13 +137,14 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
126
137
|
inputModalities?: string[] | undefined;
|
|
127
138
|
outputModalities?: string[] | undefined;
|
|
128
139
|
supportedParameters?: string[] | undefined;
|
|
140
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
129
141
|
}[] | undefined;
|
|
130
142
|
}>, {
|
|
131
143
|
id: string;
|
|
132
144
|
name: string;
|
|
133
145
|
baseUrl: string;
|
|
134
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
135
|
-
authStyle: "bearer" | "x-api-key";
|
|
146
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
147
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
136
148
|
modelsPath: string;
|
|
137
149
|
manualModels: {
|
|
138
150
|
id: string;
|
|
@@ -144,23 +156,24 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
144
156
|
inputModalities?: string[] | undefined;
|
|
145
157
|
outputModalities?: string[] | undefined;
|
|
146
158
|
supportedParameters?: string[] | undefined;
|
|
159
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
147
160
|
}[];
|
|
148
161
|
credentialEnv?: string | undefined;
|
|
149
162
|
catalogBaseUrl?: string | undefined;
|
|
150
|
-
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none" | undefined;
|
|
151
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none" | undefined;
|
|
163
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
164
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
152
165
|
catalogCredentialEnv?: string | undefined;
|
|
153
166
|
catalogAccountId?: string | undefined;
|
|
154
167
|
}, {
|
|
155
168
|
id: string;
|
|
156
169
|
name: string;
|
|
157
170
|
baseUrl: string;
|
|
158
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
171
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
159
172
|
credentialEnv?: string | undefined;
|
|
160
|
-
authStyle?: "bearer" | "x-api-key" | undefined;
|
|
173
|
+
authStyle?: "bearer" | "x-api-key" | "api-key" | undefined;
|
|
161
174
|
catalogBaseUrl?: string | undefined;
|
|
162
|
-
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none" | undefined;
|
|
163
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none" | undefined;
|
|
175
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
176
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
164
177
|
catalogCredentialEnv?: string | undefined;
|
|
165
178
|
catalogAccountId?: string | undefined;
|
|
166
179
|
modelsPath?: string | undefined;
|
|
@@ -174,6 +187,7 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
174
187
|
inputModalities?: string[] | undefined;
|
|
175
188
|
outputModalities?: string[] | undefined;
|
|
176
189
|
supportedParameters?: string[] | undefined;
|
|
190
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
177
191
|
}[] | undefined;
|
|
178
192
|
}>;
|
|
179
193
|
export declare const providerPresetSchema: z.ZodObject<{
|
|
@@ -182,32 +196,32 @@ export declare const providerPresetSchema: z.ZodObject<{
|
|
|
182
196
|
credentialEnv: z.ZodOptional<z.ZodString>;
|
|
183
197
|
credentialAliases: z.ZodArray<z.ZodString, "many">;
|
|
184
198
|
protocols: z.ZodArray<z.ZodObject<{
|
|
185
|
-
protocol: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat"]>;
|
|
199
|
+
protocol: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
|
|
186
200
|
baseUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
187
|
-
authStyle: z.ZodEnum<["bearer", "x-api-key"]>;
|
|
201
|
+
authStyle: z.ZodEnum<["bearer", "x-api-key", "api-key"]>;
|
|
188
202
|
catalogBaseUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
189
|
-
catalogFormat: z.ZodEnum<["openai", "ollama", "mistral", "together", "fireworks", "dashscope", "none"]>;
|
|
190
|
-
catalogAuthStyle: z.ZodOptional<z.ZodEnum<["bearer", "x-api-key", "none"]>>;
|
|
203
|
+
catalogFormat: z.ZodEnum<["openai", "ollama", "mistral", "together", "fireworks", "dashscope", "gemini", "none"]>;
|
|
204
|
+
catalogAuthStyle: z.ZodOptional<z.ZodEnum<["bearer", "x-api-key", "api-key", "none"]>>;
|
|
191
205
|
modelsPath: z.ZodString;
|
|
192
206
|
notes: z.ZodArray<z.ZodString, "many">;
|
|
193
207
|
}, "strict", z.ZodTypeAny, {
|
|
194
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
195
|
-
authStyle: "bearer" | "x-api-key";
|
|
196
|
-
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
208
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
209
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
210
|
+
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
197
211
|
modelsPath: string;
|
|
198
212
|
notes: string[];
|
|
199
213
|
baseUrl?: string | undefined;
|
|
200
214
|
catalogBaseUrl?: string | undefined;
|
|
201
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none" | undefined;
|
|
215
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
202
216
|
}, {
|
|
203
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
204
|
-
authStyle: "bearer" | "x-api-key";
|
|
205
|
-
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
217
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
218
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
219
|
+
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
206
220
|
modelsPath: string;
|
|
207
221
|
notes: string[];
|
|
208
222
|
baseUrl?: string | undefined;
|
|
209
223
|
catalogBaseUrl?: string | undefined;
|
|
210
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none" | undefined;
|
|
224
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
211
225
|
}>, "many">;
|
|
212
226
|
sources: z.ZodArray<z.ZodString, "many">;
|
|
213
227
|
verification: z.ZodLiteral<"documented">;
|
|
@@ -216,14 +230,14 @@ export declare const providerPresetSchema: z.ZodObject<{
|
|
|
216
230
|
name: string;
|
|
217
231
|
credentialAliases: string[];
|
|
218
232
|
protocols: {
|
|
219
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
220
|
-
authStyle: "bearer" | "x-api-key";
|
|
221
|
-
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
233
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
234
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
235
|
+
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
222
236
|
modelsPath: string;
|
|
223
237
|
notes: string[];
|
|
224
238
|
baseUrl?: string | undefined;
|
|
225
239
|
catalogBaseUrl?: string | undefined;
|
|
226
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none" | undefined;
|
|
240
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
227
241
|
}[];
|
|
228
242
|
sources: string[];
|
|
229
243
|
verification: "documented";
|
|
@@ -233,14 +247,14 @@ export declare const providerPresetSchema: z.ZodObject<{
|
|
|
233
247
|
name: string;
|
|
234
248
|
credentialAliases: string[];
|
|
235
249
|
protocols: {
|
|
236
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
237
|
-
authStyle: "bearer" | "x-api-key";
|
|
238
|
-
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
250
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
251
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
252
|
+
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
239
253
|
modelsPath: string;
|
|
240
254
|
notes: string[];
|
|
241
255
|
baseUrl?: string | undefined;
|
|
242
256
|
catalogBaseUrl?: string | undefined;
|
|
243
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none" | undefined;
|
|
257
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
244
258
|
}[];
|
|
245
259
|
sources: string[];
|
|
246
260
|
verification: "documented";
|
|
@@ -251,46 +265,297 @@ export declare const profileInputSchema: z.ZodObject<{
|
|
|
251
265
|
id: z.ZodString;
|
|
252
266
|
name: z.ZodString;
|
|
253
267
|
providerId: z.ZodString;
|
|
254
|
-
harness: z.ZodEnum<["claude", "codex", "grok", "opencode2", "pi"]>;
|
|
268
|
+
harness: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
|
|
255
269
|
model: z.ZodString;
|
|
270
|
+
modelPolicy: z.ZodOptional<z.ZodObject<{
|
|
271
|
+
version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
272
|
+
roles: z.ZodOptional<z.ZodObject<{
|
|
273
|
+
subagent: z.ZodOptional<z.ZodString>;
|
|
274
|
+
fast: z.ZodOptional<z.ZodString>;
|
|
275
|
+
planning: z.ZodOptional<z.ZodString>;
|
|
276
|
+
review: z.ZodOptional<z.ZodString>;
|
|
277
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
278
|
+
compaction: z.ZodOptional<z.ZodString>;
|
|
279
|
+
weak: z.ZodOptional<z.ZodString>;
|
|
280
|
+
editor: z.ZodOptional<z.ZodString>;
|
|
281
|
+
}, "strict", z.ZodTypeAny, {
|
|
282
|
+
subagent?: string | undefined;
|
|
283
|
+
fast?: string | undefined;
|
|
284
|
+
planning?: string | undefined;
|
|
285
|
+
review?: string | undefined;
|
|
286
|
+
summary?: string | undefined;
|
|
287
|
+
compaction?: string | undefined;
|
|
288
|
+
weak?: string | undefined;
|
|
289
|
+
editor?: string | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
subagent?: string | undefined;
|
|
292
|
+
fast?: string | undefined;
|
|
293
|
+
planning?: string | undefined;
|
|
294
|
+
review?: string | undefined;
|
|
295
|
+
summary?: string | undefined;
|
|
296
|
+
compaction?: string | undefined;
|
|
297
|
+
weak?: string | undefined;
|
|
298
|
+
editor?: string | undefined;
|
|
299
|
+
}>>;
|
|
300
|
+
allowedModels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
301
|
+
aliases: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodEffects<z.ZodString, string, string>, z.ZodString>, Record<string, string>, Record<string, string>>>;
|
|
302
|
+
fallbacks: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>, Record<string, string[]>, Record<string, string[]>>>;
|
|
303
|
+
}, "strict", z.ZodTypeAny, {
|
|
304
|
+
version: 1;
|
|
305
|
+
roles?: {
|
|
306
|
+
subagent?: string | undefined;
|
|
307
|
+
fast?: string | undefined;
|
|
308
|
+
planning?: string | undefined;
|
|
309
|
+
review?: string | undefined;
|
|
310
|
+
summary?: string | undefined;
|
|
311
|
+
compaction?: string | undefined;
|
|
312
|
+
weak?: string | undefined;
|
|
313
|
+
editor?: string | undefined;
|
|
314
|
+
} | undefined;
|
|
315
|
+
allowedModels?: string[] | undefined;
|
|
316
|
+
aliases?: Record<string, string> | undefined;
|
|
317
|
+
fallbacks?: Record<string, string[]> | undefined;
|
|
318
|
+
}, {
|
|
319
|
+
version?: 1 | undefined;
|
|
320
|
+
roles?: {
|
|
321
|
+
subagent?: string | undefined;
|
|
322
|
+
fast?: string | undefined;
|
|
323
|
+
planning?: string | undefined;
|
|
324
|
+
review?: string | undefined;
|
|
325
|
+
summary?: string | undefined;
|
|
326
|
+
compaction?: string | undefined;
|
|
327
|
+
weak?: string | undefined;
|
|
328
|
+
editor?: string | undefined;
|
|
329
|
+
} | undefined;
|
|
330
|
+
allowedModels?: string[] | undefined;
|
|
331
|
+
aliases?: Record<string, string> | undefined;
|
|
332
|
+
fallbacks?: Record<string, string[]> | undefined;
|
|
333
|
+
}>>;
|
|
256
334
|
}, "strict", z.ZodTypeAny, {
|
|
257
335
|
id: string;
|
|
258
336
|
name: string;
|
|
259
337
|
providerId: string;
|
|
260
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
338
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
261
339
|
model: string;
|
|
340
|
+
modelPolicy?: {
|
|
341
|
+
version: 1;
|
|
342
|
+
roles?: {
|
|
343
|
+
subagent?: string | undefined;
|
|
344
|
+
fast?: string | undefined;
|
|
345
|
+
planning?: string | undefined;
|
|
346
|
+
review?: string | undefined;
|
|
347
|
+
summary?: string | undefined;
|
|
348
|
+
compaction?: string | undefined;
|
|
349
|
+
weak?: string | undefined;
|
|
350
|
+
editor?: string | undefined;
|
|
351
|
+
} | undefined;
|
|
352
|
+
allowedModels?: string[] | undefined;
|
|
353
|
+
aliases?: Record<string, string> | undefined;
|
|
354
|
+
fallbacks?: Record<string, string[]> | undefined;
|
|
355
|
+
} | undefined;
|
|
262
356
|
}, {
|
|
263
357
|
id: string;
|
|
264
358
|
name: string;
|
|
265
359
|
providerId: string;
|
|
266
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
360
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
267
361
|
model: string;
|
|
362
|
+
modelPolicy?: {
|
|
363
|
+
version?: 1 | undefined;
|
|
364
|
+
roles?: {
|
|
365
|
+
subagent?: string | undefined;
|
|
366
|
+
fast?: string | undefined;
|
|
367
|
+
planning?: string | undefined;
|
|
368
|
+
review?: string | undefined;
|
|
369
|
+
summary?: string | undefined;
|
|
370
|
+
compaction?: string | undefined;
|
|
371
|
+
weak?: string | undefined;
|
|
372
|
+
editor?: string | undefined;
|
|
373
|
+
} | undefined;
|
|
374
|
+
allowedModels?: string[] | undefined;
|
|
375
|
+
aliases?: Record<string, string> | undefined;
|
|
376
|
+
fallbacks?: Record<string, string[]> | undefined;
|
|
377
|
+
} | undefined;
|
|
268
378
|
}>;
|
|
269
379
|
export declare const runInputSchema: z.ZodObject<{
|
|
380
|
+
modelPolicyVersion: z.ZodLiteral<1>;
|
|
270
381
|
profileId: z.ZodString;
|
|
271
|
-
harness: z.ZodEnum<["claude", "codex", "grok", "opencode2", "pi"]>;
|
|
382
|
+
harness: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
|
|
272
383
|
model: z.ZodString;
|
|
384
|
+
modelPolicy: z.ZodOptional<z.ZodObject<{
|
|
385
|
+
version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
386
|
+
roles: z.ZodOptional<z.ZodObject<{
|
|
387
|
+
subagent: z.ZodOptional<z.ZodString>;
|
|
388
|
+
fast: z.ZodOptional<z.ZodString>;
|
|
389
|
+
planning: z.ZodOptional<z.ZodString>;
|
|
390
|
+
review: z.ZodOptional<z.ZodString>;
|
|
391
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
392
|
+
compaction: z.ZodOptional<z.ZodString>;
|
|
393
|
+
weak: z.ZodOptional<z.ZodString>;
|
|
394
|
+
editor: z.ZodOptional<z.ZodString>;
|
|
395
|
+
}, "strict", z.ZodTypeAny, {
|
|
396
|
+
subagent?: string | undefined;
|
|
397
|
+
fast?: string | undefined;
|
|
398
|
+
planning?: string | undefined;
|
|
399
|
+
review?: string | undefined;
|
|
400
|
+
summary?: string | undefined;
|
|
401
|
+
compaction?: string | undefined;
|
|
402
|
+
weak?: string | undefined;
|
|
403
|
+
editor?: string | undefined;
|
|
404
|
+
}, {
|
|
405
|
+
subagent?: string | undefined;
|
|
406
|
+
fast?: string | undefined;
|
|
407
|
+
planning?: string | undefined;
|
|
408
|
+
review?: string | undefined;
|
|
409
|
+
summary?: string | undefined;
|
|
410
|
+
compaction?: string | undefined;
|
|
411
|
+
weak?: string | undefined;
|
|
412
|
+
editor?: string | undefined;
|
|
413
|
+
}>>;
|
|
414
|
+
allowedModels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
415
|
+
aliases: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodEffects<z.ZodString, string, string>, z.ZodString>, Record<string, string>, Record<string, string>>>;
|
|
416
|
+
fallbacks: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>, Record<string, string[]>, Record<string, string[]>>>;
|
|
417
|
+
}, "strict", z.ZodTypeAny, {
|
|
418
|
+
version: 1;
|
|
419
|
+
roles?: {
|
|
420
|
+
subagent?: string | undefined;
|
|
421
|
+
fast?: string | undefined;
|
|
422
|
+
planning?: string | undefined;
|
|
423
|
+
review?: string | undefined;
|
|
424
|
+
summary?: string | undefined;
|
|
425
|
+
compaction?: string | undefined;
|
|
426
|
+
weak?: string | undefined;
|
|
427
|
+
editor?: string | undefined;
|
|
428
|
+
} | undefined;
|
|
429
|
+
allowedModels?: string[] | undefined;
|
|
430
|
+
aliases?: Record<string, string> | undefined;
|
|
431
|
+
fallbacks?: Record<string, string[]> | undefined;
|
|
432
|
+
}, {
|
|
433
|
+
version?: 1 | undefined;
|
|
434
|
+
roles?: {
|
|
435
|
+
subagent?: string | undefined;
|
|
436
|
+
fast?: string | undefined;
|
|
437
|
+
planning?: string | undefined;
|
|
438
|
+
review?: string | undefined;
|
|
439
|
+
summary?: string | undefined;
|
|
440
|
+
compaction?: string | undefined;
|
|
441
|
+
weak?: string | undefined;
|
|
442
|
+
editor?: string | undefined;
|
|
443
|
+
} | undefined;
|
|
444
|
+
allowedModels?: string[] | undefined;
|
|
445
|
+
aliases?: Record<string, string> | undefined;
|
|
446
|
+
fallbacks?: Record<string, string[]> | undefined;
|
|
447
|
+
}>>;
|
|
273
448
|
planToken: z.ZodString;
|
|
274
449
|
}, "strict", z.ZodTypeAny, {
|
|
275
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
450
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
276
451
|
model: string;
|
|
452
|
+
modelPolicyVersion: 1;
|
|
277
453
|
profileId: string;
|
|
278
454
|
planToken: string;
|
|
455
|
+
modelPolicy?: {
|
|
456
|
+
version: 1;
|
|
457
|
+
roles?: {
|
|
458
|
+
subagent?: string | undefined;
|
|
459
|
+
fast?: string | undefined;
|
|
460
|
+
planning?: string | undefined;
|
|
461
|
+
review?: string | undefined;
|
|
462
|
+
summary?: string | undefined;
|
|
463
|
+
compaction?: string | undefined;
|
|
464
|
+
weak?: string | undefined;
|
|
465
|
+
editor?: string | undefined;
|
|
466
|
+
} | undefined;
|
|
467
|
+
allowedModels?: string[] | undefined;
|
|
468
|
+
aliases?: Record<string, string> | undefined;
|
|
469
|
+
fallbacks?: Record<string, string[]> | undefined;
|
|
470
|
+
} | undefined;
|
|
279
471
|
}, {
|
|
280
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
472
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
281
473
|
model: string;
|
|
474
|
+
modelPolicyVersion: 1;
|
|
282
475
|
profileId: string;
|
|
283
476
|
planToken: string;
|
|
477
|
+
modelPolicy?: {
|
|
478
|
+
version?: 1 | undefined;
|
|
479
|
+
roles?: {
|
|
480
|
+
subagent?: string | undefined;
|
|
481
|
+
fast?: string | undefined;
|
|
482
|
+
planning?: string | undefined;
|
|
483
|
+
review?: string | undefined;
|
|
484
|
+
summary?: string | undefined;
|
|
485
|
+
compaction?: string | undefined;
|
|
486
|
+
weak?: string | undefined;
|
|
487
|
+
editor?: string | undefined;
|
|
488
|
+
} | undefined;
|
|
489
|
+
allowedModels?: string[] | undefined;
|
|
490
|
+
aliases?: Record<string, string> | undefined;
|
|
491
|
+
fallbacks?: Record<string, string[]> | undefined;
|
|
492
|
+
} | undefined;
|
|
284
493
|
}>;
|
|
285
494
|
export declare const runUpdateSchema: z.ZodObject<{
|
|
286
495
|
status: z.ZodEnum<["exited", "failed", "interrupted"]>;
|
|
287
496
|
exitCode: z.ZodNumber;
|
|
497
|
+
routingEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
498
|
+
at: z.ZodString;
|
|
499
|
+
requestId: z.ZodString;
|
|
500
|
+
requestedModel: z.ZodString;
|
|
501
|
+
resolvedModel: z.ZodOptional<z.ZodString>;
|
|
502
|
+
reportedModel: z.ZodOptional<z.ZodString>;
|
|
503
|
+
decision: z.ZodEnum<["allow", "alias", "reject", "fallback"]>;
|
|
504
|
+
role: z.ZodOptional<z.ZodEnum<["main", "subagent", "fast", "planning", "review", "summary", "compaction", "weak", "editor"]>>;
|
|
505
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
506
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
507
|
+
}, "strict", z.ZodTypeAny, {
|
|
508
|
+
at: string;
|
|
509
|
+
requestId: string;
|
|
510
|
+
requestedModel: string;
|
|
511
|
+
decision: "allow" | "alias" | "reject" | "fallback";
|
|
512
|
+
resolvedModel?: string | undefined;
|
|
513
|
+
reportedModel?: string | undefined;
|
|
514
|
+
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor" | undefined;
|
|
515
|
+
reason?: string | undefined;
|
|
516
|
+
upstreamStatus?: number | undefined;
|
|
517
|
+
}, {
|
|
518
|
+
at: string;
|
|
519
|
+
requestId: string;
|
|
520
|
+
requestedModel: string;
|
|
521
|
+
decision: "allow" | "alias" | "reject" | "fallback";
|
|
522
|
+
resolvedModel?: string | undefined;
|
|
523
|
+
reportedModel?: string | undefined;
|
|
524
|
+
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor" | undefined;
|
|
525
|
+
reason?: string | undefined;
|
|
526
|
+
upstreamStatus?: number | undefined;
|
|
527
|
+
}>, "many">>;
|
|
528
|
+
routingEventsDropped: z.ZodOptional<z.ZodNumber>;
|
|
288
529
|
}, "strict", z.ZodTypeAny, {
|
|
289
530
|
status: "exited" | "failed" | "interrupted";
|
|
290
531
|
exitCode: number;
|
|
532
|
+
routingEvents?: {
|
|
533
|
+
at: string;
|
|
534
|
+
requestId: string;
|
|
535
|
+
requestedModel: string;
|
|
536
|
+
decision: "allow" | "alias" | "reject" | "fallback";
|
|
537
|
+
resolvedModel?: string | undefined;
|
|
538
|
+
reportedModel?: string | undefined;
|
|
539
|
+
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor" | undefined;
|
|
540
|
+
reason?: string | undefined;
|
|
541
|
+
upstreamStatus?: number | undefined;
|
|
542
|
+
}[] | undefined;
|
|
543
|
+
routingEventsDropped?: number | undefined;
|
|
291
544
|
}, {
|
|
292
545
|
status: "exited" | "failed" | "interrupted";
|
|
293
546
|
exitCode: number;
|
|
547
|
+
routingEvents?: {
|
|
548
|
+
at: string;
|
|
549
|
+
requestId: string;
|
|
550
|
+
requestedModel: string;
|
|
551
|
+
decision: "allow" | "alias" | "reject" | "fallback";
|
|
552
|
+
resolvedModel?: string | undefined;
|
|
553
|
+
reportedModel?: string | undefined;
|
|
554
|
+
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor" | undefined;
|
|
555
|
+
reason?: string | undefined;
|
|
556
|
+
upstreamStatus?: number | undefined;
|
|
557
|
+
}[] | undefined;
|
|
558
|
+
routingEventsDropped?: number | undefined;
|
|
294
559
|
}>;
|
|
295
560
|
export type ProviderInput = z.input<typeof providerInputSchema>;
|
|
296
561
|
export type Provider = z.output<typeof providerInputSchema> & {
|
|
@@ -303,7 +568,8 @@ export type Profile = ProfileInput & {
|
|
|
303
568
|
updatedAt: string;
|
|
304
569
|
};
|
|
305
570
|
export type Model = z.infer<typeof modelSchema>;
|
|
306
|
-
export type Run = z.infer<typeof runInputSchema> & {
|
|
571
|
+
export type Run = Omit<z.infer<typeof runInputSchema>, "modelPolicyVersion"> & {
|
|
572
|
+
modelPolicyVersion?: 1;
|
|
307
573
|
providerId: string;
|
|
308
574
|
providerVersion: number;
|
|
309
575
|
profileVersion: number;
|
|
@@ -312,6 +578,8 @@ export type Run = z.infer<typeof runInputSchema> & {
|
|
|
312
578
|
startedAt: string;
|
|
313
579
|
endedAt?: string;
|
|
314
580
|
exitCode?: number;
|
|
581
|
+
routingEvents?: RoutingEvent[];
|
|
582
|
+
routingEventsDropped?: number;
|
|
315
583
|
version: number;
|
|
316
584
|
updatedAt: string;
|
|
317
585
|
};
|
|
@@ -338,4 +606,6 @@ export declare class CommandInterrupted extends Fault {
|
|
|
338
606
|
}
|
|
339
607
|
export declare function parse<T>(schema: z.ZodType<T, any, any>, value: unknown): T;
|
|
340
608
|
export declare function compatible(harness: Profile["harness"], protocol: Provider["protocol"]): boolean;
|
|
609
|
+
export declare function validateHarnessProvider(harness: Profile["harness"], provider: Pick<Provider, "protocol" | "authStyle">): void;
|
|
341
610
|
export declare function codingEligible(model: Model): boolean;
|
|
611
|
+
export declare function harnessEligible(model: Model, harness: Profile["harness"]): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HarnessLaunchInput, PreparedLaunch } from "./harness-types";
|
|
2
|
+
type Settings = Record<string, any>;
|
|
3
|
+
export declare function validateGeminiConfiguration(cwd: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
4
|
+
home: string;
|
|
5
|
+
defaults: Settings;
|
|
6
|
+
user: Settings;
|
|
7
|
+
system: Settings;
|
|
8
|
+
contextNames: string[];
|
|
9
|
+
trustPath: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function prepareGemini(input: HarnessLaunchInput): Promise<PreparedLaunch>;
|
|
12
|
+
export {};
|