@orq-ai/node 4.4.11 → 4.4.14

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 (193) hide show
  1. package/funcs/agentsStream.js +4 -2
  2. package/funcs/agentsStream.js.map +1 -1
  3. package/funcs/agentsStreamRun.js +4 -2
  4. package/funcs/agentsStreamRun.js.map +1 -1
  5. package/funcs/deploymentsStream.js +4 -2
  6. package/funcs/deploymentsStream.js.map +1 -1
  7. package/funcs/filesCreate.js +7 -0
  8. package/funcs/filesCreate.js.map +1 -1
  9. package/funcs/routerAudioTranscriptionsCreate.js +7 -0
  10. package/funcs/routerAudioTranscriptionsCreate.js.map +1 -1
  11. package/funcs/routerAudioTranslationsCreate.js +7 -0
  12. package/funcs/routerAudioTranslationsCreate.js.map +1 -1
  13. package/jsr.json +1 -1
  14. package/lib/config.d.ts +3 -3
  15. package/lib/config.js +3 -3
  16. package/lib/config.js.map +1 -1
  17. package/lib/event-streams.d.ts +5 -0
  18. package/lib/event-streams.d.ts.map +1 -1
  19. package/lib/event-streams.js.map +1 -1
  20. package/lib/matchers.d.ts.map +1 -1
  21. package/lib/matchers.js +0 -1
  22. package/lib/matchers.js.map +1 -1
  23. package/lib/security.d.ts.map +1 -1
  24. package/lib/security.js +1 -2
  25. package/lib/security.js.map +1 -1
  26. package/models/components/partdoneevent.js +1 -1
  27. package/models/components/reasoningpart.js +1 -1
  28. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  29. package/models/operations/createagentresponserequest.js +2 -1
  30. package/models/operations/createagentresponserequest.js.map +1 -1
  31. package/models/operations/createchatcompletion.d.ts.map +1 -1
  32. package/models/operations/createchatcompletion.js +2 -1
  33. package/models/operations/createchatcompletion.js.map +1 -1
  34. package/models/operations/createcompletion.d.ts.map +1 -1
  35. package/models/operations/createcompletion.js +2 -1
  36. package/models/operations/createcompletion.js.map +1 -1
  37. package/models/operations/createcontact.js +1 -1
  38. package/models/operations/createdataset.js +1 -1
  39. package/models/operations/createdatasetitem.js +4 -4
  40. package/models/operations/createdatasource.js +1 -1
  41. package/models/operations/createeval.js +16 -16
  42. package/models/operations/createidentity.js +1 -1
  43. package/models/operations/createresponse.d.ts.map +1 -1
  44. package/models/operations/createresponse.js +2 -1
  45. package/models/operations/createresponse.js.map +1 -1
  46. package/models/operations/createtool.js +6 -6
  47. package/models/operations/fileget.js +1 -1
  48. package/models/operations/filelist.js +1 -1
  49. package/models/operations/fileupload.js +1 -1
  50. package/models/operations/getalltools.js +6 -6
  51. package/models/operations/getevals.js +16 -16
  52. package/models/operations/listdatasetdatapoints.js +4 -4
  53. package/models/operations/listdatasets.js +1 -1
  54. package/models/operations/listdatasources.js +1 -1
  55. package/models/operations/listidentities.js +1 -1
  56. package/models/operations/retrievedatapoint.js +4 -4
  57. package/models/operations/retrievedataset.js +1 -1
  58. package/models/operations/retrievedatasource.js +1 -1
  59. package/models/operations/retrieveidentity.js +1 -1
  60. package/models/operations/retrievetool.js +6 -6
  61. package/models/operations/runagent.js +1 -1
  62. package/models/operations/streamrunagent.js +1 -1
  63. package/models/operations/updatedatapoint.js +4 -4
  64. package/models/operations/updatedataset.js +1 -1
  65. package/models/operations/updatedatasource.js +1 -1
  66. package/models/operations/updateeval.js +16 -16
  67. package/models/operations/updateidentity.js +1 -1
  68. package/models/operations/updatetool.js +7 -7
  69. package/package.json +1 -1
  70. package/packages/orq-rc/src/funcs/agentsList.ts +5 -0
  71. package/packages/orq-rc/src/funcs/agentsPostV2AgentsA2a.ts +178 -0
  72. package/packages/orq-rc/src/funcs/agentsPostV2AgentsKeyCardRefresh.ts +187 -0
  73. package/packages/orq-rc/src/funcs/agentsResponsesGet.ts +182 -0
  74. package/packages/orq-rc/src/funcs/agentsStream.ts +4 -1
  75. package/packages/orq-rc/src/funcs/agentsStreamRun.ts +4 -1
  76. package/packages/orq-rc/src/funcs/agentsUpdate.ts +2 -2
  77. package/packages/orq-rc/src/funcs/deploymentsStream.ts +4 -1
  78. package/packages/orq-rc/src/funcs/filesCreate.ts +11 -0
  79. package/packages/orq-rc/src/funcs/routerAudioTranscriptionsCreate.ts +11 -0
  80. package/packages/orq-rc/src/funcs/routerAudioTranslationsCreate.ts +11 -0
  81. package/packages/orq-rc/src/lib/config.ts +3 -3
  82. package/packages/orq-rc/src/lib/event-streams.ts +10 -1
  83. package/packages/orq-rc/src/lib/matchers.ts +3 -2
  84. package/packages/orq-rc/src/lib/security.ts +1 -2
  85. package/packages/orq-rc/src/models/components/createagentresponse.ts +6 -0
  86. package/packages/orq-rc/src/models/components/extendedmessage.ts +146 -0
  87. package/packages/orq-rc/src/models/components/getagentresponse.ts +348 -0
  88. package/packages/orq-rc/src/models/components/index.ts +3 -0
  89. package/packages/orq-rc/src/models/components/partdoneevent.ts +1 -1
  90. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  91. package/packages/orq-rc/src/models/components/responsedoneevent.ts +6 -0
  92. package/packages/orq-rc/src/models/components/responsestartedevent.ts +6 -0
  93. package/packages/orq-rc/src/models/components/telemetry.ts +48 -0
  94. package/packages/orq-rc/src/models/errors/index.ts +2 -0
  95. package/packages/orq-rc/src/models/errors/postv2agentsa2a.ts +96 -0
  96. package/packages/orq-rc/src/models/errors/postv2agentskeycardrefresh.ts +97 -0
  97. package/packages/orq-rc/src/models/operations/createagentrequest.ts +755 -1212
  98. package/packages/orq-rc/src/models/operations/createagentresponserequest.ts +37 -2
  99. package/packages/orq-rc/src/models/operations/createannotation.ts +5 -1
  100. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +14 -3
  101. package/packages/orq-rc/src/models/operations/createcompletion.ts +8 -3
  102. package/packages/orq-rc/src/models/operations/createcontact.ts +1 -1
  103. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  104. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
  105. package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
  106. package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
  107. package/packages/orq-rc/src/models/operations/createidentity.ts +1 -1
  108. package/packages/orq-rc/src/models/operations/createknowledge.ts +19 -17
  109. package/packages/orq-rc/src/models/operations/createprompt.ts +55 -66
  110. package/packages/orq-rc/src/models/operations/createresponse.ts +2 -1
  111. package/packages/orq-rc/src/models/operations/createtool.ts +103 -91
  112. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +38 -0
  113. package/packages/orq-rc/src/models/operations/deploymentstream.ts +38 -0
  114. package/packages/orq-rc/src/models/operations/fileget.ts +1 -1
  115. package/packages/orq-rc/src/models/operations/filelist.ts +1 -1
  116. package/packages/orq-rc/src/models/operations/fileupload.ts +1 -1
  117. package/packages/orq-rc/src/models/operations/getagentresponse.ts +46 -0
  118. package/packages/orq-rc/src/models/operations/getalltools.ts +93 -87
  119. package/packages/orq-rc/src/models/operations/getevals.ts +16 -16
  120. package/packages/orq-rc/src/models/operations/index.ts +3 -0
  121. package/packages/orq-rc/src/models/operations/invokeagent.ts +45 -1
  122. package/packages/orq-rc/src/models/operations/listagents.ts +751 -787
  123. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
  124. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  125. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  126. package/packages/orq-rc/src/models/operations/listidentities.ts +1 -1
  127. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +72 -64
  128. package/packages/orq-rc/src/models/operations/postv2agentsa2a.ts +252 -0
  129. package/packages/orq-rc/src/models/operations/postv2agentskeycardrefresh.ts +100 -0
  130. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +962 -857
  131. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
  132. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  133. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  134. package/packages/orq-rc/src/models/operations/retrieveidentity.ts +1 -1
  135. package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
  136. package/packages/orq-rc/src/models/operations/runagent.ts +69 -493
  137. package/packages/orq-rc/src/models/operations/streamagent.ts +40 -1
  138. package/packages/orq-rc/src/models/operations/streamrunagent.ts +36 -493
  139. package/packages/orq-rc/src/models/operations/updateagent.ts +966 -1313
  140. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
  141. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  142. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  143. package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
  144. package/packages/orq-rc/src/models/operations/updateidentity.ts +1 -1
  145. package/packages/orq-rc/src/models/operations/updatememorystore.ts +3 -62
  146. package/packages/orq-rc/src/models/operations/updatetool.ts +96 -7
  147. package/packages/orq-rc/src/sdk/agents.ts +39 -1
  148. package/packages/orq-rc/src/sdk/responses.ts +19 -0
  149. package/src/funcs/agentsStream.ts +4 -1
  150. package/src/funcs/agentsStreamRun.ts +4 -1
  151. package/src/funcs/deploymentsStream.ts +4 -1
  152. package/src/funcs/filesCreate.ts +11 -0
  153. package/src/funcs/routerAudioTranscriptionsCreate.ts +11 -0
  154. package/src/funcs/routerAudioTranslationsCreate.ts +11 -0
  155. package/src/lib/config.ts +3 -3
  156. package/src/lib/event-streams.ts +10 -1
  157. package/src/lib/matchers.ts +3 -2
  158. package/src/lib/security.ts +1 -2
  159. package/src/models/components/partdoneevent.ts +1 -1
  160. package/src/models/components/reasoningpart.ts +1 -1
  161. package/src/models/operations/createagentresponserequest.ts +2 -1
  162. package/src/models/operations/createchatcompletion.ts +2 -1
  163. package/src/models/operations/createcompletion.ts +2 -1
  164. package/src/models/operations/createcontact.ts +1 -1
  165. package/src/models/operations/createdataset.ts +1 -1
  166. package/src/models/operations/createdatasetitem.ts +4 -4
  167. package/src/models/operations/createdatasource.ts +1 -1
  168. package/src/models/operations/createeval.ts +16 -16
  169. package/src/models/operations/createidentity.ts +1 -1
  170. package/src/models/operations/createresponse.ts +2 -1
  171. package/src/models/operations/createtool.ts +6 -6
  172. package/src/models/operations/fileget.ts +1 -1
  173. package/src/models/operations/filelist.ts +1 -1
  174. package/src/models/operations/fileupload.ts +1 -1
  175. package/src/models/operations/getalltools.ts +6 -6
  176. package/src/models/operations/getevals.ts +16 -16
  177. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  178. package/src/models/operations/listdatasets.ts +1 -1
  179. package/src/models/operations/listdatasources.ts +1 -1
  180. package/src/models/operations/listidentities.ts +1 -1
  181. package/src/models/operations/retrievedatapoint.ts +4 -4
  182. package/src/models/operations/retrievedataset.ts +1 -1
  183. package/src/models/operations/retrievedatasource.ts +1 -1
  184. package/src/models/operations/retrieveidentity.ts +1 -1
  185. package/src/models/operations/retrievetool.ts +6 -6
  186. package/src/models/operations/runagent.ts +1 -1
  187. package/src/models/operations/streamrunagent.ts +1 -1
  188. package/src/models/operations/updatedatapoint.ts +4 -4
  189. package/src/models/operations/updatedataset.ts +1 -1
  190. package/src/models/operations/updatedatasource.ts +1 -1
  191. package/src/models/operations/updateeval.ts +16 -16
  192. package/src/models/operations/updateidentity.ts +1 -1
  193. package/src/models/operations/updatetool.ts +7 -7
