@orq-ai/node 4.1.0-rc.3 → 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.
Files changed (182) hide show
  1. package/bin/mcp-server.js +37458 -38314
  2. package/bin/mcp-server.js.map +59 -54
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +2 -2
  6. package/lib/config.js +2 -2
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/server.js +1 -1
  9. package/models/components/datapart.d.ts +41 -0
  10. package/models/components/datapart.d.ts.map +1 -0
  11. package/models/components/datapart.js +69 -0
  12. package/models/components/datapart.js.map +1 -0
  13. package/models/components/filepart.d.ts +104 -0
  14. package/models/components/filepart.d.ts.map +1 -0
  15. package/models/components/filepart.js +134 -0
  16. package/models/components/filepart.js.map +1 -0
  17. package/models/components/index.d.ts +5 -0
  18. package/models/components/index.d.ts.map +1 -1
  19. package/models/components/index.js +5 -0
  20. package/models/components/index.js.map +1 -1
  21. package/models/components/invokedeploymentrequest.d.ts +8 -8
  22. package/models/components/invokedeploymentrequest.d.ts.map +1 -1
  23. package/models/components/invokedeploymentrequest.js +11 -12
  24. package/models/components/invokedeploymentrequest.js.map +1 -1
  25. package/models/components/textpart.d.ts +31 -0
  26. package/models/components/textpart.d.ts.map +1 -0
  27. package/models/components/textpart.js +67 -0
  28. package/models/components/textpart.js.map +1 -0
  29. package/models/components/toolcallpart.d.ts +45 -0
  30. package/models/components/toolcallpart.d.ts.map +1 -0
  31. package/models/components/toolcallpart.js +84 -0
  32. package/models/components/toolcallpart.js.map +1 -0
  33. package/models/components/toolresultpart.d.ts +39 -0
  34. package/models/components/toolresultpart.d.ts.map +1 -0
  35. package/models/components/toolresultpart.js +80 -0
  36. package/models/components/toolresultpart.js.map +1 -0
  37. package/models/operations/createagentresponserequest.d.ts +66 -42
  38. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  39. package/models/operations/createagentresponserequest.js +90 -44
  40. package/models/operations/createagentresponserequest.js.map +1 -1
  41. package/models/operations/createbudget.js +2 -2
  42. package/models/operations/createcontact.js +2 -2
  43. package/models/operations/createdataset.js +2 -2
  44. package/models/operations/createdatasetitem.js +8 -8
  45. package/models/operations/createdatasource.js +2 -2
  46. package/models/operations/createeval.js +28 -28
  47. package/models/operations/createprompt.d.ts +9 -11
  48. package/models/operations/createprompt.d.ts.map +1 -1
  49. package/models/operations/createprompt.js +9 -11
  50. package/models/operations/createprompt.js.map +1 -1
  51. package/models/operations/createtool.js +12 -12
  52. package/models/operations/deploymentinvoke.d.ts +9 -11
  53. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  54. package/models/operations/deploymentinvoke.js +9 -11
  55. package/models/operations/deploymentinvoke.js.map +1 -1
  56. package/models/operations/deployments.d.ts +9 -11
  57. package/models/operations/deployments.d.ts.map +1 -1
  58. package/models/operations/deployments.js +9 -11
  59. package/models/operations/deployments.js.map +1 -1
  60. package/models/operations/deploymentstream.d.ts +9 -11
  61. package/models/operations/deploymentstream.d.ts.map +1 -1
  62. package/models/operations/deploymentstream.js +9 -11
  63. package/models/operations/deploymentstream.js.map +1 -1
  64. package/models/operations/fileget.js +2 -2
  65. package/models/operations/filelist.js +2 -2
  66. package/models/operations/fileupload.js +2 -2
  67. package/models/operations/getallprompts.d.ts +9 -11
  68. package/models/operations/getallprompts.d.ts.map +1 -1
  69. package/models/operations/getallprompts.js +9 -11
  70. package/models/operations/getallprompts.js.map +1 -1
  71. package/models/operations/getalltools.js +12 -12
  72. package/models/operations/getbudget.js +2 -2
  73. package/models/operations/getevals.js +28 -28
  74. package/models/operations/getoneprompt.d.ts +9 -11
  75. package/models/operations/getoneprompt.d.ts.map +1 -1
  76. package/models/operations/getoneprompt.js +9 -11
  77. package/models/operations/getoneprompt.js.map +1 -1
  78. package/models/operations/getpromptversion.d.ts +9 -11
  79. package/models/operations/getpromptversion.d.ts.map +1 -1
  80. package/models/operations/getpromptversion.js +9 -11
  81. package/models/operations/getpromptversion.js.map +1 -1
  82. package/models/operations/invokeagent.d.ts +63 -283
  83. package/models/operations/invokeagent.d.ts.map +1 -1
  84. package/models/operations/invokeagent.js +73 -293
  85. package/models/operations/invokeagent.js.map +1 -1
  86. package/models/operations/listbudgets.js +2 -2
  87. package/models/operations/listcontacts.js +2 -2
  88. package/models/operations/listdatasetdatapoints.js +8 -8
  89. package/models/operations/listdatasets.js +2 -2
  90. package/models/operations/listdatasources.js +2 -2
  91. package/models/operations/listpromptversions.d.ts +9 -11
  92. package/models/operations/listpromptversions.d.ts.map +1 -1
  93. package/models/operations/listpromptversions.js +9 -11
  94. package/models/operations/listpromptversions.js.map +1 -1
  95. package/models/operations/retrievecontact.js +2 -2
  96. package/models/operations/retrievedatapoint.js +8 -8
  97. package/models/operations/retrievedataset.js +2 -2
  98. package/models/operations/retrievedatasource.js +2 -2
  99. package/models/operations/retrievetool.js +12 -12
  100. package/models/operations/runagent.d.ts +59 -279
  101. package/models/operations/runagent.d.ts.map +1 -1
  102. package/models/operations/runagent.js +72 -292
  103. package/models/operations/runagent.js.map +1 -1
  104. package/models/operations/streamagent.d.ts +212 -1003
  105. package/models/operations/streamagent.d.ts.map +1 -1
  106. package/models/operations/streamagent.js +227 -1017
  107. package/models/operations/streamagent.js.map +1 -1
  108. package/models/operations/streamrunagent.d.ts +215 -1006
  109. package/models/operations/streamrunagent.d.ts.map +1 -1
  110. package/models/operations/streamrunagent.js +236 -1026
  111. package/models/operations/streamrunagent.js.map +1 -1
  112. package/models/operations/updatebudget.js +2 -2
  113. package/models/operations/updatecontact.js +2 -2
  114. package/models/operations/updatedatapoint.js +8 -8
  115. package/models/operations/updatedataset.js +2 -2
  116. package/models/operations/updatedatasource.js +2 -2
  117. package/models/operations/updateeval.js +28 -28
  118. package/models/operations/updatememorystore.d.ts +9 -20
  119. package/models/operations/updatememorystore.d.ts.map +1 -1
  120. package/models/operations/updatememorystore.js +9 -14
  121. package/models/operations/updatememorystore.js.map +1 -1
  122. package/models/operations/updateprompt.d.ts +18 -22
  123. package/models/operations/updateprompt.d.ts.map +1 -1
  124. package/models/operations/updateprompt.js +18 -22
  125. package/models/operations/updateprompt.js.map +1 -1
  126. package/models/operations/updatetool.js +14 -14
  127. package/package.json +1 -1
  128. package/src/lib/config.ts +2 -2
  129. package/src/mcp-server/mcp-server.ts +1 -1
  130. package/src/mcp-server/server.ts +1 -1
  131. package/src/models/components/datapart.ts +71 -0
  132. package/src/models/components/filepart.ts +231 -0
  133. package/src/models/components/index.ts +5 -0
  134. package/src/models/components/invokedeploymentrequest.ts +34 -25
  135. package/src/models/components/textpart.ts +68 -0
  136. package/src/models/components/toolcallpart.ts +92 -0
  137. package/src/models/components/toolresultpart.ts +86 -0
  138. package/src/models/operations/createagentresponserequest.ts +188 -95
  139. package/src/models/operations/createbudget.ts +2 -2
  140. package/src/models/operations/createcontact.ts +2 -2
  141. package/src/models/operations/createdataset.ts +2 -2
  142. package/src/models/operations/createdatasetitem.ts +8 -8
  143. package/src/models/operations/createdatasource.ts +2 -2
  144. package/src/models/operations/createeval.ts +28 -28
  145. package/src/models/operations/createprompt.ts +9 -11
  146. package/src/models/operations/createtool.ts +12 -12
  147. package/src/models/operations/deploymentinvoke.ts +9 -11
  148. package/src/models/operations/deployments.ts +9 -11
  149. package/src/models/operations/deploymentstream.ts +9 -11
  150. package/src/models/operations/fileget.ts +2 -2
  151. package/src/models/operations/filelist.ts +2 -2
  152. package/src/models/operations/fileupload.ts +2 -2
  153. package/src/models/operations/getallprompts.ts +9 -11
  154. package/src/models/operations/getalltools.ts +12 -12
  155. package/src/models/operations/getbudget.ts +2 -2
  156. package/src/models/operations/getevals.ts +28 -28
  157. package/src/models/operations/getoneprompt.ts +9 -11
  158. package/src/models/operations/getpromptversion.ts +9 -11
  159. package/src/models/operations/invokeagent.ts +158 -682
  160. package/src/models/operations/listbudgets.ts +2 -2
  161. package/src/models/operations/listcontacts.ts +2 -2
  162. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  163. package/src/models/operations/listdatasets.ts +2 -2
  164. package/src/models/operations/listdatasources.ts +2 -2
  165. package/src/models/operations/listpromptversions.ts +9 -11
  166. package/src/models/operations/retrievecontact.ts +2 -2
  167. package/src/models/operations/retrievedatapoint.ts +8 -8
  168. package/src/models/operations/retrievedataset.ts +2 -2
  169. package/src/models/operations/retrievedatasource.ts +2 -2
  170. package/src/models/operations/retrievetool.ts +12 -12
  171. package/src/models/operations/runagent.ts +143 -697
  172. package/src/models/operations/streamagent.ts +2222 -4559
  173. package/src/models/operations/streamrunagent.ts +2189 -4615
  174. package/src/models/operations/updatebudget.ts +2 -2
  175. package/src/models/operations/updatecontact.ts +2 -2
  176. package/src/models/operations/updatedatapoint.ts +8 -8
  177. package/src/models/operations/updatedataset.ts +2 -2
  178. package/src/models/operations/updatedatasource.ts +2 -2
  179. package/src/models/operations/updateeval.ts +28 -28
  180. package/src/models/operations/updatememorystore.ts +9 -20
  181. package/src/models/operations/updateprompt.ts +18 -22
  182. package/src/models/operations/updatetool.ts +14 -14
