@meetkai/mka1 0.48.26 → 0.48.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.
- package/bin/mcp-server.js +39 -6
- package/bin/mcp-server.js.map +8 -8
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/models/components/banwordsguardrail.d.ts +5 -0
- package/dist/commonjs/models/components/banwordsguardrail.d.ts.map +1 -1
- package/dist/commonjs/models/components/banwordsguardrail.js +11 -0
- package/dist/commonjs/models/components/banwordsguardrail.js.map +1 -1
- package/dist/commonjs/models/components/leakageguardrail.d.ts +5 -0
- package/dist/commonjs/models/components/leakageguardrail.d.ts.map +1 -1
- package/dist/commonjs/models/components/leakageguardrail.js +11 -0
- package/dist/commonjs/models/components/leakageguardrail.js.map +1 -1
- package/dist/commonjs/models/components/promptinjectionguardrail.d.ts +5 -0
- package/dist/commonjs/models/components/promptinjectionguardrail.d.ts.map +1 -1
- package/dist/commonjs/models/components/promptinjectionguardrail.js +11 -0
- package/dist/commonjs/models/components/promptinjectionguardrail.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/models/components/banwordsguardrail.d.ts +5 -0
- package/dist/esm/models/components/banwordsguardrail.d.ts.map +1 -1
- package/dist/esm/models/components/banwordsguardrail.js +11 -0
- package/dist/esm/models/components/banwordsguardrail.js.map +1 -1
- package/dist/esm/models/components/leakageguardrail.d.ts +5 -0
- package/dist/esm/models/components/leakageguardrail.d.ts.map +1 -1
- package/dist/esm/models/components/leakageguardrail.js +11 -0
- package/dist/esm/models/components/leakageguardrail.js.map +1 -1
- package/dist/esm/models/components/promptinjectionguardrail.d.ts +5 -0
- package/dist/esm/models/components/promptinjectionguardrail.d.ts.map +1 -1
- package/dist/esm/models/components/promptinjectionguardrail.js +11 -0
- package/dist/esm/models/components/promptinjectionguardrail.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +7 -6
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/banwordsguardrail.ts +16 -0
- package/src/models/components/leakageguardrail.ts +16 -0
- package/src/models/components/promptinjectionguardrail.ts +16 -0
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
@@ -22,6 +23,10 @@ export type BanWordsGuardrail = {
|
|
|
22
23
|
* Whether this guardrail is enabled
|
|
23
24
|
*/
|
|
24
25
|
enabled?: boolean | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Also apply this guardrail to model output, not just the request
|
|
28
|
+
*/
|
|
29
|
+
checkOutput?: boolean | undefined;
|
|
25
30
|
/**
|
|
26
31
|
* Configuration for banned words guardrail
|
|
27
32
|
*/
|
|
@@ -36,12 +41,18 @@ export const BanWordsGuardrail$inboundSchema: z.ZodType<
|
|
|
36
41
|
> = z.object({
|
|
37
42
|
mode: z.literal("ban_words"),
|
|
38
43
|
enabled: z.boolean().default(true),
|
|
44
|
+
check_output: z.boolean().optional(),
|
|
39
45
|
config: BanWordsConfig$inboundSchema.optional(),
|
|
46
|
+
}).transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
"check_output": "checkOutput",
|
|
49
|
+
});
|
|
40
50
|
});
|
|
41
51
|
/** @internal */
|
|
42
52
|
export type BanWordsGuardrail$Outbound = {
|
|
43
53
|
mode: "ban_words";
|
|
44
54
|
enabled: boolean;
|
|
55
|
+
check_output?: boolean | undefined;
|
|
45
56
|
config?: BanWordsConfig$Outbound | undefined;
|
|
46
57
|
};
|
|
47
58
|
|
|
@@ -53,7 +64,12 @@ export const BanWordsGuardrail$outboundSchema: z.ZodType<
|
|
|
53
64
|
> = z.object({
|
|
54
65
|
mode: z.literal("ban_words"),
|
|
55
66
|
enabled: z.boolean().default(true),
|
|
67
|
+
checkOutput: z.boolean().optional(),
|
|
56
68
|
config: BanWordsConfig$outboundSchema.optional(),
|
|
69
|
+
}).transform((v) => {
|
|
70
|
+
return remap$(v, {
|
|
71
|
+
checkOutput: "check_output",
|
|
72
|
+
});
|
|
57
73
|
});
|
|
58
74
|
|
|
59
75
|
export function banWordsGuardrailToJSON(
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
@@ -22,6 +23,10 @@ export type LeakageGuardrail = {
|
|
|
22
23
|
* Whether this guardrail is enabled
|
|
23
24
|
*/
|
|
24
25
|
enabled?: boolean | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Also apply this guardrail to model output, not just the request
|
|
28
|
+
*/
|
|
29
|
+
checkOutput?: boolean | undefined;
|
|
25
30
|
/**
|
|
26
31
|
* Configuration for system prompt leakage detection guardrail
|
|
27
32
|
*/
|
|
@@ -36,12 +41,18 @@ export const LeakageGuardrail$inboundSchema: z.ZodType<
|
|
|
36
41
|
> = z.object({
|
|
37
42
|
mode: z.literal("leakage"),
|
|
38
43
|
enabled: z.boolean().default(true),
|
|
44
|
+
check_output: z.boolean().optional(),
|
|
39
45
|
config: LeakageConfig$inboundSchema.optional(),
|
|
46
|
+
}).transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
"check_output": "checkOutput",
|
|
49
|
+
});
|
|
40
50
|
});
|
|
41
51
|
/** @internal */
|
|
42
52
|
export type LeakageGuardrail$Outbound = {
|
|
43
53
|
mode: "leakage";
|
|
44
54
|
enabled: boolean;
|
|
55
|
+
check_output?: boolean | undefined;
|
|
45
56
|
config?: LeakageConfig$Outbound | undefined;
|
|
46
57
|
};
|
|
47
58
|
|
|
@@ -53,7 +64,12 @@ export const LeakageGuardrail$outboundSchema: z.ZodType<
|
|
|
53
64
|
> = z.object({
|
|
54
65
|
mode: z.literal("leakage"),
|
|
55
66
|
enabled: z.boolean().default(true),
|
|
67
|
+
checkOutput: z.boolean().optional(),
|
|
56
68
|
config: LeakageConfig$outboundSchema.optional(),
|
|
69
|
+
}).transform((v) => {
|
|
70
|
+
return remap$(v, {
|
|
71
|
+
checkOutput: "check_output",
|
|
72
|
+
});
|
|
57
73
|
});
|
|
58
74
|
|
|
59
75
|
export function leakageGuardrailToJSON(
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
@@ -22,6 +23,10 @@ export type PromptInjectionGuardrail = {
|
|
|
22
23
|
* Whether this guardrail is enabled
|
|
23
24
|
*/
|
|
24
25
|
enabled?: boolean | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Also apply this guardrail to model output, not just the request
|
|
28
|
+
*/
|
|
29
|
+
checkOutput?: boolean | undefined;
|
|
25
30
|
/**
|
|
26
31
|
* Configuration for prompt injection detection guardrail
|
|
27
32
|
*/
|
|
@@ -36,12 +41,18 @@ export const PromptInjectionGuardrail$inboundSchema: z.ZodType<
|
|
|
36
41
|
> = z.object({
|
|
37
42
|
mode: z.literal("prompt_injection"),
|
|
38
43
|
enabled: z.boolean().default(true),
|
|
44
|
+
check_output: z.boolean().optional(),
|
|
39
45
|
config: PromptInjectionConfig$inboundSchema.optional(),
|
|
46
|
+
}).transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
"check_output": "checkOutput",
|
|
49
|
+
});
|
|
40
50
|
});
|
|
41
51
|
/** @internal */
|
|
42
52
|
export type PromptInjectionGuardrail$Outbound = {
|
|
43
53
|
mode: "prompt_injection";
|
|
44
54
|
enabled: boolean;
|
|
55
|
+
check_output?: boolean | undefined;
|
|
45
56
|
config?: PromptInjectionConfig$Outbound | undefined;
|
|
46
57
|
};
|
|
47
58
|
|
|
@@ -53,7 +64,12 @@ export const PromptInjectionGuardrail$outboundSchema: z.ZodType<
|
|
|
53
64
|
> = z.object({
|
|
54
65
|
mode: z.literal("prompt_injection"),
|
|
55
66
|
enabled: z.boolean().default(true),
|
|
67
|
+
checkOutput: z.boolean().optional(),
|
|
56
68
|
config: PromptInjectionConfig$outboundSchema.optional(),
|
|
69
|
+
}).transform((v) => {
|
|
70
|
+
return remap$(v, {
|
|
71
|
+
checkOutput: "check_output",
|
|
72
|
+
});
|
|
57
73
|
});
|
|
58
74
|
|
|
59
75
|
export function promptInjectionGuardrailToJSON(
|