@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/sdk.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export type ProviderInput = components["schemas"]["ProviderInput"];
|
|
|
5
5
|
export type Provider = components["schemas"]["Provider"];
|
|
6
6
|
export type ProfileInput = components["schemas"]["ProfileInput"];
|
|
7
7
|
export type Profile = components["schemas"]["Profile"];
|
|
8
|
+
export type ModelPolicy = components["schemas"]["ModelPolicy"];
|
|
9
|
+
export type RoutingEvent = components["schemas"]["RoutingEvent"];
|
|
8
10
|
export type Model = components["schemas"]["Model"];
|
|
9
11
|
export type Catalog = components["schemas"]["Catalog"];
|
|
10
12
|
export type LaunchPlan = components["schemas"]["LaunchPlan"];
|
|
@@ -57,12 +59,12 @@ export declare class SwitcherClient {
|
|
|
57
59
|
credentialEnv?: string;
|
|
58
60
|
credentialAliases: string[];
|
|
59
61
|
protocols: {
|
|
60
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
62
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
61
63
|
baseUrl?: string;
|
|
62
|
-
authStyle: "bearer" | "x-api-key";
|
|
64
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
63
65
|
catalogBaseUrl?: string;
|
|
64
|
-
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
65
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none";
|
|
66
|
+
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
67
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none";
|
|
66
68
|
modelsPath: string;
|
|
67
69
|
notes: string[];
|
|
68
70
|
}[];
|
|
@@ -73,12 +75,12 @@ export declare class SwitcherClient {
|
|
|
73
75
|
id: string;
|
|
74
76
|
name: string;
|
|
75
77
|
baseUrl: string;
|
|
76
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
78
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
77
79
|
credentialEnv?: string;
|
|
78
|
-
authStyle: "bearer" | "x-api-key";
|
|
80
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
79
81
|
catalogBaseUrl?: string;
|
|
80
|
-
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
81
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none";
|
|
82
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
83
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none";
|
|
82
84
|
catalogCredentialEnv?: string;
|
|
83
85
|
catalogAccountId?: string;
|
|
84
86
|
modelsPath: string;
|
|
@@ -92,6 +94,7 @@ export declare class SwitcherClient {
|
|
|
92
94
|
inputModalities?: string[];
|
|
93
95
|
outputModalities?: string[];
|
|
94
96
|
supportedParameters?: string[];
|
|
97
|
+
supportedGenerationMethods?: string[];
|
|
95
98
|
}[];
|
|
96
99
|
version: number;
|
|
97
100
|
updatedAt: string;
|
|
@@ -100,12 +103,12 @@ export declare class SwitcherClient {
|
|
|
100
103
|
id: string;
|
|
101
104
|
name: string;
|
|
102
105
|
baseUrl: string;
|
|
103
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
106
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
104
107
|
credentialEnv?: string;
|
|
105
|
-
authStyle: "bearer" | "x-api-key";
|
|
108
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
106
109
|
catalogBaseUrl?: string;
|
|
107
|
-
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
108
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none";
|
|
110
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
111
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none";
|
|
109
112
|
catalogCredentialEnv?: string;
|
|
110
113
|
catalogAccountId?: string;
|
|
111
114
|
modelsPath: string;
|
|
@@ -119,6 +122,7 @@ export declare class SwitcherClient {
|
|
|
119
122
|
inputModalities?: string[];
|
|
120
123
|
outputModalities?: string[];
|
|
121
124
|
supportedParameters?: string[];
|
|
125
|
+
supportedGenerationMethods?: string[];
|
|
122
126
|
}[];
|
|
123
127
|
version: number;
|
|
124
128
|
updatedAt: string;
|
|
@@ -127,12 +131,12 @@ export declare class SwitcherClient {
|
|
|
127
131
|
id: string;
|
|
128
132
|
name: string;
|
|
129
133
|
baseUrl: string;
|
|
130
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
134
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
131
135
|
credentialEnv?: string;
|
|
132
|
-
authStyle: "bearer" | "x-api-key";
|
|
136
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
133
137
|
catalogBaseUrl?: string;
|
|
134
|
-
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
135
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none";
|
|
138
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
139
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none";
|
|
136
140
|
catalogCredentialEnv?: string;
|
|
137
141
|
catalogAccountId?: string;
|
|
138
142
|
modelsPath: string;
|
|
@@ -146,6 +150,7 @@ export declare class SwitcherClient {
|
|
|
146
150
|
inputModalities?: string[];
|
|
147
151
|
outputModalities?: string[];
|
|
148
152
|
supportedParameters?: string[];
|
|
153
|
+
supportedGenerationMethods?: string[];
|
|
149
154
|
}[];
|
|
150
155
|
version: number;
|
|
151
156
|
updatedAt: string;
|
|
@@ -154,12 +159,12 @@ export declare class SwitcherClient {
|
|
|
154
159
|
id: string;
|
|
155
160
|
name: string;
|
|
156
161
|
baseUrl: string;
|
|
157
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
162
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
158
163
|
credentialEnv?: string;
|
|
159
|
-
authStyle: "bearer" | "x-api-key";
|
|
164
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
160
165
|
catalogBaseUrl?: string;
|
|
161
|
-
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
162
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none";
|
|
166
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
167
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none";
|
|
163
168
|
catalogCredentialEnv?: string;
|
|
164
169
|
catalogAccountId?: string;
|
|
165
170
|
modelsPath: string;
|
|
@@ -173,6 +178,7 @@ export declare class SwitcherClient {
|
|
|
173
178
|
inputModalities?: string[];
|
|
174
179
|
outputModalities?: string[];
|
|
175
180
|
supportedParameters?: string[];
|
|
181
|
+
supportedGenerationMethods?: string[];
|
|
176
182
|
}[];
|
|
177
183
|
version: number;
|
|
178
184
|
updatedAt: string;
|
|
@@ -191,6 +197,7 @@ export declare class SwitcherClient {
|
|
|
191
197
|
inputModalities?: string[];
|
|
192
198
|
outputModalities?: string[];
|
|
193
199
|
supportedParameters?: string[];
|
|
200
|
+
supportedGenerationMethods?: string[];
|
|
194
201
|
}[];
|
|
195
202
|
refreshedAt: string;
|
|
196
203
|
source: "remote" | "manual";
|
|
@@ -206,6 +213,7 @@ export declare class SwitcherClient {
|
|
|
206
213
|
inputModalities?: string[];
|
|
207
214
|
outputModalities?: string[];
|
|
208
215
|
supportedParameters?: string[];
|
|
216
|
+
supportedGenerationMethods?: string[];
|
|
209
217
|
codingEligible: boolean;
|
|
210
218
|
}[];
|
|
211
219
|
total: number;
|
|
@@ -218,8 +226,28 @@ export declare class SwitcherClient {
|
|
|
218
226
|
id: string;
|
|
219
227
|
name: string;
|
|
220
228
|
providerId: string;
|
|
221
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
229
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
222
230
|
model: string;
|
|
231
|
+
modelPolicy?: {
|
|
232
|
+
version: 1;
|
|
233
|
+
roles?: {
|
|
234
|
+
subagent?: string;
|
|
235
|
+
fast?: string;
|
|
236
|
+
planning?: string;
|
|
237
|
+
review?: string;
|
|
238
|
+
summary?: string;
|
|
239
|
+
compaction?: string;
|
|
240
|
+
weak?: string;
|
|
241
|
+
editor?: string;
|
|
242
|
+
};
|
|
243
|
+
allowedModels?: string[];
|
|
244
|
+
aliases?: {
|
|
245
|
+
[key: string]: string;
|
|
246
|
+
};
|
|
247
|
+
fallbacks?: {
|
|
248
|
+
[key: string]: string[];
|
|
249
|
+
};
|
|
250
|
+
};
|
|
223
251
|
version: number;
|
|
224
252
|
updatedAt: string;
|
|
225
253
|
}>>;
|
|
@@ -227,8 +255,28 @@ export declare class SwitcherClient {
|
|
|
227
255
|
id: string;
|
|
228
256
|
name: string;
|
|
229
257
|
providerId: string;
|
|
230
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
258
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
231
259
|
model: string;
|
|
260
|
+
modelPolicy?: {
|
|
261
|
+
version: 1;
|
|
262
|
+
roles?: {
|
|
263
|
+
subagent?: string;
|
|
264
|
+
fast?: string;
|
|
265
|
+
planning?: string;
|
|
266
|
+
review?: string;
|
|
267
|
+
summary?: string;
|
|
268
|
+
compaction?: string;
|
|
269
|
+
weak?: string;
|
|
270
|
+
editor?: string;
|
|
271
|
+
};
|
|
272
|
+
allowedModels?: string[];
|
|
273
|
+
aliases?: {
|
|
274
|
+
[key: string]: string;
|
|
275
|
+
};
|
|
276
|
+
fallbacks?: {
|
|
277
|
+
[key: string]: string[];
|
|
278
|
+
};
|
|
279
|
+
};
|
|
232
280
|
version: number;
|
|
233
281
|
updatedAt: string;
|
|
234
282
|
}>;
|
|
@@ -236,8 +284,28 @@ export declare class SwitcherClient {
|
|
|
236
284
|
id: string;
|
|
237
285
|
name: string;
|
|
238
286
|
providerId: string;
|
|
239
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
287
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
240
288
|
model: string;
|
|
289
|
+
modelPolicy?: {
|
|
290
|
+
version: 1;
|
|
291
|
+
roles?: {
|
|
292
|
+
subagent?: string;
|
|
293
|
+
fast?: string;
|
|
294
|
+
planning?: string;
|
|
295
|
+
review?: string;
|
|
296
|
+
summary?: string;
|
|
297
|
+
compaction?: string;
|
|
298
|
+
weak?: string;
|
|
299
|
+
editor?: string;
|
|
300
|
+
};
|
|
301
|
+
allowedModels?: string[];
|
|
302
|
+
aliases?: {
|
|
303
|
+
[key: string]: string;
|
|
304
|
+
};
|
|
305
|
+
fallbacks?: {
|
|
306
|
+
[key: string]: string[];
|
|
307
|
+
};
|
|
308
|
+
};
|
|
241
309
|
version: number;
|
|
242
310
|
updatedAt: string;
|
|
243
311
|
}>;
|
|
@@ -245,8 +313,28 @@ export declare class SwitcherClient {
|
|
|
245
313
|
id: string;
|
|
246
314
|
name: string;
|
|
247
315
|
providerId: string;
|
|
248
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
316
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
249
317
|
model: string;
|
|
318
|
+
modelPolicy?: {
|
|
319
|
+
version: 1;
|
|
320
|
+
roles?: {
|
|
321
|
+
subagent?: string;
|
|
322
|
+
fast?: string;
|
|
323
|
+
planning?: string;
|
|
324
|
+
review?: string;
|
|
325
|
+
summary?: string;
|
|
326
|
+
compaction?: string;
|
|
327
|
+
weak?: string;
|
|
328
|
+
editor?: string;
|
|
329
|
+
};
|
|
330
|
+
allowedModels?: string[];
|
|
331
|
+
aliases?: {
|
|
332
|
+
[key: string]: string;
|
|
333
|
+
};
|
|
334
|
+
fallbacks?: {
|
|
335
|
+
[key: string]: string[];
|
|
336
|
+
};
|
|
337
|
+
};
|
|
250
338
|
version: number;
|
|
251
339
|
updatedAt: string;
|
|
252
340
|
}>;
|
|
@@ -258,12 +346,12 @@ export declare class SwitcherClient {
|
|
|
258
346
|
id: string;
|
|
259
347
|
name: string;
|
|
260
348
|
baseUrl: string;
|
|
261
|
-
protocol: "anthropic-messages" | "openai-responses" | "openai-chat";
|
|
349
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
262
350
|
credentialEnv?: string;
|
|
263
|
-
authStyle: "bearer" | "x-api-key";
|
|
351
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
264
352
|
catalogBaseUrl?: string;
|
|
265
|
-
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "none";
|
|
266
|
-
catalogAuthStyle?: "bearer" | "x-api-key" | "none";
|
|
353
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
354
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none";
|
|
267
355
|
catalogCredentialEnv?: string;
|
|
268
356
|
catalogAccountId?: string;
|
|
269
357
|
modelsPath: string;
|
|
@@ -277,6 +365,7 @@ export declare class SwitcherClient {
|
|
|
277
365
|
inputModalities?: string[];
|
|
278
366
|
outputModalities?: string[];
|
|
279
367
|
supportedParameters?: string[];
|
|
368
|
+
supportedGenerationMethods?: string[];
|
|
280
369
|
}[];
|
|
281
370
|
version: number;
|
|
282
371
|
updatedAt: string;
|
|
@@ -285,8 +374,28 @@ export declare class SwitcherClient {
|
|
|
285
374
|
id: string;
|
|
286
375
|
name: string;
|
|
287
376
|
providerId: string;
|
|
288
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
377
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
289
378
|
model: string;
|
|
379
|
+
modelPolicy?: {
|
|
380
|
+
version: 1;
|
|
381
|
+
roles?: {
|
|
382
|
+
subagent?: string;
|
|
383
|
+
fast?: string;
|
|
384
|
+
planning?: string;
|
|
385
|
+
review?: string;
|
|
386
|
+
summary?: string;
|
|
387
|
+
compaction?: string;
|
|
388
|
+
weak?: string;
|
|
389
|
+
editor?: string;
|
|
390
|
+
};
|
|
391
|
+
allowedModels?: string[];
|
|
392
|
+
aliases?: {
|
|
393
|
+
[key: string]: string;
|
|
394
|
+
};
|
|
395
|
+
fallbacks?: {
|
|
396
|
+
[key: string]: string[];
|
|
397
|
+
};
|
|
398
|
+
};
|
|
290
399
|
version: number;
|
|
291
400
|
updatedAt: string;
|
|
292
401
|
};
|
|
@@ -301,6 +410,7 @@ export declare class SwitcherClient {
|
|
|
301
410
|
inputModalities?: string[];
|
|
302
411
|
outputModalities?: string[];
|
|
303
412
|
supportedParameters?: string[];
|
|
413
|
+
supportedGenerationMethods?: string[];
|
|
304
414
|
}[];
|
|
305
415
|
refreshedAt: string;
|
|
306
416
|
source: "remote" | "manual";
|
|
@@ -309,9 +419,30 @@ export declare class SwitcherClient {
|
|
|
309
419
|
warnings: string[];
|
|
310
420
|
}>;
|
|
311
421
|
listRuns(options?: {}): Promise<Page<{
|
|
422
|
+
modelPolicyVersion?: 1;
|
|
312
423
|
profileId: string;
|
|
313
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
424
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
314
425
|
model: string;
|
|
426
|
+
modelPolicy?: {
|
|
427
|
+
version: 1;
|
|
428
|
+
roles?: {
|
|
429
|
+
subagent?: string;
|
|
430
|
+
fast?: string;
|
|
431
|
+
planning?: string;
|
|
432
|
+
review?: string;
|
|
433
|
+
summary?: string;
|
|
434
|
+
compaction?: string;
|
|
435
|
+
weak?: string;
|
|
436
|
+
editor?: string;
|
|
437
|
+
};
|
|
438
|
+
allowedModels?: string[];
|
|
439
|
+
aliases?: {
|
|
440
|
+
[key: string]: string;
|
|
441
|
+
};
|
|
442
|
+
fallbacks?: {
|
|
443
|
+
[key: string]: string[];
|
|
444
|
+
};
|
|
445
|
+
};
|
|
315
446
|
planToken: string;
|
|
316
447
|
version: number;
|
|
317
448
|
updatedAt: string;
|
|
@@ -323,11 +454,44 @@ export declare class SwitcherClient {
|
|
|
323
454
|
startedAt: string;
|
|
324
455
|
endedAt?: string;
|
|
325
456
|
exitCode?: number;
|
|
457
|
+
routingEvents?: {
|
|
458
|
+
at: string;
|
|
459
|
+
requestId: string;
|
|
460
|
+
requestedModel: string;
|
|
461
|
+
resolvedModel?: string;
|
|
462
|
+
reportedModel?: string;
|
|
463
|
+
decision: "allow" | "alias" | "reject" | "fallback";
|
|
464
|
+
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor";
|
|
465
|
+
reason?: string;
|
|
466
|
+
upstreamStatus?: number;
|
|
467
|
+
}[];
|
|
468
|
+
routingEventsDropped?: number;
|
|
326
469
|
}>>;
|
|
327
470
|
getRun(id: string): Promise<{
|
|
471
|
+
modelPolicyVersion?: 1;
|
|
328
472
|
profileId: string;
|
|
329
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
473
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
330
474
|
model: string;
|
|
475
|
+
modelPolicy?: {
|
|
476
|
+
version: 1;
|
|
477
|
+
roles?: {
|
|
478
|
+
subagent?: string;
|
|
479
|
+
fast?: string;
|
|
480
|
+
planning?: string;
|
|
481
|
+
review?: string;
|
|
482
|
+
summary?: string;
|
|
483
|
+
compaction?: string;
|
|
484
|
+
weak?: string;
|
|
485
|
+
editor?: string;
|
|
486
|
+
};
|
|
487
|
+
allowedModels?: string[];
|
|
488
|
+
aliases?: {
|
|
489
|
+
[key: string]: string;
|
|
490
|
+
};
|
|
491
|
+
fallbacks?: {
|
|
492
|
+
[key: string]: string[];
|
|
493
|
+
};
|
|
494
|
+
};
|
|
331
495
|
planToken: string;
|
|
332
496
|
version: number;
|
|
333
497
|
updatedAt: string;
|
|
@@ -339,11 +503,46 @@ export declare class SwitcherClient {
|
|
|
339
503
|
startedAt: string;
|
|
340
504
|
endedAt?: string;
|
|
341
505
|
exitCode?: number;
|
|
506
|
+
routingEvents?: {
|
|
507
|
+
at: string;
|
|
508
|
+
requestId: string;
|
|
509
|
+
requestedModel: string;
|
|
510
|
+
resolvedModel?: string;
|
|
511
|
+
reportedModel?: string;
|
|
512
|
+
decision: "allow" | "alias" | "reject" | "fallback";
|
|
513
|
+
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor";
|
|
514
|
+
reason?: string;
|
|
515
|
+
upstreamStatus?: number;
|
|
516
|
+
}[];
|
|
517
|
+
routingEventsDropped?: number;
|
|
342
518
|
}>;
|
|
343
|
-
createRun(input: components["schemas"]["RunInput"],
|
|
519
|
+
createRun(input: Omit<components["schemas"]["RunInput"], "modelPolicyVersion"> & {
|
|
520
|
+
modelPolicyVersion?: 1;
|
|
521
|
+
}, idempotencyKey?: string): Promise<{
|
|
522
|
+
modelPolicyVersion?: 1;
|
|
344
523
|
profileId: string;
|
|
345
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
524
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
346
525
|
model: string;
|
|
526
|
+
modelPolicy?: {
|
|
527
|
+
version: 1;
|
|
528
|
+
roles?: {
|
|
529
|
+
subagent?: string;
|
|
530
|
+
fast?: string;
|
|
531
|
+
planning?: string;
|
|
532
|
+
review?: string;
|
|
533
|
+
summary?: string;
|
|
534
|
+
compaction?: string;
|
|
535
|
+
weak?: string;
|
|
536
|
+
editor?: string;
|
|
537
|
+
};
|
|
538
|
+
allowedModels?: string[];
|
|
539
|
+
aliases?: {
|
|
540
|
+
[key: string]: string;
|
|
541
|
+
};
|
|
542
|
+
fallbacks?: {
|
|
543
|
+
[key: string]: string[];
|
|
544
|
+
};
|
|
545
|
+
};
|
|
347
546
|
planToken: string;
|
|
348
547
|
version: number;
|
|
349
548
|
updatedAt: string;
|
|
@@ -355,14 +554,44 @@ export declare class SwitcherClient {
|
|
|
355
554
|
startedAt: string;
|
|
356
555
|
endedAt?: string;
|
|
357
556
|
exitCode?: number;
|
|
557
|
+
routingEvents?: {
|
|
558
|
+
at: string;
|
|
559
|
+
requestId: string;
|
|
560
|
+
requestedModel: string;
|
|
561
|
+
resolvedModel?: string;
|
|
562
|
+
reportedModel?: string;
|
|
563
|
+
decision: "allow" | "alias" | "reject" | "fallback";
|
|
564
|
+
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor";
|
|
565
|
+
reason?: string;
|
|
566
|
+
upstreamStatus?: number;
|
|
567
|
+
}[];
|
|
568
|
+
routingEventsDropped?: number;
|
|
358
569
|
}>;
|
|
359
|
-
finishRun(id: string, version: number, input: {
|
|
360
|
-
|
|
361
|
-
exitCode: number;
|
|
362
|
-
}, idempotencyKey?: string): Promise<{
|
|
570
|
+
finishRun(id: string, version: number, input: components["schemas"]["RunUpdate"], idempotencyKey?: string): Promise<{
|
|
571
|
+
modelPolicyVersion?: 1;
|
|
363
572
|
profileId: string;
|
|
364
|
-
harness: "claude" | "codex" | "grok" | "opencode2" | "pi";
|
|
573
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
365
574
|
model: string;
|
|
575
|
+
modelPolicy?: {
|
|
576
|
+
version: 1;
|
|
577
|
+
roles?: {
|
|
578
|
+
subagent?: string;
|
|
579
|
+
fast?: string;
|
|
580
|
+
planning?: string;
|
|
581
|
+
review?: string;
|
|
582
|
+
summary?: string;
|
|
583
|
+
compaction?: string;
|
|
584
|
+
weak?: string;
|
|
585
|
+
editor?: string;
|
|
586
|
+
};
|
|
587
|
+
allowedModels?: string[];
|
|
588
|
+
aliases?: {
|
|
589
|
+
[key: string]: string;
|
|
590
|
+
};
|
|
591
|
+
fallbacks?: {
|
|
592
|
+
[key: string]: string[];
|
|
593
|
+
};
|
|
594
|
+
};
|
|
366
595
|
planToken: string;
|
|
367
596
|
version: number;
|
|
368
597
|
updatedAt: string;
|
|
@@ -374,6 +603,18 @@ export declare class SwitcherClient {
|
|
|
374
603
|
startedAt: string;
|
|
375
604
|
endedAt?: string;
|
|
376
605
|
exitCode?: number;
|
|
606
|
+
routingEvents?: {
|
|
607
|
+
at: string;
|
|
608
|
+
requestId: string;
|
|
609
|
+
requestedModel: string;
|
|
610
|
+
resolvedModel?: string;
|
|
611
|
+
reportedModel?: string;
|
|
612
|
+
decision: "allow" | "alias" | "reject" | "fallback";
|
|
613
|
+
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor";
|
|
614
|
+
reason?: string;
|
|
615
|
+
upstreamStatus?: number;
|
|
616
|
+
}[];
|
|
617
|
+
routingEventsDropped?: number;
|
|
377
618
|
}>;
|
|
378
619
|
}
|
|
379
620
|
export declare function clientFromEnv(env?: Record<string, string | undefined>): SwitcherClient;
|