@orq-ai/node 4.0.0-rc.20 → 4.0.0-rc.21

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.
Files changed (161) hide show
  1. package/README.md +25 -21
  2. package/bin/mcp-server.js +4356 -3411
  3. package/bin/mcp-server.js.map +54 -50
  4. package/docs/sdks/agents/README.md +83 -3
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/agentsDuplicate.d.ts +18 -0
  7. package/funcs/agentsDuplicate.d.ts.map +1 -0
  8. package/funcs/agentsDuplicate.js +123 -0
  9. package/funcs/agentsDuplicate.js.map +1 -0
  10. package/funcs/agentsList.d.ts +1 -1
  11. package/funcs/agentsList.js +1 -1
  12. package/jsr.json +1 -1
  13. package/lib/config.d.ts +3 -3
  14. package/lib/config.js +3 -3
  15. package/mcp-server/mcp-server.js +1 -1
  16. package/mcp-server/server.d.ts.map +1 -1
  17. package/mcp-server/server.js +3 -1
  18. package/mcp-server/server.js.map +1 -1
  19. package/mcp-server/tools/agentsDuplicate.d.ts +8 -0
  20. package/mcp-server/tools/agentsDuplicate.d.ts.map +1 -0
  21. package/mcp-server/tools/agentsDuplicate.js +64 -0
  22. package/mcp-server/tools/agentsDuplicate.js.map +1 -0
  23. package/mcp-server/tools/agentsList.js +1 -1
  24. package/mcp-server/tools/agentsList.js.map +1 -1
  25. package/models/errors/duplicateagent.d.ts +55 -0
  26. package/models/errors/duplicateagent.d.ts.map +1 -0
  27. package/models/errors/duplicateagent.js +106 -0
  28. package/models/errors/duplicateagent.js.map +1 -0
  29. package/models/errors/index.d.ts +1 -0
  30. package/models/errors/index.d.ts.map +1 -1
  31. package/models/errors/index.js +1 -0
  32. package/models/errors/index.js.map +1 -1
  33. package/models/operations/createagent.d.ts +19 -10
  34. package/models/operations/createagent.d.ts.map +1 -1
  35. package/models/operations/createagent.js +14 -11
  36. package/models/operations/createagent.js.map +1 -1
  37. package/models/operations/createbudget.js +2 -2
  38. package/models/operations/createcontact.js +2 -2
  39. package/models/operations/createdataset.js +2 -2
  40. package/models/operations/createdatasetitem.js +8 -8
  41. package/models/operations/createdatasource.js +2 -2
  42. package/models/operations/createeval.js +28 -28
  43. package/models/operations/createtool.js +10 -10
  44. package/models/operations/duplicateagent.d.ts +1267 -0
  45. package/models/operations/duplicateagent.d.ts.map +1 -0
  46. package/models/operations/duplicateagent.js +1278 -0
  47. package/models/operations/duplicateagent.js.map +1 -0
  48. package/models/operations/duplicatetool.js +10 -10
  49. package/models/operations/fileget.js +2 -2
  50. package/models/operations/filelist.js +2 -2
  51. package/models/operations/fileupload.js +2 -2
  52. package/models/operations/getagent.d.ts +12 -9
  53. package/models/operations/getagent.d.ts.map +1 -1
  54. package/models/operations/getagent.js +11 -11
  55. package/models/operations/getagent.js.map +1 -1
  56. package/models/operations/getagenttask.d.ts +321 -4
  57. package/models/operations/getagenttask.d.ts.map +1 -1
  58. package/models/operations/getagenttask.js +351 -5
  59. package/models/operations/getagenttask.js.map +1 -1
  60. package/models/operations/getalltools.js +10 -10
  61. package/models/operations/getbudget.js +2 -2
  62. package/models/operations/getevals.js +28 -28
  63. package/models/operations/index.d.ts +1 -0
  64. package/models/operations/index.d.ts.map +1 -1
  65. package/models/operations/index.js +1 -0
  66. package/models/operations/index.js.map +1 -1
  67. package/models/operations/invokeagent.d.ts +231 -2
  68. package/models/operations/invokeagent.d.ts.map +1 -1
  69. package/models/operations/invokeagent.js +261 -4
  70. package/models/operations/invokeagent.js.map +1 -1
  71. package/models/operations/listagents.d.ts +14 -11
  72. package/models/operations/listagents.d.ts.map +1 -1
  73. package/models/operations/listagents.js +14 -13
  74. package/models/operations/listagents.js.map +1 -1
  75. package/models/operations/listagenttasks.d.ts +250 -1094
  76. package/models/operations/listagenttasks.d.ts.map +1 -1
  77. package/models/operations/listagenttasks.js +276 -1117
  78. package/models/operations/listagenttasks.js.map +1 -1
  79. package/models/operations/listbudgets.js +2 -2
  80. package/models/operations/listcontacts.js +2 -2
  81. package/models/operations/listdatasetdatapoints.js +8 -8
  82. package/models/operations/listdatasets.js +2 -2
  83. package/models/operations/listdatasources.js +2 -2
  84. package/models/operations/retrievecontact.js +2 -2
  85. package/models/operations/retrievedatapoint.js +8 -8
  86. package/models/operations/retrievedataset.js +2 -2
  87. package/models/operations/retrievedatasource.js +2 -2
  88. package/models/operations/retrievetool.js +10 -10
  89. package/models/operations/runagent.d.ts +232 -3
  90. package/models/operations/runagent.d.ts.map +1 -1
  91. package/models/operations/runagent.js +267 -8
  92. package/models/operations/runagent.js.map +1 -1
  93. package/models/operations/streamrunagent.d.ts +1 -1
  94. package/models/operations/updateagent.d.ts +41 -9
  95. package/models/operations/updateagent.d.ts.map +1 -1
  96. package/models/operations/updateagent.js +34 -16
  97. package/models/operations/updateagent.js.map +1 -1
  98. package/models/operations/updatebudget.js +2 -2
  99. package/models/operations/updatecontact.js +2 -2
  100. package/models/operations/updatedatapoint.js +8 -8
  101. package/models/operations/updatedataset.js +2 -2
  102. package/models/operations/updatedatasource.js +2 -2
  103. package/models/operations/updateeval.js +28 -28
  104. package/models/operations/updatetool.js +10 -10
  105. package/package.json +1 -1
  106. package/sdk/agents.d.ts +8 -1
  107. package/sdk/agents.d.ts.map +1 -1
  108. package/sdk/agents.js +11 -1
  109. package/sdk/agents.js.map +1 -1
  110. package/src/funcs/agentsDuplicate.ts +179 -0
  111. package/src/funcs/agentsList.ts +1 -1
  112. package/src/lib/config.ts +3 -3
  113. package/src/mcp-server/mcp-server.ts +1 -1
  114. package/src/mcp-server/server.ts +3 -1
  115. package/src/mcp-server/tools/agentsDuplicate.ts +37 -0
  116. package/src/mcp-server/tools/agentsList.ts +1 -1
  117. package/src/models/errors/duplicateagent.ts +128 -0
  118. package/src/models/errors/index.ts +1 -0
  119. package/src/models/operations/createagent.ts +33 -16
  120. package/src/models/operations/createbudget.ts +2 -2
  121. package/src/models/operations/createcontact.ts +2 -2
  122. package/src/models/operations/createdataset.ts +2 -2
  123. package/src/models/operations/createdatasetitem.ts +8 -8
  124. package/src/models/operations/createdatasource.ts +2 -2
  125. package/src/models/operations/createeval.ts +28 -28
  126. package/src/models/operations/createtool.ts +10 -10
  127. package/src/models/operations/duplicateagent.ts +3280 -0
  128. package/src/models/operations/duplicatetool.ts +10 -10
  129. package/src/models/operations/fileget.ts +2 -2
  130. package/src/models/operations/filelist.ts +2 -2
  131. package/src/models/operations/fileupload.ts +2 -2
  132. package/src/models/operations/getagent.ts +29 -17
  133. package/src/models/operations/getagenttask.ts +750 -8
  134. package/src/models/operations/getalltools.ts +10 -10
  135. package/src/models/operations/getbudget.ts +2 -2
  136. package/src/models/operations/getevals.ts +28 -28
  137. package/src/models/operations/index.ts +1 -0
  138. package/src/models/operations/invokeagent.ts +632 -4
  139. package/src/models/operations/listagents.ts +32 -21
  140. package/src/models/operations/listagenttasks.ts +640 -2908
  141. package/src/models/operations/listbudgets.ts +2 -2
  142. package/src/models/operations/listcontacts.ts +2 -2
  143. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  144. package/src/models/operations/listdatasets.ts +2 -2
  145. package/src/models/operations/listdatasources.ts +2 -2
  146. package/src/models/operations/retrievecontact.ts +2 -2
  147. package/src/models/operations/retrievedatapoint.ts +8 -8
  148. package/src/models/operations/retrievedataset.ts +2 -2
  149. package/src/models/operations/retrievedatasource.ts +2 -2
  150. package/src/models/operations/retrievetool.ts +10 -10
  151. package/src/models/operations/runagent.ts +606 -5
  152. package/src/models/operations/streamrunagent.ts +1 -1
  153. package/src/models/operations/updateagent.ts +72 -18
  154. package/src/models/operations/updatebudget.ts +2 -2
  155. package/src/models/operations/updatecontact.ts +2 -2
  156. package/src/models/operations/updatedatapoint.ts +8 -8
  157. package/src/models/operations/updatedataset.ts +2 -2
  158. package/src/models/operations/updatedatasource.ts +2 -2
  159. package/src/models/operations/updateeval.ts +28 -28
  160. package/src/models/operations/updatetool.ts +10 -10
  161. package/src/sdk/agents.ts +19 -1
