@mutagent/sdk 0.3.10 → 0.3.12
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 +9 -6
- package/dist/commonjs/funcs/provider-configs-create-provider.d.ts +1 -1
- package/dist/commonjs/funcs/provider-configs-create-provider.js +1 -1
- package/dist/commonjs/funcs/provider-configs-list-provider-models.d.ts +19 -0
- package/dist/commonjs/funcs/provider-configs-list-provider-models.d.ts.map +1 -0
- package/dist/commonjs/funcs/provider-configs-list-provider-models.js +125 -0
- package/dist/commonjs/funcs/provider-configs-list-provider-models.js.map +1 -0
- package/dist/commonjs/funcs/provider-configs-list-providers.js +0 -3
- package/dist/commonjs/funcs/provider-configs-list-providers.js.map +1 -1
- package/dist/commonjs/funcs/provider-configs-update-provider.js +1 -1
- package/dist/commonjs/funcs/provider-configs-update-provider.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/errors/index.d.ts +1 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/errors/workspace-model-listing-error.d.ts +45 -0
- package/dist/commonjs/models/errors/workspace-model-listing-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/workspace-model-listing-error.js +76 -0
- package/dist/commonjs/models/errors/workspace-model-listing-error.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +1 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +1 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/name-api-key-base-url.d.ts +3 -3
- package/dist/commonjs/models/name-api-key-base-url.d.ts.map +1 -1
- package/dist/commonjs/models/name-api-key-base-url.js +1 -1
- package/dist/commonjs/models/name-api-key-base-url.js.map +1 -1
- package/dist/commonjs/models/name-provider-api-key.d.ts +23 -38
- package/dist/commonjs/models/name-provider-api-key.d.ts.map +1 -1
- package/dist/commonjs/models/name-provider-api-key.js +14 -17
- package/dist/commonjs/models/name-provider-api-key.js.map +1 -1
- package/dist/commonjs/models/name-slug-description2.d.ts +5 -0
- package/dist/commonjs/models/name-slug-description2.d.ts.map +1 -1
- package/dist/commonjs/models/name-slug-description2.js +1 -0
- package/dist/commonjs/models/name-slug-description2.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/list-provider-models.d.ts +12 -0
- package/dist/commonjs/models/operations/list-provider-models.d.ts.map +1 -0
- package/dist/commonjs/models/operations/list-provider-models.js +49 -0
- package/dist/commonjs/models/operations/list-provider-models.js.map +1 -0
- package/dist/commonjs/models/operations/list-providers.d.ts +0 -6
- package/dist/commonjs/models/operations/list-providers.d.ts.map +1 -1
- package/dist/commonjs/models/operations/list-providers.js +0 -3
- package/dist/commonjs/models/operations/list-providers.js.map +1 -1
- package/dist/commonjs/models/provider-config.d.ts +5 -13
- package/dist/commonjs/models/provider-config.d.ts.map +1 -1
- package/dist/commonjs/models/provider-config.js +2 -4
- package/dist/commonjs/models/provider-config.js.map +1 -1
- package/dist/commonjs/models/provider-configs-list.d.ts +5 -13
- package/dist/commonjs/models/provider-configs-list.d.ts.map +1 -1
- package/dist/commonjs/models/provider-configs-list.js +2 -4
- package/dist/commonjs/models/provider-configs-list.js.map +1 -1
- package/dist/commonjs/models/workspace-model-listing.d.ts +64 -0
- package/dist/commonjs/models/workspace-model-listing.d.ts.map +1 -0
- package/dist/commonjs/models/workspace-model-listing.js +77 -0
- package/dist/commonjs/models/workspace-model-listing.js.map +1 -0
- package/dist/commonjs/sdk/provider-configs.d.ts +8 -1
- package/dist/commonjs/sdk/provider-configs.d.ts.map +1 -1
- package/dist/commonjs/sdk/provider-configs.js +11 -1
- package/dist/commonjs/sdk/provider-configs.js.map +1 -1
- package/dist/esm/funcs/provider-configs-create-provider.d.ts +1 -1
- package/dist/esm/funcs/provider-configs-create-provider.js +1 -1
- package/dist/esm/funcs/provider-configs-list-provider-models.d.ts +19 -0
- package/dist/esm/funcs/provider-configs-list-provider-models.d.ts.map +1 -0
- package/dist/esm/funcs/provider-configs-list-provider-models.js +89 -0
- package/dist/esm/funcs/provider-configs-list-provider-models.js.map +1 -0
- package/dist/esm/funcs/provider-configs-list-providers.js +0 -3
- package/dist/esm/funcs/provider-configs-list-providers.js.map +1 -1
- package/dist/esm/funcs/provider-configs-update-provider.js +1 -1
- package/dist/esm/funcs/provider-configs-update-provider.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/errors/index.d.ts +1 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/errors/workspace-model-listing-error.d.ts +45 -0
- package/dist/esm/models/errors/workspace-model-listing-error.d.ts.map +1 -0
- package/dist/esm/models/errors/workspace-model-listing-error.js +39 -0
- package/dist/esm/models/errors/workspace-model-listing-error.js.map +1 -0
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +1 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/name-api-key-base-url.d.ts +3 -3
- package/dist/esm/models/name-api-key-base-url.d.ts.map +1 -1
- package/dist/esm/models/name-api-key-base-url.js +1 -1
- package/dist/esm/models/name-api-key-base-url.js.map +1 -1
- package/dist/esm/models/name-provider-api-key.d.ts +23 -38
- package/dist/esm/models/name-provider-api-key.d.ts.map +1 -1
- package/dist/esm/models/name-provider-api-key.js +12 -15
- package/dist/esm/models/name-provider-api-key.js.map +1 -1
- package/dist/esm/models/name-slug-description2.d.ts +5 -0
- package/dist/esm/models/name-slug-description2.d.ts.map +1 -1
- package/dist/esm/models/name-slug-description2.js +1 -0
- package/dist/esm/models/name-slug-description2.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/list-provider-models.d.ts +12 -0
- package/dist/esm/models/operations/list-provider-models.d.ts.map +1 -0
- package/dist/esm/models/operations/list-provider-models.js +12 -0
- package/dist/esm/models/operations/list-provider-models.js.map +1 -0
- package/dist/esm/models/operations/list-providers.d.ts +0 -6
- package/dist/esm/models/operations/list-providers.d.ts.map +1 -1
- package/dist/esm/models/operations/list-providers.js +0 -3
- package/dist/esm/models/operations/list-providers.js.map +1 -1
- package/dist/esm/models/provider-config.d.ts +5 -13
- package/dist/esm/models/provider-config.d.ts.map +1 -1
- package/dist/esm/models/provider-config.js +2 -4
- package/dist/esm/models/provider-config.js.map +1 -1
- package/dist/esm/models/provider-configs-list.d.ts +5 -13
- package/dist/esm/models/provider-configs-list.d.ts.map +1 -1
- package/dist/esm/models/provider-configs-list.js +2 -4
- package/dist/esm/models/provider-configs-list.js.map +1 -1
- package/dist/esm/models/workspace-model-listing.d.ts +64 -0
- package/dist/esm/models/workspace-model-listing.d.ts.map +1 -0
- package/dist/esm/models/workspace-model-listing.js +39 -0
- package/dist/esm/models/workspace-model-listing.js.map +1 -0
- package/dist/esm/sdk/provider-configs.d.ts +8 -1
- package/dist/esm/sdk/provider-configs.d.ts.map +1 -1
- package/dist/esm/sdk/provider-configs.js +11 -1
- package/dist/esm/sdk/provider-configs.js.map +1 -1
- package/package.json +1 -1
- package/src/funcs/provider-configs-create-provider.ts +1 -1
- package/src/funcs/provider-configs-list-provider-models.ts +182 -0
- package/src/funcs/provider-configs-list-providers.ts +0 -3
- package/src/funcs/provider-configs-update-provider.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/workspace-model-listing-error.ts +82 -0
- package/src/models/index.ts +1 -0
- package/src/models/name-api-key-base-url.ts +4 -4
- package/src/models/name-provider-api-key.ts +34 -47
- package/src/models/name-slug-description2.ts +6 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/list-provider-models.ts +30 -0
- package/src/models/operations/list-providers.ts +0 -9
- package/src/models/provider-config.ts +7 -17
- package/src/models/provider-configs-list.ts +7 -17
- package/src/models/workspace-model-listing.ts +109 -0
- package/src/sdk/provider-configs.ts +19 -1
|
@@ -5,37 +5,26 @@
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Provider type (openai, anthropic, google,
|
|
8
|
+
* Provider type (openai, anthropic, google, moonshot, glm, deepseek, xai, azure, vertex, bedrock, custom)
|
|
9
9
|
*/
|
|
10
10
|
export enum Provider {
|
|
11
11
|
Openai = "openai",
|
|
12
12
|
Anthropic = "anthropic",
|
|
13
13
|
Google = "google",
|
|
14
|
+
Moonshot = "moonshot",
|
|
15
|
+
Glm = "glm",
|
|
16
|
+
Deepseek = "deepseek",
|
|
17
|
+
Xai = "xai",
|
|
14
18
|
Azure = "azure",
|
|
19
|
+
Vertex = "vertex",
|
|
15
20
|
Bedrock = "bedrock",
|
|
16
|
-
Xai = "xai",
|
|
17
|
-
Glm = "glm",
|
|
18
|
-
Moonshot = "moonshot",
|
|
19
21
|
Custom = "custom",
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
25
|
+
* Per-entry credential material keyed by the catalog wire names for this provider. GET /providers/catalog declares which fields each entry accepts. The secret is extracted and encrypted; only the non-secret remainder is stored.
|
|
24
26
|
*/
|
|
25
|
-
export type
|
|
26
|
-
/**
|
|
27
|
-
* Organization ID for org-level config
|
|
28
|
-
*/
|
|
29
|
-
organizationId?: string | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Workspace ID for workspace-level config
|
|
32
|
-
*/
|
|
33
|
-
workspaceId?: string | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* User ID for personal config (UUID format)
|
|
36
|
-
*/
|
|
37
|
-
userId?: string | undefined;
|
|
38
|
-
};
|
|
27
|
+
export type CredentialFields = {};
|
|
39
28
|
|
|
40
29
|
/**
|
|
41
30
|
* Model name mappings (e.g., {"gpt-4": "custom-gpt-4"})
|
|
@@ -76,17 +65,21 @@ export type NameProviderApiKey = {
|
|
|
76
65
|
*/
|
|
77
66
|
name: string;
|
|
78
67
|
/**
|
|
79
|
-
* Provider type (openai, anthropic, google,
|
|
68
|
+
* Provider type (openai, anthropic, google, moonshot, glm, deepseek, xai, azure, vertex, bedrock, custom)
|
|
80
69
|
*/
|
|
81
70
|
provider?: Provider | undefined;
|
|
82
71
|
/**
|
|
83
|
-
*
|
|
72
|
+
* The entry's single secret, when sent in this top-level slot. OPTIONAL because the secret's wire name is per-entry — ten entries call it 'apiKey', Google Vertex calls it 'serviceAccountKey'. Send it here or as the correspondingly-named key in credentialFields.
|
|
84
73
|
*/
|
|
85
|
-
apiKey
|
|
74
|
+
apiKey?: string | undefined;
|
|
86
75
|
/**
|
|
87
|
-
*
|
|
76
|
+
* Per-entry credential material keyed by the catalog wire names for this provider. GET /providers/catalog declares which fields each entry accepts. The secret is extracted and encrypted; only the non-secret remainder is stored.
|
|
88
77
|
*/
|
|
89
|
-
|
|
78
|
+
credentialFields?: CredentialFields | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Which hosted model family a gateway configuration targets. Required for gateways hosting more than one (Azure, Google Vertex); derived for single-family gateways (AWS Bedrock); not accepted for direct providers.
|
|
81
|
+
*/
|
|
82
|
+
hostedFamily?: string | undefined;
|
|
90
83
|
/**
|
|
91
84
|
* Custom base URL for the provider API
|
|
92
85
|
*/
|
|
@@ -99,10 +92,6 @@ export type NameProviderApiKey = {
|
|
|
99
92
|
* Set as default provider for this scope
|
|
100
93
|
*/
|
|
101
94
|
isDefault?: boolean | undefined;
|
|
102
|
-
/**
|
|
103
|
-
* Azure/custom wire-format family: 'openai' | 'anthropic' | 'inference'
|
|
104
|
-
*/
|
|
105
|
-
family?: string | undefined;
|
|
106
95
|
/**
|
|
107
96
|
* Declared models this provider serves
|
|
108
97
|
*/
|
|
@@ -123,22 +112,20 @@ export const Provider$outboundSchema: z.ZodMiniEnum<typeof Provider> = z.enum(
|
|
|
123
112
|
);
|
|
124
113
|
|
|
125
114
|
/** @internal */
|
|
126
|
-
export type
|
|
127
|
-
organizationId?: string | undefined;
|
|
128
|
-
workspaceId?: string | undefined;
|
|
129
|
-
userId?: string | undefined;
|
|
130
|
-
};
|
|
115
|
+
export type CredentialFields$Outbound = {};
|
|
131
116
|
|
|
132
117
|
/** @internal */
|
|
133
|
-
export const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
userId: z.optional(z.string()),
|
|
138
|
-
});
|
|
118
|
+
export const CredentialFields$outboundSchema: z.ZodMiniType<
|
|
119
|
+
CredentialFields$Outbound,
|
|
120
|
+
CredentialFields
|
|
121
|
+
> = z.object({});
|
|
139
122
|
|
|
140
|
-
export function
|
|
141
|
-
|
|
123
|
+
export function credentialFieldsToJSON(
|
|
124
|
+
credentialFields: CredentialFields,
|
|
125
|
+
): string {
|
|
126
|
+
return JSON.stringify(
|
|
127
|
+
CredentialFields$outboundSchema.parse(credentialFields),
|
|
128
|
+
);
|
|
142
129
|
}
|
|
143
130
|
|
|
144
131
|
/** @internal */
|
|
@@ -212,12 +199,12 @@ export function nameProviderApiKeyMetadataToJSON(
|
|
|
212
199
|
export type NameProviderApiKey$Outbound = {
|
|
213
200
|
name: string;
|
|
214
201
|
provider: string;
|
|
215
|
-
apiKey
|
|
216
|
-
|
|
202
|
+
apiKey?: string | undefined;
|
|
203
|
+
credentialFields?: CredentialFields$Outbound | undefined;
|
|
204
|
+
hostedFamily?: string | undefined;
|
|
217
205
|
baseUrl?: string | undefined;
|
|
218
206
|
modelOverrides?: NameProviderApiKeyModelOverrides$Outbound | undefined;
|
|
219
207
|
isDefault: boolean;
|
|
220
|
-
family?: string | undefined;
|
|
221
208
|
supportedModels?:
|
|
222
209
|
| Array<NameProviderApiKeySupportedModel$Outbound>
|
|
223
210
|
| undefined;
|
|
@@ -232,14 +219,14 @@ export const NameProviderApiKey$outboundSchema: z.ZodMiniType<
|
|
|
232
219
|
> = z.object({
|
|
233
220
|
name: z.string(),
|
|
234
221
|
provider: z._default(Provider$outboundSchema, Provider.Openai),
|
|
235
|
-
apiKey: z.string(),
|
|
236
|
-
|
|
222
|
+
apiKey: z.optional(z.string()),
|
|
223
|
+
credentialFields: z.optional(z.lazy(() => CredentialFields$outboundSchema)),
|
|
224
|
+
hostedFamily: z.optional(z.string()),
|
|
237
225
|
baseUrl: z.optional(z.string()),
|
|
238
226
|
modelOverrides: z.optional(
|
|
239
227
|
z.lazy(() => NameProviderApiKeyModelOverrides$outboundSchema),
|
|
240
228
|
),
|
|
241
229
|
isDefault: z._default(z.boolean(), false),
|
|
242
|
-
family: z.optional(z.string()),
|
|
243
230
|
supportedModels: z.optional(
|
|
244
231
|
z.array(z.lazy(() => NameProviderApiKeySupportedModel$outboundSchema)),
|
|
245
232
|
),
|
|
@@ -34,6 +34,10 @@ export type NameSlugDescription2 = {
|
|
|
34
34
|
* Arbitrary metadata
|
|
35
35
|
*/
|
|
36
36
|
metadata?: NameSlugDescription2Metadata | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* When true, a slug conflict is resolved by deriving a unique suffixed slug (<base>-<rand6>) instead of returning 409. Intended for auto-bootstrap flows.
|
|
39
|
+
*/
|
|
40
|
+
autoSuffixSlug?: boolean | undefined;
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
/** @internal */
|
|
@@ -63,6 +67,7 @@ export type NameSlugDescription2$Outbound = {
|
|
|
63
67
|
logoUrl?: string | undefined;
|
|
64
68
|
billingEmail?: string | undefined;
|
|
65
69
|
metadata?: NameSlugDescription2Metadata$Outbound | undefined;
|
|
70
|
+
autoSuffixSlug?: boolean | undefined;
|
|
66
71
|
};
|
|
67
72
|
|
|
68
73
|
/** @internal */
|
|
@@ -78,6 +83,7 @@ export const NameSlugDescription2$outboundSchema: z.ZodMiniType<
|
|
|
78
83
|
metadata: z.optional(
|
|
79
84
|
z.lazy(() => NameSlugDescription2Metadata$outboundSchema),
|
|
80
85
|
),
|
|
86
|
+
autoSuffixSlug: z.optional(z.boolean()),
|
|
81
87
|
});
|
|
82
88
|
|
|
83
89
|
export function nameSlugDescription2ToJSON(
|
|
@@ -29,6 +29,7 @@ export * from "./list-available-models.js";
|
|
|
29
29
|
export * from "./list-invitations.js";
|
|
30
30
|
export * from "./list-organization-members.js";
|
|
31
31
|
export * from "./list-organizations.js";
|
|
32
|
+
export * from "./list-provider-models.js";
|
|
32
33
|
export * from "./list-providers.js";
|
|
33
34
|
export * from "./list-sessions.js";
|
|
34
35
|
export * from "./list-workspace-members.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export type ListProviderModelsRequest = {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
export type ListProviderModelsRequest$Outbound = {
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ListProviderModelsRequest$outboundSchema: z.ZodMiniType<
|
|
18
|
+
ListProviderModelsRequest$Outbound,
|
|
19
|
+
ListProviderModelsRequest
|
|
20
|
+
> = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export function listProviderModelsRequestToJSON(
|
|
25
|
+
listProviderModelsRequest: ListProviderModelsRequest,
|
|
26
|
+
): string {
|
|
27
|
+
return JSON.stringify(
|
|
28
|
+
ListProviderModelsRequest$outboundSchema.parse(listProviderModelsRequest),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -5,18 +5,12 @@
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
|
|
7
7
|
export type ListProvidersRequest = {
|
|
8
|
-
organizationId?: string | undefined;
|
|
9
|
-
workspaceId?: string | undefined;
|
|
10
|
-
userId?: string | undefined;
|
|
11
8
|
provider?: string | undefined;
|
|
12
9
|
includeInactive?: boolean | undefined;
|
|
13
10
|
};
|
|
14
11
|
|
|
15
12
|
/** @internal */
|
|
16
13
|
export type ListProvidersRequest$Outbound = {
|
|
17
|
-
organizationId?: string | undefined;
|
|
18
|
-
workspaceId?: string | undefined;
|
|
19
|
-
userId?: string | undefined;
|
|
20
14
|
provider?: string | undefined;
|
|
21
15
|
includeInactive?: boolean | undefined;
|
|
22
16
|
};
|
|
@@ -26,9 +20,6 @@ export const ListProvidersRequest$outboundSchema: z.ZodMiniType<
|
|
|
26
20
|
ListProvidersRequest$Outbound,
|
|
27
21
|
ListProvidersRequest
|
|
28
22
|
> = z.object({
|
|
29
|
-
organizationId: z.optional(z.string()),
|
|
30
|
-
workspaceId: z.optional(z.string()),
|
|
31
|
-
userId: z.optional(z.string()),
|
|
32
23
|
provider: z.optional(z.string()),
|
|
33
24
|
includeInactive: z.optional(z.boolean()),
|
|
34
25
|
});
|
|
@@ -50,17 +50,9 @@ export type ProviderConfig = {
|
|
|
50
50
|
*/
|
|
51
51
|
apiKeyMasked: string;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Workspace this configuration belongs to
|
|
54
54
|
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Workspace ID if workspace-scoped
|
|
58
|
-
*/
|
|
59
|
-
workspaceId: string | null;
|
|
60
|
-
/**
|
|
61
|
-
* User ID if personal
|
|
62
|
-
*/
|
|
63
|
-
userId: string | null;
|
|
55
|
+
workspaceId: string;
|
|
64
56
|
/**
|
|
65
57
|
* Custom base URL
|
|
66
58
|
*/
|
|
@@ -74,13 +66,13 @@ export type ProviderConfig = {
|
|
|
74
66
|
*/
|
|
75
67
|
isActive: boolean;
|
|
76
68
|
/**
|
|
77
|
-
* Whether this is the default for its
|
|
69
|
+
* Whether this is the default for its workspace
|
|
78
70
|
*/
|
|
79
71
|
isDefault: boolean;
|
|
80
72
|
/**
|
|
81
|
-
*
|
|
73
|
+
* Hosted model family for gateway entries: 'openai' | 'anthropic' | 'inference'; null for direct providers
|
|
82
74
|
*/
|
|
83
|
-
|
|
75
|
+
hostedFamily: string | null;
|
|
84
76
|
/**
|
|
85
77
|
* Declared models this provider serves
|
|
86
78
|
*/
|
|
@@ -170,16 +162,14 @@ export const ProviderConfig$inboundSchema: z.ZodMiniType<
|
|
|
170
162
|
name: types.string(),
|
|
171
163
|
provider: types.string(),
|
|
172
164
|
apiKeyMasked: types.string(),
|
|
173
|
-
|
|
174
|
-
workspaceId: types.nullable(types.string()),
|
|
175
|
-
userId: types.nullable(types.string()),
|
|
165
|
+
workspaceId: types.string(),
|
|
176
166
|
baseUrl: types.nullable(types.string()),
|
|
177
167
|
modelOverrides: types.nullable(
|
|
178
168
|
z.lazy(() => ProviderConfigModelOverrides$inboundSchema),
|
|
179
169
|
),
|
|
180
170
|
isActive: types.boolean(),
|
|
181
171
|
isDefault: types.boolean(),
|
|
182
|
-
|
|
172
|
+
hostedFamily: types.nullable(types.string()),
|
|
183
173
|
supportedModels: types.nullable(
|
|
184
174
|
z.array(z.lazy(() => ProviderConfigSupportedModel$inboundSchema)),
|
|
185
175
|
),
|
|
@@ -50,17 +50,9 @@ export type Config = {
|
|
|
50
50
|
*/
|
|
51
51
|
apiKeyMasked: string;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Workspace this configuration belongs to
|
|
54
54
|
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Workspace ID if workspace-scoped
|
|
58
|
-
*/
|
|
59
|
-
workspaceId: string | null;
|
|
60
|
-
/**
|
|
61
|
-
* User ID if personal
|
|
62
|
-
*/
|
|
63
|
-
userId: string | null;
|
|
55
|
+
workspaceId: string;
|
|
64
56
|
/**
|
|
65
57
|
* Custom base URL
|
|
66
58
|
*/
|
|
@@ -74,13 +66,13 @@ export type Config = {
|
|
|
74
66
|
*/
|
|
75
67
|
isActive: boolean;
|
|
76
68
|
/**
|
|
77
|
-
* Whether this is the default for its
|
|
69
|
+
* Whether this is the default for its workspace
|
|
78
70
|
*/
|
|
79
71
|
isDefault: boolean;
|
|
80
72
|
/**
|
|
81
|
-
*
|
|
73
|
+
* Hosted model family for gateway entries: 'openai' | 'anthropic' | 'inference'; null for direct providers
|
|
82
74
|
*/
|
|
83
|
-
|
|
75
|
+
hostedFamily: string | null;
|
|
84
76
|
/**
|
|
85
77
|
* Declared models this provider serves
|
|
86
78
|
*/
|
|
@@ -181,16 +173,14 @@ export const Config$inboundSchema: z.ZodMiniType<Config, unknown> = z.object({
|
|
|
181
173
|
name: types.string(),
|
|
182
174
|
provider: types.string(),
|
|
183
175
|
apiKeyMasked: types.string(),
|
|
184
|
-
|
|
185
|
-
workspaceId: types.nullable(types.string()),
|
|
186
|
-
userId: types.nullable(types.string()),
|
|
176
|
+
workspaceId: types.string(),
|
|
187
177
|
baseUrl: types.nullable(types.string()),
|
|
188
178
|
modelOverrides: types.nullable(
|
|
189
179
|
z.lazy(() => ProviderConfigsListModelOverrides$inboundSchema),
|
|
190
180
|
),
|
|
191
181
|
isActive: types.boolean(),
|
|
192
182
|
isDefault: types.boolean(),
|
|
193
|
-
|
|
183
|
+
hostedFamily: types.nullable(types.string()),
|
|
194
184
|
supportedModels: types.nullable(
|
|
195
185
|
z.array(z.lazy(() => ProviderConfigsListSupportedModel$inboundSchema)),
|
|
196
186
|
),
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { OpenEnum } from "../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
|
+
import * as types from "../types/primitives.js";
|
|
11
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
12
|
+
|
|
13
|
+
export type Model = {
|
|
14
|
+
/**
|
|
15
|
+
* Model identifier, as the provider addresses it
|
|
16
|
+
*/
|
|
17
|
+
id: string;
|
|
18
|
+
/**
|
|
19
|
+
* Human-readable name
|
|
20
|
+
*/
|
|
21
|
+
displayName: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether this workspace exposes the model. An empty allow-list enables everything.
|
|
24
|
+
*/
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Role list: exec, eval, opt
|
|
28
|
+
*/
|
|
29
|
+
roles: Array<string>;
|
|
30
|
+
/**
|
|
31
|
+
* False when the provider hides which model an identifier serves (an Azure deployment name), so admission was by shape alone.
|
|
32
|
+
*/
|
|
33
|
+
modelVerified: boolean;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 'live' — listed from the provider just now; 'stored' — the persisted allow-list
|
|
38
|
+
*/
|
|
39
|
+
export enum Source {
|
|
40
|
+
Live = "live",
|
|
41
|
+
Stored = "stored",
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 'live' — listed from the provider just now; 'stored' — the persisted allow-list
|
|
45
|
+
*/
|
|
46
|
+
export type SourceOpen = OpenEnum<typeof Source>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A provider configuration's models, with this workspace's enablement applied
|
|
50
|
+
*/
|
|
51
|
+
export type WorkspaceModelListing = {
|
|
52
|
+
models: Array<Model>;
|
|
53
|
+
/**
|
|
54
|
+
* 'live' — listed from the provider just now; 'stored' — the persisted allow-list
|
|
55
|
+
*/
|
|
56
|
+
source: SourceOpen;
|
|
57
|
+
/**
|
|
58
|
+
* True when the live listing failed and the stored allow-list is being shown
|
|
59
|
+
*/
|
|
60
|
+
degraded: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Why the listing degraded, or a provider-stated caveat. Null when neither.
|
|
63
|
+
*/
|
|
64
|
+
message: string | null;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const Model$inboundSchema: z.ZodMiniType<Model, unknown> = z.object({
|
|
69
|
+
id: types.string(),
|
|
70
|
+
displayName: types.string(),
|
|
71
|
+
enabled: types.boolean(),
|
|
72
|
+
roles: z.array(types.string()),
|
|
73
|
+
modelVerified: types.boolean(),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export function modelFromJSON(
|
|
77
|
+
jsonString: string,
|
|
78
|
+
): SafeParseResult<Model, SDKValidationError> {
|
|
79
|
+
return safeParse(
|
|
80
|
+
jsonString,
|
|
81
|
+
(x) => Model$inboundSchema.parse(JSON.parse(x)),
|
|
82
|
+
`Failed to parse 'Model' from JSON`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const Source$inboundSchema: z.ZodMiniType<SourceOpen, unknown> =
|
|
88
|
+
openEnums.inboundSchema(Source);
|
|
89
|
+
|
|
90
|
+
/** @internal */
|
|
91
|
+
export const WorkspaceModelListing$inboundSchema: z.ZodMiniType<
|
|
92
|
+
WorkspaceModelListing,
|
|
93
|
+
unknown
|
|
94
|
+
> = z.object({
|
|
95
|
+
models: z.array(z.lazy(() => Model$inboundSchema)),
|
|
96
|
+
source: z._default(Source$inboundSchema, Source.Live),
|
|
97
|
+
degraded: types.boolean(),
|
|
98
|
+
message: types.nullable(types.string()),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export function workspaceModelListingFromJSON(
|
|
102
|
+
jsonString: string,
|
|
103
|
+
): SafeParseResult<WorkspaceModelListing, SDKValidationError> {
|
|
104
|
+
return safeParse(
|
|
105
|
+
jsonString,
|
|
106
|
+
(x) => WorkspaceModelListing$inboundSchema.parse(JSON.parse(x)),
|
|
107
|
+
`Failed to parse 'WorkspaceModelListing' from JSON`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -7,6 +7,7 @@ import { providerConfigsDeleteProvider } from "../funcs/provider-configs-delete-
|
|
|
7
7
|
import { providerConfigsGetModelsCatalog } from "../funcs/provider-configs-get-models-catalog.js";
|
|
8
8
|
import { providerConfigsGetProvider } from "../funcs/provider-configs-get-provider.js";
|
|
9
9
|
import { providerConfigsListAvailableModels } from "../funcs/provider-configs-list-available-models.js";
|
|
10
|
+
import { providerConfigsListProviderModels } from "../funcs/provider-configs-list-provider-models.js";
|
|
10
11
|
import { providerConfigsListProviders } from "../funcs/provider-configs-list-providers.js";
|
|
11
12
|
import { providerConfigsTestProvider } from "../funcs/provider-configs-test-provider.js";
|
|
12
13
|
import { providerConfigsUpdateProvider } from "../funcs/provider-configs-update-provider.js";
|
|
@@ -37,7 +38,7 @@ export class ProviderConfigs extends ClientSDK {
|
|
|
37
38
|
* Create provider config
|
|
38
39
|
*
|
|
39
40
|
* @remarks
|
|
40
|
-
* Create a new provider configuration. API key is encrypted before storage and never returned in plain text.
|
|
41
|
+
* Create a new provider configuration. The credential is tested against the live provider BEFORE it is persisted — a failed test returns the provider's own error, scrubbed of the submitted secret, and writes no row. On success the API key is encrypted before storage and is never returned in plain text.
|
|
41
42
|
*/
|
|
42
43
|
async createProvider(
|
|
43
44
|
request: models.NameProviderApiKey,
|
|
@@ -131,6 +132,23 @@ export class ProviderConfigs extends ClientSDK {
|
|
|
131
132
|
));
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
/**
|
|
136
|
+
* List a provider configuration models
|
|
137
|
+
*
|
|
138
|
+
* @remarks
|
|
139
|
+
* The models this provider configuration offers, listed live from the provider and narrowed to the catalog's allow-list policy, with this workspace's per-model enablement applied. When the provider cannot be reached the stored allow-list is returned with `degraded: true` and the reason — an empty list is never presented as 'no models'.
|
|
140
|
+
*/
|
|
141
|
+
async listProviderModels(
|
|
142
|
+
request: operations.ListProviderModelsRequest,
|
|
143
|
+
options?: RequestOptions,
|
|
144
|
+
): Promise<models.WorkspaceModelListing> {
|
|
145
|
+
return unwrapAsync(providerConfigsListProviderModels(
|
|
146
|
+
this,
|
|
147
|
+
request,
|
|
148
|
+
options,
|
|
149
|
+
));
|
|
150
|
+
}
|
|
151
|
+
|
|
134
152
|
/**
|
|
135
153
|
* Test provider connection
|
|
136
154
|
*
|