@orq-ai/node 3.14.42 → 3.14.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/bin/mcp-server.js +209 -209
  2. package/bin/mcp-server.js.map +35 -35
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +2 -2
  6. package/lib/config.js +2 -2
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/server.js +1 -1
  9. package/models/operations/createbudget.js +2 -2
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/createdataset.js +2 -2
  12. package/models/operations/createdatasetitem.js +8 -8
  13. package/models/operations/createdatasource.js +2 -2
  14. package/models/operations/createeval.js +28 -28
  15. package/models/operations/createtool.js +10 -10
  16. package/models/operations/duplicatetool.js +10 -10
  17. package/models/operations/fileget.js +2 -2
  18. package/models/operations/filelist.js +2 -2
  19. package/models/operations/fileupload.js +2 -2
  20. package/models/operations/getalltools.js +10 -10
  21. package/models/operations/getbudget.js +2 -2
  22. package/models/operations/getevals.js +28 -28
  23. package/models/operations/listbudgets.js +2 -2
  24. package/models/operations/listcontacts.js +2 -2
  25. package/models/operations/listdatasetdatapoints.js +8 -8
  26. package/models/operations/listdatasets.js +2 -2
  27. package/models/operations/listdatasources.js +2 -2
  28. package/models/operations/retrievecontact.js +2 -2
  29. package/models/operations/retrievedatapoint.js +8 -8
  30. package/models/operations/retrievedataset.js +2 -2
  31. package/models/operations/retrievedatasource.js +2 -2
  32. package/models/operations/retrievetool.js +10 -10
  33. package/models/operations/updatebudget.js +2 -2
  34. package/models/operations/updatecontact.js +2 -2
  35. package/models/operations/updatedatapoint.js +8 -8
  36. package/models/operations/updatedataset.js +2 -2
  37. package/models/operations/updatedatasource.js +2 -2
  38. package/models/operations/updateeval.js +28 -28
  39. package/models/operations/updatetool.js +10 -10
  40. package/package.json +1 -1
  41. package/packages/orq-rc/README.md +20 -29
  42. package/packages/orq-rc/docs/sdks/agents/README.md +0 -78
  43. package/packages/orq-rc/docs/sdks/tools/README.md +1 -152
  44. package/packages/orq-rc/examples/package-lock.json +1 -1
  45. package/packages/orq-rc/jsr.json +1 -1
  46. package/packages/orq-rc/package-lock.json +2 -2
  47. package/packages/orq-rc/package.json +1 -1
  48. package/packages/orq-rc/src/lib/config.ts +2 -2
  49. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  50. package/packages/orq-rc/src/mcp-server/server.ts +1 -7
  51. package/packages/orq-rc/src/models/errors/index.ts +0 -2
  52. package/packages/orq-rc/src/models/operations/createagent.ts +4 -4
  53. package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
  54. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  55. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  56. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +8 -8
  57. package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
  58. package/packages/orq-rc/src/models/operations/createeval.ts +28 -28
  59. package/packages/orq-rc/src/models/operations/createtool.ts +12 -12
  60. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  61. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  62. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  63. package/packages/orq-rc/src/models/operations/getalltools.ts +12 -12
  64. package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
  65. package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
  66. package/packages/orq-rc/src/models/operations/index.ts +0 -3
  67. package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
  68. package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
  69. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +8 -8
  70. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  71. package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
  72. package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
  73. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +8 -8
  74. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  75. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
  76. package/packages/orq-rc/src/models/operations/retrievetool.ts +12 -12
  77. package/packages/orq-rc/src/models/operations/runagent.ts +2 -2
  78. package/packages/orq-rc/src/models/operations/streamrunagent.ts +2 -2
  79. package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
  80. package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
  81. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +8 -8
  82. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  83. package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
  84. package/packages/orq-rc/src/models/operations/updateeval.ts +28 -28
  85. package/packages/orq-rc/src/models/operations/updatetool.ts +14 -14
  86. package/packages/orq-rc/src/sdk/agents.ts +0 -18
  87. package/packages/orq-rc/src/sdk/tools.ts +0 -36
  88. package/src/lib/config.ts +2 -2
  89. package/src/mcp-server/mcp-server.ts +1 -1
  90. package/src/mcp-server/server.ts +1 -1
  91. package/src/models/operations/createbudget.ts +2 -2
  92. package/src/models/operations/createcontact.ts +2 -2
  93. package/src/models/operations/createdataset.ts +2 -2
  94. package/src/models/operations/createdatasetitem.ts +8 -8
  95. package/src/models/operations/createdatasource.ts +2 -2
  96. package/src/models/operations/createeval.ts +28 -28
  97. package/src/models/operations/createtool.ts +10 -10
  98. package/src/models/operations/duplicatetool.ts +10 -10
  99. package/src/models/operations/fileget.ts +2 -2
  100. package/src/models/operations/filelist.ts +2 -2
  101. package/src/models/operations/fileupload.ts +2 -2
  102. package/src/models/operations/getalltools.ts +10 -10
  103. package/src/models/operations/getbudget.ts +2 -2
  104. package/src/models/operations/getevals.ts +28 -28
  105. package/src/models/operations/listbudgets.ts +2 -2
  106. package/src/models/operations/listcontacts.ts +2 -2
  107. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  108. package/src/models/operations/listdatasets.ts +2 -2
  109. package/src/models/operations/listdatasources.ts +2 -2
  110. package/src/models/operations/retrievecontact.ts +2 -2
  111. package/src/models/operations/retrievedatapoint.ts +8 -8
  112. package/src/models/operations/retrievedataset.ts +2 -2
  113. package/src/models/operations/retrievedatasource.ts +2 -2
  114. package/src/models/operations/retrievetool.ts +10 -10
  115. package/src/models/operations/updatebudget.ts +2 -2
  116. package/src/models/operations/updatecontact.ts +2 -2
  117. package/src/models/operations/updatedatapoint.ts +8 -8
  118. package/src/models/operations/updatedataset.ts +2 -2
  119. package/src/models/operations/updatedatasource.ts +2 -2
  120. package/src/models/operations/updateeval.ts +28 -28
  121. package/src/models/operations/updatetool.ts +10 -10
  122. package/packages/orq-rc/src/funcs/agentsDuplicate.ts +0 -179
  123. package/packages/orq-rc/src/funcs/toolsDuplicate.ts +0 -176
  124. package/packages/orq-rc/src/funcs/toolsSync.ts +0 -176
  125. package/packages/orq-rc/src/mcp-server/tools/agentsDuplicate.ts +0 -37
  126. package/packages/orq-rc/src/mcp-server/tools/toolsDuplicate.ts +0 -37
  127. package/packages/orq-rc/src/mcp-server/tools/toolsSync.ts +0 -37
  128. package/packages/orq-rc/src/models/errors/duplicateagent.ts +0 -128
  129. package/packages/orq-rc/src/models/errors/duplicatetool.ts +0 -78
  130. package/packages/orq-rc/src/models/operations/duplicateagent.ts +0 -3598
  131. package/packages/orq-rc/src/models/operations/duplicatetool.ts +0 -2395
  132. package/packages/orq-rc/src/models/operations/syncmcptool.ts +0 -2603