@@ -25,6 +25,159 @@ export type GetAgentTaskStatus = {
25
25
  message?: any | undefined;
26
26
  };
27
27
 
28
+ export const GetAgentTaskAgentsResponseKind = {
29
+ Message: "message",
30
+ } as const;
31
+ export type GetAgentTaskAgentsResponseKind = ClosedEnum<
32
+ typeof GetAgentTaskAgentsResponseKind
33
+ >;
34
+
35
+ /**
36
+ * Extended A2A message role
37
+ */
38
+ export const GetAgentTaskRole = {
39
+ User: "user",
40
+ Agent: "agent",
41
+ Tool: "tool",
42
+ System: "system",
43
+ } as const;
44
+ /**
45
+ * Extended A2A message role
46
+ */
47
+ export type GetAgentTaskRole = ClosedEnum<typeof GetAgentTaskRole>;
48
+
49
+ export const GetAgentTaskPartsAgentsResponse200Kind = {
50
+ ToolResult: "tool_result",
51
+ } as const;
52
+ export type GetAgentTaskPartsAgentsResponse200Kind = ClosedEnum<
53
+ typeof GetAgentTaskPartsAgentsResponse200Kind
54
+ >;
55
+
56
+ export type Parts5 = {
57
+ kind: GetAgentTaskPartsAgentsResponse200Kind;
58
+ toolCallId: string;
59
+ result?: any | undefined;
60
+ metadata?: { [k: string]: any } | undefined;
61
+ };
62
+
63
+ export const GetAgentTaskPartsAgentsResponseKind = {
64
+ ToolCall: "tool_call",
65
+ } as const;
66
+ export type GetAgentTaskPartsAgentsResponseKind = ClosedEnum<
67
+ typeof GetAgentTaskPartsAgentsResponseKind
68
+ >;
69
+
70
+ export type Parts4 = {
71
+ kind: GetAgentTaskPartsAgentsResponseKind;
72
+ toolName: string;
73
+ toolCallId: string;
74
+ arguments: { [k: string]: any };
75
+ metadata?: { [k: string]: any } | undefined;
76
+ };
77
+
78
+ export const GetAgentTaskPartsAgentsKind = {
79
+ File: "file",
80
+ } as const;
81
+ export type GetAgentTaskPartsAgentsKind = ClosedEnum<
82
+ typeof GetAgentTaskPartsAgentsKind
83
+ >;
84
+
85
+ /**
86
+ * File in URI format. Check in the model's documentation for the supported mime types for the URI format
87
+ */
88
+ export type GetAgentTaskFileFileInURIFormat = {
89
+ /**
90
+ * URL for the File content
91
+ */
92
+ uri: string;
93
+ /**
94
+ * Optional mimeType for the file
95
+ */
96
+ mimeType?: string | undefined;
97
+ /**
98
+ * Optional name for the file
99
+ */
100
+ name?: string | undefined;
101
+ };
102
+
103
+ /**
104
+ * Binary in base64 format. Check in the model's documentation for the supported mime types for the binary format.
105
+ */
106
+ export type GetAgentTaskFileBinaryFormat = {
107
+ /**
108
+ * base64 encoded content of the file
109
+ */
110
+ bytes: string;
111
+ /**
112
+ * Optional mimeType for the file
113
+ */
114
+ mimeType?: string | undefined;
115
+ /**
116
+ * Optional name for the file
117
+ */
118
+ name?: string | undefined;
119
+ };
120
+
121
+ export type PartsFile =
122
+ | GetAgentTaskFileBinaryFormat
123
+ | GetAgentTaskFileFileInURIFormat;
124
+
125
+ export type Parts3 = {
126
+ kind: GetAgentTaskPartsAgentsKind;
127
+ file: GetAgentTaskFileBinaryFormat | GetAgentTaskFileFileInURIFormat;
128
+ metadata?: { [k: string]: any } | undefined;
129
+ };
130
+
131
+ export const GetAgentTaskPartsKind = {
132
+ Data: "data",
133
+ } as const;
134
+ export type GetAgentTaskPartsKind = ClosedEnum<typeof GetAgentTaskPartsKind>;
135
+
136
+ export type Parts2 = {
137
+ kind: GetAgentTaskPartsKind;
138
+ data: { [k: string]: any };
139
+ metadata?: { [k: string]: any } | undefined;
140
+ };
141
+
142
+ export const PartsKind = {
143
+ Text: "text",
144
+ } as const;
145
+ export type PartsKind = ClosedEnum<typeof PartsKind>;
146
+
147
+ export type Parts1 = {
148
+ kind: PartsKind;
149
+ text: string;
150
+ };
151
+
152
+ export type Parts = Parts4 | Parts1 | Parts2 | Parts3 | Parts5;
153
+
154
+ export type History = {
155
+ kind: GetAgentTaskAgentsResponseKind;
156
+ messageId: string;
157
+ /**
158
+ * Extended A2A message role
159
+ */
160
+ role: GetAgentTaskRole;
161
+ parts: Array<Parts4 | Parts1 | Parts2 | Parts3 | Parts5>;
162
+ taskId?: string | undefined;
163
+ contextId?: string | undefined;
164
+ metadata?: { [k: string]: any } | undefined;
165
+ };
166
+
167
+ export const GetAgentTaskAgentsKind = {
168
+ Artifact: "artifact",
169
+ } as const;
170
+ export type GetAgentTaskAgentsKind = ClosedEnum<typeof GetAgentTaskAgentsKind>;
171
+
172
+ export type Artifacts = {
173
+ kind: GetAgentTaskAgentsKind;
174
+ artifactId: string;
175
+ name: string;
176
+ type: string;
177
+ url?: string | undefined;
178
+ data?: any | undefined;
179
+ };
180
+
28
181
  /**
29
182
  * Agent task retrieved
30
183
  */
