@orq-ai/node 4.1.0-rc.45 → 4.1.0-rc.50

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 (199) hide show
  1. package/README.md +31 -24
  2. package/bin/mcp-server.js +3439 -531
  3. package/bin/mcp-server.js.map +65 -58
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/routerChatCompletions.d.ts +23 -0
  6. package/funcs/routerChatCompletions.d.ts.map +1 -0
  7. package/funcs/routerChatCompletions.js +121 -0
  8. package/funcs/routerChatCompletions.js.map +1 -0
  9. package/funcs/routerImagesGenerate.d.ts +17 -0
  10. package/funcs/routerImagesGenerate.d.ts.map +1 -0
  11. package/funcs/routerImagesGenerate.js +114 -0
  12. package/funcs/routerImagesGenerate.js.map +1 -0
  13. package/jsr.json +1 -1
  14. package/lib/config.d.ts +3 -3
  15. package/lib/config.js +3 -3
  16. package/lib/event-streams.js +1 -1
  17. package/lib/event-streams.js.map +1 -1
  18. package/mcp-server/mcp-server.js +1 -1
  19. package/mcp-server/server.d.ts.map +1 -1
  20. package/mcp-server/server.js +5 -1
  21. package/mcp-server/server.js.map +1 -1
  22. package/mcp-server/tools/routerChatCompletions.d.ts +8 -0
  23. package/mcp-server/tools/routerChatCompletions.d.ts.map +1 -0
  24. package/mcp-server/tools/routerChatCompletions.js +64 -0
  25. package/mcp-server/tools/routerChatCompletions.js.map +1 -0
  26. package/mcp-server/tools/routerImagesGenerate.d.ts +8 -0
  27. package/mcp-server/tools/routerImagesGenerate.d.ts.map +1 -0
  28. package/mcp-server/tools/routerImagesGenerate.js +64 -0
  29. package/mcp-server/tools/routerImagesGenerate.js.map +1 -0
  30. package/models/components/conversationresponse.js +2 -2
  31. package/models/components/index.d.ts +1 -0
  32. package/models/components/index.d.ts.map +1 -1
  33. package/models/components/index.js +1 -0
  34. package/models/components/index.js.map +1 -1
  35. package/models/components/partdoneevent.js +2 -2
  36. package/models/components/publiccontact.d.ts +52 -0
  37. package/models/components/publiccontact.d.ts.map +1 -0
  38. package/models/components/publiccontact.js +79 -0
  39. package/models/components/publiccontact.js.map +1 -0
  40. package/models/components/reasoningpart.js +2 -2
  41. package/models/operations/createagentrequest.d.ts +280 -36
  42. package/models/operations/createagentrequest.d.ts.map +1 -1
  43. package/models/operations/createagentrequest.js +308 -51
  44. package/models/operations/createagentrequest.js.map +1 -1
  45. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  46. package/models/operations/createagentresponserequest.js +3 -1
  47. package/models/operations/createagentresponserequest.js.map +1 -1
  48. package/models/operations/createbudget.js +2 -2
  49. package/models/operations/createchatcompletion.d.ts +3152 -0
  50. package/models/operations/createchatcompletion.d.ts.map +1 -0
  51. package/models/operations/createchatcompletion.js +3398 -0
  52. package/models/operations/createchatcompletion.js.map +1 -0
  53. package/models/operations/createcontact.js +2 -2
  54. package/models/operations/createconversation.js +2 -2
  55. package/models/operations/createdataset.js +2 -2
  56. package/models/operations/createdatasetitem.js +8 -8
  57. package/models/operations/createdatasource.js +2 -2
  58. package/models/operations/createeval.js +28 -28
  59. package/models/operations/createimage.d.ts +433 -0
  60. package/models/operations/createimage.d.ts.map +1 -0
  61. package/models/operations/createimage.js +455 -0
  62. package/models/operations/createimage.js.map +1 -0
  63. package/models/operations/creatememory.d.ts +1 -1
  64. package/models/operations/createtool.js +12 -12
  65. package/models/operations/deploymentstream.d.ts.map +1 -1
  66. package/models/operations/deploymentstream.js +3 -1
  67. package/models/operations/deploymentstream.js.map +1 -1
  68. package/models/operations/fileget.js +2 -2
  69. package/models/operations/filelist.js +2 -2
  70. package/models/operations/fileupload.js +2 -2
  71. package/models/operations/generateconversationname.js +2 -2
  72. package/models/operations/getallprompts.d.ts +8 -8
  73. package/models/operations/getallprompts.d.ts.map +1 -1
  74. package/models/operations/getallprompts.js +11 -12
  75. package/models/operations/getallprompts.js.map +1 -1
  76. package/models/operations/getalltools.js +12 -12
  77. package/models/operations/getbudget.js +2 -2
  78. package/models/operations/getevals.js +28 -28
  79. package/models/operations/index.d.ts +2 -0
  80. package/models/operations/index.d.ts.map +1 -1
  81. package/models/operations/index.js +2 -0
  82. package/models/operations/index.js.map +1 -1
  83. package/models/operations/invokeeval.d.ts +5 -5
  84. package/models/operations/invokeeval.d.ts.map +1 -1
  85. package/models/operations/invokeeval.js +7 -7
  86. package/models/operations/invokeeval.js.map +1 -1
  87. package/models/operations/listagents.d.ts +122 -0
  88. package/models/operations/listagents.d.ts.map +1 -1
  89. package/models/operations/listagents.js +129 -3
  90. package/models/operations/listagents.js.map +1 -1
  91. package/models/operations/listbudgets.js +2 -2
  92. package/models/operations/listcontacts.js +2 -2
  93. package/models/operations/listdatasetdatapoints.js +8 -8
  94. package/models/operations/listdatasets.js +2 -2
  95. package/models/operations/listdatasources.js +2 -2
  96. package/models/operations/retrieveagentrequest.d.ts +122 -0
  97. package/models/operations/retrieveagentrequest.d.ts.map +1 -1
  98. package/models/operations/retrieveagentrequest.js +128 -3
  99. package/models/operations/retrieveagentrequest.js.map +1 -1
  100. package/models/operations/retrievecontact.js +2 -2
  101. package/models/operations/retrieveconversation.js +2 -2
  102. package/models/operations/retrievedatapoint.js +8 -8
  103. package/models/operations/retrievedataset.js +2 -2
  104. package/models/operations/retrievedatasource.js +2 -2
  105. package/models/operations/retrievetool.js +12 -12
  106. package/models/operations/runagent.d.ts +122 -0
  107. package/models/operations/runagent.d.ts.map +1 -1
  108. package/models/operations/runagent.js +132 -7
  109. package/models/operations/runagent.js.map +1 -1
  110. package/models/operations/streamrunagent.d.ts +122 -0
  111. package/models/operations/streamrunagent.d.ts.map +1 -1
  112. package/models/operations/streamrunagent.js +131 -7
  113. package/models/operations/streamrunagent.js.map +1 -1
  114. package/models/operations/updateagent.d.ts +244 -0
  115. package/models/operations/updateagent.d.ts.map +1 -1
  116. package/models/operations/updateagent.js +255 -7
  117. package/models/operations/updateagent.js.map +1 -1
  118. package/models/operations/updatebudget.js +2 -2
  119. package/models/operations/updatecontact.js +2 -2
  120. package/models/operations/updateconversation.js +2 -2
  121. package/models/operations/updatedatapoint.js +8 -8
  122. package/models/operations/updatedataset.js +2 -2
  123. package/models/operations/updatedatasource.js +2 -2
  124. package/models/operations/updateeval.js +28 -28
  125. package/models/operations/updatememory.d.ts +1 -1
  126. package/models/operations/updatetool.js +14 -14
  127. package/package.json +1 -1
  128. package/sdk/router.d.ts +23 -0
  129. package/sdk/router.d.ts.map +1 -0
  130. package/sdk/router.js +34 -0
  131. package/sdk/router.js.map +1 -0
  132. package/sdk/sdk.d.ts +3 -0
  133. package/sdk/sdk.d.ts.map +1 -1
  134. package/sdk/sdk.js +4 -0
  135. package/sdk/sdk.js.map +1 -1
  136. package/src/funcs/routerChatCompletions.ts +172 -0
  137. package/src/funcs/routerImagesGenerate.ts +160 -0
  138. package/src/lib/config.ts +3 -3
  139. package/src/lib/event-streams.ts +1 -1
  140. package/src/mcp-server/mcp-server.ts +1 -1
  141. package/src/mcp-server/server.ts +5 -1
  142. package/src/mcp-server/tools/routerChatCompletions.ts +37 -0
  143. package/src/mcp-server/tools/routerImagesGenerate.ts +37 -0
  144. package/src/models/components/conversationresponse.ts +2 -2
  145. package/src/models/components/index.ts +1 -0
  146. package/src/models/components/partdoneevent.ts +2 -2
  147. package/src/models/components/publiccontact.ts +99 -0
  148. package/src/models/components/reasoningpart.ts +2 -2
  149. package/src/models/operations/createagentrequest.ts +760 -113
  150. package/src/models/operations/createagentresponserequest.ts +2 -1
  151. package/src/models/operations/createbudget.ts +2 -2
  152. package/src/models/operations/createchatcompletion.ts +8911 -0
  153. package/src/models/operations/createcontact.ts +2 -2
  154. package/src/models/operations/createconversation.ts +2 -2
  155. package/src/models/operations/createdataset.ts +2 -2
  156. package/src/models/operations/createdatasetitem.ts +8 -8
  157. package/src/models/operations/createdatasource.ts +2 -2
  158. package/src/models/operations/createeval.ts +28 -28
  159. package/src/models/operations/createimage.ts +966 -0
  160. package/src/models/operations/creatememory.ts +1 -1
  161. package/src/models/operations/createtool.ts +12 -12
  162. package/src/models/operations/deploymentstream.ts +2 -1
  163. package/src/models/operations/fileget.ts +2 -2
  164. package/src/models/operations/filelist.ts +2 -2
  165. package/src/models/operations/fileupload.ts +2 -2
  166. package/src/models/operations/generateconversationname.ts +2 -2
  167. package/src/models/operations/getallprompts.ts +45 -38
  168. package/src/models/operations/getalltools.ts +12 -12
  169. package/src/models/operations/getbudget.ts +2 -2
  170. package/src/models/operations/getevals.ts +28 -28
  171. package/src/models/operations/index.ts +2 -0
  172. package/src/models/operations/invokeeval.ts +11 -10
  173. package/src/models/operations/listagents.ts +313 -0
  174. package/src/models/operations/listbudgets.ts +2 -2
  175. package/src/models/operations/listcontacts.ts +2 -2
  176. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  177. package/src/models/operations/listdatasets.ts +2 -2
  178. package/src/models/operations/listdatasources.ts +2 -2
  179. package/src/models/operations/retrieveagentrequest.ts +337 -0
  180. package/src/models/operations/retrievecontact.ts +2 -2
  181. package/src/models/operations/retrieveconversation.ts +2 -2
  182. package/src/models/operations/retrievedatapoint.ts +8 -8
  183. package/src/models/operations/retrievedataset.ts +2 -2
  184. package/src/models/operations/retrievedatasource.ts +2 -2
  185. package/src/models/operations/retrievetool.ts +12 -12
  186. package/src/models/operations/runagent.ts +315 -2
  187. package/src/models/operations/streamrunagent.ts +342 -2
  188. package/src/models/operations/updateagent.ts +659 -0
  189. package/src/models/operations/updatebudget.ts +2 -2
  190. package/src/models/operations/updatecontact.ts +2 -2
  191. package/src/models/operations/updateconversation.ts +2 -2
  192. package/src/models/operations/updatedatapoint.ts +8 -8
  193. package/src/models/operations/updatedataset.ts +2 -2
  194. package/src/models/operations/updatedatasource.ts +2 -2
  195. package/src/models/operations/updateeval.ts +28 -28
  196. package/src/models/operations/updatememory.ts +1 -1
  197. package/src/models/operations/updatetool.ts +14 -14
  198. package/src/sdk/router.ts +52 -0
  199. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,172 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON } 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 {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import { OrqError } from "../models/errors/orqerror.js";
21
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ export enum ChatCompletionsAcceptEnum {
28
+ applicationJson = "application/json",
29
+ textEventStream = "text/event-stream",
30
+ }
31
+
32
+ /**
33
+ * Create chat completion
34
+ *
35
+ * @remarks
36
+ * Creates a model response for the given chat conversation with support for retries, fallbacks, prompts, and variables.
37
+ */
38
+ export function routerChatCompletions(
39
+ client: OrqCore,
40
+ request: operations.CreateChatCompletionRequestBody,
41
+ options?: RequestOptions & {
42
+ acceptHeaderOverride?: ChatCompletionsAcceptEnum;
43
+ },
44
+ ): APIPromise<
45
+ Result<
46
+ operations.CreateChatCompletionResponse,
47
+ | OrqError
48
+ | ResponseValidationError
49
+ | ConnectionError
50
+ | RequestAbortedError
51
+ | RequestTimeoutError
52
+ | InvalidRequestError
53
+ | UnexpectedClientError
54
+ | SDKValidationError
55
+ >
56
+ > {
57
+ return new APIPromise($do(
58
+ client,
59
+ request,
60
+ options,
61
+ ));
62
+ }
63
+
64
+ async function $do(
65
+ client: OrqCore,
66
+ request: operations.CreateChatCompletionRequestBody,
67
+ options?: RequestOptions & {
68
+ acceptHeaderOverride?: ChatCompletionsAcceptEnum;
69
+ },
70
+ ): Promise<
71
+ [
72
+ Result<
73
+ operations.CreateChatCompletionResponse,
74
+ | OrqError
75
+ | ResponseValidationError
76
+ | ConnectionError
77
+ | RequestAbortedError
78
+ | RequestTimeoutError
79
+ | InvalidRequestError
80
+ | UnexpectedClientError
81
+ | SDKValidationError
82
+ >,
83
+ APICall,
84
+ ]
85
+ > {
86
+ const parsed = safeParse(
87
+ request,
88
+ (value) =>
89
+ operations.CreateChatCompletionRequestBody$outboundSchema.parse(value),
90
+ "Input validation failed",
91
+ );
92
+ if (!parsed.ok) {
93
+ return [parsed, { status: "invalid" }];
94
+ }
95
+ const payload = parsed.value;
96
+ const body = encodeJSON("body", payload, { explode: true });
97
+
98
+ const path = pathToFunc("/v2/gateway/chat/completions")();
99
+
100
+ const headers = new Headers(compactMap({
101
+ "Content-Type": "application/json",
102
+ Accept: options?.acceptHeaderOverride
103
+ || "application/json;q=1, text/event-stream;q=0",
104
+ }));
105
+
106
+ const secConfig = await extractSecurity(client._options.apiKey);
107
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
108
+ const requestSecurity = resolveGlobalSecurity(securityInput);
109
+
110
+ const context = {
111
+ options: client._options,
112
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
113
+ operationID: "createChatCompletion",
114
+ oAuth2Scopes: null,
115
+
116
+ resolvedSecurity: requestSecurity,
117
+
118
+ securitySource: client._options.apiKey,
119
+ retryConfig: options?.retries
120
+ || client._options.retryConfig
121
+ || { strategy: "none" },
122
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
123
+ };
124
+
125
+ const requestRes = client._createRequest(context, {
126
+ security: requestSecurity,
127
+ method: "POST",
128
+ baseURL: options?.serverURL,
129
+ path: path,
130
+ headers: headers,
131
+ body: body,
132
+ userAgent: client._options.userAgent,
133
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
134
+ }, options);
135
+ if (!requestRes.ok) {
136
+ return [requestRes, { status: "invalid" }];
137
+ }
138
+ const req = requestRes.value;
139
+
140
+ const doResult = await client._do(req, {
141
+ context,
142
+ errorCodes: ["4XX", "5XX"],
143
+ retryConfig: context.retryConfig,
144
+ retryCodes: context.retryCodes,
145
+ });
146
+ if (!doResult.ok) {
147
+ return [doResult, { status: "request-error", request: req }];
148
+ }
149
+ const response = doResult.value;
150
+
151
+ const [result] = await M.match<
152
+ operations.CreateChatCompletionResponse,
153
+ | OrqError
154
+ | ResponseValidationError
155
+ | ConnectionError
156
+ | RequestAbortedError
157
+ | RequestTimeoutError
158
+ | InvalidRequestError
159
+ | UnexpectedClientError
160
+ | SDKValidationError
161
+ >(
162
+ M.json(200, operations.CreateChatCompletionResponse$inboundSchema),
163
+ M.sse(200, operations.CreateChatCompletionResponse$inboundSchema),
164
+ M.fail("4XX"),
165
+ M.fail("5XX"),
166
+ )(response, req);
167
+ if (!result.ok) {
168
+ return [result, { status: "complete", request: req, response }];
169
+ }
170
+
171
+ return [result, { status: "complete", request: req, response }];
172
+ }
@@ -0,0 +1,160 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON } 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 {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import { OrqError } from "../models/errors/orqerror.js";
21
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * Create image
29
+ *
30
+ * @remarks
31
+ * Create an Image
32
+ */
33
+ export function routerImagesGenerate(
34
+ client: OrqCore,
35
+ request: operations.CreateImageRequestBody,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ operations.CreateImageResponseBody,
40
+ | OrqError
41
+ | ResponseValidationError
42
+ | ConnectionError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | InvalidRequestError
46
+ | UnexpectedClientError
47
+ | SDKValidationError
48
+ >
49
+ > {
50
+ return new APIPromise($do(
51
+ client,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client: OrqCore,
59
+ request: operations.CreateImageRequestBody,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ operations.CreateImageResponseBody,
65
+ | OrqError
66
+ | ResponseValidationError
67
+ | ConnectionError
68
+ | RequestAbortedError
69
+ | RequestTimeoutError
70
+ | InvalidRequestError
71
+ | UnexpectedClientError
72
+ | SDKValidationError
73
+ >,
74
+ APICall,
75
+ ]
76
+ > {
77
+ const parsed = safeParse(
78
+ request,
79
+ (value) => operations.CreateImageRequestBody$outboundSchema.parse(value),
80
+ "Input validation failed",
81
+ );
82
+ if (!parsed.ok) {
83
+ return [parsed, { status: "invalid" }];
84
+ }
85
+ const payload = parsed.value;
86
+ const body = encodeJSON("body", payload, { explode: true });
87
+
88
+ const path = pathToFunc("/v2/gateway/images/generations")();
89
+
90
+ const headers = new Headers(compactMap({
91
+ "Content-Type": "application/json",
92
+ Accept: "application/json",
93
+ }));
94
+
95
+ const secConfig = await extractSecurity(client._options.apiKey);
96
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
97
+ const requestSecurity = resolveGlobalSecurity(securityInput);
98
+
99
+ const context = {
100
+ options: client._options,
101
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
102
+ operationID: "createImage",
103
+ oAuth2Scopes: null,
104
+
105
+ resolvedSecurity: requestSecurity,
106
+
107
+ securitySource: client._options.apiKey,
108
+ retryConfig: options?.retries
109
+ || client._options.retryConfig
110
+ || { strategy: "none" },
111
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
112
+ };
113
+
114
+ const requestRes = client._createRequest(context, {
115
+ security: requestSecurity,
116
+ method: "POST",
117
+ baseURL: options?.serverURL,
118
+ path: path,
119
+ headers: headers,
120
+ body: body,
121
+ userAgent: client._options.userAgent,
122
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
123
+ }, options);
124
+ if (!requestRes.ok) {
125
+ return [requestRes, { status: "invalid" }];
126
+ }
127
+ const req = requestRes.value;
128
+
129
+ const doResult = await client._do(req, {
130
+ context,
131
+ errorCodes: ["4XX", "5XX"],
132
+ retryConfig: context.retryConfig,
133
+ retryCodes: context.retryCodes,
134
+ });
135
+ if (!doResult.ok) {
136
+ return [doResult, { status: "request-error", request: req }];
137
+ }
138
+ const response = doResult.value;
139
+
140
+ const [result] = await M.match<
141
+ operations.CreateImageResponseBody,
142
+ | OrqError
143
+ | ResponseValidationError
144
+ | ConnectionError
145
+ | RequestAbortedError
146
+ | RequestTimeoutError
147
+ | InvalidRequestError
148
+ | UnexpectedClientError
149
+ | SDKValidationError
150
+ >(
151
+ M.json(200, operations.CreateImageResponseBody$inboundSchema),
152
+ M.fail("4XX"),
153
+ M.fail("5XX"),
154
+ )(response, req);
155
+ if (!result.ok) {
156
+ return [result, { status: "complete", request: req, response }];
157
+ }
158
+
159
+ return [result, { status: "complete", request: req, response }];
160
+ }
package/src/lib/config.ts CHANGED
@@ -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.1.0-rc.45",
72
- genVersion: "2.785.0",
73
- userAgent: "speakeasy-sdk/typescript 4.1.0-rc.45 2.785.0 2.0 @orq-ai/node",
71
+ sdkVersion: "4.1.0-rc.50",
72
+ genVersion: "2.787.2",
73
+ userAgent: "speakeasy-sdk/typescript 4.1.0-rc.50 2.787.2 2.0 @orq-ai/node",
74
74
  } as const;
@@ -31,7 +31,7 @@ export class EventStream<T extends SseMessage<unknown>>
31
31
  const message = buffer.slice(0, match.index);
32
32
  buffer = buffer.slice(match.index + match.length);
33
33
  const item = parseMessage(message, parse);
34
- if (item?.value) return downstream.enqueue(item.value);
34
+ if (item && !item.done) return downstream.enqueue(item.value);
35
35
  if (item?.done) {
36
36
  await upstream.cancel("done");
37
37
  return downstream.close();
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "4.1.0-rc.45",
22
+ currentVersion: "4.1.0-rc.50",
23
23
  },
24
24
  });
25
25
 
@@ -109,6 +109,8 @@ import { tool$promptsListVersions } from "./tools/promptsListVersions.js";
109
109
  import { tool$promptsRetrieve } from "./tools/promptsRetrieve.js";
110
110
  import { tool$promptsUpdate } from "./tools/promptsUpdate.js";
111
111
  import { tool$remoteconfigsRetrieve } from "./tools/remoteconfigsRetrieve.js";
112
+ import { tool$routerChatCompletions } from "./tools/routerChatCompletions.js";
113
+ import { tool$routerImagesGenerate } from "./tools/routerImagesGenerate.js";
112
114
  import { tool$toolsCreate } from "./tools/toolsCreate.js";
113
115
  import { tool$toolsDelete } from "./tools/toolsDelete.js";
114
116
  import { tool$toolsList } from "./tools/toolsList.js";
@@ -127,7 +129,7 @@ export function createMCPServer(deps: {
127
129
  }) {
128
130
  const server = new McpServer({
129
131
  name: "Orq",
130
- version: "4.1.0-rc.45",
132
+ version: "4.1.0-rc.50",
131
133
  });
132
134
 
133
135
  const client = new OrqCore({
@@ -258,6 +260,8 @@ export function createMCPServer(deps: {
258
260
  tool(tool$datasetsUpdateDatapoint);
259
261
  tool(tool$datasetsDeleteDatapoint);
260
262
  tool(tool$datasetsClear);
263
+ tool(tool$routerChatCompletions);
264
+ tool(tool$routerImagesGenerate);
261
265
  tool(tool$deploymentsMetricsCreate);
262
266
  tool(tool$agentsResponsesCreate);
263
267
 
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { routerChatCompletions } from "../../funcs/routerChatCompletions.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.CreateChatCompletionRequestBody$inboundSchema,
11
+ };
12
+
13
+ export const tool$routerChatCompletions: ToolDefinition<typeof args> = {
14
+ name: "router-chat-completions",
15
+ description: `Create chat completion
16
+
17
+ Creates a model response for the given chat conversation with support for retries, fallbacks, prompts, and variables.`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await routerChatCompletions(
21
+ client,
22
+ args.request,
23
+ { fetchOptions: { signal: ctx.signal } },
24
+ ).$inspect();
25
+
26
+ if (!result.ok) {
27
+ return {
28
+ content: [{ type: "text", text: result.error.message }],
29
+ isError: true,
30
+ };
31
+ }
32
+
33
+ const value = result.value;
34
+
35
+ return formatResult(value, apiCall);
36
+ },
37
+ };
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { routerImagesGenerate } from "../../funcs/routerImagesGenerate.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.CreateImageRequestBody$inboundSchema,
11
+ };
12
+
13
+ export const tool$routerImagesGenerate: ToolDefinition<typeof args> = {
14
+ name: "router-images-generate",
15
+ description: `Create image
16
+
17
+ Create an Image`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await routerImagesGenerate(
21
+ client,
22
+ args.request,
23
+ { fetchOptions: { signal: ctx.signal } },
24
+ ).$inspect();
25
+
26
+ if (!result.ok) {
27
+ return {
28
+ content: [{ type: "text", text: result.error.message }],
29
+ isError: true,
30
+ };
31
+ }
32
+
33
+ const value = result.value;
34
+
35
+ return formatResult(value, apiCall);
36
+ },
37
+ };
@@ -128,7 +128,7 @@ export const ConversationResponse$inboundSchema: z.ZodType<
128
128
  z.ZodTypeDef,
129
129
  unknown
130
130
  > = z.object({
131
- _id: z.string().default("conv_01kckc7b338cb3jf55mt7y9g9s"),
131
+ _id: z.string().default("conv_01kccay59y23wgde9jv5bxed8q"),
132
132
  entityId: z.string(),
133
133
  kind: ConversationResponseKind$inboundSchema,
134
134
  displayName: z.string(),
@@ -161,7 +161,7 @@ export const ConversationResponse$outboundSchema: z.ZodType<
161
161
  z.ZodTypeDef,
162
162
  ConversationResponse
163
163
  > = z.object({
164
- id: z.string().default("conv_01kckc7b338cb3jf55mt7y9g9s"),
164
+ id: z.string().default("conv_01kccay59y23wgde9jv5bxed8q"),
165
165
  entityId: z.string(),
166
166
  kind: ConversationResponseKind$outboundSchema,
167
167
  displayName: z.string(),
@@ -27,6 +27,7 @@ export * from "./invokedeploymentrequest.js";
27
27
  export * from "./partdelta.js";
28
28
  export * from "./partdeltaevent.js";
29
29
  export * from "./partdoneevent.js";
30
+ export * from "./publiccontact.js";
30
31
  export * from "./reasoningpart.js";
31
32
  export * from "./reasoningpartschema.js";
32
33
  export * from "./redactedreasoningpartschema.js";
@@ -79,7 +79,7 @@ export const PartReasoningPart$inboundSchema: z.ZodType<
79
79
  z.ZodTypeDef,
80
80
  unknown
81
81
  > = z.object({
82
- _id: z.string().default("reasoning_01kckc7avp9y2kn1bt8e9race6"),
82
+ _id: z.string().default("reasoning_01kccay57r85aj4k5nhfcrxavv"),
83
83
  metadata: z.record(z.any()).optional(),
84
84
  kind: PartKind$inboundSchema,
85
85
  reasoning: z.string(),
@@ -104,7 +104,7 @@ export const PartReasoningPart$outboundSchema: z.ZodType<
104
104
  z.ZodTypeDef,
105
105
  PartReasoningPart
106
106
  > = z.object({
107
- id: z.string().default("reasoning_01kckc7avp9y2kn1bt8e9race6"),
107
+ id: z.string().default("reasoning_01kccay57r85aj4k5nhfcrxavv"),
108
108
  metadata: z.record(z.any()).optional(),
109
109
  kind: PartKind$outboundSchema,
110
110
  reasoning: z.string(),
@@ -0,0 +1,99 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Information about the contact making the request. If the contact does not exist, it will be created automatically.
13
+ */
14
+ export type PublicContact = {
15
+ /**
16
+ * Unique identifier for the contact
17
+ */
18
+ id: string;
19
+ /**
20
+ * Display name of the contact
21
+ */
22
+ displayName?: string | undefined;
23
+ /**
24
+ * Email address of the contact
25
+ */
26
+ email?: string | undefined;
27
+ /**
28
+ * A hash of key/value pairs containing any other data about the contact
29
+ */
30
+ metadata?: Array<{ [k: string]: any }> | undefined;
31
+ /**
32
+ * URL to the contact's avatar or logo
33
+ */
34
+ logoUrl?: string | undefined;
35
+ /**
36
+ * A list of tags associated with the contact
37
+ */
38
+ tags?: Array<string> | undefined;
39
+ };
40
+
41
+ /** @internal */
42
+ export const PublicContact$inboundSchema: z.ZodType<
43
+ PublicContact,
44
+ z.ZodTypeDef,
45
+ unknown
46
+ > = z.object({
47
+ id: z.string(),
48
+ display_name: z.string().optional(),
49
+ email: z.string().optional(),
50
+ metadata: z.array(z.record(z.any())).optional(),
51
+ logo_url: z.string().optional(),
52
+ tags: z.array(z.string()).optional(),
53
+ }).transform((v) => {
54
+ return remap$(v, {
55
+ "display_name": "displayName",
56
+ "logo_url": "logoUrl",
57
+ });
58
+ });
59
+ /** @internal */
60
+ export type PublicContact$Outbound = {
61
+ id: string;
62
+ display_name?: string | undefined;
63
+ email?: string | undefined;
64
+ metadata?: Array<{ [k: string]: any }> | undefined;
65
+ logo_url?: string | undefined;
66
+ tags?: Array<string> | undefined;
67
+ };
68
+
69
+ /** @internal */
70
+ export const PublicContact$outboundSchema: z.ZodType<
71
+ PublicContact$Outbound,
72
+ z.ZodTypeDef,
73
+ PublicContact
74
+ > = z.object({
75
+ id: z.string(),
76
+ displayName: z.string().optional(),
77
+ email: z.string().optional(),
78
+ metadata: z.array(z.record(z.any())).optional(),
79
+ logoUrl: z.string().optional(),
80
+ tags: z.array(z.string()).optional(),
81
+ }).transform((v) => {
82
+ return remap$(v, {
83
+ displayName: "display_name",
84
+ logoUrl: "logo_url",
85
+ });
86
+ });
87
+
88
+ export function publicContactToJSON(publicContact: PublicContact): string {
89
+ return JSON.stringify(PublicContact$outboundSchema.parse(publicContact));
90
+ }
91
+ export function publicContactFromJSON(
92
+ jsonString: string,
93
+ ): SafeParseResult<PublicContact, SDKValidationError> {
94
+ return safeParse(
95
+ jsonString,
96
+ (x) => PublicContact$inboundSchema.parse(JSON.parse(x)),
97
+ `Failed to parse 'PublicContact' from JSON`,
98
+ );
99
+ }
@@ -40,7 +40,7 @@ export const ReasoningPart$inboundSchema: z.ZodType<
40
40
  z.ZodTypeDef,
41
41
  unknown
42
42
  > = z.object({
43
- _id: z.string().default("reasoning_01kckc7avj58725yp5ns9g35hg"),
43
+ _id: z.string().default("reasoning_01kccay57q9egzwbd8qgqqf2th"),
44
44
  metadata: z.record(z.any()).optional(),
45
45
  kind: z.literal("reasoning"),
46
46
  reasoning: z.string(),
@@ -65,7 +65,7 @@ export const ReasoningPart$outboundSchema: z.ZodType<
65
65
  z.ZodTypeDef,
66
66
  ReasoningPart
67
67
  > = z.object({
68
- id: z.string().default("reasoning_01kckc7avj58725yp5ns9g35hg"),
68
+ id: z.string().default("reasoning_01kccay57q9egzwbd8qgqqf2th"),
69
69
  metadata: z.record(z.any()).optional(),
70
70
  kind: z.literal("reasoning"),
71
71
  reasoning: z.string(),