@mistralai/mistralai 2.1.1 → 2.1.2
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 +4 -2
- package/esm/funcs/audioSpeechComplete.d.ts +11 -0
- package/esm/funcs/audioSpeechComplete.d.ts.map +1 -1
- package/esm/funcs/audioSpeechComplete.js +0 -3
- package/esm/funcs/audioSpeechComplete.js.map +1 -1
- package/esm/funcs/betaConnectorsListTools.d.ts +18 -0
- package/esm/funcs/betaConnectorsListTools.d.ts.map +1 -0
- package/esm/funcs/betaConnectorsListTools.js +92 -0
- package/esm/funcs/betaConnectorsListTools.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/index.d.ts +8 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +8 -0
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/mcptool.d.ts +27 -0
- package/esm/models/components/mcptool.d.ts.map +1 -0
- package/esm/models/components/mcptool.js +31 -0
- package/esm/models/components/mcptool.js.map +1 -0
- package/esm/models/components/mcptoolmeta.d.ts +21 -0
- package/esm/models/components/mcptoolmeta.d.ts.map +1 -0
- package/esm/models/components/mcptoolmeta.js +23 -0
- package/esm/models/components/mcptoolmeta.js.map +1 -0
- package/esm/models/components/mcpuitoolmeta.d.ts +23 -0
- package/esm/models/components/mcpuitoolmeta.d.ts.map +1 -0
- package/esm/models/components/mcpuitoolmeta.js +23 -0
- package/esm/models/components/mcpuitoolmeta.js.map +1 -0
- package/esm/models/components/toolannotations.d.ts +27 -0
- package/esm/models/components/toolannotations.d.ts.map +1 -0
- package/esm/models/components/toolannotations.js +18 -0
- package/esm/models/components/toolannotations.js.map +1 -0
- package/esm/models/components/toolexecution.d.ts +23 -0
- package/esm/models/components/toolexecution.d.ts.map +1 -0
- package/esm/models/components/toolexecution.js +23 -0
- package/esm/models/components/toolexecution.js.map +1 -0
- package/esm/models/components/tooltype.d.ts +12 -0
- package/esm/models/components/tooltype.d.ts.map +1 -0
- package/esm/models/components/tooltype.js +15 -0
- package/esm/models/components/tooltype.js.map +1 -0
- package/esm/models/components/turbinetoollocale.d.ts +24 -0
- package/esm/models/components/turbinetoollocale.d.ts.map +1 -0
- package/esm/models/components/turbinetoollocale.js +25 -0
- package/esm/models/components/turbinetoollocale.js.map +1 -0
- package/esm/models/components/turbinetoolmeta.d.ts +15 -0
- package/esm/models/components/turbinetoolmeta.d.ts.map +1 -0
- package/esm/models/components/turbinetoolmeta.js +25 -0
- package/esm/models/components/turbinetoolmeta.js.map +1 -0
- package/esm/models/operations/connectorlisttoolsv1.d.ts +39 -0
- package/esm/models/operations/connectorlisttoolsv1.d.ts.map +1 -0
- package/esm/models/operations/connectorlisttoolsv1.js +45 -0
- package/esm/models/operations/connectorlisttoolsv1.js.map +1 -0
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/sdk/connectors.d.ts +7 -0
- package/esm/sdk/connectors.d.ts.map +1 -1
- package/esm/sdk/connectors.js +10 -0
- package/esm/sdk/connectors.js.map +1 -1
- package/esm/sdk/speech.d.ts +11 -0
- package/esm/sdk/speech.d.ts.map +1 -1
- package/esm/sdk/speech.js +0 -3
- package/esm/sdk/speech.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/audioSpeechComplete.ts +55 -0
- package/src/funcs/betaConnectorsListTools.ts +188 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/index.ts +8 -0
- package/src/models/components/mcptool.ts +57 -0
- package/src/models/components/mcptoolmeta.ts +49 -0
- package/src/models/components/mcpuitoolmeta.ts +47 -0
- package/src/models/components/toolannotations.ts +52 -0
- package/src/models/components/toolexecution.ts +46 -0
- package/src/models/components/tooltype.ts +20 -0
- package/src/models/components/turbinetoollocale.ts +46 -0
- package/src/models/components/turbinetoolmeta.ts +48 -0
- package/src/models/operations/connectorlisttoolsv1.ts +113 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/connectors.ts +18 -0
- package/src/sdk/speech.ts +13 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 76826e0ed19b
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { MistralCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { MistralError } from "../models/errors/mistralerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* List tools for a connector.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* List all tools available for an MCP connector.
|
|
34
|
+
*/
|
|
35
|
+
export function betaConnectorsListTools(
|
|
36
|
+
client: MistralCore,
|
|
37
|
+
request: operations.ConnectorListToolsV1Request,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.ResponseConnectorListToolsV12,
|
|
42
|
+
| errors.HTTPValidationError
|
|
43
|
+
| MistralError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: MistralCore,
|
|
62
|
+
request: operations.ConnectorListToolsV1Request,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.ResponseConnectorListToolsV12,
|
|
68
|
+
| errors.HTTPValidationError
|
|
69
|
+
| MistralError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) =>
|
|
84
|
+
operations.ConnectorListToolsV1Request$outboundSchema.parse(value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = null;
|
|
92
|
+
|
|
93
|
+
const pathParams = {
|
|
94
|
+
connector_id_or_name: encodeSimple(
|
|
95
|
+
"connector_id_or_name",
|
|
96
|
+
payload.connector_id_or_name,
|
|
97
|
+
{ explode: false, charEncoding: "percent" },
|
|
98
|
+
),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const path = pathToFunc("/v1/connectors/{connector_id_or_name}/tools")(
|
|
102
|
+
pathParams,
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const query = encodeFormQuery({
|
|
106
|
+
"page": payload.page,
|
|
107
|
+
"page_size": payload.page_size,
|
|
108
|
+
"pretty": payload.pretty,
|
|
109
|
+
"refresh": payload.refresh,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const headers = new Headers(compactMap({
|
|
113
|
+
Accept: "application/json",
|
|
114
|
+
}));
|
|
115
|
+
|
|
116
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
117
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
118
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
119
|
+
|
|
120
|
+
const context = {
|
|
121
|
+
options: client._options,
|
|
122
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
123
|
+
operationID: "connector_list_tools_v1",
|
|
124
|
+
oAuth2Scopes: null,
|
|
125
|
+
|
|
126
|
+
resolvedSecurity: requestSecurity,
|
|
127
|
+
|
|
128
|
+
securitySource: client._options.apiKey,
|
|
129
|
+
retryConfig: options?.retries
|
|
130
|
+
|| client._options.retryConfig
|
|
131
|
+
|| { strategy: "none" },
|
|
132
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const requestRes = client._createRequest(context, {
|
|
136
|
+
security: requestSecurity,
|
|
137
|
+
method: "GET",
|
|
138
|
+
baseURL: options?.serverURL,
|
|
139
|
+
path: path,
|
|
140
|
+
headers: headers,
|
|
141
|
+
query: query,
|
|
142
|
+
body: body,
|
|
143
|
+
userAgent: client._options.userAgent,
|
|
144
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
145
|
+
}, options);
|
|
146
|
+
if (!requestRes.ok) {
|
|
147
|
+
return [requestRes, { status: "invalid" }];
|
|
148
|
+
}
|
|
149
|
+
const req = requestRes.value;
|
|
150
|
+
|
|
151
|
+
const doResult = await client._do(req, {
|
|
152
|
+
context,
|
|
153
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
154
|
+
retryConfig: context.retryConfig,
|
|
155
|
+
retryCodes: context.retryCodes,
|
|
156
|
+
});
|
|
157
|
+
if (!doResult.ok) {
|
|
158
|
+
return [doResult, { status: "request-error", request: req }];
|
|
159
|
+
}
|
|
160
|
+
const response = doResult.value;
|
|
161
|
+
|
|
162
|
+
const responseFields = {
|
|
163
|
+
HttpMeta: { Response: response, Request: req },
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const [result] = await M.match<
|
|
167
|
+
operations.ResponseConnectorListToolsV12,
|
|
168
|
+
| errors.HTTPValidationError
|
|
169
|
+
| MistralError
|
|
170
|
+
| ResponseValidationError
|
|
171
|
+
| ConnectionError
|
|
172
|
+
| RequestAbortedError
|
|
173
|
+
| RequestTimeoutError
|
|
174
|
+
| InvalidRequestError
|
|
175
|
+
| UnexpectedClientError
|
|
176
|
+
| SDKValidationError
|
|
177
|
+
>(
|
|
178
|
+
M.json(200, operations.ResponseConnectorListToolsV12$inboundSchema),
|
|
179
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
180
|
+
M.fail("4XX"),
|
|
181
|
+
M.fail("5XX"),
|
|
182
|
+
)(response, req, { extraFields: responseFields });
|
|
183
|
+
if (!result.ok) {
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return [result, { status: "complete", request: req, response }];
|
|
188
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -60,8 +60,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
60
60
|
export const SDK_METADATA = {
|
|
61
61
|
language: "typescript",
|
|
62
62
|
openapiDocVersion: "1.0.0",
|
|
63
|
-
sdkVersion: "2.1.
|
|
63
|
+
sdkVersion: "2.1.2",
|
|
64
64
|
genVersion: "2.859.0",
|
|
65
65
|
userAgent:
|
|
66
|
-
"speakeasy-sdk/typescript 2.1.
|
|
66
|
+
"speakeasy-sdk/typescript 2.1.2 2.859.0 1.0.0 @mistralai/mistralai",
|
|
67
67
|
} as const;
|
|
@@ -195,6 +195,9 @@ export * from "./listjudgesresponse.js";
|
|
|
195
195
|
export * from "./listlibrariesresponse.js";
|
|
196
196
|
export * from "./listsharingresponse.js";
|
|
197
197
|
export * from "./mcpservericon.js";
|
|
198
|
+
export * from "./mcptool.js";
|
|
199
|
+
export * from "./mcptoolmeta.js";
|
|
200
|
+
export * from "./mcpuitoolmeta.js";
|
|
198
201
|
export * from "./messageentries.js";
|
|
199
202
|
export * from "./messageinputcontentchunks.js";
|
|
200
203
|
export * from "./messageinputentry.js";
|
|
@@ -288,11 +291,13 @@ export * from "./textresourcecontents.js";
|
|
|
288
291
|
export * from "./thinkchunk.js";
|
|
289
292
|
export * from "./timestampgranularity.js";
|
|
290
293
|
export * from "./tool.js";
|
|
294
|
+
export * from "./toolannotations.js";
|
|
291
295
|
export * from "./toolcall.js";
|
|
292
296
|
export * from "./toolcallconfirmation.js";
|
|
293
297
|
export * from "./toolchoice.js";
|
|
294
298
|
export * from "./toolchoiceenum.js";
|
|
295
299
|
export * from "./toolconfiguration.js";
|
|
300
|
+
export * from "./toolexecution.js";
|
|
296
301
|
export * from "./toolexecutiondeltaevent.js";
|
|
297
302
|
export * from "./toolexecutiondoneevent.js";
|
|
298
303
|
export * from "./toolexecutionentry.js";
|
|
@@ -300,6 +305,7 @@ export * from "./toolexecutionstartedevent.js";
|
|
|
300
305
|
export * from "./toolfilechunk.js";
|
|
301
306
|
export * from "./toolmessage.js";
|
|
302
307
|
export * from "./toolreferencechunk.js";
|
|
308
|
+
export * from "./tooltype.js";
|
|
303
309
|
export * from "./tooltypes.js";
|
|
304
310
|
export * from "./trainingfile.js";
|
|
305
311
|
export * from "./transcriptionresponse.js";
|
|
@@ -310,6 +316,8 @@ export * from "./transcriptionstreameventtypes.js";
|
|
|
310
316
|
export * from "./transcriptionstreamlanguage.js";
|
|
311
317
|
export * from "./transcriptionstreamsegmentdelta.js";
|
|
312
318
|
export * from "./transcriptionstreamtextdelta.js";
|
|
319
|
+
export * from "./turbinetoollocale.js";
|
|
320
|
+
export * from "./turbinetoolmeta.js";
|
|
313
321
|
export * from "./unarchivemodelresponse.js";
|
|
314
322
|
export * from "./updateagentrequest.js";
|
|
315
323
|
export * from "./updateconnectorrequest.js";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: eb9603e91876
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import { MCPServerIcon, MCPServerIcon$inboundSchema } from "./mcpservericon.js";
|
|
12
|
+
import { MCPToolMeta, MCPToolMeta$inboundSchema } from "./mcptoolmeta.js";
|
|
13
|
+
import {
|
|
14
|
+
ToolAnnotations,
|
|
15
|
+
ToolAnnotations$inboundSchema,
|
|
16
|
+
} from "./toolannotations.js";
|
|
17
|
+
import { ToolExecution, ToolExecution$inboundSchema } from "./toolexecution.js";
|
|
18
|
+
|
|
19
|
+
export type MCPTool = {
|
|
20
|
+
name: string;
|
|
21
|
+
title?: string | null | undefined;
|
|
22
|
+
description?: string | null | undefined;
|
|
23
|
+
inputSchema: { [k: string]: any };
|
|
24
|
+
outputSchema?: { [k: string]: any } | null | undefined;
|
|
25
|
+
icons?: Array<MCPServerIcon> | null | undefined;
|
|
26
|
+
annotations?: ToolAnnotations | null | undefined;
|
|
27
|
+
meta?: MCPToolMeta | null | undefined;
|
|
28
|
+
execution?: ToolExecution | null | undefined;
|
|
29
|
+
[additionalProperties: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const MCPTool$inboundSchema: z.ZodType<MCPTool, unknown> = z.object({
|
|
34
|
+
name: z.string(),
|
|
35
|
+
title: z.nullable(z.string()).optional(),
|
|
36
|
+
description: z.nullable(z.string()).optional(),
|
|
37
|
+
inputSchema: z.record(z.string(), z.any()),
|
|
38
|
+
outputSchema: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
39
|
+
icons: z.nullable(z.array(MCPServerIcon$inboundSchema)).optional(),
|
|
40
|
+
annotations: z.nullable(ToolAnnotations$inboundSchema).optional(),
|
|
41
|
+
_meta: z.nullable(MCPToolMeta$inboundSchema).optional(),
|
|
42
|
+
execution: z.nullable(ToolExecution$inboundSchema).optional(),
|
|
43
|
+
}).catchall(z.any()).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
"_meta": "meta",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export function mcpToolFromJSON(
|
|
50
|
+
jsonString: string,
|
|
51
|
+
): SafeParseResult<MCPTool, SDKValidationError> {
|
|
52
|
+
return safeParse(
|
|
53
|
+
jsonString,
|
|
54
|
+
(x) => MCPTool$inboundSchema.parse(JSON.parse(x)),
|
|
55
|
+
`Failed to parse 'MCPTool' from JSON`,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f3cdc62104da
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import { MCPUIToolMeta, MCPUIToolMeta$inboundSchema } from "./mcpuitoolmeta.js";
|
|
12
|
+
import {
|
|
13
|
+
TurbineToolMeta,
|
|
14
|
+
TurbineToolMeta$inboundSchema,
|
|
15
|
+
} from "./turbinetoolmeta.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Typed _meta for MCP tools.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
*
|
|
22
|
+
* Only the 'ui' field is typed. Other fields are allowed via extra="allow".
|
|
23
|
+
*/
|
|
24
|
+
export type MCPToolMeta = {
|
|
25
|
+
ui?: MCPUIToolMeta | null | undefined;
|
|
26
|
+
aiMistralTurbine?: TurbineToolMeta | null | undefined;
|
|
27
|
+
[additionalProperties: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const MCPToolMeta$inboundSchema: z.ZodType<MCPToolMeta, unknown> = z
|
|
32
|
+
.object({
|
|
33
|
+
ui: z.nullable(MCPUIToolMeta$inboundSchema).optional(),
|
|
34
|
+
"ai.mistral/turbine": z.nullable(TurbineToolMeta$inboundSchema).optional(),
|
|
35
|
+
}).catchall(z.any()).transform((v) => {
|
|
36
|
+
return remap$(v, {
|
|
37
|
+
"ai.mistral/turbine": "aiMistralTurbine",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export function mcpToolMetaFromJSON(
|
|
42
|
+
jsonString: string,
|
|
43
|
+
): SafeParseResult<MCPToolMeta, SDKValidationError> {
|
|
44
|
+
return safeParse(
|
|
45
|
+
jsonString,
|
|
46
|
+
(x) => MCPToolMeta$inboundSchema.parse(JSON.parse(x)),
|
|
47
|
+
`Failed to parse 'MCPToolMeta' from JSON`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 214688641f30
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../../types/enums.js";
|
|
9
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export const Visibility = {
|
|
14
|
+
Model: "model",
|
|
15
|
+
App: "app",
|
|
16
|
+
} as const;
|
|
17
|
+
export type Visibility = OpenEnum<typeof Visibility>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* UI metadata for tools that reference UI resources.
|
|
21
|
+
*/
|
|
22
|
+
export type MCPUIToolMeta = {
|
|
23
|
+
resourceUri?: string | null | undefined;
|
|
24
|
+
visibility?: Array<Visibility> | null | undefined;
|
|
25
|
+
[additionalProperties: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const Visibility$inboundSchema: z.ZodType<Visibility, unknown> =
|
|
30
|
+
openEnums.inboundSchema(Visibility);
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const MCPUIToolMeta$inboundSchema: z.ZodType<MCPUIToolMeta, unknown> = z
|
|
34
|
+
.object({
|
|
35
|
+
resourceUri: z.nullable(z.string()).optional(),
|
|
36
|
+
visibility: z.nullable(z.array(Visibility$inboundSchema)).optional(),
|
|
37
|
+
}).catchall(z.any());
|
|
38
|
+
|
|
39
|
+
export function mcpuiToolMetaFromJSON(
|
|
40
|
+
jsonString: string,
|
|
41
|
+
): SafeParseResult<MCPUIToolMeta, SDKValidationError> {
|
|
42
|
+
return safeParse(
|
|
43
|
+
jsonString,
|
|
44
|
+
(x) => MCPUIToolMeta$inboundSchema.parse(JSON.parse(x)),
|
|
45
|
+
`Failed to parse 'MCPUIToolMeta' from JSON`,
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: d537caae3348
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Additional properties describing a Tool to clients.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
*
|
|
16
|
+
* NOTE: all properties in ToolAnnotations are **hints**.
|
|
17
|
+
* They are not guaranteed to provide a faithful description of
|
|
18
|
+
* tool behavior (including descriptive properties like `title`).
|
|
19
|
+
*
|
|
20
|
+
* Clients should never make tool use decisions based on ToolAnnotations
|
|
21
|
+
* received from untrusted servers.
|
|
22
|
+
*/
|
|
23
|
+
export type ToolAnnotations = {
|
|
24
|
+
title?: string | null | undefined;
|
|
25
|
+
readOnlyHint?: boolean | null | undefined;
|
|
26
|
+
destructiveHint?: boolean | null | undefined;
|
|
27
|
+
idempotentHint?: boolean | null | undefined;
|
|
28
|
+
openWorldHint?: boolean | null | undefined;
|
|
29
|
+
[additionalProperties: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const ToolAnnotations$inboundSchema: z.ZodType<
|
|
34
|
+
ToolAnnotations,
|
|
35
|
+
unknown
|
|
36
|
+
> = z.object({
|
|
37
|
+
title: z.nullable(z.string()).optional(),
|
|
38
|
+
readOnlyHint: z.nullable(z.boolean()).optional(),
|
|
39
|
+
destructiveHint: z.nullable(z.boolean()).optional(),
|
|
40
|
+
idempotentHint: z.nullable(z.boolean()).optional(),
|
|
41
|
+
openWorldHint: z.nullable(z.boolean()).optional(),
|
|
42
|
+
}).catchall(z.any());
|
|
43
|
+
|
|
44
|
+
export function toolAnnotationsFromJSON(
|
|
45
|
+
jsonString: string,
|
|
46
|
+
): SafeParseResult<ToolAnnotations, SDKValidationError> {
|
|
47
|
+
return safeParse(
|
|
48
|
+
jsonString,
|
|
49
|
+
(x) => ToolAnnotations$inboundSchema.parse(JSON.parse(x)),
|
|
50
|
+
`Failed to parse 'ToolAnnotations' from JSON`,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e4afdeb4b779
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../../types/enums.js";
|
|
9
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export const TaskSupport = {
|
|
14
|
+
Forbidden: "forbidden",
|
|
15
|
+
Optional: "optional",
|
|
16
|
+
Required: "required",
|
|
17
|
+
} as const;
|
|
18
|
+
export type TaskSupport = OpenEnum<typeof TaskSupport>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Execution-related properties for a tool.
|
|
22
|
+
*/
|
|
23
|
+
export type ToolExecution = {
|
|
24
|
+
taskSupport?: TaskSupport | null | undefined;
|
|
25
|
+
[additionalProperties: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const TaskSupport$inboundSchema: z.ZodType<TaskSupport, unknown> =
|
|
30
|
+
openEnums.inboundSchema(TaskSupport);
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const ToolExecution$inboundSchema: z.ZodType<ToolExecution, unknown> = z
|
|
34
|
+
.object({
|
|
35
|
+
taskSupport: z.nullable(TaskSupport$inboundSchema).optional(),
|
|
36
|
+
}).catchall(z.any());
|
|
37
|
+
|
|
38
|
+
export function toolExecutionFromJSON(
|
|
39
|
+
jsonString: string,
|
|
40
|
+
): SafeParseResult<ToolExecution, SDKValidationError> {
|
|
41
|
+
return safeParse(
|
|
42
|
+
jsonString,
|
|
43
|
+
(x) => ToolExecution$inboundSchema.parse(JSON.parse(x)),
|
|
44
|
+
`Failed to parse 'ToolExecution' from JSON`,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2d3fa4dcb1a1
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
9
|
+
|
|
10
|
+
export const ToolType = {
|
|
11
|
+
Rag: "rag",
|
|
12
|
+
Image: "image",
|
|
13
|
+
Code: "code",
|
|
14
|
+
Event: "event",
|
|
15
|
+
} as const;
|
|
16
|
+
export type ToolType = OpenEnum<typeof ToolType>;
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ToolType$inboundSchema: z.ZodType<ToolType, unknown> = openEnums
|
|
20
|
+
.inboundSchema(ToolType);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 4a2e89dd045a
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type TurbineToolLocale = {
|
|
13
|
+
name?: { [k: string]: string } | null | undefined;
|
|
14
|
+
description?: { [k: string]: string } | null | undefined;
|
|
15
|
+
usageSentence?: { [k: string]: string } | null | undefined;
|
|
16
|
+
workingDescription?: { [k: string]: string } | null | undefined;
|
|
17
|
+
doneDescription?: { [k: string]: string } | null | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const TurbineToolLocale$inboundSchema: z.ZodType<
|
|
22
|
+
TurbineToolLocale,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.object({
|
|
25
|
+
name: z.nullable(z.record(z.string(), z.string())).optional(),
|
|
26
|
+
description: z.nullable(z.record(z.string(), z.string())).optional(),
|
|
27
|
+
usage_sentence: z.nullable(z.record(z.string(), z.string())).optional(),
|
|
28
|
+
working_description: z.nullable(z.record(z.string(), z.string())).optional(),
|
|
29
|
+
done_description: z.nullable(z.record(z.string(), z.string())).optional(),
|
|
30
|
+
}).transform((v) => {
|
|
31
|
+
return remap$(v, {
|
|
32
|
+
"usage_sentence": "usageSentence",
|
|
33
|
+
"working_description": "workingDescription",
|
|
34
|
+
"done_description": "doneDescription",
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function turbineToolLocaleFromJSON(
|
|
39
|
+
jsonString: string,
|
|
40
|
+
): SafeParseResult<TurbineToolLocale, SDKValidationError> {
|
|
41
|
+
return safeParse(
|
|
42
|
+
jsonString,
|
|
43
|
+
(x) => TurbineToolLocale$inboundSchema.parse(JSON.parse(x)),
|
|
44
|
+
`Failed to parse 'TurbineToolLocale' from JSON`,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 044cdb287e1c
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import { ToolType, ToolType$inboundSchema } from "./tooltype.js";
|
|
12
|
+
import {
|
|
13
|
+
TurbineToolLocale,
|
|
14
|
+
TurbineToolLocale$inboundSchema,
|
|
15
|
+
} from "./turbinetoollocale.js";
|
|
16
|
+
|
|
17
|
+
export type TurbineToolMeta = {
|
|
18
|
+
locale?: TurbineToolLocale | null | undefined;
|
|
19
|
+
toolType?: ToolType | null | undefined;
|
|
20
|
+
timeout?: number | null | undefined;
|
|
21
|
+
privateExecution?: boolean | null | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const TurbineToolMeta$inboundSchema: z.ZodType<
|
|
26
|
+
TurbineToolMeta,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
locale: z.nullable(TurbineToolLocale$inboundSchema).optional(),
|
|
30
|
+
tool_type: z.nullable(ToolType$inboundSchema).optional(),
|
|
31
|
+
timeout: z.nullable(z.number()).optional(),
|
|
32
|
+
private_execution: z.nullable(z.boolean()).optional(),
|
|
33
|
+
}).transform((v) => {
|
|
34
|
+
return remap$(v, {
|
|
35
|
+
"tool_type": "toolType",
|
|
36
|
+
"private_execution": "privateExecution",
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export function turbineToolMetaFromJSON(
|
|
41
|
+
jsonString: string,
|
|
42
|
+
): SafeParseResult<TurbineToolMeta, SDKValidationError> {
|
|
43
|
+
return safeParse(
|
|
44
|
+
jsonString,
|
|
45
|
+
(x) => TurbineToolMeta$inboundSchema.parse(JSON.parse(x)),
|
|
46
|
+
`Failed to parse 'TurbineToolMeta' from JSON`,
|
|
47
|
+
);
|
|
48
|
+
}
|