@meetkai/mka1 0.55.26 → 0.55.27

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 (81) hide show
  1. package/bin/mcp-server.js +106 -10
  2. package/bin/mcp-server.js.map +14 -13
  3. package/dist/commonjs/lib/config.d.ts +2 -2
  4. package/dist/commonjs/lib/config.js +2 -2
  5. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  6. package/dist/commonjs/mcp-server/server.js +1 -1
  7. package/dist/commonjs/models/components/banwordsguardrail.d.ts +27 -0
  8. package/dist/commonjs/models/components/banwordsguardrail.d.ts.map +1 -1
  9. package/dist/commonjs/models/components/banwordsguardrail.js +21 -1
  10. package/dist/commonjs/models/components/banwordsguardrail.js.map +1 -1
  11. package/dist/commonjs/models/components/classifierguardrail.d.ts +27 -0
  12. package/dist/commonjs/models/components/classifierguardrail.d.ts.map +1 -1
  13. package/dist/commonjs/models/components/classifierguardrail.js +21 -1
  14. package/dist/commonjs/models/components/classifierguardrail.js.map +1 -1
  15. package/dist/commonjs/models/components/clusterdefaultrulesummary.d.ts +21 -0
  16. package/dist/commonjs/models/components/clusterdefaultrulesummary.d.ts.map +1 -1
  17. package/dist/commonjs/models/components/clusterdefaultrulesummary.js +16 -1
  18. package/dist/commonjs/models/components/clusterdefaultrulesummary.js.map +1 -1
  19. package/dist/commonjs/models/components/index.d.ts +1 -0
  20. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  21. package/dist/commonjs/models/components/index.js +1 -0
  22. package/dist/commonjs/models/components/index.js.map +1 -1
  23. package/dist/commonjs/models/components/leakageguardrail.d.ts +27 -0
  24. package/dist/commonjs/models/components/leakageguardrail.d.ts.map +1 -1
  25. package/dist/commonjs/models/components/leakageguardrail.js +21 -1
  26. package/dist/commonjs/models/components/leakageguardrail.js.map +1 -1
  27. package/dist/commonjs/models/components/outputwindow.d.ts +28 -0
  28. package/dist/commonjs/models/components/outputwindow.d.ts.map +1 -0
  29. package/dist/commonjs/models/components/outputwindow.js +71 -0
  30. package/dist/commonjs/models/components/outputwindow.js.map +1 -0
  31. package/dist/commonjs/models/components/promptinjectionguardrail.d.ts +27 -0
  32. package/dist/commonjs/models/components/promptinjectionguardrail.d.ts.map +1 -1
  33. package/dist/commonjs/models/components/promptinjectionguardrail.js +21 -1
  34. package/dist/commonjs/models/components/promptinjectionguardrail.js.map +1 -1
  35. package/dist/commonjs/models/components/tooldefinition.d.ts +1 -1
  36. package/dist/esm/lib/config.d.ts +2 -2
  37. package/dist/esm/lib/config.js +2 -2
  38. package/dist/esm/mcp-server/mcp-server.js +1 -1
  39. package/dist/esm/mcp-server/server.js +1 -1
  40. package/dist/esm/models/components/banwordsguardrail.d.ts +27 -0
  41. package/dist/esm/models/components/banwordsguardrail.d.ts.map +1 -1
  42. package/dist/esm/models/components/banwordsguardrail.js +20 -0
  43. package/dist/esm/models/components/banwordsguardrail.js.map +1 -1
  44. package/dist/esm/models/components/classifierguardrail.d.ts +27 -0
  45. package/dist/esm/models/components/classifierguardrail.d.ts.map +1 -1
  46. package/dist/esm/models/components/classifierguardrail.js +20 -0
  47. package/dist/esm/models/components/classifierguardrail.js.map +1 -1
  48. package/dist/esm/models/components/clusterdefaultrulesummary.d.ts +21 -0
  49. package/dist/esm/models/components/clusterdefaultrulesummary.d.ts.map +1 -1
  50. package/dist/esm/models/components/clusterdefaultrulesummary.js +15 -0
  51. package/dist/esm/models/components/clusterdefaultrulesummary.js.map +1 -1
  52. package/dist/esm/models/components/index.d.ts +1 -0
  53. package/dist/esm/models/components/index.d.ts.map +1 -1
  54. package/dist/esm/models/components/index.js +1 -0
  55. package/dist/esm/models/components/index.js.map +1 -1
  56. package/dist/esm/models/components/leakageguardrail.d.ts +27 -0
  57. package/dist/esm/models/components/leakageguardrail.d.ts.map +1 -1
  58. package/dist/esm/models/components/leakageguardrail.js +20 -0
  59. package/dist/esm/models/components/leakageguardrail.js.map +1 -1
  60. package/dist/esm/models/components/outputwindow.d.ts +28 -0
  61. package/dist/esm/models/components/outputwindow.d.ts.map +1 -0
  62. package/dist/esm/models/components/outputwindow.js +33 -0
  63. package/dist/esm/models/components/outputwindow.js.map +1 -0
  64. package/dist/esm/models/components/promptinjectionguardrail.d.ts +27 -0
  65. package/dist/esm/models/components/promptinjectionguardrail.d.ts.map +1 -1
  66. package/dist/esm/models/components/promptinjectionguardrail.js +20 -0
  67. package/dist/esm/models/components/promptinjectionguardrail.js.map +1 -1
  68. package/dist/esm/models/components/tooldefinition.d.ts +1 -1
  69. package/jsr.json +1 -1
  70. package/package.json +1 -1
  71. package/src/lib/config.ts +2 -2
  72. package/src/mcp-server/mcp-server.ts +1 -1
  73. package/src/mcp-server/server.ts +1 -1
  74. package/src/models/components/banwordsguardrail.ts +44 -0
  75. package/src/models/components/classifierguardrail.ts +48 -0
  76. package/src/models/components/clusterdefaultrulesummary.ts +34 -0
  77. package/src/models/components/index.ts +1 -0
  78. package/src/models/components/leakageguardrail.ts +48 -0
  79. package/src/models/components/outputwindow.ts +71 -0
  80. package/src/models/components/promptinjectionguardrail.ts +49 -0
  81. package/src/models/components/tooldefinition.ts +1 -1
