@meetkai/mka1 0.54.104 → 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 +3392 -3234
- package/bin/mcp-server.js.map +11 -8
- 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/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/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/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/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/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/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/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/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/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/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/agentRunsCancelAgentRun.ts +201 -0
- 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/models/components/agentrun.ts +11 -0
- 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/index.ts +1 -0
- package/src/sdk/agentruns.ts +18 -0
|
@@ -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
|
+
}
|
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";
|
package/src/sdk/agentruns.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { agentRunsCancelAgentRun } from "../funcs/agentRunsCancelAgentRun.js";
|
|
5
6
|
import { agentRunsCreateAgentRun } from "../funcs/agentRunsCreateAgentRun.js";
|
|
6
7
|
import { agentRunsDecideAgentRunMcpApproval } from "../funcs/agentRunsDecideAgentRunMcpApproval.js";
|
|
7
8
|
import { agentRunsGetAgentRun } from "../funcs/agentRunsGetAgentRun.js";
|
|
@@ -62,6 +63,23 @@ export class AgentRuns extends ClientSDK {
|
|
|
62
63
|
));
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Cancel a saved-agent run
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* 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.
|
|
71
|
+
*/
|
|
72
|
+
async cancelAgentRun(
|
|
73
|
+
request: operations.CancelAgentRunRequest,
|
|
74
|
+
options?: RequestOptions,
|
|
75
|
+
): Promise<components.AgentRun> {
|
|
76
|
+
return unwrapAsync(agentRunsCancelAgentRun(
|
|
77
|
+
this,
|
|
78
|
+
request,
|
|
79
|
+
options,
|
|
80
|
+
));
|
|
81
|
+
}
|
|
82
|
+
|
|
65
83
|
/**
|
|
66
84
|
* Wake a sleeping agent run
|
|
67
85
|
*
|