@handlebar/governance-schema 0.0.6-dev.0 → 0.0.6-dev.2
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.d.ts +21 -1
- package/dist/audit/events.llm.d.ts +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -1
- package/dist/rules/condition.types.d.ts +22 -1
- package/package.json +1 -1
package/dist/audit/events.d.ts
CHANGED
|
@@ -38,6 +38,16 @@ export declare const RunStartedEventSchema: z.ZodObject<{
|
|
|
38
38
|
id: z.ZodOptional<z.ZodString>;
|
|
39
39
|
name: z.ZodOptional<z.ZodString>;
|
|
40
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>>;
|
|
41
51
|
model: z.ZodOptional<z.ZodObject<{
|
|
42
52
|
provider: z.ZodOptional<z.ZodString>;
|
|
43
53
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -303,6 +313,16 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
303
313
|
id: z.ZodOptional<z.ZodString>;
|
|
304
314
|
name: z.ZodOptional<z.ZodString>;
|
|
305
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>>;
|
|
306
326
|
model: z.ZodOptional<z.ZodObject<{
|
|
307
327
|
provider: z.ZodOptional<z.ZodString>;
|
|
308
328
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -551,8 +571,8 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
551
571
|
tool: "tool";
|
|
552
572
|
}>;
|
|
553
573
|
kind: z.ZodEnum<{
|
|
554
|
-
input: "input";
|
|
555
574
|
output: "output";
|
|
575
|
+
input: "input";
|
|
556
576
|
tool_call: "tool_call";
|
|
557
577
|
tool_result: "tool_result";
|
|
558
578
|
observation: "observation";
|
|
@@ -18,8 +18,8 @@ export declare const MessageRoleSchema: z.ZodEnum<{
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
export declare const MessageKindSchema: z.ZodEnum<{
|
|
21
|
-
input: "input";
|
|
22
21
|
output: "output";
|
|
22
|
+
input: "input";
|
|
23
23
|
tool_call: "tool_call";
|
|
24
24
|
tool_result: "tool_result";
|
|
25
25
|
observation: "observation";
|
|
@@ -36,8 +36,8 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
36
36
|
tool: "tool";
|
|
37
37
|
}>;
|
|
38
38
|
kind: z.ZodEnum<{
|
|
39
|
-
input: "input";
|
|
40
39
|
output: "output";
|
|
40
|
+
input: "input";
|
|
41
41
|
tool_call: "tool_call";
|
|
42
42
|
tool_result: "tool_result";
|
|
43
43
|
observation: "observation";
|
|
@@ -88,8 +88,8 @@ export declare const MessageEventSchema: z.ZodObject<{
|
|
|
88
88
|
tool: "tool";
|
|
89
89
|
}>;
|
|
90
90
|
kind: z.ZodEnum<{
|
|
91
|
-
input: "input";
|
|
92
91
|
output: "output";
|
|
92
|
+
input: "input";
|
|
93
93
|
tool_call: "tool_call";
|
|
94
94
|
tool_result: "tool_result";
|
|
95
95
|
observation: "observation";
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./audit/events";
|
|
|
2
2
|
export * from "./audit/events.base";
|
|
3
3
|
export * from "./audit/events.llm";
|
|
4
4
|
export * from "./audit/governance-actions";
|
|
5
|
+
export type { EndUserConfig, EndUserGroupConfig } from "./enduser.types";
|
|
5
6
|
export * from "./rules/action.types";
|
|
6
7
|
export * from "./rules/condition.types";
|
|
7
8
|
export * from "./rules/rule.types";
|
package/dist/index.js
CHANGED
|
@@ -12574,6 +12574,14 @@ function date4(params) {
|
|
|
12574
12574
|
|
|
12575
12575
|
// node_modules/zod/v4/classic/external.js
|
|
12576
12576
|
config(en_default());
|
|
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()
|
|
12582
|
+
});
|
|
12583
|
+
var EndUserGroupConfigSchema = EndUserConfigSchema;
|
|
12584
|
+
|
|
12577
12585
|
// src/audit/events.base.ts
|
|
12578
12586
|
var AuditEnvelopeSchema = exports_external.object({
|
|
12579
12587
|
schema: exports_external.literal("handlebar.audit.v1"),
|
|
@@ -12608,7 +12616,13 @@ var AuditEnvelopeSchema = exports_external.object({
|
|
|
12608
12616
|
});
|
|
12609
12617
|
|
|
12610
12618
|
// src/audit/events.llm.ts
|
|
12611
|
-
var MessageRoleSchema = exports_external.enum([
|
|
12619
|
+
var MessageRoleSchema = exports_external.enum([
|
|
12620
|
+
"system",
|
|
12621
|
+
"developer",
|
|
12622
|
+
"user",
|
|
12623
|
+
"assistant",
|
|
12624
|
+
"tool"
|
|
12625
|
+
]);
|
|
12612
12626
|
var MessageKindSchema = exports_external.enum([
|
|
12613
12627
|
"input",
|
|
12614
12628
|
"output",
|
|
@@ -12664,6 +12678,9 @@ var RunStartedEventSchema = AuditEnvelopeSchema.extend({
|
|
|
12664
12678
|
id: exports_external.string().optional(),
|
|
12665
12679
|
name: exports_external.string().optional()
|
|
12666
12680
|
}),
|
|
12681
|
+
enduser: EndUserConfigSchema.extend({
|
|
12682
|
+
group: EndUserGroupConfigSchema.optional()
|
|
12683
|
+
}).optional(),
|
|
12667
12684
|
model: exports_external.object({
|
|
12668
12685
|
provider: exports_external.string().optional(),
|
|
12669
12686
|
name: exports_external.string().optional()
|
|
@@ -48,6 +48,27 @@ export type ToolTagCondition = {
|
|
|
48
48
|
op: "allOf";
|
|
49
49
|
tags: string[];
|
|
50
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* Match on arbitrary tags assigned to the enduser.
|
|
53
|
+
* "enduser" in this context means the users of a Handlebar user.
|
|
54
|
+
* - has: existence AND truthiness of the tag. E.g. "has:tier" would be false if "tier=0", "tier=false", or no "tier" tag exists.
|
|
55
|
+
* - hasValue: tag exists and has an exact given value
|
|
56
|
+
*/
|
|
57
|
+
export type EndUserTagCondition = {
|
|
58
|
+
kind: "enduserTag";
|
|
59
|
+
op: "has";
|
|
60
|
+
tag: string;
|
|
61
|
+
} | {
|
|
62
|
+
kind: "enduserTag";
|
|
63
|
+
op: "hasValue";
|
|
64
|
+
tag: string;
|
|
65
|
+
value: string;
|
|
66
|
+
} | {
|
|
67
|
+
kind: "enduserTag";
|
|
68
|
+
op: "hasValueAny";
|
|
69
|
+
tag: string;
|
|
70
|
+
values: string[];
|
|
71
|
+
};
|
|
51
72
|
/**
|
|
52
73
|
* Scope for execution time measurement.
|
|
53
74
|
* - "tool": the single tool call duration
|
|
@@ -118,4 +139,4 @@ export type NotCondition = {
|
|
|
118
139
|
/**
|
|
119
140
|
* The full condition algebra supported by the rule engine.
|
|
120
141
|
*/
|
|
121
|
-
export type RuleCondition = ToolNameCondition | ToolTagCondition | ExecutionTimeCondition | SequenceCondition | MaxCallsCondition | CustomFunctionCondition | AndCondition | OrCondition | NotCondition;
|
|
142
|
+
export type RuleCondition = ToolNameCondition | ToolTagCondition | EndUserTagCondition | ExecutionTimeCondition | SequenceCondition | MaxCallsCondition | CustomFunctionCondition | AndCondition | OrCondition | NotCondition;
|