@meetkai/mka1 0.54.104 → 0.54.106

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 (120) hide show
  1. package/README.md +360 -360
  2. package/bin/mcp-server.js +3400 -3238
  3. package/bin/mcp-server.js.map +15 -12
  4. package/dist/commonjs/funcs/agentRunsCancelAgentRun.d.ts +21 -0
  5. package/dist/commonjs/funcs/agentRunsCancelAgentRun.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/agentRunsCancelAgentRun.js +142 -0
  7. package/dist/commonjs/funcs/agentRunsCancelAgentRun.js.map +1 -0
  8. package/dist/commonjs/lib/config.d.ts +2 -2
  9. package/dist/commonjs/lib/config.js +2 -2
  10. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  11. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  12. package/dist/commonjs/mcp-server/server.js +3 -1
  13. package/dist/commonjs/mcp-server/server.js.map +1 -1
  14. package/dist/commonjs/mcp-server/tools/agentRunsCancelAgentRun.d.ts +8 -0
  15. package/dist/commonjs/mcp-server/tools/agentRunsCancelAgentRun.d.ts.map +1 -0
  16. package/dist/commonjs/mcp-server/tools/agentRunsCancelAgentRun.js +64 -0
  17. package/dist/commonjs/mcp-server/tools/agentRunsCancelAgentRun.js.map +1 -0
  18. package/dist/commonjs/models/components/addcatalogmodelrequest.d.ts +4 -2
  19. package/dist/commonjs/models/components/addcatalogmodelrequest.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/addcatalogmodelrequest.js +4 -2
  21. package/dist/commonjs/models/components/addcatalogmodelrequest.js.map +1 -1
  22. package/dist/commonjs/models/components/agentrun.d.ts +11 -0
  23. package/dist/commonjs/models/components/agentrun.d.ts.map +1 -1
  24. package/dist/commonjs/models/components/agentrun.js +5 -0
  25. package/dist/commonjs/models/components/agentrun.js.map +1 -1
  26. package/dist/commonjs/models/components/texttospeechrequest.d.ts +3 -3
  27. package/dist/commonjs/models/components/texttospeechrequest.js +1 -1
  28. package/dist/commonjs/models/components/texttospeechstreamingrequest.d.ts +3 -3
  29. package/dist/commonjs/models/components/texttospeechstreamingrequest.js +1 -1
  30. package/dist/commonjs/models/components/updatecatalogmodelrequest.d.ts +4 -2
  31. package/dist/commonjs/models/components/updatecatalogmodelrequest.d.ts.map +1 -1
  32. package/dist/commonjs/models/components/updatecatalogmodelrequest.js +4 -2
  33. package/dist/commonjs/models/components/updatecatalogmodelrequest.js.map +1 -1
  34. package/dist/commonjs/models/operations/cancelagentrun.d.ts +24 -0
  35. package/dist/commonjs/models/operations/cancelagentrun.d.ts.map +1 -0
  36. package/dist/commonjs/models/operations/cancelagentrun.js +75 -0
  37. package/dist/commonjs/models/operations/cancelagentrun.js.map +1 -0
  38. package/dist/commonjs/models/operations/index.d.ts +1 -0
  39. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  40. package/dist/commonjs/models/operations/index.js +1 -0
  41. package/dist/commonjs/models/operations/index.js.map +1 -1
  42. package/dist/commonjs/react-query/agentRunsCancelAgentRun.d.ts +30 -0
  43. package/dist/commonjs/react-query/agentRunsCancelAgentRun.d.ts.map +1 -0
  44. package/dist/commonjs/react-query/agentRunsCancelAgentRun.js +47 -0
  45. package/dist/commonjs/react-query/agentRunsCancelAgentRun.js.map +1 -0
  46. package/dist/commonjs/react-query/index.d.ts +1 -0
  47. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  48. package/dist/commonjs/react-query/index.js +1 -0
  49. package/dist/commonjs/react-query/index.js.map +1 -1
  50. package/dist/commonjs/sdk/agentruns.d.ts +7 -0
  51. package/dist/commonjs/sdk/agentruns.d.ts.map +1 -1
  52. package/dist/commonjs/sdk/agentruns.js +10 -0
  53. package/dist/commonjs/sdk/agentruns.js.map +1 -1
  54. package/dist/esm/funcs/agentRunsCancelAgentRun.d.ts +21 -0
  55. package/dist/esm/funcs/agentRunsCancelAgentRun.d.ts.map +1 -0
  56. package/dist/esm/funcs/agentRunsCancelAgentRun.js +106 -0
  57. package/dist/esm/funcs/agentRunsCancelAgentRun.js.map +1 -0
  58. package/dist/esm/lib/config.d.ts +2 -2
  59. package/dist/esm/lib/config.js +2 -2
  60. package/dist/esm/mcp-server/mcp-server.js +1 -1
  61. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  62. package/dist/esm/mcp-server/server.js +3 -1
  63. package/dist/esm/mcp-server/server.js.map +1 -1
  64. package/dist/esm/mcp-server/tools/agentRunsCancelAgentRun.d.ts +8 -0
  65. package/dist/esm/mcp-server/tools/agentRunsCancelAgentRun.d.ts.map +1 -0
  66. package/dist/esm/mcp-server/tools/agentRunsCancelAgentRun.js +28 -0
  67. package/dist/esm/mcp-server/tools/agentRunsCancelAgentRun.js.map +1 -0
  68. package/dist/esm/models/components/addcatalogmodelrequest.d.ts +4 -2
  69. package/dist/esm/models/components/addcatalogmodelrequest.d.ts.map +1 -1
  70. package/dist/esm/models/components/addcatalogmodelrequest.js +4 -2
  71. package/dist/esm/models/components/addcatalogmodelrequest.js.map +1 -1
  72. package/dist/esm/models/components/agentrun.d.ts +11 -0
  73. package/dist/esm/models/components/agentrun.d.ts.map +1 -1
  74. package/dist/esm/models/components/agentrun.js +5 -0
  75. package/dist/esm/models/components/agentrun.js.map +1 -1
  76. package/dist/esm/models/components/texttospeechrequest.d.ts +3 -3
  77. package/dist/esm/models/components/texttospeechrequest.js +1 -1
  78. package/dist/esm/models/components/texttospeechstreamingrequest.d.ts +3 -3
  79. package/dist/esm/models/components/texttospeechstreamingrequest.js +1 -1
  80. package/dist/esm/models/components/updatecatalogmodelrequest.d.ts +4 -2
  81. package/dist/esm/models/components/updatecatalogmodelrequest.d.ts.map +1 -1
  82. package/dist/esm/models/components/updatecatalogmodelrequest.js +4 -2
  83. package/dist/esm/models/components/updatecatalogmodelrequest.js.map +1 -1
  84. package/dist/esm/models/operations/cancelagentrun.d.ts +24 -0
  85. package/dist/esm/models/operations/cancelagentrun.d.ts.map +1 -0
  86. package/dist/esm/models/operations/cancelagentrun.js +37 -0
  87. package/dist/esm/models/operations/cancelagentrun.js.map +1 -0
  88. package/dist/esm/models/operations/index.d.ts +1 -0
  89. package/dist/esm/models/operations/index.d.ts.map +1 -1
  90. package/dist/esm/models/operations/index.js +1 -0
  91. package/dist/esm/models/operations/index.js.map +1 -1
  92. package/dist/esm/react-query/agentRunsCancelAgentRun.d.ts +30 -0
  93. package/dist/esm/react-query/agentRunsCancelAgentRun.d.ts.map +1 -0
  94. package/dist/esm/react-query/agentRunsCancelAgentRun.js +42 -0
  95. package/dist/esm/react-query/agentRunsCancelAgentRun.js.map +1 -0
  96. package/dist/esm/react-query/index.d.ts +1 -0
  97. package/dist/esm/react-query/index.d.ts.map +1 -1
  98. package/dist/esm/react-query/index.js +1 -0
  99. package/dist/esm/react-query/index.js.map +1 -1
  100. package/dist/esm/sdk/agentruns.d.ts +7 -0
  101. package/dist/esm/sdk/agentruns.d.ts.map +1 -1
  102. package/dist/esm/sdk/agentruns.js +10 -0
  103. package/dist/esm/sdk/agentruns.js.map +1 -1
  104. package/jsr.json +1 -1
  105. package/package.json +1 -1
  106. package/src/funcs/agentRunsCancelAgentRun.ts +201 -0
  107. package/src/lib/config.ts +2 -2
  108. package/src/mcp-server/mcp-server.ts +1 -1
  109. package/src/mcp-server/server.ts +3 -1
  110. package/src/mcp-server/tools/agentRunsCancelAgentRun.ts +37 -0
  111. package/src/models/components/addcatalogmodelrequest.ts +8 -4
  112. package/src/models/components/agentrun.ts +11 -0
  113. package/src/models/components/texttospeechrequest.ts +3 -3
  114. package/src/models/components/texttospeechstreamingrequest.ts +3 -3
  115. package/src/models/components/updatecatalogmodelrequest.ts +8 -4
  116. package/src/models/operations/cancelagentrun.ts +75 -0
  117. package/src/models/operations/index.ts +1 -0
  118. package/src/react-query/agentRunsCancelAgentRun.ts +111 -0
  119. package/src/react-query/index.ts +1 -0
  120. package/src/sdk/agentruns.ts +18 -0