@@ -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
- * Duplicate an existing agent
30
- *
31
- * @remarks
32
- * Creates a copy of an existing agent with a new unique key. The duplicated agent will have all the same configuration as the original, including model settings, instructions, tools, and knowledge bases.
33
- */
34
- export function agentsDuplicate(
35
- client: OrqCore,
36
- request: operations.DuplicateAgentRequest,
37
- options?: RequestOptions,
38
- ): APIPromise<
39
- Result<
40
- operations.DuplicateAgentResponseBody,
41
- | errors.DuplicateAgentResponseBody
42
- | errors.DuplicateAgentAgentsResponseBody
43
- | OrqError
44
- | ResponseValidationError
45
- | ConnectionError
46
- | RequestAbortedError
47
- | RequestTimeoutError
48
- | InvalidRequestError
49
- | UnexpectedClientError
50
- | SDKValidationError
51
- >
52
- > {
53
- return new APIPromise($do(
54
- client,
55
- request,
56
- options,
57
- ));
58
- }
59
-
60
- async function $do(
61
- client: OrqCore,
62
- request: operations.DuplicateAgentRequest,
63
- options?: RequestOptions,
64
- ): Promise<
65
- [
66
- Result<
67
- operations.DuplicateAgentResponseBody,
68
- | errors.DuplicateAgentResponseBody
69
- | errors.DuplicateAgentAgentsResponseBody
70
- | OrqError
71
- | ResponseValidationError
72
- | ConnectionError
73
- | RequestAbortedError
74
- | RequestTimeoutError
75
- | InvalidRequestError
76
- | UnexpectedClientError
77
- | SDKValidationError
78
- >,
79
- APICall,
80
- ]
81
- > {
82
- const parsed = safeParse(
83
- request,
84
- (value) => operations.DuplicateAgentRequest$outboundSchema.parse(value),
85
- "Input validation failed",
86
- );
87
- if (!parsed.ok) {
88
- return [parsed, { status: "invalid" }];
89
- }
90
- const payload = parsed.value;
91
- const body = null;
92
-
93
- const pathParams = {
94
- id: encodeSimple("id", payload.id, {
95
- explode: false,
96
- charEncoding: "percent",
97
- }),
98
- };
99
-
100
- const path = pathToFunc("/v2/agents/{id}/duplicate")(pathParams);
101
-
102
- const headers = new Headers(compactMap({
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: "DuplicateAgent",
114
- oAuth2Scopes: null,
115
-
116
- resolvedSecurity: requestSecurity,
117
-
118
- securitySource: client._options.apiKey,
119
- retryConfig: options?.retries
120
- || client._options.retryConfig
121
- || { strategy: "none" },
122
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
123
- };
124
-
125
- const requestRes = client._createRequest(context, {
126
- security: requestSecurity,
127
- method: "POST",
128
- baseURL: options?.serverURL,
129
- path: path,
130
- headers: headers,
131
- body: body,
132
- userAgent: client._options.userAgent,
133
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
134
- }, options);
135
- if (!requestRes.ok) {
136
- return [requestRes, { status: "invalid" }];
137
- }
138
- const req = requestRes.value;
139
-
140
- const doResult = await client._do(req, {
141
- context,
142
- errorCodes: ["404", "409", "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 responseFields = {
152
- HttpMeta: { Response: response, Request: req },
153
- };
154
-
155
- const [result] = await M.match<
156
- operations.DuplicateAgentResponseBody,
157
- | errors.DuplicateAgentResponseBody
158
- | errors.DuplicateAgentAgentsResponseBody
159
- | OrqError
160
- | ResponseValidationError
161
- | ConnectionError
162
- | RequestAbortedError
163
- | RequestTimeoutError
164
- | InvalidRequestError
165
- | UnexpectedClientError
166
- | SDKValidationError
167
- >(
168
- M.json(201, operations.DuplicateAgentResponseBody$inboundSchema),
169
- M.jsonErr(404, errors.DuplicateAgentResponseBody$inboundSchema),
170
- M.jsonErr(409, errors.DuplicateAgentAgentsResponseBody$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,176 +0,0 @@
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 * 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
- * Duplicate tool
30
- *
31
- * @remarks
32
- * Creates a copy of an existing tool with a new id and ID.
33
- */
34
- export function toolsDuplicate(
35
- client: OrqCore,
36
- request: operations.DuplicateToolRequest,
37
- options?: RequestOptions,
38
- ): APIPromise<
39
- Result<
40
- operations.DuplicateToolResponseBody,
41
- | errors.DuplicateToolResponseBody
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.DuplicateToolRequest,
62
- options?: RequestOptions,
63
- ): Promise<
64
- [
65
- Result<
66
- operations.DuplicateToolResponseBody,
67
- | errors.DuplicateToolResponseBody
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.DuplicateToolRequest$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 = encodeJSON("body", payload.RequestBody, { explode: true });
90
-
91
- const pathParams = {
92
- tool_id: encodeSimple("tool_id", payload.tool_id, {
93
- explode: false,
94
- charEncoding: "percent",
95
- }),
96
- };
97
-
98
- const path = pathToFunc("/v2/tools/{tool_id}/duplicate")(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: "DuplicateTool",
113
- oAuth2Scopes: null,
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: ["404", "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 responseFields = {
151
- HttpMeta: { Response: response, Request: req },
152
- };
153
-
154
- const [result] = await M.match<
155
- operations.DuplicateToolResponseBody,
156
- | errors.DuplicateToolResponseBody
157
- | OrqError
158
- | ResponseValidationError
159
- | ConnectionError
160
- | RequestAbortedError
161
- | RequestTimeoutError
162
- | InvalidRequestError
163
- | UnexpectedClientError
164
- | SDKValidationError
165
- >(
166
- M.json(200, operations.DuplicateToolResponseBody$inboundSchema),
167
- M.jsonErr(404, errors.DuplicateToolResponseBody$inboundSchema),
168
- M.fail("4XX"),
169
- M.fail("5XX"),
170
- )(response, req, { extraFields: responseFields });
171
- if (!result.ok) {
172
- return [result, { status: "complete", request: req, response }];
173
- }
174
-
175
- return [result, { status: "complete", request: req, response }];
176
- }
@@ -1,176 +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
- * Sync MCP tool
30
- *
31
- * @remarks
32
- * Manually triggers tool discovery and synchronization from the MCP server. Fetches the latest tools and updates the tool configuration.
33
- */
34
- export function toolsSync(
35
- client: OrqCore,
36
- request: operations.SyncMcpToolRequest,
37
- options?: RequestOptions,
38
- ): APIPromise<
39
- Result<
40
- operations.SyncMcpToolResponseBody,
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.SyncMcpToolRequest,
62
- options?: RequestOptions,
63
- ): Promise<
64
- [
65
- Result<
66
- operations.SyncMcpToolResponseBody,
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.SyncMcpToolRequest$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
- tool_id: encodeSimple("tool_id", payload.tool_id, {
93
- explode: false,
94
- charEncoding: "percent",
95
- }),
96
- };
97
-
98
- const path = pathToFunc("/v2/tools/{tool_id}/sync")(pathParams);
99
-
100
- const headers = new Headers(compactMap({
101
- Accept: "application/json",
102
- }));
103
-
104
- const secConfig = await extractSecurity(client._options.apiKey);
105
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
106
- const requestSecurity = resolveGlobalSecurity(securityInput);
107
-
108
- const context = {
109
- options: client._options,
110
- baseURL: options?.serverURL ?? client._baseURL ?? "",
111
- operationID: "SyncMcpTool",
112
- oAuth2Scopes: null,
113
-
114
- resolvedSecurity: requestSecurity,
115
-
116
- securitySource: client._options.apiKey,
117
- retryConfig: options?.retries
118
- || client._options.retryConfig
119
- || { strategy: "none" },
120
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
121
- };
122
-
123
- const requestRes = client._createRequest(context, {
124
- security: requestSecurity,
125
- method: "POST",
126
- baseURL: options?.serverURL,
127
- path: path,
128
- headers: headers,
129
- body: body,
130
- userAgent: client._options.userAgent,
131
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
132
- }, options);
133
- if (!requestRes.ok) {
134
- return [requestRes, { status: "invalid" }];
135
- }
136
- const req = requestRes.value;
137
-
138
- const doResult = await client._do(req, {
139
- context,
140
- errorCodes: ["400", "404", "4XX", "500", "5XX"],
141
- retryConfig: context.retryConfig,
142
- retryCodes: context.retryCodes,
143
- });
144
- if (!doResult.ok) {
145
- return [doResult, { status: "request-error", request: req }];
146
- }
147
- const response = doResult.value;
148
-
149
- const responseFields = {
150
- HttpMeta: { Response: response, Request: req },
151
- };
152
-
153
- const [result] = await M.match<
154
- operations.SyncMcpToolResponseBody,
155
- | errors.HonoApiError
156
- | OrqError
157
- | ResponseValidationError
158
- | ConnectionError
159
- | RequestAbortedError
160
- | RequestTimeoutError
161
- | InvalidRequestError
162
- | UnexpectedClientError
163
- | SDKValidationError
164
- >(
165
- M.json(200, operations.SyncMcpToolResponseBody$inboundSchema),
166
- M.jsonErr([400, 404], errors.HonoApiError$inboundSchema),
167
- M.jsonErr(500, errors.HonoApiError$inboundSchema),
168
- M.fail("4XX"),
169
- M.fail("5XX"),
170
- )(response, req, { extraFields: responseFields });
171
- if (!result.ok) {
172
- return [result, { status: "complete", request: req, response }];
173
- }
174
-
175
- return [result, { status: "complete", request: req, response }];
176
- }
@@ -1,37 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { agentsDuplicate } from "../../funcs/agentsDuplicate.js";
6
- import * as operations from "../../models/operations/index.js";
7
- import { formatResult, ToolDefinition } from "../tools.js";
8
-
9
- const args = {
10
- request: operations.DuplicateAgentRequest$inboundSchema,
11
- };
12
-
13
- export const tool$agentsDuplicate: ToolDefinition<typeof args> = {
14
- name: "agents-duplicate",
15
- description: `Duplicate an existing agent
16
-
17
- Creates a copy of an existing agent with a new unique key. The duplicated agent will have all the same configuration as the original, including model settings, instructions, tools, and knowledge bases.`,
18
- args,
19
- tool: async (client, args, ctx) => {
20
- const [result, apiCall] = await agentsDuplicate(
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,37 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { toolsDuplicate } from "../../funcs/toolsDuplicate.js";
6
- import * as operations from "../../models/operations/index.js";
7
- import { formatResult, ToolDefinition } from "../tools.js";
8
-
9
- const args = {
10
- request: operations.DuplicateToolRequest$inboundSchema,
11
- };
12
-
13
- export const tool$toolsDuplicate: ToolDefinition<typeof args> = {
14
- name: "tools-duplicate",
15
- description: `Duplicate tool
16
-
17
- Creates a copy of an existing tool with a new id and ID.`,
18
- args,
19
- tool: async (client, args, ctx) => {
20
- const [result, apiCall] = await toolsDuplicate(
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,37 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { toolsSync } from "../../funcs/toolsSync.js";
6
- import * as operations from "../../models/operations/index.js";
7
- import { formatResult, ToolDefinition } from "../tools.js";
8
-
9
- const args = {
10
- request: operations.SyncMcpToolRequest$inboundSchema,
11
- };
12
-
13
- export const tool$toolsSync: ToolDefinition<typeof args> = {
14
- name: "tools-sync",
15
- description: `Sync MCP tool
16
-
17
- Manually triggers tool discovery and synchronization from the MCP server. Fetches the latest tools and updates the tool configuration.`,
18
- args,
19
- tool: async (client, args, ctx) => {
20
- const [result, apiCall] = await toolsSync(
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
- };