@meetkai/mka1 0.54.103 → 0.54.105
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/README.md +360 -360
- package/bin/mcp-server.js +3394 -3236
- package/bin/mcp-server.js.map +16 -13
- package/dist/commonjs/funcs/agentRunsCancelAgentRun.d.ts +21 -0
- package/dist/commonjs/funcs/agentRunsCancelAgentRun.d.ts.map +1 -0
- package/dist/commonjs/funcs/agentRunsCancelAgentRun.js +142 -0
- package/dist/commonjs/funcs/agentRunsCancelAgentRun.js.map +1 -0
- package/dist/commonjs/funcs/guardrailsGetClusterDefaultGuardrails.d.ts +1 -1
- package/dist/commonjs/funcs/guardrailsGetClusterDefaultGuardrails.js +1 -1
- package/dist/commonjs/funcs/guardrailsResetClusterDefaultGuardrails.d.ts +1 -1
- package/dist/commonjs/funcs/guardrailsResetClusterDefaultGuardrails.js +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/agentRunsCancelAgentRun.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/agentRunsCancelAgentRun.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/agentRunsCancelAgentRun.js +64 -0
- package/dist/commonjs/mcp-server/tools/agentRunsCancelAgentRun.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/guardrailsGetClusterDefaultGuardrails.js +1 -1
- package/dist/commonjs/mcp-server/tools/guardrailsGetClusterDefaultGuardrails.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/guardrailsResetClusterDefaultGuardrails.js +1 -1
- package/dist/commonjs/mcp-server/tools/guardrailsResetClusterDefaultGuardrails.js.map +1 -1
- package/dist/commonjs/models/components/agentrun.d.ts +11 -0
- package/dist/commonjs/models/components/agentrun.d.ts.map +1 -1
- package/dist/commonjs/models/components/agentrun.js +5 -0
- package/dist/commonjs/models/components/agentrun.js.map +1 -1
- package/dist/commonjs/models/components/clusterdefaultguardrailsresponse.d.ts +2 -2
- package/dist/commonjs/models/operations/cancelagentrun.d.ts +24 -0
- package/dist/commonjs/models/operations/cancelagentrun.d.ts.map +1 -0
- package/dist/commonjs/models/operations/cancelagentrun.js +75 -0
- package/dist/commonjs/models/operations/cancelagentrun.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/react-query/agentRunsCancelAgentRun.d.ts +30 -0
- package/dist/commonjs/react-query/agentRunsCancelAgentRun.d.ts.map +1 -0
- package/dist/commonjs/react-query/agentRunsCancelAgentRun.js +47 -0
- package/dist/commonjs/react-query/agentRunsCancelAgentRun.js.map +1 -0
- package/dist/commonjs/react-query/guardrailsGetClusterDefaultGuardrails.d.ts +2 -2
- package/dist/commonjs/react-query/guardrailsGetClusterDefaultGuardrails.js +2 -2
- package/dist/commonjs/react-query/guardrailsResetClusterDefaultGuardrails.d.ts +1 -1
- package/dist/commonjs/react-query/guardrailsResetClusterDefaultGuardrails.js +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/sdk/agentruns.d.ts +7 -0
- package/dist/commonjs/sdk/agentruns.d.ts.map +1 -1
- package/dist/commonjs/sdk/agentruns.js +10 -0
- package/dist/commonjs/sdk/agentruns.js.map +1 -1
- package/dist/commonjs/sdk/guardrails.d.ts +2 -2
- package/dist/commonjs/sdk/guardrails.js +2 -2
- package/dist/esm/funcs/agentRunsCancelAgentRun.d.ts +21 -0
- package/dist/esm/funcs/agentRunsCancelAgentRun.d.ts.map +1 -0
- package/dist/esm/funcs/agentRunsCancelAgentRun.js +106 -0
- package/dist/esm/funcs/agentRunsCancelAgentRun.js.map +1 -0
- package/dist/esm/funcs/guardrailsGetClusterDefaultGuardrails.d.ts +1 -1
- package/dist/esm/funcs/guardrailsGetClusterDefaultGuardrails.js +1 -1
- package/dist/esm/funcs/guardrailsResetClusterDefaultGuardrails.d.ts +1 -1
- package/dist/esm/funcs/guardrailsResetClusterDefaultGuardrails.js +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/agentRunsCancelAgentRun.d.ts +8 -0
- package/dist/esm/mcp-server/tools/agentRunsCancelAgentRun.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/agentRunsCancelAgentRun.js +28 -0
- package/dist/esm/mcp-server/tools/agentRunsCancelAgentRun.js.map +1 -0
- package/dist/esm/mcp-server/tools/guardrailsGetClusterDefaultGuardrails.js +1 -1
- package/dist/esm/mcp-server/tools/guardrailsGetClusterDefaultGuardrails.js.map +1 -1
- package/dist/esm/mcp-server/tools/guardrailsResetClusterDefaultGuardrails.js +1 -1
- package/dist/esm/mcp-server/tools/guardrailsResetClusterDefaultGuardrails.js.map +1 -1
- package/dist/esm/models/components/agentrun.d.ts +11 -0
- package/dist/esm/models/components/agentrun.d.ts.map +1 -1
- package/dist/esm/models/components/agentrun.js +5 -0
- package/dist/esm/models/components/agentrun.js.map +1 -1
- package/dist/esm/models/components/clusterdefaultguardrailsresponse.d.ts +2 -2
- package/dist/esm/models/operations/cancelagentrun.d.ts +24 -0
- package/dist/esm/models/operations/cancelagentrun.d.ts.map +1 -0
- package/dist/esm/models/operations/cancelagentrun.js +37 -0
- package/dist/esm/models/operations/cancelagentrun.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/react-query/agentRunsCancelAgentRun.d.ts +30 -0
- package/dist/esm/react-query/agentRunsCancelAgentRun.d.ts.map +1 -0
- package/dist/esm/react-query/agentRunsCancelAgentRun.js +42 -0
- package/dist/esm/react-query/agentRunsCancelAgentRun.js.map +1 -0
- package/dist/esm/react-query/guardrailsGetClusterDefaultGuardrails.d.ts +2 -2
- package/dist/esm/react-query/guardrailsGetClusterDefaultGuardrails.js +2 -2
- package/dist/esm/react-query/guardrailsResetClusterDefaultGuardrails.d.ts +1 -1
- package/dist/esm/react-query/guardrailsResetClusterDefaultGuardrails.js +1 -1
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/sdk/agentruns.d.ts +7 -0
- package/dist/esm/sdk/agentruns.d.ts.map +1 -1
- package/dist/esm/sdk/agentruns.js +10 -0
- package/dist/esm/sdk/agentruns.js.map +1 -1
- package/dist/esm/sdk/guardrails.d.ts +2 -2
- package/dist/esm/sdk/guardrails.js +2 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/agentRunsCancelAgentRun.ts +201 -0
- package/src/funcs/guardrailsGetClusterDefaultGuardrails.ts +1 -1
- package/src/funcs/guardrailsResetClusterDefaultGuardrails.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/agentRunsCancelAgentRun.ts +37 -0
- package/src/mcp-server/tools/guardrailsGetClusterDefaultGuardrails.ts +1 -1
- package/src/mcp-server/tools/guardrailsResetClusterDefaultGuardrails.ts +1 -1
- package/src/models/components/agentrun.ts +11 -0
- package/src/models/components/clusterdefaultguardrailsresponse.ts +2 -2
- package/src/models/operations/cancelagentrun.ts +75 -0
- package/src/models/operations/index.ts +1 -0
- package/src/react-query/agentRunsCancelAgentRun.ts +111 -0
- package/src/react-query/guardrailsGetClusterDefaultGuardrails.ts +2 -2
- package/src/react-query/guardrailsResetClusterDefaultGuardrails.ts +1 -1
- package/src/react-query/index.ts +1 -0
- package/src/sdk/agentruns.ts +18 -0
- package/src/sdk/guardrails.ts +2 -2
|
@@ -63,7 +63,7 @@ export class Guardrails extends ClientSDK {
|
|
|
63
63
|
* Get the cluster default guardrails
|
|
64
64
|
*
|
|
65
65
|
* @remarks
|
|
66
|
-
* Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with
|
|
66
|
+
* Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with no rules, so nothing is enforced.
|
|
67
67
|
*/
|
|
68
68
|
async getClusterDefaultGuardrails(options) {
|
|
69
69
|
return unwrapAsync(guardrailsGetClusterDefaultGuardrails(this, options));
|
|
@@ -81,7 +81,7 @@ export class Guardrails extends ClientSDK {
|
|
|
81
81
|
* Reset the cluster default guardrails
|
|
82
82
|
*
|
|
83
83
|
* @remarks
|
|
84
|
-
* Delete the saved cluster default so the built-in default applies again: switched on, with
|
|
84
|
+
* Delete the saved cluster default so the built-in default applies again: switched on, with no rules, so nothing is enforced. To stop enforcing a cluster default, update it with enabled set to false instead.
|
|
85
85
|
*/
|
|
86
86
|
async resetClusterDefaultGuardrails(options) {
|
|
87
87
|
return unwrapAsync(guardrailsResetClusterDefaultGuardrails(this, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Cancel a saved-agent run
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Cancels a queued run locally before dispatch, or forwards cancellation to its linked gateway response. Locally failed linked runs with an active or missing gateway snapshot are checked upstream before cancellation; genuine terminal work is never relabelled cancelled. Fresh incomplete gateway snapshots are presented as incomplete on subsequent reads while preserving the connector error and completion timestamp, even if cancel returns 409. Repeated cancellation is idempotent. Returns 409 if submission has no linked response yet or a genuine terminal outcome already won. Uses the run's organization, team and delegated-user mutation scope; operator read access does not grant cancellation access. API-key callers also need write:responses for linked cancellation and read:responses to inspect locally failed runs or reconcile a completion race.
|
|
35
|
+
*
|
|
36
|
+
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
37
|
+
*/
|
|
38
|
+
export function agentRunsCancelAgentRun(
|
|
39
|
+
client: SDKCore,
|
|
40
|
+
request: operations.CancelAgentRunRequest,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): APIPromise<
|
|
43
|
+
Result<
|
|
44
|
+
components.AgentRun,
|
|
45
|
+
| errors.ErrorEnvelope
|
|
46
|
+
| SDKError
|
|
47
|
+
| ResponseValidationError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
| RequestAbortedError
|
|
50
|
+
| RequestTimeoutError
|
|
51
|
+
| InvalidRequestError
|
|
52
|
+
| UnexpectedClientError
|
|
53
|
+
| SDKValidationError
|
|
54
|
+
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
request,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function $do(
|
|
64
|
+
client: SDKCore,
|
|
65
|
+
request: operations.CancelAgentRunRequest,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
components.AgentRun,
|
|
71
|
+
| errors.ErrorEnvelope
|
|
72
|
+
| SDKError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const parsed = safeParse(
|
|
85
|
+
request,
|
|
86
|
+
(value) => operations.CancelAgentRunRequest$outboundSchema.parse(value),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = null;
|
|
94
|
+
|
|
95
|
+
const pathParams = {
|
|
96
|
+
agent_id: encodeSimple("agent_id", payload.agent_id, {
|
|
97
|
+
explode: false,
|
|
98
|
+
charEncoding: "percent",
|
|
99
|
+
}),
|
|
100
|
+
run_id: encodeSimple("run_id", payload.run_id, {
|
|
101
|
+
explode: false,
|
|
102
|
+
charEncoding: "percent",
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
const path = pathToFunc("/api/v1/agents/{agent_id}/runs/{run_id}/cancel")(
|
|
106
|
+
pathParams,
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
const headers = new Headers(compactMap({
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
"X-On-Behalf-Of": encodeSimple(
|
|
112
|
+
"X-On-Behalf-Of",
|
|
113
|
+
payload["X-On-Behalf-Of"],
|
|
114
|
+
{ explode: false, charEncoding: "none" },
|
|
115
|
+
),
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
119
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
120
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
121
|
+
|
|
122
|
+
const context = {
|
|
123
|
+
options: client._options,
|
|
124
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
125
|
+
operationID: "cancelAgentRun",
|
|
126
|
+
oAuth2Scopes: null,
|
|
127
|
+
|
|
128
|
+
resolvedSecurity: requestSecurity,
|
|
129
|
+
|
|
130
|
+
securitySource: client._options.bearerAuth,
|
|
131
|
+
retryConfig: options?.retries
|
|
132
|
+
|| client._options.retryConfig
|
|
133
|
+
|| {
|
|
134
|
+
strategy: "backoff",
|
|
135
|
+
backoff: {
|
|
136
|
+
initialInterval: 500,
|
|
137
|
+
maxInterval: 5000,
|
|
138
|
+
exponent: 1.5,
|
|
139
|
+
maxElapsedTime: 15000,
|
|
140
|
+
},
|
|
141
|
+
retryConnectionErrors: true,
|
|
142
|
+
}
|
|
143
|
+
|| { strategy: "none" },
|
|
144
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const requestRes = client._createRequest(context, {
|
|
148
|
+
security: requestSecurity,
|
|
149
|
+
method: "POST",
|
|
150
|
+
baseURL: options?.serverURL,
|
|
151
|
+
path: path,
|
|
152
|
+
headers: headers,
|
|
153
|
+
body: body,
|
|
154
|
+
userAgent: client._options.userAgent,
|
|
155
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
156
|
+
}, options);
|
|
157
|
+
if (!requestRes.ok) {
|
|
158
|
+
return [requestRes, { status: "invalid" }];
|
|
159
|
+
}
|
|
160
|
+
const req = requestRes.value;
|
|
161
|
+
|
|
162
|
+
const doResult = await client._do(req, {
|
|
163
|
+
context,
|
|
164
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
165
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
166
|
+
retryConfig: context.retryConfig,
|
|
167
|
+
retryCodes: context.retryCodes,
|
|
168
|
+
});
|
|
169
|
+
if (!doResult.ok) {
|
|
170
|
+
return [doResult, { status: "request-error", request: req }];
|
|
171
|
+
}
|
|
172
|
+
const response = doResult.value;
|
|
173
|
+
|
|
174
|
+
const responseFields = {
|
|
175
|
+
HttpMeta: { Response: response, Request: req },
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const [result] = await M.match<
|
|
179
|
+
components.AgentRun,
|
|
180
|
+
| errors.ErrorEnvelope
|
|
181
|
+
| SDKError
|
|
182
|
+
| ResponseValidationError
|
|
183
|
+
| ConnectionError
|
|
184
|
+
| RequestAbortedError
|
|
185
|
+
| RequestTimeoutError
|
|
186
|
+
| InvalidRequestError
|
|
187
|
+
| UnexpectedClientError
|
|
188
|
+
| SDKValidationError
|
|
189
|
+
>(
|
|
190
|
+
M.json(200, components.AgentRun$inboundSchema),
|
|
191
|
+
M.jsonErr([401, 403, 404, 409], errors.ErrorEnvelope$inboundSchema),
|
|
192
|
+
M.jsonErr(502, errors.ErrorEnvelope$inboundSchema),
|
|
193
|
+
M.fail("4XX"),
|
|
194
|
+
M.fail("5XX"),
|
|
195
|
+
)(response, req, { extraFields: responseFields });
|
|
196
|
+
if (!result.ok) {
|
|
197
|
+
return [result, { status: "complete", request: req, response }];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return [result, { status: "complete", request: req, response }];
|
|
201
|
+
}
|
|
@@ -27,7 +27,7 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
* Get the cluster default guardrails
|
|
28
28
|
*
|
|
29
29
|
* @remarks
|
|
30
|
-
* Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with
|
|
30
|
+
* Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with no rules, so nothing is enforced.
|
|
31
31
|
*
|
|
32
32
|
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
33
33
|
*/
|
|
@@ -27,7 +27,7 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
* Reset the cluster default guardrails
|
|
28
28
|
*
|
|
29
29
|
* @remarks
|
|
30
|
-
* Delete the saved cluster default so the built-in default applies again: switched on, with
|
|
30
|
+
* Delete the saved cluster default so the built-in default applies again: switched on, with no rules, so nothing is enforced. To stop enforcing a cluster default, update it with enabled set to false instead.
|
|
31
31
|
*
|
|
32
32
|
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
33
33
|
*/
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "1.1.0",
|
|
68
|
-
sdkVersion: "0.54.
|
|
68
|
+
sdkVersion: "0.54.105",
|
|
69
69
|
genVersion: "2.948.4",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.54.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.54.105 2.948.4 1.1.0 @meetkai/mka1",
|
|
71
71
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { tool$agentConnectorsDeleteAgentConnector } from "./tools/agentConnector
|
|
|
19
19
|
import { tool$agentConnectorsGetAgentConnector } from "./tools/agentConnectorsGetAgentConnector.js";
|
|
20
20
|
import { tool$agentConnectorsListAgentConnectors } from "./tools/agentConnectorsListAgentConnectors.js";
|
|
21
21
|
import { tool$agentConnectorsSetupWhatsAppAppWebhook } from "./tools/agentConnectorsSetupWhatsAppAppWebhook.js";
|
|
22
|
+
import { tool$agentRunsCancelAgentRun } from "./tools/agentRunsCancelAgentRun.js";
|
|
22
23
|
import { tool$agentRunsCreateAgentRun } from "./tools/agentRunsCreateAgentRun.js";
|
|
23
24
|
import { tool$agentRunsDecideAgentRunMcpApproval } from "./tools/agentRunsDecideAgentRunMcpApproval.js";
|
|
24
25
|
import { tool$agentRunsGetAgentRun } from "./tools/agentRunsGetAgentRun.js";
|
|
@@ -499,7 +500,7 @@ export function createMCPServer(deps: {
|
|
|
499
500
|
}) {
|
|
500
501
|
const server = new McpServer({
|
|
501
502
|
name: "SDK",
|
|
502
|
-
version: "0.54.
|
|
503
|
+
version: "0.54.105",
|
|
503
504
|
});
|
|
504
505
|
|
|
505
506
|
const client = new SDKCore({
|
|
@@ -586,6 +587,7 @@ export function createMCPServer(deps: {
|
|
|
586
587
|
tool(tool$agentRunsListAgentRuns);
|
|
587
588
|
tool(tool$agentRunsCreateAgentRun);
|
|
588
589
|
tool(tool$agentRunsStreamAgentRunEvents);
|
|
590
|
+
tool(tool$agentRunsCancelAgentRun);
|
|
589
591
|
tool(tool$agentRunsWakeAgentRun);
|
|
590
592
|
tool(tool$agentRunsDecideAgentRunMcpApproval);
|
|
591
593
|
tool(tool$agentRunsGetAgentRun);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { agentRunsCancelAgentRun } from "../../funcs/agentRunsCancelAgentRun.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CancelAgentRunRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$agentRunsCancelAgentRun: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "agent-runs-cancel-agent-run",
|
|
15
|
+
description: `Cancel a saved-agent run
|
|
16
|
+
|
|
17
|
+
Cancels a queued run locally before dispatch, or forwards cancellation to its linked gateway response. Locally failed linked runs with an active or missing gateway snapshot are checked upstream before cancellation; genuine terminal work is never relabelled cancelled. Fresh incomplete gateway snapshots are presented as incomplete on subsequent reads while preserving the connector error and completion timestamp, even if cancel returns 409. Repeated cancellation is idempotent. Returns 409 if submission has no linked response yet or a genuine terminal outcome already won. Uses the run's organization, team and delegated-user mutation scope; operator read access does not grant cancellation access. API-key callers also need write:responses for linked cancellation and read:responses to inspect locally failed runs or reconcile a completion race.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await agentRunsCancelAgentRun(
|
|
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
|
+
};
|
|
@@ -9,7 +9,7 @@ export const tool$guardrailsGetClusterDefaultGuardrails: ToolDefinition = {
|
|
|
9
9
|
name: "guardrails-get-cluster-default-guardrails",
|
|
10
10
|
description: `Get the cluster default guardrails
|
|
11
11
|
|
|
12
|
-
Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with
|
|
12
|
+
Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with no rules, so nothing is enforced.`,
|
|
13
13
|
tool: async (client, ctx) => {
|
|
14
14
|
const [result, apiCall] = await guardrailsGetClusterDefaultGuardrails(
|
|
15
15
|
client,
|
|
@@ -9,7 +9,7 @@ export const tool$guardrailsResetClusterDefaultGuardrails: ToolDefinition = {
|
|
|
9
9
|
name: "guardrails-reset-cluster-default-guardrails",
|
|
10
10
|
description: `Reset the cluster default guardrails
|
|
11
11
|
|
|
12
|
-
Delete the saved cluster default so the built-in default applies again: switched on, with
|
|
12
|
+
Delete the saved cluster default so the built-in default applies again: switched on, with no rules, so nothing is enforced. To stop enforcing a cluster default, update it with enabled set to false instead.`,
|
|
13
13
|
tool: async (client, ctx) => {
|
|
14
14
|
const [result, apiCall] = await guardrailsResetClusterDefaultGuardrails(
|
|
15
15
|
client,
|
|
@@ -14,12 +14,20 @@ export const AgentRunObject = {
|
|
|
14
14
|
} as const;
|
|
15
15
|
export type AgentRunObject = ClosedEnum<typeof AgentRunObject>;
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Terminal outcomes stay distinct: cancelled is caller-requested; incomplete means a limit or interruption stopped the run. gateway_response.incomplete_details records the reason, including max_tokens or max_tool_calls. Stored failed rows with one of these gateway outcomes are serialized with the gateway outcome, retaining any connector error and completion timestamp.
|
|
19
|
+
*/
|
|
17
20
|
export const AgentRunStatus = {
|
|
18
21
|
Queued: "queued",
|
|
19
22
|
Submitting: "submitting",
|
|
20
23
|
Completed: "completed",
|
|
21
24
|
Failed: "failed",
|
|
25
|
+
Cancelled: "cancelled",
|
|
26
|
+
Incomplete: "incomplete",
|
|
22
27
|
} as const;
|
|
28
|
+
/**
|
|
29
|
+
* Terminal outcomes stay distinct: cancelled is caller-requested; incomplete means a limit or interruption stopped the run. gateway_response.incomplete_details records the reason, including max_tokens or max_tool_calls. Stored failed rows with one of these gateway outcomes are serialized with the gateway outcome, retaining any connector error and completion timestamp.
|
|
30
|
+
*/
|
|
23
31
|
export type AgentRunStatus = ClosedEnum<typeof AgentRunStatus>;
|
|
24
32
|
|
|
25
33
|
export type AgentRun = {
|
|
@@ -30,6 +38,9 @@ export type AgentRun = {
|
|
|
30
38
|
* The agent configuration version this run executed against. Null for runs created before versioning.
|
|
31
39
|
*/
|
|
32
40
|
agentVersion: number | null;
|
|
41
|
+
/**
|
|
42
|
+
* Terminal outcomes stay distinct: cancelled is caller-requested; incomplete means a limit or interruption stopped the run. gateway_response.incomplete_details records the reason, including max_tokens or max_tool_calls. Stored failed rows with one of these gateway outcomes are serialized with the gateway outcome, retaining any connector error and completion timestamp.
|
|
43
|
+
*/
|
|
33
44
|
status: AgentRunStatus;
|
|
34
45
|
/**
|
|
35
46
|
* Arbitrary JSON value.
|
|
@@ -25,11 +25,11 @@ export type ClusterDefaultGuardrailsResponse = {
|
|
|
25
25
|
*/
|
|
26
26
|
guardrails: Array<GuardrailConfig>;
|
|
27
27
|
/**
|
|
28
|
-
* True while the cluster runs the built-in default (
|
|
28
|
+
* True while the cluster runs the built-in default (switched on, with no rules) because no operator has saved one
|
|
29
29
|
*/
|
|
30
30
|
builtIn: boolean;
|
|
31
31
|
/**
|
|
32
|
-
* True when
|
|
32
|
+
* True when some saved cluster default rules cannot be read: only the rules shown here are enforced. Saving this state back drops the unreadable rules, so do not unless that is intended
|
|
33
33
|
*/
|
|
34
34
|
settingsUnreadable: boolean;
|
|
35
35
|
/**
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type CancelAgentRunRequest = {
|
|
12
|
+
agentId: string;
|
|
13
|
+
runId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional external end-user identifier forwarded by the API gateway.
|
|
16
|
+
*/
|
|
17
|
+
xOnBehalfOf?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const CancelAgentRunRequest$inboundSchema: z.ZodType<
|
|
22
|
+
CancelAgentRunRequest,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({
|
|
26
|
+
agent_id: z.string(),
|
|
27
|
+
run_id: z.string(),
|
|
28
|
+
"X-On-Behalf-Of": z.string().optional(),
|
|
29
|
+
}).transform((v) => {
|
|
30
|
+
return remap$(v, {
|
|
31
|
+
"agent_id": "agentId",
|
|
32
|
+
"run_id": "runId",
|
|
33
|
+
"X-On-Behalf-Of": "xOnBehalfOf",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
/** @internal */
|
|
37
|
+
export type CancelAgentRunRequest$Outbound = {
|
|
38
|
+
agent_id: string;
|
|
39
|
+
run_id: string;
|
|
40
|
+
"X-On-Behalf-Of"?: string | undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const CancelAgentRunRequest$outboundSchema: z.ZodType<
|
|
45
|
+
CancelAgentRunRequest$Outbound,
|
|
46
|
+
z.ZodTypeDef,
|
|
47
|
+
CancelAgentRunRequest
|
|
48
|
+
> = z.object({
|
|
49
|
+
agentId: z.string(),
|
|
50
|
+
runId: z.string(),
|
|
51
|
+
xOnBehalfOf: z.string().optional(),
|
|
52
|
+
}).transform((v) => {
|
|
53
|
+
return remap$(v, {
|
|
54
|
+
agentId: "agent_id",
|
|
55
|
+
runId: "run_id",
|
|
56
|
+
xOnBehalfOf: "X-On-Behalf-Of",
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export function cancelAgentRunRequestToJSON(
|
|
61
|
+
cancelAgentRunRequest: CancelAgentRunRequest,
|
|
62
|
+
): string {
|
|
63
|
+
return JSON.stringify(
|
|
64
|
+
CancelAgentRunRequest$outboundSchema.parse(cancelAgentRunRequest),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
export function cancelAgentRunRequestFromJSON(
|
|
68
|
+
jsonString: string,
|
|
69
|
+
): SafeParseResult<CancelAgentRunRequest, SDKValidationError> {
|
|
70
|
+
return safeParse(
|
|
71
|
+
jsonString,
|
|
72
|
+
(x) => CancelAgentRunRequest$inboundSchema.parse(JSON.parse(x)),
|
|
73
|
+
`Failed to parse 'CancelAgentRunRequest' from JSON`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -22,6 +22,7 @@ export * from "./appendagentevaltrials.js";
|
|
|
22
22
|
export * from "./archivefeatureflag.js";
|
|
23
23
|
export * from "./batchgetcompletionfeedback.js";
|
|
24
24
|
export * from "./batchgetresponsefeedback.js";
|
|
25
|
+
export * from "./cancelagentrun.js";
|
|
25
26
|
export * from "./cancelbatch.js";
|
|
26
27
|
export * from "./cancelevalrun.js";
|
|
27
28
|
export * from "./cancelfinetuningjob.js";
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { SDKCore } from "../core.js";
|
|
11
|
+
import { agentRunsCancelAgentRun } from "../funcs/agentRunsCancelAgentRun.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
28
|
+
import { useSDKContext } from "./_context.js";
|
|
29
|
+
import { MutationHookOptions } from "./_types.js";
|
|
30
|
+
|
|
31
|
+
export type AgentRunsCancelAgentRunMutationVariables = {
|
|
32
|
+
request: operations.CancelAgentRunRequest;
|
|
33
|
+
options?: RequestOptions;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type AgentRunsCancelAgentRunMutationData = components.AgentRun;
|
|
37
|
+
|
|
38
|
+
export type AgentRunsCancelAgentRunMutationError =
|
|
39
|
+
| errors.ErrorEnvelope
|
|
40
|
+
| SDKError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Cancel a saved-agent run
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Cancels a queued run locally before dispatch, or forwards cancellation to its linked gateway response. Locally failed linked runs with an active or missing gateway snapshot are checked upstream before cancellation; genuine terminal work is never relabelled cancelled. Fresh incomplete gateway snapshots are presented as incomplete on subsequent reads while preserving the connector error and completion timestamp, even if cancel returns 409. Repeated cancellation is idempotent. Returns 409 if submission has no linked response yet or a genuine terminal outcome already won. Uses the run's organization, team and delegated-user mutation scope; operator read access does not grant cancellation access. API-key callers also need write:responses for linked cancellation and read:responses to inspect locally failed runs or reconcile a completion race.
|
|
54
|
+
*/
|
|
55
|
+
export function useAgentRunsCancelAgentRunMutation(
|
|
56
|
+
options?: MutationHookOptions<
|
|
57
|
+
AgentRunsCancelAgentRunMutationData,
|
|
58
|
+
AgentRunsCancelAgentRunMutationError,
|
|
59
|
+
AgentRunsCancelAgentRunMutationVariables
|
|
60
|
+
>,
|
|
61
|
+
): UseMutationResult<
|
|
62
|
+
AgentRunsCancelAgentRunMutationData,
|
|
63
|
+
AgentRunsCancelAgentRunMutationError,
|
|
64
|
+
AgentRunsCancelAgentRunMutationVariables
|
|
65
|
+
> {
|
|
66
|
+
const client = useSDKContext();
|
|
67
|
+
return useMutation({
|
|
68
|
+
...buildAgentRunsCancelAgentRunMutation(client, options),
|
|
69
|
+
...options,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function mutationKeyAgentRunsCancelAgentRun(): MutationKey {
|
|
74
|
+
return ["@meetkai/mka1", "Agent Runs", "cancelAgentRun"];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function buildAgentRunsCancelAgentRunMutation(
|
|
78
|
+
client$: SDKCore,
|
|
79
|
+
hookOptions?: RequestOptions,
|
|
80
|
+
): {
|
|
81
|
+
mutationKey: MutationKey;
|
|
82
|
+
mutationFn: (
|
|
83
|
+
variables: AgentRunsCancelAgentRunMutationVariables,
|
|
84
|
+
) => Promise<AgentRunsCancelAgentRunMutationData>;
|
|
85
|
+
} {
|
|
86
|
+
return {
|
|
87
|
+
mutationKey: mutationKeyAgentRunsCancelAgentRun(),
|
|
88
|
+
mutationFn: function agentRunsCancelAgentRunMutationFn({
|
|
89
|
+
request,
|
|
90
|
+
options,
|
|
91
|
+
}): Promise<AgentRunsCancelAgentRunMutationData> {
|
|
92
|
+
const mergedOptions = {
|
|
93
|
+
...hookOptions,
|
|
94
|
+
...options,
|
|
95
|
+
fetchOptions: {
|
|
96
|
+
...hookOptions?.fetchOptions,
|
|
97
|
+
...options?.fetchOptions,
|
|
98
|
+
signal: combineSignals(
|
|
99
|
+
hookOptions?.fetchOptions?.signal,
|
|
100
|
+
options?.fetchOptions?.signal,
|
|
101
|
+
),
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
return unwrapAsync(agentRunsCancelAgentRun(
|
|
105
|
+
client$,
|
|
106
|
+
request,
|
|
107
|
+
mergedOptions,
|
|
108
|
+
));
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -49,7 +49,7 @@ export type GuardrailsGetClusterDefaultGuardrailsQueryError =
|
|
|
49
49
|
* Get the cluster default guardrails
|
|
50
50
|
*
|
|
51
51
|
* @remarks
|
|
52
|
-
* Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with
|
|
52
|
+
* Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with no rules, so nothing is enforced.
|
|
53
53
|
*/
|
|
54
54
|
export function useGuardrailsGetClusterDefaultGuardrails(
|
|
55
55
|
options?: QueryHookOptions<
|
|
@@ -74,7 +74,7 @@ export function useGuardrailsGetClusterDefaultGuardrails(
|
|
|
74
74
|
* Get the cluster default guardrails
|
|
75
75
|
*
|
|
76
76
|
* @remarks
|
|
77
|
-
* Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with
|
|
77
|
+
* Cluster operator view of the default guardrails enforced beneath the org-wide and team policies of every enrolled organization. Until an operator saves one, the built-in default applies: switched on, with no rules, so nothing is enforced.
|
|
78
78
|
*/
|
|
79
79
|
export function useGuardrailsGetClusterDefaultGuardrailsSuspense(
|
|
80
80
|
options?: SuspenseQueryHookOptions<
|
|
@@ -47,7 +47,7 @@ export type GuardrailsResetClusterDefaultGuardrailsMutationError =
|
|
|
47
47
|
* Reset the cluster default guardrails
|
|
48
48
|
*
|
|
49
49
|
* @remarks
|
|
50
|
-
* Delete the saved cluster default so the built-in default applies again: switched on, with
|
|
50
|
+
* Delete the saved cluster default so the built-in default applies again: switched on, with no rules, so nothing is enforced. To stop enforcing a cluster default, update it with enabled set to false instead.
|
|
51
51
|
*/
|
|
52
52
|
export function useGuardrailsResetClusterDefaultGuardrailsMutation(
|
|
53
53
|
options?: MutationHookOptions<
|
package/src/react-query/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from "./agentConnectorsDeleteAgentConnector.js";
|
|
|
11
11
|
export * from "./agentConnectorsGetAgentConnector.js";
|
|
12
12
|
export * from "./agentConnectorsListAgentConnectors.js";
|
|
13
13
|
export * from "./agentConnectorsSetupWhatsAppAppWebhook.js";
|
|
14
|
+
export * from "./agentRunsCancelAgentRun.js";
|
|
14
15
|
export * from "./agentRunsCreateAgentRun.js";
|
|
15
16
|
export * from "./agentRunsDecideAgentRunMcpApproval.js";
|
|
16
17
|
export * from "./agentRunsGetAgentRun.js";
|