@orq-ai/node 3.12.4 → 3.12.7

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 (205) hide show
  1. package/README.md +0 -1
  2. package/bin/mcp-server.js +112 -112
  3. package/bin/mcp-server.js.map +33 -33
  4. package/docs/sdks/deployments/README.md +0 -2
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/deploymentsStream.js +5 -2
  7. package/funcs/deploymentsStream.js.map +1 -1
  8. package/jsr.json +1 -1
  9. package/lib/config.d.ts +3 -3
  10. package/lib/config.js +3 -3
  11. package/lib/event-streams.d.ts +3 -3
  12. package/lib/event-streams.d.ts.map +1 -1
  13. package/lib/event-streams.js.map +1 -1
  14. package/mcp-server/mcp-server.js +1 -1
  15. package/mcp-server/server.js +1 -1
  16. package/models/operations/createbudget.js +2 -2
  17. package/models/operations/createcontact.js +2 -2
  18. package/models/operations/createdataset.js +2 -2
  19. package/models/operations/createdatasetitem.js +2 -2
  20. package/models/operations/createdatasource.js +2 -2
  21. package/models/operations/createeval.js +16 -16
  22. package/models/operations/fileget.js +2 -2
  23. package/models/operations/filelist.js +2 -2
  24. package/models/operations/fileupload.js +2 -2
  25. package/models/operations/getbudget.js +2 -2
  26. package/models/operations/getevals.js +28 -28
  27. package/models/operations/listbudgets.js +2 -2
  28. package/models/operations/listcontacts.js +2 -2
  29. package/models/operations/listdatasetdatapoints.js +2 -2
  30. package/models/operations/listdatasets.js +2 -2
  31. package/models/operations/listdatasources.js +2 -2
  32. package/models/operations/retrievecontact.js +2 -2
  33. package/models/operations/retrievedatapoint.js +2 -2
  34. package/models/operations/retrievedataset.js +2 -2
  35. package/models/operations/retrievedatasource.js +2 -2
  36. package/models/operations/updatebudget.js +2 -2
  37. package/models/operations/updatecontact.js +2 -2
  38. package/models/operations/updatedatapoint.js +2 -2
  39. package/models/operations/updatedataset.js +2 -2
  40. package/models/operations/updatedatasource.js +2 -2
  41. package/models/operations/updateeval.js +16 -16
  42. package/package.json +1 -1
  43. package/packages/orq-rc/FUNCTIONS.md +9 -19
  44. package/packages/orq-rc/README.md +180 -181
  45. package/packages/orq-rc/docs/sdks/agents/README.md +702 -0
  46. package/packages/orq-rc/docs/sdks/budgets/README.md +5 -5
  47. package/packages/orq-rc/docs/sdks/memorystores/README.md +1172 -0
  48. package/packages/orq-rc/docs/sdks/orq/README.md +81 -0
  49. package/packages/orq-rc/examples/package-lock.json +1 -1
  50. package/packages/orq-rc/examples/postV2AgentsInternal.example.ts +30 -0
  51. package/packages/orq-rc/jsr.json +1 -1
  52. package/packages/orq-rc/package-lock.json +2 -2
  53. package/packages/orq-rc/package.json +1 -1
  54. package/packages/orq-rc/src/funcs/agentsList.ts +167 -0
  55. package/packages/orq-rc/src/funcs/agentsListActions.ts +169 -0
  56. package/packages/orq-rc/src/funcs/agentsRetrieve.ts +175 -0
  57. package/packages/orq-rc/src/funcs/agentsRetrieveAction.ts +173 -0
  58. package/packages/orq-rc/src/funcs/agentsRetrieveTask.ts +179 -0
  59. package/packages/orq-rc/src/funcs/agentsReviewAction.ts +177 -0
  60. package/packages/orq-rc/src/funcs/agentsRun.ts +163 -0
  61. package/packages/orq-rc/src/funcs/agentsStreamRun.ts +187 -0
  62. package/packages/orq-rc/src/funcs/budgetsCreate.ts +1 -1
  63. package/packages/orq-rc/src/funcs/budgetsGet.ts +2 -2
  64. package/packages/orq-rc/src/funcs/budgetsList.ts +2 -2
  65. package/packages/orq-rc/src/funcs/memoryStoresCreate.ts +171 -0
  66. package/packages/orq-rc/src/funcs/memoryStoresCreateDocument.ts +175 -0
  67. package/packages/orq-rc/src/funcs/memoryStoresCreateMemory.ts +170 -0
  68. package/packages/orq-rc/src/funcs/memoryStoresDelete.ts +168 -0
  69. package/packages/orq-rc/src/funcs/memoryStoresDeleteDocument.ts +184 -0
  70. package/packages/orq-rc/src/funcs/memoryStoresDeleteMemory.ts +179 -0
  71. package/packages/orq-rc/src/funcs/memoryStoresList.ts +178 -0
  72. package/packages/orq-rc/src/funcs/memoryStoresListDocuments.ts +181 -0
  73. package/packages/orq-rc/src/funcs/memoryStoresListMemories.ts +176 -0
  74. package/packages/orq-rc/src/funcs/memoryStoresRetrieve.ts +177 -0
  75. package/packages/orq-rc/src/funcs/memoryStoresRetrieveDocument.ts +178 -0
  76. package/packages/orq-rc/src/funcs/memoryStoresRetrieveMemory.ts +173 -0
  77. package/packages/orq-rc/src/funcs/memoryStoresUpdate.ts +168 -0
  78. package/packages/orq-rc/src/funcs/memoryStoresUpdateDocument.ts +179 -0
  79. package/packages/orq-rc/src/funcs/memoryStoresUpdateMemory.ts +174 -0
  80. package/packages/orq-rc/src/funcs/postV2AgentsInternal.ts +159 -0
  81. package/packages/orq-rc/src/lib/config.ts +3 -3
  82. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  83. package/packages/orq-rc/src/mcp-server/server.ts +49 -1
  84. package/packages/orq-rc/src/mcp-server/tools/agentsList.ts +37 -0
  85. package/packages/orq-rc/src/mcp-server/tools/agentsListActions.ts +35 -0
  86. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieve.ts +37 -0
  87. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveAction.ts +35 -0
  88. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveTask.ts +37 -0
  89. package/packages/orq-rc/src/mcp-server/tools/agentsReviewAction.ts +37 -0
  90. package/packages/orq-rc/src/mcp-server/tools/agentsRun.ts +37 -0
  91. package/packages/orq-rc/src/mcp-server/tools/agentsStreamRun.ts +37 -0
  92. package/packages/orq-rc/src/mcp-server/tools/budgetsCreate.ts +1 -1
  93. package/packages/orq-rc/src/mcp-server/tools/budgetsGet.ts +2 -2
  94. package/packages/orq-rc/src/mcp-server/tools/budgetsList.ts +2 -2
  95. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreate.ts +35 -0
  96. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateDocument.ts +37 -0
  97. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateMemory.ts +37 -0
  98. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDelete.ts +35 -0
  99. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteDocument.ts +40 -0
  100. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteMemory.ts +40 -0
  101. package/packages/orq-rc/src/mcp-server/tools/memoryStoresList.ts +37 -0
  102. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListDocuments.ts +37 -0
  103. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListMemories.ts +37 -0
  104. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieve.ts +37 -0
  105. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveDocument.ts +37 -0
  106. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveMemory.ts +37 -0
  107. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdate.ts +37 -0
  108. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateDocument.ts +37 -0
  109. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateMemory.ts +37 -0
  110. package/packages/orq-rc/src/mcp-server/tools/postV2AgentsInternal.ts +33 -0
  111. package/packages/orq-rc/src/models/errors/getagent.ts +80 -0
  112. package/packages/orq-rc/src/models/errors/getagenttask.ts +80 -0
  113. package/packages/orq-rc/src/models/errors/index.ts +3 -0
  114. package/packages/orq-rc/src/models/errors/streamrunagent.ts +80 -0
  115. package/packages/orq-rc/src/models/operations/createbudget.ts +57 -58
  116. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  117. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  118. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
  119. package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
  120. package/packages/orq-rc/src/models/operations/createeval.ts +6383 -1075
  121. package/packages/orq-rc/src/models/operations/creatememory.ts +265 -0
  122. package/packages/orq-rc/src/models/operations/creatememorydocument.ts +284 -0
  123. package/packages/orq-rc/src/models/operations/creatememorystore.ts +1956 -0
  124. package/packages/orq-rc/src/models/operations/deletememory.ts +87 -0
  125. package/packages/orq-rc/src/models/operations/deletememorydocument.ts +98 -0
  126. package/packages/orq-rc/src/models/operations/deletememorystore.ts +78 -0
  127. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +36 -27
  128. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +31 -24
  129. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  130. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  131. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  132. package/packages/orq-rc/src/models/operations/getagent.ts +1171 -0
  133. package/packages/orq-rc/src/models/operations/getagenttask.ts +257 -0
  134. package/packages/orq-rc/src/models/operations/getallmemories.ts +315 -0
  135. package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +335 -0
  136. package/packages/orq-rc/src/models/operations/getallmemorystores.ts +1241 -0
  137. package/packages/orq-rc/src/models/operations/getbudget.ts +2 -11
  138. package/packages/orq-rc/src/models/operations/getevals.ts +1362 -1166
  139. package/packages/orq-rc/src/models/operations/index.ts +24 -0
  140. package/packages/orq-rc/src/models/operations/listactions.ts +517 -0
  141. package/packages/orq-rc/src/models/operations/listagents.ts +1335 -0
  142. package/packages/orq-rc/src/models/operations/listbudgets.ts +5 -15
  143. package/packages/orq-rc/src/models/operations/listchunks.ts +21 -21
  144. package/packages/orq-rc/src/models/operations/listcontacts.ts +44 -37
  145. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
  146. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  147. package/packages/orq-rc/src/models/operations/listdatasources.ts +29 -22
  148. package/packages/orq-rc/src/models/operations/postv2agentsinternal.ts +103 -0
  149. package/packages/orq-rc/src/models/operations/retrieveaction.ts +419 -0
  150. package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
  151. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
  152. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  153. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
  154. package/packages/orq-rc/src/models/operations/retrievememory.ts +198 -0
  155. package/packages/orq-rc/src/models/operations/retrievememorydocument.ts +217 -0
  156. package/packages/orq-rc/src/models/operations/retrievememorystore.ts +1124 -0
  157. package/packages/orq-rc/src/models/operations/reviewaction.ts +258 -0
  158. package/packages/orq-rc/src/models/operations/runagent.ts +3428 -0
  159. package/packages/orq-rc/src/models/operations/streamrunagent.ts +3361 -0
  160. package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -11
  161. package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
  162. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
  163. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  164. package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
  165. package/packages/orq-rc/src/models/operations/updateeval.ts +6627 -1224
  166. package/packages/orq-rc/src/models/operations/updatememory.ts +274 -0
  167. package/packages/orq-rc/src/models/operations/updatememorydocument.ts +293 -0
  168. package/packages/orq-rc/src/models/operations/updatememorystore.ts +1348 -0
  169. package/packages/orq-rc/src/models/operations/updateprompt.ts +64 -19
  170. package/packages/orq-rc/src/sdk/agents.ts +148 -0
  171. package/packages/orq-rc/src/sdk/budgets.ts +5 -5
  172. package/packages/orq-rc/src/sdk/memorystores.ts +286 -0
  173. package/packages/orq-rc/src/sdk/sdk.ts +27 -1
  174. package/src/funcs/deploymentsStream.ts +11 -10
  175. package/src/lib/config.ts +3 -3
  176. package/src/lib/event-streams.ts +6 -8
  177. package/src/mcp-server/mcp-server.ts +1 -1
  178. package/src/mcp-server/server.ts +1 -1
  179. package/src/models/operations/createbudget.ts +2 -2
  180. package/src/models/operations/createcontact.ts +2 -2
  181. package/src/models/operations/createdataset.ts +2 -2
  182. package/src/models/operations/createdatasetitem.ts +2 -2
  183. package/src/models/operations/createdatasource.ts +2 -2
  184. package/src/models/operations/createeval.ts +16 -16
  185. package/src/models/operations/fileget.ts +2 -2
  186. package/src/models/operations/filelist.ts +2 -2
  187. package/src/models/operations/fileupload.ts +2 -2
  188. package/src/models/operations/getbudget.ts +2 -2
  189. package/src/models/operations/getevals.ts +28 -28
  190. package/src/models/operations/listbudgets.ts +2 -2
  191. package/src/models/operations/listcontacts.ts +2 -2
  192. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  193. package/src/models/operations/listdatasets.ts +2 -2
  194. package/src/models/operations/listdatasources.ts +2 -2
  195. package/src/models/operations/retrievecontact.ts +2 -2
  196. package/src/models/operations/retrievedatapoint.ts +2 -2
  197. package/src/models/operations/retrievedataset.ts +2 -2
  198. package/src/models/operations/retrievedatasource.ts +2 -2
  199. package/src/models/operations/updatebudget.ts +2 -2
  200. package/src/models/operations/updatecontact.ts +2 -2
  201. package/src/models/operations/updatedatapoint.ts +2 -2
  202. package/src/models/operations/updatedataset.ts +2 -2
  203. package/src/models/operations/updatedatasource.ts +2 -2
  204. package/src/models/operations/updateeval.ts +16 -16
  205. package/packages/orq-rc/examples/contactsCreate.example.ts +0 -42
