@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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
|
+
export type Model = {
|
|
6
|
+
/**
|
|
7
|
+
* Model identifier, as the provider addresses it
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Human-readable name
|
|
12
|
+
*/
|
|
13
|
+
displayName: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether this workspace exposes the model. An empty allow-list enables everything.
|
|
16
|
+
*/
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Role list: exec, eval, opt
|
|
20
|
+
*/
|
|
21
|
+
roles: Array<string>;
|
|
22
|
+
/**
|
|
23
|
+
* False when the provider hides which model an identifier serves (an Azure deployment name), so admission was by shape alone.
|
|
24
|
+
*/
|
|
25
|
+
modelVerified: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* 'live' — listed from the provider just now; 'stored' — the persisted allow-list
|
|
29
|
+
*/
|
|
30
|
+
export declare enum Source {
|
|
31
|
+
Live = "live",
|
|
32
|
+
Stored = "stored"
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 'live' — listed from the provider just now; 'stored' — the persisted allow-list
|
|
36
|
+
*/
|
|
37
|
+
export type SourceOpen = OpenEnum<typeof Source>;
|
|
38
|
+
/**
|
|
39
|
+
* A provider configuration's models, with this workspace's enablement applied
|
|
40
|
+
*/
|
|
41
|
+
export type WorkspaceModelListing = {
|
|
42
|
+
models: Array<Model>;
|
|
43
|
+
/**
|
|
44
|
+
* 'live' — listed from the provider just now; 'stored' — the persisted allow-list
|
|
45
|
+
*/
|
|
46
|
+
source: SourceOpen;
|
|
47
|
+
/**
|
|
48
|
+
* True when the live listing failed and the stored allow-list is being shown
|
|
49
|
+
*/
|
|
50
|
+
degraded: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Why the listing degraded, or a provider-stated caveat. Null when neither.
|
|
53
|
+
*/
|
|
54
|
+
message: string | null;
|
|
55
|
+
};
|
|
56
|
+
/** @internal */
|
|
57
|
+
export declare const Model$inboundSchema: z.ZodMiniType<Model, unknown>;
|
|
58
|
+
export declare function modelFromJSON(jsonString: string): SafeParseResult<Model, SDKValidationError>;
|
|
59
|
+
/** @internal */
|
|
60
|
+
export declare const Source$inboundSchema: z.ZodMiniType<SourceOpen, unknown>;
|
|
61
|
+
/** @internal */
|
|
62
|
+
export declare const WorkspaceModelListing$inboundSchema: z.ZodMiniType<WorkspaceModelListing, unknown>;
|
|
63
|
+
export declare function workspaceModelListingFromJSON(jsonString: string): SafeParseResult<WorkspaceModelListing, SDKValidationError>;
|
|
64
|
+
//# sourceMappingURL=workspace-model-listing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-model-listing.d.ts","sourceRoot":"","sources":["../../../src/models/workspace-model-listing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AA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ated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
import * as types from "../types/primitives.js";
|
|
8
|
+
/**
|
|
9
|
+
* 'live' — listed from the provider just now; 'stored' — the persisted allow-list
|
|
10
|
+
*/
|
|
11
|
+
export var Source;
|
|
12
|
+
(function (Source) {
|
|
13
|
+
Source["Live"] = "live";
|
|
14
|
+
Source["Stored"] = "stored";
|
|
15
|
+
})(Source || (Source = {}));
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const Model$inboundSchema = z.object({
|
|
18
|
+
id: types.string(),
|
|
19
|
+
displayName: types.string(),
|
|
20
|
+
enabled: types.boolean(),
|
|
21
|
+
roles: z.array(types.string()),
|
|
22
|
+
modelVerified: types.boolean(),
|
|
23
|
+
});
|
|
24
|
+
export function modelFromJSON(jsonString) {
|
|
25
|
+
return safeParse(jsonString, (x) => Model$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Model' from JSON`);
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const Source$inboundSchema = openEnums.inboundSchema(Source);
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const WorkspaceModelListing$inboundSchema = z.object({
|
|
31
|
+
models: z.array(z.lazy(() => Model$inboundSchema)),
|
|
32
|
+
source: z._default(Source$inboundSchema, Source.Live),
|
|
33
|
+
degraded: types.boolean(),
|
|
34
|
+
message: types.nullable(types.string()),
|
|
35
|
+
});
|
|
36
|
+
export function workspaceModelListingFromJSON(jsonString) {
|
|
37
|
+
return safeParse(jsonString, (x) => WorkspaceModelListing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkspaceModelListing' from JSON`);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=workspace-model-listing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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C,CAAC;IAClD,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC;IACrD,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE;IACzB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;CACxC,CAAC,CAAC;AAEH,MAAM,UAAU,6BAA6B,CAC3C,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,mCAAmC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC/D,mDAAmD,CACpD,CAAC;AACJ,CAAC"}
|
|
@@ -13,7 +13,7 @@ export declare class ProviderConfigs extends ClientSDK {
|
|
|
13
13
|
* Create provider config
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Create a new provider configuration. API key is encrypted before storage and never returned in plain text.
|
|
16
|
+
* 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.
|
|
17
17
|
*/
|
|
18
18
|
createProvider(request: models.NameProviderApiKey, options?: RequestOptions): Promise<models.ProviderConfig>;
|
|
19
19
|
/**
|
|
@@ -51,6 +51,13 @@ export declare class ProviderConfigs extends ClientSDK {
|
|
|
51
51
|
* Returns the union of static known models and declared provider models for a workspace. Used by the optimizer dropdown.
|
|
52
52
|
*/
|
|
53
53
|
getModelsCatalog(options?: RequestOptions): Promise<operations.GetModelsCatalogResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* List a provider configuration models
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* 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'.
|
|
59
|
+
*/
|
|
60
|
+
listProviderModels(request: operations.ListProviderModelsRequest, options?: RequestOptions): Promise<models.WorkspaceModelListing>;
|
|
54
61
|
/**
|
|
55
62
|
* Test provider connection
|
|
56
63
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-configs.d.ts","sourceRoot":"","sources":["../../../src/sdk/provider-configs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider-configs.d.ts","sourceRoot":"","sources":["../../../src/sdk/provider-configs.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,eAAgB,SAAQ,SAAS;IAC5C;;;;;OAKG;IACG,aAAa,CACjB,OAAO,CAAC,EAAE,UAAU,CAAC,oBAAoB,GAAG,SAAS,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC;IAQtC;;;;;OAKG;IACG,cAAc,CAClB,OAAO,EAAE,MAAM,CAAC,kBAAkB,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;IAQjC;;;;;OAKG;IACG,mBAAmB,CACvB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAOlD;;;;;OAKG;IACG,WAAW,CACf,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;IAQjC;;;;;OAKG;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;IAQjC;;;;;OAKG;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAQlC;;;;;OAKG;IACG,gBAAgB,CACpB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC;IAO/C;;;;;OAKG;IACG,kBAAkB,CACtB,OAAO,EAAE,UAAU,CAAC,yBAAyB,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC;IAQxC;;;;;OAKG;IACG,YAAY,CAChB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC;CAOxC"}
|
|
@@ -6,6 +6,7 @@ import { providerConfigsDeleteProvider } from "../funcs/provider-configs-delete-
|
|
|
6
6
|
import { providerConfigsGetModelsCatalog } from "../funcs/provider-configs-get-models-catalog.js";
|
|
7
7
|
import { providerConfigsGetProvider } from "../funcs/provider-configs-get-provider.js";
|
|
8
8
|
import { providerConfigsListAvailableModels } from "../funcs/provider-configs-list-available-models.js";
|
|
9
|
+
import { providerConfigsListProviderModels } from "../funcs/provider-configs-list-provider-models.js";
|
|
9
10
|
import { providerConfigsListProviders } from "../funcs/provider-configs-list-providers.js";
|
|
10
11
|
import { providerConfigsTestProvider } from "../funcs/provider-configs-test-provider.js";
|
|
11
12
|
import { providerConfigsUpdateProvider } from "../funcs/provider-configs-update-provider.js";
|
|
@@ -25,7 +26,7 @@ export class ProviderConfigs extends ClientSDK {
|
|
|
25
26
|
* Create provider config
|
|
26
27
|
*
|
|
27
28
|
* @remarks
|
|
28
|
-
* Create a new provider configuration. API key is encrypted before storage and never returned in plain text.
|
|
29
|
+
* 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.
|
|
29
30
|
*/
|
|
30
31
|
async createProvider(request, options) {
|
|
31
32
|
return unwrapAsync(providerConfigsCreateProvider(this, request, options));
|
|
@@ -75,6 +76,15 @@ export class ProviderConfigs extends ClientSDK {
|
|
|
75
76
|
async getModelsCatalog(options) {
|
|
76
77
|
return unwrapAsync(providerConfigsGetModelsCatalog(this, options));
|
|
77
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* List a provider configuration models
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* 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'.
|
|
84
|
+
*/
|
|
85
|
+
async listProviderModels(request, options) {
|
|
86
|
+
return unwrapAsync(providerConfigsListProviderModels(this, request, options));
|
|
87
|
+
}
|
|
78
88
|
/**
|
|
79
89
|
* Test provider connection
|
|
80
90
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-configs.js","sourceRoot":"","sources":["../../../src/sdk/provider-configs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,kCAAkC,EAAE,MAAM,oDAAoD,CAAC;AACxG,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,M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OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CACf,OAAsC,EACtC,OAAwB;QAExB,OAAO,WAAW,CAAC,0BAA0B,CAC3C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,WAAW,CAAC,6BAA6B,CAC9C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,WAAW,CAAC,6BAA6B,CAC9C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB,CACpB,OAAwB;QAExB,OAAO,WAAW,CAAC,+BAA+B,CAChD,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,kBAAkB,CACtB,OAA6C,EAC7C,OAAwB;QAExB,OAAO,WAAW,CAAC,iCAAiC,CAClD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,WAAW,CAAC,2BAA2B,CAC5C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Create provider config
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Create a new provider configuration. API key is encrypted before storage and never returned in plain text.
|
|
34
|
+
* 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.
|
|
35
35
|
*/
|
|
36
36
|
export function providerConfigsCreateProvider(
|
|
37
37
|
client: MutagentCore,
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { MutagentCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { MutagentError } from "../models/errors/mutagent-error.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
26
|
+
import * as models from "../models/index.js";
|
|
27
|
+
import * as operations from "../models/operations/index.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* List a provider configuration models
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* 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'.
|
|
36
|
+
*/
|
|
37
|
+
export function providerConfigsListProviderModels(
|
|
38
|
+
client: MutagentCore,
|
|
39
|
+
request: operations.ListProviderModelsRequest,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
models.WorkspaceModelListing,
|
|
44
|
+
| errors.ProviderError
|
|
45
|
+
| errors.WorkspaceModelListingError
|
|
46
|
+
| MutagentError
|
|
47
|
+
| ResponseValidationError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
| RequestAbortedError
|
|
50
|
+
| RequestTimeoutError
|
|
51
|
+
| InvalidRequestError
|
|
52
|
+
| UnexpectedClientError
|
|
53
|
+
| SDKValidationError
|
|
54
|
+
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
request,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function $do(
|
|
64
|
+
client: MutagentCore,
|
|
65
|
+
request: operations.ListProviderModelsRequest,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
models.WorkspaceModelListing,
|
|
71
|
+
| errors.ProviderError
|
|
72
|
+
| errors.WorkspaceModelListingError
|
|
73
|
+
| MutagentError
|
|
74
|
+
| ResponseValidationError
|
|
75
|
+
| ConnectionError
|
|
76
|
+
| RequestAbortedError
|
|
77
|
+
| RequestTimeoutError
|
|
78
|
+
| InvalidRequestError
|
|
79
|
+
| UnexpectedClientError
|
|
80
|
+
| SDKValidationError
|
|
81
|
+
>,
|
|
82
|
+
APICall,
|
|
83
|
+
]
|
|
84
|
+
> {
|
|
85
|
+
const parsed = safeParse(
|
|
86
|
+
request,
|
|
87
|
+
(value) =>
|
|
88
|
+
z.parse(operations.ListProviderModelsRequest$outboundSchema, value),
|
|
89
|
+
"Input validation failed",
|
|
90
|
+
);
|
|
91
|
+
if (!parsed.ok) {
|
|
92
|
+
return [parsed, { status: "invalid" }];
|
|
93
|
+
}
|
|
94
|
+
const payload = parsed.value;
|
|
95
|
+
const body = null;
|
|
96
|
+
|
|
97
|
+
const pathParams = {
|
|
98
|
+
id: encodeSimple("id", payload.id, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
const path = pathToFunc("/api/providers/{id}/models")(pathParams);
|
|
104
|
+
|
|
105
|
+
const headers = new Headers(compactMap({
|
|
106
|
+
Accept: "application/json",
|
|
107
|
+
}));
|
|
108
|
+
|
|
109
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
110
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
111
|
+
|
|
112
|
+
const context = {
|
|
113
|
+
options: client._options,
|
|
114
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
115
|
+
operationID: "listProviderModels",
|
|
116
|
+
oAuth2Scopes: null,
|
|
117
|
+
|
|
118
|
+
resolvedSecurity: requestSecurity,
|
|
119
|
+
|
|
120
|
+
securitySource: client._options.security,
|
|
121
|
+
retryConfig: options?.retries
|
|
122
|
+
|| client._options.retryConfig
|
|
123
|
+
|| { strategy: "none" },
|
|
124
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const requestRes = client._createRequest(context, {
|
|
128
|
+
security: requestSecurity,
|
|
129
|
+
method: "GET",
|
|
130
|
+
baseURL: options?.serverURL,
|
|
131
|
+
path: path,
|
|
132
|
+
headers: headers,
|
|
133
|
+
body: body,
|
|
134
|
+
userAgent: client._options.userAgent,
|
|
135
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
136
|
+
}, options);
|
|
137
|
+
if (!requestRes.ok) {
|
|
138
|
+
return [requestRes, { status: "invalid" }];
|
|
139
|
+
}
|
|
140
|
+
const req = requestRes.value;
|
|
141
|
+
|
|
142
|
+
const doResult = await client._do(req, {
|
|
143
|
+
context,
|
|
144
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
145
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
146
|
+
retryConfig: context.retryConfig,
|
|
147
|
+
retryCodes: context.retryCodes,
|
|
148
|
+
});
|
|
149
|
+
if (!doResult.ok) {
|
|
150
|
+
return [doResult, { status: "request-error", request: req }];
|
|
151
|
+
}
|
|
152
|
+
const response = doResult.value;
|
|
153
|
+
|
|
154
|
+
const responseFields = {
|
|
155
|
+
HttpMeta: { Response: response, Request: req },
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const [result] = await M.match<
|
|
159
|
+
models.WorkspaceModelListing,
|
|
160
|
+
| errors.ProviderError
|
|
161
|
+
| errors.WorkspaceModelListingError
|
|
162
|
+
| MutagentError
|
|
163
|
+
| ResponseValidationError
|
|
164
|
+
| ConnectionError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| UnexpectedClientError
|
|
169
|
+
| SDKValidationError
|
|
170
|
+
>(
|
|
171
|
+
M.json(200, models.WorkspaceModelListing$inboundSchema),
|
|
172
|
+
M.jsonErr(401, errors.ProviderError$inboundSchema),
|
|
173
|
+
M.jsonErr(404, errors.WorkspaceModelListingError$inboundSchema),
|
|
174
|
+
M.fail("4XX"),
|
|
175
|
+
M.fail("5XX"),
|
|
176
|
+
)(response, req, { extraFields: responseFields });
|
|
177
|
+
if (!result.ok) {
|
|
178
|
+
return [result, { status: "complete", request: req, response }];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
@@ -99,10 +99,7 @@ async function $do(
|
|
|
99
99
|
|
|
100
100
|
const query = encodeFormQuery({
|
|
101
101
|
"includeInactive": payload?.includeInactive,
|
|
102
|
-
"organizationId": payload?.organizationId,
|
|
103
102
|
"provider": payload?.provider,
|
|
104
|
-
"userId": payload?.userId,
|
|
105
|
-
"workspaceId": payload?.workspaceId,
|
|
106
103
|
});
|
|
107
104
|
|
|
108
105
|
const headers = new Headers(compactMap({
|
|
@@ -166,7 +166,7 @@ async function $do(
|
|
|
166
166
|
| SDKValidationError
|
|
167
167
|
>(
|
|
168
168
|
M.json(200, models.ProviderConfig$inboundSchema),
|
|
169
|
-
M.jsonErr([401, 404, 409], errors.ProviderError$inboundSchema),
|
|
169
|
+
M.jsonErr([400, 401, 404, 409], errors.ProviderError$inboundSchema),
|
|
170
170
|
M.jsonErr(500, errors.ProviderError$inboundSchema),
|
|
171
171
|
M.fail("4XX"),
|
|
172
172
|
M.fail("5XX"),
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "2.0.0",
|
|
68
|
-
sdkVersion: "0.3.
|
|
68
|
+
sdkVersion: "0.3.12",
|
|
69
69
|
genVersion: "2.926.2",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.3.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.3.12 2.926.2 2.0.0 @mutagent/sdk",
|
|
71
71
|
} as const;
|
|
@@ -11,4 +11,5 @@ export * from "./response-validation-error.js";
|
|
|
11
11
|
export * from "./sdk-error.js";
|
|
12
12
|
export * from "./sdk-validation-error.js";
|
|
13
13
|
export * from "./test-connection-result-error.js";
|
|
14
|
+
export * from "./workspace-model-listing-error.js";
|
|
14
15
|
export * from "./ws-error.js";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as types from "../../types/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
import { MutagentError } from "./mutagent-error.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A provider configuration's models, with this workspace's enablement applied
|
|
12
|
+
*/
|
|
13
|
+
export type WorkspaceModelListingErrorData = {
|
|
14
|
+
models: Array<models.Model>;
|
|
15
|
+
/**
|
|
16
|
+
* 'live' — listed from the provider just now; 'stored' — the persisted allow-list
|
|
17
|
+
*/
|
|
18
|
+
source?: models.SourceOpen | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* True when the live listing failed and the stored allow-list is being shown
|
|
21
|
+
*/
|
|
22
|
+
degraded: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Why the listing degraded, or a provider-stated caveat. Null when neither.
|
|
25
|
+
*/
|
|
26
|
+
message: string | null;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A provider configuration's models, with this workspace's enablement applied
|
|
31
|
+
*/
|
|
32
|
+
export class WorkspaceModelListingError extends MutagentError {
|
|
33
|
+
models: Array<models.Model>;
|
|
34
|
+
/**
|
|
35
|
+
* 'live' — listed from the provider just now; 'stored' — the persisted allow-list
|
|
36
|
+
*/
|
|
37
|
+
source?: models.SourceOpen | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* True when the live listing failed and the stored allow-list is being shown
|
|
40
|
+
*/
|
|
41
|
+
degraded: boolean;
|
|
42
|
+
|
|
43
|
+
/** The original data that was passed to this error instance. */
|
|
44
|
+
data$: WorkspaceModelListingErrorData;
|
|
45
|
+
|
|
46
|
+
constructor(
|
|
47
|
+
err: WorkspaceModelListingErrorData,
|
|
48
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
49
|
+
) {
|
|
50
|
+
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
51
|
+
super(message, httpMeta);
|
|
52
|
+
this.data$ = err;
|
|
53
|
+
this.models = err.models;
|
|
54
|
+
if (err.source != null) this.source = err.source;
|
|
55
|
+
this.degraded = err.degraded;
|
|
56
|
+
|
|
57
|
+
this.name = "WorkspaceModelListingError";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const WorkspaceModelListingError$inboundSchema: z.ZodMiniType<
|
|
63
|
+
WorkspaceModelListingError,
|
|
64
|
+
unknown
|
|
65
|
+
> = z.pipe(
|
|
66
|
+
z.object({
|
|
67
|
+
models: z.array(models.Model$inboundSchema),
|
|
68
|
+
source: z._default(models.Source$inboundSchema, models.Source.Live),
|
|
69
|
+
degraded: types.boolean(),
|
|
70
|
+
message: types.nullable(types.string()),
|
|
71
|
+
request$: z.custom<Request>(x => x instanceof Request),
|
|
72
|
+
response$: z.custom<Response>(x => x instanceof Response),
|
|
73
|
+
body$: z.string(),
|
|
74
|
+
}),
|
|
75
|
+
z.transform((v) => {
|
|
76
|
+
return new WorkspaceModelListingError(v, {
|
|
77
|
+
request: v.request$,
|
|
78
|
+
response: v.response$,
|
|
79
|
+
body: v.body$,
|
|
80
|
+
});
|
|
81
|
+
}),
|
|
82
|
+
);
|
package/src/models/index.ts
CHANGED
|
@@ -36,6 +36,7 @@ export * from "./success-message.js";
|
|
|
36
36
|
export * from "./test-connection-result.js";
|
|
37
37
|
export * from "./user-id-role-status.js";
|
|
38
38
|
export * from "./user-id-role.js";
|
|
39
|
+
export * from "./workspace-model-listing.js";
|
|
39
40
|
export * from "./workspace.js";
|
|
40
41
|
export * from "./workspaces-list.js";
|
|
41
42
|
export * from "./ws-success.js";
|
|
@@ -40,9 +40,9 @@ export type NameApiKeyBaseUrl = {
|
|
|
40
40
|
*/
|
|
41
41
|
isDefault?: boolean | undefined;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Which hosted model family a gateway configuration targets (null to clear). Named for the column it populates.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
hostedFamily?: string | null | undefined;
|
|
46
46
|
/**
|
|
47
47
|
* Updated declared models (null to clear)
|
|
48
48
|
*/
|
|
@@ -65,7 +65,7 @@ export type NameApiKeyBaseUrl$Outbound = {
|
|
|
65
65
|
modelOverrides?: Schemanullab2$Outbound | null | undefined;
|
|
66
66
|
isActive?: boolean | undefined;
|
|
67
67
|
isDefault?: boolean | undefined;
|
|
68
|
-
|
|
68
|
+
hostedFamily?: string | null | undefined;
|
|
69
69
|
supportedModels?: Array<IdDisplayNameFamily$Outbound> | null | undefined;
|
|
70
70
|
apiVersion?: string | null | undefined;
|
|
71
71
|
metadata?: Schemanullab2$Outbound | null | undefined;
|
|
@@ -82,7 +82,7 @@ export const NameApiKeyBaseUrl$outboundSchema: z.ZodMiniType<
|
|
|
82
82
|
modelOverrides: z.optional(z.nullable(Schemanullab2$outboundSchema)),
|
|
83
83
|
isActive: z.optional(z.boolean()),
|
|
84
84
|
isDefault: z.optional(z.boolean()),
|
|
85
|
-
|
|
85
|
+
hostedFamily: z.optional(z.nullable(z.string())),
|
|
86
86
|
supportedModels: z.optional(
|
|
87
87
|
z.nullable(z.array(IdDisplayNameFamily$outboundSchema)),
|
|
88
88
|
),
|