@@ -0,0 +1,71 @@
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
+ /**
12
+ * When a streaming output check runs: whichever of max_chars and max_ms fills first
13
+ */
14
+ export type OutputWindow = {
15
+ /**
16
+ * Check once this many characters of unchecked text have accumulated
17
+ */
18
+ maxChars?: number | undefined;
19
+ /**
20
+ * Check once the oldest unchecked text has been held this many milliseconds
21
+ */
22
+ maxMs?: number | undefined;
23
+ };
24
+
25
+ /** @internal */
26
+ export const OutputWindow$inboundSchema: z.ZodType<
27
+ OutputWindow,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ max_chars: z.number().int().optional(),
32
+ max_ms: z.number().int().optional(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ "max_chars": "maxChars",
36
+ "max_ms": "maxMs",
37
+ });
38
+ });
39
+ /** @internal */
40
+ export type OutputWindow$Outbound = {
41
+ max_chars?: number | undefined;
42
+ max_ms?: number | undefined;
43
+ };
44
+
45
+ /** @internal */
46
+ export const OutputWindow$outboundSchema: z.ZodType<
47
+ OutputWindow$Outbound,
48
+ z.ZodTypeDef,
49
+ OutputWindow
50
+ > = z.object({
51
+ maxChars: z.number().int().optional(),
52
+ maxMs: z.number().int().optional(),
53
+ }).transform((v) => {
54
+ return remap$(v, {
55
+ maxChars: "max_chars",
56
+ maxMs: "max_ms",
57
+ });
58
+ });
59
+
60
+ export function outputWindowToJSON(outputWindow: OutputWindow): string {
61
+ return JSON.stringify(OutputWindow$outboundSchema.parse(outputWindow));
62
+ }
63
+ export function outputWindowFromJSON(
64
+ jsonString: string,
65
+ ): SafeParseResult<OutputWindow, SDKValidationError> {
66
+ return safeParse(
67
+ jsonString,
68
+ (x) => OutputWindow$inboundSchema.parse(JSON.parse(x)),
69
+ `Failed to parse 'OutputWindow' from JSON`,
70
+ );
71
+ }
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
8
9
  import { Result as SafeParseResult } from "../../types/fp.js";
