@handlebar/governance-schema 0.0.6-dev.2 → 0.0.6-dev.4
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 +32 -0
- package/dist/audit/run-metrics.d.ts +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -1
- package/package.json +1 -1
package/dist/audit/events.d.ts
CHANGED
|
@@ -185,6 +185,22 @@ export declare const ToolResultEventSchema: z.ZodObject<{
|
|
|
185
185
|
}>;
|
|
186
186
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
187
187
|
counters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
188
|
+
metrics: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
inbuilt: z.ZodRecord<z.ZodEnum<{
|
|
190
|
+
bytes_in: "bytes_in";
|
|
191
|
+
bytes_out: "bytes_out";
|
|
192
|
+
duration_ms: "duration_ms";
|
|
193
|
+
records_in: "records_in";
|
|
194
|
+
records_out: "records_out";
|
|
195
|
+
}>, z.ZodObject<{
|
|
196
|
+
value: z.ZodNumber;
|
|
197
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
custom: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
200
|
+
value: z.ZodNumber;
|
|
201
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
188
204
|
error: z.ZodOptional<z.ZodObject<{
|
|
189
205
|
name: z.ZodOptional<z.ZodString>;
|
|
190
206
|
message: z.ZodOptional<z.ZodString>;
|
|
@@ -448,6 +464,22 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
448
464
|
}>;
|
|
449
465
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
450
466
|
counters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
467
|
+
metrics: z.ZodOptional<z.ZodObject<{
|
|
468
|
+
inbuilt: z.ZodRecord<z.ZodEnum<{
|
|
469
|
+
bytes_in: "bytes_in";
|
|
470
|
+
bytes_out: "bytes_out";
|
|
471
|
+
duration_ms: "duration_ms";
|
|
472
|
+
records_in: "records_in";
|
|
473
|
+
records_out: "records_out";
|
|
474
|
+
}>, z.ZodObject<{
|
|
475
|
+
value: z.ZodNumber;
|
|
476
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
477
|
+
}, z.core.$strip>>;
|
|
478
|
+
custom: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
479
|
+
value: z.ZodNumber;
|
|
480
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
481
|
+
}, z.core.$strip>>;
|
|
482
|
+
}, z.core.$strip>>;
|
|
451
483
|
error: z.ZodOptional<z.ZodObject<{
|
|
452
484
|
name: z.ZodOptional<z.ZodString>;
|
|
453
485
|
message: z.ZodOptional<z.ZodString>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const InbuiltAgentMetricKind: z.ZodEnum<{
|
|
3
|
+
bytes_in: "bytes_in";
|
|
4
|
+
bytes_out: "bytes_out";
|
|
5
|
+
duration_ms: "duration_ms";
|
|
6
|
+
records_in: "records_in";
|
|
7
|
+
records_out: "records_out";
|
|
8
|
+
}>;
|
|
9
|
+
export declare const CustomAgentMetricKind: z.ZodString;
|
|
10
|
+
export declare const AgentMetrics: z.ZodObject<{
|
|
11
|
+
inbuilt: z.ZodRecord<z.ZodEnum<{
|
|
12
|
+
bytes_in: "bytes_in";
|
|
13
|
+
bytes_out: "bytes_out";
|
|
14
|
+
duration_ms: "duration_ms";
|
|
15
|
+
records_in: "records_in";
|
|
16
|
+
records_out: "records_out";
|
|
17
|
+
}>, z.ZodObject<{
|
|
18
|
+
value: z.ZodNumber;
|
|
19
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
custom: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
22
|
+
value: z.ZodNumber;
|
|
23
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
}, z.core.$strip>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./audit/events";
|
|
2
2
|
export * from "./audit/events.base";
|
|
3
3
|
export * from "./audit/events.llm";
|
|
4
|
+
export * from "./audit/run-metrics";
|
|
4
5
|
export * from "./audit/governance-actions";
|
|
5
6
|
export type { EndUserConfig, EndUserGroupConfig } from "./enduser.types";
|
|
6
7
|
export * from "./rules/action.types";
|
package/dist/index.js
CHANGED
|
@@ -12661,6 +12661,20 @@ var GovernanceDecisionSchema = exports_external.object({
|
|
|
12661
12661
|
reason: exports_external.optional(exports_external.string())
|
|
12662
12662
|
});
|
|
12663
12663
|
|
|
12664
|
+
// src/audit/run-metrics.ts
|
|
12665
|
+
var InbuiltAgentMetricKind = exports_external.enum(["bytes_in", "bytes_out", "duration_ms", "records_in", "records_out"]);
|
|
12666
|
+
var CustomAgentMetricKind = exports_external.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/);
|
|
12667
|
+
var AgentMetricInfo = exports_external.object({
|
|
12668
|
+
value: exports_external.number(),
|
|
12669
|
+
unit: exports_external.string().min(1).max(64).optional()
|
|
12670
|
+
});
|
|
12671
|
+
var InbuiltAgentMetrics = exports_external.record(InbuiltAgentMetricKind, AgentMetricInfo);
|
|
12672
|
+
var CustomAgentMetrics = exports_external.record(CustomAgentMetricKind, AgentMetricInfo);
|
|
12673
|
+
var AgentMetrics = exports_external.object({
|
|
12674
|
+
inbuilt: InbuiltAgentMetrics,
|
|
12675
|
+
custom: CustomAgentMetrics
|
|
12676
|
+
});
|
|
12677
|
+
|
|
12664
12678
|
// src/audit/events.ts
|
|
12665
12679
|
var CountersSchema = exports_external.record(exports_external.string(), exports_external.union([exports_external.string(), exports_external.number()]));
|
|
12666
12680
|
var ToolMetaSchema = exports_external.object({
|
|
@@ -12729,6 +12743,7 @@ var ToolResultEventSchema = AuditEnvelopeSchema.extend({
|
|
|
12729
12743
|
outcome: exports_external.enum(["success", "error"]),
|
|
12730
12744
|
durationMs: exports_external.number().min(0).optional(),
|
|
12731
12745
|
counters: CountersSchema.optional(),
|
|
12746
|
+
metrics: AgentMetrics.optional(),
|
|
12732
12747
|
error: exports_external.object({
|
|
12733
12748
|
name: exports_external.string().optional(),
|
|
12734
12749
|
message: exports_external.string().optional(),
|
|
@@ -12785,11 +12800,14 @@ export {
|
|
|
12785
12800
|
MessageRoleSchema,
|
|
12786
12801
|
MessageKindSchema,
|
|
12787
12802
|
MessageEventSchema,
|
|
12803
|
+
InbuiltAgentMetricKind,
|
|
12788
12804
|
HitlMetaSchema,
|
|
12789
12805
|
GovernanceDecisionSchema,
|
|
12790
12806
|
ErrorEventSchema,
|
|
12807
|
+
CustomAgentMetricKind,
|
|
12791
12808
|
AuditEventSchema,
|
|
12792
12809
|
AuditEnvelopeSchema,
|
|
12793
|
-
AppliedActionSchema
|
|
12810
|
+
AppliedActionSchema,
|
|
12811
|
+
AgentMetrics
|
|
12794
12812
|
};
|
|
12795
12813
|
// 🚲
|