@hasna/switcher 0.1.5 → 0.1.7

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.
@@ -211,6 +211,18 @@ export declare class CredentialBindings {
211
211
  }
212
212
  export declare function credentialReference(selector: string): string;
213
213
  export declare function validateVaultExecutable(path: string): Promise<string>;
214
+ /** Explicit install finalization. The caller supplies a digest from a verified
215
+ * artifact, never a digest computed from the currently installed executable.
216
+ * No credential is resolved and the executable is never started. */
217
+ export declare function repairVaultExecutablePermissions(path: string, expectedSha256: string): Promise<{
218
+ changed: false;
219
+ mode: string;
220
+ sha256: string;
221
+ } | {
222
+ changed: true;
223
+ mode: string;
224
+ sha256: string;
225
+ }>;
214
226
  export declare function bindingTarget(selector: string, override?: string, allowedOrigins?: string[]): {
215
227
  credentialEnv: string;
216
228
  origins: string[];
package/dist/domain.d.ts CHANGED
@@ -3,16 +3,18 @@ import { type RoutingEvent } from "./model-policy-schema";
3
3
  export { modelPolicySchema, routingEventSchema, routingEventsSchema } from "./model-policy-schema";
4
4
  export type { ModelPolicy, RoutingEvent } from "./model-policy-schema";
5
5
  export type { AuthStyle } from "./auth";
6
- export declare const VERSION = "0.1.5";
6
+ export declare const VERSION = "0.1.7";
7
7
  export declare const harnessSchema: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
8
8
  export declare const protocolSchema: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
9
9
  export declare const idSchema: z.ZodString;
10
10
  export declare function endpoint(value: string): string;
11
+ export declare const expiresOnSchema: z.ZodEffects<z.ZodString, string, string>;
11
12
  export declare const modelSchema: z.ZodObject<{
12
13
  id: z.ZodString;
13
14
  name: z.ZodString;
14
15
  description: z.ZodOptional<z.ZodString>;
15
16
  available: z.ZodOptional<z.ZodBoolean>;
17
+ expiresOn: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
16
18
  contextWindow: z.ZodOptional<z.ZodNumber>;
17
19
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
18
20
  inputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -24,6 +26,7 @@ export declare const modelSchema: z.ZodObject<{
24
26
  name: string;
25
27
  description?: string | undefined;
26
28
  available?: boolean | undefined;
29
+ expiresOn?: string | undefined;
27
30
  contextWindow?: number | undefined;
28
31
  maxOutputTokens?: number | undefined;
29
32
  inputModalities?: string[] | undefined;
@@ -35,6 +38,7 @@ export declare const modelSchema: z.ZodObject<{
35
38
  name: string;
36
39
  description?: string | undefined;
37
40
  available?: boolean | undefined;
41
+ expiresOn?: string | undefined;
38
42
  contextWindow?: number | undefined;
39
43
  maxOutputTokens?: number | undefined;
40
44
  inputModalities?: string[] | undefined;
@@ -60,6 +64,7 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
60
64
  name: z.ZodString;
61
65
  description: z.ZodOptional<z.ZodString>;
62
66
  available: z.ZodOptional<z.ZodBoolean>;
67
+ expiresOn: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
63
68
  contextWindow: z.ZodOptional<z.ZodNumber>;
64
69
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
65
70
  inputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -71,6 +76,7 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
71
76
  name: string;
72
77
  description?: string | undefined;
73
78
  available?: boolean | undefined;
79
+ expiresOn?: string | undefined;
74
80
  contextWindow?: number | undefined;
75
81
  maxOutputTokens?: number | undefined;
76
82
  inputModalities?: string[] | undefined;
@@ -82,6 +88,44 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
82
88
  name: string;
83
89
  description?: string | undefined;
84
90
  available?: boolean | undefined;
91
+ expiresOn?: string | undefined;
92
+ contextWindow?: number | undefined;
93
+ maxOutputTokens?: number | undefined;
94
+ inputModalities?: string[] | undefined;
95
+ outputModalities?: string[] | undefined;
96
+ supportedParameters?: string[] | undefined;
97
+ supportedGenerationMethods?: string[] | undefined;
98
+ }>, "many">>;
99
+ additionalModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
100
+ id: z.ZodString;
101
+ name: z.ZodString;
102
+ description: z.ZodOptional<z.ZodString>;
103
+ available: z.ZodOptional<z.ZodBoolean>;
104
+ expiresOn: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
105
+ contextWindow: z.ZodOptional<z.ZodNumber>;
106
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
107
+ inputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
108
+ outputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
109
+ supportedParameters: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
110
+ supportedGenerationMethods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
111
+ }, "strict", z.ZodTypeAny, {
112
+ id: string;
113
+ name: string;
114
+ description?: string | undefined;
115
+ available?: boolean | undefined;
116
+ expiresOn?: string | undefined;
117
+ contextWindow?: number | undefined;
118
+ maxOutputTokens?: number | undefined;
119
+ inputModalities?: string[] | undefined;
120
+ outputModalities?: string[] | undefined;
121
+ supportedParameters?: string[] | undefined;
122
+ supportedGenerationMethods?: string[] | undefined;
123
+ }, {
124
+ id: string;
125
+ name: string;
126
+ description?: string | undefined;
127
+ available?: boolean | undefined;
128
+ expiresOn?: string | undefined;
85
129
  contextWindow?: number | undefined;
86
130
  maxOutputTokens?: number | undefined;
87
131
  inputModalities?: string[] | undefined;
@@ -101,6 +145,7 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
101
145
  name: string;
102
146
  description?: string | undefined;
103
147
  available?: boolean | undefined;
148
+ expiresOn?: string | undefined;
104
149
  contextWindow?: number | undefined;
105
150
  maxOutputTokens?: number | undefined;
106
151
  inputModalities?: string[] | undefined;
@@ -114,6 +159,19 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
114
159
  catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
115
160
  catalogCredentialEnv?: string | undefined;
116
161
  catalogAccountId?: string | undefined;
162
+ additionalModels?: {
163
+ id: string;
164
+ name: string;
165
+ description?: string | undefined;
166
+ available?: boolean | undefined;
167
+ expiresOn?: string | undefined;
168
+ contextWindow?: number | undefined;
169
+ maxOutputTokens?: number | undefined;
170
+ inputModalities?: string[] | undefined;
171
+ outputModalities?: string[] | undefined;
172
+ supportedParameters?: string[] | undefined;
173
+ supportedGenerationMethods?: string[] | undefined;
174
+ }[] | undefined;
117
175
  }, {
118
176
  id: string;
119
177
  name: string;
@@ -132,6 +190,20 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
132
190
  name: string;
133
191
  description?: string | undefined;
134
192
  available?: boolean | undefined;
193
+ expiresOn?: string | undefined;
194
+ contextWindow?: number | undefined;
195
+ maxOutputTokens?: number | undefined;
196
+ inputModalities?: string[] | undefined;
197
+ outputModalities?: string[] | undefined;
198
+ supportedParameters?: string[] | undefined;
199
+ supportedGenerationMethods?: string[] | undefined;
200
+ }[] | undefined;
201
+ additionalModels?: {
202
+ id: string;
203
+ name: string;
204
+ description?: string | undefined;
205
+ available?: boolean | undefined;
206
+ expiresOn?: string | undefined;
135
207
  contextWindow?: number | undefined;
136
208
  maxOutputTokens?: number | undefined;
137
209
  inputModalities?: string[] | undefined;
@@ -151,6 +223,7 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
151
223
  name: string;
152
224
  description?: string | undefined;
153
225
  available?: boolean | undefined;
226
+ expiresOn?: string | undefined;
154
227
  contextWindow?: number | undefined;
155
228
  maxOutputTokens?: number | undefined;
156
229
  inputModalities?: string[] | undefined;
@@ -164,6 +237,19 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
164
237
  catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
165
238
  catalogCredentialEnv?: string | undefined;
166
239
  catalogAccountId?: string | undefined;
240
+ additionalModels?: {
241
+ id: string;
242
+ name: string;
243
+ description?: string | undefined;
244
+ available?: boolean | undefined;
245
+ expiresOn?: string | undefined;
246
+ contextWindow?: number | undefined;
247
+ maxOutputTokens?: number | undefined;
248
+ inputModalities?: string[] | undefined;
249
+ outputModalities?: string[] | undefined;
250
+ supportedParameters?: string[] | undefined;
251
+ supportedGenerationMethods?: string[] | undefined;
252
+ }[] | undefined;
167
253
  }, {
168
254
  id: string;
169
255
  name: string;
@@ -182,6 +268,20 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
182
268
  name: string;
183
269
  description?: string | undefined;
184
270
  available?: boolean | undefined;
271
+ expiresOn?: string | undefined;
272
+ contextWindow?: number | undefined;
273
+ maxOutputTokens?: number | undefined;
274
+ inputModalities?: string[] | undefined;
275
+ outputModalities?: string[] | undefined;
276
+ supportedParameters?: string[] | undefined;
277
+ supportedGenerationMethods?: string[] | undefined;
278
+ }[] | undefined;
279
+ additionalModels?: {
280
+ id: string;
281
+ name: string;
282
+ description?: string | undefined;
283
+ available?: boolean | undefined;
284
+ expiresOn?: string | undefined;
185
285
  contextWindow?: number | undefined;
186
286
  maxOutputTokens?: number | undefined;
187
287
  inputModalities?: string[] | undefined;
@@ -607,5 +707,7 @@ export declare class CommandInterrupted extends Fault {
607
707
  export declare function parse<T>(schema: z.ZodType<T, any, any>, value: unknown): T;
608
708
  export declare function compatible(harness: Profile["harness"], protocol: Provider["protocol"]): boolean;
609
709
  export declare function validateHarnessProvider(harness: Profile["harness"], provider: Pick<Provider, "protocol" | "authStyle">): void;
710
+ /** Operator expiry dates are inclusive in UTC; they do not promise provider uptime. */
711
+ export declare function modelExpired(model: Model, now?: Date): boolean;
610
712
  export declare function codingEligible(model: Model): boolean;
611
713
  export declare function harnessEligible(model: Model, harness: Profile["harness"]): boolean;
@@ -293,6 +293,20 @@ export interface components {
293
293
  name: string;
294
294
  description?: string;
295
295
  available?: boolean;
296
+ expiresOn?: string;
297
+ contextWindow?: number;
298
+ maxOutputTokens?: number;
299
+ inputModalities?: string[];
300
+ outputModalities?: string[];
301
+ supportedParameters?: string[];
302
+ supportedGenerationMethods?: string[];
303
+ }[];
304
+ additionalModels?: {
305
+ id: string;
306
+ name: string;
307
+ description?: string;
308
+ available?: boolean;
309
+ expiresOn?: string;
296
310
  contextWindow?: number;
297
311
  maxOutputTokens?: number;
298
312
  inputModalities?: string[];
@@ -328,6 +342,20 @@ export interface components {
328
342
  name: string;
329
343
  description?: string;
330
344
  available?: boolean;
345
+ expiresOn?: string;
346
+ contextWindow?: number;
347
+ maxOutputTokens?: number;
348
+ inputModalities?: string[];
349
+ outputModalities?: string[];
350
+ supportedParameters?: string[];
351
+ supportedGenerationMethods?: string[];
352
+ }[];
353
+ additionalModels?: {
354
+ id: string;
355
+ name: string;
356
+ description?: string;
357
+ available?: boolean;
358
+ expiresOn?: string;
331
359
  contextWindow?: number;
332
360
  maxOutputTokens?: number;
333
361
  inputModalities?: string[];
@@ -409,6 +437,7 @@ export interface components {
409
437
  name: string;
410
438
  description?: string;
411
439
  available?: boolean;
440
+ expiresOn?: string;
412
441
  contextWindow?: number;
413
442
  maxOutputTokens?: number;
414
443
  inputModalities?: string[];
@@ -460,6 +489,7 @@ export interface components {
460
489
  name: string;
461
490
  description?: string;
462
491
  available?: boolean;
492
+ expiresOn?: string;
463
493
  contextWindow?: number;
464
494
  maxOutputTokens?: number;
465
495
  inputModalities?: string[];
@@ -467,6 +497,7 @@ export interface components {
467
497
  supportedParameters?: string[];
468
498
  supportedGenerationMethods?: string[];
469
499
  codingEligible: boolean;
500
+ expired: boolean;
470
501
  }[];
471
502
  total: number;
472
503
  limit: number;
@@ -481,6 +512,7 @@ export interface components {
481
512
  name: string;
482
513
  description?: string;
483
514
  available?: boolean;
515
+ expiresOn?: string;
484
516
  contextWindow?: number;
485
517
  maxOutputTokens?: number;
486
518
  inputModalities?: string[];
@@ -520,6 +552,20 @@ export interface components {
520
552
  name: string;
521
553
  description?: string;
522
554
  available?: boolean;
555
+ expiresOn?: string;
556
+ contextWindow?: number;
557
+ maxOutputTokens?: number;
558
+ inputModalities?: string[];
559
+ outputModalities?: string[];
560
+ supportedParameters?: string[];
561
+ supportedGenerationMethods?: string[];
562
+ }[];
563
+ additionalModels?: {
564
+ id: string;
565
+ name: string;
566
+ description?: string;
567
+ available?: boolean;
568
+ expiresOn?: string;
523
569
  contextWindow?: number;
524
570
  maxOutputTokens?: number;
525
571
  inputModalities?: string[];
@@ -570,6 +616,7 @@ export interface components {
570
616
  name: string;
571
617
  description?: string;
572
618
  available?: boolean;
619
+ expiresOn?: string;
573
620
  contextWindow?: number;
574
621
  maxOutputTokens?: number;
575
622
  inputModalities?: string[];
package/dist/index.js CHANGED
@@ -70,11 +70,16 @@ var urlSchema = z2.string().max(2000).superRefine((v, ctx) => {
70
70
  ctx.addIssue({ code: "custom", message: "Invalid endpoint URL" });
71
71
  }
72
72
  }).transform(endpoint);
73
+ var expiresOnSchema = z2.string().regex(/^\d{4}-\d{2}-\d{2}$/).refine((value) => {
74
+ const day = new Date(`${value}T00:00:00.000Z`);
75
+ return Number.isFinite(day.getTime()) && day.toISOString().slice(0, 10) === value;
76
+ }, "Use a real calendar date in YYYY-MM-DD format.");
73
77
  var modelSchema = z2.object({
74
78
  id: z2.string().min(1).max(300),
75
79
  name: label,
76
80
  description: z2.string().max(8000).optional(),
77
81
  available: z2.boolean().optional(),
82
+ expiresOn: expiresOnSchema.optional(),
78
83
  contextWindow: z2.number().int().positive().optional(),
79
84
  maxOutputTokens: z2.number().int().positive().optional(),
80
85
  inputModalities: z2.array(z2.string().max(50)).max(20).optional(),
@@ -95,7 +100,8 @@ var providerInputSchema = z2.object({
95
100
  catalogCredentialEnv: envRef.optional(),
96
101
  catalogAccountId: z2.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/).optional(),
97
102
  modelsPath: z2.string().regex(/^[a-zA-Z0-9_/-]+$/).max(200).default("models"),
98
- manualModels: z2.array(modelSchema).max(1e4).default([])
103
+ manualModels: z2.array(modelSchema).max(1e4).default([]),
104
+ additionalModels: z2.array(modelSchema).max(1e4).optional()
99
105
  }).strict().refine((p) => !p.modelsPath.split("/").includes("..") && !p.modelsPath.startsWith("/"), "modelsPath must be relative");
100
106
  var providerPresetSchema = z2.object({
101
107
  id: idSchema,
@@ -322,7 +328,12 @@ function providerFromPreset(presetId, options = {}) {
322
328
  catalogAuthStyle: options.catalogAuthStyle ?? selected.catalogAuthStyle,
323
329
  catalogFormat: options.catalogFormat ?? selected.catalogFormat,
324
330
  catalogAccountId: options.catalogAccountId,
325
- modelsPath: options.modelsPath ?? selected.modelsPath
331
+ modelsPath: options.modelsPath ?? selected.modelsPath,
332
+ additionalModels: presetId === "deepseek" && new URL(baseUrl).origin === "https://api.deepseek.com" ? [{
333
+ id: "deepseek-v4.1-flash-expires-on-0910",
334
+ name: "DeepSeek V4.1 Flash preview",
335
+ expiresOn: "2026-09-10"
336
+ }] : []
326
337
  });
327
338
  }
328
339
 
package/dist/mcp/index.js CHANGED
@@ -55,7 +55,7 @@ var routingEventSchema = z.object({
55
55
  var routingEventsSchema = z.array(routingEventSchema).max(1000);
56
56
 
57
57
  // src/domain.ts
58
- var VERSION = "0.1.5";
58
+ var VERSION = "0.1.7";
59
59
  var harnessSchema = z2.enum(["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]);
60
60
  var protocolSchema = z2.enum(["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]);
61
61
  var idSchema = z2.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$/);
@@ -80,11 +80,16 @@ var urlSchema = z2.string().max(2000).superRefine((v, ctx) => {
80
80
  ctx.addIssue({ code: "custom", message: "Invalid endpoint URL" });
81
81
  }
82
82
  }).transform(endpoint);
83
+ var expiresOnSchema = z2.string().regex(/^\d{4}-\d{2}-\d{2}$/).refine((value) => {
84
+ const day = new Date(`${value}T00:00:00.000Z`);
85
+ return Number.isFinite(day.getTime()) && day.toISOString().slice(0, 10) === value;
86
+ }, "Use a real calendar date in YYYY-MM-DD format.");
83
87
  var modelSchema = z2.object({
84
88
  id: z2.string().min(1).max(300),
85
89
  name: label,
86
90
  description: z2.string().max(8000).optional(),
87
91
  available: z2.boolean().optional(),
92
+ expiresOn: expiresOnSchema.optional(),
88
93
  contextWindow: z2.number().int().positive().optional(),
89
94
  maxOutputTokens: z2.number().int().positive().optional(),
90
95
  inputModalities: z2.array(z2.string().max(50)).max(20).optional(),
@@ -105,7 +110,8 @@ var providerInputSchema = z2.object({
105
110
  catalogCredentialEnv: envRef.optional(),
106
111
  catalogAccountId: z2.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/).optional(),
107
112
  modelsPath: z2.string().regex(/^[a-zA-Z0-9_/-]+$/).max(200).default("models"),
108
- manualModels: z2.array(modelSchema).max(1e4).default([])
113
+ manualModels: z2.array(modelSchema).max(1e4).default([]),
114
+ additionalModels: z2.array(modelSchema).max(1e4).optional()
109
115
  }).strict().refine((p) => !p.modelsPath.split("/").includes("..") && !p.modelsPath.startsWith("/"), "modelsPath must be relative");
110
116
  var providerPresetSchema = z2.object({
111
117
  id: idSchema,
package/dist/presets.d.ts CHANGED
@@ -45,6 +45,7 @@ export declare function providerFromPreset(presetId: string, options?: PresetOpt
45
45
  name: string;
46
46
  description?: string | undefined;
47
47
  available?: boolean | undefined;
48
+ expiresOn?: string | undefined;
48
49
  contextWindow?: number | undefined;
49
50
  maxOutputTokens?: number | undefined;
50
51
  inputModalities?: string[] | undefined;
@@ -58,6 +59,19 @@ export declare function providerFromPreset(presetId: string, options?: PresetOpt
58
59
  catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
59
60
  catalogCredentialEnv?: string | undefined;
60
61
  catalogAccountId?: string | undefined;
62
+ additionalModels?: {
63
+ id: string;
64
+ name: string;
65
+ description?: string | undefined;
66
+ available?: boolean | undefined;
67
+ expiresOn?: string | undefined;
68
+ contextWindow?: number | undefined;
69
+ maxOutputTokens?: number | undefined;
70
+ inputModalities?: string[] | undefined;
71
+ outputModalities?: string[] | undefined;
72
+ supportedParameters?: string[] | undefined;
73
+ supportedGenerationMethods?: string[] | undefined;
74
+ }[] | undefined;
61
75
  };
62
76
  /** Resolve an alias only for the preset's exact credential reference and origin. */
63
77
  export declare function providerCredential(provider: ProviderInput, env?: NodeJS.ProcessEnv): string | undefined;
@@ -0,0 +1,2 @@
1
+ /** Only classify known structured failures. Provider text never leaves this boundary. */
2
+ export declare function isContextOverflow(response: Response): Promise<boolean>;
package/dist/sdk.d.ts CHANGED
@@ -98,6 +98,20 @@ export declare class SwitcherClient {
98
98
  name: string;
99
99
  description?: string;
100
100
  available?: boolean;
101
+ expiresOn?: string;
102
+ contextWindow?: number;
103
+ maxOutputTokens?: number;
104
+ inputModalities?: string[];
105
+ outputModalities?: string[];
106
+ supportedParameters?: string[];
107
+ supportedGenerationMethods?: string[];
108
+ }[];
109
+ additionalModels?: {
110
+ id: string;
111
+ name: string;
112
+ description?: string;
113
+ available?: boolean;
114
+ expiresOn?: string;
101
115
  contextWindow?: number;
102
116
  maxOutputTokens?: number;
103
117
  inputModalities?: string[];
@@ -126,6 +140,20 @@ export declare class SwitcherClient {
126
140
  name: string;
127
141
  description?: string;
128
142
  available?: boolean;
143
+ expiresOn?: string;
144
+ contextWindow?: number;
145
+ maxOutputTokens?: number;
146
+ inputModalities?: string[];
147
+ outputModalities?: string[];
148
+ supportedParameters?: string[];
149
+ supportedGenerationMethods?: string[];
150
+ }[];
151
+ additionalModels?: {
152
+ id: string;
153
+ name: string;
154
+ description?: string;
155
+ available?: boolean;
156
+ expiresOn?: string;
129
157
  contextWindow?: number;
130
158
  maxOutputTokens?: number;
131
159
  inputModalities?: string[];
@@ -154,6 +182,20 @@ export declare class SwitcherClient {
154
182
  name: string;
155
183
  description?: string;
156
184
  available?: boolean;
185
+ expiresOn?: string;
186
+ contextWindow?: number;
187
+ maxOutputTokens?: number;
188
+ inputModalities?: string[];
189
+ outputModalities?: string[];
190
+ supportedParameters?: string[];
191
+ supportedGenerationMethods?: string[];
192
+ }[];
193
+ additionalModels?: {
194
+ id: string;
195
+ name: string;
196
+ description?: string;
197
+ available?: boolean;
198
+ expiresOn?: string;
157
199
  contextWindow?: number;
158
200
  maxOutputTokens?: number;
159
201
  inputModalities?: string[];
@@ -182,6 +224,20 @@ export declare class SwitcherClient {
182
224
  name: string;
183
225
  description?: string;
184
226
  available?: boolean;
227
+ expiresOn?: string;
228
+ contextWindow?: number;
229
+ maxOutputTokens?: number;
230
+ inputModalities?: string[];
231
+ outputModalities?: string[];
232
+ supportedParameters?: string[];
233
+ supportedGenerationMethods?: string[];
234
+ }[];
235
+ additionalModels?: {
236
+ id: string;
237
+ name: string;
238
+ description?: string;
239
+ available?: boolean;
240
+ expiresOn?: string;
185
241
  contextWindow?: number;
186
242
  maxOutputTokens?: number;
187
243
  inputModalities?: string[];
@@ -201,6 +257,7 @@ export declare class SwitcherClient {
201
257
  name: string;
202
258
  description?: string;
203
259
  available?: boolean;
260
+ expiresOn?: string;
204
261
  contextWindow?: number;
205
262
  maxOutputTokens?: number;
206
263
  inputModalities?: string[];
@@ -217,6 +274,7 @@ export declare class SwitcherClient {
217
274
  name: string;
218
275
  description?: string;
219
276
  available?: boolean;
277
+ expiresOn?: string;
220
278
  contextWindow?: number;
221
279
  maxOutputTokens?: number;
222
280
  inputModalities?: string[];
@@ -224,6 +282,7 @@ export declare class SwitcherClient {
224
282
  supportedParameters?: string[];
225
283
  supportedGenerationMethods?: string[];
226
284
  codingEligible: boolean;
285
+ expired: boolean;
227
286
  }[];
228
287
  total: number;
229
288
  limit: number;
@@ -369,6 +428,20 @@ export declare class SwitcherClient {
369
428
  name: string;
370
429
  description?: string;
371
430
  available?: boolean;
431
+ expiresOn?: string;
432
+ contextWindow?: number;
433
+ maxOutputTokens?: number;
434
+ inputModalities?: string[];
435
+ outputModalities?: string[];
436
+ supportedParameters?: string[];
437
+ supportedGenerationMethods?: string[];
438
+ }[];
439
+ additionalModels?: {
440
+ id: string;
441
+ name: string;
442
+ description?: string;
443
+ available?: boolean;
444
+ expiresOn?: string;
372
445
  contextWindow?: number;
373
446
  maxOutputTokens?: number;
374
447
  inputModalities?: string[];
@@ -414,6 +487,7 @@ export declare class SwitcherClient {
414
487
  name: string;
415
488
  description?: string;
416
489
  available?: boolean;
490
+ expiresOn?: string;
417
491
  contextWindow?: number;
418
492
  maxOutputTokens?: number;
419
493
  inputModalities?: string[];
package/dist/sdk.js CHANGED
@@ -70,11 +70,16 @@ var urlSchema = z2.string().max(2000).superRefine((v, ctx) => {
70
70
  ctx.addIssue({ code: "custom", message: "Invalid endpoint URL" });
71
71
  }
72
72
  }).transform(endpoint);
73
+ var expiresOnSchema = z2.string().regex(/^\d{4}-\d{2}-\d{2}$/).refine((value) => {
74
+ const day = new Date(`${value}T00:00:00.000Z`);
75
+ return Number.isFinite(day.getTime()) && day.toISOString().slice(0, 10) === value;
76
+ }, "Use a real calendar date in YYYY-MM-DD format.");
73
77
  var modelSchema = z2.object({
74
78
  id: z2.string().min(1).max(300),
75
79
  name: label,
76
80
  description: z2.string().max(8000).optional(),
77
81
  available: z2.boolean().optional(),
82
+ expiresOn: expiresOnSchema.optional(),
78
83
  contextWindow: z2.number().int().positive().optional(),
79
84
  maxOutputTokens: z2.number().int().positive().optional(),
80
85
  inputModalities: z2.array(z2.string().max(50)).max(20).optional(),
@@ -95,7 +100,8 @@ var providerInputSchema = z2.object({
95
100
  catalogCredentialEnv: envRef.optional(),
96
101
  catalogAccountId: z2.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/).optional(),
97
102
  modelsPath: z2.string().regex(/^[a-zA-Z0-9_/-]+$/).max(200).default("models"),
98
- manualModels: z2.array(modelSchema).max(1e4).default([])
103
+ manualModels: z2.array(modelSchema).max(1e4).default([]),
104
+ additionalModels: z2.array(modelSchema).max(1e4).optional()
99
105
  }).strict().refine((p) => !p.modelsPath.split("/").includes("..") && !p.modelsPath.startsWith("/"), "modelsPath must be relative");
100
106
  var providerPresetSchema = z2.object({
101
107
  id: idSchema,
@@ -322,7 +328,12 @@ function providerFromPreset(presetId, options = {}) {
322
328
  catalogAuthStyle: options.catalogAuthStyle ?? selected.catalogAuthStyle,
323
329
  catalogFormat: options.catalogFormat ?? selected.catalogFormat,
324
330
  catalogAccountId: options.catalogAccountId,
325
- modelsPath: options.modelsPath ?? selected.modelsPath
331
+ modelsPath: options.modelsPath ?? selected.modelsPath,
332
+ additionalModels: presetId === "deepseek" && new URL(baseUrl).origin === "https://api.deepseek.com" ? [{
333
+ id: "deepseek-v4.1-flash-expires-on-0910",
334
+ name: "DeepSeek V4.1 Flash preview",
335
+ expiresOn: "2026-09-10"
336
+ }] : []
326
337
  });
327
338
  }
328
339