@@ -33,8 +186,8 @@ export type GetAgentTaskResponseBody = {
33
186
  contextId: string;
34
187
  kind: GetAgentTaskKind;
35
188
  status: GetAgentTaskStatus;
36
- history: Array<any>;
37
- artifacts?: Array<any> | undefined;
189
+ history: Array<History>;
190
+ artifacts?: Array<Artifacts> | undefined;
38
191
  metadata?: { [k: string]: any } | undefined;
39
192
  };
40
193
 
@@ -144,6 +297,595 @@ export function getAgentTaskStatusFromJSON(
144
297
  );
145
298
  }
146
299
 
300
+ /** @internal */
301
+ export const GetAgentTaskAgentsResponseKind$inboundSchema: z.ZodNativeEnum<
302
+ typeof GetAgentTaskAgentsResponseKind
303
+ > = z.nativeEnum(GetAgentTaskAgentsResponseKind);
304
+ /** @internal */
305
+ export const GetAgentTaskAgentsResponseKind$outboundSchema: z.ZodNativeEnum<
306
+ typeof GetAgentTaskAgentsResponseKind
307
+ > = GetAgentTaskAgentsResponseKind$inboundSchema;
308
+
309
+ /** @internal */
310
+ export const GetAgentTaskRole$inboundSchema: z.ZodNativeEnum<
311
+ typeof GetAgentTaskRole
312
+ > = z.nativeEnum(GetAgentTaskRole);
313
+ /** @internal */
314
+ export const GetAgentTaskRole$outboundSchema: z.ZodNativeEnum<
315
+ typeof GetAgentTaskRole
316
+ > = GetAgentTaskRole$inboundSchema;
317
+
318
+ /** @internal */
319
+ export const GetAgentTaskPartsAgentsResponse200Kind$inboundSchema:
320
+ z.ZodNativeEnum<typeof GetAgentTaskPartsAgentsResponse200Kind> = z.nativeEnum(
321
+ GetAgentTaskPartsAgentsResponse200Kind,
322
+ );
323
+ /** @internal */
324
+ export const GetAgentTaskPartsAgentsResponse200Kind$outboundSchema:
325
+ z.ZodNativeEnum<typeof GetAgentTaskPartsAgentsResponse200Kind> =
326
+ GetAgentTaskPartsAgentsResponse200Kind$inboundSchema;
327
+
328
+ /** @internal */
329
+ export const Parts5$inboundSchema: z.ZodType<Parts5, z.ZodTypeDef, unknown> = z
330
+ .object({
331
+ kind: GetAgentTaskPartsAgentsResponse200Kind$inboundSchema,
332
+ tool_call_id: z.string(),
333
+ result: z.any().optional(),
334
+ metadata: z.record(z.any()).optional(),
335
+ }).transform((v) => {
336
+ return remap$(v, {
337
+ "tool_call_id": "toolCallId",
338
+ });
339
+ });
340
+ /** @internal */
341
+ export type Parts5$Outbound = {
342
+ kind: string;
343
+ tool_call_id: string;
344
+ result?: any | undefined;
345
+ metadata?: { [k: string]: any } | undefined;
346
+ };
347
+
348
+ /** @internal */
349
+ export const Parts5$outboundSchema: z.ZodType<
350
+ Parts5$Outbound,
351
+ z.ZodTypeDef,
352
+ Parts5
353
+ > = z.object({
354
+ kind: GetAgentTaskPartsAgentsResponse200Kind$outboundSchema,
355
+ toolCallId: z.string(),
356
+ result: z.any().optional(),
357
+ metadata: z.record(z.any()).optional(),
358
+ }).transform((v) => {
359
+ return remap$(v, {
360
+ toolCallId: "tool_call_id",
361
+ });
362
+ });
363
+
364
+ export function parts5ToJSON(parts5: Parts5): string {
365
+ return JSON.stringify(Parts5$outboundSchema.parse(parts5));
366
+ }
367
+ export function parts5FromJSON(
368
+ jsonString: string,
369
+ ): SafeParseResult<Parts5, SDKValidationError> {
370
+ return safeParse(
371
+ jsonString,
372
+ (x) => Parts5$inboundSchema.parse(JSON.parse(x)),
373
+ `Failed to parse 'Parts5' from JSON`,
374
+ );
375
+ }
376
+
377
+ /** @internal */
378
+ export const GetAgentTaskPartsAgentsResponseKind$inboundSchema: z.ZodNativeEnum<
379
+ typeof GetAgentTaskPartsAgentsResponseKind
380
+ > = z.nativeEnum(GetAgentTaskPartsAgentsResponseKind);
381
+ /** @internal */
382
+ export const GetAgentTaskPartsAgentsResponseKind$outboundSchema:
383
+ z.ZodNativeEnum<typeof GetAgentTaskPartsAgentsResponseKind> =
384
+ GetAgentTaskPartsAgentsResponseKind$inboundSchema;
385
+
386
+ /** @internal */
387
+ export const Parts4$inboundSchema: z.ZodType<Parts4, z.ZodTypeDef, unknown> = z
388
+ .object({
389
+ kind: GetAgentTaskPartsAgentsResponseKind$inboundSchema,
390
+ tool_name: z.string(),
391
+ tool_call_id: z.string(),
392
+ arguments: z.record(z.any()),
393
+ metadata: z.record(z.any()).optional(),
394
+ }).transform((v) => {
395
+ return remap$(v, {
396
+ "tool_name": "toolName",
397
+ "tool_call_id": "toolCallId",
398
+ });
399
+ });
400
+ /** @internal */
401
+ export type Parts4$Outbound = {
402
+ kind: string;
403
+ tool_name: string;
404
+ tool_call_id: string;
405
+ arguments: { [k: string]: any };
406
+ metadata?: { [k: string]: any } | undefined;
407
+ };
408
+
409
+ /** @internal */
410
+ export const Parts4$outboundSchema: z.ZodType<
411
+ Parts4$Outbound,
412
+ z.ZodTypeDef,
413
+ Parts4
414
+ > = z.object({
415
+ kind: GetAgentTaskPartsAgentsResponseKind$outboundSchema,
416
+ toolName: z.string(),
417
+ toolCallId: z.string(),
418
+ arguments: z.record(z.any()),
419
+ metadata: z.record(z.any()).optional(),
420
+ }).transform((v) => {
421
+ return remap$(v, {
422
+ toolName: "tool_name",
423
+ toolCallId: "tool_call_id",
424
+ });
425
+ });
426
+
427
+ export function parts4ToJSON(parts4: Parts4): string {
428
+ return JSON.stringify(Parts4$outboundSchema.parse(parts4));
429
+ }
430
+ export function parts4FromJSON(
431
+ jsonString: string,
432
+ ): SafeParseResult<Parts4, SDKValidationError> {
433
+ return safeParse(
434
+ jsonString,
435
+ (x) => Parts4$inboundSchema.parse(JSON.parse(x)),
436
+ `Failed to parse 'Parts4' from JSON`,
437
+ );
438
+ }
439
+
440
+ /** @internal */
441
+ export const GetAgentTaskPartsAgentsKind$inboundSchema: z.ZodNativeEnum<
442
+ typeof GetAgentTaskPartsAgentsKind
443
+ > = z.nativeEnum(GetAgentTaskPartsAgentsKind);
444
+ /** @internal */
445
+ export const GetAgentTaskPartsAgentsKind$outboundSchema: z.ZodNativeEnum<
446
+ typeof GetAgentTaskPartsAgentsKind
447
+ > = GetAgentTaskPartsAgentsKind$inboundSchema;
448
+
449
+ /** @internal */
450
+ export const GetAgentTaskFileFileInURIFormat$inboundSchema: z.ZodType<
451
+ GetAgentTaskFileFileInURIFormat,
452
+ z.ZodTypeDef,
453
+ unknown
454
+ > = z.object({
455
+ uri: z.string(),
456
+ mimeType: z.string().optional(),
457
+ name: z.string().optional(),
458
+ });
459
+ /** @internal */
460
+ export type GetAgentTaskFileFileInURIFormat$Outbound = {
461
+ uri: string;
462
+ mimeType?: string | undefined;
463
+ name?: string | undefined;
464
+ };
465
+
466
+ /** @internal */
467
+ export const GetAgentTaskFileFileInURIFormat$outboundSchema: z.ZodType<
468
+ GetAgentTaskFileFileInURIFormat$Outbound,
469
+ z.ZodTypeDef,
470
+ GetAgentTaskFileFileInURIFormat
471
+ > = z.object({
472
+ uri: z.string(),
473
+ mimeType: z.string().optional(),
474
+ name: z.string().optional(),
475
+ });
476
+
477
+ export function getAgentTaskFileFileInURIFormatToJSON(
478
+ getAgentTaskFileFileInURIFormat: GetAgentTaskFileFileInURIFormat,
479
+ ): string {
480
+ return JSON.stringify(
481
+ GetAgentTaskFileFileInURIFormat$outboundSchema.parse(
482
+ getAgentTaskFileFileInURIFormat,
483
+ ),
484
+ );
485
+ }
486
+ export function getAgentTaskFileFileInURIFormatFromJSON(
487
+ jsonString: string,
488
+ ): SafeParseResult<GetAgentTaskFileFileInURIFormat, SDKValidationError> {
489
+ return safeParse(
490
+ jsonString,
491
+ (x) => GetAgentTaskFileFileInURIFormat$inboundSchema.parse(JSON.parse(x)),
492
+ `Failed to parse 'GetAgentTaskFileFileInURIFormat' from JSON`,
493
+ );
494
+ }
495
+
496
+ /** @internal */
497
+ export const GetAgentTaskFileBinaryFormat$inboundSchema: z.ZodType<
498
+ GetAgentTaskFileBinaryFormat,
499
+ z.ZodTypeDef,
500
+ unknown
501
+ > = z.object({
502
+ bytes: z.string(),
503
+ mimeType: z.string().optional(),
504
+ name: z.string().optional(),
505
+ });
506
+ /** @internal */
507
+ export type GetAgentTaskFileBinaryFormat$Outbound = {
508
+ bytes: string;
509
+ mimeType?: string | undefined;
510
+ name?: string | undefined;
511
+ };
512
+
513
+ /** @internal */
514
+ export const GetAgentTaskFileBinaryFormat$outboundSchema: z.ZodType<
515
+ GetAgentTaskFileBinaryFormat$Outbound,
516
+ z.ZodTypeDef,
517
+ GetAgentTaskFileBinaryFormat
518
+ > = z.object({
519
+ bytes: z.string(),
520
+ mimeType: z.string().optional(),
521
+ name: z.string().optional(),
522
+ });
523
+
524
+ export function getAgentTaskFileBinaryFormatToJSON(
525
+ getAgentTaskFileBinaryFormat: GetAgentTaskFileBinaryFormat,
526
+ ): string {
527
+ return JSON.stringify(
528
+ GetAgentTaskFileBinaryFormat$outboundSchema.parse(
529
+ getAgentTaskFileBinaryFormat,
530
+ ),
531
+ );
532
+ }
533
+ export function getAgentTaskFileBinaryFormatFromJSON(
534
+ jsonString: string,
535
+ ): SafeParseResult<GetAgentTaskFileBinaryFormat, SDKValidationError> {
536
+ return safeParse(
537
+ jsonString,
538
+ (x) => GetAgentTaskFileBinaryFormat$inboundSchema.parse(JSON.parse(x)),
539
+ `Failed to parse 'GetAgentTaskFileBinaryFormat' from JSON`,
540
+ );
541
+ }
542
+
543
+ /** @internal */
544
+ export const PartsFile$inboundSchema: z.ZodType<
545
+ PartsFile,
546
+ z.ZodTypeDef,
547
+ unknown
548
+ > = z.union([
549
+ z.lazy(() => GetAgentTaskFileBinaryFormat$inboundSchema),
550
+ z.lazy(() => GetAgentTaskFileFileInURIFormat$inboundSchema),
551
+ ]);
552
+ /** @internal */
553
+ export type PartsFile$Outbound =
554
+ | GetAgentTaskFileBinaryFormat$Outbound
555
+ | GetAgentTaskFileFileInURIFormat$Outbound;
556
+
557
+ /** @internal */
558
+ export const PartsFile$outboundSchema: z.ZodType<
559
+ PartsFile$Outbound,
560
+ z.ZodTypeDef,
561
+ PartsFile
562
+ > = z.union([
563
+ z.lazy(() => GetAgentTaskFileBinaryFormat$outboundSchema),
564
+ z.lazy(() => GetAgentTaskFileFileInURIFormat$outboundSchema),
565
+ ]);
566
+
567
+ export function partsFileToJSON(partsFile: PartsFile): string {
568
+ return JSON.stringify(PartsFile$outboundSchema.parse(partsFile));
569
+ }
570
+ export function partsFileFromJSON(
571
+ jsonString: string,
572
+ ): SafeParseResult<PartsFile, SDKValidationError> {
573
+ return safeParse(
574
+ jsonString,
575
+ (x) => PartsFile$inboundSchema.parse(JSON.parse(x)),
576
+ `Failed to parse 'PartsFile' from JSON`,
577
+ );
578
+ }
579
+
580
+ /** @internal */
581
+ export const Parts3$inboundSchema: z.ZodType<Parts3, z.ZodTypeDef, unknown> = z
582
+ .object({
583
+ kind: GetAgentTaskPartsAgentsKind$inboundSchema,
584
+ file: z.union([
585
+ z.lazy(() => GetAgentTaskFileBinaryFormat$inboundSchema),
586
+ z.lazy(() => GetAgentTaskFileFileInURIFormat$inboundSchema),
587
+ ]),
588
+ metadata: z.record(z.any()).optional(),
589
+ });
590
+ /** @internal */
591
+ export type Parts3$Outbound = {
592
+ kind: string;
593
+ file:
594
+ | GetAgentTaskFileBinaryFormat$Outbound
595
+ | GetAgentTaskFileFileInURIFormat$Outbound;
596
+ metadata?: { [k: string]: any } | undefined;
597
+ };
598
+
599
+ /** @internal */
600
+ export const Parts3$outboundSchema: z.ZodType<
601
+ Parts3$Outbound,
602
+ z.ZodTypeDef,
603
+ Parts3
604
+ > = z.object({
605
+ kind: GetAgentTaskPartsAgentsKind$outboundSchema,
606
+ file: z.union([
607
+ z.lazy(() => GetAgentTaskFileBinaryFormat$outboundSchema),
608
+ z.lazy(() => GetAgentTaskFileFileInURIFormat$outboundSchema),
609
+ ]),
610
+ metadata: z.record(z.any()).optional(),
611
+ });
612
+
613
+ export function parts3ToJSON(parts3: Parts3): string {
614
+ return JSON.stringify(Parts3$outboundSchema.parse(parts3));
615
+ }
616
+ export function parts3FromJSON(
617
+ jsonString: string,
618
+ ): SafeParseResult<Parts3, SDKValidationError> {
619
+ return safeParse(
620
+ jsonString,
621
+ (x) => Parts3$inboundSchema.parse(JSON.parse(x)),
622
+ `Failed to parse 'Parts3' from JSON`,
623
+ );
624
+ }
625
+
626
+ /** @internal */
627
+ export const GetAgentTaskPartsKind$inboundSchema: z.ZodNativeEnum<
628
+ typeof GetAgentTaskPartsKind
629
+ > = z.nativeEnum(GetAgentTaskPartsKind);
630
+ /** @internal */
631
+ export const GetAgentTaskPartsKind$outboundSchema: z.ZodNativeEnum<
632
+ typeof GetAgentTaskPartsKind
633
+ > = GetAgentTaskPartsKind$inboundSchema;
634
+
635
+ /** @internal */
636
+ export const Parts2$inboundSchema: z.ZodType<Parts2, z.ZodTypeDef, unknown> = z
637
+ .object({
638
+ kind: GetAgentTaskPartsKind$inboundSchema,
639
+ data: z.record(z.any()),
640
+ metadata: z.record(z.any()).optional(),
641
+ });
642
+ /** @internal */
643
+ export type Parts2$Outbound = {
644
+ kind: string;
645
+ data: { [k: string]: any };
646
+ metadata?: { [k: string]: any } | undefined;
647
+ };
648
+
649
+ /** @internal */
650
+ export const Parts2$outboundSchema: z.ZodType<
651
+ Parts2$Outbound,
652
+ z.ZodTypeDef,
653
+ Parts2
654
+ > = z.object({
655
+ kind: GetAgentTaskPartsKind$outboundSchema,
656
+ data: z.record(z.any()),
657
+ metadata: z.record(z.any()).optional(),
658
+ });
659
+
660
+ export function parts2ToJSON(parts2: Parts2): string {
661
+ return JSON.stringify(Parts2$outboundSchema.parse(parts2));
662
+ }
663
+ export function parts2FromJSON(
664
+ jsonString: string,
665
+ ): SafeParseResult<Parts2, SDKValidationError> {
666
+ return safeParse(
667
+ jsonString,
668
+ (x) => Parts2$inboundSchema.parse(JSON.parse(x)),
669
+ `Failed to parse 'Parts2' from JSON`,
670
+ );
671
+ }
672
+
673
+ /** @internal */
674
+ export const PartsKind$inboundSchema: z.ZodNativeEnum<typeof PartsKind> = z
675
+ .nativeEnum(PartsKind);
676
+ /** @internal */
677
+ export const PartsKind$outboundSchema: z.ZodNativeEnum<typeof PartsKind> =
678
+ PartsKind$inboundSchema;
679
+
680
+ /** @internal */
681
+ export const Parts1$inboundSchema: z.ZodType<Parts1, z.ZodTypeDef, unknown> = z
682
+ .object({
683
+ kind: PartsKind$inboundSchema,
684
+ text: z.string(),
685
+ });
686
+ /** @internal */
687
+ export type Parts1$Outbound = {
688
+ kind: string;
689
+ text: string;
690
+ };
691
+
692
+ /** @internal */
693
+ export const Parts1$outboundSchema: z.ZodType<
694
+ Parts1$Outbound,
695
+ z.ZodTypeDef,
696
+ Parts1
697
+ > = z.object({
698
+ kind: PartsKind$outboundSchema,
699
+ text: z.string(),
700
+ });
701
+
702
+ export function parts1ToJSON(parts1: Parts1): string {
703
+ return JSON.stringify(Parts1$outboundSchema.parse(parts1));
704
+ }
705
+ export function parts1FromJSON(
706
+ jsonString: string,
707
+ ): SafeParseResult<Parts1, SDKValidationError> {
708
+ return safeParse(
709
+ jsonString,
710
+ (x) => Parts1$inboundSchema.parse(JSON.parse(x)),
711
+ `Failed to parse 'Parts1' from JSON`,
712
+ );
713
+ }
714
+
715
+ /** @internal */
716
+ export const Parts$inboundSchema: z.ZodType<Parts, z.ZodTypeDef, unknown> = z
717
+ .union([
718
+ z.lazy(() => Parts4$inboundSchema),
719
+ z.lazy(() => Parts1$inboundSchema),
720
+ z.lazy(() => Parts2$inboundSchema),
721
+ z.lazy(() => Parts3$inboundSchema),
722
+ z.lazy(() => Parts5$inboundSchema),
723
+ ]);
724
+ /** @internal */
725
+ export type Parts$Outbound =
726
+ | Parts4$Outbound
727
+ | Parts1$Outbound
728
+ | Parts2$Outbound
729
+ | Parts3$Outbound
730
+ | Parts5$Outbound;
731
+
732
+ /** @internal */
733
+ export const Parts$outboundSchema: z.ZodType<
734
+ Parts$Outbound,
735
+ z.ZodTypeDef,
736
+ Parts
737
+ > = z.union([
738
+ z.lazy(() => Parts4$outboundSchema),
739
+ z.lazy(() => Parts1$outboundSchema),
740
+ z.lazy(() => Parts2$outboundSchema),
741
+ z.lazy(() => Parts3$outboundSchema),
742
+ z.lazy(() => Parts5$outboundSchema),
743
+ ]);
744
+
745
+ export function partsToJSON(parts: Parts): string {
746
+ return JSON.stringify(Parts$outboundSchema.parse(parts));
747
+ }
748
+ export function partsFromJSON(
749
+ jsonString: string,
750
+ ): SafeParseResult<Parts, SDKValidationError> {
751
+ return safeParse(
752
+ jsonString,
753
+ (x) => Parts$inboundSchema.parse(JSON.parse(x)),
754
+ `Failed to parse 'Parts' from JSON`,
755
+ );
756
+ }
757
+
758
+ /** @internal */
759
+ export const History$inboundSchema: z.ZodType<History, z.ZodTypeDef, unknown> =
760
+ z.object({
761
+ kind: GetAgentTaskAgentsResponseKind$inboundSchema,
762
+ messageId: z.string(),
763
+ role: GetAgentTaskRole$inboundSchema,
764
+ parts: z.array(
765
+ z.union([
766
+ z.lazy(() => Parts4$inboundSchema),
767
+ z.lazy(() => Parts1$inboundSchema),
768
+ z.lazy(() => Parts2$inboundSchema),
769
+ z.lazy(() => Parts3$inboundSchema),
770
+ z.lazy(() => Parts5$inboundSchema),
771
+ ]),
772
+ ),
773
+ taskId: z.string().optional(),
774
+ contextId: z.string().optional(),
775
+ metadata: z.record(z.any()).optional(),
776
+ });
777
+ /** @internal */
778
+ export type History$Outbound = {
779
+ kind: string;
780
+ messageId: string;
781
+ role: string;
782
+ parts: Array<
783
+ | Parts4$Outbound
784
+ | Parts1$Outbound
785
+ | Parts2$Outbound
786
+ | Parts3$Outbound
787
+ | Parts5$Outbound
788
+ >;
789
+ taskId?: string | undefined;
790
+ contextId?: string | undefined;
791
+ metadata?: { [k: string]: any } | undefined;
792
+ };
793
+
794
+ /** @internal */
795
+ export const History$outboundSchema: z.ZodType<
796
+ History$Outbound,
797
+ z.ZodTypeDef,
798
+ History
799
+ > = z.object({
800
+ kind: GetAgentTaskAgentsResponseKind$outboundSchema,
801
+ messageId: z.string(),
802
+ role: GetAgentTaskRole$outboundSchema,
803
+ parts: z.array(
804
+ z.union([
805
+ z.lazy(() => Parts4$outboundSchema),
806
+ z.lazy(() => Parts1$outboundSchema),
807
+ z.lazy(() => Parts2$outboundSchema),
808
+ z.lazy(() => Parts3$outboundSchema),
809
+ z.lazy(() => Parts5$outboundSchema),
810
+ ]),
811
+ ),
812
+ taskId: z.string().optional(),
813
+ contextId: z.string().optional(),
814
+ metadata: z.record(z.any()).optional(),
815
+ });
816
+
817
+ export function historyToJSON(history: History): string {
818
+ return JSON.stringify(History$outboundSchema.parse(history));
819
+ }
820
+ export function historyFromJSON(
821
+ jsonString: string,
822
+ ): SafeParseResult<History, SDKValidationError> {
823
+ return safeParse(
824
+ jsonString,
825
+ (x) => History$inboundSchema.parse(JSON.parse(x)),
826
+ `Failed to parse 'History' from JSON`,
827
+ );
828
+ }
829
+
830
+ /** @internal */
831
+ export const GetAgentTaskAgentsKind$inboundSchema: z.ZodNativeEnum<
832
+ typeof GetAgentTaskAgentsKind
833
+ > = z.nativeEnum(GetAgentTaskAgentsKind);
834
+ /** @internal */
835
+ export const GetAgentTaskAgentsKind$outboundSchema: z.ZodNativeEnum<
836
+ typeof GetAgentTaskAgentsKind
837
+ > = GetAgentTaskAgentsKind$inboundSchema;
838
+
839
+ /** @internal */
840
+ export const Artifacts$inboundSchema: z.ZodType<
841
+ Artifacts,
842
+ z.ZodTypeDef,
843
+ unknown
844
+ > = z.object({
845
+ kind: GetAgentTaskAgentsKind$inboundSchema,
846
+ artifactId: z.string(),
847
+ name: z.string(),
848
+ type: z.string(),
849
+ url: z.string().optional(),
850
+ data: z.any().optional(),
851
+ });
852
+ /** @internal */
853
+ export type Artifacts$Outbound = {
854
+ kind: string;
855
+ artifactId: string;
856
+ name: string;
857
+ type: string;
858
+ url?: string | undefined;
859
+ data?: any | undefined;
860
+ };
861
+
862
+ /** @internal */
863
+ export const Artifacts$outboundSchema: z.ZodType<
864
+ Artifacts$Outbound,
865
+ z.ZodTypeDef,
866
+ Artifacts
867
+ > = z.object({
868
+ kind: GetAgentTaskAgentsKind$outboundSchema,
869
+ artifactId: z.string(),
870
+ name: z.string(),
871
+ type: z.string(),
872
+ url: z.string().optional(),
873
+ data: z.any().optional(),
874
+ });
875
+
876
+ export function artifactsToJSON(artifacts: Artifacts): string {
877
+ return JSON.stringify(Artifacts$outboundSchema.parse(artifacts));
878
+ }
879
+ export function artifactsFromJSON(
880
+ jsonString: string,
881
+ ): SafeParseResult<Artifacts, SDKValidationError> {
882
+ return safeParse(
883
+ jsonString,
884
+ (x) => Artifacts$inboundSchema.parse(JSON.parse(x)),
885
+ `Failed to parse 'Artifacts' from JSON`,
886
+ );
887
+ }
888
+
147
889
  /** @internal */