@@ -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
  /**
@@ -36,27 +37,25 @@ export type RoleUserMessage = ClosedEnum<typeof RoleUserMessage>;
36
37
  */
37
38
  export type CreateAgentResponseRequestRole = RoleUserMessage | RoleToolMessage;
38
39
 
39
- export const CreateAgentResponseRequestPublicMessagePartKind = {
40
+ export const PublicMessagePartKind = {
40
41
  ToolResult: "tool_result",
41
42
  } as const;
42
- export type CreateAgentResponseRequestPublicMessagePartKind = ClosedEnum<
43
- typeof CreateAgentResponseRequestPublicMessagePartKind
44
- >;
43
+ export type PublicMessagePartKind = ClosedEnum<typeof PublicMessagePartKind>;
45
44
 
46
45
  /**
47
46
  * 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.
48
47
  */
49
48
  export type ToolResultPart = {
50
- kind: CreateAgentResponseRequestPublicMessagePartKind;
49
+ kind: PublicMessagePartKind;
51
50
  toolCallId: string;
52
51
  result?: any | undefined;
53
52
  metadata?: { [k: string]: any } | undefined;
54
53
  };
55
54
 
56
- export const PublicMessagePartKind = {
55
+ export const Kind = {
57
56
  File: "file",
58
57
  } as const;
59
- export type PublicMessagePartKind = ClosedEnum<typeof PublicMessagePartKind>;
58
+ export type Kind = ClosedEnum<typeof Kind>;
60
59
 
61
60
  /**
62
61
  * File in URI format. Check in the model's documentation for the supported mime types for the URI format
@@ -100,28 +99,15 @@ export type PublicMessagePartFile = BinaryFormat | FileInURIFormat;
100
99
  * File attachment part. Use this to send files (images, documents, etc.) to the agent for processing.
101
100
  */
102
101
  export type FilePart = {
103
- kind: PublicMessagePartKind;
102
+ kind: Kind;
104
103
  file: BinaryFormat | FileInURIFormat;
105
104
  metadata?: { [k: string]: any } | undefined;
106
105
  };
107
106
 
108
- export const Kind = {
109
- Text: "text",
110
- } as const;
111
- export type Kind = ClosedEnum<typeof Kind>;
112
-
113
- /**
114
- * Text content part. Use this to send text messages to the agent.
115
- */
116
- export type TextPart = {
117
- kind: Kind;
118
- text: string;
119
- };
120
-
121
107
  /**
122
108
  * 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.
123
109
  */
124
- export type PublicMessagePart = TextPart | FilePart | ToolResultPart;
110
+ export type PublicMessagePart = components.TextPart | FilePart | ToolResultPart;
125
111
 
126
112
  /**
127
113
  * The A2A message to send to the agent (user input or tool results)
@@ -138,7 +124,7 @@ export type A2AMessage = {
138
124
  /**
139
125
  * A2A message parts (text, file, or tool_result only)
140
126
  */
141
- parts: Array<TextPart | FilePart | ToolResultPart>;
127
+ parts: Array<components.TextPart | FilePart | ToolResultPart>;
142
128
  };
143
129
 
144
130
  /**
@@ -248,10 +234,23 @@ export type CreateAgentResponseRequestAgentsResponsesRole = ClosedEnum<
248
234
  typeof CreateAgentResponseRequestAgentsResponsesRole
249
235
  >;
250
236
 
237
+ export type Parts =
238
+ | (components.ToolCallPart & { kind: "tool_call" })
239
+ | (components.TextPart & { kind: "text" })
240
+ | (components.DataPart & { kind: "data" })
241
+ | (components.FilePart & { kind: "file" })
242
+ | (components.ToolResultPart & { kind: "tool_result" });
243
+
251
244
  export type Output = {
252
245
  messageId: string;
253
246
  role: CreateAgentResponseRequestAgentsResponsesRole;
254
- parts: Array<any>;
247
+ parts: Array<
248
+ | (components.ToolCallPart & { kind: "tool_call" })
249
+ | (components.TextPart & { kind: "text" })
250
+ | (components.DataPart & { kind: "data" })
251
+ | (components.FilePart & { kind: "file" })
252
+ | (components.ToolResultPart & { kind: "tool_result" })
253
+ >;
255
254
  metadata?: { [k: string]: any } | undefined;
256
255
  };
257
256
 
@@ -377,13 +376,13 @@ export function createAgentResponseRequestRoleFromJSON(
377
376
  }
378
377
 
379
378
  /** @internal */
380
- export const CreateAgentResponseRequestPublicMessagePartKind$inboundSchema:
381
- z.ZodNativeEnum<typeof CreateAgentResponseRequestPublicMessagePartKind> = z
382
- .nativeEnum(CreateAgentResponseRequestPublicMessagePartKind);
379
+ export const PublicMessagePartKind$inboundSchema: z.ZodNativeEnum<
380
+ typeof PublicMessagePartKind
381
+ > = z.nativeEnum(PublicMessagePartKind);
383
382
  /** @internal */
384
- export const CreateAgentResponseRequestPublicMessagePartKind$outboundSchema:
385
- z.ZodNativeEnum<typeof CreateAgentResponseRequestPublicMessagePartKind> =
386
- CreateAgentResponseRequestPublicMessagePartKind$inboundSchema;
383
+ export const PublicMessagePartKind$outboundSchema: z.ZodNativeEnum<
384
+ typeof PublicMessagePartKind
385
+ > = PublicMessagePartKind$inboundSchema;
387
386
 
388
387
  /** @internal */
389
388
  export const ToolResultPart$inboundSchema: z.ZodType<
@@ -391,7 +390,7 @@ export const ToolResultPart$inboundSchema: z.ZodType<
391
390
  z.ZodTypeDef,
392
391
  unknown
393
392
  > = z.object({
394
- kind: CreateAgentResponseRequestPublicMessagePartKind$inboundSchema,
393
+ kind: PublicMessagePartKind$inboundSchema,
395
394
  tool_call_id: z.string(),
396
395
  result: z.any().optional(),
397
396
  metadata: z.record(z.any()).optional(),
@@ -414,7 +413,7 @@ export const ToolResultPart$outboundSchema: z.ZodType<
414
413
  z.ZodTypeDef,
415
414
  ToolResultPart
416
415
  > = z.object({
417
- kind: CreateAgentResponseRequestPublicMessagePartKind$outboundSchema,
416
+ kind: PublicMessagePartKind$outboundSchema,
418
417
  toolCallId: z.string(),
419
418
  result: z.any().optional(),
420
419
  metadata: z.record(z.any()).optional(),
@@ -438,13 +437,12 @@ export function toolResultPartFromJSON(
438
437
  }
439
438
 
440
439
  /** @internal */
441
- export const PublicMessagePartKind$inboundSchema: z.ZodNativeEnum<
442
- typeof PublicMessagePartKind
443
- > = z.nativeEnum(PublicMessagePartKind);
440
+ export const Kind$inboundSchema: z.ZodNativeEnum<typeof Kind> = z.nativeEnum(
441
+ Kind,
442
+ );
444
443
  /** @internal */
445
- export const PublicMessagePartKind$outboundSchema: z.ZodNativeEnum<
446
- typeof PublicMessagePartKind
447
- > = PublicMessagePartKind$inboundSchema;
444
+ export const Kind$outboundSchema: z.ZodNativeEnum<typeof Kind> =
445
+ Kind$inboundSchema;
448
446
 
449
447
  /** @internal */
450
448
  export const FileInURIFormat$inboundSchema: z.ZodType<
@@ -577,7 +575,7 @@ export const FilePart$inboundSchema: z.ZodType<
577
575
  z.ZodTypeDef,
578
576
  unknown
579
577
  > = z.object({
580
- kind: PublicMessagePartKind$inboundSchema,
578
+ kind: Kind$inboundSchema,
581
579
  file: z.union([
582
580
  z.lazy(() => BinaryFormat$inboundSchema),
583
581
  z.lazy(() => FileInURIFormat$inboundSchema),
@@ -597,7 +595,7 @@ export const FilePart$outboundSchema: z.ZodType<
597
595
  z.ZodTypeDef,
598
596
  FilePart
599
597
  > = z.object({
600
- kind: PublicMessagePartKind$outboundSchema,
598
+ kind: Kind$outboundSchema,
601
599
  file: z.union([
602
600
  z.lazy(() => BinaryFormat$outboundSchema),
603
601
  z.lazy(() => FileInURIFormat$outboundSchema),
@@ -618,65 +616,19 @@ export function filePartFromJSON(
618
616
  );
619
617
  }
620
618
 
621
- /** @internal */
622
- export const Kind$inboundSchema: z.ZodNativeEnum<typeof Kind> = z.nativeEnum(
623
- Kind,
624
- );
625
- /** @internal */
626
- export const Kind$outboundSchema: z.ZodNativeEnum<typeof Kind> =
627
- Kind$inboundSchema;
628
-
629
- /** @internal */
630
- export const TextPart$inboundSchema: z.ZodType<
631
- TextPart,
632
- z.ZodTypeDef,
633
- unknown
634
- > = z.object({
635
- kind: Kind$inboundSchema,
636
- text: z.string(),
637
- });
638
- /** @internal */
639
- export type TextPart$Outbound = {
640
- kind: string;
641
- text: string;
642
- };
643
-
644
- /** @internal */
645
- export const TextPart$outboundSchema: z.ZodType<
646
- TextPart$Outbound,
647
- z.ZodTypeDef,
648
- TextPart
649
- > = z.object({
650
- kind: Kind$outboundSchema,
651
- text: z.string(),
652
- });
653
-
654
- export function textPartToJSON(textPart: TextPart): string {
655
- return JSON.stringify(TextPart$outboundSchema.parse(textPart));
656
- }
657
- export function textPartFromJSON(
658
- jsonString: string,
659
- ): SafeParseResult<TextPart, SDKValidationError> {
660
- return safeParse(
661
- jsonString,
662
- (x) => TextPart$inboundSchema.parse(JSON.parse(x)),
663
- `Failed to parse 'TextPart' from JSON`,
664
- );
665
- }
666
-
667
619
  /** @internal */
668
620
  export const PublicMessagePart$inboundSchema: z.ZodType<
669
621
  PublicMessagePart,
670
622
  z.ZodTypeDef,
671
623
  unknown
672
624
  > = z.union([
673
- z.lazy(() => TextPart$inboundSchema),
625
+ components.TextPart$inboundSchema,
674
626
  z.lazy(() => FilePart$inboundSchema),
675
627
  z.lazy(() => ToolResultPart$inboundSchema),
676
628
  ]);
677
629
  /** @internal */
678
630
  export type PublicMessagePart$Outbound =
679
- | TextPart$Outbound
631
+ | components.TextPart$Outbound
680
632
  | FilePart$Outbound
681
633
  | ToolResultPart$Outbound;
682
634
 
@@ -686,7 +638,7 @@ export const PublicMessagePart$outboundSchema: z.ZodType<
686
638
  z.ZodTypeDef,
687
639
  PublicMessagePart
688
640
  > = z.union([
689
- z.lazy(() => TextPart$outboundSchema),
641
+ components.TextPart$outboundSchema,
690
642
  z.lazy(() => FilePart$outboundSchema),
691
643
  z.lazy(() => ToolResultPart$outboundSchema),
692
644
  ]);
@@ -718,7 +670,7 @@ export const A2AMessage$inboundSchema: z.ZodType<
718
670
  role: z.union([RoleUserMessage$inboundSchema, RoleToolMessage$inboundSchema]),
719
671
  parts: z.array(
720
672
  z.union([
721
- z.lazy(() => TextPart$inboundSchema),
673
+ components.TextPart$inboundSchema,
722
674
  z.lazy(() => FilePart$inboundSchema),
723
675
  z.lazy(() => ToolResultPart$inboundSchema),
724
676
  ]),
@@ -728,7 +680,9 @@ export const A2AMessage$inboundSchema: z.ZodType<
728
680
  export type A2AMessage$Outbound = {
729
681
  messageId?: string | undefined;
730
682
  role: string | string;
731
- parts: Array<TextPart$Outbound | FilePart$Outbound | ToolResultPart$Outbound>;
683
+ parts: Array<
684
+ components.TextPart$Outbound | FilePart$Outbound | ToolResultPart$Outbound
685
+ >;
732
686
  };
733
687
 
734
688
  /** @internal */
@@ -744,7 +698,7 @@ export const A2AMessage$outboundSchema: z.ZodType<
744
698
  ]),
745
699
  parts: z.array(
746
700
  z.union([
747
- z.lazy(() => TextPart$outboundSchema),
701
+ components.TextPart$outboundSchema,
748
702
  z.lazy(() => FilePart$outboundSchema),
749
703
  z.lazy(() => ToolResultPart$outboundSchema),
750
704
  ]),
@@ -1045,19 +999,130 @@ export const CreateAgentResponseRequestAgentsResponsesRole$outboundSchema:
1045
999
  z.ZodNativeEnum<typeof CreateAgentResponseRequestAgentsResponsesRole> =
1046
1000
  CreateAgentResponseRequestAgentsResponsesRole$inboundSchema;
1047
1001
 
1002
+ /** @internal */
1003
+ export const Parts$inboundSchema: z.ZodType<Parts, z.ZodTypeDef, unknown> = z
1004
+ .union([
1005
+ components.ToolCallPart$inboundSchema.and(
1006
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
1007
+ kind: v.kind,
1008
+ })),
1009
+ ),
1010
+ components.TextPart$inboundSchema.and(
1011
+ z.object({ kind: z.literal("text") }).transform((v) => ({
1012
+ kind: v.kind,
1013
+ })),
1014
+ ),
1015
+ components.DataPart$inboundSchema.and(
1016
+ z.object({ kind: z.literal("data") }).transform((v) => ({
1017
+ kind: v.kind,
1018
+ })),
1019
+ ),
1020
+ components.FilePart$inboundSchema.and(
1021
+ z.object({ kind: z.literal("file") }).transform((v) => ({
1022
+ kind: v.kind,
1023
+ })),
1024
+ ),
1025
+ components.ToolResultPart$inboundSchema.and(
1026
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
1027
+ kind: v.kind,
1028
+ })),
1029
+ ),
1030
+ ]);
1031
+ /** @internal */
1032
+ export type Parts$Outbound =
1033
+ | (components.ToolCallPart$Outbound & { kind: "tool_call" })
1034
+ | (components.TextPart$Outbound & { kind: "text" })
1035
+ | (components.DataPart$Outbound & { kind: "data" })
1036
+ | (components.FilePart$Outbound & { kind: "file" })
1037
+ | (components.ToolResultPart$Outbound & { kind: "tool_result" });
1038
+
1039
+ /** @internal */
1040
+ export const Parts$outboundSchema: z.ZodType<
1041
+ Parts$Outbound,
1042
+ z.ZodTypeDef,
1043
+ Parts
1044
+ > = z.union([
1045
+ components.ToolCallPart$outboundSchema.and(
1046
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
1047
+ kind: v.kind,
1048
+ })),
1049
+ ),
1050
+ components.TextPart$outboundSchema.and(
1051
+ z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind })),
1052
+ ),
1053
+ components.DataPart$outboundSchema.and(
1054
+ z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind })),
1055
+ ),
1056
+ components.FilePart$outboundSchema.and(
1057
+ z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind })),
1058
+ ),
1059
+ components.ToolResultPart$outboundSchema.and(
1060
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
1061
+ kind: v.kind,
1062
+ })),
1063
+ ),
1064
+ ]);
1065
+
1066
+ export function partsToJSON(parts: Parts): string {
1067
+ return JSON.stringify(Parts$outboundSchema.parse(parts));
1068
+ }
1069
+ export function partsFromJSON(
1070
+ jsonString: string,
1071
+ ): SafeParseResult<Parts, SDKValidationError> {
1072
+ return safeParse(
1073
+ jsonString,
1074
+ (x) => Parts$inboundSchema.parse(JSON.parse(x)),
1075
+ `Failed to parse 'Parts' from JSON`,
1076
+ );
1077
+ }
1078
+
1048
1079
  /** @internal */
