@hasna/switcher 0.1.7 → 0.1.9
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 +166 -4
- package/dist/chatgpt-launch.d.ts +5 -0
- package/dist/claude-desktop-launch.d.ts +11 -0
- package/dist/cli/index.js +1122 -368
- package/dist/codex-delegation.d.ts +7 -0
- package/dist/credentials.d.ts +7 -7
- package/dist/desktop-apps.d.ts +25 -0
- package/dist/desktop-state.d.ts +3 -0
- package/dist/domain.d.ts +26 -4
- package/dist/generated/api.d.ts +16 -0
- package/dist/harness-process.d.ts +1 -0
- package/dist/harness-types.d.ts +3 -0
- package/dist/harnesses.d.ts +7 -3
- package/dist/index.js +199 -69
- package/dist/inference-gateway.d.ts +2 -0
- package/dist/launcher.d.ts +6 -0
- package/dist/mcp/index.js +145 -78
- package/dist/model-policy-schema.d.ts +6 -0
- package/dist/presets.d.ts +2 -0
- package/dist/reasoning.d.ts +10 -0
- package/dist/sdk.d.ts +156 -0
- package/dist/sdk.js +199 -69
- package/dist/serve/index.js +290 -74
- package/openapi.json +210 -1
- package/package.json +3 -2
package/dist/sdk.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { components } from "./generated/api";
|
|
2
2
|
import { type CredentialChainOptions } from "@hasna/contracts/client";
|
|
3
3
|
export { providerFromPreset } from "./presets";
|
|
4
|
+
export { detectChatGPTApp, detectClaudeDesktopApp } from "./desktop-apps";
|
|
5
|
+
export type { ChatGPTInstallation, ClaudeDesktopInstallation } from "./desktop-apps";
|
|
4
6
|
export type ProviderPreset = components["schemas"]["ProviderPreset"];
|
|
5
7
|
export type ProviderInput = components["schemas"]["ProviderInput"];
|
|
6
8
|
export type Provider = components["schemas"]["Provider"];
|
|
@@ -104,6 +106,7 @@ export declare class SwitcherClient {
|
|
|
104
106
|
inputModalities?: string[];
|
|
105
107
|
outputModalities?: string[];
|
|
106
108
|
supportedParameters?: string[];
|
|
109
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
107
110
|
supportedGenerationMethods?: string[];
|
|
108
111
|
}[];
|
|
109
112
|
additionalModels?: {
|
|
@@ -117,6 +120,7 @@ export declare class SwitcherClient {
|
|
|
117
120
|
inputModalities?: string[];
|
|
118
121
|
outputModalities?: string[];
|
|
119
122
|
supportedParameters?: string[];
|
|
123
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
120
124
|
supportedGenerationMethods?: string[];
|
|
121
125
|
}[];
|
|
122
126
|
version: number;
|
|
@@ -146,6 +150,7 @@ export declare class SwitcherClient {
|
|
|
146
150
|
inputModalities?: string[];
|
|
147
151
|
outputModalities?: string[];
|
|
148
152
|
supportedParameters?: string[];
|
|
153
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
149
154
|
supportedGenerationMethods?: string[];
|
|
150
155
|
}[];
|
|
151
156
|
additionalModels?: {
|
|
@@ -159,6 +164,7 @@ export declare class SwitcherClient {
|
|
|
159
164
|
inputModalities?: string[];
|
|
160
165
|
outputModalities?: string[];
|
|
161
166
|
supportedParameters?: string[];
|
|
167
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
162
168
|
supportedGenerationMethods?: string[];
|
|
163
169
|
}[];
|
|
164
170
|
version: number;
|
|
@@ -188,6 +194,7 @@ export declare class SwitcherClient {
|
|
|
188
194
|
inputModalities?: string[];
|
|
189
195
|
outputModalities?: string[];
|
|
190
196
|
supportedParameters?: string[];
|
|
197
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
191
198
|
supportedGenerationMethods?: string[];
|
|
192
199
|
}[];
|
|
193
200
|
additionalModels?: {
|
|
@@ -201,6 +208,7 @@ export declare class SwitcherClient {
|
|
|
201
208
|
inputModalities?: string[];
|
|
202
209
|
outputModalities?: string[];
|
|
203
210
|
supportedParameters?: string[];
|
|
211
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
204
212
|
supportedGenerationMethods?: string[];
|
|
205
213
|
}[];
|
|
206
214
|
version: number;
|
|
@@ -230,6 +238,7 @@ export declare class SwitcherClient {
|
|
|
230
238
|
inputModalities?: string[];
|
|
231
239
|
outputModalities?: string[];
|
|
232
240
|
supportedParameters?: string[];
|
|
241
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
233
242
|
supportedGenerationMethods?: string[];
|
|
234
243
|
}[];
|
|
235
244
|
additionalModels?: {
|
|
@@ -243,6 +252,7 @@ export declare class SwitcherClient {
|
|
|
243
252
|
inputModalities?: string[];
|
|
244
253
|
outputModalities?: string[];
|
|
245
254
|
supportedParameters?: string[];
|
|
255
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
246
256
|
supportedGenerationMethods?: string[];
|
|
247
257
|
}[];
|
|
248
258
|
version: number;
|
|
@@ -251,6 +261,143 @@ export declare class SwitcherClient {
|
|
|
251
261
|
deleteProvider(id: string, version: number, idempotencyKey?: string): Promise<{
|
|
252
262
|
deleted: string;
|
|
253
263
|
}>;
|
|
264
|
+
/** Configure model metadata through the existing versioned provider API.
|
|
265
|
+
* Discovery stays active unless the provider explicitly uses a manual catalog.
|
|
266
|
+
* A concurrent edit returns 409; it is never silently overwritten or retried. */
|
|
267
|
+
private editModel;
|
|
268
|
+
addModel(providerId: string, model: Model): Promise<{
|
|
269
|
+
id: string;
|
|
270
|
+
name: string;
|
|
271
|
+
baseUrl: string;
|
|
272
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
273
|
+
credentialEnv?: string;
|
|
274
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
275
|
+
catalogBaseUrl?: string;
|
|
276
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
277
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none";
|
|
278
|
+
catalogCredentialEnv?: string;
|
|
279
|
+
catalogAccountId?: string;
|
|
280
|
+
modelsPath: string;
|
|
281
|
+
manualModels: {
|
|
282
|
+
id: string;
|
|
283
|
+
name: string;
|
|
284
|
+
description?: string;
|
|
285
|
+
available?: boolean;
|
|
286
|
+
expiresOn?: string;
|
|
287
|
+
contextWindow?: number;
|
|
288
|
+
maxOutputTokens?: number;
|
|
289
|
+
inputModalities?: string[];
|
|
290
|
+
outputModalities?: string[];
|
|
291
|
+
supportedParameters?: string[];
|
|
292
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
293
|
+
supportedGenerationMethods?: string[];
|
|
294
|
+
}[];
|
|
295
|
+
additionalModels?: {
|
|
296
|
+
id: string;
|
|
297
|
+
name: string;
|
|
298
|
+
description?: string;
|
|
299
|
+
available?: boolean;
|
|
300
|
+
expiresOn?: string;
|
|
301
|
+
contextWindow?: number;
|
|
302
|
+
maxOutputTokens?: number;
|
|
303
|
+
inputModalities?: string[];
|
|
304
|
+
outputModalities?: string[];
|
|
305
|
+
supportedParameters?: string[];
|
|
306
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
307
|
+
supportedGenerationMethods?: string[];
|
|
308
|
+
}[];
|
|
309
|
+
version: number;
|
|
310
|
+
updatedAt: string;
|
|
311
|
+
}>;
|
|
312
|
+
/** Replace all saved metadata for one model, including clearing omitted fields. */
|
|
313
|
+
updateModel(providerId: string, model: Model): Promise<{
|
|
314
|
+
id: string;
|
|
315
|
+
name: string;
|
|
316
|
+
baseUrl: string;
|
|
317
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
318
|
+
credentialEnv?: string;
|
|
319
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
320
|
+
catalogBaseUrl?: string;
|
|
321
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
322
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none";
|
|
323
|
+
catalogCredentialEnv?: string;
|
|
324
|
+
catalogAccountId?: string;
|
|
325
|
+
modelsPath: string;
|
|
326
|
+
manualModels: {
|
|
327
|
+
id: string;
|
|
328
|
+
name: string;
|
|
329
|
+
description?: string;
|
|
330
|
+
available?: boolean;
|
|
331
|
+
expiresOn?: string;
|
|
332
|
+
contextWindow?: number;
|
|
333
|
+
maxOutputTokens?: number;
|
|
334
|
+
inputModalities?: string[];
|
|
335
|
+
outputModalities?: string[];
|
|
336
|
+
supportedParameters?: string[];
|
|
337
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
338
|
+
supportedGenerationMethods?: string[];
|
|
339
|
+
}[];
|
|
340
|
+
additionalModels?: {
|
|
341
|
+
id: string;
|
|
342
|
+
name: string;
|
|
343
|
+
description?: string;
|
|
344
|
+
available?: boolean;
|
|
345
|
+
expiresOn?: string;
|
|
346
|
+
contextWindow?: number;
|
|
347
|
+
maxOutputTokens?: number;
|
|
348
|
+
inputModalities?: string[];
|
|
349
|
+
outputModalities?: string[];
|
|
350
|
+
supportedParameters?: string[];
|
|
351
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
352
|
+
supportedGenerationMethods?: string[];
|
|
353
|
+
}[];
|
|
354
|
+
version: number;
|
|
355
|
+
updatedAt: string;
|
|
356
|
+
}>;
|
|
357
|
+
removeModel(providerId: string, modelId: string): Promise<{
|
|
358
|
+
id: string;
|
|
359
|
+
name: string;
|
|
360
|
+
baseUrl: string;
|
|
361
|
+
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
362
|
+
credentialEnv?: string;
|
|
363
|
+
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
364
|
+
catalogBaseUrl?: string;
|
|
365
|
+
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
366
|
+
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none";
|
|
367
|
+
catalogCredentialEnv?: string;
|
|
368
|
+
catalogAccountId?: string;
|
|
369
|
+
modelsPath: string;
|
|
370
|
+
manualModels: {
|
|
371
|
+
id: string;
|
|
372
|
+
name: string;
|
|
373
|
+
description?: string;
|
|
374
|
+
available?: boolean;
|
|
375
|
+
expiresOn?: string;
|
|
376
|
+
contextWindow?: number;
|
|
377
|
+
maxOutputTokens?: number;
|
|
378
|
+
inputModalities?: string[];
|
|
379
|
+
outputModalities?: string[];
|
|
380
|
+
supportedParameters?: string[];
|
|
381
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
382
|
+
supportedGenerationMethods?: string[];
|
|
383
|
+
}[];
|
|
384
|
+
additionalModels?: {
|
|
385
|
+
id: string;
|
|
386
|
+
name: string;
|
|
387
|
+
description?: string;
|
|
388
|
+
available?: boolean;
|
|
389
|
+
expiresOn?: string;
|
|
390
|
+
contextWindow?: number;
|
|
391
|
+
maxOutputTokens?: number;
|
|
392
|
+
inputModalities?: string[];
|
|
393
|
+
outputModalities?: string[];
|
|
394
|
+
supportedParameters?: string[];
|
|
395
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
396
|
+
supportedGenerationMethods?: string[];
|
|
397
|
+
}[];
|
|
398
|
+
version: number;
|
|
399
|
+
updatedAt: string;
|
|
400
|
+
}>;
|
|
254
401
|
refreshModels(id: string, idempotencyKey?: string): Promise<{
|
|
255
402
|
models: {
|
|
256
403
|
id: string;
|
|
@@ -263,6 +410,7 @@ export declare class SwitcherClient {
|
|
|
263
410
|
inputModalities?: string[];
|
|
264
411
|
outputModalities?: string[];
|
|
265
412
|
supportedParameters?: string[];
|
|
413
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
266
414
|
supportedGenerationMethods?: string[];
|
|
267
415
|
}[];
|
|
268
416
|
refreshedAt: string;
|
|
@@ -280,6 +428,7 @@ export declare class SwitcherClient {
|
|
|
280
428
|
inputModalities?: string[];
|
|
281
429
|
outputModalities?: string[];
|
|
282
430
|
supportedParameters?: string[];
|
|
431
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
283
432
|
supportedGenerationMethods?: string[];
|
|
284
433
|
codingEligible: boolean;
|
|
285
434
|
expired: boolean;
|
|
@@ -434,6 +583,7 @@ export declare class SwitcherClient {
|
|
|
434
583
|
inputModalities?: string[];
|
|
435
584
|
outputModalities?: string[];
|
|
436
585
|
supportedParameters?: string[];
|
|
586
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
437
587
|
supportedGenerationMethods?: string[];
|
|
438
588
|
}[];
|
|
439
589
|
additionalModels?: {
|
|
@@ -447,6 +597,7 @@ export declare class SwitcherClient {
|
|
|
447
597
|
inputModalities?: string[];
|
|
448
598
|
outputModalities?: string[];
|
|
449
599
|
supportedParameters?: string[];
|
|
600
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
450
601
|
supportedGenerationMethods?: string[];
|
|
451
602
|
}[];
|
|
452
603
|
version: number;
|
|
@@ -493,6 +644,7 @@ export declare class SwitcherClient {
|
|
|
493
644
|
inputModalities?: string[];
|
|
494
645
|
outputModalities?: string[];
|
|
495
646
|
supportedParameters?: string[];
|
|
647
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
496
648
|
supportedGenerationMethods?: string[];
|
|
497
649
|
}[];
|
|
498
650
|
refreshedAt: string;
|
|
@@ -543,6 +695,7 @@ export declare class SwitcherClient {
|
|
|
543
695
|
requestedModel: string;
|
|
544
696
|
resolvedModel?: string;
|
|
545
697
|
reportedModel?: string;
|
|
698
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
546
699
|
decision: "allow" | "alias" | "reject" | "fallback";
|
|
547
700
|
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor";
|
|
548
701
|
reason?: string;
|
|
@@ -592,6 +745,7 @@ export declare class SwitcherClient {
|
|
|
592
745
|
requestedModel: string;
|
|
593
746
|
resolvedModel?: string;
|
|
594
747
|
reportedModel?: string;
|
|
748
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
595
749
|
decision: "allow" | "alias" | "reject" | "fallback";
|
|
596
750
|
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor";
|
|
597
751
|
reason?: string;
|
|
@@ -643,6 +797,7 @@ export declare class SwitcherClient {
|
|
|
643
797
|
requestedModel: string;
|
|
644
798
|
resolvedModel?: string;
|
|
645
799
|
reportedModel?: string;
|
|
800
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
646
801
|
decision: "allow" | "alias" | "reject" | "fallback";
|
|
647
802
|
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor";
|
|
648
803
|
reason?: string;
|
|
@@ -692,6 +847,7 @@ export declare class SwitcherClient {
|
|
|
692
847
|
requestedModel: string;
|
|
693
848
|
resolvedModel?: string;
|
|
694
849
|
reportedModel?: string;
|
|
850
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
695
851
|
decision: "allow" | "alias" | "reject" | "fallback";
|
|
696
852
|
role?: "main" | "subagent" | "fast" | "planning" | "review" | "summary" | "compaction" | "weak" | "editor";
|
|
697
853
|
reason?: string;
|