148
890
  export const GetAgentTaskResponseBody$inboundSchema: z.ZodType<
149
891
  GetAgentTaskResponseBody,
@@ -154,8 +896,8 @@ export const GetAgentTaskResponseBody$inboundSchema: z.ZodType<
154
896
  contextId: z.string(),
155
897
  kind: GetAgentTaskKind$inboundSchema,
156
898
  status: z.lazy(() => GetAgentTaskStatus$inboundSchema),
157
- history: z.array(z.any()),
158
- artifacts: z.array(z.any()).optional(),
899
+ history: z.array(z.lazy(() => History$inboundSchema)),
900
+ artifacts: z.array(z.lazy(() => Artifacts$inboundSchema)).optional(),
159
901
  metadata: z.record(z.any()).optional(),
160
902
  });
161
903
  /** @internal */
@@ -164,8 +906,8 @@ export type GetAgentTaskResponseBody$Outbound = {
164
906
  contextId: string;
165
907
  kind: string;
166
908
  status: GetAgentTaskStatus$Outbound;
167
- history: Array<any>;
168
- artifacts?: Array<any> | undefined;
909
+ history: Array<History$Outbound>;
910
+ artifacts?: Array<Artifacts$Outbound> | undefined;
169
911
  metadata?: { [k: string]: any } | undefined;
170
912
  };
171
913
 
@@ -179,8 +921,8 @@ export const GetAgentTaskResponseBody$outboundSchema: z.ZodType<
179
921
  contextId: z.string(),
180
922
  kind: GetAgentTaskKind$outboundSchema,
181
923
  status: z.lazy(() => GetAgentTaskStatus$outboundSchema),
182
- history: z.array(z.any()),
183
- artifacts: z.array(z.any()).optional(),
924
+ history: z.array(z.lazy(() => History$outboundSchema)),
925
+ artifacts: z.array(z.lazy(() => Artifacts$outboundSchema)).optional(),
184
926
  metadata: z.record(z.any()).optional(),
185
927
  });
186
928