@handlebar/governance-schema 0.0.5 → 0.0.6-dev.1
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/dist/audit/events.base.d.ts +28 -0
- package/dist/audit/events.d.ts +72 -27
- package/dist/audit/events.llm.d.ts +106 -0
- package/dist/audit/index.d.ts +4 -0
- package/dist/enduser.types.d.ts +13 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +79 -31
- package/dist/rules/rule.types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AuditEnvelopeSchema: z.ZodObject<{
|
|
3
|
+
schema: z.ZodLiteral<"handlebar.audit.v1">;
|
|
4
|
+
ts: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDate>;
|
|
5
|
+
runId: z.ZodString;
|
|
6
|
+
stepIndex: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
decisionId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
userCategory: z.ZodOptional<z.ZodString>;
|
|
11
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
otel: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
15
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
sample: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
redaction: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
none: "none";
|
|
24
|
+
partial: "partial";
|
|
25
|
+
strict: "strict";
|
|
26
|
+
}>>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>;
|
package/dist/audit/events.d.ts
CHANGED
|
@@ -1,31 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const AuditEnvelopeSchema: z.ZodObject<{
|
|
3
|
-
schema: z.ZodLiteral<"handlebar.audit.v1">;
|
|
4
|
-
ts: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDate>;
|
|
5
|
-
runId: z.ZodString;
|
|
6
|
-
stepIndex: z.ZodOptional<z.ZodNumber>;
|
|
7
|
-
decisionId: z.ZodOptional<z.ZodString>;
|
|
8
|
-
user: z.ZodOptional<z.ZodObject<{
|
|
9
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
10
|
-
userCategory: z.ZodOptional<z.ZodString>;
|
|
11
|
-
sessionId: z.ZodOptional<z.ZodString>;
|
|
12
|
-
}, z.core.$strip>>;
|
|
13
|
-
otel: z.ZodOptional<z.ZodObject<{
|
|
14
|
-
traceId: z.ZodOptional<z.ZodString>;
|
|
15
|
-
spanId: z.ZodOptional<z.ZodString>;
|
|
16
|
-
}, z.core.$strip>>;
|
|
17
|
-
sample: z.ZodOptional<z.ZodObject<{
|
|
18
|
-
rate: z.ZodOptional<z.ZodNumber>;
|
|
19
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
20
|
-
}, z.core.$strip>>;
|
|
21
|
-
redaction: z.ZodOptional<z.ZodObject<{
|
|
22
|
-
level: z.ZodOptional<z.ZodEnum<{
|
|
23
|
-
none: "none";
|
|
24
|
-
partial: "partial";
|
|
25
|
-
strict: "strict";
|
|
26
|
-
}>>;
|
|
27
|
-
}, z.core.$strip>>;
|
|
28
|
-
}, z.core.$strip>;
|
|
29
2
|
export declare const RunStartedEventSchema: z.ZodObject<{
|
|
30
3
|
schema: z.ZodLiteral<"handlebar.audit.v1">;
|
|
31
4
|
ts: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDate>;
|
|
@@ -65,6 +38,16 @@ export declare const RunStartedEventSchema: z.ZodObject<{
|
|
|
65
38
|
id: z.ZodOptional<z.ZodString>;
|
|
66
39
|
name: z.ZodOptional<z.ZodString>;
|
|
67
40
|
}, z.core.$strip>;
|
|
41
|
+
enduser: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
externalId: z.ZodString;
|
|
43
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
group: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
externalId: z.ZodString;
|
|
47
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
48
|
+
name: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
68
51
|
model: z.ZodOptional<z.ZodObject<{
|
|
69
52
|
provider: z.ZodOptional<z.ZodString>;
|
|
70
53
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -330,6 +313,16 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
330
313
|
id: z.ZodOptional<z.ZodString>;
|
|
331
314
|
name: z.ZodOptional<z.ZodString>;
|
|
332
315
|
}, z.core.$strip>;
|
|
316
|
+
enduser: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
externalId: z.ZodString;
|
|
318
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
319
|
+
name: z.ZodOptional<z.ZodString>;
|
|
320
|
+
group: z.ZodOptional<z.ZodObject<{
|
|
321
|
+
externalId: z.ZodString;
|
|
322
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
323
|
+
name: z.ZodOptional<z.ZodString>;
|
|
324
|
+
}, z.core.$strip>>;
|
|
325
|
+
}, z.core.$strip>>;
|
|
333
326
|
model: z.ZodOptional<z.ZodObject<{
|
|
334
327
|
provider: z.ZodOptional<z.ZodString>;
|
|
335
328
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -541,6 +534,58 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
541
534
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
542
535
|
fatal: z.ZodOptional<z.ZodBoolean>;
|
|
543
536
|
}, z.core.$strip>;
|
|
537
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
538
|
+
schema: z.ZodLiteral<"handlebar.audit.v1">;
|
|
539
|
+
ts: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDate>;
|
|
540
|
+
runId: z.ZodString;
|
|
541
|
+
stepIndex: z.ZodOptional<z.ZodNumber>;
|
|
542
|
+
decisionId: z.ZodOptional<z.ZodString>;
|
|
543
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
544
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
545
|
+
userCategory: z.ZodOptional<z.ZodString>;
|
|
546
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
547
|
+
}, z.core.$strip>>;
|
|
548
|
+
otel: z.ZodOptional<z.ZodObject<{
|
|
549
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
550
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
551
|
+
}, z.core.$strip>>;
|
|
552
|
+
sample: z.ZodOptional<z.ZodObject<{
|
|
553
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
554
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
555
|
+
}, z.core.$strip>>;
|
|
556
|
+
redaction: z.ZodOptional<z.ZodObject<{
|
|
557
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
558
|
+
none: "none";
|
|
559
|
+
partial: "partial";
|
|
560
|
+
strict: "strict";
|
|
561
|
+
}>>;
|
|
562
|
+
}, z.core.$strip>>;
|
|
563
|
+
kind: z.ZodLiteral<"message.raw.created">;
|
|
564
|
+
data: z.ZodObject<{
|
|
565
|
+
messageId: z.ZodUUID;
|
|
566
|
+
role: z.ZodEnum<{
|
|
567
|
+
user: "user";
|
|
568
|
+
system: "system";
|
|
569
|
+
developer: "developer";
|
|
570
|
+
assistant: "assistant";
|
|
571
|
+
tool: "tool";
|
|
572
|
+
}>;
|
|
573
|
+
kind: z.ZodEnum<{
|
|
574
|
+
output: "output";
|
|
575
|
+
input: "input";
|
|
576
|
+
tool_call: "tool_call";
|
|
577
|
+
tool_result: "tool_result";
|
|
578
|
+
observation: "observation";
|
|
579
|
+
internal_summary: "internal_summary";
|
|
580
|
+
thinking: "thinking";
|
|
581
|
+
}>;
|
|
582
|
+
content: z.ZodString;
|
|
583
|
+
contentTruncated: z.ZodBoolean;
|
|
584
|
+
parentMessageId: z.ZodOptional<z.ZodUUID>;
|
|
585
|
+
turnIndex: z.ZodOptional<z.ZodNumber>;
|
|
586
|
+
name: z.ZodOptional<z.ZodString>;
|
|
587
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
588
|
+
}, z.core.$strip>;
|
|
544
589
|
}, z.core.$strip>], "kind">;
|
|
545
590
|
export type AuditEvent = z.infer<typeof AuditEventSchema>;
|
|
546
591
|
export type AuditEventByKind = {
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const MessageRoleSchema: z.ZodEnum<{
|
|
3
|
+
user: "user";
|
|
4
|
+
system: "system";
|
|
5
|
+
developer: "developer";
|
|
6
|
+
assistant: "assistant";
|
|
7
|
+
tool: "tool";
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Message "kind" is about how it appears in an agent flow.
|
|
11
|
+
* - input: user message
|
|
12
|
+
* - output: assistant natural language output
|
|
13
|
+
* - tool_call: assistant initiated tool call (as text/JSON tool call)
|
|
14
|
+
* - tool_result: tool return value summarised or raw ref
|
|
15
|
+
* - observation: agent framework observation (non-tool, e.g. environment signal)
|
|
16
|
+
* - internal_summary: optional short summary generated for UI
|
|
17
|
+
* - thinking: model CoT
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare const MessageKindSchema: z.ZodEnum<{
|
|
21
|
+
output: "output";
|
|
22
|
+
input: "input";
|
|
23
|
+
tool_call: "tool_call";
|
|
24
|
+
tool_result: "tool_result";
|
|
25
|
+
observation: "observation";
|
|
26
|
+
internal_summary: "internal_summary";
|
|
27
|
+
thinking: "thinking";
|
|
28
|
+
}>;
|
|
29
|
+
export declare const MessageSchema: z.ZodObject<{
|
|
30
|
+
messageId: z.ZodUUID;
|
|
31
|
+
role: z.ZodEnum<{
|
|
32
|
+
user: "user";
|
|
33
|
+
system: "system";
|
|
34
|
+
developer: "developer";
|
|
35
|
+
assistant: "assistant";
|
|
36
|
+
tool: "tool";
|
|
37
|
+
}>;
|
|
38
|
+
kind: z.ZodEnum<{
|
|
39
|
+
output: "output";
|
|
40
|
+
input: "input";
|
|
41
|
+
tool_call: "tool_call";
|
|
42
|
+
tool_result: "tool_result";
|
|
43
|
+
observation: "observation";
|
|
44
|
+
internal_summary: "internal_summary";
|
|
45
|
+
thinking: "thinking";
|
|
46
|
+
}>;
|
|
47
|
+
content: z.ZodString;
|
|
48
|
+
contentTruncated: z.ZodBoolean;
|
|
49
|
+
parentMessageId: z.ZodOptional<z.ZodUUID>;
|
|
50
|
+
turnIndex: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export declare const MessageEventSchema: z.ZodObject<{
|
|
55
|
+
schema: z.ZodLiteral<"handlebar.audit.v1">;
|
|
56
|
+
ts: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDate>;
|
|
57
|
+
runId: z.ZodString;
|
|
58
|
+
stepIndex: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
decisionId: z.ZodOptional<z.ZodString>;
|
|
60
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
62
|
+
userCategory: z.ZodOptional<z.ZodString>;
|
|
63
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
otel: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
67
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
sample: z.ZodOptional<z.ZodObject<{
|
|
70
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
redaction: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
none: "none";
|
|
76
|
+
partial: "partial";
|
|
77
|
+
strict: "strict";
|
|
78
|
+
}>>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
kind: z.ZodLiteral<"message.raw.created">;
|
|
81
|
+
data: z.ZodObject<{
|
|
82
|
+
messageId: z.ZodUUID;
|
|
83
|
+
role: z.ZodEnum<{
|
|
84
|
+
user: "user";
|
|
85
|
+
system: "system";
|
|
86
|
+
developer: "developer";
|
|
87
|
+
assistant: "assistant";
|
|
88
|
+
tool: "tool";
|
|
89
|
+
}>;
|
|
90
|
+
kind: z.ZodEnum<{
|
|
91
|
+
output: "output";
|
|
92
|
+
input: "input";
|
|
93
|
+
tool_call: "tool_call";
|
|
94
|
+
tool_result: "tool_result";
|
|
95
|
+
observation: "observation";
|
|
96
|
+
internal_summary: "internal_summary";
|
|
97
|
+
thinking: "thinking";
|
|
98
|
+
}>;
|
|
99
|
+
content: z.ZodString;
|
|
100
|
+
contentTruncated: z.ZodBoolean;
|
|
101
|
+
parentMessageId: z.ZodOptional<z.ZodUUID>;
|
|
102
|
+
turnIndex: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
name: z.ZodOptional<z.ZodString>;
|
|
104
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const EndUserConfigSchema: z.ZodObject<{
|
|
3
|
+
externalId: z.ZodString;
|
|
4
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const EndUserGroupConfigSchema: z.ZodObject<{
|
|
8
|
+
externalId: z.ZodString;
|
|
9
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
10
|
+
name: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type EndUserConfig = z.infer<typeof EndUserConfigSchema>;
|
|
13
|
+
export type EndUserGroupConfig = z.infer<typeof EndUserGroupConfigSchema>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export * from "./audit/events";
|
|
2
|
+
export * from "./audit/events.base";
|
|
3
|
+
export * from "./audit/events.llm";
|
|
2
4
|
export * from "./audit/governance-actions";
|
|
5
|
+
export type { EndUserConfig, EndUserGroupConfig } from "./enduser.types";
|
|
3
6
|
export * from "./rules/action.types";
|
|
4
7
|
export * from "./rules/condition.types";
|
|
5
8
|
export * from "./rules/rule.types";
|
package/dist/index.js
CHANGED
|
@@ -12574,29 +12574,15 @@ function date4(params) {
|
|
|
12574
12574
|
|
|
12575
12575
|
// node_modules/zod/v4/classic/external.js
|
|
12576
12576
|
config(en_default());
|
|
12577
|
-
//
|
|
12578
|
-
var
|
|
12579
|
-
|
|
12580
|
-
|
|
12581
|
-
|
|
12582
|
-
type: exports_external.custom(),
|
|
12583
|
-
ruleId: exports_external.string()
|
|
12584
|
-
});
|
|
12585
|
-
var GovernanceDecisionSchema = exports_external.object({
|
|
12586
|
-
effect: exports_external.custom(),
|
|
12587
|
-
code: exports_external.custom(),
|
|
12588
|
-
matchedRuleIds: exports_external.array(exports_external.string()),
|
|
12589
|
-
appliedActions: exports_external.array(AppliedActionSchema),
|
|
12590
|
-
reason: exports_external.optional(exports_external.string())
|
|
12577
|
+
// src/enduser.types.ts
|
|
12578
|
+
var EndUserConfigSchema = exports_external.object({
|
|
12579
|
+
externalId: exports_external.string(),
|
|
12580
|
+
metadata: exports_external.record(exports_external.string(), exports_external.string()),
|
|
12581
|
+
name: exports_external.string().optional()
|
|
12591
12582
|
});
|
|
12583
|
+
var EndUserGroupConfigSchema = EndUserConfigSchema;
|
|
12592
12584
|
|
|
12593
|
-
// src/audit/events.ts
|
|
12594
|
-
var CountersSchema = exports_external.record(exports_external.string(), exports_external.union([exports_external.string(), exports_external.number()]));
|
|
12595
|
-
var ToolMetaSchema = exports_external.object({
|
|
12596
|
-
redacted: exports_external.boolean(),
|
|
12597
|
-
redactedFields: exports_external.array(exports_external.string()).optional(),
|
|
12598
|
-
sizeBytesApprox: exports_external.number().min(0).optional()
|
|
12599
|
-
});
|
|
12585
|
+
// src/audit/events.base.ts
|
|
12600
12586
|
var AuditEnvelopeSchema = exports_external.object({
|
|
12601
12587
|
schema: exports_external.literal("handlebar.audit.v1"),
|
|
12602
12588
|
ts: exports_external.preprocess((v) => {
|
|
@@ -12628,6 +12614,60 @@ var AuditEnvelopeSchema = exports_external.object({
|
|
|
12628
12614
|
level: exports_external.enum(["none", "partial", "strict"]).optional()
|
|
12629
12615
|
}).optional()
|
|
12630
12616
|
});
|
|
12617
|
+
|
|
12618
|
+
// src/audit/events.llm.ts
|
|
12619
|
+
var MessageRoleSchema = exports_external.enum([
|
|
12620
|
+
"system",
|
|
12621
|
+
"developer",
|
|
12622
|
+
"user",
|
|
12623
|
+
"assistant",
|
|
12624
|
+
"tool"
|
|
12625
|
+
]);
|
|
12626
|
+
var MessageKindSchema = exports_external.enum([
|
|
12627
|
+
"input",
|
|
12628
|
+
"output",
|
|
12629
|
+
"tool_call",
|
|
12630
|
+
"tool_result",
|
|
12631
|
+
"observation",
|
|
12632
|
+
"internal_summary",
|
|
12633
|
+
"thinking"
|
|
12634
|
+
]);
|
|
12635
|
+
var MessageSchema = exports_external.object({
|
|
12636
|
+
messageId: exports_external.uuidv7(),
|
|
12637
|
+
role: MessageRoleSchema,
|
|
12638
|
+
kind: MessageKindSchema,
|
|
12639
|
+
content: exports_external.string(),
|
|
12640
|
+
contentTruncated: exports_external.boolean(),
|
|
12641
|
+
parentMessageId: exports_external.uuidv7().optional(),
|
|
12642
|
+
turnIndex: exports_external.number().int().min(0).optional(),
|
|
12643
|
+
name: exports_external.string().optional(),
|
|
12644
|
+
tags: exports_external.array(exports_external.string()).optional()
|
|
12645
|
+
});
|
|
12646
|
+
var MessageEventSchema = AuditEnvelopeSchema.extend({
|
|
12647
|
+
kind: exports_external.literal("message.raw.created"),
|
|
12648
|
+
data: MessageSchema
|
|
12649
|
+
});
|
|
12650
|
+
|
|
12651
|
+
// src/audit/governance-actions.ts
|
|
12652
|
+
var AppliedActionSchema = exports_external.object({
|
|
12653
|
+
type: exports_external.custom(),
|
|
12654
|
+
ruleId: exports_external.string()
|
|
12655
|
+
});
|
|
12656
|
+
var GovernanceDecisionSchema = exports_external.object({
|
|
12657
|
+
effect: exports_external.custom(),
|
|
12658
|
+
code: exports_external.custom(),
|
|
12659
|
+
matchedRuleIds: exports_external.array(exports_external.string()),
|
|
12660
|
+
appliedActions: exports_external.array(AppliedActionSchema),
|
|
12661
|
+
reason: exports_external.optional(exports_external.string())
|
|
12662
|
+
});
|
|
12663
|
+
|
|
12664
|
+
// src/audit/events.ts
|
|
12665
|
+
var CountersSchema = exports_external.record(exports_external.string(), exports_external.union([exports_external.string(), exports_external.number()]));
|
|
12666
|
+
var ToolMetaSchema = exports_external.object({
|
|
12667
|
+
redacted: exports_external.boolean(),
|
|
12668
|
+
redactedFields: exports_external.array(exports_external.string()).optional(),
|
|
12669
|
+
sizeBytesApprox: exports_external.number().min(0).optional()
|
|
12670
|
+
});
|
|
12631
12671
|
var RunStartedEventSchema = AuditEnvelopeSchema.extend({
|
|
12632
12672
|
kind: exports_external.literal("run.started"),
|
|
12633
12673
|
data: exports_external.object({
|
|
@@ -12638,6 +12678,9 @@ var RunStartedEventSchema = AuditEnvelopeSchema.extend({
|
|
|
12638
12678
|
id: exports_external.string().optional(),
|
|
12639
12679
|
name: exports_external.string().optional()
|
|
12640
12680
|
}),
|
|
12681
|
+
enduser: EndUserConfigSchema.extend({
|
|
12682
|
+
group: EndUserGroupConfigSchema.optional()
|
|
12683
|
+
}).optional(),
|
|
12641
12684
|
model: exports_external.object({
|
|
12642
12685
|
provider: exports_external.string().optional(),
|
|
12643
12686
|
name: exports_external.string().optional()
|
|
@@ -12717,18 +12760,19 @@ var AuditEventSchema = exports_external.discriminatedUnion("kind", [
|
|
|
12717
12760
|
ToolDecisionEventSchema,
|
|
12718
12761
|
ToolResultEventSchema,
|
|
12719
12762
|
RunEndedEventSchema,
|
|
12720
|
-
ErrorEventSchema
|
|
12763
|
+
ErrorEventSchema,
|
|
12764
|
+
MessageEventSchema
|
|
12721
12765
|
]);
|
|
12722
12766
|
// src/rules/rule.types.ts
|
|
12723
|
-
var RuleConfigSchema =
|
|
12724
|
-
priority:
|
|
12725
|
-
when:
|
|
12726
|
-
condition:
|
|
12727
|
-
actions:
|
|
12728
|
-
});
|
|
12729
|
-
var RuleSchema =
|
|
12730
|
-
id:
|
|
12731
|
-
policy_id:
|
|
12767
|
+
var RuleConfigSchema = exports_external.object({
|
|
12768
|
+
priority: exports_external.number().min(0),
|
|
12769
|
+
when: exports_external.custom(),
|
|
12770
|
+
condition: exports_external.custom(),
|
|
12771
|
+
actions: exports_external.array(exports_external.custom())
|
|
12772
|
+
});
|
|
12773
|
+
var RuleSchema = exports_external.object({
|
|
12774
|
+
id: exports_external.uuid({ version: "v7" }),
|
|
12775
|
+
policy_id: exports_external.uuid({ version: "v7" })
|
|
12732
12776
|
}).and(RuleConfigSchema);
|
|
12733
12777
|
export {
|
|
12734
12778
|
ToolResultEventSchema,
|
|
@@ -12737,6 +12781,10 @@ export {
|
|
|
12737
12781
|
RunEndedEventSchema,
|
|
12738
12782
|
RuleSchema,
|
|
12739
12783
|
RuleConfigSchema,
|
|
12784
|
+
MessageSchema,
|
|
12785
|
+
MessageRoleSchema,
|
|
12786
|
+
MessageKindSchema,
|
|
12787
|
+
MessageEventSchema,
|
|
12740
12788
|
HitlMetaSchema,
|
|
12741
12789
|
GovernanceDecisionSchema,
|
|
12742
12790
|
ErrorEventSchema,
|