@orq-ai/node 4.1.0-rc.2 → 4.1.0-rc.4
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/bin/mcp-server.js +37427 -38283
- package/bin/mcp-server.js.map +72 -67
- package/docs/sdks/agents/README.md +10 -10
- package/docs/sdks/responses/README.md +5 -5
- package/examples/package-lock.json +1 -1
- package/funcs/agentsCreate.d.ts +1 -1
- package/funcs/agentsCreate.d.ts.map +1 -1
- package/funcs/agentsCreate.js +2 -4
- package/funcs/agentsCreate.js.map +1 -1
- package/funcs/agentsResponsesCreate.d.ts +1 -1
- package/funcs/agentsResponsesCreate.d.ts.map +1 -1
- package/funcs/agentsResponsesCreate.js +4 -4
- package/funcs/agentsResponsesCreate.js.map +1 -1
- package/funcs/agentsRun.d.ts +1 -1
- package/funcs/agentsRun.d.ts.map +1 -1
- package/funcs/agentsRun.js +2 -4
- package/funcs/agentsRun.js.map +1 -1
- package/funcs/agentsStream.d.ts +1 -1
- package/funcs/agentsStream.d.ts.map +1 -1
- package/funcs/agentsStream.js +4 -4
- package/funcs/agentsStream.js.map +1 -1
- package/funcs/agentsStreamRun.d.ts +1 -1
- package/funcs/agentsStreamRun.d.ts.map +1 -1
- package/funcs/agentsStreamRun.js +2 -4
- package/funcs/agentsStreamRun.js.map +1 -1
- package/funcs/agentsUpdate.d.ts +1 -1
- package/funcs/agentsUpdate.d.ts.map +1 -1
- package/funcs/agentsUpdate.js +4 -4
- package/funcs/agentsUpdate.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/mcp-server/tools/agentsCreate.d.ts +1 -1
- package/mcp-server/tools/agentsCreate.js +1 -1
- package/mcp-server/tools/agentsCreate.js.map +1 -1
- package/mcp-server/tools/agentsResponsesCreate.d.ts +1 -1
- package/mcp-server/tools/agentsResponsesCreate.d.ts.map +1 -1
- package/mcp-server/tools/agentsResponsesCreate.js +2 -3
- package/mcp-server/tools/agentsResponsesCreate.js.map +1 -1
- package/mcp-server/tools/agentsRun.d.ts +1 -1
- package/mcp-server/tools/agentsRun.js +1 -1
- package/mcp-server/tools/agentsRun.js.map +1 -1
- package/mcp-server/tools/agentsStream.d.ts +1 -1
- package/mcp-server/tools/agentsStream.js +2 -2
- package/mcp-server/tools/agentsStream.js.map +1 -1
- package/mcp-server/tools/agentsStreamRun.d.ts +1 -1
- package/mcp-server/tools/agentsStreamRun.js +1 -1
- package/mcp-server/tools/agentsStreamRun.js.map +1 -1
- package/mcp-server/tools/agentsUpdate.d.ts +1 -1
- package/mcp-server/tools/agentsUpdate.d.ts.map +1 -1
- package/mcp-server/tools/agentsUpdate.js +2 -3
- package/mcp-server/tools/agentsUpdate.js.map +1 -1
- package/models/components/datapart.d.ts +41 -0
- package/models/components/datapart.d.ts.map +1 -0
- package/models/components/datapart.js +69 -0
- package/models/components/datapart.js.map +1 -0
- package/models/components/filepart.d.ts +104 -0
- package/models/components/filepart.d.ts.map +1 -0
- package/models/components/filepart.js +134 -0
- package/models/components/filepart.js.map +1 -0
- package/models/components/index.d.ts +5 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invokedeploymentrequest.d.ts +8 -8
- package/models/components/invokedeploymentrequest.d.ts.map +1 -1
- package/models/components/invokedeploymentrequest.js +11 -12
- package/models/components/invokedeploymentrequest.js.map +1 -1
- package/models/components/textpart.d.ts +31 -0
- package/models/components/textpart.d.ts.map +1 -0
- package/models/components/textpart.js +67 -0
- package/models/components/textpart.js.map +1 -0
- package/models/components/toolcallpart.d.ts +45 -0
- package/models/components/toolcallpart.d.ts.map +1 -0
- package/models/components/toolcallpart.js +84 -0
- package/models/components/toolcallpart.js.map +1 -0
- package/models/components/toolresultpart.d.ts +39 -0
- package/models/components/toolresultpart.d.ts.map +1 -0
- package/models/components/toolresultpart.js +80 -0
- package/models/components/toolresultpart.js.map +1 -0
- package/models/operations/createagentresponserequest.d.ts +68 -44
- package/models/operations/createagentresponserequest.d.ts.map +1 -1
- package/models/operations/createagentresponserequest.js +92 -47
- package/models/operations/createagentresponserequest.js.map +1 -1
- package/models/operations/createbudget.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createprompt.d.ts +9 -11
- package/models/operations/createprompt.d.ts.map +1 -1
- package/models/operations/createprompt.js +9 -11
- package/models/operations/createprompt.js.map +1 -1
- package/models/operations/createtool.js +12 -12
- package/models/operations/deploymentinvoke.d.ts +9 -11
- package/models/operations/deploymentinvoke.d.ts.map +1 -1
- package/models/operations/deploymentinvoke.js +9 -11
- package/models/operations/deploymentinvoke.js.map +1 -1
- package/models/operations/deployments.d.ts +9 -11
- package/models/operations/deployments.d.ts.map +1 -1
- package/models/operations/deployments.js +9 -11
- package/models/operations/deployments.js.map +1 -1
- package/models/operations/deploymentstream.d.ts +9 -11
- package/models/operations/deploymentstream.d.ts.map +1 -1
- package/models/operations/deploymentstream.js +9 -11
- package/models/operations/deploymentstream.js.map +1 -1
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getallprompts.d.ts +9 -11
- package/models/operations/getallprompts.d.ts.map +1 -1
- package/models/operations/getallprompts.js +9 -11
- package/models/operations/getallprompts.js.map +1 -1
- package/models/operations/getalltools.js +12 -12
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/getoneprompt.d.ts +9 -11
- package/models/operations/getoneprompt.d.ts.map +1 -1
- package/models/operations/getoneprompt.js +9 -11
- package/models/operations/getoneprompt.js.map +1 -1
- package/models/operations/getpromptversion.d.ts +9 -11
- package/models/operations/getpromptversion.d.ts.map +1 -1
- package/models/operations/getpromptversion.js +9 -11
- package/models/operations/getpromptversion.js.map +1 -1
- package/models/operations/invokeagent.d.ts +63 -283
- package/models/operations/invokeagent.d.ts.map +1 -1
- package/models/operations/invokeagent.js +73 -293
- package/models/operations/invokeagent.js.map +1 -1
- package/models/operations/listbudgets.js +2 -2
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +8 -8
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/listpromptversions.d.ts +9 -11
- package/models/operations/listpromptversions.d.ts.map +1 -1
- package/models/operations/listpromptversions.js +9 -11
- package/models/operations/listpromptversions.js.map +1 -1
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +12 -12
- package/models/operations/runagent.d.ts +59 -279
- package/models/operations/runagent.d.ts.map +1 -1
- package/models/operations/runagent.js +72 -292
- package/models/operations/runagent.js.map +1 -1
- package/models/operations/streamagent.d.ts +214 -1005
- package/models/operations/streamagent.d.ts.map +1 -1
- package/models/operations/streamagent.js +229 -1019
- package/models/operations/streamagent.js.map +1 -1
- package/models/operations/streamrunagent.d.ts +215 -1006
- package/models/operations/streamrunagent.d.ts.map +1 -1
- package/models/operations/streamrunagent.js +236 -1026
- package/models/operations/streamrunagent.js.map +1 -1
- package/models/operations/updateagent.d.ts +2 -2
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +2 -4
- package/models/operations/updateagent.js.map +1 -1
- package/models/operations/updatebudget.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +8 -8
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +28 -28
- package/models/operations/updatememorystore.d.ts +9 -20
- package/models/operations/updatememorystore.d.ts.map +1 -1
- package/models/operations/updatememorystore.js +9 -14
- package/models/operations/updatememorystore.js.map +1 -1
- package/models/operations/updateprompt.d.ts +18 -22
- package/models/operations/updateprompt.d.ts.map +1 -1
- package/models/operations/updateprompt.js +18 -22
- package/models/operations/updateprompt.js.map +1 -1
- package/models/operations/updatetool.js +14 -14
- package/package.json +1 -1
- package/sdk/agents.d.ts +5 -5
- package/sdk/agents.d.ts.map +1 -1
- package/sdk/agents.js +4 -4
- package/sdk/agents.js.map +1 -1
- package/sdk/responses.d.ts +1 -1
- package/sdk/responses.d.ts.map +1 -1
- package/sdk/responses.js +2 -2
- package/sdk/responses.js.map +1 -1
- package/src/funcs/agentsCreate.ts +4 -8
- package/src/funcs/agentsResponsesCreate.ts +4 -4
- package/src/funcs/agentsRun.ts +4 -7
- package/src/funcs/agentsStream.ts +4 -4
- package/src/funcs/agentsStreamRun.ts +4 -9
- package/src/funcs/agentsUpdate.ts +4 -4
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/agentsCreate.ts +1 -1
- package/src/mcp-server/tools/agentsResponsesCreate.ts +2 -3
- package/src/mcp-server/tools/agentsRun.ts +1 -1
- package/src/mcp-server/tools/agentsStream.ts +2 -2
- package/src/mcp-server/tools/agentsStreamRun.ts +1 -1
- package/src/mcp-server/tools/agentsUpdate.ts +2 -3
- package/src/models/components/datapart.ts +71 -0
- package/src/models/components/filepart.ts +231 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/components/invokedeploymentrequest.ts +34 -25
- package/src/models/components/textpart.ts +68 -0
- package/src/models/components/toolcallpart.ts +92 -0
- package/src/models/components/toolresultpart.ts +86 -0
- package/src/models/operations/createagentresponserequest.ts +194 -100
- package/src/models/operations/createbudget.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createprompt.ts +9 -11
- package/src/models/operations/createtool.ts +12 -12
- package/src/models/operations/deploymentinvoke.ts +9 -11
- package/src/models/operations/deployments.ts +9 -11
- package/src/models/operations/deploymentstream.ts +9 -11
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getallprompts.ts +9 -11
- package/src/models/operations/getalltools.ts +12 -12
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/getoneprompt.ts +9 -11
- package/src/models/operations/getpromptversion.ts +9 -11
- package/src/models/operations/invokeagent.ts +158 -682
- package/src/models/operations/listbudgets.ts +2 -2
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/listpromptversions.ts +9 -11
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +12 -12
- package/src/models/operations/runagent.ts +143 -697
- package/src/models/operations/streamagent.ts +2226 -4563
- package/src/models/operations/streamrunagent.ts +2189 -4615
- package/src/models/operations/updateagent.ts +4 -6
- package/src/models/operations/updatebudget.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +8 -8
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +28 -28
- package/src/models/operations/updatememorystore.ts +9 -20
- package/src/models/operations/updateprompt.ts +18 -22
- package/src/models/operations/updatetool.ts +14 -14
- package/src/sdk/agents.ts +7 -7
- package/src/sdk/responses.ts +2 -2
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
10
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -42,28 +43,28 @@ export type InvokeAgentRole =
|
|
|
42
43
|
| InvokeAgentRoleUserMessage
|
|
43
44
|
| InvokeAgentRoleToolMessage;
|
|
44
45
|
|
|
45
|
-
export const
|
|
46
|
+
export const InvokeAgentPublicMessagePartAgentsKind = {
|
|
46
47
|
ToolResult: "tool_result",
|
|
47
48
|
} as const;
|
|
48
|
-
export type
|
|
49
|
-
typeof
|
|
49
|
+
export type InvokeAgentPublicMessagePartAgentsKind = ClosedEnum<
|
|
50
|
+
typeof InvokeAgentPublicMessagePartAgentsKind
|
|
50
51
|
>;
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
54
|
* Tool execution result part. Use this ONLY when providing results for a pending tool call from the agent. The tool_call_id must match the ID from the agent's tool call request.
|
|
54
55
|
*/
|
|
55
56
|
export type PublicMessagePartToolResultPart = {
|
|
56
|
-
kind:
|
|
57
|
+
kind: InvokeAgentPublicMessagePartAgentsKind;
|
|
57
58
|
toolCallId: string;
|
|
58
59
|
result?: any | undefined;
|
|
59
60
|
metadata?: { [k: string]: any } | undefined;
|
|
60
61
|
};
|
|
61
62
|
|
|
62
|
-
export const
|
|
63
|
+
export const InvokeAgentPublicMessagePartKind = {
|
|
63
64
|
File: "file",
|
|
64
65
|
} as const;
|
|
65
|
-
export type
|
|
66
|
-
typeof
|
|
66
|
+
export type InvokeAgentPublicMessagePartKind = ClosedEnum<
|
|
67
|
+
typeof InvokeAgentPublicMessagePartKind
|
|
67
68
|
>;
|
|
68
69
|
|
|
69
70
|
/**
|
|
@@ -110,31 +111,16 @@ export type InvokeAgentPublicMessagePartFile =
|
|
|
110
111
|
* File attachment part. Use this to send files (images, documents, etc.) to the agent for processing.
|
|
111
112
|
*/
|
|
112
113
|
export type PublicMessagePartFilePart = {
|
|
113
|
-
kind:
|
|
114
|
+
kind: InvokeAgentPublicMessagePartKind;
|
|
114
115
|
file: FileBinaryFormat | FileFileInURIFormat;
|
|
115
116
|
metadata?: { [k: string]: any } | undefined;
|
|
116
117
|
};
|
|
117
118
|
|
|
118
|
-
export const InvokeAgentPublicMessagePartKind = {
|
|
119
|
-
Text: "text",
|
|
120
|
-
} as const;
|
|
121
|
-
export type InvokeAgentPublicMessagePartKind = ClosedEnum<
|
|
122
|
-
typeof InvokeAgentPublicMessagePartKind
|
|
123
|
-
>;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Text content part. Use this to send text messages to the agent.
|
|
127
|
-
*/
|
|
128
|
-
export type PublicMessagePartTextPart = {
|
|
129
|
-
kind: InvokeAgentPublicMessagePartKind;
|
|
130
|
-
text: string;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
119
|
/**
|
|
134
120
|
* Message part that can be provided by users. Use "text" for regular messages, "file" for attachments, or "tool_result" when responding to tool call requests.
|
|
135
121
|
*/
|
|
136
122
|
export type InvokeAgentPublicMessagePart =
|
|
137
|
-
|
|
|
123
|
+
| components.TextPart
|
|
138
124
|
| PublicMessagePartFilePart
|
|
139
125
|
| PublicMessagePartToolResultPart;
|
|
140
126
|
|
|
@@ -154,7 +140,7 @@ export type InvokeAgentA2AMessage = {
|
|
|
154
140
|
* A2A message parts (text, file, or tool_result only)
|
|
155
141
|
*/
|
|
156
142
|
parts: Array<
|
|
157
|
-
|
|
|
143
|
+
| components.TextPart
|
|
158
144
|
| PublicMessagePartFilePart
|
|
159
145
|
| PublicMessagePartToolResultPart
|
|
160
146
|
>;
|
|
@@ -301,130 +287,12 @@ export const ExtendedMessageRole = {
|
|
|
301
287
|
*/
|
|
302
288
|
export type ExtendedMessageRole = ClosedEnum<typeof ExtendedMessageRole>;
|
|
303
289
|
|
|
304
|
-
export
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* The result of a tool execution. Contains the tool call ID for correlation and the result data from the tool invocation.
|
|
313
|
-
*/
|
|
314
|
-
export type PartsToolResultPart = {
|
|
315
|
-
kind: InvokeAgentPartsAgentsResponse200Kind;
|
|
316
|
-
toolCallId: string;
|
|
317
|
-
result?: any | undefined;
|
|
318
|
-
metadata?: { [k: string]: any } | undefined;
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
export const InvokeAgentPartsAgentsResponseKind = {
|
|
322
|
-
ToolCall: "tool_call",
|
|
323
|
-
} as const;
|
|
324
|
-
export type InvokeAgentPartsAgentsResponseKind = ClosedEnum<
|
|
325
|
-
typeof InvokeAgentPartsAgentsResponseKind
|
|
326
|
-
>;
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* A tool invocation request from an agent. Contains the tool name, unique call ID, and arguments for the tool execution.
|
|
330
|
-
*/
|
|
331
|
-
export type ToolCallPart = {
|
|
332
|
-
kind: InvokeAgentPartsAgentsResponseKind;
|
|
333
|
-
toolName: string;
|
|
334
|
-
toolCallId: string;
|
|
335
|
-
arguments: { [k: string]: any };
|
|
336
|
-
metadata?: { [k: string]: any } | undefined;
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
export const InvokeAgentPartsAgentsKind = {
|
|
340
|
-
File: "file",
|
|
341
|
-
} as const;
|
|
342
|
-
export type InvokeAgentPartsAgentsKind = ClosedEnum<
|
|
343
|
-
typeof InvokeAgentPartsAgentsKind
|
|
344
|
-
>;
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* File in URI format. Check in the model's documentation for the supported mime types for the URI format
|
|
348
|
-
*/
|
|
349
|
-
export type InvokeAgentFileFileInURIFormat = {
|
|
350
|
-
/**
|
|
351
|
-
* URL for the File content
|
|
352
|
-
*/
|
|
353
|
-
uri: string;
|
|
354
|
-
/**
|
|
355
|
-
* Optional mimeType for the file
|
|
356
|
-
*/
|
|
357
|
-
mimeType?: string | undefined;
|
|
358
|
-
/**
|
|
359
|
-
* Optional name for the file
|
|
360
|
-
*/
|
|
361
|
-
name?: string | undefined;
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Binary in base64 format. Check in the model's documentation for the supported mime types for the binary format.
|
|
366
|
-
*/
|
|
367
|
-
export type InvokeAgentFileBinaryFormat = {
|
|
368
|
-
/**
|
|
369
|
-
* base64 encoded content of the file
|
|
370
|
-
*/
|
|
371
|
-
bytes: string;
|
|
372
|
-
/**
|
|
373
|
-
* Optional mimeType for the file
|
|
374
|
-
*/
|
|
375
|
-
mimeType?: string | undefined;
|
|
376
|
-
/**
|
|
377
|
-
* Optional name for the file
|
|
378
|
-
*/
|
|
379
|
-
name?: string | undefined;
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
export type PartsFile =
|
|
383
|
-
| InvokeAgentFileBinaryFormat
|
|
384
|
-
| InvokeAgentFileFileInURIFormat;
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* A file content part that can contain either base64-encoded bytes or a URI reference. Used for images, documents, and other binary content in agent communications.
|
|
388
|
-
*/
|
|
389
|
-
export type PartsFilePart = {
|
|
390
|
-
kind: InvokeAgentPartsAgentsKind;
|
|
391
|
-
file: InvokeAgentFileBinaryFormat | InvokeAgentFileFileInURIFormat;
|
|
392
|
-
metadata?: { [k: string]: any } | undefined;
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
export const InvokeAgentPartsKind = {
|
|
396
|
-
Data: "data",
|
|
397
|
-
} as const;
|
|
398
|
-
export type InvokeAgentPartsKind = ClosedEnum<typeof InvokeAgentPartsKind>;
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* A structured data part containing JSON-serializable key-value pairs. Used for passing structured information between agents and tools.
|
|
402
|
-
*/
|
|
403
|
-
export type DataPart = {
|
|
404
|
-
kind: InvokeAgentPartsKind;
|
|
405
|
-
data: { [k: string]: any };
|
|
406
|
-
metadata?: { [k: string]: any } | undefined;
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
export const PartsKind = {
|
|
410
|
-
Text: "text",
|
|
411
|
-
} as const;
|
|
412
|
-
export type PartsKind = ClosedEnum<typeof PartsKind>;
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* A text content part containing plain text or markdown. Used for agent messages, user input, and text-based responses.
|
|
416
|
-
*/
|
|
417
|
-
export type PartsTextPart = {
|
|
418
|
-
kind: PartsKind;
|
|
419
|
-
text: string;
|
|
420
|
-
};
|
|
421
|
-
|
|
422
|
-
export type Parts =
|
|
423
|
-
| ToolCallPart
|
|
424
|
-
| PartsTextPart
|
|
425
|
-
| DataPart
|
|
426
|
-
| PartsFilePart
|
|
427
|
-
| PartsToolResultPart;
|
|
290
|
+
export type InvokeAgentParts =
|
|
291
|
+
| (components.ToolCallPart & { kind: "tool_call" })
|
|
292
|
+
| (components.TextPart & { kind: "text" })
|
|
293
|
+
| (components.DataPart & { kind: "data" })
|
|
294
|
+
| (components.FilePart & { kind: "file" })
|
|
295
|
+
| (components.ToolResultPart & { kind: "tool_result" });
|
|
428
296
|
|
|
429
297
|
/**
|
|
430
298
|
* Optional A2A message providing additional context about the current status
|
|
@@ -437,11 +305,11 @@ export type TaskStatusMessage = {
|
|
|
437
305
|
*/
|
|
438
306
|
role: ExtendedMessageRole;
|
|
439
307
|
parts: Array<
|
|
440
|
-
| ToolCallPart
|
|
441
|
-
|
|
|
442
|
-
| DataPart
|
|
443
|
-
|
|
|
444
|
-
|
|
|
308
|
+
| (components.ToolCallPart & { kind: "tool_call" })
|
|
309
|
+
| (components.TextPart & { kind: "text" })
|
|
310
|
+
| (components.DataPart & { kind: "data" })
|
|
311
|
+
| (components.FilePart & { kind: "file" })
|
|
312
|
+
| (components.ToolResultPart & { kind: "tool_result" })
|
|
445
313
|
>;
|
|
446
314
|
};
|
|
447
315
|
|
|
@@ -545,13 +413,14 @@ export function invokeAgentRoleFromJSON(
|
|
|
545
413
|
}
|
|
546
414
|
|
|
547
415
|
/** @internal */
|
|
548
|
-
export const
|
|
549
|
-
z.ZodNativeEnum<typeof
|
|
550
|
-
|
|
416
|
+
export const InvokeAgentPublicMessagePartAgentsKind$inboundSchema:
|
|
417
|
+
z.ZodNativeEnum<typeof InvokeAgentPublicMessagePartAgentsKind> = z.nativeEnum(
|
|
418
|
+
InvokeAgentPublicMessagePartAgentsKind,
|
|
419
|
+
);
|
|
551
420
|
/** @internal */
|
|
552
|
-
export const
|
|
553
|
-
z.ZodNativeEnum<typeof
|
|
554
|
-
|
|
421
|
+
export const InvokeAgentPublicMessagePartAgentsKind$outboundSchema:
|
|
422
|
+
z.ZodNativeEnum<typeof InvokeAgentPublicMessagePartAgentsKind> =
|
|
423
|
+
InvokeAgentPublicMessagePartAgentsKind$inboundSchema;
|
|
555
424
|
|
|
556
425
|
/** @internal */
|
|
557
426
|
export const PublicMessagePartToolResultPart$inboundSchema: z.ZodType<
|
|
@@ -559,7 +428,7 @@ export const PublicMessagePartToolResultPart$inboundSchema: z.ZodType<
|
|
|
559
428
|
z.ZodTypeDef,
|
|
560
429
|
unknown
|
|
561
430
|
> = z.object({
|
|
562
|
-
kind:
|
|
431
|
+
kind: InvokeAgentPublicMessagePartAgentsKind$inboundSchema,
|
|
563
432
|
tool_call_id: z.string(),
|
|
564
433
|
result: z.any().optional(),
|
|
565
434
|
metadata: z.record(z.any()).optional(),
|
|
@@ -582,7 +451,7 @@ export const PublicMessagePartToolResultPart$outboundSchema: z.ZodType<
|
|
|
582
451
|
z.ZodTypeDef,
|
|
583
452
|
PublicMessagePartToolResultPart
|
|
584
453
|
> = z.object({
|
|
585
|
-
kind:
|
|
454
|
+
kind: InvokeAgentPublicMessagePartAgentsKind$outboundSchema,
|
|
586
455
|
toolCallId: z.string(),
|
|
587
456
|
result: z.any().optional(),
|
|
588
457
|
metadata: z.record(z.any()).optional(),
|
|
@@ -612,14 +481,13 @@ export function publicMessagePartToolResultPartFromJSON(
|
|
|
612
481
|
}
|
|
613
482
|
|
|
614
483
|
/** @internal */
|
|
615
|
-
export const
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
);
|
|
484
|
+
export const InvokeAgentPublicMessagePartKind$inboundSchema: z.ZodNativeEnum<
|
|
485
|
+
typeof InvokeAgentPublicMessagePartKind
|
|
486
|
+
> = z.nativeEnum(InvokeAgentPublicMessagePartKind);
|
|
619
487
|
/** @internal */
|
|
620
|
-
export const
|
|
621
|
-
|
|
622
|
-
|
|
488
|
+
export const InvokeAgentPublicMessagePartKind$outboundSchema: z.ZodNativeEnum<
|
|
489
|
+
typeof InvokeAgentPublicMessagePartKind
|
|
490
|
+
> = InvokeAgentPublicMessagePartKind$inboundSchema;
|
|
623
491
|
|
|
624
492
|
/** @internal */
|
|
625
493
|
export const FileFileInURIFormat$inboundSchema: z.ZodType<
|
|
@@ -760,7 +628,7 @@ export const PublicMessagePartFilePart$inboundSchema: z.ZodType<
|
|
|
760
628
|
z.ZodTypeDef,
|
|
761
629
|
unknown
|
|
762
630
|
> = z.object({
|
|
763
|
-
kind:
|
|
631
|
+
kind: InvokeAgentPublicMessagePartKind$inboundSchema,
|
|
764
632
|
file: z.union([
|
|
765
633
|
z.lazy(() => FileBinaryFormat$inboundSchema),
|
|
766
634
|
z.lazy(() => FileFileInURIFormat$inboundSchema),
|
|
@@ -780,7 +648,7 @@ export const PublicMessagePartFilePart$outboundSchema: z.ZodType<
|
|
|
780
648
|
z.ZodTypeDef,
|
|
781
649
|
PublicMessagePartFilePart
|
|
782
650
|
> = z.object({
|
|
783
|
-
kind:
|
|
651
|
+
kind: InvokeAgentPublicMessagePartKind$outboundSchema,
|
|
784
652
|
file: z.union([
|
|
785
653
|
z.lazy(() => FileBinaryFormat$outboundSchema),
|
|
786
654
|
z.lazy(() => FileFileInURIFormat$outboundSchema),
|
|
@@ -805,70 +673,19 @@ export function publicMessagePartFilePartFromJSON(
|
|
|
805
673
|
);
|
|
806
674
|
}
|
|
807
675
|
|
|
808
|
-
/** @internal */
|
|
809
|
-
export const InvokeAgentPublicMessagePartKind$inboundSchema: z.ZodNativeEnum<
|
|
810
|
-
typeof InvokeAgentPublicMessagePartKind
|
|
811
|
-
> = z.nativeEnum(InvokeAgentPublicMessagePartKind);
|
|
812
|
-
/** @internal */
|
|
813
|
-
export const InvokeAgentPublicMessagePartKind$outboundSchema: z.ZodNativeEnum<
|
|
814
|
-
typeof InvokeAgentPublicMessagePartKind
|
|
815
|
-
> = InvokeAgentPublicMessagePartKind$inboundSchema;
|
|
816
|
-
|
|
817
|
-
/** @internal */
|
|
818
|
-
export const PublicMessagePartTextPart$inboundSchema: z.ZodType<
|
|
819
|
-
PublicMessagePartTextPart,
|
|
820
|
-
z.ZodTypeDef,
|
|
821
|
-
unknown
|
|
822
|
-
> = z.object({
|
|
823
|
-
kind: InvokeAgentPublicMessagePartKind$inboundSchema,
|
|
824
|
-
text: z.string(),
|
|
825
|
-
});
|
|
826
|
-
/** @internal */
|
|
827
|
-
export type PublicMessagePartTextPart$Outbound = {
|
|
828
|
-
kind: string;
|
|
829
|
-
text: string;
|
|
830
|
-
};
|
|
831
|
-
|
|
832
|
-
/** @internal */
|
|
833
|
-
export const PublicMessagePartTextPart$outboundSchema: z.ZodType<
|
|
834
|
-
PublicMessagePartTextPart$Outbound,
|
|
835
|
-
z.ZodTypeDef,
|
|
836
|
-
PublicMessagePartTextPart
|
|
837
|
-
> = z.object({
|
|
838
|
-
kind: InvokeAgentPublicMessagePartKind$outboundSchema,
|
|
839
|
-
text: z.string(),
|
|
840
|
-
});
|
|
841
|
-
|
|
842
|
-
export function publicMessagePartTextPartToJSON(
|
|
843
|
-
publicMessagePartTextPart: PublicMessagePartTextPart,
|
|
844
|
-
): string {
|
|
845
|
-
return JSON.stringify(
|
|
846
|
-
PublicMessagePartTextPart$outboundSchema.parse(publicMessagePartTextPart),
|
|
847
|
-
);
|
|
848
|
-
}
|
|
849
|
-
export function publicMessagePartTextPartFromJSON(
|
|
850
|
-
jsonString: string,
|
|
851
|
-
): SafeParseResult<PublicMessagePartTextPart, SDKValidationError> {
|
|
852
|
-
return safeParse(
|
|
853
|
-
jsonString,
|
|
854
|
-
(x) => PublicMessagePartTextPart$inboundSchema.parse(JSON.parse(x)),
|
|
855
|
-
`Failed to parse 'PublicMessagePartTextPart' from JSON`,
|
|
856
|
-
);
|
|
857
|
-
}
|
|
858
|
-
|
|
859
676
|
/** @internal */
|
|
860
677
|
export const InvokeAgentPublicMessagePart$inboundSchema: z.ZodType<
|
|
861
678
|
InvokeAgentPublicMessagePart,
|
|
862
679
|
z.ZodTypeDef,
|
|
863
680
|
unknown
|
|
864
681
|
> = z.union([
|
|
865
|
-
|
|
682
|
+
components.TextPart$inboundSchema,
|
|
866
683
|
z.lazy(() => PublicMessagePartFilePart$inboundSchema),
|
|
867
684
|
z.lazy(() => PublicMessagePartToolResultPart$inboundSchema),
|
|
868
685
|
]);
|
|
869
686
|
/** @internal */
|
|
870
687
|
export type InvokeAgentPublicMessagePart$Outbound =
|
|
871
|
-
|
|
|
688
|
+
| components.TextPart$Outbound
|
|
872
689
|
| PublicMessagePartFilePart$Outbound
|
|
873
690
|
| PublicMessagePartToolResultPart$Outbound;
|
|
874
691
|
|
|
@@ -878,7 +695,7 @@ export const InvokeAgentPublicMessagePart$outboundSchema: z.ZodType<
|
|
|
878
695
|
z.ZodTypeDef,
|
|
879
696
|
InvokeAgentPublicMessagePart
|
|
880
697
|
> = z.union([
|
|
881
|
-
|
|
698
|
+
components.TextPart$outboundSchema,
|
|
882
699
|
z.lazy(() => PublicMessagePartFilePart$outboundSchema),
|
|
883
700
|
z.lazy(() => PublicMessagePartToolResultPart$outboundSchema),
|
|
884
701
|
]);
|
|
@@ -915,7 +732,7 @@ export const InvokeAgentA2AMessage$inboundSchema: z.ZodType<
|
|
|
915
732
|
]),
|
|
916
733
|
parts: z.array(
|
|
917
734
|
z.union([
|
|
918
|
-
|
|
735
|
+
components.TextPart$inboundSchema,
|
|
919
736
|
z.lazy(() => PublicMessagePartFilePart$inboundSchema),
|
|
920
737
|
z.lazy(() => PublicMessagePartToolResultPart$inboundSchema),
|
|
921
738
|
]),
|
|
@@ -926,7 +743,7 @@ export type InvokeAgentA2AMessage$Outbound = {
|
|
|
926
743
|
messageId?: string | undefined;
|
|
927
744
|
role: string | string;
|
|
928
745
|
parts: Array<
|
|
929
|
-
|
|
|
746
|
+
| components.TextPart$Outbound
|
|
930
747
|
| PublicMessagePartFilePart$Outbound
|
|
931
748
|
| PublicMessagePartToolResultPart$Outbound
|
|
932
749
|
>;
|
|
@@ -945,7 +762,7 @@ export const InvokeAgentA2AMessage$outboundSchema: z.ZodType<
|
|
|
945
762
|
]),
|
|
946
763
|
parts: z.array(
|
|
947
764
|
z.union([
|
|
948
|
-
|
|
765
|
+
components.TextPart$outboundSchema,
|
|
949
766
|
z.lazy(() => PublicMessagePartFilePart$outboundSchema),
|
|
950
767
|
z.lazy(() => PublicMessagePartToolResultPart$outboundSchema),
|
|
951
768
|
]),
|
|
@@ -1272,461 +1089,80 @@ export const ExtendedMessageRole$outboundSchema: z.ZodNativeEnum<
|
|
|
1272
1089
|
> = ExtendedMessageRole$inboundSchema;
|
|
1273
1090
|
|
|
1274
1091
|
/** @internal */
|
|
1275
|
-
export const
|
|
1276
|
-
|
|
1277
|
-
InvokeAgentPartsAgentsResponse200Kind,
|
|
1278
|
-
);
|
|
1279
|
-
/** @internal */
|
|
1280
|
-
export const InvokeAgentPartsAgentsResponse200Kind$outboundSchema:
|
|
1281
|
-
z.ZodNativeEnum<typeof InvokeAgentPartsAgentsResponse200Kind> =
|
|
1282
|
-
InvokeAgentPartsAgentsResponse200Kind$inboundSchema;
|
|
1283
|
-
|
|
1284
|
-
/** @internal */
|
|
1285
|
-
export const PartsToolResultPart$inboundSchema: z.ZodType<
|
|
1286
|
-
PartsToolResultPart,
|
|
1287
|
-
z.ZodTypeDef,
|
|
1288
|
-
unknown
|
|
1289
|
-
> = z.object({
|
|
1290
|
-
kind: InvokeAgentPartsAgentsResponse200Kind$inboundSchema,
|
|
1291
|
-
tool_call_id: z.string(),
|
|
1292
|
-
result: z.any().optional(),
|
|
1293
|
-
metadata: z.record(z.any()).optional(),
|
|
1294
|
-
}).transform((v) => {
|
|
1295
|
-
return remap$(v, {
|
|
1296
|
-
"tool_call_id": "toolCallId",
|
|
1297
|
-
});
|
|
1298
|
-
});
|
|
1299
|
-
/** @internal */
|
|
1300
|
-
export type PartsToolResultPart$Outbound = {
|
|
1301
|
-
kind: string;
|
|
1302
|
-
tool_call_id: string;
|
|
1303
|
-
result?: any | undefined;
|
|
1304
|
-
metadata?: { [k: string]: any } | undefined;
|
|
1305
|
-
};
|
|
1306
|
-
|
|
1307
|
-
/** @internal */
|
|
1308
|
-
export const PartsToolResultPart$outboundSchema: z.ZodType<
|
|
1309
|
-
PartsToolResultPart$Outbound,
|
|
1310
|
-
z.ZodTypeDef,
|
|
1311
|
-
PartsToolResultPart
|
|
1312
|
-
> = z.object({
|
|
1313
|
-
kind: InvokeAgentPartsAgentsResponse200Kind$outboundSchema,
|
|
1314
|
-
toolCallId: z.string(),
|
|
1315
|
-
result: z.any().optional(),
|
|
1316
|
-
metadata: z.record(z.any()).optional(),
|
|
1317
|
-
}).transform((v) => {
|
|
1318
|
-
return remap$(v, {
|
|
1319
|
-
toolCallId: "tool_call_id",
|
|
1320
|
-
});
|
|
1321
|
-
});
|
|
1322
|
-
|
|
1323
|
-
export function partsToolResultPartToJSON(
|
|
1324
|
-
partsToolResultPart: PartsToolResultPart,
|
|
1325
|
-
): string {
|
|
1326
|
-
return JSON.stringify(
|
|
1327
|
-
PartsToolResultPart$outboundSchema.parse(partsToolResultPart),
|
|
1328
|
-
);
|
|
1329
|
-
}
|
|
1330
|
-
export function partsToolResultPartFromJSON(
|
|
1331
|
-
jsonString: string,
|
|
1332
|
-
): SafeParseResult<PartsToolResultPart, SDKValidationError> {
|
|
1333
|
-
return safeParse(
|
|
1334
|
-
jsonString,
|
|
1335
|
-
(x) => PartsToolResultPart$inboundSchema.parse(JSON.parse(x)),
|
|
1336
|
-
`Failed to parse 'PartsToolResultPart' from JSON`,
|
|
1337
|
-
);
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
/** @internal */
|
|
1341
|
-
export const InvokeAgentPartsAgentsResponseKind$inboundSchema: z.ZodNativeEnum<
|
|
1342
|
-
typeof InvokeAgentPartsAgentsResponseKind
|
|
1343
|
-
> = z.nativeEnum(InvokeAgentPartsAgentsResponseKind);
|
|
1344
|
-
/** @internal */
|
|
1345
|
-
export const InvokeAgentPartsAgentsResponseKind$outboundSchema: z.ZodNativeEnum<
|
|
1346
|
-
typeof InvokeAgentPartsAgentsResponseKind
|
|
1347
|
-
> = InvokeAgentPartsAgentsResponseKind$inboundSchema;
|
|
1348
|
-
|
|
1349
|
-
/** @internal */
|
|
1350
|
-
export const ToolCallPart$inboundSchema: z.ZodType<
|
|
1351
|
-
ToolCallPart,
|
|
1352
|
-
z.ZodTypeDef,
|
|
1353
|
-
unknown
|
|
1354
|
-
> = z.object({
|
|
1355
|
-
kind: InvokeAgentPartsAgentsResponseKind$inboundSchema,
|
|
1356
|
-
tool_name: z.string(),
|
|
1357
|
-
tool_call_id: z.string(),
|
|
1358
|
-
arguments: z.record(z.any()),
|
|
1359
|
-
metadata: z.record(z.any()).optional(),
|
|
1360
|
-
}).transform((v) => {
|
|
1361
|
-
return remap$(v, {
|
|
1362
|
-
"tool_name": "toolName",
|
|
1363
|
-
"tool_call_id": "toolCallId",
|
|
1364
|
-
});
|
|
1365
|
-
});
|
|
1366
|
-
/** @internal */
|
|
1367
|
-
export type ToolCallPart$Outbound = {
|
|
1368
|
-
kind: string;
|
|
1369
|
-
tool_name: string;
|
|
1370
|
-
tool_call_id: string;
|
|
1371
|
-
arguments: { [k: string]: any };
|
|
1372
|
-
metadata?: { [k: string]: any } | undefined;
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
/** @internal */
|
|
1376
|
-
export const ToolCallPart$outboundSchema: z.ZodType<
|
|
1377
|
-
ToolCallPart$Outbound,
|
|
1378
|
-
z.ZodTypeDef,
|
|
1379
|
-
ToolCallPart
|
|
1380
|
-
> = z.object({
|
|
1381
|
-
kind: InvokeAgentPartsAgentsResponseKind$outboundSchema,
|
|
1382
|
-
toolName: z.string(),
|
|
1383
|
-
toolCallId: z.string(),
|
|
1384
|
-
arguments: z.record(z.any()),
|
|
1385
|
-
metadata: z.record(z.any()).optional(),
|
|
1386
|
-
}).transform((v) => {
|
|
1387
|
-
return remap$(v, {
|
|
1388
|
-
toolName: "tool_name",
|
|
1389
|
-
toolCallId: "tool_call_id",
|
|
1390
|
-
});
|
|
1391
|
-
});
|
|
1392
|
-
|
|
1393
|
-
export function toolCallPartToJSON(toolCallPart: ToolCallPart): string {
|
|
1394
|
-
return JSON.stringify(ToolCallPart$outboundSchema.parse(toolCallPart));
|
|
1395
|
-
}
|
|
1396
|
-
export function toolCallPartFromJSON(
|
|
1397
|
-
jsonString: string,
|
|
1398
|
-
): SafeParseResult<ToolCallPart, SDKValidationError> {
|
|
1399
|
-
return safeParse(
|
|
1400
|
-
jsonString,
|
|
1401
|
-
(x) => ToolCallPart$inboundSchema.parse(JSON.parse(x)),
|
|
1402
|
-
`Failed to parse 'ToolCallPart' from JSON`,
|
|
1403
|
-
);
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
/** @internal */
|
|
1407
|
-
export const InvokeAgentPartsAgentsKind$inboundSchema: z.ZodNativeEnum<
|
|
1408
|
-
typeof InvokeAgentPartsAgentsKind
|
|
1409
|
-
> = z.nativeEnum(InvokeAgentPartsAgentsKind);
|
|
1410
|
-
/** @internal */
|
|
1411
|
-
export const InvokeAgentPartsAgentsKind$outboundSchema: z.ZodNativeEnum<
|
|
1412
|
-
typeof InvokeAgentPartsAgentsKind
|
|
1413
|
-
> = InvokeAgentPartsAgentsKind$inboundSchema;
|
|
1414
|
-
|
|
1415
|
-
/** @internal */
|
|
1416
|
-
export const InvokeAgentFileFileInURIFormat$inboundSchema: z.ZodType<
|
|
1417
|
-
InvokeAgentFileFileInURIFormat,
|
|
1418
|
-
z.ZodTypeDef,
|
|
1419
|
-
unknown
|
|
1420
|
-
> = z.object({
|
|
1421
|
-
uri: z.string(),
|
|
1422
|
-
mimeType: z.string().optional(),
|
|
1423
|
-
name: z.string().optional(),
|
|
1424
|
-
});
|
|
1425
|
-
/** @internal */
|
|
1426
|
-
export type InvokeAgentFileFileInURIFormat$Outbound = {
|
|
1427
|
-
uri: string;
|
|
1428
|
-
mimeType?: string | undefined;
|
|
1429
|
-
name?: string | undefined;
|
|
1430
|
-
};
|
|
1431
|
-
|
|
1432
|
-
/** @internal */
|
|
1433
|
-
export const InvokeAgentFileFileInURIFormat$outboundSchema: z.ZodType<
|
|
1434
|
-
InvokeAgentFileFileInURIFormat$Outbound,
|
|
1435
|
-
z.ZodTypeDef,
|
|
1436
|
-
InvokeAgentFileFileInURIFormat
|
|
1437
|
-
> = z.object({
|
|
1438
|
-
uri: z.string(),
|
|
1439
|
-
mimeType: z.string().optional(),
|
|
1440
|
-
name: z.string().optional(),
|
|
1441
|
-
});
|
|
1442
|
-
|
|
1443
|
-
export function invokeAgentFileFileInURIFormatToJSON(
|
|
1444
|
-
invokeAgentFileFileInURIFormat: InvokeAgentFileFileInURIFormat,
|
|
1445
|
-
): string {
|
|
1446
|
-
return JSON.stringify(
|
|
1447
|
-
InvokeAgentFileFileInURIFormat$outboundSchema.parse(
|
|
1448
|
-
invokeAgentFileFileInURIFormat,
|
|
1449
|
-
),
|
|
1450
|
-
);
|
|
1451
|
-
}
|
|
1452
|
-
export function invokeAgentFileFileInURIFormatFromJSON(
|
|
1453
|
-
jsonString: string,
|
|
1454
|
-
): SafeParseResult<InvokeAgentFileFileInURIFormat, SDKValidationError> {
|
|
1455
|
-
return safeParse(
|
|
1456
|
-
jsonString,
|
|
1457
|
-
(x) => InvokeAgentFileFileInURIFormat$inboundSchema.parse(JSON.parse(x)),
|
|
1458
|
-
`Failed to parse 'InvokeAgentFileFileInURIFormat' from JSON`,
|
|
1459
|
-
);
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
/** @internal */
|
|
1463
|
-
export const InvokeAgentFileBinaryFormat$inboundSchema: z.ZodType<
|
|
1464
|
-
InvokeAgentFileBinaryFormat,
|
|
1465
|
-
z.ZodTypeDef,
|
|
1466
|
-
unknown
|
|
1467
|
-
> = z.object({
|
|
1468
|
-
bytes: z.string(),
|
|
1469
|
-
mimeType: z.string().optional(),
|
|
1470
|
-
name: z.string().optional(),
|
|
1471
|
-
});
|
|
1472
|
-
/** @internal */
|
|
1473
|
-
export type InvokeAgentFileBinaryFormat$Outbound = {
|
|
1474
|
-
bytes: string;
|
|
1475
|
-
mimeType?: string | undefined;
|
|
1476
|
-
name?: string | undefined;
|
|
1477
|
-
};
|
|
1478
|
-
|
|
1479
|
-
/** @internal */
|
|
1480
|
-
export const InvokeAgentFileBinaryFormat$outboundSchema: z.ZodType<
|
|
1481
|
-
InvokeAgentFileBinaryFormat$Outbound,
|
|
1482
|
-
z.ZodTypeDef,
|
|
1483
|
-
InvokeAgentFileBinaryFormat
|
|
1484
|
-
> = z.object({
|
|
1485
|
-
bytes: z.string(),
|
|
1486
|
-
mimeType: z.string().optional(),
|
|
1487
|
-
name: z.string().optional(),
|
|
1488
|
-
});
|
|
1489
|
-
|
|
1490
|
-
export function invokeAgentFileBinaryFormatToJSON(
|
|
1491
|
-
invokeAgentFileBinaryFormat: InvokeAgentFileBinaryFormat,
|
|
1492
|
-
): string {
|
|
1493
|
-
return JSON.stringify(
|
|
1494
|
-
InvokeAgentFileBinaryFormat$outboundSchema.parse(
|
|
1495
|
-
invokeAgentFileBinaryFormat,
|
|
1496
|
-
),
|
|
1497
|
-
);
|
|
1498
|
-
}
|
|
1499
|
-
export function invokeAgentFileBinaryFormatFromJSON(
|
|
1500
|
-
jsonString: string,
|
|
1501
|
-
): SafeParseResult<InvokeAgentFileBinaryFormat, SDKValidationError> {
|
|
1502
|
-
return safeParse(
|
|
1503
|
-
jsonString,
|
|
1504
|
-
(x) => InvokeAgentFileBinaryFormat$inboundSchema.parse(JSON.parse(x)),
|
|
1505
|
-
`Failed to parse 'InvokeAgentFileBinaryFormat' from JSON`,
|
|
1506
|
-
);
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
/** @internal */
|
|
1510
|
-
export const PartsFile$inboundSchema: z.ZodType<
|
|
1511
|
-
PartsFile,
|
|
1092
|
+
export const InvokeAgentParts$inboundSchema: z.ZodType<
|
|
1093
|
+
InvokeAgentParts,
|
|
1512
1094
|
z.ZodTypeDef,
|
|
1513
1095
|
unknown
|
|
1514
1096
|
> = z.union([
|
|
1515
|
-
|
|
1516
|
-
|
|
1097
|
+
components.ToolCallPart$inboundSchema.and(
|
|
1098
|
+
z.object({ kind: z.literal("tool_call") }).transform((v) => ({
|
|
1099
|
+
kind: v.kind,
|
|
1100
|
+
})),
|
|
1101
|
+
),
|
|
1102
|
+
components.TextPart$inboundSchema.and(
|
|
1103
|
+
z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind })),
|
|
1104
|
+
),
|
|
1105
|
+
components.DataPart$inboundSchema.and(
|
|
1106
|
+
z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind })),
|
|
1107
|
+
),
|
|
1108
|
+
components.FilePart$inboundSchema.and(
|
|
1109
|
+
z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind })),
|
|
1110
|
+
),
|
|
1111
|
+
components.ToolResultPart$inboundSchema.and(
|
|
1112
|
+
z.object({ kind: z.literal("tool_result") }).transform((v) => ({
|
|
1113
|
+
kind: v.kind,
|
|
1114
|
+
})),
|
|
1115
|
+
),
|
|
1517
1116
|
]);
|
|
1518
1117
|
/** @internal */
|
|
1519
|
-
export type
|
|
1520
|
-
|
|
|
1521
|
-
|
|
|
1118
|
+
export type InvokeAgentParts$Outbound =
|
|
1119
|
+
| (components.ToolCallPart$Outbound & { kind: "tool_call" })
|
|
1120
|
+
| (components.TextPart$Outbound & { kind: "text" })
|
|
1121
|
+
| (components.DataPart$Outbound & { kind: "data" })
|
|
1122
|
+
| (components.FilePart$Outbound & { kind: "file" })
|
|
1123
|
+
| (components.ToolResultPart$Outbound & { kind: "tool_result" });
|
|
1522
1124
|
|
|
1523
1125
|
/** @internal */
|
|
1524
|
-
export const
|
|
1525
|
-
|
|
1126
|
+
export const InvokeAgentParts$outboundSchema: z.ZodType<
|
|
1127
|
+
InvokeAgentParts$Outbound,
|
|
1526
1128
|
z.ZodTypeDef,
|
|
1527
|
-
|
|
1129
|
+
InvokeAgentParts
|
|
1528
1130
|
> = z.union([
|
|
1529
|
-
|
|
1530
|
-
|
|
1131
|
+
components.ToolCallPart$outboundSchema.and(
|
|
1132
|
+
z.object({ kind: z.literal("tool_call") }).transform((v) => ({
|
|
1133
|
+
kind: v.kind,
|
|
1134
|
+
})),
|
|
1135
|
+
),
|
|
1136
|
+
components.TextPart$outboundSchema.and(
|
|
1137
|
+
z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind })),
|
|
1138
|
+
),
|
|
1139
|
+
components.DataPart$outboundSchema.and(
|
|
1140
|
+
z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind })),
|
|
1141
|
+
),
|
|
1142
|
+
components.FilePart$outboundSchema.and(
|
|
1143
|
+
z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind })),
|
|
1144
|
+
),
|
|
1145
|
+
components.ToolResultPart$outboundSchema.and(
|
|
1146
|
+
z.object({ kind: z.literal("tool_result") }).transform((v) => ({
|
|
1147
|
+
kind: v.kind,
|
|
1148
|
+
})),
|
|
1149
|
+
),
|
|
1531
1150
|
]);
|
|
1532
1151
|
|
|
1533
|
-
export function
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
): SafeParseResult<PartsFile, SDKValidationError> {
|
|
1539
|
-
return safeParse(
|
|
1540
|
-
jsonString,
|
|
1541
|
-
(x) => PartsFile$inboundSchema.parse(JSON.parse(x)),
|
|
1542
|
-
`Failed to parse 'PartsFile' from JSON`,
|
|
1543
|
-
);
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
/** @internal */
|
|
1547
|
-
export const PartsFilePart$inboundSchema: z.ZodType<
|
|
1548
|
-
PartsFilePart,
|
|
1549
|
-
z.ZodTypeDef,
|
|
1550
|
-
unknown
|
|
1551
|
-
> = z.object({
|
|
1552
|
-
kind: InvokeAgentPartsAgentsKind$inboundSchema,
|
|
1553
|
-
file: z.union([
|
|
1554
|
-
z.lazy(() => InvokeAgentFileBinaryFormat$inboundSchema),
|
|
1555
|
-
z.lazy(() => InvokeAgentFileFileInURIFormat$inboundSchema),
|
|
1556
|
-
]),
|
|
1557
|
-
metadata: z.record(z.any()).optional(),
|
|
1558
|
-
});
|
|
1559
|
-
/** @internal */
|
|
1560
|
-
export type PartsFilePart$Outbound = {
|
|
1561
|
-
kind: string;
|
|
1562
|
-
file:
|
|
1563
|
-
| InvokeAgentFileBinaryFormat$Outbound
|
|
1564
|
-
| InvokeAgentFileFileInURIFormat$Outbound;
|
|
1565
|
-
metadata?: { [k: string]: any } | undefined;
|
|
1566
|
-
};
|
|
1567
|
-
|
|
1568
|
-
/** @internal */
|
|
1569
|
-
export const PartsFilePart$outboundSchema: z.ZodType<
|
|
1570
|
-
PartsFilePart$Outbound,
|
|
1571
|
-
z.ZodTypeDef,
|
|
1572
|
-
PartsFilePart
|
|
1573
|
-
> = z.object({
|
|
1574
|
-
kind: InvokeAgentPartsAgentsKind$outboundSchema,
|
|
1575
|
-
file: z.union([
|
|
1576
|
-
z.lazy(() => InvokeAgentFileBinaryFormat$outboundSchema),
|
|
1577
|
-
z.lazy(() => InvokeAgentFileFileInURIFormat$outboundSchema),
|
|
1578
|
-
]),
|
|
1579
|
-
metadata: z.record(z.any()).optional(),
|
|
1580
|
-
});
|
|
1581
|
-
|
|
1582
|
-
export function partsFilePartToJSON(partsFilePart: PartsFilePart): string {
|
|
1583
|
-
return JSON.stringify(PartsFilePart$outboundSchema.parse(partsFilePart));
|
|
1584
|
-
}
|
|
1585
|
-
export function partsFilePartFromJSON(
|
|
1586
|
-
jsonString: string,
|
|
1587
|
-
): SafeParseResult<PartsFilePart, SDKValidationError> {
|
|
1588
|
-
return safeParse(
|
|
1589
|
-
jsonString,
|
|
1590
|
-
(x) => PartsFilePart$inboundSchema.parse(JSON.parse(x)),
|
|
1591
|
-
`Failed to parse 'PartsFilePart' from JSON`,
|
|
1592
|
-
);
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
|
-
/** @internal */
|
|
1596
|
-
export const InvokeAgentPartsKind$inboundSchema: z.ZodNativeEnum<
|
|
1597
|
-
typeof InvokeAgentPartsKind
|
|
1598
|
-
> = z.nativeEnum(InvokeAgentPartsKind);
|
|
1599
|
-
/** @internal */
|
|
1600
|
-
export const InvokeAgentPartsKind$outboundSchema: z.ZodNativeEnum<
|
|
1601
|
-
typeof InvokeAgentPartsKind
|
|
1602
|
-
> = InvokeAgentPartsKind$inboundSchema;
|
|
1603
|
-
|
|
1604
|
-
/** @internal */
|
|
1605
|
-
export const DataPart$inboundSchema: z.ZodType<
|
|
1606
|
-
DataPart,
|
|
1607
|
-
z.ZodTypeDef,
|
|
1608
|
-
unknown
|
|
1609
|
-
> = z.object({
|
|
1610
|
-
kind: InvokeAgentPartsKind$inboundSchema,
|
|
1611
|
-
data: z.record(z.any()),
|
|
1612
|
-
metadata: z.record(z.any()).optional(),
|
|
1613
|
-
});
|
|
1614
|
-
/** @internal */
|
|
1615
|
-
export type DataPart$Outbound = {
|
|
1616
|
-
kind: string;
|
|
1617
|
-
data: { [k: string]: any };
|
|
1618
|
-
metadata?: { [k: string]: any } | undefined;
|
|
1619
|
-
};
|
|
1620
|
-
|
|
1621
|
-
/** @internal */
|
|
1622
|
-
export const DataPart$outboundSchema: z.ZodType<
|
|
1623
|
-
DataPart$Outbound,
|
|
1624
|
-
z.ZodTypeDef,
|
|
1625
|
-
DataPart
|
|
1626
|
-
> = z.object({
|
|
1627
|
-
kind: InvokeAgentPartsKind$outboundSchema,
|
|
1628
|
-
data: z.record(z.any()),
|
|
1629
|
-
metadata: z.record(z.any()).optional(),
|
|
1630
|
-
});
|
|
1631
|
-
|
|
1632
|
-
export function dataPartToJSON(dataPart: DataPart): string {
|
|
1633
|
-
return JSON.stringify(DataPart$outboundSchema.parse(dataPart));
|
|
1634
|
-
}
|
|
1635
|
-
export function dataPartFromJSON(
|
|
1636
|
-
jsonString: string,
|
|
1637
|
-
): SafeParseResult<DataPart, SDKValidationError> {
|
|
1638
|
-
return safeParse(
|
|
1639
|
-
jsonString,
|
|
1640
|
-
(x) => DataPart$inboundSchema.parse(JSON.parse(x)),
|
|
1641
|
-
`Failed to parse 'DataPart' from JSON`,
|
|
1642
|
-
);
|
|
1643
|
-
}
|
|
1644
|
-
|
|
1645
|
-
/** @internal */
|
|
1646
|
-
export const PartsKind$inboundSchema: z.ZodNativeEnum<typeof PartsKind> = z
|
|
1647
|
-
.nativeEnum(PartsKind);
|
|
1648
|
-
/** @internal */
|
|
1649
|
-
export const PartsKind$outboundSchema: z.ZodNativeEnum<typeof PartsKind> =
|
|
1650
|
-
PartsKind$inboundSchema;
|
|
1651
|
-
|
|
1652
|
-
/** @internal */
|
|
1653
|
-
export const PartsTextPart$inboundSchema: z.ZodType<
|
|
1654
|
-
PartsTextPart,
|
|
1655
|
-
z.ZodTypeDef,
|
|
1656
|
-
unknown
|
|
1657
|
-
> = z.object({
|
|
1658
|
-
kind: PartsKind$inboundSchema,
|
|
1659
|
-
text: z.string(),
|
|
1660
|
-
});
|
|
1661
|
-
/** @internal */
|
|
1662
|
-
export type PartsTextPart$Outbound = {
|
|
1663
|
-
kind: string;
|
|
1664
|
-
text: string;
|
|
1665
|
-
};
|
|
1666
|
-
|
|
1667
|
-
/** @internal */
|
|
1668
|
-
export const PartsTextPart$outboundSchema: z.ZodType<
|
|
1669
|
-
PartsTextPart$Outbound,
|
|
1670
|
-
z.ZodTypeDef,
|
|
1671
|
-
PartsTextPart
|
|
1672
|
-
> = z.object({
|
|
1673
|
-
kind: PartsKind$outboundSchema,
|
|
1674
|
-
text: z.string(),
|
|
1675
|
-
});
|
|
1676
|
-
|
|
1677
|
-
export function partsTextPartToJSON(partsTextPart: PartsTextPart): string {
|
|
1678
|
-
return JSON.stringify(PartsTextPart$outboundSchema.parse(partsTextPart));
|
|
1679
|
-
}
|
|
1680
|
-
export function partsTextPartFromJSON(
|
|
1681
|
-
jsonString: string,
|
|
1682
|
-
): SafeParseResult<PartsTextPart, SDKValidationError> {
|
|
1683
|
-
return safeParse(
|
|
1684
|
-
jsonString,
|
|
1685
|
-
(x) => PartsTextPart$inboundSchema.parse(JSON.parse(x)),
|
|
1686
|
-
`Failed to parse 'PartsTextPart' from JSON`,
|
|
1152
|
+
export function invokeAgentPartsToJSON(
|
|
1153
|
+
invokeAgentParts: InvokeAgentParts,
|
|
1154
|
+
): string {
|
|
1155
|
+
return JSON.stringify(
|
|
1156
|
+
InvokeAgentParts$outboundSchema.parse(invokeAgentParts),
|
|
1687
1157
|
);
|
|
1688
1158
|
}
|
|
1689
|
-
|
|
1690
|
-
/** @internal */
|
|
1691
|
-
export const Parts$inboundSchema: z.ZodType<Parts, z.ZodTypeDef, unknown> = z
|
|
1692
|
-
.union([
|
|
1693
|
-
z.lazy(() => ToolCallPart$inboundSchema),
|
|
1694
|
-
z.lazy(() => PartsTextPart$inboundSchema),
|
|
1695
|
-
z.lazy(() => DataPart$inboundSchema),
|
|
1696
|
-
z.lazy(() => PartsFilePart$inboundSchema),
|
|
1697
|
-
z.lazy(() => PartsToolResultPart$inboundSchema),
|
|
1698
|
-
]);
|
|
1699
|
-
/** @internal */
|
|
1700
|
-
export type Parts$Outbound =
|
|
1701
|
-
| ToolCallPart$Outbound
|
|
1702
|
-
| PartsTextPart$Outbound
|
|
1703
|
-
| DataPart$Outbound
|
|
1704
|
-
| PartsFilePart$Outbound
|
|
1705
|
-
| PartsToolResultPart$Outbound;
|
|
1706
|
-
|
|
1707
|
-
/** @internal */
|
|
1708
|
-
export const Parts$outboundSchema: z.ZodType<
|
|
1709
|
-
Parts$Outbound,
|
|
1710
|
-
z.ZodTypeDef,
|
|
1711
|
-
Parts
|
|
1712
|
-
> = z.union([
|
|
1713
|
-
z.lazy(() => ToolCallPart$outboundSchema),
|
|
1714
|
-
z.lazy(() => PartsTextPart$outboundSchema),
|
|
1715
|
-
z.lazy(() => DataPart$outboundSchema),
|
|
1716
|
-
z.lazy(() => PartsFilePart$outboundSchema),
|
|
1717
|
-
z.lazy(() => PartsToolResultPart$outboundSchema),
|
|
1718
|
-
]);
|
|
1719
|
-
|
|
1720
|
-
export function partsToJSON(parts: Parts): string {
|
|
1721
|
-
return JSON.stringify(Parts$outboundSchema.parse(parts));
|
|
1722
|
-
}
|
|
1723
|
-
export function partsFromJSON(
|
|
1159
|
+
export function invokeAgentPartsFromJSON(
|
|
1724
1160
|
jsonString: string,
|
|
1725
|
-
): SafeParseResult<
|
|
1161
|
+
): SafeParseResult<InvokeAgentParts, SDKValidationError> {
|
|
1726
1162
|
return safeParse(
|
|
1727
1163
|
jsonString,
|
|
1728
|
-
(x) =>
|
|
1729
|
-
`Failed to parse '
|
|
1164
|
+
(x) => InvokeAgentParts$inboundSchema.parse(JSON.parse(x)),
|
|
1165
|
+
`Failed to parse 'InvokeAgentParts' from JSON`,
|
|
1730
1166
|
);
|
|
1731
1167
|
}
|
|
1732
1168
|
|
|
@@ -1741,11 +1177,31 @@ export const TaskStatusMessage$inboundSchema: z.ZodType<
|
|
|
1741
1177
|
role: ExtendedMessageRole$inboundSchema,
|
|
1742
1178
|
parts: z.array(
|
|
1743
1179
|
z.union([
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1180
|
+
components.ToolCallPart$inboundSchema.and(
|
|
1181
|
+
z.object({ kind: z.literal("tool_call") }).transform((v) => ({
|
|
1182
|
+
kind: v.kind,
|
|
1183
|
+
})),
|
|
1184
|
+
),
|
|
1185
|
+
components.TextPart$inboundSchema.and(
|
|
1186
|
+
z.object({ kind: z.literal("text") }).transform((v) => ({
|
|
1187
|
+
kind: v.kind,
|
|
1188
|
+
})),
|
|
1189
|
+
),
|
|
1190
|
+
components.DataPart$inboundSchema.and(
|
|
1191
|
+
z.object({ kind: z.literal("data") }).transform((v) => ({
|
|
1192
|
+
kind: v.kind,
|
|
1193
|
+
})),
|
|
1194
|
+
),
|
|
1195
|
+
components.FilePart$inboundSchema.and(
|
|
1196
|
+
z.object({ kind: z.literal("file") }).transform((v) => ({
|
|
1197
|
+
kind: v.kind,
|
|
1198
|
+
})),
|
|
1199
|
+
),
|
|
1200
|
+
components.ToolResultPart$inboundSchema.and(
|
|
1201
|
+
z.object({ kind: z.literal("tool_result") }).transform((v) => ({
|
|
1202
|
+
kind: v.kind,
|
|
1203
|
+
})),
|
|
1204
|
+
),
|
|
1749
1205
|
]),
|
|
1750
1206
|
),
|
|
1751
1207
|
});
|
|
@@ -1755,11 +1211,11 @@ export type TaskStatusMessage$Outbound = {
|
|
|
1755
1211
|
messageId: string;
|
|
1756
1212
|
role: string;
|
|
1757
1213
|
parts: Array<
|
|
1758
|
-
| ToolCallPart$Outbound
|
|
1759
|
-
|
|
|
1760
|
-
| DataPart$Outbound
|
|
1761
|
-
|
|
|
1762
|
-
|
|
|
1214
|
+
| (components.ToolCallPart$Outbound & { kind: "tool_call" })
|
|
1215
|
+
| (components.TextPart$Outbound & { kind: "text" })
|
|
1216
|
+
| (components.DataPart$Outbound & { kind: "data" })
|
|
1217
|
+
| (components.FilePart$Outbound & { kind: "file" })
|
|
1218
|
+
| (components.ToolResultPart$Outbound & { kind: "tool_result" })
|
|
1763
1219
|
>;
|
|
1764
1220
|
};
|
|
1765
1221
|
|
|
@@ -1774,11 +1230,31 @@ export const TaskStatusMessage$outboundSchema: z.ZodType<
|
|
|
1774
1230
|
role: ExtendedMessageRole$outboundSchema,
|
|
1775
1231
|
parts: z.array(
|
|
1776
1232
|
z.union([
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1233
|
+
components.ToolCallPart$outboundSchema.and(
|
|
1234
|
+
z.object({ kind: z.literal("tool_call") }).transform((v) => ({
|
|
1235
|
+
kind: v.kind,
|
|
1236
|
+
})),
|
|
1237
|
+
),
|
|
1238
|
+
components.TextPart$outboundSchema.and(
|
|
1239
|
+
z.object({ kind: z.literal("text") }).transform((v) => ({
|
|
1240
|
+
kind: v.kind,
|
|
1241
|
+
})),
|
|
1242
|
+
),
|
|
1243
|
+
components.DataPart$outboundSchema.and(
|
|
1244
|
+
z.object({ kind: z.literal("data") }).transform((v) => ({
|
|
1245
|
+
kind: v.kind,
|
|
1246
|
+
})),
|
|
1247
|
+
),
|
|
1248
|
+
components.FilePart$outboundSchema.and(
|
|
1249
|
+
z.object({ kind: z.literal("file") }).transform((v) => ({
|
|
1250
|
+
kind: v.kind,
|
|
1251
|
+
})),
|
|
1252
|
+
),
|
|
1253
|
+
components.ToolResultPart$outboundSchema.and(
|
|
1254
|
+
z.object({ kind: z.literal("tool_result") }).transform((v) => ({
|
|
1255
|
+
kind: v.kind,
|
|
1256
|
+
})),
|
|
1257
|
+
),
|
|
1782
1258
|
]),
|
|
1783
1259
|
),
|
|
1784
1260
|
});
|