1049
1080
  export const Output$inboundSchema: z.ZodType<Output, z.ZodTypeDef, unknown> = z
1050
1081
  .object({
1051
1082
  messageId: z.string(),
1052
1083
  role: CreateAgentResponseRequestAgentsResponsesRole$inboundSchema,
1053
- parts: z.array(z.any()),
1084
+ parts: z.array(
1085
+ z.union([
1086
+ components.ToolCallPart$inboundSchema.and(
1087
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
1088
+ kind: v.kind,
1089
+ })),
1090
+ ),
1091
+ components.TextPart$inboundSchema.and(
1092
+ z.object({ kind: z.literal("text") }).transform((v) => ({
1093
+ kind: v.kind,
1094
+ })),
1095
+ ),
1096
+ components.DataPart$inboundSchema.and(
1097
+ z.object({ kind: z.literal("data") }).transform((v) => ({
1098
+ kind: v.kind,
1099
+ })),
1100
+ ),
1101
+ components.FilePart$inboundSchema.and(
1102
+ z.object({ kind: z.literal("file") }).transform((v) => ({
1103
+ kind: v.kind,
1104
+ })),
1105
+ ),
1106
+ components.ToolResultPart$inboundSchema.and(
1107
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
1108
+ kind: v.kind,
1109
+ })),
1110
+ ),
1111
+ ]),
1112
+ ),
1054
1113
  metadata: z.record(z.any()).optional(),