@@ -0,0 +1,702 @@
1
+ # Agents
2
+ (*agents*)
3
+
4
+ ## Overview
5
+
6
+ ### Available Operations
7
+
8
+ * [list](#list) - List all agents
9
+ * [retrieve](#retrieve) - Get an agent
10
+ * [retrieveTask](#retrievetask) - Retrieve a specific agent task
11
+ * [run](#run) - Run an agent
12
+ * [streamRun](#streamrun) - Run and stream agent execution
13
+ * [listActions](#listactions) - List all actions
14
+ * [retrieveAction](#retrieveaction) - Retrieve an action executed by an agent task.
15
+ * [reviewAction](#reviewaction) - Review a tool execution
16
+
17
+ ## list
18
+
19
+ Retrieves a paginated list of all agents in your workspace. Each agent includes its configuration, primary model, and optional fallback model settings.
20
+
21
+ ### Example Usage
22
+
23
+ <!-- UsageSnippet language="typescript" operationID="ListAgents" method="get" path="/v2/agents/" -->
24
+ ```typescript
25
+ import { Orq } from "@orq-ai/node";
26
+
27
+ const orq = new Orq({
28
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
29
+ });
30
+
31
+ async function run() {
32
+ const result = await orq.agents.list({});
33
+
34
+ console.log(result);
35
+ }
36
+
37
+ run();
38
+ ```
39
+
40
+ ### Standalone function
41
+
42
+ The standalone function version of this method:
43
+
44
+ ```typescript
45
+ import { OrqCore } from "@orq-ai/node/core.js";
46
+ import { agentsList } from "@orq-ai/node/funcs/agentsList.js";
47
+
48
+ // Use `OrqCore` for best tree-shaking performance.
49
+ // You can create one instance of it to use across an application.
50
+ const orq = new OrqCore({
51
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
52
+ });
53
+
54
+ async function run() {
55
+ const res = await agentsList(orq, {});
56
+ if (res.ok) {
57
+ const { value: result } = res;
58
+ console.log(result);
59
+ } else {
60
+ console.log("agentsList failed:", res.error);
61
+ }
62
+ }
63
+
64
+ run();
65
+ ```
66
+
67
+ ### Parameters
68
+
69
+ | Parameter | Type | Required | Description |
70
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
71
+ | `request` | [operations.ListAgentsRequest](../../models/operations/listagentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
72
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
73
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
74
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
75
+
76
+ ### Response
77
+
78
+ **Promise\<[operations.ListAgentsResponseBody](../../models/operations/listagentsresponsebody.md)\>**
79
+
80
+ ### Errors
81
+
82
+ | Error Type | Status Code | Content Type |
83
+ | --------------- | --------------- | --------------- |
84
+ | errors.APIError | 4XX, 5XX | \*/\* |
85
+
86
+ ## retrieve
87
+
88
+ Retrieves a single agent by ID, including its full configuration with primary and fallback model settings.
89
+
90
+ ### Example Usage
91
+
92
+ <!-- UsageSnippet language="typescript" operationID="GetAgent" method="get" path="/v2/agents/{id}" -->
93
+ ```typescript
94
+ import { Orq } from "@orq-ai/node";
95
+
96
+ const orq = new Orq({
97
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
98
+ });
99
+
100
+ async function run() {
101
+ const result = await orq.agents.retrieve({
102
+ id: "<id>",
103
+ });
104
+
105
+ console.log(result);
106
+ }
107
+
108
+ run();
109
+ ```
110
+
111
+ ### Standalone function
112
+
113
+ The standalone function version of this method:
114
+
115
+ ```typescript
116
+ import { OrqCore } from "@orq-ai/node/core.js";
117
+ import { agentsRetrieve } from "@orq-ai/node/funcs/agentsRetrieve.js";
118
+
119
+ // Use `OrqCore` for best tree-shaking performance.
120
+ // You can create one instance of it to use across an application.
121
+ const orq = new OrqCore({
122
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
123
+ });
124
+
125
+ async function run() {
126
+ const res = await agentsRetrieve(orq, {
127
+ id: "<id>",
128
+ });
129
+ if (res.ok) {
130
+ const { value: result } = res;
131
+ console.log(result);
132
+ } else {
133
+ console.log("agentsRetrieve failed:", res.error);
134
+ }
135
+ }
136
+
137
+ run();
138
+ ```
139
+
140
+ ### Parameters
141
+
142
+ | Parameter | Type | Required | Description |
143
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
144
+ | `request` | [operations.GetAgentRequest](../../models/operations/getagentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
145
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
146
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
147
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
148
+
149
+ ### Response
150
+
151
+ **Promise\<[operations.GetAgentResponseBody](../../models/operations/getagentresponsebody.md)\>**
152
+
153
+ ### Errors
154
+
155
+ | Error Type | Status Code | Content Type |
156
+ | --------------------------- | --------------------------- | --------------------------- |
157
+ | errors.GetAgentResponseBody | 404 | application/json |
158
+ | errors.APIError | 4XX, 5XX | \*/\* |
159
+
160
+ ## retrieveTask
161
+
162
+ Retrieves detailed information about a specific task for a given agent, including execution status and results.
163
+
164
+ ### Example Usage
165
+
166
+ <!-- UsageSnippet language="typescript" operationID="GetAgentTask" method="get" path="/v2/agents/{id}/tasks/{task_id}" -->
167
+ ```typescript
168
+ import { Orq } from "@orq-ai/node";
169
+
170
+ const orq = new Orq({
171
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
172
+ });
173
+
174
+ async function run() {
175
+ const result = await orq.agents.retrieveTask({
176
+ id: "<id>",
177
+ taskId: "<id>",
178
+ });
179
+
180
+ console.log(result);
181
+ }
182
+
183
+ run();
184
+ ```
185
+
186
+ ### Standalone function
187
+
188
+ The standalone function version of this method:
189
+
190
+ ```typescript
191
+ import { OrqCore } from "@orq-ai/node/core.js";
192
+ import { agentsRetrieveTask } from "@orq-ai/node/funcs/agentsRetrieveTask.js";
193
+
194
+ // Use `OrqCore` for best tree-shaking performance.
195
+ // You can create one instance of it to use across an application.
196
+ const orq = new OrqCore({
197
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
198
+ });
199
+
200
+ async function run() {
201
+ const res = await agentsRetrieveTask(orq, {
202
+ id: "<id>",
203
+ taskId: "<id>",
204
+ });
205
+ if (res.ok) {
206
+ const { value: result } = res;
207
+ console.log(result);
208
+ } else {
209
+ console.log("agentsRetrieveTask failed:", res.error);
210
+ }
211
+ }
212
+
213
+ run();
214
+ ```
215
+
216
+ ### Parameters
217
+
218
+ | Parameter | Type | Required | Description |
219
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
220
+ | `request` | [operations.GetAgentTaskRequest](../../models/operations/getagenttaskrequest.md) | :heavy_check_mark: | The request object to use for the request. |
221
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
222
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
223
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
224
+
225
+ ### Response
226
+
227
+ **Promise\<[operations.GetAgentTaskResponseBody](../../models/operations/getagenttaskresponsebody.md)\>**
228
+
229
+ ### Errors
230
+
231
+ | Error Type | Status Code | Content Type |
232
+ | ------------------------------- | ------------------------------- | ------------------------------- |
233
+ | errors.GetAgentTaskResponseBody | 404 | application/json |
234
+ | errors.APIError | 4XX, 5XX | \*/\* |
235
+
236
+ ## run
237
+
238
+ Executes an agent with the provided configuration using A2A message format. If the agent already exists with the same configuration, it will be reused. If the configuration differs, a new version is created. The fallback model is configured at the agent level and will be used automatically if the primary model fails during execution.
239
+
240
+ ### Example Usage
241
+
242
+ <!-- UsageSnippet language="typescript" operationID="RunAgent" method="post" path="/v2/agents/run" -->
243
+ ```typescript
244
+ import { Orq } from "@orq-ai/node";
245
+
246
+ const orq = new Orq({
247
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
248
+ });
249
+
250
+ async function run() {
251
+ const result = await orq.agents.run({
252
+ key: "<key>",
253
+ model: "F-150",
254
+ role: "<value>",
255
+ instructions: "<value>",
256
+ message: {
257
+ role: "tool",
258
+ parts: [
259
+ {
260
+ kind: "data",
261
+ },
262
+ ],
263
+ },
264
+ path: "Default",
265
+ settings: {
266
+ tools: [
267
+ {
268
+ type: "query_memory_store",
269
+ requiresApproval: false,
270
+ },
271
+ ],
272
+ },
273
+ });
274
+
275
+ console.log(result);
276
+ }
277
+
278
+ run();
279
+ ```
280
+
281
+ ### Standalone function
282
+
283
+ The standalone function version of this method:
284
+
285
+ ```typescript
286
+ import { OrqCore } from "@orq-ai/node/core.js";
287
+ import { agentsRun } from "@orq-ai/node/funcs/agentsRun.js";
288
+
289
+ // Use `OrqCore` for best tree-shaking performance.
290
+ // You can create one instance of it to use across an application.
291
+ const orq = new OrqCore({
292
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
293
+ });
294
+
295
+ async function run() {
296
+ const res = await agentsRun(orq, {
297
+ key: "<key>",
298
+ model: "F-150",
299
+ role: "<value>",
300
+ instructions: "<value>",
301
+ message: {
302
+ role: "tool",
303
+ parts: [
304
+ {
305
+ kind: "data",
306
+ },
307
+ ],
308
+ },
309
+ path: "Default",
310
+ settings: {
311
+ tools: [
312
+ {
313
+ type: "query_memory_store",
314
+ requiresApproval: false,
315
+ },
316
+ ],
317
+ },
318
+ });
319
+ if (res.ok) {
320
+ const { value: result } = res;
321
+ console.log(result);
322
+ } else {
323
+ console.log("agentsRun failed:", res.error);
324
+ }
325
+ }
326
+
327
+ run();
328
+ ```
329
+
330
+ ### Parameters
331
+
332
+ | Parameter | Type | Required | Description |
333
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
334
+ | `request` | [operations.RunAgentRequestBody](../../models/operations/runagentrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
335
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
336
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
337
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
338
+
339
+ ### Response
340
+
341
+ **Promise\<[operations.RunAgentResponseBody](../../models/operations/runagentresponsebody.md)\>**
342
+
343
+ ### Errors
344
+
345
+ | Error Type | Status Code | Content Type |
346
+ | --------------- | --------------- | --------------- |
347
+ | errors.APIError | 4XX, 5XX | \*/\* |
348
+
349
+ ## streamRun
350
+
351
+ Creates or updates an agent with the provided configuration, then streams execution events via Server-Sent Events (SSE). If the agent already exists with the same configuration, it will be reused. If the configuration differs, a new version is created. The stream will continue until the agent completes, errors, or reaches the configured timeout.
352
+
353
+ ### Example Usage
354
+
355
+ <!-- UsageSnippet language="typescript" operationID="StreamRunAgent" method="post" path="/v2/agents/stream-run" -->
356
+ ```typescript
357
+ import { Orq } from "@orq-ai/node";
358
+
359
+ const orq = new Orq({
360
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
361
+ });
362
+
363
+ async function run() {
364
+ const result = await orq.agents.streamRun({
365
+ key: "<key>",
366
+ model: "Alpine",
367
+ role: "<value>",
368
+ instructions: "<value>",
369
+ message: {
370
+ role: "user",
371
+ parts: [
372
+ {
373
+ kind: "file",
374
+ file: {
375
+ uri: "https://jumbo-zebra.info/",
376
+ },
377
+ },
378
+ ],
379
+ },
380
+ path: "Default",
381
+ settings: {
382
+ tools: [
383
+ {
384
+ type: "query_memory_store",
385
+ requiresApproval: false,
386
+ },
387
+ ],
388
+ },
389
+ });
390
+
391
+ for await (const event of result) {
392
+ // Handle the event
393
+ console.log(event);
394
+ }
395
+ }
396
+
397
+ run();
398
+ ```
399
+
400
+ ### Standalone function
401
+
402
+ The standalone function version of this method:
403
+
404
+ ```typescript
405
+ import { OrqCore } from "@orq-ai/node/core.js";
406
+ import { agentsStreamRun } from "@orq-ai/node/funcs/agentsStreamRun.js";
407
+
408
+ // Use `OrqCore` for best tree-shaking performance.
409
+ // You can create one instance of it to use across an application.
410
+ const orq = new OrqCore({
411
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
412
+ });
413
+
414
+ async function run() {
415
+ const res = await agentsStreamRun(orq, {
416
+ key: "<key>",
417
+ model: "Alpine",
418
+ role: "<value>",
419
+ instructions: "<value>",
420
+ message: {
421
+ role: "user",
422
+ parts: [
423
+ {
424
+ kind: "file",
425
+ file: {
426
+ uri: "https://jumbo-zebra.info/",
427
+ },
428
+ },
429
+ ],
430
+ },
431
+ path: "Default",
432
+ settings: {
433
+ tools: [
434
+ {
435
+ type: "query_memory_store",
436
+ requiresApproval: false,
437
+ },
438
+ ],
439
+ },
440
+ });
441
+ if (res.ok) {
442
+ const { value: result } = res;
443
+ for await (const event of result) {
444
+ // Handle the event
445
+ console.log(event);
446
+ }
447
+ } else {
448
+ console.log("agentsStreamRun failed:", res.error);
449
+ }
450
+ }
451
+
452
+ run();
453
+ ```
454
+
455
+ ### Parameters
456
+
457
+ | Parameter | Type | Required | Description |
458
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
459
+ | `request` | [operations.StreamRunAgentRequestBody](../../models/operations/streamrunagentrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
460
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
461
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
462
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
463
+
464
+ ### Response
465
+
466
+ **Promise\<[EventStream<operations.StreamRunAgentResponseBody>](../../models/.md)\>**
467
+
468
+ ### Errors
469
+
470
+ | Error Type | Status Code | Content Type |
471
+ | --------------------------------- | --------------------------------- | --------------------------------- |
472
+ | errors.StreamRunAgentResponseBody | 404 | application/json |
473
+ | errors.APIError | 4XX, 5XX | \*/\* |
474
+
475
+ ## listActions
476
+
477
+ List all actions
478
+
479
+ ### Example Usage
480
+
481
+ <!-- UsageSnippet language="typescript" operationID="ListActions" method="get" path="/v2/agents/{agent_key}/tasks/{task_id}/actions" -->
482
+ ```typescript
483
+ import { Orq } from "@orq-ai/node";
484
+
485
+ const orq = new Orq({
486
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
487
+ });
488
+
489
+ async function run() {
490
+ const result = await orq.agents.listActions({
491
+ agentKey: "<value>",
492
+ taskId: "<id>",
493
+ });
494
+
495
+ console.log(result);
496
+ }
497
+
498
+ run();
499
+ ```
500
+
501
+ ### Standalone function
502
+
503
+ The standalone function version of this method:
504
+
505
+ ```typescript
506
+ import { OrqCore } from "@orq-ai/node/core.js";
507
+ import { agentsListActions } from "@orq-ai/node/funcs/agentsListActions.js";
508
+
509
+ // Use `OrqCore` for best tree-shaking performance.
510
+ // You can create one instance of it to use across an application.
511
+ const orq = new OrqCore({
512
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
513
+ });
514
+
515
+ async function run() {
516
+ const res = await agentsListActions(orq, {
517
+ agentKey: "<value>",
518
+ taskId: "<id>",
519
+ });
520
+ if (res.ok) {
521
+ const { value: result } = res;
522
+ console.log(result);
523
+ } else {
524
+ console.log("agentsListActions failed:", res.error);
525
+ }
526
+ }
527
+
528
+ run();
529
+ ```
530
+
531
+ ### Parameters
532
+
533
+ | Parameter | Type | Required | Description |
534
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
535
+ | `request` | [operations.ListActionsRequest](../../models/operations/listactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
536
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
537
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
538
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
539
+
540
+ ### Response
541
+
542
+ **Promise\<[operations.ListActionsResponseBody](../../models/operations/listactionsresponsebody.md)\>**
543
+
544
+ ### Errors
545
+
546
+ | Error Type | Status Code | Content Type |
547
+ | --------------- | --------------- | --------------- |
548
+ | errors.APIError | 4XX, 5XX | \*/\* |
549
+
550
+ ## retrieveAction
551
+
552
+ Retrieve an action executed by an agent task.
553
+
554
+ ### Example Usage
555
+
556
+ <!-- UsageSnippet language="typescript" operationID="RetrieveAction" method="get" path="/v2/agents/{agent_key}/tasks/{task_id}/actions/{action_id}" -->
557
+ ```typescript
558
+ import { Orq } from "@orq-ai/node";
559
+
560
+ const orq = new Orq({
561
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
562
+ });
563
+
564
+ async function run() {
565
+ const result = await orq.agents.retrieveAction({
566
+ agentKey: "<value>",
567
+ taskId: "<id>",
568
+ actionId: "<id>",
569
+ });
570
+
571
+ console.log(result);
572
+ }
573
+
574
+ run();
575
+ ```
576
+
577
+ ### Standalone function
578
+
579
+ The standalone function version of this method:
580
+
581
+ ```typescript
582
+ import { OrqCore } from "@orq-ai/node/core.js";
583
+ import { agentsRetrieveAction } from "@orq-ai/node/funcs/agentsRetrieveAction.js";
584
+
585
+ // Use `OrqCore` for best tree-shaking performance.
586
+ // You can create one instance of it to use across an application.
587
+ const orq = new OrqCore({
588
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
589
+ });
590
+
591
+ async function run() {
592
+ const res = await agentsRetrieveAction(orq, {
593
+ agentKey: "<value>",
594
+ taskId: "<id>",
595
+ actionId: "<id>",
596
+ });
597
+ if (res.ok) {
598
+ const { value: result } = res;
599
+ console.log(result);
600
+ } else {
601
+ console.log("agentsRetrieveAction failed:", res.error);
602
+ }
603
+ }
604
+
605
+ run();
606
+ ```
607
+
608
+ ### Parameters
609
+
610
+ | Parameter | Type | Required | Description |
611
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
612
+ | `request` | [operations.RetrieveActionRequest](../../models/operations/retrieveactionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
613
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
614
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
615
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
616
+
617
+ ### Response
618
+
619
+ **Promise\<[operations.RetrieveActionResponseBody](../../models/operations/retrieveactionresponsebody.md)\>**
620
+
621
+ ### Errors
622
+
623
+ | Error Type | Status Code | Content Type |
624
+ | --------------- | --------------- | --------------- |
625
+ | errors.APIError | 4XX, 5XX | \*/\* |
626
+
627
+ ## reviewAction
628
+
629
+ Review a tool execution and approve, reject or mock it. This will trigger the next step in the agent execution.
630
+
631
+ ### Example Usage
632
+
633
+ <!-- UsageSnippet language="typescript" operationID="ReviewAction" method="post" path="/v2/agents/{agent_key}/tasks/{task_id}/actions/{action_id}/review" -->
634
+ ```typescript
635
+ import { Orq } from "@orq-ai/node";
636
+
637
+ const orq = new Orq({
638
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
639
+ });
640
+
641
+ async function run() {
642
+ const result = await orq.agents.reviewAction({
643
+ agentKey: "<value>",
644
+ taskId: "<id>",
645
+ actionId: "<id>",
646
+ });
647
+
648
+ console.log(result);
649
+ }
650
+
651
+ run();
652
+ ```
653
+
654
+ ### Standalone function
655
+
656
+ The standalone function version of this method:
657
+
658
+ ```typescript
659
+ import { OrqCore } from "@orq-ai/node/core.js";
660
+ import { agentsReviewAction } from "@orq-ai/node/funcs/agentsReviewAction.js";
661
+
662
+ // Use `OrqCore` for best tree-shaking performance.
663
+ // You can create one instance of it to use across an application.
664
+ const orq = new OrqCore({
665
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
666
+ });
667
+
668
+ async function run() {
669
+ const res = await agentsReviewAction(orq, {
670
+ agentKey: "<value>",
671
+ taskId: "<id>",
672
+ actionId: "<id>",
673
+ });
674
+ if (res.ok) {
675
+ const { value: result } = res;
676
+ console.log(result);
677
+ } else {
678
+ console.log("agentsReviewAction failed:", res.error);
679
+ }
680
+ }
681
+
682
+ run();
683
+ ```
684
+
685
+ ### Parameters
686
+
687
+ | Parameter | Type | Required | Description |
688
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
689
+ | `request` | [operations.ReviewActionRequest](../../models/operations/reviewactionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
690
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
691
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
692
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
693
+
694
+ ### Response
695
+
696
+ **Promise\<[operations.ReviewActionResponseBody](../../models/operations/reviewactionresponsebody.md)\>**
697
+
698
+ ### Errors
699
+
700
+ | Error Type | Status Code | Content Type |
701
+ | --------------- | --------------- | --------------- |
702
+ | errors.APIError | 4XX, 5XX | \*/\* |