opc-agent 2.1.0 → 3.0.0
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 +603 -545
- package/dist/channels/voice.d.ts +59 -0
- package/dist/channels/voice.js +351 -1
- package/dist/cli.js +172 -1
- package/dist/core/agent.d.ts +4 -0
- package/dist/core/agent.js +35 -0
- package/dist/core/collaboration.d.ts +89 -0
- package/dist/core/collaboration.js +201 -0
- package/dist/deploy/index.d.ts +40 -0
- package/dist/deploy/index.js +261 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +47 -3
- package/dist/mcp/servers/calculator-mcp.d.ts +3 -0
- package/dist/mcp/servers/calculator-mcp.js +65 -0
- package/dist/mcp/servers/crypto-mcp.d.ts +3 -0
- package/dist/mcp/servers/crypto-mcp.js +108 -0
- package/dist/mcp/servers/database-mcp.d.ts +3 -0
- package/dist/mcp/servers/database-mcp.js +73 -0
- package/dist/mcp/servers/datetime-mcp.d.ts +3 -0
- package/dist/mcp/servers/datetime-mcp.js +71 -0
- package/dist/mcp/servers/filesystem.d.ts +3 -0
- package/dist/mcp/servers/filesystem.js +101 -0
- package/dist/mcp/servers/github-mcp.d.ts +3 -0
- package/dist/mcp/servers/github-mcp.js +60 -0
- package/dist/mcp/servers/index.d.ts +21 -0
- package/dist/mcp/servers/index.js +50 -0
- package/dist/mcp/servers/json-mcp.d.ts +3 -0
- package/dist/mcp/servers/json-mcp.js +126 -0
- package/dist/mcp/servers/memory-mcp.d.ts +3 -0
- package/dist/mcp/servers/memory-mcp.js +60 -0
- package/dist/mcp/servers/regex-mcp.d.ts +3 -0
- package/dist/mcp/servers/regex-mcp.js +56 -0
- package/dist/mcp/servers/web-mcp.d.ts +3 -0
- package/dist/mcp/servers/web-mcp.js +51 -0
- package/dist/schema/oad.d.ts +292 -12
- package/dist/schema/oad.js +12 -1
- package/dist/security/guardrails.d.ts +50 -0
- package/dist/security/guardrails.js +197 -0
- package/dist/studio/server.d.ts +31 -1
- package/dist/studio/server.js +154 -3
- package/dist/studio-ui/index.html +1278 -662
- package/dist/tools/integrations/calendar.d.ts +3 -0
- package/dist/tools/integrations/calendar.js +73 -0
- package/dist/tools/integrations/code-exec.d.ts +3 -0
- package/dist/tools/integrations/code-exec.js +42 -0
- package/dist/tools/integrations/csv-analyzer.d.ts +3 -0
- package/dist/tools/integrations/csv-analyzer.js +142 -0
- package/dist/tools/integrations/database.d.ts +3 -0
- package/dist/tools/integrations/database.js +44 -0
- package/dist/tools/integrations/email-send.d.ts +3 -0
- package/dist/tools/integrations/email-send.js +104 -0
- package/dist/tools/integrations/git-tool.d.ts +3 -0
- package/dist/tools/integrations/git-tool.js +49 -0
- package/dist/tools/integrations/github-tool.d.ts +3 -0
- package/dist/tools/integrations/github-tool.js +77 -0
- package/dist/tools/integrations/image-gen.d.ts +3 -0
- package/dist/tools/integrations/image-gen.js +58 -0
- package/dist/tools/integrations/index.d.ts +30 -0
- package/dist/tools/integrations/index.js +107 -0
- package/dist/tools/integrations/jira.d.ts +3 -0
- package/dist/tools/integrations/jira.js +85 -0
- package/dist/tools/integrations/notion.d.ts +3 -0
- package/dist/tools/integrations/notion.js +71 -0
- package/dist/tools/integrations/npm-tool.d.ts +3 -0
- package/dist/tools/integrations/npm-tool.js +49 -0
- package/dist/tools/integrations/pdf-reader.d.ts +3 -0
- package/dist/tools/integrations/pdf-reader.js +91 -0
- package/dist/tools/integrations/slack.d.ts +3 -0
- package/dist/tools/integrations/slack.js +67 -0
- package/dist/tools/integrations/summarizer.d.ts +3 -0
- package/dist/tools/integrations/summarizer.js +49 -0
- package/dist/tools/integrations/translator.d.ts +3 -0
- package/dist/tools/integrations/translator.js +48 -0
- package/dist/tools/integrations/trello.d.ts +3 -0
- package/dist/tools/integrations/trello.js +60 -0
- package/dist/tools/integrations/vector-search.d.ts +3 -0
- package/dist/tools/integrations/vector-search.js +44 -0
- package/dist/tools/integrations/web-scraper.d.ts +3 -0
- package/dist/tools/integrations/web-scraper.js +48 -0
- package/dist/tools/integrations/web-search.d.ts +3 -0
- package/dist/tools/integrations/web-search.js +60 -0
- package/dist/tools/integrations/webhook.d.ts +3 -0
- package/dist/tools/integrations/webhook.js +39 -0
- package/dist/ui/components.d.ts +10 -0
- package/dist/ui/components.js +123 -0
- package/package.json +1 -1
- package/src/channels/voice.ts +365 -0
- package/src/cli.ts +176 -2
- package/src/core/agent.ts +38 -0
- package/src/core/collaboration.ts +275 -0
- package/src/deploy/index.ts +255 -0
- package/src/index.ts +21 -1
- package/src/mcp/servers/calculator-mcp.ts +65 -0
- package/src/mcp/servers/crypto-mcp.ts +73 -0
- package/src/mcp/servers/database-mcp.ts +72 -0
- package/src/mcp/servers/datetime-mcp.ts +69 -0
- package/src/mcp/servers/filesystem.ts +66 -0
- package/src/mcp/servers/github-mcp.ts +58 -0
- package/src/mcp/servers/index.ts +63 -0
- package/src/mcp/servers/json-mcp.ts +102 -0
- package/src/mcp/servers/memory-mcp.ts +56 -0
- package/src/mcp/servers/regex-mcp.ts +53 -0
- package/src/mcp/servers/web-mcp.ts +49 -0
- package/src/schema/oad.ts +13 -0
- package/src/security/guardrails.ts +248 -0
- package/src/studio/server.ts +166 -4
- package/src/studio-ui/index.html +1278 -662
- package/src/tools/integrations/calendar.ts +73 -0
- package/src/tools/integrations/code-exec.ts +39 -0
- package/src/tools/integrations/csv-analyzer.ts +92 -0
- package/src/tools/integrations/database.ts +44 -0
- package/src/tools/integrations/email-send.ts +76 -0
- package/src/tools/integrations/git-tool.ts +42 -0
- package/src/tools/integrations/github-tool.ts +76 -0
- package/src/tools/integrations/image-gen.ts +56 -0
- package/src/tools/integrations/index.ts +92 -0
- package/src/tools/integrations/jira.ts +83 -0
- package/src/tools/integrations/notion.ts +71 -0
- package/src/tools/integrations/npm-tool.ts +48 -0
- package/src/tools/integrations/pdf-reader.ts +58 -0
- package/src/tools/integrations/slack.ts +65 -0
- package/src/tools/integrations/summarizer.ts +49 -0
- package/src/tools/integrations/translator.ts +48 -0
- package/src/tools/integrations/trello.ts +60 -0
- package/src/tools/integrations/vector-search.ts +42 -0
- package/src/tools/integrations/web-scraper.ts +47 -0
- package/src/tools/integrations/web-search.ts +58 -0
- package/src/tools/integrations/webhook.ts +38 -0
- package/src/ui/components.ts +127 -0
- package/tests/brain-seed-extended.test.ts +490 -0
- package/tests/collaboration.test.ts +319 -0
- package/tests/deploy-and-dag.test.ts +196 -0
- package/tests/guardrails.test.ts +177 -0
- package/tests/integrations.test.ts +249 -0
- package/tests/mcp-servers.test.ts +260 -0
- package/tests/voice-enhanced.test.ts +169 -0
- package/dist/dtv/data.d.ts +0 -18
- package/dist/dtv/data.js +0 -25
- package/dist/dtv/trust.d.ts +0 -19
- package/dist/dtv/trust.js +0 -40
- package/dist/dtv/value.d.ts +0 -23
- package/dist/dtv/value.js +0 -38
- package/dist/marketplace/index.d.ts +0 -34
- package/dist/marketplace/index.js +0 -202
package/dist/schema/oad.d.ts
CHANGED
|
@@ -105,11 +105,11 @@ export declare const ChannelSchema: z.ZodObject<{
|
|
|
105
105
|
port: z.ZodOptional<z.ZodNumber>;
|
|
106
106
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
107
107
|
}, "strip", z.ZodTypeAny, {
|
|
108
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
108
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
109
109
|
port?: number | undefined;
|
|
110
110
|
config?: Record<string, unknown> | undefined;
|
|
111
111
|
}, {
|
|
112
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
112
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
113
113
|
port?: number | undefined;
|
|
114
114
|
config?: Record<string, unknown> | undefined;
|
|
115
115
|
}>;
|
|
@@ -522,6 +522,82 @@ export declare const ProtocolsSchema: z.ZodObject<{
|
|
|
522
522
|
enabled?: boolean | undefined;
|
|
523
523
|
} | undefined;
|
|
524
524
|
}>;
|
|
525
|
+
export declare const GuardrailRuleSchema: z.ZodObject<{
|
|
526
|
+
name: z.ZodString;
|
|
527
|
+
type: z.ZodEnum<["regex", "keyword", "llm", "custom"]>;
|
|
528
|
+
action: z.ZodEnum<["block", "warn", "redact", "log"]>;
|
|
529
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
530
|
+
}, "strip", z.ZodTypeAny, {
|
|
531
|
+
name: string;
|
|
532
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
533
|
+
action: "warn" | "block" | "redact" | "log";
|
|
534
|
+
config?: Record<string, any> | undefined;
|
|
535
|
+
}, {
|
|
536
|
+
name: string;
|
|
537
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
538
|
+
action: "warn" | "block" | "redact" | "log";
|
|
539
|
+
config?: Record<string, any> | undefined;
|
|
540
|
+
}>;
|
|
541
|
+
export declare const GuardrailsSchema: z.ZodObject<{
|
|
542
|
+
input: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
543
|
+
name: z.ZodString;
|
|
544
|
+
type: z.ZodEnum<["regex", "keyword", "llm", "custom"]>;
|
|
545
|
+
action: z.ZodEnum<["block", "warn", "redact", "log"]>;
|
|
546
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
547
|
+
}, "strip", z.ZodTypeAny, {
|
|
548
|
+
name: string;
|
|
549
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
550
|
+
action: "warn" | "block" | "redact" | "log";
|
|
551
|
+
config?: Record<string, any> | undefined;
|
|
552
|
+
}, {
|
|
553
|
+
name: string;
|
|
554
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
555
|
+
action: "warn" | "block" | "redact" | "log";
|
|
556
|
+
config?: Record<string, any> | undefined;
|
|
557
|
+
}>, "many">>;
|
|
558
|
+
output: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
559
|
+
name: z.ZodString;
|
|
560
|
+
type: z.ZodEnum<["regex", "keyword", "llm", "custom"]>;
|
|
561
|
+
action: z.ZodEnum<["block", "warn", "redact", "log"]>;
|
|
562
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
563
|
+
}, "strip", z.ZodTypeAny, {
|
|
564
|
+
name: string;
|
|
565
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
566
|
+
action: "warn" | "block" | "redact" | "log";
|
|
567
|
+
config?: Record<string, any> | undefined;
|
|
568
|
+
}, {
|
|
569
|
+
name: string;
|
|
570
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
571
|
+
action: "warn" | "block" | "redact" | "log";
|
|
572
|
+
config?: Record<string, any> | undefined;
|
|
573
|
+
}>, "many">>;
|
|
574
|
+
}, "strip", z.ZodTypeAny, {
|
|
575
|
+
input?: {
|
|
576
|
+
name: string;
|
|
577
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
578
|
+
action: "warn" | "block" | "redact" | "log";
|
|
579
|
+
config?: Record<string, any> | undefined;
|
|
580
|
+
}[] | undefined;
|
|
581
|
+
output?: {
|
|
582
|
+
name: string;
|
|
583
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
584
|
+
action: "warn" | "block" | "redact" | "log";
|
|
585
|
+
config?: Record<string, any> | undefined;
|
|
586
|
+
}[] | undefined;
|
|
587
|
+
}, {
|
|
588
|
+
input?: {
|
|
589
|
+
name: string;
|
|
590
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
591
|
+
action: "warn" | "block" | "redact" | "log";
|
|
592
|
+
config?: Record<string, any> | undefined;
|
|
593
|
+
}[] | undefined;
|
|
594
|
+
output?: {
|
|
595
|
+
name: string;
|
|
596
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
597
|
+
action: "warn" | "block" | "redact" | "log";
|
|
598
|
+
config?: Record<string, any> | undefined;
|
|
599
|
+
}[] | undefined;
|
|
600
|
+
}>;
|
|
525
601
|
export declare const SpecSchema: z.ZodObject<{
|
|
526
602
|
provider: z.ZodOptional<z.ZodObject<{
|
|
527
603
|
default: z.ZodDefault<z.ZodString>;
|
|
@@ -553,11 +629,11 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
553
629
|
port: z.ZodOptional<z.ZodNumber>;
|
|
554
630
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
555
631
|
}, "strip", z.ZodTypeAny, {
|
|
556
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
632
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
557
633
|
port?: number | undefined;
|
|
558
634
|
config?: Record<string, unknown> | undefined;
|
|
559
635
|
}, {
|
|
560
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
636
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
561
637
|
port?: number | undefined;
|
|
562
638
|
config?: Record<string, unknown> | undefined;
|
|
563
639
|
}>, "many">>;
|
|
@@ -899,6 +975,66 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
899
975
|
name: string;
|
|
900
976
|
config?: Record<string, unknown> | undefined;
|
|
901
977
|
}>, "many">>;
|
|
978
|
+
guardrails: z.ZodOptional<z.ZodObject<{
|
|
979
|
+
input: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
980
|
+
name: z.ZodString;
|
|
981
|
+
type: z.ZodEnum<["regex", "keyword", "llm", "custom"]>;
|
|
982
|
+
action: z.ZodEnum<["block", "warn", "redact", "log"]>;
|
|
983
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
984
|
+
}, "strip", z.ZodTypeAny, {
|
|
985
|
+
name: string;
|
|
986
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
987
|
+
action: "warn" | "block" | "redact" | "log";
|
|
988
|
+
config?: Record<string, any> | undefined;
|
|
989
|
+
}, {
|
|
990
|
+
name: string;
|
|
991
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
992
|
+
action: "warn" | "block" | "redact" | "log";
|
|
993
|
+
config?: Record<string, any> | undefined;
|
|
994
|
+
}>, "many">>;
|
|
995
|
+
output: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
996
|
+
name: z.ZodString;
|
|
997
|
+
type: z.ZodEnum<["regex", "keyword", "llm", "custom"]>;
|
|
998
|
+
action: z.ZodEnum<["block", "warn", "redact", "log"]>;
|
|
999
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
1000
|
+
}, "strip", z.ZodTypeAny, {
|
|
1001
|
+
name: string;
|
|
1002
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1003
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1004
|
+
config?: Record<string, any> | undefined;
|
|
1005
|
+
}, {
|
|
1006
|
+
name: string;
|
|
1007
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1008
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1009
|
+
config?: Record<string, any> | undefined;
|
|
1010
|
+
}>, "many">>;
|
|
1011
|
+
}, "strip", z.ZodTypeAny, {
|
|
1012
|
+
input?: {
|
|
1013
|
+
name: string;
|
|
1014
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1015
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1016
|
+
config?: Record<string, any> | undefined;
|
|
1017
|
+
}[] | undefined;
|
|
1018
|
+
output?: {
|
|
1019
|
+
name: string;
|
|
1020
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1021
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1022
|
+
config?: Record<string, any> | undefined;
|
|
1023
|
+
}[] | undefined;
|
|
1024
|
+
}, {
|
|
1025
|
+
input?: {
|
|
1026
|
+
name: string;
|
|
1027
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1028
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1029
|
+
config?: Record<string, any> | undefined;
|
|
1030
|
+
}[] | undefined;
|
|
1031
|
+
output?: {
|
|
1032
|
+
name: string;
|
|
1033
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1034
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1035
|
+
config?: Record<string, any> | undefined;
|
|
1036
|
+
}[] | undefined;
|
|
1037
|
+
}>>;
|
|
902
1038
|
}, "strip", z.ZodTypeAny, {
|
|
903
1039
|
model: string;
|
|
904
1040
|
skills: {
|
|
@@ -907,7 +1043,7 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
907
1043
|
config?: Record<string, unknown> | undefined;
|
|
908
1044
|
}[];
|
|
909
1045
|
channels: {
|
|
910
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
1046
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
911
1047
|
port?: number | undefined;
|
|
912
1048
|
config?: Record<string, unknown> | undefined;
|
|
913
1049
|
}[];
|
|
@@ -1014,6 +1150,20 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
1014
1150
|
enabled: boolean;
|
|
1015
1151
|
} | undefined;
|
|
1016
1152
|
} | undefined;
|
|
1153
|
+
guardrails?: {
|
|
1154
|
+
input?: {
|
|
1155
|
+
name: string;
|
|
1156
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1157
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1158
|
+
config?: Record<string, any> | undefined;
|
|
1159
|
+
}[] | undefined;
|
|
1160
|
+
output?: {
|
|
1161
|
+
name: string;
|
|
1162
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1163
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1164
|
+
config?: Record<string, any> | undefined;
|
|
1165
|
+
}[] | undefined;
|
|
1166
|
+
} | undefined;
|
|
1017
1167
|
}, {
|
|
1018
1168
|
plugins?: {
|
|
1019
1169
|
name: string;
|
|
@@ -1056,7 +1206,7 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
1056
1206
|
config?: Record<string, unknown> | undefined;
|
|
1057
1207
|
}[] | undefined;
|
|
1058
1208
|
channels?: {
|
|
1059
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
1209
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
1060
1210
|
port?: number | undefined;
|
|
1061
1211
|
config?: Record<string, unknown> | undefined;
|
|
1062
1212
|
}[] | undefined;
|
|
@@ -1129,6 +1279,20 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
1129
1279
|
enabled?: boolean | undefined;
|
|
1130
1280
|
} | undefined;
|
|
1131
1281
|
} | undefined;
|
|
1282
|
+
guardrails?: {
|
|
1283
|
+
input?: {
|
|
1284
|
+
name: string;
|
|
1285
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1286
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1287
|
+
config?: Record<string, any> | undefined;
|
|
1288
|
+
}[] | undefined;
|
|
1289
|
+
output?: {
|
|
1290
|
+
name: string;
|
|
1291
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1292
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1293
|
+
config?: Record<string, any> | undefined;
|
|
1294
|
+
}[] | undefined;
|
|
1295
|
+
} | undefined;
|
|
1132
1296
|
}>;
|
|
1133
1297
|
export declare const OADSchema: z.ZodObject<{
|
|
1134
1298
|
apiVersion: z.ZodLiteral<"opc/v1">;
|
|
@@ -1211,11 +1375,11 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
1211
1375
|
port: z.ZodOptional<z.ZodNumber>;
|
|
1212
1376
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1213
1377
|
}, "strip", z.ZodTypeAny, {
|
|
1214
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
1378
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
1215
1379
|
port?: number | undefined;
|
|
1216
1380
|
config?: Record<string, unknown> | undefined;
|
|
1217
1381
|
}, {
|
|
1218
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
1382
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
1219
1383
|
port?: number | undefined;
|
|
1220
1384
|
config?: Record<string, unknown> | undefined;
|
|
1221
1385
|
}>, "many">>;
|
|
@@ -1557,6 +1721,66 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
1557
1721
|
name: string;
|
|
1558
1722
|
config?: Record<string, unknown> | undefined;
|
|
1559
1723
|
}>, "many">>;
|
|
1724
|
+
guardrails: z.ZodOptional<z.ZodObject<{
|
|
1725
|
+
input: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1726
|
+
name: z.ZodString;
|
|
1727
|
+
type: z.ZodEnum<["regex", "keyword", "llm", "custom"]>;
|
|
1728
|
+
action: z.ZodEnum<["block", "warn", "redact", "log"]>;
|
|
1729
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
1730
|
+
}, "strip", z.ZodTypeAny, {
|
|
1731
|
+
name: string;
|
|
1732
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1733
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1734
|
+
config?: Record<string, any> | undefined;
|
|
1735
|
+
}, {
|
|
1736
|
+
name: string;
|
|
1737
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1738
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1739
|
+
config?: Record<string, any> | undefined;
|
|
1740
|
+
}>, "many">>;
|
|
1741
|
+
output: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1742
|
+
name: z.ZodString;
|
|
1743
|
+
type: z.ZodEnum<["regex", "keyword", "llm", "custom"]>;
|
|
1744
|
+
action: z.ZodEnum<["block", "warn", "redact", "log"]>;
|
|
1745
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
1746
|
+
}, "strip", z.ZodTypeAny, {
|
|
1747
|
+
name: string;
|
|
1748
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1749
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1750
|
+
config?: Record<string, any> | undefined;
|
|
1751
|
+
}, {
|
|
1752
|
+
name: string;
|
|
1753
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1754
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1755
|
+
config?: Record<string, any> | undefined;
|
|
1756
|
+
}>, "many">>;
|
|
1757
|
+
}, "strip", z.ZodTypeAny, {
|
|
1758
|
+
input?: {
|
|
1759
|
+
name: string;
|
|
1760
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1761
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1762
|
+
config?: Record<string, any> | undefined;
|
|
1763
|
+
}[] | undefined;
|
|
1764
|
+
output?: {
|
|
1765
|
+
name: string;
|
|
1766
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1767
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1768
|
+
config?: Record<string, any> | undefined;
|
|
1769
|
+
}[] | undefined;
|
|
1770
|
+
}, {
|
|
1771
|
+
input?: {
|
|
1772
|
+
name: string;
|
|
1773
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1774
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1775
|
+
config?: Record<string, any> | undefined;
|
|
1776
|
+
}[] | undefined;
|
|
1777
|
+
output?: {
|
|
1778
|
+
name: string;
|
|
1779
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1780
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1781
|
+
config?: Record<string, any> | undefined;
|
|
1782
|
+
}[] | undefined;
|
|
1783
|
+
}>>;
|
|
1560
1784
|
}, "strip", z.ZodTypeAny, {
|
|
1561
1785
|
model: string;
|
|
1562
1786
|
skills: {
|
|
@@ -1565,7 +1789,7 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
1565
1789
|
config?: Record<string, unknown> | undefined;
|
|
1566
1790
|
}[];
|
|
1567
1791
|
channels: {
|
|
1568
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
1792
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
1569
1793
|
port?: number | undefined;
|
|
1570
1794
|
config?: Record<string, unknown> | undefined;
|
|
1571
1795
|
}[];
|
|
@@ -1672,6 +1896,20 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
1672
1896
|
enabled: boolean;
|
|
1673
1897
|
} | undefined;
|
|
1674
1898
|
} | undefined;
|
|
1899
|
+
guardrails?: {
|
|
1900
|
+
input?: {
|
|
1901
|
+
name: string;
|
|
1902
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1903
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1904
|
+
config?: Record<string, any> | undefined;
|
|
1905
|
+
}[] | undefined;
|
|
1906
|
+
output?: {
|
|
1907
|
+
name: string;
|
|
1908
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
1909
|
+
action: "warn" | "block" | "redact" | "log";
|
|
1910
|
+
config?: Record<string, any> | undefined;
|
|
1911
|
+
}[] | undefined;
|
|
1912
|
+
} | undefined;
|
|
1675
1913
|
}, {
|
|
1676
1914
|
plugins?: {
|
|
1677
1915
|
name: string;
|
|
@@ -1714,7 +1952,7 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
1714
1952
|
config?: Record<string, unknown> | undefined;
|
|
1715
1953
|
}[] | undefined;
|
|
1716
1954
|
channels?: {
|
|
1717
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
1955
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
1718
1956
|
port?: number | undefined;
|
|
1719
1957
|
config?: Record<string, unknown> | undefined;
|
|
1720
1958
|
}[] | undefined;
|
|
@@ -1787,6 +2025,20 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
1787
2025
|
enabled?: boolean | undefined;
|
|
1788
2026
|
} | undefined;
|
|
1789
2027
|
} | undefined;
|
|
2028
|
+
guardrails?: {
|
|
2029
|
+
input?: {
|
|
2030
|
+
name: string;
|
|
2031
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
2032
|
+
action: "warn" | "block" | "redact" | "log";
|
|
2033
|
+
config?: Record<string, any> | undefined;
|
|
2034
|
+
}[] | undefined;
|
|
2035
|
+
output?: {
|
|
2036
|
+
name: string;
|
|
2037
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
2038
|
+
action: "warn" | "block" | "redact" | "log";
|
|
2039
|
+
config?: Record<string, any> | undefined;
|
|
2040
|
+
}[] | undefined;
|
|
2041
|
+
} | undefined;
|
|
1790
2042
|
}>;
|
|
1791
2043
|
}, "strip", z.ZodTypeAny, {
|
|
1792
2044
|
metadata: {
|
|
@@ -1812,7 +2064,7 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
1812
2064
|
config?: Record<string, unknown> | undefined;
|
|
1813
2065
|
}[];
|
|
1814
2066
|
channels: {
|
|
1815
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
2067
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
1816
2068
|
port?: number | undefined;
|
|
1817
2069
|
config?: Record<string, unknown> | undefined;
|
|
1818
2070
|
}[];
|
|
@@ -1919,6 +2171,20 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
1919
2171
|
enabled: boolean;
|
|
1920
2172
|
} | undefined;
|
|
1921
2173
|
} | undefined;
|
|
2174
|
+
guardrails?: {
|
|
2175
|
+
input?: {
|
|
2176
|
+
name: string;
|
|
2177
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
2178
|
+
action: "warn" | "block" | "redact" | "log";
|
|
2179
|
+
config?: Record<string, any> | undefined;
|
|
2180
|
+
}[] | undefined;
|
|
2181
|
+
output?: {
|
|
2182
|
+
name: string;
|
|
2183
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
2184
|
+
action: "warn" | "block" | "redact" | "log";
|
|
2185
|
+
config?: Record<string, any> | undefined;
|
|
2186
|
+
}[] | undefined;
|
|
2187
|
+
} | undefined;
|
|
1922
2188
|
};
|
|
1923
2189
|
}, {
|
|
1924
2190
|
metadata: {
|
|
@@ -1978,7 +2244,7 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
1978
2244
|
config?: Record<string, unknown> | undefined;
|
|
1979
2245
|
}[] | undefined;
|
|
1980
2246
|
channels?: {
|
|
1981
|
-
type: "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "
|
|
2247
|
+
type: "email" | "web" | "websocket" | "telegram" | "cli" | "voice" | "webhook" | "wechat" | "feishu" | "slack" | "discord";
|
|
1982
2248
|
port?: number | undefined;
|
|
1983
2249
|
config?: Record<string, unknown> | undefined;
|
|
1984
2250
|
}[] | undefined;
|
|
@@ -2051,6 +2317,20 @@ export declare const OADSchema: z.ZodObject<{
|
|
|
2051
2317
|
enabled?: boolean | undefined;
|
|
2052
2318
|
} | undefined;
|
|
2053
2319
|
} | undefined;
|
|
2320
|
+
guardrails?: {
|
|
2321
|
+
input?: {
|
|
2322
|
+
name: string;
|
|
2323
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
2324
|
+
action: "warn" | "block" | "redact" | "log";
|
|
2325
|
+
config?: Record<string, any> | undefined;
|
|
2326
|
+
}[] | undefined;
|
|
2327
|
+
output?: {
|
|
2328
|
+
name: string;
|
|
2329
|
+
type: "regex" | "keyword" | "llm" | "custom";
|
|
2330
|
+
action: "warn" | "block" | "redact" | "log";
|
|
2331
|
+
config?: Record<string, any> | undefined;
|
|
2332
|
+
}[] | undefined;
|
|
2333
|
+
} | undefined;
|
|
2054
2334
|
};
|
|
2055
2335
|
}>;
|
|
2056
2336
|
export type OADDocument = z.infer<typeof OADSchema>;
|
package/dist/schema/oad.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OADSchema = exports.SpecSchema = exports.ProtocolsSchema = exports.AGUIProtocolSchema = exports.TelemetrySchema = exports.ToolsSchema = exports.MCPServeSchema = exports.MCPServerSchema = exports.StreamingSchema = exports.RoomSchema = exports.MetadataSchema = exports.MarketplaceSchema = exports.ProviderSchema = exports.DTVSchema = exports.TrustLevel = exports.MemorySchema = exports.LongTermMemorySchema = exports.ChannelSchema = exports.AuthSchema = exports.PluginRefSchema = exports.HITLSchema = exports.WebhookSchema = exports.VoiceSchema = exports.WorkflowSchema = exports.WorkflowStepSchema = exports.SkillRefSchema = void 0;
|
|
3
|
+
exports.OADSchema = exports.SpecSchema = exports.GuardrailsSchema = exports.GuardrailRuleSchema = exports.ProtocolsSchema = exports.AGUIProtocolSchema = exports.TelemetrySchema = exports.ToolsSchema = exports.MCPServeSchema = exports.MCPServerSchema = exports.StreamingSchema = exports.RoomSchema = exports.MetadataSchema = exports.MarketplaceSchema = exports.ProviderSchema = exports.DTVSchema = exports.TrustLevel = exports.MemorySchema = exports.LongTermMemorySchema = exports.ChannelSchema = exports.AuthSchema = exports.PluginRefSchema = exports.HITLSchema = exports.WebhookSchema = exports.VoiceSchema = exports.WorkflowSchema = exports.WorkflowStepSchema = exports.SkillRefSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// ─── OAD Schema v1 ───────────────────────────────────────────
|
|
6
6
|
exports.SkillRefSchema = zod_1.z.object({
|
|
@@ -144,6 +144,16 @@ exports.ProtocolsSchema = zod_1.z.object({
|
|
|
144
144
|
agui: exports.AGUIProtocolSchema.optional(),
|
|
145
145
|
mcp: exports.MCPServeSchema.optional(),
|
|
146
146
|
});
|
|
147
|
+
exports.GuardrailRuleSchema = zod_1.z.object({
|
|
148
|
+
name: zod_1.z.string(),
|
|
149
|
+
type: zod_1.z.enum(['regex', 'keyword', 'llm', 'custom']),
|
|
150
|
+
action: zod_1.z.enum(['block', 'warn', 'redact', 'log']),
|
|
151
|
+
config: zod_1.z.record(zod_1.z.any()).optional(),
|
|
152
|
+
});
|
|
153
|
+
exports.GuardrailsSchema = zod_1.z.object({
|
|
154
|
+
input: zod_1.z.array(exports.GuardrailRuleSchema).optional(),
|
|
155
|
+
output: zod_1.z.array(exports.GuardrailRuleSchema).optional(),
|
|
156
|
+
});
|
|
147
157
|
exports.SpecSchema = zod_1.z.object({
|
|
148
158
|
provider: exports.ProviderSchema.optional(),
|
|
149
159
|
model: zod_1.z.string().default('deepseek-chat'),
|
|
@@ -164,6 +174,7 @@ exports.SpecSchema = zod_1.z.object({
|
|
|
164
174
|
telemetry: exports.TelemetrySchema.optional(),
|
|
165
175
|
protocols: exports.ProtocolsSchema.optional(),
|
|
166
176
|
plugins: zod_1.z.array(exports.PluginRefSchema).optional(),
|
|
177
|
+
guardrails: exports.GuardrailsSchema.optional(),
|
|
167
178
|
});
|
|
168
179
|
exports.OADSchema = zod_1.z.object({
|
|
169
180
|
apiVersion: zod_1.z.literal('opc/v1'),
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guardrails Module - v2.1.0
|
|
3
|
+
* Input/output guardrails for LLM safety: PII, toxicity, injection, compliance.
|
|
4
|
+
*/
|
|
5
|
+
export interface GuardrailConfig {
|
|
6
|
+
input?: GuardrailRule[];
|
|
7
|
+
output?: GuardrailRule[];
|
|
8
|
+
}
|
|
9
|
+
export interface GuardrailRule {
|
|
10
|
+
name: string;
|
|
11
|
+
type: 'regex' | 'keyword' | 'llm' | 'custom';
|
|
12
|
+
action: 'block' | 'warn' | 'redact' | 'log';
|
|
13
|
+
config?: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export interface GuardrailResult {
|
|
16
|
+
passed: boolean;
|
|
17
|
+
blocked: boolean;
|
|
18
|
+
warned: boolean;
|
|
19
|
+
redacted: boolean;
|
|
20
|
+
message?: string;
|
|
21
|
+
redactedText?: string;
|
|
22
|
+
violations: GuardrailViolation[];
|
|
23
|
+
}
|
|
24
|
+
export interface GuardrailViolation {
|
|
25
|
+
rule: string;
|
|
26
|
+
action: string;
|
|
27
|
+
detail: string;
|
|
28
|
+
}
|
|
29
|
+
export declare class GuardrailManager {
|
|
30
|
+
private config;
|
|
31
|
+
constructor(config: GuardrailConfig);
|
|
32
|
+
checkInput(message: string): Promise<GuardrailResult>;
|
|
33
|
+
checkOutput(response: string): Promise<GuardrailResult>;
|
|
34
|
+
private runRules;
|
|
35
|
+
}
|
|
36
|
+
export declare function createGuardrailsFromConfig(config: {
|
|
37
|
+
input?: Array<{
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
action: string;
|
|
41
|
+
config?: any;
|
|
42
|
+
}>;
|
|
43
|
+
output?: Array<{
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
46
|
+
action: string;
|
|
47
|
+
config?: any;
|
|
48
|
+
}>;
|
|
49
|
+
}): GuardrailManager;
|
|
50
|
+
//# sourceMappingURL=guardrails.d.ts.map
|