@orq-ai/node 4.0.2 → 4.0.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 +213 -213
- package/bin/mcp-server.js.map +36 -36
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- 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 +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createtool.js +12 -12
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getalltools.js +12 -12
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/listbudgets.js +2 -2
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +8 -8
- 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 +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +12 -12
- 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 +8 -8
- 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 +38 -47
- package/packages/orq-rc/docs/sdks/agents/README.md +230 -529
- package/packages/orq-rc/docs/sdks/responses/README.md +60 -65
- 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/agentsCreate.ts +16 -14
- package/packages/orq-rc/src/funcs/agentsDelete.ts +10 -6
- package/packages/orq-rc/src/funcs/agentsInvoke.ts +16 -6
- package/packages/orq-rc/src/funcs/agentsList.ts +18 -6
- package/packages/orq-rc/src/funcs/agentsResponsesCreate.ts +23 -12
- package/packages/orq-rc/src/funcs/agentsRetrieve.ts +21 -16
- package/packages/orq-rc/src/funcs/agentsRun.ts +4 -2
- package/packages/orq-rc/src/funcs/agentsStream.ts +16 -6
- package/packages/orq-rc/src/funcs/agentsStreamRun.ts +4 -2
- package/packages/orq-rc/src/funcs/agentsUpdate.ts +14 -6
- 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 +1 -9
- package/packages/orq-rc/src/mcp-server/tools/agentsCreate.ts +3 -3
- package/packages/orq-rc/src/mcp-server/tools/agentsDelete.ts +5 -5
- package/packages/orq-rc/src/mcp-server/tools/agentsInvoke.ts +7 -4
- package/packages/orq-rc/src/mcp-server/tools/agentsList.ts +9 -5
- package/packages/orq-rc/src/mcp-server/tools/agentsResponsesCreate.ts +8 -4
- package/packages/orq-rc/src/mcp-server/tools/agentsRetrieve.ts +5 -5
- package/packages/orq-rc/src/mcp-server/tools/agentsRun.ts +2 -2
- package/packages/orq-rc/src/mcp-server/tools/agentsStream.ts +7 -4
- package/packages/orq-rc/src/mcp-server/tools/agentsStreamRun.ts +2 -2
- package/packages/orq-rc/src/mcp-server/tools/agentsUpdate.ts +8 -4
- package/packages/orq-rc/src/models/errors/createagentrequest.ts +67 -0
- package/packages/orq-rc/src/models/errors/deleteagent.ts +2 -2
- package/packages/orq-rc/src/models/errors/index.ts +2 -3
- package/packages/orq-rc/src/models/errors/{listagenttasks.ts → retrieveagentrequest.ts} +15 -15
- package/packages/orq-rc/src/models/errors/updateagent.ts +2 -2
- package/packages/orq-rc/src/models/operations/{createagent.ts → createagentrequest.ts} +1643 -1485
- package/packages/orq-rc/src/models/operations/{createagentresponse.ts → createagentresponserequest.ts} +141 -127
- 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 +8 -8
- 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/createprompt.ts +4 -4
- package/packages/orq-rc/src/models/operations/createtool.ts +12 -12
- 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/getalltools.ts +12 -12
- 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 +3 -7
- package/packages/orq-rc/src/models/operations/invokeagent.ts +153 -190
- package/packages/orq-rc/src/models/operations/listagents.ts +9 -21
- package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +3741 -0
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +8 -8
- 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 +12 -12
- package/packages/orq-rc/src/models/operations/runagent.ts +53 -57
- package/packages/orq-rc/src/models/operations/streamagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +68 -82
- package/packages/orq-rc/src/models/operations/updateagent.ts +17 -17
- 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 +8 -8
- 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/updateprompt.ts +4 -4
- package/packages/orq-rc/src/models/operations/updatetool.ts +14 -14
- package/packages/orq-rc/src/sdk/agents.ts +51 -99
- package/packages/orq-rc/src/sdk/responses.ts +7 -5
- package/src/lib/config.ts +2 -2
- 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 +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createtool.ts +12 -12
- 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/getalltools.ts +12 -12
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listbudgets.ts +2 -2
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- 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 +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +12 -12
- 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 +8 -8
- 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
- package/packages/orq-rc/src/funcs/agentsListActions.ts +0 -169
- package/packages/orq-rc/src/funcs/agentsListTasks.ts +0 -183
- package/packages/orq-rc/src/funcs/agentsRetrieveAction.ts +0 -173
- package/packages/orq-rc/src/funcs/agentsRetrieveTask.ts +0 -179
- package/packages/orq-rc/src/mcp-server/tools/agentsListActions.ts +0 -35
- package/packages/orq-rc/src/mcp-server/tools/agentsListTasks.ts +0 -37
- package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveAction.ts +0 -35
- package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveTask.ts +0 -37
- package/packages/orq-rc/src/models/errors/createagent.ts +0 -67
- package/packages/orq-rc/src/models/errors/getagent.ts +0 -67
- package/packages/orq-rc/src/models/operations/getagent.ts +0 -3480
- package/packages/orq-rc/src/models/operations/getagenttask.ts +0 -2389
- package/packages/orq-rc/src/models/operations/listactions.ts +0 -427
- package/packages/orq-rc/src/models/operations/listagenttasks.ts +0 -2614
- package/packages/orq-rc/src/models/operations/retrieveaction.ts +0 -354
|
@@ -1,183 +0,0 @@
|
|
|
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.ListAgentTasksAgentTasksListResponse,
|
|
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.ListAgentTasksAgentTasksListResponse,
|
|
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: null,
|
|
120
|
-
|
|
121
|
-
resolvedSecurity: requestSecurity,
|
|
122
|
-
|
|
123
|
-
securitySource: client._options.apiKey,
|
|
124
|
-
retryConfig: options?.retries
|
|
125
|
-
|| client._options.retryConfig
|
|
126
|
-
|| { strategy: "none" },
|
|
127
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const requestRes = client._createRequest(context, {
|
|
131
|
-
security: requestSecurity,
|
|
132
|
-
method: "GET",
|
|
133
|
-
baseURL: options?.serverURL,
|
|
134
|
-
path: path,
|
|
135
|
-
headers: headers,
|
|
136
|
-
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.ListAgentTasksAgentTasksListResponse,
|
|
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.ListAgentTasksAgentTasksListResponse$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
|
-
}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { OrqCore } from "../core.js";
|
|
6
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import {
|
|
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
|
-
* Retrieve an action executed by an agent task.
|
|
29
|
-
*/
|
|
30
|
-
export function agentsRetrieveAction(
|
|
31
|
-
client: OrqCore,
|
|
32
|
-
request: operations.RetrieveActionRequest,
|
|
33
|
-
options?: RequestOptions,
|
|
34
|
-
): APIPromise<
|
|
35
|
-
Result<
|
|
36
|
-
operations.RetrieveActionResponseBody,
|
|
37
|
-
| OrqError
|
|
38
|
-
| ResponseValidationError
|
|
39
|
-
| ConnectionError
|
|
40
|
-
| RequestAbortedError
|
|
41
|
-
| RequestTimeoutError
|
|
42
|
-
| InvalidRequestError
|
|
43
|
-
| UnexpectedClientError
|
|
44
|
-
| SDKValidationError
|
|
45
|
-
>
|
|
46
|
-
> {
|
|
47
|
-
return new APIPromise($do(
|
|
48
|
-
client,
|
|
49
|
-
request,
|
|
50
|
-
options,
|
|
51
|
-
));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async function $do(
|
|
55
|
-
client: OrqCore,
|
|
56
|
-
request: operations.RetrieveActionRequest,
|
|
57
|
-
options?: RequestOptions,
|
|
58
|
-
): Promise<
|
|
59
|
-
[
|
|
60
|
-
Result<
|
|
61
|
-
operations.RetrieveActionResponseBody,
|
|
62
|
-
| OrqError
|
|
63
|
-
| ResponseValidationError
|
|
64
|
-
| ConnectionError
|
|
65
|
-
| RequestAbortedError
|
|
66
|
-
| RequestTimeoutError
|
|
67
|
-
| InvalidRequestError
|
|
68
|
-
| UnexpectedClientError
|
|
69
|
-
| SDKValidationError
|
|
70
|
-
>,
|
|
71
|
-
APICall,
|
|
72
|
-
]
|
|
73
|
-
> {
|
|
74
|
-
const parsed = safeParse(
|
|
75
|
-
request,
|
|
76
|
-
(value) => operations.RetrieveActionRequest$outboundSchema.parse(value),
|
|
77
|
-
"Input validation failed",
|
|
78
|
-
);
|
|
79
|
-
if (!parsed.ok) {
|
|
80
|
-
return [parsed, { status: "invalid" }];
|
|
81
|
-
}
|
|
82
|
-
const payload = parsed.value;
|
|
83
|
-
const body = null;
|
|
84
|
-
|
|
85
|
-
const pathParams = {
|
|
86
|
-
action_id: encodeSimple("action_id", payload.action_id, {
|
|
87
|
-
explode: false,
|
|
88
|
-
charEncoding: "percent",
|
|
89
|
-
}),
|
|
90
|
-
agent_key: encodeSimple("agent_key", payload.agent_key, {
|
|
91
|
-
explode: false,
|
|
92
|
-
charEncoding: "percent",
|
|
93
|
-
}),
|
|
94
|
-
task_id: encodeSimple("task_id", payload.task_id, {
|
|
95
|
-
explode: false,
|
|
96
|
-
charEncoding: "percent",
|
|
97
|
-
}),
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const path = pathToFunc(
|
|
101
|
-
"/v2/agents/{agent_key}/tasks/{task_id}/actions/{action_id}",
|
|
102
|
-
)(pathParams);
|
|
103
|
-
|
|
104
|
-
const headers = new Headers(compactMap({
|
|
105
|
-
Accept: "application/json",
|
|
106
|
-
}));
|
|
107
|
-
|
|
108
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
109
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
110
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
111
|
-
|
|
112
|
-
const context = {
|
|
113
|
-
options: client._options,
|
|
114
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
115
|
-
operationID: "RetrieveAction",
|
|
116
|
-
oAuth2Scopes: null,
|
|
117
|
-
|
|
118
|
-
resolvedSecurity: requestSecurity,
|
|
119
|
-
|
|
120
|
-
securitySource: client._options.apiKey,
|
|
121
|
-
retryConfig: options?.retries
|
|
122
|
-
|| client._options.retryConfig
|
|
123
|
-
|| { strategy: "none" },
|
|
124
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const requestRes = client._createRequest(context, {
|
|
128
|
-
security: requestSecurity,
|
|
129
|
-
method: "GET",
|
|
130
|
-
baseURL: options?.serverURL,
|
|
131
|
-
path: path,
|
|
132
|
-
headers: headers,
|
|
133
|
-
body: body,
|
|
134
|
-
userAgent: client._options.userAgent,
|
|
135
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
136
|
-
}, options);
|
|
137
|
-
if (!requestRes.ok) {
|
|
138
|
-
return [requestRes, { status: "invalid" }];
|
|
139
|
-
}
|
|
140
|
-
const req = requestRes.value;
|
|
141
|
-
|
|
142
|
-
const doResult = await client._do(req, {
|
|
143
|
-
context,
|
|
144
|
-
errorCodes: ["4XX", "5XX"],
|
|
145
|
-
retryConfig: context.retryConfig,
|
|
146
|
-
retryCodes: context.retryCodes,
|
|
147
|
-
});
|
|
148
|
-
if (!doResult.ok) {
|
|
149
|
-
return [doResult, { status: "request-error", request: req }];
|
|
150
|
-
}
|
|
151
|
-
const response = doResult.value;
|
|
152
|
-
|
|
153
|
-
const [result] = await M.match<
|
|
154
|
-
operations.RetrieveActionResponseBody,
|
|
155
|
-
| OrqError
|
|
156
|
-
| ResponseValidationError
|
|
157
|
-
| ConnectionError
|
|
158
|
-
| RequestAbortedError
|
|
159
|
-
| RequestTimeoutError
|
|
160
|
-
| InvalidRequestError
|
|
161
|
-
| UnexpectedClientError
|
|
162
|
-
| SDKValidationError
|
|
163
|
-
>(
|
|
164
|
-
M.json(200, operations.RetrieveActionResponseBody$inboundSchema),
|
|
165
|
-
M.fail("4XX"),
|
|
166
|
-
M.fail("5XX"),
|
|
167
|
-
)(response, req);
|
|
168
|
-
if (!result.ok) {
|
|
169
|
-
return [result, { status: "complete", request: req, response }];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return [result, { status: "complete", request: req, response }];
|
|
173
|
-
}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { OrqCore } from "../core.js";
|
|
6
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import {
|
|
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
|
-
* Retrieve a specific agent task
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Retrieves detailed information about a specific task for a given agent, including execution status and results.
|
|
33
|
-
*/
|
|
34
|
-
export function agentsRetrieveTask(
|
|
35
|
-
client: OrqCore,
|
|
36
|
-
request: operations.GetAgentTaskRequest,
|
|
37
|
-
options?: RequestOptions,
|
|
38
|
-
): APIPromise<
|
|
39
|
-
Result<
|
|
40
|
-
operations.GetAgentTaskExtendedTaskResponse,
|
|
41
|
-
| errors.HonoApiError
|
|
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.GetAgentTaskRequest,
|
|
62
|
-
options?: RequestOptions,
|
|
63
|
-
): Promise<
|
|
64
|
-
[
|
|
65
|
-
Result<
|
|
66
|
-
operations.GetAgentTaskExtendedTaskResponse,
|
|
67
|
-
| errors.HonoApiError
|
|
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.GetAgentTaskRequest$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
|
-
task_id: encodeSimple("task_id", payload.task_id, {
|
|
97
|
-
explode: false,
|
|
98
|
-
charEncoding: "percent",
|
|
99
|
-
}),
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const path = pathToFunc("/v2/agents/{agent_key}/tasks/{task_id}")(pathParams);
|
|
103
|
-
|
|
104
|
-
const headers = new Headers(compactMap({
|
|
105
|
-
Accept: "application/json",
|
|
106
|
-
}));
|
|
107
|
-
|
|
108
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
109
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
110
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
111
|
-
|
|
112
|
-
const context = {
|
|
113
|
-
options: client._options,
|
|
114
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
115
|
-
operationID: "GetAgentTask",
|
|
116
|
-
oAuth2Scopes: null,
|
|
117
|
-
|
|
118
|
-
resolvedSecurity: requestSecurity,
|
|
119
|
-
|
|
120
|
-
securitySource: client._options.apiKey,
|
|
121
|
-
retryConfig: options?.retries
|
|
122
|
-
|| client._options.retryConfig
|
|
123
|
-
|| { strategy: "none" },
|
|
124
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const requestRes = client._createRequest(context, {
|
|
128
|
-
security: requestSecurity,
|
|
129
|
-
method: "GET",
|
|
130
|
-
baseURL: options?.serverURL,
|
|
131
|
-
path: path,
|
|
132
|
-
headers: headers,
|
|
133
|
-
body: body,
|
|
134
|
-
userAgent: client._options.userAgent,
|
|
135
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
136
|
-
}, options);
|
|
137
|
-
if (!requestRes.ok) {
|
|
138
|
-
return [requestRes, { status: "invalid" }];
|
|
139
|
-
}
|
|
140
|
-
const req = requestRes.value;
|
|
141
|
-
|
|
142
|
-
const doResult = await client._do(req, {
|
|
143
|
-
context,
|
|
144
|
-
errorCodes: ["404", "4XX", "5XX"],
|
|
145
|
-
retryConfig: context.retryConfig,
|
|
146
|
-
retryCodes: context.retryCodes,
|
|
147
|
-
});
|
|
148
|
-
if (!doResult.ok) {
|
|
149
|
-
return [doResult, { status: "request-error", request: req }];
|
|
150
|
-
}
|
|
151
|
-
const response = doResult.value;
|
|
152
|
-
|
|
153
|
-
const responseFields = {
|
|
154
|
-
HttpMeta: { Response: response, Request: req },
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const [result] = await M.match<
|
|
158
|
-
operations.GetAgentTaskExtendedTaskResponse,
|
|
159
|
-
| errors.HonoApiError
|
|
160
|
-
| OrqError
|
|
161
|
-
| ResponseValidationError
|
|
162
|
-
| ConnectionError
|
|
163
|
-
| RequestAbortedError
|
|
164
|
-
| RequestTimeoutError
|
|
165
|
-
| InvalidRequestError
|
|
166
|
-
| UnexpectedClientError
|
|
167
|
-
| SDKValidationError
|
|
168
|
-
>(
|
|
169
|
-
M.json(200, operations.GetAgentTaskExtendedTaskResponse$inboundSchema),
|
|
170
|
-
M.jsonErr(404, errors.HonoApiError$inboundSchema),
|
|
171
|
-
M.fail("4XX"),
|
|
172
|
-
M.fail("5XX"),
|
|
173
|
-
)(response, req, { extraFields: responseFields });
|
|
174
|
-
if (!result.ok) {
|
|
175
|
-
return [result, { status: "complete", request: req, response }];
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return [result, { status: "complete", request: req, response }];
|
|
179
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { agentsListActions } from "../../funcs/agentsListActions.js";
|
|
6
|
-
import * as operations from "../../models/operations/index.js";
|
|
7
|
-
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
-
|
|
9
|
-
const args = {
|
|
10
|
-
request: operations.ListActionsRequest$inboundSchema,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const tool$agentsListActions: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "agents-list-actions",
|
|
15
|
-
description: `List all actions`,
|
|
16
|
-
args,
|
|
17
|
-
tool: async (client, args, ctx) => {
|
|
18
|
-
const [result, apiCall] = await agentsListActions(
|
|
19
|
-
client,
|
|
20
|
-
args.request,
|
|
21
|
-
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
-
).$inspect();
|
|
23
|
-
|
|
24
|
-
if (!result.ok) {
|
|
25
|
-
return {
|
|
26
|
-
content: [{ type: "text", text: result.error.message }],
|
|
27
|
-
isError: true,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const value = result.value;
|
|
32
|
-
|
|
33
|
-
return formatResult(value, apiCall);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { agentsRetrieveAction } from "../../funcs/agentsRetrieveAction.js";
|
|
6
|
-
import * as operations from "../../models/operations/index.js";
|
|
7
|
-
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
-
|
|
9
|
-
const args = {
|
|
10
|
-
request: operations.RetrieveActionRequest$inboundSchema,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const tool$agentsRetrieveAction: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "agents-retrieve-action",
|
|
15
|
-
description: `Retrieve an action executed by an agent task.`,
|
|
16
|
-
args,
|
|
17
|
-
tool: async (client, args, ctx) => {
|
|
18
|
-
const [result, apiCall] = await agentsRetrieveAction(
|
|
19
|
-
client,
|
|
20
|
-
args.request,
|
|
21
|
-
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
-
).$inspect();
|
|
23
|
-
|
|
24
|
-
if (!result.ok) {
|
|
25
|
-
return {
|
|
26
|
-
content: [{ type: "text", text: result.error.message }],
|
|
27
|
-
isError: true,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const value = result.value;
|
|
32
|
-
|
|
33
|
-
return formatResult(value, apiCall);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { agentsRetrieveTask } from "../../funcs/agentsRetrieveTask.js";
|
|
6
|
-
import * as operations from "../../models/operations/index.js";
|
|
7
|
-
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
-
|
|
9
|
-
const args = {
|
|
10
|
-
request: operations.GetAgentTaskRequest$inboundSchema,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const tool$agentsRetrieveTask: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "agents-retrieve-task",
|
|
15
|
-
description: `Retrieve a specific agent task
|
|
16
|
-
|
|
17
|
-
Retrieves detailed information about a specific task for a given agent, including execution status and results.`,
|
|
18
|
-
args,
|
|
19
|
-
tool: async (client, args, ctx) => {
|
|
20
|
-
const [result, apiCall] = await agentsRetrieveTask(
|
|
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
|
-
};
|