@@ -0,0 +1,182 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { OrqError } from "../models/errors/orqerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Get response
31
+ *
32
+ * @remarks
33
+ * Retrieves the current state of an agent response by task ID. Returns the response output, model information, token usage, and execution status. When the agent is still processing, the output array will be empty and status will be `in_progress`. Once completed, the response includes the full output, usage statistics, and finish reason.
34
+ */
35
+ export function agentsResponsesGet(
36
+ client: OrqCore,
37
+ request: operations.GetAgentResponseRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.GetAgentResponse,
42
+ | errors.HonoApiError
43
+ | OrqError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: OrqCore,
62
+ request: operations.GetAgentResponseRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ components.GetAgentResponse,
68
+ | errors.HonoApiError
69
+ | OrqError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const parsed = safeParse(
82
+ request,
83
+ (value) => operations.GetAgentResponseRequest$outboundSchema.parse(value),
84
+ "Input validation failed",
85
+ );
86
+ if (!parsed.ok) {
87
+ return [parsed, { status: "invalid" }];
88
+ }
89
+ const payload = parsed.value;
90
+ const body = null;
91
+
92
+ const pathParams = {
93
+ agent_key: encodeSimple("agent_key", payload.agent_key, {
94
+ explode: false,
95
+ charEncoding: "percent",
96
+ }),
97
+ task_id: encodeSimple("task_id", payload.task_id, {
98
+ explode: false,
99
+ charEncoding: "percent",
100
+ }),
101
+ };
102
+
103
+ const path = pathToFunc("/v2/agents/{agent_key}/responses/{task_id}")(
104
+ pathParams,
105
+ );
106
+
107
+ const headers = new Headers(compactMap({
108
+ Accept: "application/json",
109
+ }));
110
+
111
+ const secConfig = await extractSecurity(client._options.apiKey);
112
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
113
+ const requestSecurity = resolveGlobalSecurity(securityInput);
114
+
115
+ const context = {
116
+ options: client._options,
117
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
118
+ operationID: "GetAgentResponse",
119
+ oAuth2Scopes: null,
120
+
121
+ resolvedSecurity: requestSecurity,
122
+
123
+ securitySource: client._options.apiKey,
124
+ retryConfig: options?.retries
125
+ || client._options.retryConfig
126
+ || { strategy: "none" },
127
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
128
+ };
129
+
130
+ const requestRes = client._createRequest(context, {
131
+ security: requestSecurity,
132
+ method: "GET",
133
+ baseURL: options?.serverURL,
134
+ path: path,
135
+ headers: headers,
136
+ body: body,
137
+ userAgent: client._options.userAgent,
138
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
139
+ }, options);
140
+ if (!requestRes.ok) {
141
+ return [requestRes, { status: "invalid" }];
142
+ }
143
+ const req = requestRes.value;
144
+
145
+ const doResult = await client._do(req, {
146
+ context,
147
+ errorCodes: ["404", "4XX", "5XX"],
148
+ retryConfig: context.retryConfig,
149
+ retryCodes: context.retryCodes,
150
+ });
151
+ if (!doResult.ok) {
152
+ return [doResult, { status: "request-error", request: req }];
153
+ }
154
+ const response = doResult.value;
155
+
156
+ const responseFields = {
157
+ HttpMeta: { Response: response, Request: req },
158
+ };
159
+
160
+ const [result] = await M.match<
161
+ components.GetAgentResponse,
162
+ | errors.HonoApiError
163
+ | OrqError
164
+ | ResponseValidationError
165
+ | ConnectionError
166
+ | RequestAbortedError
167
+ | RequestTimeoutError
168
+ | InvalidRequestError
169
+ | UnexpectedClientError
170
+ | SDKValidationError
171
+ >(
172
+ M.json(200, components.GetAgentResponse$inboundSchema),
173
+ M.jsonErr(404, errors.HonoApiError$inboundSchema),
174
+ M.fail("4XX"),
175
+ M.fail("5XX"),
176
+ )(response, req, { extraFields: responseFields });
177
+ if (!result.ok) {
178
+ return [result, { status: "complete", request: req, response }];
179
+ }
180
+
181
+ return [result, { status: "complete", request: req, response }];
182
+ }
@@ -180,8 +180,11 @@ async function $do(
180
180
  z.instanceof(ReadableStream<Uint8Array>)
181
181
  .transform(stream => {
182
182
  return new EventStream(stream, rawEvent => {
183
- if (rawEvent.data === "[DONE]") return { done: true };
183
+ if (rawEvent.data === "[DONE]") {
184
+ return { done: true, value: undefined };
185
+ }
184
186
  return {
187
+ done: false,
185
188
  value: operations.StreamAgentResponseBody$inboundSchema.parse(
186
189
  rawEvent,
187
190
  ),
@@ -165,8 +165,11 @@ async function $do(
165
165
  z.instanceof(ReadableStream<Uint8Array>)
166
166
  .transform(stream => {
167
167
  return new EventStream(stream, rawEvent => {
168
- if (rawEvent.data === "[DONE]") return { done: true };
168
+ if (rawEvent.data === "[DONE]") {
169
+ return { done: true, value: undefined };
170
+ }
169
171
  return {
172
+ done: false,
170
173
  value: operations.StreamRunAgentResponseBody$inboundSchema.parse(
171
174
  rawEvent,
172
175
  ),
@@ -33,7 +33,7 @@ import { Result } from "../types/fp.js";
33
33
  */
34
34
  export function agentsUpdate(
35
35
  client: OrqCore,
36
- requestBody: operations.UpdateAgentUpdateAgentRequest,
36
+ requestBody: operations.UpdateAgentRequestBody,
37
37
  agentKey: string,
38
38
  options?: RequestOptions,
39
39
  ): APIPromise<
@@ -60,7 +60,7 @@ export function agentsUpdate(
60
60
 
61
61
  async function $do(
62
62
  client: OrqCore,
63
- requestBody: operations.UpdateAgentUpdateAgentRequest,
63
+ requestBody: operations.UpdateAgentRequestBody,
64
64
  agentKey: string,
65
65
  options?: RequestOptions,
66
66
  ): Promise<
@@ -164,8 +164,11 @@ async function $do(
164
164
  z.instanceof(ReadableStream<Uint8Array>)
165
165
  .transform(stream => {
166
166
  return new EventStream(stream, rawEvent => {
167
- if (rawEvent.data === "[DONE]") return { done: true };
167
+ if (rawEvent.data === "[DONE]") {
168
+ return { done: true, value: undefined };
169
+ }
168
170
  return {
171
+ done: false,
169
172
  value: operations.DeploymentStreamResponseBody$inboundSchema
170
173
  .parse(rawEvent),
171
174
  };
@@ -99,6 +99,17 @@ async function $do(
99
99
  || "application/octet-stream";
100
100
  const blob = new Blob([buffer], { type: contentType });
101
101
  appendForm(body, "file", blob, payload.file.fileName);
102
+ } else if (payload.file.content instanceof Uint8Array) {
103
+ const contentType = getContentTypeFromFileName(payload.file.fileName)
104
+ || "application/octet-stream";
105
+ appendForm(
106
+ body,
107
+ "file",
108
+ new Blob([new Uint8Array(payload.file.content).buffer], {
109
+ type: contentType,
110
+ }),
111
+ payload.file.fileName,
112
+ );
102
113
  } else {
103
114
  const contentType = getContentTypeFromFileName(payload.file.fileName)
104
115
  || "application/octet-stream";
@@ -115,6 +115,17 @@ async function $do(
115
115
  || "application/octet-stream";
116
116
  const blob = new Blob([buffer], { type: contentType });
117
117
  appendForm(body, "file", blob, payload.file.fileName);
118
+ } else if (payload.file.content instanceof Uint8Array) {
119
+ const contentType = getContentTypeFromFileName(payload.file.fileName)
120
+ || "application/octet-stream";
121
+ appendForm(
122
+ body,
123
+ "file",
124
+ new Blob([new Uint8Array(payload.file.content).buffer], {
125
+ type: contentType,
126
+ }),
127
+ payload.file.fileName,
128
+ );
118
129
  } else {
119
130
  const contentType = getContentTypeFromFileName(payload.file.fileName)
120
131
  || "application/octet-stream";
@@ -115,6 +115,17 @@ async function $do(
115
115
  || "application/octet-stream";
116
116
  const blob = new Blob([buffer], { type: contentType });
117
117
  appendForm(body, "file", blob, payload.file.fileName);
118
+ } else if (payload.file.content instanceof Uint8Array) {
119
+ const contentType = getContentTypeFromFileName(payload.file.fileName)
120
+ || "application/octet-stream";
121
+ appendForm(
122
+ body,
123
+ "file",
124
+ new Blob([new Uint8Array(payload.file.content).buffer], {
125
+ type: contentType,
126
+ }),
127
+ payload.file.fileName,
128
+ );
118
129
  } else {
119
130
  const contentType = getContentTypeFromFileName(payload.file.fileName)
120
131
  || "application/octet-stream";
@@ -68,7 +68,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
68
68
  export const SDK_METADATA = {
69
69
  language: "typescript",
70
70
  openapiDocVersion: "2.0",
71
- sdkVersion: "4.5.0-rc.19",
72
- genVersion: "2.845.15",
73
- userAgent: "speakeasy-sdk/typescript 4.5.0-rc.19 2.845.15 2.0 @orq-ai/node",
71
+ sdkVersion: "4.5.0-rc.33",
72
+ genVersion: "2.849.8",
73
+ userAgent: "speakeasy-sdk/typescript 4.5.0-rc.33 2.849.8 2.0 @orq-ai/node",
74
74
  } as const;
@@ -2,6 +2,15 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ // Ensure ReadableStream always declares [Symbol.asyncIterator] so the
6
+ // override keyword works consistently regardless of installed type
7
+ // definitions (e.g. bun-types omits it from its ReadableStream).
8
+ declare global {
9
+ interface ReadableStream<R = any> {
10
+ [Symbol.asyncIterator](): AsyncIterableIterator<R>;
11
+ }
12
+ }
13
+
5
14
  export type SseMessage<T> = {
6
15
  data?: T | undefined;
7
16
  event?: string | null | undefined;
@@ -48,7 +57,7 @@ export class EventStream<T extends SseMessage<unknown>>
48
57
  }
49
58
 
50
59
  // Polyfill for older browsers
51
- [Symbol.asyncIterator](): AsyncIterableIterator<T> {
60
+ override [Symbol.asyncIterator](): AsyncIterableIterator<T> {
52
61
  const fn = (ReadableStream.prototype as any)[Symbol.asyncIterator];
53
62
  if (typeof fn === "function") return fn.call(this);
54
63
  const reader = this.getReader();
@@ -248,8 +248,9 @@ export function match<T, E>(
248
248
  raw = body;
249
249
  break;
250
250
  default:
251
- encoding satisfies never;
252
- throw new Error(`Unsupported response type: ${encoding}`);
251
+ throw new Error(
252
+ `Unsupported response type: ${encoding satisfies never}`,
253
+ );
253
254
  }
254
255
 
255
256
  if (matcher.enc === "fail") {
@@ -198,8 +198,7 @@ export function resolveSecurity(
198
198
  applyBearer(state, spec);
199
199
  break;
200
200
  default:
201
- spec satisfies never;
202
- throw SecurityError.unrecognizedType(type);
201
+ throw SecurityError.unrecognizedType((spec satisfies never, type));
203
202
  }
204
203
  });
205
204
 
@@ -12,6 +12,7 @@ import {
12
12
  AgentResponseMessage,
13
13
  AgentResponseMessage$inboundSchema,
14
14
  } from "./agentresponsemessage.js";
15
+ import { Telemetry, Telemetry$inboundSchema } from "./telemetry.js";
15
16
 
16
17
  export type PromptTokensDetails = {
17
18
  cachedTokens?: number | null | undefined;
@@ -123,6 +124,10 @@ export type CreateAgentResponse = {
123
124
  * Tool calls awaiting user response (when finish_reason is function_call)
124
125
  */
125
126
  pendingToolCalls?: Array<PendingToolCalls> | undefined;
127
+ /**
128
+ * Telemetry information for correlating the response with traces
129
+ */
130
+ telemetry?: Telemetry | undefined;
126
131
  };
127
132
 
128
133
  /** @internal */
@@ -278,6 +283,7 @@ export const CreateAgentResponse$inboundSchema: z.ZodType<
278
283
  finish_reason: FinishReason$inboundSchema.optional(),
279
284
  pending_tool_calls: z.array(z.lazy(() => PendingToolCalls$inboundSchema))
280
285
  .optional(),
286
+ telemetry: Telemetry$inboundSchema.optional(),
281
287
  }).transform((v) => {
282
288
  return remap$(v, {
283
289
  "_id": "id",
@@ -0,0 +1,146 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import { DataPart, DataPart$inboundSchema } from "./datapart.js";
11
+ import { ErrorPart, ErrorPart$inboundSchema } from "./errorpart.js";
12
+ import { FilePart, FilePart$inboundSchema } from "./filepart.js";
13
+ import { TextPart, TextPart$inboundSchema } from "./textpart.js";
14
+ import { ToolCallPart, ToolCallPart$inboundSchema } from "./toolcallpart.js";
15
+ import {
16
+ ToolResultPart,
17
+ ToolResultPart$inboundSchema,
18
+ } from "./toolresultpart.js";
19
+
20
+ export const ExtendedMessageKind = {
21
+ Message: "message",
22
+ } as const;
23
+ export type ExtendedMessageKind = ClosedEnum<typeof ExtendedMessageKind>;
24
+
25
+ /**
26
+ * Role of the message sender in the A2A protocol. Values: user (end user), agent (AI agent), tool (tool execution result), system (system instructions/prompts).
27
+ */
28
+ export const ExtendedMessageRole = {
29
+ User: "user",
30
+ Agent: "agent",
31
+ Tool: "tool",
32
+ System: "system",
33
+ } as const;
34
+ /**
35
+ * Role of the message sender in the A2A protocol. Values: user (end user), agent (AI agent), tool (tool execution result), system (system instructions/prompts).
36
+ */
37
+ export type ExtendedMessageRole = ClosedEnum<typeof ExtendedMessageRole>;
38
+
39
+ export type ExtendedMessageParts =
40
+ | TextPart
41
+ | ErrorPart
42
+ | DataPart
43
+ | FilePart
44
+ | ToolCallPart
45
+ | ToolResultPart;
46
+
47
+ /**
48
+ * Extended Agent-to-Agent protocol message with support for tool calls and tool results. Extends the base A2A message format with Orquesta-specific features.
49
+ */
50
+ export type ExtendedMessage = {
51
+ kind: ExtendedMessageKind;
52
+ /**
53
+ * Unique identifier for the message
54
+ */
55
+ messageId: string;
56
+ /**
57
+ * Role of the message sender in the A2A protocol. Values: user (end user), agent (AI agent), tool (tool execution result), system (system instructions/prompts).
58
+ */
59
+ role: ExtendedMessageRole;
60
+ /**
61
+ * Array of message parts (text, file, tool_call, tool_result)
62
+ */
63
+ parts: Array<
64
+ TextPart | ErrorPart | DataPart | FilePart | ToolCallPart | ToolResultPart
65
+ >;
66
+ /**
67
+ * Associated task ID if applicable
68
+ */
69
+ taskId?: string | undefined;
70
+ /**
71
+ * Correlation ID for execution tracking
72
+ */
73
+ contextId?: string | undefined;
74
+ /**
75
+ * Additional message metadata
76
+ */
77
+ metadata?: { [k: string]: any } | undefined;
78
+ };
79
+
80
+ /** @internal */
81
+ export const ExtendedMessageKind$inboundSchema: z.ZodNativeEnum<
82
+ typeof ExtendedMessageKind
83
+ > = z.nativeEnum(ExtendedMessageKind);
84
+
85
+ /** @internal */
86
+ export const ExtendedMessageRole$inboundSchema: z.ZodNativeEnum<
87
+ typeof ExtendedMessageRole
88
+ > = z.nativeEnum(ExtendedMessageRole);
89
+
90
+ /** @internal */
91
+ export const ExtendedMessageParts$inboundSchema: z.ZodType<
92
+ ExtendedMessageParts,
93
+ z.ZodTypeDef,
94
+ unknown
95
+ > = z.union([
96
+ TextPart$inboundSchema,
97
+ ErrorPart$inboundSchema,
98
+ DataPart$inboundSchema,
99
+ FilePart$inboundSchema,
100
+ ToolCallPart$inboundSchema,
101
+ ToolResultPart$inboundSchema,
102
+ ]);
103
+
104
+ export function extendedMessagePartsFromJSON(
105
+ jsonString: string,
106
+ ): SafeParseResult<ExtendedMessageParts, SDKValidationError> {
107
+ return safeParse(
108
+ jsonString,
109
+ (x) => ExtendedMessageParts$inboundSchema.parse(JSON.parse(x)),
110
+ `Failed to parse 'ExtendedMessageParts' from JSON`,
111
+ );
112
+ }
113
+
114
+ /** @internal */
115
+ export const ExtendedMessage$inboundSchema: z.ZodType<
116
+ ExtendedMessage,
117
+ z.ZodTypeDef,
118
+ unknown
119
+ > = z.object({
120
+ kind: ExtendedMessageKind$inboundSchema,
121
+ messageId: z.string(),
122
+ role: ExtendedMessageRole$inboundSchema,
123
+ parts: z.array(
124
+ z.union([
125
+ TextPart$inboundSchema,
126
+ ErrorPart$inboundSchema,
127
+ DataPart$inboundSchema,
128
+ FilePart$inboundSchema,
129
+ ToolCallPart$inboundSchema,
130
+ ToolResultPart$inboundSchema,
131
+ ]),
132
+ ),
133
+ taskId: z.string().optional(),
134
+ contextId: z.string().optional(),
135
+ metadata: z.record(z.any()).optional(),
136
+ });
137
+
138
+ export function extendedMessageFromJSON(
139
+ jsonString: string,
140
+ ): SafeParseResult<ExtendedMessage, SDKValidationError> {
141
+ return safeParse(
142
+ jsonString,
143
+ (x) => ExtendedMessage$inboundSchema.parse(JSON.parse(x)),
144
+ `Failed to parse 'ExtendedMessage' from JSON`,
145
+ );
146
+ }