@@ -9,7 +9,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
11
  /**
12
- * Language code: 'auto' for automatic detection, or ISO 639-1 language codes
12
+ * Language code: 'auto' for automatic detection, or ISO 639-1 language codes. With 'auto', text confidently detected as a language without a voice is rejected with a 400 naming it.
13
13
  */
14
14
  export const TextToSpeechStreamingRequestLanguage = {
15
15
  Auto: "auto",
@@ -37,7 +37,7 @@ export const TextToSpeechStreamingRequestLanguage = {
37
37
  Uk: "uk",
38
38
  } as const;
39
39
  /**
40
- * Language code: 'auto' for automatic detection, or ISO 639-1 language codes
40
+ * Language code: 'auto' for automatic detection, or ISO 639-1 language codes. With 'auto', text confidently detected as a language without a voice is rejected with a 400 naming it.
41
41
  */
42
42
  export type TextToSpeechStreamingRequestLanguage = ClosedEnum<
43
43
  typeof TextToSpeechStreamingRequestLanguage
@@ -64,7 +64,7 @@ export type TextToSpeechStreamingRequest = {
64
64
  */
65
65
  text: string;
66
66
  /**
67
- * Language code: 'auto' for automatic detection, or ISO 639-1 language codes
67
+ * Language code: 'auto' for automatic detection, or ISO 639-1 language codes. With 'auto', text confidently detected as a language without a voice is rejected with a 400 naming it.
68
68
  */
69
69
  language?: TextToSpeechStreamingRequestLanguage | undefined;
70
70
  /**
@@ -189,7 +189,8 @@ export type RateLimitsQueue = {
189
189
 
190
190
  export type UpdateCatalogModelRequestRateLimits = {
191
191
  scope: RateLimitsScope;
192
- rpm: number;
192
+ rpm?: number | undefined;
193
+ tpm?: number | undefined;
193
194
  duration?: number | undefined;
194
195
  queue?: RateLimitsQueue | undefined;
195
196
  };
@@ -1435,14 +1436,16 @@ export const UpdateCatalogModelRequestRateLimits$inboundSchema: z.ZodType<
1435
1436
  unknown
1436
1437
  > = z.object({
1437
1438
  scope: RateLimitsScope$inboundSchema,
1438
- rpm: z.number().int(),
1439
+ rpm: z.number().int().optional(),
1440
+ tpm: z.number().int().optional(),
1439
1441
  duration: z.number().int().optional(),
1440
1442
  queue: z.lazy(() => RateLimitsQueue$inboundSchema).optional(),
1441
1443
  });
1442
1444
  /** @internal */
1443
1445
  export type UpdateCatalogModelRequestRateLimits$Outbound = {
1444
1446
  scope: string;
1445
- rpm: number;
1447
+ rpm?: number | undefined;
1448
+ tpm?: number | undefined;
1446
1449
  duration?: number | undefined;
1447
1450
  queue?: RateLimitsQueue$Outbound | undefined;
1448
1451
  };
@@ -1454,7 +1457,8 @@ export const UpdateCatalogModelRequestRateLimits$outboundSchema: z.ZodType<
1454
1457
  UpdateCatalogModelRequestRateLimits
1455
1458
  > = z.object({
1456
1459
  scope: RateLimitsScope$outboundSchema,
1457
- rpm: z.number().int(),
1460
+ rpm: z.number().int().optional(),
1461
+ tpm: z.number().int().optional(),
1458
1462
  duration: z.number().int().optional(),
1459
1463
  queue: z.lazy(() => RateLimitsQueue$outboundSchema).optional(),
1460
1464
  });
@@ -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
+ }
@@ -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";
@@ -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
  *