@orq-ai/node 3.13.4 → 3.13.5
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.
- package/bin/mcp-server.js +202 -202
- package/bin/mcp-server.js.map +39 -39
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/operations/createbudget.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +2 -2
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createtool.js +14 -14
- package/models/operations/duplicatetool.js +10 -10
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getagent.js +2 -2
- package/models/operations/getalltools.js +10 -10
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/listagents.js +2 -2
- package/models/operations/listbudgets.js +2 -2
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +2 -2
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +2 -2
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +10 -10
- package/models/operations/runagent.js +2 -2
- package/models/operations/streamrunagent.js +2 -2
- package/models/operations/updatebudget.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +2 -2
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +28 -28
- package/models/operations/updatetool.js +14 -14
- package/package.json +1 -1
- package/packages/orq-rc/README.md +96 -93
- package/packages/orq-rc/docs/sdks/agents/README.md +95 -20
- package/packages/orq-rc/examples/package-lock.json +1 -1
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/agentsListTasks.ts +183 -0
- package/packages/orq-rc/src/funcs/agentsRetrieve.ts +3 -3
- package/packages/orq-rc/src/lib/config.ts +2 -2
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +4 -2
- package/packages/orq-rc/src/mcp-server/tools/agentsListTasks.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/agentsRetrieve.ts +1 -1
- package/packages/orq-rc/src/models/errors/index.ts +1 -0
- package/packages/orq-rc/src/models/errors/listagenttasks.ts +80 -0
- package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/createtool.ts +10 -10
- package/packages/orq-rc/src/models/operations/duplicatetool.ts +10 -10
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/getagent.ts +23 -15
- package/packages/orq-rc/src/models/operations/getalltools.ts +10 -10
- package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/index.ts +1 -0
- package/packages/orq-rc/src/models/operations/listagents.ts +10 -10
- package/packages/orq-rc/src/models/operations/listagenttasks.ts +1099 -0
- package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listchunks.ts +21 -21
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +29 -22
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievetool.ts +10 -10
- package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/updatetool.ts +10 -10
- package/packages/orq-rc/src/sdk/agents.ts +25 -7
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/operations/createbudget.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +2 -2
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createtool.ts +14 -14
- package/src/models/operations/duplicatetool.ts +10 -10
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getagent.ts +2 -2
- package/src/models/operations/getalltools.ts +10 -10
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listagents.ts +2 -2
- package/src/models/operations/listbudgets.ts +2 -2
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +2 -2
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +10 -10
- package/src/models/operations/runagent.ts +2 -2
- package/src/models/operations/streamrunagent.ts +2 -2
- package/src/models/operations/updatebudget.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +2 -2
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +28 -28
- package/src/models/operations/updatetool.ts +14 -14
|
@@ -5,14 +5,91 @@
|
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
+
* [retrieveTask](#retrievetask) - Retrieve a specific agent task
|
|
8
9
|
* [list](#list) - List all agents
|
|
9
10
|
* [retrieve](#retrieve) - Get an agent
|
|
10
|
-
* [
|
|
11
|
+
* [listTasks](#listtasks) - List all tasks for an agent
|
|
11
12
|
* [run](#run) - Run an agent
|
|
12
13
|
* [streamRun](#streamrun) - Run and stream agent execution
|
|
13
14
|
* [listActions](#listactions) - List all actions
|
|
14
15
|
* [retrieveAction](#retrieveaction) - Retrieve an action executed by an agent task.
|
|
15
16
|
|
|
17
|
+
## retrieveTask
|
|
18
|
+
|
|
19
|
+
Retrieves detailed information about a specific task for a given agent, including execution status and results.
|
|
20
|
+
|
|
21
|
+
### Example Usage
|
|
22
|
+
|
|
23
|
+
<!-- UsageSnippet language="typescript" operationID="GetAgentTask" method="get" path="/v2/agents/{agent_key}/tasks/{task_id}" -->
|
|
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.retrieveTask({
|
|
33
|
+
agentKey: "<value>",
|
|
34
|
+
taskId: "<id>",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
console.log(result);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
run();
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Standalone function
|
|
44
|
+
|
|
45
|
+
The standalone function version of this method:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
49
|
+
import { agentsRetrieveTask } from "@orq-ai/node/funcs/agentsRetrieveTask.js";
|
|
50
|
+
|
|
51
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
52
|
+
// You can create one instance of it to use across an application.
|
|
53
|
+
const orq = new OrqCore({
|
|
54
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
async function run() {
|
|
58
|
+
const res = await agentsRetrieveTask(orq, {
|
|
59
|
+
agentKey: "<value>",
|
|
60
|
+
taskId: "<id>",
|
|
61
|
+
});
|
|
62
|
+
if (res.ok) {
|
|
63
|
+
const { value: result } = res;
|
|
64
|
+
console.log(result);
|
|
65
|
+
} else {
|
|
66
|
+
console.log("agentsRetrieveTask failed:", res.error);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
run();
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Parameters
|
|
74
|
+
|
|
75
|
+
| Parameter | Type | Required | Description |
|
|
76
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
77
|
+
| `request` | [operations.GetAgentTaskRequest](../../models/operations/getagenttaskrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
78
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
79
|
+
| `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. |
|
|
80
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
81
|
+
|
|
82
|
+
### Response
|
|
83
|
+
|
|
84
|
+
**Promise\<[operations.GetAgentTaskResponseBody](../../models/operations/getagenttaskresponsebody.md)\>**
|
|
85
|
+
|
|
86
|
+
### Errors
|
|
87
|
+
|
|
88
|
+
| Error Type | Status Code | Content Type |
|
|
89
|
+
| ------------------------------- | ------------------------------- | ------------------------------- |
|
|
90
|
+
| errors.GetAgentTaskResponseBody | 404 | application/json |
|
|
91
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
92
|
+
|
|
16
93
|
## list
|
|
17
94
|
|
|
18
95
|
Retrieves a paginated list of all agents in your workspace. Each agent includes its configuration, primary model, and optional fallback model settings.
|
|
@@ -84,11 +161,11 @@ run();
|
|
|
84
161
|
|
|
85
162
|
## retrieve
|
|
86
163
|
|
|
87
|
-
Retrieves a single agent by
|
|
164
|
+
Retrieves a single agent by its unique key, including its full configuration with primary and fallback model settings.
|
|
88
165
|
|
|
89
166
|
### Example Usage
|
|
90
167
|
|
|
91
|
-
<!-- UsageSnippet language="typescript" operationID="GetAgent" method="get" path="/v2/agents/{
|
|
168
|
+
<!-- UsageSnippet language="typescript" operationID="GetAgent" method="get" path="/v2/agents/{agent_key}" -->
|
|
92
169
|
```typescript
|
|
93
170
|
import { Orq } from "@orq-ai/node";
|
|
94
171
|
|
|
@@ -98,7 +175,7 @@ const orq = new Orq({
|
|
|
98
175
|
|
|
99
176
|
async function run() {
|
|
100
177
|
const result = await orq.agents.retrieve({
|
|
101
|
-
|
|
178
|
+
agentKey: "<value>",
|
|
102
179
|
});
|
|
103
180
|
|
|
104
181
|
console.log(result);
|
|
@@ -123,7 +200,7 @@ const orq = new OrqCore({
|
|
|
123
200
|
|
|
124
201
|
async function run() {
|
|
125
202
|
const res = await agentsRetrieve(orq, {
|
|
126
|
-
|
|
203
|
+
agentKey: "<value>",
|
|
127
204
|
});
|
|
128
205
|
if (res.ok) {
|
|
129
206
|
const { value: result } = res;
|
|
@@ -156,13 +233,13 @@ run();
|
|
|
156
233
|
| errors.GetAgentResponseBody | 404 | application/json |
|
|
157
234
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
158
235
|
|
|
159
|
-
##
|
|
236
|
+
## listTasks
|
|
160
237
|
|
|
161
|
-
Retrieves
|
|
238
|
+
Retrieves a paginated list of all tasks associated with a specific agent, optionally filtered by status.
|
|
162
239
|
|
|
163
240
|
### Example Usage
|
|
164
241
|
|
|
165
|
-
<!-- UsageSnippet language="typescript" operationID="
|
|
242
|
+
<!-- UsageSnippet language="typescript" operationID="ListAgentTasks" method="get" path="/v2/agents/{agent_key}/tasks" -->
|
|
166
243
|
```typescript
|
|
167
244
|
import { Orq } from "@orq-ai/node";
|
|
168
245
|
|
|
@@ -171,9 +248,8 @@ const orq = new Orq({
|
|
|
171
248
|
});
|
|
172
249
|
|
|
173
250
|
async function run() {
|
|
174
|
-
const result = await orq.agents.
|
|
251
|
+
const result = await orq.agents.listTasks({
|
|
175
252
|
agentKey: "<value>",
|
|
176
|
-
taskId: "<id>",
|
|
177
253
|
});
|
|
178
254
|
|
|
179
255
|
console.log(result);
|
|
@@ -188,7 +264,7 @@ The standalone function version of this method:
|
|
|
188
264
|
|
|
189
265
|
```typescript
|
|
190
266
|
import { OrqCore } from "@orq-ai/node/core.js";
|
|
191
|
-
import {
|
|
267
|
+
import { agentsListTasks } from "@orq-ai/node/funcs/agentsListTasks.js";
|
|
192
268
|
|
|
193
269
|
// Use `OrqCore` for best tree-shaking performance.
|
|
194
270
|
// You can create one instance of it to use across an application.
|
|
@@ -197,15 +273,14 @@ const orq = new OrqCore({
|
|
|
197
273
|
});
|
|
198
274
|
|
|
199
275
|
async function run() {
|
|
200
|
-
const res = await
|
|
276
|
+
const res = await agentsListTasks(orq, {
|
|
201
277
|
agentKey: "<value>",
|
|
202
|
-
taskId: "<id>",
|
|
203
278
|
});
|
|
204
279
|
if (res.ok) {
|
|
205
280
|
const { value: result } = res;
|
|
206
281
|
console.log(result);
|
|
207
282
|
} else {
|
|
208
|
-
console.log("
|
|
283
|
+
console.log("agentsListTasks failed:", res.error);
|
|
209
284
|
}
|
|
210
285
|
}
|
|
211
286
|
|
|
@@ -216,21 +291,21 @@ run();
|
|
|
216
291
|
|
|
217
292
|
| Parameter | Type | Required | Description |
|
|
218
293
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
219
|
-
| `request` | [operations.
|
|
294
|
+
| `request` | [operations.ListAgentTasksRequest](../../models/operations/listagenttasksrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
220
295
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
221
296
|
| `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. |
|
|
222
297
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
223
298
|
|
|
224
299
|
### Response
|
|
225
300
|
|
|
226
|
-
**Promise\<[operations.
|
|
301
|
+
**Promise\<[operations.ListAgentTasksResponseBody](../../models/operations/listagenttasksresponsebody.md)\>**
|
|
227
302
|
|
|
228
303
|
### Errors
|
|
229
304
|
|
|
230
|
-
| Error Type
|
|
231
|
-
|
|
|
232
|
-
| errors.
|
|
233
|
-
| errors.APIError
|
|
305
|
+
| Error Type | Status Code | Content Type |
|
|
306
|
+
| --------------------------------- | --------------------------------- | --------------------------------- |
|
|
307
|
+
| errors.ListAgentTasksResponseBody | 404 | application/json |
|
|
308
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
234
309
|
|
|
235
310
|
## run
|
|
236
311
|
|
package/packages/orq-rc/jsr.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orq-ai/node",
|
|
3
|
-
"version": "3.14.0-rc.
|
|
3
|
+
"version": "3.14.0-rc.7",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@orq-ai/node",
|
|
9
|
-
"version": "3.14.0-rc.
|
|
9
|
+
"version": "3.14.0-rc.7",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"zod": "^3.20.0"
|
|
12
12
|
},
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, 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 {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* List all tasks for an agent
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Retrieves a paginated list of all tasks associated with a specific agent, optionally filtered by status.
|
|
33
|
+
*/
|
|
34
|
+
export function agentsListTasks(
|
|
35
|
+
client: OrqCore,
|
|
36
|
+
request: operations.ListAgentTasksRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.ListAgentTasksResponseBody,
|
|
41
|
+
| errors.ListAgentTasksResponseBody
|
|
42
|
+
| OrqError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: OrqCore,
|
|
61
|
+
request: operations.ListAgentTasksRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
operations.ListAgentTasksResponseBody,
|
|
67
|
+
| errors.ListAgentTasksResponseBody
|
|
68
|
+
| OrqError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) => operations.ListAgentTasksRequest$outboundSchema.parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = null;
|
|
90
|
+
|
|
91
|
+
const pathParams = {
|
|
92
|
+
agent_key: encodeSimple("agent_key", payload.agent_key, {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "percent",
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/v2/agents/{agent_key}/tasks")(pathParams);
|
|
99
|
+
|
|
100
|
+
const query = encodeFormQuery({
|
|
101
|
+
"ending_before": payload.ending_before,
|
|
102
|
+
"limit": payload.limit,
|
|
103
|
+
"starting_after": payload.starting_after,
|
|
104
|
+
"status": payload.status,
|
|
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: "ListAgentTasks",
|
|
119
|
+
oAuth2Scopes: [],
|
|
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
|
+
query: query,
|
|
137
|
+
body: body,
|
|
138
|
+
userAgent: client._options.userAgent,
|
|
139
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
140
|
+
}, options);
|
|
141
|
+
if (!requestRes.ok) {
|
|
142
|
+
return [requestRes, { status: "invalid" }];
|
|
143
|
+
}
|
|
144
|
+
const req = requestRes.value;
|
|
145
|
+
|
|
146
|
+
const doResult = await client._do(req, {
|
|
147
|
+
context,
|
|
148
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
149
|
+
retryConfig: context.retryConfig,
|
|
150
|
+
retryCodes: context.retryCodes,
|
|
151
|
+
});
|
|
152
|
+
if (!doResult.ok) {
|
|
153
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
|
+
}
|
|
155
|
+
const response = doResult.value;
|
|
156
|
+
|
|
157
|
+
const responseFields = {
|
|
158
|
+
HttpMeta: { Response: response, Request: req },
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const [result] = await M.match<
|
|
162
|
+
operations.ListAgentTasksResponseBody,
|
|
163
|
+
| errors.ListAgentTasksResponseBody
|
|
164
|
+
| OrqError
|
|
165
|
+
| ResponseValidationError
|
|
166
|
+
| ConnectionError
|
|
167
|
+
| RequestAbortedError
|
|
168
|
+
| RequestTimeoutError
|
|
169
|
+
| InvalidRequestError
|
|
170
|
+
| UnexpectedClientError
|
|
171
|
+
| SDKValidationError
|
|
172
|
+
>(
|
|
173
|
+
M.json(200, operations.ListAgentTasksResponseBody$inboundSchema),
|
|
174
|
+
M.jsonErr(404, errors.ListAgentTasksResponseBody$inboundSchema),
|
|
175
|
+
M.fail("4XX"),
|
|
176
|
+
M.fail("5XX"),
|
|
177
|
+
)(response, req, { extraFields: responseFields });
|
|
178
|
+
if (!result.ok) {
|
|
179
|
+
return [result, { status: "complete", request: req, response }];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return [result, { status: "complete", request: req, response }];
|
|
183
|
+
}
|
|
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
* Get an agent
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Retrieves a single agent by
|
|
32
|
+
* Retrieves a single agent by its unique key, including its full configuration with primary and fallback model settings.
|
|
33
33
|
*/
|
|
34
34
|
export function agentsRetrieve(
|
|
35
35
|
client: OrqCore,
|
|
@@ -89,13 +89,13 @@ async function $do(
|
|
|
89
89
|
const body = null;
|
|
90
90
|
|
|
91
91
|
const pathParams = {
|
|
92
|
-
|
|
92
|
+
agent_key: encodeSimple("agent_key", payload.agent_key, {
|
|
93
93
|
explode: false,
|
|
94
94
|
charEncoding: "percent",
|
|
95
95
|
}),
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
const path = pathToFunc("/v2/agents/{
|
|
98
|
+
const path = pathToFunc("/v2/agents/{agent_key}")(pathParams);
|
|
99
99
|
|
|
100
100
|
const headers = new Headers(compactMap({
|
|
101
101
|
Accept: "application/json",
|
|
@@ -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: "3.14.0-rc.
|
|
71
|
+
sdkVersion: "3.14.0-rc.7",
|
|
72
72
|
genVersion: "2.721.0",
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 3.14.0-rc.
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 3.14.0-rc.7 2.721.0 2.0 @orq-ai/node",
|
|
74
74
|
} as const;
|
|
@@ -15,6 +15,7 @@ import { MCPScope } from "./scopes.js";
|
|
|
15
15
|
import { createRegisterTool } from "./tools.js";
|
|
16
16
|
import { tool$agentsList } from "./tools/agentsList.js";
|
|
17
17
|
import { tool$agentsListActions } from "./tools/agentsListActions.js";
|
|
18
|
+
import { tool$agentsListTasks } from "./tools/agentsListTasks.js";
|
|
18
19
|
import { tool$agentsRetrieve } from "./tools/agentsRetrieve.js";
|
|
19
20
|
import { tool$agentsRetrieveAction } from "./tools/agentsRetrieveAction.js";
|
|
20
21
|
import { tool$agentsRetrieveTask } from "./tools/agentsRetrieveTask.js";
|
|
@@ -156,7 +157,7 @@ export function createMCPServer(deps: {
|
|
|
156
157
|
}) {
|
|
157
158
|
const server = new McpServer({
|
|
158
159
|
name: "Orq",
|
|
159
|
-
version: "3.14.0-rc.
|
|
160
|
+
version: "3.14.0-rc.7",
|
|
160
161
|
});
|
|
161
162
|
|
|
162
163
|
const client = new OrqCore({
|
|
@@ -198,9 +199,10 @@ export function createMCPServer(deps: {
|
|
|
198
199
|
tool(tool$deploymentsGetConfig);
|
|
199
200
|
tool(tool$deploymentsInvoke);
|
|
200
201
|
tool(tool$deploymentsStream);
|
|
202
|
+
tool(tool$agentsRetrieveTask);
|
|
201
203
|
tool(tool$agentsList);
|
|
202
204
|
tool(tool$agentsRetrieve);
|
|
203
|
-
tool(tool$
|
|
205
|
+
tool(tool$agentsListTasks);
|
|
204
206
|
tool(tool$agentsRun);
|
|
205
207
|
tool(tool$agentsStreamRun);
|
|
206
208
|
tool(tool$agentsListActions);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { agentsListTasks } from "../../funcs/agentsListTasks.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListAgentTasksRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$agentsListTasks: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "agents-list-tasks",
|
|
15
|
+
description: `List all tasks for an agent
|
|
16
|
+
|
|
17
|
+
Retrieves a paginated list of all tasks associated with a specific agent, optionally filtered by status.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await agentsListTasks(
|
|
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
|
+
};
|
|
@@ -14,7 +14,7 @@ export const tool$agentsRetrieve: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "agents-retrieve",
|
|
15
15
|
description: `Get an agent
|
|
16
16
|
|
|
17
|
-
Retrieves a single agent by
|
|
17
|
+
Retrieves a single agent by its unique key, including its full configuration with primary and fallback model settings.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await agentsRetrieve(
|
|
@@ -51,6 +51,7 @@ export * from "./getpromptversion.js";
|
|
|
51
51
|
export * from "./honoapierror.js";
|
|
52
52
|
export * from "./httpclienterrors.js";
|
|
53
53
|
export * from "./invokeeval.js";
|
|
54
|
+
export * from "./listagenttasks.js";
|
|
54
55
|
export * from "./orqerror.js";
|
|
55
56
|
export * from "./responsevalidationerror.js";
|
|
56
57
|
export * from "./retrievecontact.js";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { OrqError } from "./orqerror.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* No agent tasks found
|
|
10
|
+
*/
|
|
11
|
+
export type ListAgentTasksResponseBodyData = {
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* No agent tasks found
|
|
17
|
+
*/
|
|
18
|
+
export class ListAgentTasksResponseBody extends OrqError {
|
|
19
|
+
/** The original data that was passed to this error instance. */
|
|
20
|
+
data$: ListAgentTasksResponseBodyData;
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
err: ListAgentTasksResponseBodyData,
|
|
24
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
25
|
+
) {
|
|
26
|
+
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
27
|
+
super(message, httpMeta);
|
|
28
|
+
this.data$ = err;
|
|
29
|
+
|
|
30
|
+
this.name = "ListAgentTasksResponseBody";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const ListAgentTasksResponseBody$inboundSchema: z.ZodType<
|
|
36
|
+
ListAgentTasksResponseBody,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
unknown
|
|
39
|
+
> = z.object({
|
|
40
|
+
message: z.string(),
|
|
41
|
+
request$: z.instanceof(Request),
|
|
42
|
+
response$: z.instanceof(Response),
|
|
43
|
+
body$: z.string(),
|
|
44
|
+
})
|
|
45
|
+
.transform((v) => {
|
|
46
|
+
return new ListAgentTasksResponseBody(v, {
|
|
47
|
+
request: v.request$,
|
|
48
|
+
response: v.response$,
|
|
49
|
+
body: v.body$,
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type ListAgentTasksResponseBody$Outbound = {
|
|
55
|
+
message: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const ListAgentTasksResponseBody$outboundSchema: z.ZodType<
|
|
60
|
+
ListAgentTasksResponseBody$Outbound,
|
|
61
|
+
z.ZodTypeDef,
|
|
62
|
+
ListAgentTasksResponseBody
|
|
63
|
+
> = z.instanceof(ListAgentTasksResponseBody)
|
|
64
|
+
.transform(v => v.data$)
|
|
65
|
+
.pipe(z.object({
|
|
66
|
+
message: z.string(),
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
72
|
+
*/
|
|
73
|
+
export namespace ListAgentTasksResponseBody$ {
|
|
74
|
+
/** @deprecated use `ListAgentTasksResponseBody$inboundSchema` instead. */
|
|
75
|
+
export const inboundSchema = ListAgentTasksResponseBody$inboundSchema;
|
|
76
|
+
/** @deprecated use `ListAgentTasksResponseBody$outboundSchema` instead. */
|
|
77
|
+
export const outboundSchema = ListAgentTasksResponseBody$outboundSchema;
|
|
78
|
+
/** @deprecated use `ListAgentTasksResponseBody$Outbound` instead. */
|
|
79
|
+
export type Outbound = ListAgentTasksResponseBody$Outbound;
|
|
80
|
+
}
|