@orq-ai/node 3.13.2 → 3.13.4
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 +216 -246
- package/bin/mcp-server.js.map +42 -42
- package/docs/sdks/agents/README.md +3 -3
- package/examples/package-lock.json +1 -1
- package/funcs/agentsRetrieveTask.js +2 -2
- package/funcs/agentsRetrieveTask.js.map +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.d.ts +5 -2
- package/models/operations/getagent.d.ts.map +1 -1
- package/models/operations/getagent.js +4 -12
- package/models/operations/getagent.js.map +1 -1
- package/models/operations/getagenttask.d.ts +2 -2
- package/models/operations/getagenttask.d.ts.map +1 -1
- package/models/operations/getagenttask.js +4 -2
- package/models/operations/getagenttask.js.map +1 -1
- 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.d.ts +5 -2
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js +4 -12
- package/models/operations/listagents.js.map +1 -1
- 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.d.ts +5 -2
- package/models/operations/runagent.d.ts.map +1 -1
- package/models/operations/runagent.js +4 -12
- package/models/operations/runagent.js.map +1 -1
- package/models/operations/streamrunagent.d.ts +5 -2
- package/models/operations/streamrunagent.d.ts.map +1 -1
- package/models/operations/streamrunagent.js +4 -12
- package/models/operations/streamrunagent.js.map +1 -1
- 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 +97 -91
- package/packages/orq-rc/docs/sdks/agents/README.md +3 -3
- package/packages/orq-rc/docs/sdks/knowledge/README.md +228 -0
- package/packages/orq-rc/docs/sdks/tools/README.md +14 -16
- 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/agentsRetrieveTask.ts +2 -2
- package/packages/orq-rc/src/funcs/knowledgeDeleteChunks.ts +170 -0
- package/packages/orq-rc/src/funcs/knowledgeGetChunksCount.ts +170 -0
- package/packages/orq-rc/src/funcs/knowledgeListChunksPaginated.ts +171 -0
- package/packages/orq-rc/src/funcs/toolsDelete.ts +2 -2
- package/packages/orq-rc/src/funcs/toolsDuplicate.ts +3 -3
- package/packages/orq-rc/src/funcs/toolsRetrieve.ts +3 -3
- package/packages/orq-rc/src/funcs/toolsUpdate.ts +2 -2
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +7 -1
- package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunks.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/knowledgeGetChunksCount.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunksPaginated.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/toolsDuplicate.ts +1 -1
- package/packages/orq-rc/src/mcp-server/tools/toolsRetrieve.ts +1 -1
- 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/createprompt.ts +8 -0
- package/packages/orq-rc/src/models/operations/createtool.ts +10 -22
- package/packages/orq-rc/src/models/operations/deletechunks.ts +243 -0
- package/packages/orq-rc/src/models/operations/deletetool.ts +6 -6
- package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +4 -0
- package/packages/orq-rc/src/models/operations/deployments.ts +4 -0
- package/packages/orq-rc/src/models/operations/duplicatetool.ts +23 -15
- 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 +9 -14
- package/packages/orq-rc/src/models/operations/getagenttask.ts +6 -4
- package/packages/orq-rc/src/models/operations/getallprompts.ts +4 -0
- 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/getchunkscount.ts +230 -0
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/getoneprompt.ts +4 -0
- package/packages/orq-rc/src/models/operations/getpromptversion.ts +4 -0
- package/packages/orq-rc/src/models/operations/index.ts +3 -0
- package/packages/orq-rc/src/models/operations/listagents.ts +9 -14
- package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listchunkspaginated.ts +507 -0
- 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 +2 -2
- package/packages/orq-rc/src/models/operations/listpromptversions.ts +4 -0
- 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 +16 -16
- package/packages/orq-rc/src/models/operations/runagent.ts +7 -18
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +7 -18
- 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/updateprompt.ts +8 -0
- package/packages/orq-rc/src/models/operations/updatetool.ts +44 -28
- package/packages/orq-rc/src/sdk/knowledge.ts +45 -0
- package/packages/orq-rc/src/sdk/tools.ts +2 -2
- package/src/funcs/agentsRetrieveTask.ts +2 -2
- 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 +9 -14
- package/src/models/operations/getagenttask.ts +6 -4
- 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 +9 -14
- 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 +9 -14
- package/src/models/operations/streamrunagent.ts +9 -14
- 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
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, 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
|
+
* Get chunks total count
|
|
29
|
+
*/
|
|
30
|
+
export function knowledgeGetChunksCount(
|
|
31
|
+
client: OrqCore,
|
|
32
|
+
request: operations.GetChunksCountRequest,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<
|
|
35
|
+
Result<
|
|
36
|
+
operations.GetChunksCountResponseBody,
|
|
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.GetChunksCountRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<
|
|
59
|
+
[
|
|
60
|
+
Result<
|
|
61
|
+
operations.GetChunksCountResponseBody,
|
|
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.GetChunksCountRequest$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 = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
84
|
+
|
|
85
|
+
const pathParams = {
|
|
86
|
+
datasource_id: encodeSimple("datasource_id", payload.datasource_id, {
|
|
87
|
+
explode: false,
|
|
88
|
+
charEncoding: "percent",
|
|
89
|
+
}),
|
|
90
|
+
knowledge_id: encodeSimple("knowledge_id", payload.knowledge_id, {
|
|
91
|
+
explode: false,
|
|
92
|
+
charEncoding: "percent",
|
|
93
|
+
}),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const path = pathToFunc(
|
|
97
|
+
"/v2/knowledge/{knowledge_id}/datasources/{datasource_id}/chunks/count",
|
|
98
|
+
)(pathParams);
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
107
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
+
|
|
109
|
+
const context = {
|
|
110
|
+
options: client._options,
|
|
111
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
+
operationID: "GetChunksCount",
|
|
113
|
+
oAuth2Scopes: [],
|
|
114
|
+
|
|
115
|
+
resolvedSecurity: requestSecurity,
|
|
116
|
+
|
|
117
|
+
securitySource: client._options.apiKey,
|
|
118
|
+
retryConfig: options?.retries
|
|
119
|
+
|| client._options.retryConfig
|
|
120
|
+
|| { strategy: "none" },
|
|
121
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const requestRes = client._createRequest(context, {
|
|
125
|
+
security: requestSecurity,
|
|
126
|
+
method: "POST",
|
|
127
|
+
baseURL: options?.serverURL,
|
|
128
|
+
path: path,
|
|
129
|
+
headers: headers,
|
|
130
|
+
body: body,
|
|
131
|
+
userAgent: client._options.userAgent,
|
|
132
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
133
|
+
}, options);
|
|
134
|
+
if (!requestRes.ok) {
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
136
|
+
}
|
|
137
|
+
const req = requestRes.value;
|
|
138
|
+
|
|
139
|
+
const doResult = await client._do(req, {
|
|
140
|
+
context,
|
|
141
|
+
errorCodes: ["4XX", "5XX"],
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const [result] = await M.match<
|
|
151
|
+
operations.GetChunksCountResponseBody,
|
|
152
|
+
| OrqError
|
|
153
|
+
| ResponseValidationError
|
|
154
|
+
| ConnectionError
|
|
155
|
+
| RequestAbortedError
|
|
156
|
+
| RequestTimeoutError
|
|
157
|
+
| InvalidRequestError
|
|
158
|
+
| UnexpectedClientError
|
|
159
|
+
| SDKValidationError
|
|
160
|
+
>(
|
|
161
|
+
M.json(200, operations.GetChunksCountResponseBody$inboundSchema),
|
|
162
|
+
M.fail("4XX"),
|
|
163
|
+
M.fail("5XX"),
|
|
164
|
+
)(response, req);
|
|
165
|
+
if (!result.ok) {
|
|
166
|
+
return [result, { status: "complete", request: req, response }];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return [result, { status: "complete", request: req, response }];
|
|
170
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, 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
|
+
* List chunks with offset-based pagination
|
|
29
|
+
*/
|
|
30
|
+
export function knowledgeListChunksPaginated(
|
|
31
|
+
client: OrqCore,
|
|
32
|
+
request: operations.ListChunksPaginatedRequest,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<
|
|
35
|
+
Result<
|
|
36
|
+
operations.ListChunksPaginatedResponseBody,
|
|
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.ListChunksPaginatedRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<
|
|
59
|
+
[
|
|
60
|
+
Result<
|
|
61
|
+
operations.ListChunksPaginatedResponseBody,
|
|
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) =>
|
|
77
|
+
operations.ListChunksPaginatedRequest$outboundSchema.parse(value),
|
|
78
|
+
"Input validation failed",
|
|
79
|
+
);
|
|
80
|
+
if (!parsed.ok) {
|
|
81
|
+
return [parsed, { status: "invalid" }];
|
|
82
|
+
}
|
|
83
|
+
const payload = parsed.value;
|
|
84
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
85
|
+
|
|
86
|
+
const pathParams = {
|
|
87
|
+
datasource_id: encodeSimple("datasource_id", payload.datasource_id, {
|
|
88
|
+
explode: false,
|
|
89
|
+
charEncoding: "percent",
|
|
90
|
+
}),
|
|
91
|
+
knowledge_id: encodeSimple("knowledge_id", payload.knowledge_id, {
|
|
92
|
+
explode: false,
|
|
93
|
+
charEncoding: "percent",
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const path = pathToFunc(
|
|
98
|
+
"/v2/knowledge/{knowledge_id}/datasources/{datasource_id}/chunks/list",
|
|
99
|
+
)(pathParams);
|
|
100
|
+
|
|
101
|
+
const headers = new Headers(compactMap({
|
|
102
|
+
"Content-Type": "application/json",
|
|
103
|
+
Accept: "application/json",
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
107
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
108
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
109
|
+
|
|
110
|
+
const context = {
|
|
111
|
+
options: client._options,
|
|
112
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
+
operationID: "ListChunksPaginated",
|
|
114
|
+
oAuth2Scopes: [],
|
|
115
|
+
|
|
116
|
+
resolvedSecurity: requestSecurity,
|
|
117
|
+
|
|
118
|
+
securitySource: client._options.apiKey,
|
|
119
|
+
retryConfig: options?.retries
|
|
120
|
+
|| client._options.retryConfig
|
|
121
|
+
|| { strategy: "none" },
|
|
122
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const requestRes = client._createRequest(context, {
|
|
126
|
+
security: requestSecurity,
|
|
127
|
+
method: "POST",
|
|
128
|
+
baseURL: options?.serverURL,
|
|
129
|
+
path: path,
|
|
130
|
+
headers: headers,
|
|
131
|
+
body: body,
|
|
132
|
+
userAgent: client._options.userAgent,
|
|
133
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
134
|
+
}, options);
|
|
135
|
+
if (!requestRes.ok) {
|
|
136
|
+
return [requestRes, { status: "invalid" }];
|
|
137
|
+
}
|
|
138
|
+
const req = requestRes.value;
|
|
139
|
+
|
|
140
|
+
const doResult = await client._do(req, {
|
|
141
|
+
context,
|
|
142
|
+
errorCodes: ["4XX", "5XX"],
|
|
143
|
+
retryConfig: context.retryConfig,
|
|
144
|
+
retryCodes: context.retryCodes,
|
|
145
|
+
});
|
|
146
|
+
if (!doResult.ok) {
|
|
147
|
+
return [doResult, { status: "request-error", request: req }];
|
|
148
|
+
}
|
|
149
|
+
const response = doResult.value;
|
|
150
|
+
|
|
151
|
+
const [result] = await M.match<
|
|
152
|
+
operations.ListChunksPaginatedResponseBody,
|
|
153
|
+
| OrqError
|
|
154
|
+
| ResponseValidationError
|
|
155
|
+
| ConnectionError
|
|
156
|
+
| RequestAbortedError
|
|
157
|
+
| RequestTimeoutError
|
|
158
|
+
| InvalidRequestError
|
|
159
|
+
| UnexpectedClientError
|
|
160
|
+
| SDKValidationError
|
|
161
|
+
>(
|
|
162
|
+
M.json(200, operations.ListChunksPaginatedResponseBody$inboundSchema),
|
|
163
|
+
M.fail("4XX"),
|
|
164
|
+
M.fail("5XX"),
|
|
165
|
+
)(response, req);
|
|
166
|
+
if (!result.ok) {
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
|
@@ -87,13 +87,13 @@ async function $do(
|
|
|
87
87
|
const body = null;
|
|
88
88
|
|
|
89
89
|
const pathParams = {
|
|
90
|
-
|
|
90
|
+
tool_id: encodeSimple("tool_id", payload.tool_id, {
|
|
91
91
|
explode: false,
|
|
92
92
|
charEncoding: "percent",
|
|
93
93
|
}),
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
const path = pathToFunc("/v2/tools/{
|
|
96
|
+
const path = pathToFunc("/v2/tools/{tool_id}")(pathParams);
|
|
97
97
|
|
|
98
98
|
const headers = new Headers(compactMap({
|
|
99
99
|
Accept: "*/*",
|
|
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
* Duplicate tool
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Creates a copy of an existing tool with a new
|
|
32
|
+
* Creates a copy of an existing tool with a new id and ID.
|
|
33
33
|
*/
|
|
34
34
|
export function toolsDuplicate(
|
|
35
35
|
client: OrqCore,
|
|
@@ -89,13 +89,13 @@ async function $do(
|
|
|
89
89
|
const body = null;
|
|
90
90
|
|
|
91
91
|
const pathParams = {
|
|
92
|
-
|
|
92
|
+
tool_id: encodeSimple("tool_id", payload.tool_id, {
|
|
93
93
|
explode: false,
|
|
94
94
|
charEncoding: "percent",
|
|
95
95
|
}),
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
const path = pathToFunc("/v2/tools/{
|
|
98
|
+
const path = pathToFunc("/v2/tools/{tool_id}/duplicate")(pathParams);
|
|
99
99
|
|
|
100
100
|
const headers = new Headers(compactMap({
|
|
101
101
|
Accept: "application/json",
|
|
@@ -28,7 +28,7 @@ import { Result } from "../types/fp.js";
|
|
|
28
28
|
* Retrieve tool
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
|
-
* Retrieves a tool by
|
|
31
|
+
* Retrieves a tool by id.
|
|
32
32
|
*/
|
|
33
33
|
export function toolsRetrieve(
|
|
34
34
|
client: OrqCore,
|
|
@@ -86,13 +86,13 @@ async function $do(
|
|
|
86
86
|
const body = null;
|
|
87
87
|
|
|
88
88
|
const pathParams = {
|
|
89
|
-
|
|
89
|
+
tool_id: encodeSimple("tool_id", payload.tool_id, {
|
|
90
90
|
explode: false,
|
|
91
91
|
charEncoding: "percent",
|
|
92
92
|
}),
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
const path = pathToFunc("/v2/tools/{
|
|
95
|
+
const path = pathToFunc("/v2/tools/{tool_id}")(pathParams);
|
|
96
96
|
|
|
97
97
|
const headers = new Headers(compactMap({
|
|
98
98
|
Accept: "application/json",
|
|
@@ -89,13 +89,13 @@ async function $do(
|
|
|
89
89
|
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
90
90
|
|
|
91
91
|
const pathParams = {
|
|
92
|
-
|
|
92
|
+
tool_id: encodeSimple("tool_id", payload.tool_id, {
|
|
93
93
|
explode: false,
|
|
94
94
|
charEncoding: "percent",
|
|
95
95
|
}),
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
const path = pathToFunc("/v2/tools/{
|
|
98
|
+
const path = pathToFunc("/v2/tools/{tool_id}")(pathParams);
|
|
99
99
|
|
|
100
100
|
const headers = new Headers(compactMap({
|
|
101
101
|
"Content-Type": "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.
|
|
72
|
-
genVersion: "2.
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 3.14.0-rc.
|
|
71
|
+
sdkVersion: "3.14.0-rc.6",
|
|
72
|
+
genVersion: "2.721.0",
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 3.14.0-rc.6 2.721.0 2.0 @orq-ai/node",
|
|
74
74
|
} as const;
|
|
@@ -99,9 +99,12 @@ import { tool$knowledgeCreateChunks } from "./tools/knowledgeCreateChunks.js";
|
|
|
99
99
|
import { tool$knowledgeCreateDatasource } from "./tools/knowledgeCreateDatasource.js";
|
|
100
100
|
import { tool$knowledgeDelete } from "./tools/knowledgeDelete.js";
|
|
101
101
|
import { tool$knowledgeDeleteChunk } from "./tools/knowledgeDeleteChunk.js";
|
|
102
|
+
import { tool$knowledgeDeleteChunks } from "./tools/knowledgeDeleteChunks.js";
|
|
102
103
|
import { tool$knowledgeDeleteDatasource } from "./tools/knowledgeDeleteDatasource.js";
|
|
104
|
+
import { tool$knowledgeGetChunksCount } from "./tools/knowledgeGetChunksCount.js";
|
|
103
105
|
import { tool$knowledgeList } from "./tools/knowledgeList.js";
|
|
104
106
|
import { tool$knowledgeListChunks } from "./tools/knowledgeListChunks.js";
|
|
107
|
+
import { tool$knowledgeListChunksPaginated } from "./tools/knowledgeListChunksPaginated.js";
|
|
105
108
|
import { tool$knowledgeListDatasources } from "./tools/knowledgeListDatasources.js";
|
|
106
109
|
import { tool$knowledgeRetrieve } from "./tools/knowledgeRetrieve.js";
|
|
107
110
|
import { tool$knowledgeRetrieveChunk } from "./tools/knowledgeRetrieveChunk.js";
|
|
@@ -153,7 +156,7 @@ export function createMCPServer(deps: {
|
|
|
153
156
|
}) {
|
|
154
157
|
const server = new McpServer({
|
|
155
158
|
name: "Orq",
|
|
156
|
-
version: "3.14.0-rc.
|
|
159
|
+
version: "3.14.0-rc.6",
|
|
157
160
|
});
|
|
158
161
|
|
|
159
162
|
const client = new OrqCore({
|
|
@@ -254,6 +257,9 @@ export function createMCPServer(deps: {
|
|
|
254
257
|
tool(tool$knowledgeUpdateDatasource);
|
|
255
258
|
tool(tool$knowledgeCreateChunks);
|
|
256
259
|
tool(tool$knowledgeListChunks);
|
|
260
|
+
tool(tool$knowledgeDeleteChunks);
|
|
261
|
+
tool(tool$knowledgeListChunksPaginated);
|
|
262
|
+
tool(tool$knowledgeGetChunksCount);
|
|
257
263
|
tool(tool$knowledgeUpdateChunk);
|
|
258
264
|
tool(tool$knowledgeDeleteChunk);
|
|
259
265
|
tool(tool$knowledgeRetrieveChunk);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { knowledgeDeleteChunks } from "../../funcs/knowledgeDeleteChunks.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.DeleteChunksRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$knowledgeDeleteChunks: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "knowledge-delete-chunks",
|
|
15
|
+
description: `Delete multiple chunks`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await knowledgeDeleteChunks(
|
|
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
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { knowledgeGetChunksCount } from "../../funcs/knowledgeGetChunksCount.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetChunksCountRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$knowledgeGetChunksCount: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "knowledge-get-chunks-count",
|
|
15
|
+
description: `Get chunks total count`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await knowledgeGetChunksCount(
|
|
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
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { knowledgeListChunksPaginated } from "../../funcs/knowledgeListChunksPaginated.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListChunksPaginatedRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$knowledgeListChunksPaginated: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "knowledge-list-chunks-paginated",
|
|
15
|
+
description: `List chunks with offset-based pagination`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await knowledgeListChunksPaginated(
|
|
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
|
+
};
|
|
@@ -14,7 +14,7 @@ export const tool$toolsDuplicate: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "tools-duplicate",
|
|
15
15
|
description: `Duplicate tool
|
|
16
16
|
|
|
17
|
-
Creates a copy of an existing tool with a new
|
|
17
|
+
Creates a copy of an existing tool with a new id and ID.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await toolsDuplicate(
|
|
@@ -14,7 +14,7 @@ export const tool$toolsRetrieve: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "tools-retrieve",
|
|
15
15
|
description: `Retrieve tool
|
|
16
16
|
|
|
17
|
-
Retrieves a tool by
|
|
17
|
+
Retrieves a tool by id.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await toolsRetrieve(
|
|
@@ -658,7 +658,7 @@ export const CreateBudgetResponseBody$inboundSchema: z.ZodType<
|
|
|
658
658
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
659
659
|
.optional(),
|
|
660
660
|
updated: z.string().datetime({ offset: true }).default(
|
|
661
|
-
"2025-10-
|
|
661
|
+
"2025-10-03T06:58:46.742Z",
|
|
662
662
|
).transform(v => new Date(v)),
|
|
663
663
|
}).transform((v) => {
|
|
664
664
|
return remap$(v, {
|
|
@@ -693,7 +693,7 @@ export const CreateBudgetResponseBody$outboundSchema: z.ZodType<
|
|
|
693
693
|
isActive: z.boolean(),
|
|
694
694
|
consumption: z.lazy(() => Consumption$outboundSchema).optional(),
|
|
695
695
|
created: z.date().transform(v => v.toISOString()).optional(),
|
|
696
|
-
updated: z.date().default(() => new Date("2025-10-
|
|
696
|
+
updated: z.date().default(() => new Date("2025-10-03T06:58:46.742Z"))
|
|
697
697
|
.transform(v => v.toISOString()),
|
|
698
698
|
}).transform((v) => {
|
|
699
699
|
return remap$(v, {
|
|
@@ -182,7 +182,7 @@ export const CreateContactResponseBody$inboundSchema: z.ZodType<
|
|
|
182
182
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
183
183
|
.optional(),
|
|
184
184
|
updated: z.string().datetime({ offset: true }).default(
|
|
185
|
-
"2025-10-
|
|
185
|
+
"2025-10-03T06:58:46.742Z",
|
|
186
186
|
).transform(v => new Date(v)),
|
|
187
187
|
}).transform((v) => {
|
|
188
188
|
return remap$(v, {
|
|
@@ -223,7 +223,7 @@ export const CreateContactResponseBody$outboundSchema: z.ZodType<
|
|
|
223
223
|
tags: z.array(z.string()).optional(),
|
|
224
224
|
metadata: z.record(z.any()).optional(),
|
|
225
225
|
created: z.date().transform(v => v.toISOString()).optional(),
|
|
226
|
-
updated: z.date().default(() => new Date("2025-10-
|
|
226
|
+
updated: z.date().default(() => new Date("2025-10-03T06:58:46.742Z"))
|
|
227
227
|
.transform(v => v.toISOString()),
|
|
228
228
|
}).transform((v) => {
|
|
229
229
|
return remap$(v, {
|
|
@@ -211,7 +211,7 @@ export const CreateDatasetResponseBody$inboundSchema: z.ZodType<
|
|
|
211
211
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
212
212
|
.optional(),
|
|
213
213
|
updated: z.string().datetime({ offset: true }).default(
|
|
214
|
-
"2025-10-
|
|
214
|
+
"2025-10-03T06:58:46.742Z",
|
|
215
215
|
).transform(v => new Date(v)),
|
|
216
216
|
}).transform((v) => {
|
|
217
217
|
return remap$(v, {
|
|
@@ -251,7 +251,7 @@ export const CreateDatasetResponseBody$outboundSchema: z.ZodType<
|
|
|
251
251
|
updatedById: z.string().optional(),
|
|
252
252
|
metadata: z.lazy(() => CreateDatasetMetadata$outboundSchema),
|
|
253
253
|
created: z.date().transform(v => v.toISOString()).optional(),
|
|
254
|
-
updated: z.date().default(() => new Date("2025-10-
|
|
254
|
+
updated: z.date().default(() => new Date("2025-10-03T06:58:46.742Z"))
|
|
255
255
|
.transform(v => v.toISOString()),
|
|
256
256
|
}).transform((v) => {
|
|
257
257
|
return remap$(v, {
|