@handlebar/governance-schema 0.0.6-dev.9 → 0.1.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.
@@ -139,6 +139,9 @@ export declare const ToolResultEventSchema: z.ZodObject<{
139
139
  duration_ms: "duration_ms";
140
140
  records_in: "records_in";
141
141
  records_out: "records_out";
142
+ llm_tokens_in: "llm_tokens_in";
143
+ llm_tokens_out: "llm_tokens_out";
144
+ llm_cost_usd: "llm_cost_usd";
142
145
  }> & z.core.$partial, z.ZodObject<{
143
146
  value: z.ZodNumber;
144
147
  unit: z.ZodOptional<z.ZodString>;
@@ -161,6 +164,7 @@ export declare const ToolResultEventSchema: z.ZodObject<{
161
164
  debug: z.ZodOptional<z.ZodObject<{
162
165
  approxTokens: z.ZodOptional<z.ZodNumber>;
163
166
  chars: z.ZodOptional<z.ZodNumber>;
167
+ bytes: z.ZodOptional<z.ZodNumber>;
164
168
  }, z.core.$strip>>;
165
169
  }, z.core.$strip>;
166
170
  }, z.core.$strip>;
@@ -5,6 +5,9 @@ export declare const InbuiltAgentMetricKind: z.ZodEnum<{
5
5
  duration_ms: "duration_ms";
6
6
  records_in: "records_in";
7
7
  records_out: "records_out";
8
+ llm_tokens_in: "llm_tokens_in";
9
+ llm_tokens_out: "llm_tokens_out";
10
+ llm_cost_usd: "llm_cost_usd";
8
11
  }>;
9
12
  export declare const CustomAgentMetricKind: z.ZodString;