1055
1114
  });
1056
1115
  /** @internal */
1057
1116
  export type Output$Outbound = {
1058
1117
  messageId: string;
1059
1118
  role: string;
1060
- parts: Array<any>;
1119
+ parts: Array<
1120
+ | (components.ToolCallPart$Outbound & { kind: "tool_call" })
1121
+ | (components.TextPart$Outbound & { kind: "text" })
1122
+ | (components.DataPart$Outbound & { kind: "data" })
1123
+ | (components.FilePart$Outbound & { kind: "file" })
1124
+ | (components.ToolResultPart$Outbound & { kind: "tool_result" })
1125
+ >;
1061
1126
  metadata?: { [k: string]: any } | undefined;
1062
1127
  };
1063
1128
 
@@ -1069,7 +1134,35 @@ export const Output$outboundSchema: z.ZodType<
1069
1134
  > = z.object({
1070
1135
  messageId: z.string(),
1071
1136
  role: CreateAgentResponseRequestAgentsResponsesRole$outboundSchema,
1072
- parts: z.array(z.any()),
1137
+ parts: z.array(
1138
+ z.union([
1139
+ components.ToolCallPart$outboundSchema.and(
1140
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
1141
+ kind: v.kind,
1142
+ })),
1143
+ ),
1144
+ components.TextPart$outboundSchema.and(
1145
+ z.object({ kind: z.literal("text") }).transform((v) => ({
1146
+ kind: v.kind,
1147
+ })),
1148
+ ),
1149
+ components.DataPart$outboundSchema.and(
1150
+ z.object({ kind: z.literal("data") }).transform((v) => ({
1151
+ kind: v.kind,
1152
+ })),
1153
+ ),
1154
+ components.FilePart$outboundSchema.and(
1155
+ z.object({ kind: z.literal("file") }).transform((v) => ({
1156
+ kind: v.kind,
1157
+ })),
1158
+ ),
1159
+ components.ToolResultPart$outboundSchema.and(
1160
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
1161
+ kind: v.kind,
1162
+ })),
1163
+ ),
1164
+ ]),
1165
+ ),
1073
1166
  metadata: z.record(z.any()).optional(),