9
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
11
  import {
@@ -12,6 +13,12 @@ import {
12
13
  GuardrailInputSource$inboundSchema,
13
14
  GuardrailInputSource$outboundSchema,
14
15
  } from "./guardrailinputsource.js";
16
+ import {
17
+ OutputWindow,
18
+ OutputWindow$inboundSchema,
19
+ OutputWindow$Outbound,
20
+ OutputWindow$outboundSchema,
21
+ } from "./outputwindow.js";
15
22
  import {
16
23
  PromptInjectionConfig,
17
24
  PromptInjectionConfig$inboundSchema,
@@ -19,6 +26,20 @@ import {
19
26
  PromptInjectionConfig$outboundSchema,
20
27
  } from "./promptinjectionconfig.js";
21
28
 
29
+ /**
30
+ * When this rule checks model output: final (default) checks the finished text once, after it has streamed; streaming holds streamed text in a window and releases only text this rule has cleared
31
+ */
32
+ export const PromptInjectionGuardrailOutputTiming = {
33
+ Final: "final",
34
+ Streaming: "streaming",
35
+ } as const;
36
+ /**
37
+ * When this rule checks model output: final (default) checks the finished text once, after it has streamed; streaming holds streamed text in a window and releases only text this rule has cleared
38
+ */
39
+ export type PromptInjectionGuardrailOutputTiming = ClosedEnum<
40
+ typeof PromptInjectionGuardrailOutputTiming
41
+ >;
42
+
22
43
  /**
23
44
  * Prompt injection guardrail
24
45
  */
@@ -32,6 +53,14 @@ export type PromptInjectionGuardrail = {
32
53
  * Also apply this guardrail to model output, not just the request
33
54
  */
34
55
  checkOutput?: boolean | undefined;
56
+ /**
57
+ * When this rule checks model output: final (default) checks the finished text once, after it has streamed; streaming holds streamed text in a window and releases only text this rule has cleared
58
+ */
59
+ outputTiming?: PromptInjectionGuardrailOutputTiming | undefined;
60
+ /**
61
+ * When a streaming output check runs: whichever of max_chars and max_ms fills first
62
+ */
63
+ outputWindow?: OutputWindow | undefined;
35
64
  /**
36
65
  * Request sources this guardrail checks before they reach the model. Omit to use the mode's default: every source for classifier; every source except system for ban_words, since instructions often name the terms they forbid; only what the user sends for prompt_injection and leakage, whose keyword patterns match ordinary instructions, replies and documents. An empty list checks no input, so the rule only checks output when check_output is set. Rules saved before this field existed were set to user messages only.
37
66
  */
@@ -42,6 +71,16 @@ export type PromptInjectionGuardrail = {
42
71
  config?: PromptInjectionConfig | undefined;
43
72
  };
44
73
 
74
+ /** @internal */
75
+ export const PromptInjectionGuardrailOutputTiming$inboundSchema:
76
+ z.ZodNativeEnum<typeof PromptInjectionGuardrailOutputTiming> = z.nativeEnum(
77
+ PromptInjectionGuardrailOutputTiming,
78
+ );
79
+ /** @internal */
80
+ export const PromptInjectionGuardrailOutputTiming$outboundSchema:
81
+ z.ZodNativeEnum<typeof PromptInjectionGuardrailOutputTiming> =
82
+ PromptInjectionGuardrailOutputTiming$inboundSchema;
83
+
45
84
  /** @internal */
46
85
  export const PromptInjectionGuardrail$inboundSchema: z.ZodType<
47
86
  PromptInjectionGuardrail,
@@ -51,11 +90,15 @@ export const PromptInjectionGuardrail$inboundSchema: z.ZodType<
51
90
  mode: z.literal("prompt_injection"),
52
91
  enabled: z.boolean().default(true),
53
92
  check_output: z.boolean().optional(),
93
+ output_timing: PromptInjectionGuardrailOutputTiming$inboundSchema.optional(),
94
+ output_window: OutputWindow$inboundSchema.optional(),
54
95
  input_sources: z.array(GuardrailInputSource$inboundSchema).optional(),
55
96
  config: PromptInjectionConfig$inboundSchema.optional(),
56
97
  }).transform((v) => {
57
98
  return remap$(v, {
58
99
  "check_output": "checkOutput",
100
+ "output_timing": "outputTiming",
101
+ "output_window": "outputWindow",
59
102
  "input_sources": "inputSources",
60
103
  });
61
104
  });
@@ -64,6 +107,8 @@ export type PromptInjectionGuardrail$Outbound = {
64
107
  mode: "prompt_injection";
65
108
  enabled: boolean;
66
109
  check_output?: boolean | undefined;
110
+ output_timing?: string | undefined;
111
+ output_window?: OutputWindow$Outbound | undefined;
67
112
  input_sources?: Array<string> | undefined;
68
113
  config?: PromptInjectionConfig$Outbound | undefined;
69
114
  };
@@ -77,11 +122,15 @@ export const PromptInjectionGuardrail$outboundSchema: z.ZodType<
77
122
  mode: z.literal("prompt_injection"),
78
123
  enabled: z.boolean().default(true),
79
124
  checkOutput: z.boolean().optional(),
125
+ outputTiming: PromptInjectionGuardrailOutputTiming$outboundSchema.optional(),
126
+ outputWindow: OutputWindow$outboundSchema.optional(),
80
127
  inputSources: z.array(GuardrailInputSource$outboundSchema).optional(),
81
128
  config: PromptInjectionConfig$outboundSchema.optional(),
82
129
  }).transform((v) => {
83
130
  return remap$(v, {
84
131
  checkOutput: "check_output",
132
+ outputTiming: "output_timing",
133
+ outputWindow: "output_window",
85
134
  inputSources: "input_sources",
86
135
  });
87
136
  });
@@ -120,7 +120,7 @@ export const ToolDefinition9Type = {
120
120
  export type ToolDefinition9Type = ClosedEnum<typeof ToolDefinition9Type>;
121
121
 
122
122
  /**
123
- * Another saved agent of the same team, called as a tool. mkllm-gateway starts a run of that agent and returns its answer.
123
+ * Another saved agent of the same team, called as a tool. The Responses API starts a run of that agent and returns its answer.
124
124
  */
125
125
  export type Nine = {
126
126
  type: ToolDefinition9Type;