@hasna/switcher 0.2.1 → 0.2.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/Dockerfile +38 -8
- package/README.md +43 -13
- package/dist/cli/index.js +2855 -2189
- package/dist/credentials.d.ts +52 -7
- package/dist/direct-launch.d.ts +1 -0
- package/dist/domain.d.ts +140 -4
- package/dist/generated/api.d.ts +141 -1
- package/dist/index.js +21 -12
- package/dist/launcher.d.ts +1 -0
- package/dist/mcp/index.js +1152 -96
- package/dist/mint/index.js +136 -0
- package/dist/mint-key.d.ts +34 -0
- package/dist/presets.d.ts +8 -0
- package/dist/provider-credential-onboarding.d.ts +73 -0
- package/dist/sdk.d.ts +57 -1
- package/dist/sdk.js +21 -12
- package/dist/serve/index.js +447 -91
- package/dist/server.d.ts +2 -1
- package/dist/service.d.ts +8 -1
- package/dist/store.d.ts +4 -0
- package/hasna.contract.json +20 -6
- package/openapi.json +227 -9
- package/package.json +6 -3
package/dist/credentials.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type CredentialChainOptions } from "@hasna/contracts/client";
|
|
3
3
|
import { CommandInterrupted, type ProviderInput } from "./domain";
|
|
4
|
+
export declare const vaultKeySchema: z.ZodString;
|
|
4
5
|
declare const keychain: z.ZodObject<{
|
|
5
6
|
kind: z.ZodLiteral<"keychain">;
|
|
6
7
|
service: z.ZodString;
|
|
@@ -14,10 +15,12 @@ declare const keychain: z.ZodObject<{
|
|
|
14
15
|
service: string;
|
|
15
16
|
account: string;
|
|
16
17
|
}>;
|
|
18
|
+
declare const credentialTier: z.ZodEnum<["argument", "override", "pointer", "profile", "keychain", "disk", "env"]>;
|
|
17
19
|
export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
18
20
|
schema: z.ZodLiteral<1>;
|
|
19
21
|
credentialEnv: z.ZodString;
|
|
20
22
|
origins: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
23
|
+
requireProviderAuthentication: z.ZodOptional<z.ZodLiteral<true>>;
|
|
21
24
|
source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
22
25
|
kind: z.ZodLiteral<"keychain">;
|
|
23
26
|
service: z.ZodString;
|
|
@@ -37,10 +40,16 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
37
40
|
executable: z.ZodEffects<z.ZodString, string, string>;
|
|
38
41
|
operator: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
39
42
|
kind: z.ZodLiteral<"contracts">;
|
|
43
|
+
expectedSource: z.ZodOptional<z.ZodString>;
|
|
44
|
+
expectedTier: z.ZodOptional<z.ZodEnum<["argument", "override", "pointer", "profile", "keychain", "disk", "env"]>>;
|
|
40
45
|
}, "strict", z.ZodTypeAny, {
|
|
41
46
|
kind: "contracts";
|
|
47
|
+
expectedSource?: string | undefined;
|
|
48
|
+
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
42
49
|
}, {
|
|
43
50
|
kind: "contracts";
|
|
51
|
+
expectedSource?: string | undefined;
|
|
52
|
+
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
44
53
|
}>, z.ZodObject<{
|
|
45
54
|
kind: z.ZodLiteral<"env">;
|
|
46
55
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -58,11 +67,13 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
58
67
|
account: string;
|
|
59
68
|
}>]>;
|
|
60
69
|
}, "strict", z.ZodTypeAny, {
|
|
61
|
-
executable: string;
|
|
62
70
|
key: string;
|
|
71
|
+
executable: string;
|
|
63
72
|
kind: "vault";
|
|
64
73
|
operator: {
|
|
65
74
|
kind: "contracts";
|
|
75
|
+
expectedSource?: string | undefined;
|
|
76
|
+
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
66
77
|
} | {
|
|
67
78
|
kind: "env";
|
|
68
79
|
} | {
|
|
@@ -71,11 +82,13 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
71
82
|
};
|
|
72
83
|
url?: string | undefined;
|
|
73
84
|
}, {
|
|
74
|
-
executable: string;
|
|
75
85
|
key: string;
|
|
86
|
+
executable: string;
|
|
76
87
|
kind: "vault";
|
|
77
88
|
operator: {
|
|
78
89
|
kind: "contracts";
|
|
90
|
+
expectedSource?: string | undefined;
|
|
91
|
+
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
79
92
|
} | {
|
|
80
93
|
kind: "env";
|
|
81
94
|
} | {
|
|
@@ -91,11 +104,13 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
91
104
|
service: string;
|
|
92
105
|
account: string;
|
|
93
106
|
} | {
|
|
94
|
-
executable: string;
|
|
95
107
|
key: string;
|
|
108
|
+
executable: string;
|
|
96
109
|
kind: "vault";
|
|
97
110
|
operator: {
|
|
98
111
|
kind: "contracts";
|
|
112
|
+
expectedSource?: string | undefined;
|
|
113
|
+
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
99
114
|
} | {
|
|
100
115
|
kind: "env";
|
|
101
116
|
} | {
|
|
@@ -106,6 +121,7 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
106
121
|
};
|
|
107
122
|
schema: 1;
|
|
108
123
|
origins: string[];
|
|
124
|
+
requireProviderAuthentication?: true | undefined;
|
|
109
125
|
}, {
|
|
110
126
|
credentialEnv: string;
|
|
111
127
|
source: {
|
|
@@ -113,11 +129,13 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
113
129
|
service: string;
|
|
114
130
|
account: string;
|
|
115
131
|
} | {
|
|
116
|
-
executable: string;
|
|
117
132
|
key: string;
|
|
133
|
+
executable: string;
|
|
118
134
|
kind: "vault";
|
|
119
135
|
operator: {
|
|
120
136
|
kind: "contracts";
|
|
137
|
+
expectedSource?: string | undefined;
|
|
138
|
+
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
121
139
|
} | {
|
|
122
140
|
kind: "env";
|
|
123
141
|
} | {
|
|
@@ -128,6 +146,7 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
128
146
|
};
|
|
129
147
|
schema: 1;
|
|
130
148
|
origins: string[];
|
|
149
|
+
requireProviderAuthentication?: true | undefined;
|
|
131
150
|
}>, {
|
|
132
151
|
credentialEnv: string;
|
|
133
152
|
source: {
|
|
@@ -135,11 +154,13 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
135
154
|
service: string;
|
|
136
155
|
account: string;
|
|
137
156
|
} | {
|
|
138
|
-
executable: string;
|
|
139
157
|
key: string;
|
|
158
|
+
executable: string;
|
|
140
159
|
kind: "vault";
|
|
141
160
|
operator: {
|
|
142
161
|
kind: "contracts";
|
|
162
|
+
expectedSource?: string | undefined;
|
|
163
|
+
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
143
164
|
} | {
|
|
144
165
|
kind: "env";
|
|
145
166
|
} | {
|
|
@@ -150,6 +171,7 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
150
171
|
};
|
|
151
172
|
schema: 1;
|
|
152
173
|
origins: string[];
|
|
174
|
+
requireProviderAuthentication?: true | undefined;
|
|
153
175
|
}, {
|
|
154
176
|
credentialEnv: string;
|
|
155
177
|
source: {
|
|
@@ -157,11 +179,13 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
157
179
|
service: string;
|
|
158
180
|
account: string;
|
|
159
181
|
} | {
|
|
160
|
-
executable: string;
|
|
161
182
|
key: string;
|
|
183
|
+
executable: string;
|
|
162
184
|
kind: "vault";
|
|
163
185
|
operator: {
|
|
164
186
|
kind: "contracts";
|
|
187
|
+
expectedSource?: string | undefined;
|
|
188
|
+
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
165
189
|
} | {
|
|
166
190
|
kind: "env";
|
|
167
191
|
} | {
|
|
@@ -172,6 +196,7 @@ export declare const credentialBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
|
172
196
|
};
|
|
173
197
|
schema: 1;
|
|
174
198
|
origins: string[];
|
|
199
|
+
requireProviderAuthentication?: true | undefined;
|
|
175
200
|
}>;
|
|
176
201
|
export type CredentialBinding = z.infer<typeof credentialBindingSchema>;
|
|
177
202
|
export declare class CredentialBindings {
|
|
@@ -189,11 +214,13 @@ export declare class CredentialBindings {
|
|
|
189
214
|
service: string;
|
|
190
215
|
account: string;
|
|
191
216
|
} | {
|
|
192
|
-
executable: string;
|
|
193
217
|
key: string;
|
|
218
|
+
executable: string;
|
|
194
219
|
kind: "vault";
|
|
195
220
|
operator: {
|
|
196
221
|
kind: "contracts";
|
|
222
|
+
expectedSource?: string | undefined;
|
|
223
|
+
expectedTier?: "profile" | "argument" | "override" | "pointer" | "keychain" | "disk" | "env" | undefined;
|
|
197
224
|
} | {
|
|
198
225
|
kind: "env";
|
|
199
226
|
} | {
|
|
@@ -204,6 +231,7 @@ export declare class CredentialBindings {
|
|
|
204
231
|
};
|
|
205
232
|
schema: 1;
|
|
206
233
|
origins: string[];
|
|
234
|
+
requireProviderAuthentication?: true | undefined;
|
|
207
235
|
}>;
|
|
208
236
|
remove(name: string): Promise<{
|
|
209
237
|
removed: string;
|
|
@@ -246,8 +274,25 @@ export declare class CredentialResolver {
|
|
|
246
274
|
export declare class CredentialInterrupted extends CommandInterrupted {
|
|
247
275
|
constructor(exitCode: number);
|
|
248
276
|
}
|
|
277
|
+
export type VaultOperatorResolution = {
|
|
278
|
+
environment: NodeJS.ProcessEnv;
|
|
279
|
+
source: string;
|
|
280
|
+
tier: z.infer<typeof credentialTier>;
|
|
281
|
+
url: string;
|
|
282
|
+
};
|
|
283
|
+
/** Select an operator through the shared credential seam, then pin that choice. */
|
|
284
|
+
export declare function resolveVaultOperatorEnvironment(binding: CredentialBinding, env: NodeJS.ProcessEnv, options?: Pick<CredentialChainOptions, "keychain">): Promise<VaultOperatorResolution>;
|
|
249
285
|
/** Select an operator through the shared credential seam, then pin that choice. */
|
|
250
286
|
export declare function vaultEnvironment(binding: CredentialBinding, env: NodeJS.ProcessEnv, options?: Pick<CredentialChainOptions, "keychain">): Promise<NodeJS.ProcessEnv>;
|
|
287
|
+
/** Vault children never own a harness or a TTY; their entire process group is bounded. */
|
|
288
|
+
export declare function runVaultCommand(binding: CredentialBinding, args: string[], env: NodeJS.ProcessEnv, delivery?: NodeJS.ProcessEnv, options?: {
|
|
289
|
+
captureBytes?: number;
|
|
290
|
+
oversizeCode?: string;
|
|
291
|
+
oversizeMessage?: string;
|
|
292
|
+
lookupCode?: string;
|
|
293
|
+
lookupMessage?: string;
|
|
294
|
+
operator?: VaultOperatorResolution;
|
|
295
|
+
}): Promise<string>;
|
|
251
296
|
/** Internal child mode: the key travels only through an authenticated loopback request. */
|
|
252
297
|
export declare function deliverVaultCredential(): Promise<void>;
|
|
253
298
|
export {};
|
package/dist/direct-launch.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SwitcherClient, type Provider, type Profile } from "./sdk";
|
|
2
|
+
export { launchCatalog } from "./provider-credential-onboarding";
|
|
2
3
|
import { type Model, type ModelPolicy } from "./domain";
|
|
3
4
|
import { type PresetOptions } from "./presets";
|
|
4
5
|
export declare function resolveLaunchProvider(client: SwitcherClient, selector: string, options?: PresetOptions): Promise<Provider>;
|
package/dist/domain.d.ts
CHANGED
|
@@ -3,11 +3,21 @@ 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.2.
|
|
6
|
+
export declare const VERSION = "0.2.3";
|
|
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 credentialCheckSchema: z.ZodObject<{
|
|
12
|
+
method: z.ZodDefault<z.ZodEnum<["GET", "HEAD"]>>;
|
|
13
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
14
|
+
}, "strict", z.ZodTypeAny, {
|
|
15
|
+
path: string;
|
|
16
|
+
method: "GET" | "HEAD";
|
|
17
|
+
}, {
|
|
18
|
+
path: string;
|
|
19
|
+
method?: "GET" | "HEAD" | undefined;
|
|
20
|
+
}>;
|
|
11
21
|
export declare const expiresOnSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
12
22
|
export declare const modelSchema: z.ZodObject<{
|
|
13
23
|
id: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -56,6 +66,16 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
56
66
|
protocol: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
|
|
57
67
|
credentialEnv: z.ZodOptional<z.ZodString>;
|
|
58
68
|
authStyle: z.ZodDefault<z.ZodEnum<["bearer", "x-api-key", "api-key"]>>;
|
|
69
|
+
credentialCheck: z.ZodOptional<z.ZodObject<{
|
|
70
|
+
method: z.ZodDefault<z.ZodEnum<["GET", "HEAD"]>>;
|
|
71
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
72
|
+
}, "strict", z.ZodTypeAny, {
|
|
73
|
+
path: string;
|
|
74
|
+
method: "GET" | "HEAD";
|
|
75
|
+
}, {
|
|
76
|
+
path: string;
|
|
77
|
+
method?: "GET" | "HEAD" | undefined;
|
|
78
|
+
}>>;
|
|
59
79
|
catalogBaseUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
60
80
|
catalogFormat: z.ZodOptional<z.ZodEnum<["openai", "ollama", "mistral", "together", "fireworks", "dashscope", "gemini", "none"]>>;
|
|
61
81
|
catalogAuthStyle: z.ZodOptional<z.ZodEnum<["bearer", "x-api-key", "api-key", "none"]>>;
|
|
@@ -164,6 +184,10 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
164
184
|
supportedGenerationMethods?: string[] | undefined;
|
|
165
185
|
}[];
|
|
166
186
|
credentialEnv?: string | undefined;
|
|
187
|
+
credentialCheck?: {
|
|
188
|
+
path: string;
|
|
189
|
+
method: "GET" | "HEAD";
|
|
190
|
+
} | undefined;
|
|
167
191
|
catalogBaseUrl?: string | undefined;
|
|
168
192
|
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
169
193
|
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
@@ -190,6 +214,10 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
190
214
|
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
191
215
|
credentialEnv?: string | undefined;
|
|
192
216
|
authStyle?: "bearer" | "x-api-key" | "api-key" | undefined;
|
|
217
|
+
credentialCheck?: {
|
|
218
|
+
path: string;
|
|
219
|
+
method?: "GET" | "HEAD" | undefined;
|
|
220
|
+
} | undefined;
|
|
193
221
|
catalogBaseUrl?: string | undefined;
|
|
194
222
|
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
195
223
|
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
@@ -246,6 +274,10 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
246
274
|
supportedGenerationMethods?: string[] | undefined;
|
|
247
275
|
}[];
|
|
248
276
|
credentialEnv?: string | undefined;
|
|
277
|
+
credentialCheck?: {
|
|
278
|
+
path: string;
|
|
279
|
+
method: "GET" | "HEAD";
|
|
280
|
+
} | undefined;
|
|
249
281
|
catalogBaseUrl?: string | undefined;
|
|
250
282
|
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
251
283
|
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
@@ -272,6 +304,10 @@ export declare const providerInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
272
304
|
protocol: "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
273
305
|
credentialEnv?: string | undefined;
|
|
274
306
|
authStyle?: "bearer" | "x-api-key" | "api-key" | undefined;
|
|
307
|
+
credentialCheck?: {
|
|
308
|
+
path: string;
|
|
309
|
+
method?: "GET" | "HEAD" | undefined;
|
|
310
|
+
} | undefined;
|
|
275
311
|
catalogBaseUrl?: string | undefined;
|
|
276
312
|
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none" | undefined;
|
|
277
313
|
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
@@ -316,6 +352,16 @@ export declare const providerPresetSchema: z.ZodObject<{
|
|
|
316
352
|
protocol: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
|
|
317
353
|
baseUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
318
354
|
authStyle: z.ZodEnum<["bearer", "x-api-key", "api-key"]>;
|
|
355
|
+
credentialCheck: z.ZodOptional<z.ZodObject<{
|
|
356
|
+
method: z.ZodDefault<z.ZodEnum<["GET", "HEAD"]>>;
|
|
357
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
358
|
+
}, "strict", z.ZodTypeAny, {
|
|
359
|
+
path: string;
|
|
360
|
+
method: "GET" | "HEAD";
|
|
361
|
+
}, {
|
|
362
|
+
path: string;
|
|
363
|
+
method?: "GET" | "HEAD" | undefined;
|
|
364
|
+
}>>;
|
|
319
365
|
catalogBaseUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
320
366
|
catalogFormat: z.ZodEnum<["openai", "ollama", "mistral", "together", "fireworks", "dashscope", "gemini", "none"]>;
|
|
321
367
|
catalogAuthStyle: z.ZodOptional<z.ZodEnum<["bearer", "x-api-key", "api-key", "none"]>>;
|
|
@@ -328,6 +374,10 @@ export declare const providerPresetSchema: z.ZodObject<{
|
|
|
328
374
|
modelsPath: string;
|
|
329
375
|
notes: string[];
|
|
330
376
|
baseUrl?: string | undefined;
|
|
377
|
+
credentialCheck?: {
|
|
378
|
+
path: string;
|
|
379
|
+
method: "GET" | "HEAD";
|
|
380
|
+
} | undefined;
|
|
331
381
|
catalogBaseUrl?: string | undefined;
|
|
332
382
|
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
333
383
|
}, {
|
|
@@ -337,6 +387,10 @@ export declare const providerPresetSchema: z.ZodObject<{
|
|
|
337
387
|
modelsPath: string;
|
|
338
388
|
notes: string[];
|
|
339
389
|
baseUrl?: string | undefined;
|
|
390
|
+
credentialCheck?: {
|
|
391
|
+
path: string;
|
|
392
|
+
method?: "GET" | "HEAD" | undefined;
|
|
393
|
+
} | undefined;
|
|
340
394
|
catalogBaseUrl?: string | undefined;
|
|
341
395
|
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
342
396
|
}>, "many">;
|
|
@@ -353,6 +407,10 @@ export declare const providerPresetSchema: z.ZodObject<{
|
|
|
353
407
|
modelsPath: string;
|
|
354
408
|
notes: string[];
|
|
355
409
|
baseUrl?: string | undefined;
|
|
410
|
+
credentialCheck?: {
|
|
411
|
+
path: string;
|
|
412
|
+
method: "GET" | "HEAD";
|
|
413
|
+
} | undefined;
|
|
356
414
|
catalogBaseUrl?: string | undefined;
|
|
357
415
|
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
358
416
|
}[];
|
|
@@ -370,6 +428,10 @@ export declare const providerPresetSchema: z.ZodObject<{
|
|
|
370
428
|
modelsPath: string;
|
|
371
429
|
notes: string[];
|
|
372
430
|
baseUrl?: string | undefined;
|
|
431
|
+
credentialCheck?: {
|
|
432
|
+
path: string;
|
|
433
|
+
method?: "GET" | "HEAD" | undefined;
|
|
434
|
+
} | undefined;
|
|
373
435
|
catalogBaseUrl?: string | undefined;
|
|
374
436
|
catalogAuthStyle?: "bearer" | "x-api-key" | "api-key" | "none" | undefined;
|
|
375
437
|
}[];
|
|
@@ -705,11 +767,85 @@ export type Run = Omit<z.infer<typeof runInputSchema>, "modelPolicyVersion"> & {
|
|
|
705
767
|
version: number;
|
|
706
768
|
updatedAt: string;
|
|
707
769
|
};
|
|
708
|
-
export
|
|
709
|
-
models:
|
|
770
|
+
export declare const catalogSchema: z.ZodObject<{
|
|
771
|
+
models: z.ZodArray<z.ZodObject<{
|
|
772
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
773
|
+
name: z.ZodString;
|
|
774
|
+
description: z.ZodOptional<z.ZodString>;
|
|
775
|
+
available: z.ZodOptional<z.ZodBoolean>;
|
|
776
|
+
expiresOn: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
777
|
+
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
778
|
+
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
779
|
+
inputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
780
|
+
outputModalities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
781
|
+
supportedParameters: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
782
|
+
reasoningEfforts: z.ZodOptional<z.ZodArray<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra"]>, "many">>;
|
|
783
|
+
supportedGenerationMethods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
784
|
+
}, "strict", z.ZodTypeAny, {
|
|
785
|
+
id: string;
|
|
786
|
+
name: string;
|
|
787
|
+
description?: string | undefined;
|
|
788
|
+
available?: boolean | undefined;
|
|
789
|
+
expiresOn?: string | undefined;
|
|
790
|
+
contextWindow?: number | undefined;
|
|
791
|
+
maxOutputTokens?: number | undefined;
|
|
792
|
+
inputModalities?: string[] | undefined;
|
|
793
|
+
outputModalities?: string[] | undefined;
|
|
794
|
+
supportedParameters?: string[] | undefined;
|
|
795
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[] | undefined;
|
|
796
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
797
|
+
}, {
|
|
798
|
+
id: string;
|
|
799
|
+
name: string;
|
|
800
|
+
description?: string | undefined;
|
|
801
|
+
available?: boolean | undefined;
|
|
802
|
+
expiresOn?: string | undefined;
|
|
803
|
+
contextWindow?: number | undefined;
|
|
804
|
+
maxOutputTokens?: number | undefined;
|
|
805
|
+
inputModalities?: string[] | undefined;
|
|
806
|
+
outputModalities?: string[] | undefined;
|
|
807
|
+
supportedParameters?: string[] | undefined;
|
|
808
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[] | undefined;
|
|
809
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
810
|
+
}>, "many">;
|
|
811
|
+
refreshedAt: z.ZodString;
|
|
812
|
+
source: z.ZodEnum<["remote", "manual"]>;
|
|
813
|
+
}, "strict", z.ZodTypeAny, {
|
|
814
|
+
models: {
|
|
815
|
+
id: string;
|
|
816
|
+
name: string;
|
|
817
|
+
description?: string | undefined;
|
|
818
|
+
available?: boolean | undefined;
|
|
819
|
+
expiresOn?: string | undefined;
|
|
820
|
+
contextWindow?: number | undefined;
|
|
821
|
+
maxOutputTokens?: number | undefined;
|
|
822
|
+
inputModalities?: string[] | undefined;
|
|
823
|
+
outputModalities?: string[] | undefined;
|
|
824
|
+
supportedParameters?: string[] | undefined;
|
|
825
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[] | undefined;
|
|
826
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
827
|
+
}[];
|
|
710
828
|
refreshedAt: string;
|
|
711
829
|
source: "remote" | "manual";
|
|
712
|
-
}
|
|
830
|
+
}, {
|
|
831
|
+
models: {
|
|
832
|
+
id: string;
|
|
833
|
+
name: string;
|
|
834
|
+
description?: string | undefined;
|
|
835
|
+
available?: boolean | undefined;
|
|
836
|
+
expiresOn?: string | undefined;
|
|
837
|
+
contextWindow?: number | undefined;
|
|
838
|
+
maxOutputTokens?: number | undefined;
|
|
839
|
+
inputModalities?: string[] | undefined;
|
|
840
|
+
outputModalities?: string[] | undefined;
|
|
841
|
+
supportedParameters?: string[] | undefined;
|
|
842
|
+
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[] | undefined;
|
|
843
|
+
supportedGenerationMethods?: string[] | undefined;
|
|
844
|
+
}[];
|
|
845
|
+
refreshedAt: string;
|
|
846
|
+
source: "remote" | "manual";
|
|
847
|
+
}>;
|
|
848
|
+
export type Catalog = z.infer<typeof catalogSchema>;
|
|
713
849
|
export type LaunchPlan = {
|
|
714
850
|
planToken: string;
|
|
715
851
|
profile: Profile;
|
package/dist/generated/api.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export interface paths {
|
|
|
120
120
|
};
|
|
121
121
|
get?: never;
|
|
122
122
|
put?: never;
|
|
123
|
+
/** @description Self-hosted/local server refresh. Hosted clients discover locally and commit catalog metadata through the version-checked catalog endpoint. */
|
|
123
124
|
post: operations["refreshModels"];
|
|
124
125
|
delete?: never;
|
|
125
126
|
options?: never;
|
|
@@ -127,6 +128,22 @@ export interface paths {
|
|
|
127
128
|
patch?: never;
|
|
128
129
|
trace?: never;
|
|
129
130
|
};
|
|
131
|
+
"/v1/providers/{id}/catalog": {
|
|
132
|
+
parameters: {
|
|
133
|
+
query?: never;
|
|
134
|
+
header?: never;
|
|
135
|
+
path?: never;
|
|
136
|
+
cookie?: never;
|
|
137
|
+
};
|
|
138
|
+
get?: never;
|
|
139
|
+
put: operations["saveCatalog"];
|
|
140
|
+
post?: never;
|
|
141
|
+
delete?: never;
|
|
142
|
+
options?: never;
|
|
143
|
+
head?: never;
|
|
144
|
+
patch?: never;
|
|
145
|
+
trace?: never;
|
|
146
|
+
};
|
|
130
147
|
"/v1/launch-plans": {
|
|
131
148
|
parameters: {
|
|
132
149
|
query?: never;
|
|
@@ -224,6 +241,22 @@ export interface paths {
|
|
|
224
241
|
trace?: never;
|
|
225
242
|
};
|
|
226
243
|
"/v1/openapi.json": {
|
|
244
|
+
parameters: {
|
|
245
|
+
query?: never;
|
|
246
|
+
header?: never;
|
|
247
|
+
path?: never;
|
|
248
|
+
cookie?: never;
|
|
249
|
+
};
|
|
250
|
+
get: operations["openApiV1"];
|
|
251
|
+
put?: never;
|
|
252
|
+
post?: never;
|
|
253
|
+
delete?: never;
|
|
254
|
+
options?: never;
|
|
255
|
+
head?: never;
|
|
256
|
+
patch?: never;
|
|
257
|
+
trace?: never;
|
|
258
|
+
};
|
|
259
|
+
"/openapi.json": {
|
|
227
260
|
parameters: {
|
|
228
261
|
query?: never;
|
|
229
262
|
header?: never;
|
|
@@ -254,6 +287,14 @@ export interface components {
|
|
|
254
287
|
baseUrl?: string;
|
|
255
288
|
/** @enum {string} */
|
|
256
289
|
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
290
|
+
credentialCheck?: {
|
|
291
|
+
/**
|
|
292
|
+
* @default GET
|
|
293
|
+
* @enum {string}
|
|
294
|
+
*/
|
|
295
|
+
method: "GET" | "HEAD";
|
|
296
|
+
path: string;
|
|
297
|
+
};
|
|
257
298
|
catalogBaseUrl?: string;
|
|
258
299
|
/** @enum {string} */
|
|
259
300
|
catalogFormat: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
@@ -278,6 +319,14 @@ export interface components {
|
|
|
278
319
|
* @enum {string}
|
|
279
320
|
*/
|
|
280
321
|
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
322
|
+
credentialCheck?: {
|
|
323
|
+
/**
|
|
324
|
+
* @default GET
|
|
325
|
+
* @enum {string}
|
|
326
|
+
*/
|
|
327
|
+
method: "GET" | "HEAD";
|
|
328
|
+
path: string;
|
|
329
|
+
};
|
|
281
330
|
catalogBaseUrl?: string;
|
|
282
331
|
/** @enum {string} */
|
|
283
332
|
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
@@ -329,6 +378,14 @@ export interface components {
|
|
|
329
378
|
* @enum {string}
|
|
330
379
|
*/
|
|
331
380
|
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
381
|
+
credentialCheck?: {
|
|
382
|
+
/**
|
|
383
|
+
* @default GET
|
|
384
|
+
* @enum {string}
|
|
385
|
+
*/
|
|
386
|
+
method: "GET" | "HEAD";
|
|
387
|
+
path: string;
|
|
388
|
+
};
|
|
332
389
|
catalogBaseUrl?: string;
|
|
333
390
|
/** @enum {string} */
|
|
334
391
|
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
@@ -529,6 +586,7 @@ export interface components {
|
|
|
529
586
|
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
530
587
|
supportedGenerationMethods?: string[];
|
|
531
588
|
}[];
|
|
589
|
+
/** Format: date-time */
|
|
532
590
|
refreshedAt: string;
|
|
533
591
|
/** @enum {string} */
|
|
534
592
|
source: "remote" | "manual";
|
|
@@ -546,6 +604,14 @@ export interface components {
|
|
|
546
604
|
* @enum {string}
|
|
547
605
|
*/
|
|
548
606
|
authStyle: "bearer" | "x-api-key" | "api-key";
|
|
607
|
+
credentialCheck?: {
|
|
608
|
+
/**
|
|
609
|
+
* @default GET
|
|
610
|
+
* @enum {string}
|
|
611
|
+
*/
|
|
612
|
+
method: "GET" | "HEAD";
|
|
613
|
+
path: string;
|
|
614
|
+
};
|
|
549
615
|
catalogBaseUrl?: string;
|
|
550
616
|
/** @enum {string} */
|
|
551
617
|
catalogFormat?: "openai" | "ollama" | "mistral" | "together" | "fireworks" | "dashscope" | "gemini" | "none";
|
|
@@ -636,6 +702,7 @@ export interface components {
|
|
|
636
702
|
reasoningEfforts?: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
637
703
|
supportedGenerationMethods?: string[];
|
|
638
704
|
}[];
|
|
705
|
+
/** Format: date-time */
|
|
639
706
|
refreshedAt: string;
|
|
640
707
|
/** @enum {string} */
|
|
641
708
|
source: "remote" | "manual";
|
|
@@ -767,7 +834,11 @@ export interface components {
|
|
|
767
834
|
backend: "sqlite" | "postgresql";
|
|
768
835
|
};
|
|
769
836
|
Ready: {
|
|
770
|
-
|
|
837
|
+
/** @enum {string} */
|
|
838
|
+
status: "ready" | "unavailable";
|
|
839
|
+
version: string;
|
|
840
|
+
/** @enum {string} */
|
|
841
|
+
backend: "sqlite" | "postgresql";
|
|
771
842
|
reason?: string;
|
|
772
843
|
};
|
|
773
844
|
Version: {
|
|
@@ -1283,6 +1354,44 @@ export interface operations {
|
|
|
1283
1354
|
};
|
|
1284
1355
|
};
|
|
1285
1356
|
};
|
|
1357
|
+
saveCatalog: {
|
|
1358
|
+
parameters: {
|
|
1359
|
+
query?: never;
|
|
1360
|
+
header: {
|
|
1361
|
+
"Idempotency-Key": string;
|
|
1362
|
+
"If-Match": number;
|
|
1363
|
+
};
|
|
1364
|
+
path: {
|
|
1365
|
+
id: string;
|
|
1366
|
+
};
|
|
1367
|
+
cookie?: never;
|
|
1368
|
+
};
|
|
1369
|
+
requestBody: {
|
|
1370
|
+
content: {
|
|
1371
|
+
"application/json": components["schemas"]["Catalog"];
|
|
1372
|
+
};
|
|
1373
|
+
};
|
|
1374
|
+
responses: {
|
|
1375
|
+
/** @description Success */
|
|
1376
|
+
200: {
|
|
1377
|
+
headers: {
|
|
1378
|
+
[name: string]: unknown;
|
|
1379
|
+
};
|
|
1380
|
+
content: {
|
|
1381
|
+
"application/json": components["schemas"]["Catalog"];
|
|
1382
|
+
};
|
|
1383
|
+
};
|
|
1384
|
+
/** @description Structured error */
|
|
1385
|
+
default: {
|
|
1386
|
+
headers: {
|
|
1387
|
+
[name: string]: unknown;
|
|
1388
|
+
};
|
|
1389
|
+
content: {
|
|
1390
|
+
"application/json": components["schemas"]["Error"];
|
|
1391
|
+
};
|
|
1392
|
+
};
|
|
1393
|
+
};
|
|
1394
|
+
};
|
|
1286
1395
|
launchPlan: {
|
|
1287
1396
|
parameters: {
|
|
1288
1397
|
query?: never;
|
|
@@ -1547,6 +1656,37 @@ export interface operations {
|
|
|
1547
1656
|
};
|
|
1548
1657
|
};
|
|
1549
1658
|
};
|
|
1659
|
+
openApiV1: {
|
|
1660
|
+
parameters: {
|
|
1661
|
+
query?: never;
|
|
1662
|
+
header?: never;
|
|
1663
|
+
path?: never;
|
|
1664
|
+
cookie?: never;
|
|
1665
|
+
};
|
|
1666
|
+
requestBody?: never;
|
|
1667
|
+
responses: {
|
|
1668
|
+
/** @description Success */
|
|
1669
|
+
200: {
|
|
1670
|
+
headers: {
|
|
1671
|
+
[name: string]: unknown;
|
|
1672
|
+
};
|
|
1673
|
+
content: {
|
|
1674
|
+
"application/json": {
|
|
1675
|
+
[key: string]: unknown;
|
|
1676
|
+
};
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
/** @description Structured error */
|
|
1680
|
+
default: {
|
|
1681
|
+
headers: {
|
|
1682
|
+
[name: string]: unknown;
|
|
1683
|
+
};
|
|
1684
|
+
content: {
|
|
1685
|
+
"application/json": components["schemas"]["Error"];
|
|
1686
|
+
};
|
|
1687
|
+
};
|
|
1688
|
+
};
|
|
1689
|
+
};
|
|
1550
1690
|
openApi: {
|
|
1551
1691
|
parameters: {
|
|
1552
1692
|
query?: never;
|