10
13
  export declare const AgentMetrics: z.ZodObject<{
@@ -14,6 +17,9 @@ export declare const AgentMetrics: z.ZodObject<{
14
17
  duration_ms: "duration_ms";
15
18
  records_in: "records_in";
16
19
  records_out: "records_out";
20
+ llm_tokens_in: "llm_tokens_in";
21
+ llm_tokens_out: "llm_tokens_out";
22
+ llm_cost_usd: "llm_cost_usd";
17
23
  }> & z.core.$partial, z.ZodObject<{
18
24
  value: z.ZodNumber;
19
25
  unit: z.ZodOptional<z.ZodString>;
package/dist/index.js CHANGED
@@ -13611,7 +13611,7 @@ var MessageSchema = exports_external.object({
13611
13611
  });
13612
13612
  var MessageEventSchema = AuditEnvelopeSchema.extend({
13613
13613
  kind: exports_external.literal("message.raw.created"),
13614
- data: MessageSchema.extend(exports_external.object({
13614
+ data: MessageSchema.and(exports_external.object({
13615
13615
  debug: exports_external.object({
13616
13616
  approxTokens: exports_external.number().min(0).optional(),
13617
13617
  chars: exports_external.number().min(0).optional()
@@ -13622,7 +13622,7 @@ var LLMResultEventSchema = AuditEnvelopeSchema.extend({
13622
13622
  kind: exports_external.literal("llm.result"),
13623
13623
  data: exports_external.object({
13624
13624
  model: exports_external.object({
13625
- model: exports_external.string(),
13625
+ name: exports_external.string(),
13626
13626
  provider: exports_external.string().optional()
13627
13627
  }),
13628
13628
  tokens: exports_external.object({
@@ -13630,13 +13630,7 @@ var LLMResultEventSchema = AuditEnvelopeSchema.extend({
13630
13630
  out: exports_external.number().min(0)
13631
13631
  }),
13632
13632
  debug: exports_external.object({
13633
- inTokenAttribution: exports_external.object({
13634
- system: exports_external.number().min(0).optional(),
13635
- user: exports_external.number().min(0).optional(),
13636
- assistant: exports_external.number().min(0).optional(),
13637
- tool: exports_external.number().min(0).optional(),
13638
- other: exports_external.number().min(0).optional()
13639
- })
13633
+ inTokenAttribution: exports_external.partialRecord(MessageRoleSchema, exports_external.number().min(0))
13640
13634
  }).optional(),
13641
13635
  messageCount: exports_external.number().min(0),
13642
13636
  durationMs: exports_external.number().min(0).optional()
@@ -13671,7 +13665,10 @@ var InbuiltAgentMetricKind = exports_external.enum([
13671
13665
  "bytes_out",
13672
13666
  "duration_ms",
13673
13667
  "records_in",
13674
- "records_out"
13668
+ "records_out",
13669
+ "llm_tokens_in",
13670
+ "llm_tokens_out",
13671
+ "llm_cost_usd"
13675
13672
  ]);
13676
13673
  var CustomAgentMetricKind = exports_external.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/);
13677
13674
  var AgentMetricInfo = exports_external.object({
@@ -13738,7 +13735,8 @@ var ToolResultEventSchema = AuditEnvelopeSchema.extend({
13738
13735
  resultMeta: ToolMetaSchema.optional(),
13739
13736
  debug: zod_default.object({
13740
13737
  approxTokens: zod_default.number().min(0).optional(),
13741
- chars: zod_default.number().min(0).optional()
13738
+ chars: zod_default.number().min(0).optional(),
13739
+ bytes: zod_default.number().min(0).optional()
13742
13740
  }).optional()
13743
13741
  })
13744
13742
  });
@@ -121,6 +121,9 @@ declare const AndConditionSchema: z.ZodObject<{
121
121
  duration_ms: "duration_ms";
122
122
  records_in: "records_in";
123
123
  records_out: "records_out";
124
+ llm_tokens_in: "llm_tokens_in";
125
+ llm_tokens_out: "llm_tokens_out";
126
+ llm_cost_usd: "llm_cost_usd";
124
127
  }>;
125
128
  }, z.core.$strict>, z.ZodObject<{
126
129
  kind: z.ZodLiteral<"custom">;
@@ -344,6 +347,9 @@ declare const OrConditionSchema: z.ZodObject<{
344
347
  duration_ms: "duration_ms";
345
348
  records_in: "records_in";
346
349
  records_out: "records_out";
350
+ llm_tokens_in: "llm_tokens_in";
351
+ llm_tokens_out: "llm_tokens_out";
352
+ llm_cost_usd: "llm_cost_usd";
347
353
  }>;
348
354
  }, z.core.$strict>, z.ZodObject<{
349
355
  kind: z.ZodLiteral<"custom">;
@@ -567,6 +573,9 @@ declare const NotConditionSchema: z.ZodObject<{
567
573
  duration_ms: "duration_ms";
568
574
  records_in: "records_in";
569
575
  records_out: "records_out";
576
+ llm_tokens_in: "llm_tokens_in";
577
+ llm_tokens_out: "llm_tokens_out";
578
+ llm_cost_usd: "llm_cost_usd";
570
579
  }>;
571
580
  }, z.core.$strict>, z.ZodObject<{
572
581
  kind: z.ZodLiteral<"custom">;
@@ -791,6 +800,9 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
791
800
  duration_ms: "duration_ms";
792
801
  records_in: "records_in";
793
802
  records_out: "records_out";
803
+ llm_tokens_in: "llm_tokens_in";
804
+ llm_tokens_out: "llm_tokens_out";
805
+ llm_cost_usd: "llm_cost_usd";
794
806
  }>;
795
807
  }, z.core.$strict>, z.ZodObject<{
796
808
  kind: z.ZodLiteral<"custom">;
@@ -1012,6 +1024,9 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
1012
1024
  duration_ms: "duration_ms";
1013
1025
  records_in: "records_in";
1014
1026
  records_out: "records_out";
1027
+ llm_tokens_in: "llm_tokens_in";
1028
+ llm_tokens_out: "llm_tokens_out";
1029
+ llm_cost_usd: "llm_cost_usd";
1015
1030
  }>;
1016
1031
  }, z.core.$strict>, z.ZodObject<{
1017
1032
  kind: z.ZodLiteral<"custom">;
@@ -1234,6 +1249,9 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
1234
1249
  duration_ms: "duration_ms";
1235
1250
  records_in: "records_in";
1236
1251
  records_out: "records_out";
1252
+ llm_tokens_in: "llm_tokens_in";
1253
+ llm_tokens_out: "llm_tokens_out";
1254
+ llm_cost_usd: "llm_cost_usd";
1237
1255
  }>;
1238
1256
  }, z.core.$strict>, z.ZodObject<{
1239
1257
  kind: z.ZodLiteral<"custom">;
@@ -1456,6 +1474,9 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
1456
1474
  duration_ms: "duration_ms";
1457
1475
  records_in: "records_in";
1458
1476
  records_out: "records_out";
1477
+ llm_tokens_in: "llm_tokens_in";
1478
+ llm_tokens_out: "llm_tokens_out";
1479
+ llm_cost_usd: "llm_cost_usd";
1459
1480
  }>;
1460
1481
  }, z.core.$strict>, z.ZodObject<{
1461
1482
  kind: z.ZodLiteral<"custom">;
@@ -7,6 +7,9 @@ export declare const MetricRefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7
7
  duration_ms: "duration_ms";
8
8
  records_in: "records_in";
9
9
  records_out: "records_out";
10
+ llm_tokens_in: "llm_tokens_in";
11
+ llm_tokens_out: "llm_tokens_out";
12
+ llm_cost_usd: "llm_cost_usd";
10
13
  }>;
11
14
  }, z.core.$strict>, z.ZodObject<{
12
15
  kind: z.ZodLiteral<"custom">;
@@ -27,6 +30,9 @@ export declare const MetricWindowConditionSchema: z.ZodObject<{
27
30
  duration_ms: "duration_ms";
28
31
  records_in: "records_in";
29
32
  records_out: "records_out";
33
+ llm_tokens_in: "llm_tokens_in";
34
+ llm_tokens_out: "llm_tokens_out";
35
+ llm_cost_usd: "llm_cost_usd";
30
36
  }>;
31
37
  }, z.core.$strict>, z.ZodObject<{
32
38
  kind: z.ZodLiteral<"custom">;
@@ -153,6 +153,9 @@ export declare const RuleSchema: z.ZodObject<{
153
153
  duration_ms: "duration_ms";
154
154
  records_in: "records_in";
155
155
  records_out: "records_out";
156
+ llm_tokens_in: "llm_tokens_in";
157
+ llm_tokens_out: "llm_tokens_out";
158
+ llm_cost_usd: "llm_cost_usd";
156
159
  }>;
157
160
  }, z.core.$strict>, z.ZodObject<{
158
161
  kind: z.ZodLiteral<"custom">;
@@ -374,6 +377,9 @@ export declare const RuleSchema: z.ZodObject<{
374
377
  duration_ms: "duration_ms";
375
378
  records_in: "records_in";
376
379
  records_out: "records_out";
380
+ llm_tokens_in: "llm_tokens_in";
381
+ llm_tokens_out: "llm_tokens_out";
382
+ llm_cost_usd: "llm_cost_usd";
377
383
  }>;
378
384
  }, z.core.$strict>, z.ZodObject<{
379
385
  kind: z.ZodLiteral<"custom">;
@@ -596,6 +602,9 @@ export declare const RuleSchema: z.ZodObject<{
596
602
  duration_ms: "duration_ms";
597
603
  records_in: "records_in";
598
604
  records_out: "records_out";
605
+ llm_tokens_in: "llm_tokens_in";
606
+ llm_tokens_out: "llm_tokens_out";
607
+ llm_cost_usd: "llm_cost_usd";
599
608
  }>;
600
609
  }, z.core.$strict>, z.ZodObject<{
601
610
  kind: z.ZodLiteral<"custom">;
@@ -818,6 +827,9 @@ export declare const RuleSchema: z.ZodObject<{
818
827
  duration_ms: "duration_ms";
819
828
  records_in: "records_in";
820
829
  records_out: "records_out";
830
+ llm_tokens_in: "llm_tokens_in";
831
+ llm_tokens_out: "llm_tokens_out";
832
+ llm_cost_usd: "llm_cost_usd";
821
833
  }>;
822
834
  }, z.core.$strict>, z.ZodObject<{
823
835
  kind: z.ZodLiteral<"custom">;
@@ -1085,6 +1097,9 @@ export declare const RuleSpecSchema: z.ZodObject<{
1085
1097
  duration_ms: "duration_ms";
1086
1098
  records_in: "records_in";
1087
1099
  records_out: "records_out";
1100
+ llm_tokens_in: "llm_tokens_in";
1101
+ llm_tokens_out: "llm_tokens_out";
1102
+ llm_cost_usd: "llm_cost_usd";
1088
1103
  }>;
1089
1104
  }, z.core.$strict>, z.ZodObject<{
1090
1105
  kind: z.ZodLiteral<"custom">;
@@ -1306,6 +1321,9 @@ export declare const RuleSpecSchema: z.ZodObject<{
1306
1321
  duration_ms: "duration_ms";
1307
1322
  records_in: "records_in";
1308
1323
  records_out: "records_out";
1324
+ llm_tokens_in: "llm_tokens_in";
1325
+ llm_tokens_out: "llm_tokens_out";
1326
+ llm_cost_usd: "llm_cost_usd";
1309
1327
  }>;
1310
1328
  }, z.core.$strict>, z.ZodObject<{
1311
1329
  kind: z.ZodLiteral<"custom">;
@@ -1528,6 +1546,9 @@ export declare const RuleSpecSchema: z.ZodObject<{
1528
1546
  duration_ms: "duration_ms";
1529
1547
  records_in: "records_in";
1530
1548
  records_out: "records_out";
1549
+ llm_tokens_in: "llm_tokens_in";
1550
+ llm_tokens_out: "llm_tokens_out";
1551
+ llm_cost_usd: "llm_cost_usd";
1531
1552
  }>;
1532
1553
  }, z.core.$strict>, z.ZodObject<{
1533
1554
  kind: z.ZodLiteral<"custom">;
@@ -1750,6 +1771,9 @@ export declare const RuleSpecSchema: z.ZodObject<{
1750
1771
  duration_ms: "duration_ms";
1751
1772
  records_in: "records_in";
1752
1773
  records_out: "records_out";
1774
+ llm_tokens_in: "llm_tokens_in";
1775
+ llm_tokens_out: "llm_tokens_out";
1776
+ llm_cost_usd: "llm_cost_usd";
1753
1777
  }>;
1754
1778
  }, z.core.$strict>, z.ZodObject<{
1755
1779
  kind: z.ZodLiteral<"custom">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handlebar/governance-schema",
3
- "version": "0.0.6-dev.9",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",