1074
1167
  });
1075
1168
 
@@ -516,7 +516,7 @@ export const CreateBudgetResponseBody$inboundSchema: z.ZodType<
516
516
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
517
517
  .optional(),
518
518
  updated: z.string().datetime({ offset: true }).default(
519
- "2025-11-25T09:21:48.673Z",
519
+ "2025-11-25T12:44:28.109Z",
520
520
  ).transform(v => new Date(v)),
521
521
  }).transform((v) => {
522
522
  return remap$(v, {
@@ -553,7 +553,7 @@ export const CreateBudgetResponseBody$outboundSchema: z.ZodType<
553
553
  isActive: z.boolean(),
554
554
  consumption: z.lazy(() => Consumption$outboundSchema).optional(),
555
555
  created: z.date().transform(v => v.toISOString()).optional(),
556
- updated: z.date().default(() => new Date("2025-11-25T09:21:48.673Z"))
556
+ updated: z.date().default(() => new Date("2025-11-25T12:44:28.109Z"))
557
557
  .transform(v => v.toISOString()),
558
558
  }).transform((v) => {
559
559
  return remap$(v, {
@@ -167,7 +167,7 @@ export const CreateContactResponseBody$inboundSchema: z.ZodType<
167
167
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
168
168
  .optional(),
169
169
  updated: z.string().datetime({ offset: true }).default(
170
- "2025-11-25T09:21:47.602Z",
170
+ "2025-11-25T12:44:27.774Z",
171
171
  ).transform(v => new Date(v)),
172
172
  }).transform((v) => {
173
173
  return remap$(v, {
@@ -207,7 +207,7 @@ export const CreateContactResponseBody$outboundSchema: z.ZodType<
207
207
  tags: z.array(z.string()).optional(),
208
208
  metadata: z.record(z.any()).optional(),
209
209
  created: z.date().transform(v => v.toISOString()).optional(),
210
- updated: z.date().default(() => new Date("2025-11-25T09:21:47.602Z"))
210
+ updated: z.date().default(() => new Date("2025-11-25T12:44:27.774Z"))
211
211
  .transform(v => v.toISOString()),
212
212
  }).transform((v) => {
213
213
  return remap$(v, {
@@ -187,7 +187,7 @@ export const CreateDatasetResponseBody$inboundSchema: z.ZodType<
187
187
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
188
188
  .optional(),
189
189
  updated: z.string().datetime({ offset: true }).default(
190
- "2025-11-25T09:21:47.602Z",
190
+ "2025-11-25T12:44:27.774Z",
191
191
  ).transform(v => new Date(v)),
192
192
  }).transform((v) => {
193
193
  return remap$(v, {
@@ -226,7 +226,7 @@ export const CreateDatasetResponseBody$outboundSchema: z.ZodType<
226
226
  createdById: z.string().optional(),
227
227
  updatedById: z.string().optional(),
228
228
  created: z.date().transform(v => v.toISOString()).optional(),
229
- updated: z.date().default(() => new Date("2025-11-25T09:21:47.602Z"))
229
+ updated: z.date().default(() => new Date("2025-11-25T12:44:27.774Z"))
230
230
  .transform(v => v.toISOString()),
231
231
  }).transform((v) => {
232
232
  return remap$(v, {
@@ -4929,7 +4929,7 @@ export const Evaluations3$inboundSchema: z.ZodType<
4929
4929
  source: CreateDatasetItemEvaluationsSource$inboundSchema.default("orq"),
4930
4930
  reviewed_by_id: z.string(),
4931
4931
  reviewed_at: z.string().datetime({ offset: true }).default(
4932
- "2025-11-25T09:22:00.058Z",
4932
+ "2025-11-25T12:44:38.542Z",
4933
4933
  ).transform(v => new Date(v)),
4934
4934
  type: CreateDatasetItemEvaluationsDatasetsType$inboundSchema,
4935
4935
  values: z.array(z.string()),
@@ -4964,7 +4964,7 @@ export const Evaluations3$outboundSchema: z.ZodType<
4964
4964
  humanReviewId: z.string(),
4965
4965
  source: CreateDatasetItemEvaluationsSource$outboundSchema.default("orq"),
4966
4966
  reviewedById: z.string(),
4967
- reviewedAt: z.date().default(() => new Date("2025-11-25T09:22:00.058Z"))
4967
+ reviewedAt: z.date().default(() => new Date("2025-11-25T12:44:38.542Z"))
4968
4968
  .transform(v => v.toISOString()),
4969
4969
  type: CreateDatasetItemEvaluationsDatasetsType$outboundSchema,
4970
4970
  values: z.array(z.string()),
@@ -5029,7 +5029,7 @@ export const Evaluations2$inboundSchema: z.ZodType<
5029
5029
  source: EvaluationsSource$inboundSchema.default("orq"),
5030
5030
  reviewed_by_id: z.string(),
5031
5031
  reviewed_at: z.string().datetime({ offset: true }).default(
5032
- "2025-11-25T09:22:00.058Z",
5032
+ "2025-11-25T12:44:38.541Z",
5033
5033
  ).transform(v => new Date(v)),
5034
5034
  type: CreateDatasetItemEvaluationsType$inboundSchema,
5035
5035
  value: z.number(),
@@ -5064,7 +5064,7 @@ export const Evaluations2$outboundSchema: z.ZodType<
5064
5064
  humanReviewId: z.string(),
5065
5065
  source: EvaluationsSource$outboundSchema.default("orq"),
5066
5066
  reviewedById: z.string(),
5067
- reviewedAt: z.date().default(() => new Date("2025-11-25T09:22:00.058Z"))
5067
+ reviewedAt: z.date().default(() => new Date("2025-11-25T12:44:38.541Z"))
5068
5068
  .transform(v => v.toISOString()),
5069
5069
  type: CreateDatasetItemEvaluationsType$outboundSchema,
5070
5070
  value: z.number(),
@@ -5127,7 +5127,7 @@ export const Evaluations1$inboundSchema: z.ZodType<
5127
5127
  source: Source$inboundSchema.default("orq"),
5128
5128
  reviewed_by_id: z.string(),
5129
5129
  reviewed_at: z.string().datetime({ offset: true }).default(
5130
- "2025-11-25T09:22:00.058Z",
5130
+ "2025-11-25T12:44:38.540Z",
5131
5131
  ).transform(v => new Date(v)),
5132
5132
  type: EvaluationsType$inboundSchema,
5133
5133
  value: z.string(),
@@ -5162,7 +5162,7 @@ export const Evaluations1$outboundSchema: z.ZodType<
5162
5162
  humanReviewId: z.string(),
5163
5163
  source: Source$outboundSchema.default("orq"),
5164
5164
  reviewedById: z.string(),
5165
- reviewedAt: z.date().default(() => new Date("2025-11-25T09:22:00.058Z"))
5165
+ reviewedAt: z.date().default(() => new Date("2025-11-25T12:44:38.540Z"))
5166
5166
  .transform(v => v.toISOString()),
5167
5167
  type: EvaluationsType$outboundSchema,
5168
5168
  value: z.string(),
@@ -5267,7 +5267,7 @@ export const CreateDatasetItemResponseBody$inboundSchema: z.ZodType<
5267
5267
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
5268
5268
  .optional(),
5269
5269
  updated: z.string().datetime({ offset: true }).default(
5270
- "2025-11-25T09:21:47.602Z",
5270
+ "2025-11-25T12:44:27.774Z",
5271
5271
  ).transform(v => new Date(v)),
5272
5272
  }).transform((v) => {
5273
5273
  return remap$(v, {
@@ -5345,7 +5345,7 @@ export const CreateDatasetItemResponseBody$outboundSchema: z.ZodType<
5345
5345
  createdById: z.string().optional(),
5346
5346
  updatedById: z.string().optional(),
5347
5347
  created: z.date().transform(v => v.toISOString()).optional(),
5348
- updated: z.date().default(() => new Date("2025-11-25T09:21:47.602Z"))
5348
+ updated: z.date().default(() => new Date("2025-11-25T12:44:27.774Z"))
5349
5349
  .transform(v => v.toISOString()),
5350
5350
  }).transform((v) => {
5351
5351
  return remap$(v, {
@@ -608,7 +608,7 @@ export const CreateDatasourceResponseBody$inboundSchema: z.ZodType<
608
608
  z.ZodTypeDef,
609
609
  unknown
610
610
  > = z.object({
611
- _id: z.string().default("01KAX53RNQSPE60Q7Z8B74EH9E"),
611
+ _id: z.string().default("01KAXGPT5A8N6ZEGGGG9PA4FWG"),
612
612
  display_name: z.string(),
613
613
  description: z.string().optional(),
614
614
  status: CreateDatasourceStatus$inboundSchema,
@@ -651,7 +651,7 @@ export const CreateDatasourceResponseBody$outboundSchema: z.ZodType<
651
651
  z.ZodTypeDef,
652
652
  CreateDatasourceResponseBody
653
653
  > = z.object({
654
- id: z.string().default("01KAX53RNQSPE60Q7Z8B74EH9E"),
654
+ id: z.string().default("01KAXGPT5A8N6ZEGGGG9PA4FWG"),
655
655
  displayName: z.string(),
656
656
  description: z.string().optional(),
657
657
  status: CreateDatasourceStatus$outboundSchema,