@handlebar/governance-schema 0.0.6-dev.8 → 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.
- package/README.md +1 -21
- package/dist/audit/events.d.ts +62 -5
- package/dist/audit/events.llm.d.ts +51 -1
- package/dist/audit/events.tools.d.ts +8 -0
- package/dist/audit/run-metrics.d.ts +6 -0
- package/dist/enduser.types.d.ts +2 -2
- package/dist/index.js +62 -5
- package/dist/rules/condition.d.ts +245 -0
- package/dist/rules/metrics.d.ts +6 -0
- package/dist/rules/rule.d.ts +280 -0
- package/dist/rules/tools.d.ts +34 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,30 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Schemas and types for [Handlebar] rules.
|
|
4
4
|
|
|
5
|
-
_Note: This package in early development and the interface is subject to change._
|
|
6
|
-
|
|
7
|
-
## Roadmap
|
|
8
|
-
|
|
9
|
-
Handlebar is in early development. We have a lot of functionality planned,
|
|
10
|
-
but need your feedback on what you need to help you build better agents.
|
|
11
|
-
|
|
12
|
-
- Refer to the [roadmap][root_roadmap] to see what we're cooking.
|
|
13
|
-
- Please feel free to [open an issue](https://github.com/gethandlebar/handlebar-js/issues/new) if you have any feedback or suggestions
|
|
14
|
-
- or [join our Discord][discord_invite] to talk to us directly
|
|
15
|
-
|
|
16
|
-
See [contributing][root_contributing] for more ways to get in touch and help.
|
|
17
|
-
|
|
18
5
|
## Getting started
|
|
19
6
|
|
|
20
7
|
This package should be used alongside a framework-specific Handlebar SDK,
|
|
21
8
|
such as [ai-sdk-v5](https://github.com/gethandlebar/handlebar-js/blob/main/packages/ai-sdk-v5/).
|
|
22
9
|
Refer to that package's README for more information.
|
|
23
10
|
|
|
24
|
-
Please refer to [`./examples/`][examples] for a runable demo of [Handlebar]
|
|
25
|
-
applied to an ai sdk agent.
|
|
26
|
-
|
|
27
|
-
**N.b. Our developer docs are incoming.**
|
|
28
|
-
|
|
29
11
|
## Contributing
|
|
30
12
|
|
|
31
13
|
We welcome contributions from the community: bug reports, feedback, feature requests
|
|
@@ -35,10 +17,8 @@ and guidelines.
|
|
|
35
17
|
|
|
36
18
|
## About Handlebar
|
|
37
19
|
|
|
38
|
-
Find out more at https://gethandlebar.com
|
|
20
|
+
Find out more at [https://gethandlebar.com][handlebar]
|
|
39
21
|
|
|
40
22
|
[handlebar]: https://gethandlebar.com
|
|
41
|
-
[root_roadmap]: https://github.com/gethandlebar/handlebar-js/blob/main/ROADMAP.md
|
|
42
23
|
[root_contributing]: https://github.com/gethandlebar/handlebar-js/blob/main/CONTRIBUTING.md
|
|
43
|
-
[examples]: https://github.com/gethandlebar/handlebar-js/blob/main/examples/ai-sdk-v5/
|
|
44
24
|
[discord_invite]: https://discord.gg/Q6xwvccg
|
package/dist/audit/events.d.ts
CHANGED
|
@@ -36,11 +36,11 @@ export declare const RunStartedEventSchema: z.ZodObject<{
|
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
enduser: z.ZodOptional<z.ZodObject<{
|
|
38
38
|
externalId: z.ZodString;
|
|
39
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodString
|
|
39
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
40
40
|
name: z.ZodOptional<z.ZodString>;
|
|
41
41
|
group: z.ZodOptional<z.ZodObject<{
|
|
42
42
|
externalId: z.ZodString;
|
|
43
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodString
|
|
43
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
44
44
|
name: z.ZodOptional<z.ZodString>;
|
|
45
45
|
}, z.core.$strip>>;
|
|
46
46
|
}, z.core.$strip>>;
|
|
@@ -169,11 +169,11 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
169
169
|
}, z.core.$strip>;
|
|
170
170
|
enduser: z.ZodOptional<z.ZodObject<{
|
|
171
171
|
externalId: z.ZodString;
|
|
172
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodString
|
|
172
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
173
173
|
name: z.ZodOptional<z.ZodString>;
|
|
174
174
|
group: z.ZodOptional<z.ZodObject<{
|
|
175
175
|
externalId: z.ZodString;
|
|
176
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodString
|
|
176
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
177
177
|
name: z.ZodOptional<z.ZodString>;
|
|
178
178
|
}, z.core.$strip>>;
|
|
179
179
|
}, z.core.$strip>>;
|
|
@@ -318,6 +318,9 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
318
318
|
duration_ms: "duration_ms";
|
|
319
319
|
records_in: "records_in";
|
|
320
320
|
records_out: "records_out";
|
|
321
|
+
llm_tokens_in: "llm_tokens_in";
|
|
322
|
+
llm_tokens_out: "llm_tokens_out";
|
|
323
|
+
llm_cost_usd: "llm_cost_usd";
|
|
321
324
|
}> & z.core.$partial, z.ZodObject<{
|
|
322
325
|
value: z.ZodNumber;
|
|
323
326
|
unit: z.ZodOptional<z.ZodString>;
|
|
@@ -337,6 +340,11 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
337
340
|
redactedFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
338
341
|
sizeBytesApprox: z.ZodOptional<z.ZodNumber>;
|
|
339
342
|
}, z.core.$strip>>;
|
|
343
|
+
debug: z.ZodOptional<z.ZodObject<{
|
|
344
|
+
approxTokens: z.ZodOptional<z.ZodNumber>;
|
|
345
|
+
chars: z.ZodOptional<z.ZodNumber>;
|
|
346
|
+
bytes: z.ZodOptional<z.ZodNumber>;
|
|
347
|
+
}, z.core.$strip>>;
|
|
340
348
|
}, z.core.$strip>;
|
|
341
349
|
}, z.core.$strip>, z.ZodObject<{
|
|
342
350
|
schema: z.ZodLiteral<"handlebar.audit.v1">;
|
|
@@ -428,7 +436,7 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
428
436
|
}>>;
|
|
429
437
|
}, z.core.$strip>>;
|
|
430
438
|
kind: z.ZodLiteral<"message.raw.created">;
|
|
431
|
-
data: z.ZodObject<{
|
|
439
|
+
data: z.ZodIntersection<z.ZodObject<{
|
|
432
440
|
messageId: z.ZodUUID;
|
|
433
441
|
role: z.ZodEnum<{
|
|
434
442
|
system: "system";
|
|
@@ -452,6 +460,55 @@ export declare const AuditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
452
460
|
turnIndex: z.ZodOptional<z.ZodNumber>;
|
|
453
461
|
name: z.ZodOptional<z.ZodString>;
|
|
454
462
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
463
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
464
|
+
debug: z.ZodOptional<z.ZodObject<{
|
|
465
|
+
approxTokens: z.ZodOptional<z.ZodNumber>;
|
|
466
|
+
chars: z.ZodOptional<z.ZodNumber>;
|
|
467
|
+
}, z.core.$strip>>;
|
|
468
|
+
}, z.core.$strip>>;
|
|
469
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
470
|
+
schema: z.ZodLiteral<"handlebar.audit.v1">;
|
|
471
|
+
ts: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDate>;
|
|
472
|
+
runId: z.ZodString;
|
|
473
|
+
stepIndex: z.ZodOptional<z.ZodNumber>;
|
|
474
|
+
decisionId: z.ZodOptional<z.ZodString>;
|
|
475
|
+
enduserExternalId: z.ZodOptional<z.ZodString>;
|
|
476
|
+
otel: z.ZodOptional<z.ZodObject<{
|
|
477
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
478
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
479
|
+
}, z.core.$strip>>;
|
|
480
|
+
sample: z.ZodOptional<z.ZodObject<{
|
|
481
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
482
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
483
|
+
}, z.core.$strip>>;
|
|
484
|
+
redaction: z.ZodOptional<z.ZodObject<{
|
|
485
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
486
|
+
none: "none";
|
|
487
|
+
partial: "partial";
|
|
488
|
+
strict: "strict";
|
|
489
|
+
}>>;
|
|
490
|
+
}, z.core.$strip>>;
|
|
491
|
+
kind: z.ZodLiteral<"llm.result">;
|
|
492
|
+
data: z.ZodObject<{
|
|
493
|
+
model: z.ZodObject<{
|
|
494
|
+
name: z.ZodString;
|
|
495
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
496
|
+
}, z.core.$strip>;
|
|
497
|
+
tokens: z.ZodObject<{
|
|
498
|
+
in: z.ZodNumber;
|
|
499
|
+
out: z.ZodNumber;
|
|
500
|
+
}, z.core.$strip>;
|
|
501
|
+
debug: z.ZodOptional<z.ZodObject<{
|
|
502
|
+
inTokenAttribution: z.ZodRecord<z.ZodEnum<{
|
|
503
|
+
system: "system";
|
|
504
|
+
developer: "developer";
|
|
505
|
+
user: "user";
|
|
506
|
+
assistant: "assistant";
|
|
507
|
+
tool: "tool";
|
|
508
|
+
}> & z.core.$partial, z.ZodNumber>;
|
|
509
|
+
}, z.core.$strip>>;
|
|
510
|
+
messageCount: z.ZodNumber;
|
|
511
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
455
512
|
}, z.core.$strip>;
|
|
456
513
|
}, z.core.$strip>], "kind">;
|
|
457
514
|
export type AuditEvent = z.infer<typeof AuditEventSchema>;
|
|
@@ -74,7 +74,7 @@ export declare const MessageEventSchema: z.ZodObject<{
|
|
|
74
74
|
}>>;
|
|
75
75
|
}, z.core.$strip>>;
|
|
76
76
|
kind: z.ZodLiteral<"message.raw.created">;
|
|
77
|
-
data: z.ZodObject<{
|
|
77
|
+
data: z.ZodIntersection<z.ZodObject<{
|
|
78
78
|
messageId: z.ZodUUID;
|
|
79
79
|
role: z.ZodEnum<{
|
|
80
80
|
system: "system";
|
|
@@ -98,5 +98,55 @@ export declare const MessageEventSchema: z.ZodObject<{
|
|
|
98
98
|
turnIndex: z.ZodOptional<z.ZodNumber>;
|
|
99
99
|
name: z.ZodOptional<z.ZodString>;
|
|
100
100
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
101
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
102
|
+
debug: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
approxTokens: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
chars: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export declare const LLMResultEventSchema: z.ZodObject<{
|
|
109
|
+
schema: z.ZodLiteral<"handlebar.audit.v1">;
|
|
110
|
+
ts: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDate>;
|
|
111
|
+
runId: z.ZodString;
|
|
112
|
+
stepIndex: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
decisionId: z.ZodOptional<z.ZodString>;
|
|
114
|
+
enduserExternalId: z.ZodOptional<z.ZodString>;
|
|
115
|
+
otel: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
117
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
sample: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
redaction: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
none: "none";
|
|
126
|
+
partial: "partial";
|
|
127
|
+
strict: "strict";
|
|
128
|
+
}>>;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
kind: z.ZodLiteral<"llm.result">;
|
|
131
|
+
data: z.ZodObject<{
|
|
132
|
+
model: z.ZodObject<{
|
|
133
|
+
name: z.ZodString;
|
|
134
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
tokens: z.ZodObject<{
|
|
137
|
+
in: z.ZodNumber;
|
|
138
|
+
out: z.ZodNumber;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
debug: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
inTokenAttribution: z.ZodRecord<z.ZodEnum<{
|
|
142
|
+
system: "system";
|
|
143
|
+
developer: "developer";
|
|
144
|
+
user: "user";
|
|
145
|
+
assistant: "assistant";
|
|
146
|
+
tool: "tool";
|
|
147
|
+
}> & z.core.$partial, z.ZodNumber>;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
messageCount: z.ZodNumber;
|
|
150
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
101
151
|
}, z.core.$strip>;
|
|
102
152
|
}, z.core.$strip>;
|
|
@@ -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>;
|
|
@@ -158,5 +161,10 @@ export declare const ToolResultEventSchema: z.ZodObject<{
|
|
|
158
161
|
redactedFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
159
162
|
sizeBytesApprox: z.ZodOptional<z.ZodNumber>;
|
|
160
163
|
}, z.core.$strip>>;
|
|
164
|
+
debug: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
approxTokens: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
chars: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
bytes: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
}, z.core.$strip>>;
|
|
161
169
|
}, z.core.$strip>;
|
|
162
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/enduser.types.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const EndUserConfigSchema: z.ZodObject<{
|
|
3
3
|
externalId: z.ZodString;
|
|
4
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodString
|
|
4
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
5
5
|
name: z.ZodOptional<z.ZodString>;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
7
|
export declare const EndUserGroupConfigSchema: z.ZodObject<{
|
|
8
8
|
externalId: z.ZodString;
|
|
9
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodString
|
|
9
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
10
10
|
name: z.ZodOptional<z.ZodString>;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
12
|
export type EndUserConfig = z.infer<typeof EndUserConfigSchema>;
|
package/dist/index.js
CHANGED
|
@@ -13547,7 +13547,7 @@ var zod_default = exports_external;
|
|
|
13547
13547
|
// src/enduser.types.ts
|
|
13548
13548
|
var EndUserConfigSchema = exports_external.object({
|
|
13549
13549
|
externalId: exports_external.string(),
|
|
13550
|
-
metadata: exports_external.record(exports_external.string(), exports_external.string()),
|
|
13550
|
+
metadata: exports_external.record(exports_external.string(), exports_external.string()).optional(),
|
|
13551
13551
|
name: exports_external.string().optional()
|
|
13552
13552
|
});
|
|
13553
13553
|
var EndUserGroupConfigSchema = EndUserConfigSchema;
|
|
@@ -13611,7 +13611,30 @@ 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
|
|
13614
|
+
data: MessageSchema.and(exports_external.object({
|
|
13615
|
+
debug: exports_external.object({
|
|
13616
|
+
approxTokens: exports_external.number().min(0).optional(),
|
|
13617
|
+
chars: exports_external.number().min(0).optional()
|
|
13618
|
+
}).optional()
|
|
13619
|
+
}))
|
|
13620
|
+
});
|
|
13621
|
+
var LLMResultEventSchema = AuditEnvelopeSchema.extend({
|
|
13622
|
+
kind: exports_external.literal("llm.result"),
|
|
13623
|
+
data: exports_external.object({
|
|
13624
|
+
model: exports_external.object({
|
|
13625
|
+
name: exports_external.string(),
|
|
13626
|
+
provider: exports_external.string().optional()
|
|
13627
|
+
}),
|
|
13628
|
+
tokens: exports_external.object({
|
|
13629
|
+
in: exports_external.number().min(0),
|
|
13630
|
+
out: exports_external.number().min(0)
|
|
13631
|
+
}),
|
|
13632
|
+
debug: exports_external.object({
|
|
13633
|
+
inTokenAttribution: exports_external.partialRecord(MessageRoleSchema, exports_external.number().min(0))
|
|
13634
|
+
}).optional(),
|
|
13635
|
+
messageCount: exports_external.number().min(0),
|
|
13636
|
+
durationMs: exports_external.number().min(0).optional()
|
|
13637
|
+
})
|
|
13615
13638
|
});
|
|
13616
13639
|
|
|
13617
13640
|
// src/audit/governance-actions.ts
|
|
@@ -13642,7 +13665,10 @@ var InbuiltAgentMetricKind = exports_external.enum([
|
|
|
13642
13665
|
"bytes_out",
|
|
13643
13666
|
"duration_ms",
|
|
13644
13667
|
"records_in",
|
|
13645
|
-
"records_out"
|
|
13668
|
+
"records_out",
|
|
13669
|
+
"llm_tokens_in",
|
|
13670
|
+
"llm_tokens_out",
|
|
13671
|
+
"llm_cost_usd"
|
|
13646
13672
|
]);
|
|
13647
13673
|
var CustomAgentMetricKind = exports_external.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/);
|
|
13648
13674
|
var AgentMetricInfo = exports_external.object({
|
|
@@ -13706,7 +13732,12 @@ var ToolResultEventSchema = AuditEnvelopeSchema.extend({
|
|
|
13706
13732
|
message: zod_default.string().optional(),
|
|
13707
13733
|
stack: zod_default.string().optional()
|
|
13708
13734
|
}).optional(),
|
|
13709
|
-
resultMeta: ToolMetaSchema.optional()
|
|
13735
|
+
resultMeta: ToolMetaSchema.optional(),
|
|
13736
|
+
debug: zod_default.object({
|
|
13737
|
+
approxTokens: zod_default.number().min(0).optional(),
|
|
13738
|
+
chars: zod_default.number().min(0).optional(),
|
|
13739
|
+
bytes: zod_default.number().min(0).optional()
|
|
13740
|
+
}).optional()
|
|
13710
13741
|
})
|
|
13711
13742
|
});
|
|
13712
13743
|
|
|
@@ -13767,7 +13798,8 @@ var AuditEventSchema = exports_external.discriminatedUnion("kind", [
|
|
|
13767
13798
|
ToolResultEventSchema,
|
|
13768
13799
|
RunEndedEventSchema,
|
|
13769
13800
|
ErrorEventSchema,
|
|
13770
|
-
MessageEventSchema
|
|
13801
|
+
MessageEventSchema,
|
|
13802
|
+
LLMResultEventSchema
|
|
13771
13803
|
]);
|
|
13772
13804
|
// src/policies.ts
|
|
13773
13805
|
var AgentSelectorSchema = exports_external.object({
|
|
@@ -13921,6 +13953,29 @@ var ToolNameConditionSchema = exports_external.discriminatedUnion("op", [
|
|
|
13921
13953
|
value: exports_external.array(exports_external.string().min(1)).min(1)
|
|
13922
13954
|
}).strict()
|
|
13923
13955
|
]);
|
|
13956
|
+
var ToolArgConditionSchema = exports_external.discriminatedUnion("type", [
|
|
13957
|
+
exports_external.object({
|
|
13958
|
+
kind: exports_external.literal("toolArg"),
|
|
13959
|
+
type: exports_external.literal("string"),
|
|
13960
|
+
op: exports_external.enum(["eq", "neq", "contains", "startsWith", "endsWith", "in"]),
|
|
13961
|
+
path: exports_external.string().min(1).max(100),
|
|
13962
|
+
value: exports_external.string().min(1).max(1000)
|
|
13963
|
+
}),
|
|
13964
|
+
exports_external.object({
|
|
13965
|
+
kind: exports_external.literal("toolArg"),
|
|
13966
|
+
type: exports_external.literal("number"),
|
|
13967
|
+
op: exports_external.enum(["eq", "neq", "lt", "lte", "gt", "gte"]),
|
|
13968
|
+
path: exports_external.string().min(1).max(100),
|
|
13969
|
+
value: exports_external.number()
|
|
13970
|
+
}),
|
|
13971
|
+
exports_external.object({
|
|
13972
|
+
kind: exports_external.literal("toolArg"),
|
|
13973
|
+
type: exports_external.literal("boolean"),
|
|
13974
|
+
op: exports_external.literal("eq"),
|
|
13975
|
+
path: exports_external.string().min(1).max(100),
|
|
13976
|
+
value: exports_external.boolean()
|
|
13977
|
+
})
|
|
13978
|
+
]);
|
|
13924
13979
|
var ToolTagConditionSchema = exports_external.discriminatedUnion("op", [
|
|
13925
13980
|
exports_external.object({
|
|
13926
13981
|
kind: exports_external.literal("toolTag"),
|
|
@@ -13960,6 +14015,7 @@ var MaxCallsConditionSchema = exports_external.object({
|
|
|
13960
14015
|
var BaseRuleConditionSchema = exports_external.union([
|
|
13961
14016
|
ToolNameConditionSchema,
|
|
13962
14017
|
ToolTagConditionSchema,
|
|
14018
|
+
ToolArgConditionSchema,
|
|
13963
14019
|
EndUserTagConditionSchema,
|
|
13964
14020
|
ExecutionTimeConditionSchema,
|
|
13965
14021
|
SequenceConditionSchema,
|
|
@@ -14025,6 +14081,7 @@ export {
|
|
|
14025
14081
|
MessageRoleSchema,
|
|
14026
14082
|
MessageKindSchema,
|
|
14027
14083
|
MessageEventSchema,
|
|
14084
|
+
LLMResultEventSchema,
|
|
14028
14085
|
InbuiltAgentMetricKind,
|
|
14029
14086
|
HitlMetaSchema,
|
|
14030
14087
|
GovernanceDecisionSchema,
|
|
@@ -29,6 +29,38 @@ declare const AndConditionSchema: z.ZodObject<{
|
|
|
29
29
|
op: z.ZodLiteral<"allOf">;
|
|
30
30
|
tags: z.ZodArray<z.ZodString>;
|
|
31
31
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
32
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
33
|
+
type: z.ZodLiteral<"string">;
|
|
34
|
+
op: z.ZodEnum<{
|
|
35
|
+
in: "in";
|
|
36
|
+
eq: "eq";
|
|
37
|
+
neq: "neq";
|
|
38
|
+
contains: "contains";
|
|
39
|
+
startsWith: "startsWith";
|
|
40
|
+
endsWith: "endsWith";
|
|
41
|
+
}>;
|
|
42
|
+
path: z.ZodString;
|
|
43
|
+
value: z.ZodString;
|
|
44
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
46
|
+
type: z.ZodLiteral<"number">;
|
|
47
|
+
op: z.ZodEnum<{
|
|
48
|
+
gt: "gt";
|
|
49
|
+
gte: "gte";
|
|
50
|
+
lt: "lt";
|
|
51
|
+
lte: "lte";
|
|
52
|
+
eq: "eq";
|
|
53
|
+
neq: "neq";
|
|
54
|
+
}>;
|
|
55
|
+
path: z.ZodString;
|
|
56
|
+
value: z.ZodNumber;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
59
|
+
type: z.ZodLiteral<"boolean">;
|
|
60
|
+
op: z.ZodLiteral<"eq">;
|
|
61
|
+
path: z.ZodString;
|
|
62
|
+
value: z.ZodBoolean;
|
|
63
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
32
64
|
kind: z.ZodLiteral<"enduserTag">;
|
|
33
65
|
op: z.ZodLiteral<"has">;
|
|
34
66
|
tag: z.ZodString;
|
|
@@ -89,6 +121,9 @@ declare const AndConditionSchema: z.ZodObject<{
|
|
|
89
121
|
duration_ms: "duration_ms";
|
|
90
122
|
records_in: "records_in";
|
|
91
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";
|
|
92
127
|
}>;
|
|
93
128
|
}, z.core.$strict>, z.ZodObject<{
|
|
94
129
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -220,6 +255,38 @@ declare const OrConditionSchema: z.ZodObject<{
|
|
|
220
255
|
op: z.ZodLiteral<"allOf">;
|
|
221
256
|
tags: z.ZodArray<z.ZodString>;
|
|
222
257
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
258
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
259
|
+
type: z.ZodLiteral<"string">;
|
|
260
|
+
op: z.ZodEnum<{
|
|
261
|
+
in: "in";
|
|
262
|
+
eq: "eq";
|
|
263
|
+
neq: "neq";
|
|
264
|
+
contains: "contains";
|
|
265
|
+
startsWith: "startsWith";
|
|
266
|
+
endsWith: "endsWith";
|
|
267
|
+
}>;
|
|
268
|
+
path: z.ZodString;
|
|
269
|
+
value: z.ZodString;
|
|
270
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
271
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
272
|
+
type: z.ZodLiteral<"number">;
|
|
273
|
+
op: z.ZodEnum<{
|
|
274
|
+
gt: "gt";
|
|
275
|
+
gte: "gte";
|
|
276
|
+
lt: "lt";
|
|
277
|
+
lte: "lte";
|
|
278
|
+
eq: "eq";
|
|
279
|
+
neq: "neq";
|
|
280
|
+
}>;
|
|
281
|
+
path: z.ZodString;
|
|
282
|
+
value: z.ZodNumber;
|
|
283
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
284
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
285
|
+
type: z.ZodLiteral<"boolean">;
|
|
286
|
+
op: z.ZodLiteral<"eq">;
|
|
287
|
+
path: z.ZodString;
|
|
288
|
+
value: z.ZodBoolean;
|
|
289
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
223
290
|
kind: z.ZodLiteral<"enduserTag">;
|
|
224
291
|
op: z.ZodLiteral<"has">;
|
|
225
292
|
tag: z.ZodString;
|
|
@@ -280,6 +347,9 @@ declare const OrConditionSchema: z.ZodObject<{
|
|
|
280
347
|
duration_ms: "duration_ms";
|
|
281
348
|
records_in: "records_in";
|
|
282
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";
|
|
283
353
|
}>;
|
|
284
354
|
}, z.core.$strict>, z.ZodObject<{
|
|
285
355
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -411,6 +481,38 @@ declare const NotConditionSchema: z.ZodObject<{
|
|
|
411
481
|
op: z.ZodLiteral<"allOf">;
|
|
412
482
|
tags: z.ZodArray<z.ZodString>;
|
|
413
483
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
484
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
485
|
+
type: z.ZodLiteral<"string">;
|
|
486
|
+
op: z.ZodEnum<{
|
|
487
|
+
in: "in";
|
|
488
|
+
eq: "eq";
|
|
489
|
+
neq: "neq";
|
|
490
|
+
contains: "contains";
|
|
491
|
+
startsWith: "startsWith";
|
|
492
|
+
endsWith: "endsWith";
|
|
493
|
+
}>;
|
|
494
|
+
path: z.ZodString;
|
|
495
|
+
value: z.ZodString;
|
|
496
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
497
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
498
|
+
type: z.ZodLiteral<"number">;
|
|
499
|
+
op: z.ZodEnum<{
|
|
500
|
+
gt: "gt";
|
|
501
|
+
gte: "gte";
|
|
502
|
+
lt: "lt";
|
|
503
|
+
lte: "lte";
|
|
504
|
+
eq: "eq";
|
|
505
|
+
neq: "neq";
|
|
506
|
+
}>;
|
|
507
|
+
path: z.ZodString;
|
|
508
|
+
value: z.ZodNumber;
|
|
509
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
510
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
511
|
+
type: z.ZodLiteral<"boolean">;
|
|
512
|
+
op: z.ZodLiteral<"eq">;
|
|
513
|
+
path: z.ZodString;
|
|
514
|
+
value: z.ZodBoolean;
|
|
515
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
414
516
|
kind: z.ZodLiteral<"enduserTag">;
|
|
415
517
|
op: z.ZodLiteral<"has">;
|
|
416
518
|
tag: z.ZodString;
|
|
@@ -471,6 +573,9 @@ declare const NotConditionSchema: z.ZodObject<{
|
|
|
471
573
|
duration_ms: "duration_ms";
|
|
472
574
|
records_in: "records_in";
|
|
473
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";
|
|
474
579
|
}>;
|
|
475
580
|
}, z.core.$strict>, z.ZodObject<{
|
|
476
581
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -603,6 +708,38 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
|
|
|
603
708
|
op: z.ZodLiteral<"allOf">;
|
|
604
709
|
tags: z.ZodArray<z.ZodString>;
|
|
605
710
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
711
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
712
|
+
type: z.ZodLiteral<"string">;
|
|
713
|
+
op: z.ZodEnum<{
|
|
714
|
+
in: "in";
|
|
715
|
+
eq: "eq";
|
|
716
|
+
neq: "neq";
|
|
717
|
+
contains: "contains";
|
|
718
|
+
startsWith: "startsWith";
|
|
719
|
+
endsWith: "endsWith";
|
|
720
|
+
}>;
|
|
721
|
+
path: z.ZodString;
|
|
722
|
+
value: z.ZodString;
|
|
723
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
724
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
725
|
+
type: z.ZodLiteral<"number">;
|
|
726
|
+
op: z.ZodEnum<{
|
|
727
|
+
gt: "gt";
|
|
728
|
+
gte: "gte";
|
|
729
|
+
lt: "lt";
|
|
730
|
+
lte: "lte";
|
|
731
|
+
eq: "eq";
|
|
732
|
+
neq: "neq";
|
|
733
|
+
}>;
|
|
734
|
+
path: z.ZodString;
|
|
735
|
+
value: z.ZodNumber;
|
|
736
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
737
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
738
|
+
type: z.ZodLiteral<"boolean">;
|
|
739
|
+
op: z.ZodLiteral<"eq">;
|
|
740
|
+
path: z.ZodString;
|
|
741
|
+
value: z.ZodBoolean;
|
|
742
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
606
743
|
kind: z.ZodLiteral<"enduserTag">;
|
|
607
744
|
op: z.ZodLiteral<"has">;
|
|
608
745
|
tag: z.ZodString;
|
|
@@ -663,6 +800,9 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
|
|
|
663
800
|
duration_ms: "duration_ms";
|
|
664
801
|
records_in: "records_in";
|
|
665
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";
|
|
666
806
|
}>;
|
|
667
807
|
}, z.core.$strict>, z.ZodObject<{
|
|
668
808
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -792,6 +932,38 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
|
|
|
792
932
|
op: z.ZodLiteral<"allOf">;
|
|
793
933
|
tags: z.ZodArray<z.ZodString>;
|
|
794
934
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
935
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
936
|
+
type: z.ZodLiteral<"string">;
|
|
937
|
+
op: z.ZodEnum<{
|
|
938
|
+
in: "in";
|
|
939
|
+
eq: "eq";
|
|
940
|
+
neq: "neq";
|
|
941
|
+
contains: "contains";
|
|
942
|
+
startsWith: "startsWith";
|
|
943
|
+
endsWith: "endsWith";
|
|
944
|
+
}>;
|
|
945
|
+
path: z.ZodString;
|
|
946
|
+
value: z.ZodString;
|
|
947
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
948
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
949
|
+
type: z.ZodLiteral<"number">;
|
|
950
|
+
op: z.ZodEnum<{
|
|
951
|
+
gt: "gt";
|
|
952
|
+
gte: "gte";
|
|
953
|
+
lt: "lt";
|
|
954
|
+
lte: "lte";
|
|
955
|
+
eq: "eq";
|
|
956
|
+
neq: "neq";
|
|
957
|
+
}>;
|
|
958
|
+
path: z.ZodString;
|
|
959
|
+
value: z.ZodNumber;
|
|
960
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
961
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
962
|
+
type: z.ZodLiteral<"boolean">;
|
|
963
|
+
op: z.ZodLiteral<"eq">;
|
|
964
|
+
path: z.ZodString;
|
|
965
|
+
value: z.ZodBoolean;
|
|
966
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
795
967
|
kind: z.ZodLiteral<"enduserTag">;
|
|
796
968
|
op: z.ZodLiteral<"has">;
|
|
797
969
|
tag: z.ZodString;
|
|
@@ -852,6 +1024,9 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
|
|
|
852
1024
|
duration_ms: "duration_ms";
|
|
853
1025
|
records_in: "records_in";
|
|
854
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";
|
|
855
1030
|
}>;
|
|
856
1031
|
}, z.core.$strict>, z.ZodObject<{
|
|
857
1032
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -982,6 +1157,38 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
|
|
|
982
1157
|
op: z.ZodLiteral<"allOf">;
|
|
983
1158
|
tags: z.ZodArray<z.ZodString>;
|
|
984
1159
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1160
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1161
|
+
type: z.ZodLiteral<"string">;
|
|
1162
|
+
op: z.ZodEnum<{
|
|
1163
|
+
in: "in";
|
|
1164
|
+
eq: "eq";
|
|
1165
|
+
neq: "neq";
|
|
1166
|
+
contains: "contains";
|
|
1167
|
+
startsWith: "startsWith";
|
|
1168
|
+
endsWith: "endsWith";
|
|
1169
|
+
}>;
|
|
1170
|
+
path: z.ZodString;
|
|
1171
|
+
value: z.ZodString;
|
|
1172
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1173
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1174
|
+
type: z.ZodLiteral<"number">;
|
|
1175
|
+
op: z.ZodEnum<{
|
|
1176
|
+
gt: "gt";
|
|
1177
|
+
gte: "gte";
|
|
1178
|
+
lt: "lt";
|
|
1179
|
+
lte: "lte";
|
|
1180
|
+
eq: "eq";
|
|
1181
|
+
neq: "neq";
|
|
1182
|
+
}>;
|
|
1183
|
+
path: z.ZodString;
|
|
1184
|
+
value: z.ZodNumber;
|
|
1185
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1186
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1187
|
+
type: z.ZodLiteral<"boolean">;
|
|
1188
|
+
op: z.ZodLiteral<"eq">;
|
|
1189
|
+
path: z.ZodString;
|
|
1190
|
+
value: z.ZodBoolean;
|
|
1191
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
985
1192
|
kind: z.ZodLiteral<"enduserTag">;
|
|
986
1193
|
op: z.ZodLiteral<"has">;
|
|
987
1194
|
tag: z.ZodString;
|
|
@@ -1042,6 +1249,9 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
|
|
|
1042
1249
|
duration_ms: "duration_ms";
|
|
1043
1250
|
records_in: "records_in";
|
|
1044
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";
|
|
1045
1255
|
}>;
|
|
1046
1256
|
}, z.core.$strict>, z.ZodObject<{
|
|
1047
1257
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -1172,6 +1382,38 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
|
|
|
1172
1382
|
op: z.ZodLiteral<"allOf">;
|
|
1173
1383
|
tags: z.ZodArray<z.ZodString>;
|
|
1174
1384
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1385
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1386
|
+
type: z.ZodLiteral<"string">;
|
|
1387
|
+
op: z.ZodEnum<{
|
|
1388
|
+
in: "in";
|
|
1389
|
+
eq: "eq";
|
|
1390
|
+
neq: "neq";
|
|
1391
|
+
contains: "contains";
|
|
1392
|
+
startsWith: "startsWith";
|
|
1393
|
+
endsWith: "endsWith";
|
|
1394
|
+
}>;
|
|
1395
|
+
path: z.ZodString;
|
|
1396
|
+
value: z.ZodString;
|
|
1397
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1398
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1399
|
+
type: z.ZodLiteral<"number">;
|
|
1400
|
+
op: z.ZodEnum<{
|
|
1401
|
+
gt: "gt";
|
|
1402
|
+
gte: "gte";
|
|
1403
|
+
lt: "lt";
|
|
1404
|
+
lte: "lte";
|
|
1405
|
+
eq: "eq";
|
|
1406
|
+
neq: "neq";
|
|
1407
|
+
}>;
|
|
1408
|
+
path: z.ZodString;
|
|
1409
|
+
value: z.ZodNumber;
|
|
1410
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1411
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1412
|
+
type: z.ZodLiteral<"boolean">;
|
|
1413
|
+
op: z.ZodLiteral<"eq">;
|
|
1414
|
+
path: z.ZodString;
|
|
1415
|
+
value: z.ZodBoolean;
|
|
1416
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1175
1417
|
kind: z.ZodLiteral<"enduserTag">;
|
|
1176
1418
|
op: z.ZodLiteral<"has">;
|
|
1177
1419
|
tag: z.ZodString;
|
|
@@ -1232,6 +1474,9 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
|
|
|
1232
1474
|
duration_ms: "duration_ms";
|
|
1233
1475
|
records_in: "records_in";
|
|
1234
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";
|
|
1235
1480
|
}>;
|
|
1236
1481
|
}, z.core.$strict>, z.ZodObject<{
|
|
1237
1482
|
kind: z.ZodLiteral<"custom">;
|
package/dist/rules/metrics.d.ts
CHANGED
|
@@ -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">;
|
package/dist/rules/rule.d.ts
CHANGED
|
@@ -61,6 +61,38 @@ export declare const RuleSchema: z.ZodObject<{
|
|
|
61
61
|
op: z.ZodLiteral<"allOf">;
|
|
62
62
|
tags: z.ZodArray<z.ZodString>;
|
|
63
63
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
64
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
65
|
+
type: z.ZodLiteral<"string">;
|
|
66
|
+
op: z.ZodEnum<{
|
|
67
|
+
in: "in";
|
|
68
|
+
eq: "eq";
|
|
69
|
+
neq: "neq";
|
|
70
|
+
contains: "contains";
|
|
71
|
+
startsWith: "startsWith";
|
|
72
|
+
endsWith: "endsWith";
|
|
73
|
+
}>;
|
|
74
|
+
path: z.ZodString;
|
|
75
|
+
value: z.ZodString;
|
|
76
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
77
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
78
|
+
type: z.ZodLiteral<"number">;
|
|
79
|
+
op: z.ZodEnum<{
|
|
80
|
+
gt: "gt";
|
|
81
|
+
gte: "gte";
|
|
82
|
+
lt: "lt";
|
|
83
|
+
lte: "lte";
|
|
84
|
+
eq: "eq";
|
|
85
|
+
neq: "neq";
|
|
86
|
+
}>;
|
|
87
|
+
path: z.ZodString;
|
|
88
|
+
value: z.ZodNumber;
|
|
89
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
91
|
+
type: z.ZodLiteral<"boolean">;
|
|
92
|
+
op: z.ZodLiteral<"eq">;
|
|
93
|
+
path: z.ZodString;
|
|
94
|
+
value: z.ZodBoolean;
|
|
95
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
64
96
|
kind: z.ZodLiteral<"enduserTag">;
|
|
65
97
|
op: z.ZodLiteral<"has">;
|
|
66
98
|
tag: z.ZodString;
|
|
@@ -121,6 +153,9 @@ export declare const RuleSchema: z.ZodObject<{
|
|
|
121
153
|
duration_ms: "duration_ms";
|
|
122
154
|
records_in: "records_in";
|
|
123
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";
|
|
124
159
|
}>;
|
|
125
160
|
}, z.core.$strict>, z.ZodObject<{
|
|
126
161
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -250,6 +285,38 @@ export declare const RuleSchema: z.ZodObject<{
|
|
|
250
285
|
op: z.ZodLiteral<"allOf">;
|
|
251
286
|
tags: z.ZodArray<z.ZodString>;
|
|
252
287
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
288
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
289
|
+
type: z.ZodLiteral<"string">;
|
|
290
|
+
op: z.ZodEnum<{
|
|
291
|
+
in: "in";
|
|
292
|
+
eq: "eq";
|
|
293
|
+
neq: "neq";
|
|
294
|
+
contains: "contains";
|
|
295
|
+
startsWith: "startsWith";
|
|
296
|
+
endsWith: "endsWith";
|
|
297
|
+
}>;
|
|
298
|
+
path: z.ZodString;
|
|
299
|
+
value: z.ZodString;
|
|
300
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
301
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
302
|
+
type: z.ZodLiteral<"number">;
|
|
303
|
+
op: z.ZodEnum<{
|
|
304
|
+
gt: "gt";
|
|
305
|
+
gte: "gte";
|
|
306
|
+
lt: "lt";
|
|
307
|
+
lte: "lte";
|
|
308
|
+
eq: "eq";
|
|
309
|
+
neq: "neq";
|
|
310
|
+
}>;
|
|
311
|
+
path: z.ZodString;
|
|
312
|
+
value: z.ZodNumber;
|
|
313
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
314
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
315
|
+
type: z.ZodLiteral<"boolean">;
|
|
316
|
+
op: z.ZodLiteral<"eq">;
|
|
317
|
+
path: z.ZodString;
|
|
318
|
+
value: z.ZodBoolean;
|
|
319
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
253
320
|
kind: z.ZodLiteral<"enduserTag">;
|
|
254
321
|
op: z.ZodLiteral<"has">;
|
|
255
322
|
tag: z.ZodString;
|
|
@@ -310,6 +377,9 @@ export declare const RuleSchema: z.ZodObject<{
|
|
|
310
377
|
duration_ms: "duration_ms";
|
|
311
378
|
records_in: "records_in";
|
|
312
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";
|
|
313
383
|
}>;
|
|
314
384
|
}, z.core.$strict>, z.ZodObject<{
|
|
315
385
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -440,6 +510,38 @@ export declare const RuleSchema: z.ZodObject<{
|
|
|
440
510
|
op: z.ZodLiteral<"allOf">;
|
|
441
511
|
tags: z.ZodArray<z.ZodString>;
|
|
442
512
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
513
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
514
|
+
type: z.ZodLiteral<"string">;
|
|
515
|
+
op: z.ZodEnum<{
|
|
516
|
+
in: "in";
|
|
517
|
+
eq: "eq";
|
|
518
|
+
neq: "neq";
|
|
519
|
+
contains: "contains";
|
|
520
|
+
startsWith: "startsWith";
|
|
521
|
+
endsWith: "endsWith";
|
|
522
|
+
}>;
|
|
523
|
+
path: z.ZodString;
|
|
524
|
+
value: z.ZodString;
|
|
525
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
526
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
527
|
+
type: z.ZodLiteral<"number">;
|
|
528
|
+
op: z.ZodEnum<{
|
|
529
|
+
gt: "gt";
|
|
530
|
+
gte: "gte";
|
|
531
|
+
lt: "lt";
|
|
532
|
+
lte: "lte";
|
|
533
|
+
eq: "eq";
|
|
534
|
+
neq: "neq";
|
|
535
|
+
}>;
|
|
536
|
+
path: z.ZodString;
|
|
537
|
+
value: z.ZodNumber;
|
|
538
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
539
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
540
|
+
type: z.ZodLiteral<"boolean">;
|
|
541
|
+
op: z.ZodLiteral<"eq">;
|
|
542
|
+
path: z.ZodString;
|
|
543
|
+
value: z.ZodBoolean;
|
|
544
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
443
545
|
kind: z.ZodLiteral<"enduserTag">;
|
|
444
546
|
op: z.ZodLiteral<"has">;
|
|
445
547
|
tag: z.ZodString;
|
|
@@ -500,6 +602,9 @@ export declare const RuleSchema: z.ZodObject<{
|
|
|
500
602
|
duration_ms: "duration_ms";
|
|
501
603
|
records_in: "records_in";
|
|
502
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";
|
|
503
608
|
}>;
|
|
504
609
|
}, z.core.$strict>, z.ZodObject<{
|
|
505
610
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -630,6 +735,38 @@ export declare const RuleSchema: z.ZodObject<{
|
|
|
630
735
|
op: z.ZodLiteral<"allOf">;
|
|
631
736
|
tags: z.ZodArray<z.ZodString>;
|
|
632
737
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
738
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
739
|
+
type: z.ZodLiteral<"string">;
|
|
740
|
+
op: z.ZodEnum<{
|
|
741
|
+
in: "in";
|
|
742
|
+
eq: "eq";
|
|
743
|
+
neq: "neq";
|
|
744
|
+
contains: "contains";
|
|
745
|
+
startsWith: "startsWith";
|
|
746
|
+
endsWith: "endsWith";
|
|
747
|
+
}>;
|
|
748
|
+
path: z.ZodString;
|
|
749
|
+
value: z.ZodString;
|
|
750
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
751
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
752
|
+
type: z.ZodLiteral<"number">;
|
|
753
|
+
op: z.ZodEnum<{
|
|
754
|
+
gt: "gt";
|
|
755
|
+
gte: "gte";
|
|
756
|
+
lt: "lt";
|
|
757
|
+
lte: "lte";
|
|
758
|
+
eq: "eq";
|
|
759
|
+
neq: "neq";
|
|
760
|
+
}>;
|
|
761
|
+
path: z.ZodString;
|
|
762
|
+
value: z.ZodNumber;
|
|
763
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
764
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
765
|
+
type: z.ZodLiteral<"boolean">;
|
|
766
|
+
op: z.ZodLiteral<"eq">;
|
|
767
|
+
path: z.ZodString;
|
|
768
|
+
value: z.ZodBoolean;
|
|
769
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
633
770
|
kind: z.ZodLiteral<"enduserTag">;
|
|
634
771
|
op: z.ZodLiteral<"has">;
|
|
635
772
|
tag: z.ZodString;
|
|
@@ -690,6 +827,9 @@ export declare const RuleSchema: z.ZodObject<{
|
|
|
690
827
|
duration_ms: "duration_ms";
|
|
691
828
|
records_in: "records_in";
|
|
692
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";
|
|
693
833
|
}>;
|
|
694
834
|
}, z.core.$strict>, z.ZodObject<{
|
|
695
835
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -865,6 +1005,38 @@ export declare const RuleSpecSchema: z.ZodObject<{
|
|
|
865
1005
|
op: z.ZodLiteral<"allOf">;
|
|
866
1006
|
tags: z.ZodArray<z.ZodString>;
|
|
867
1007
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1008
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1009
|
+
type: z.ZodLiteral<"string">;
|
|
1010
|
+
op: z.ZodEnum<{
|
|
1011
|
+
in: "in";
|
|
1012
|
+
eq: "eq";
|
|
1013
|
+
neq: "neq";
|
|
1014
|
+
contains: "contains";
|
|
1015
|
+
startsWith: "startsWith";
|
|
1016
|
+
endsWith: "endsWith";
|
|
1017
|
+
}>;
|
|
1018
|
+
path: z.ZodString;
|
|
1019
|
+
value: z.ZodString;
|
|
1020
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1021
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1022
|
+
type: z.ZodLiteral<"number">;
|
|
1023
|
+
op: z.ZodEnum<{
|
|
1024
|
+
gt: "gt";
|
|
1025
|
+
gte: "gte";
|
|
1026
|
+
lt: "lt";
|
|
1027
|
+
lte: "lte";
|
|
1028
|
+
eq: "eq";
|
|
1029
|
+
neq: "neq";
|
|
1030
|
+
}>;
|
|
1031
|
+
path: z.ZodString;
|
|
1032
|
+
value: z.ZodNumber;
|
|
1033
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1034
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1035
|
+
type: z.ZodLiteral<"boolean">;
|
|
1036
|
+
op: z.ZodLiteral<"eq">;
|
|
1037
|
+
path: z.ZodString;
|
|
1038
|
+
value: z.ZodBoolean;
|
|
1039
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
868
1040
|
kind: z.ZodLiteral<"enduserTag">;
|
|
869
1041
|
op: z.ZodLiteral<"has">;
|
|
870
1042
|
tag: z.ZodString;
|
|
@@ -925,6 +1097,9 @@ export declare const RuleSpecSchema: z.ZodObject<{
|
|
|
925
1097
|
duration_ms: "duration_ms";
|
|
926
1098
|
records_in: "records_in";
|
|
927
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";
|
|
928
1103
|
}>;
|
|
929
1104
|
}, z.core.$strict>, z.ZodObject<{
|
|
930
1105
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -1054,6 +1229,38 @@ export declare const RuleSpecSchema: z.ZodObject<{
|
|
|
1054
1229
|
op: z.ZodLiteral<"allOf">;
|
|
1055
1230
|
tags: z.ZodArray<z.ZodString>;
|
|
1056
1231
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1232
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1233
|
+
type: z.ZodLiteral<"string">;
|
|
1234
|
+
op: z.ZodEnum<{
|
|
1235
|
+
in: "in";
|
|
1236
|
+
eq: "eq";
|
|
1237
|
+
neq: "neq";
|
|
1238
|
+
contains: "contains";
|
|
1239
|
+
startsWith: "startsWith";
|
|
1240
|
+
endsWith: "endsWith";
|
|
1241
|
+
}>;
|
|
1242
|
+
path: z.ZodString;
|
|
1243
|
+
value: z.ZodString;
|
|
1244
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1245
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1246
|
+
type: z.ZodLiteral<"number">;
|
|
1247
|
+
op: z.ZodEnum<{
|
|
1248
|
+
gt: "gt";
|
|
1249
|
+
gte: "gte";
|
|
1250
|
+
lt: "lt";
|
|
1251
|
+
lte: "lte";
|
|
1252
|
+
eq: "eq";
|
|
1253
|
+
neq: "neq";
|
|
1254
|
+
}>;
|
|
1255
|
+
path: z.ZodString;
|
|
1256
|
+
value: z.ZodNumber;
|
|
1257
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1258
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1259
|
+
type: z.ZodLiteral<"boolean">;
|
|
1260
|
+
op: z.ZodLiteral<"eq">;
|
|
1261
|
+
path: z.ZodString;
|
|
1262
|
+
value: z.ZodBoolean;
|
|
1263
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1057
1264
|
kind: z.ZodLiteral<"enduserTag">;
|
|
1058
1265
|
op: z.ZodLiteral<"has">;
|
|
1059
1266
|
tag: z.ZodString;
|
|
@@ -1114,6 +1321,9 @@ export declare const RuleSpecSchema: z.ZodObject<{
|
|
|
1114
1321
|
duration_ms: "duration_ms";
|
|
1115
1322
|
records_in: "records_in";
|
|
1116
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";
|
|
1117
1327
|
}>;
|
|
1118
1328
|
}, z.core.$strict>, z.ZodObject<{
|
|
1119
1329
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -1244,6 +1454,38 @@ export declare const RuleSpecSchema: z.ZodObject<{
|
|
|
1244
1454
|
op: z.ZodLiteral<"allOf">;
|
|
1245
1455
|
tags: z.ZodArray<z.ZodString>;
|
|
1246
1456
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1457
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1458
|
+
type: z.ZodLiteral<"string">;
|
|
1459
|
+
op: z.ZodEnum<{
|
|
1460
|
+
in: "in";
|
|
1461
|
+
eq: "eq";
|
|
1462
|
+
neq: "neq";
|
|
1463
|
+
contains: "contains";
|
|
1464
|
+
startsWith: "startsWith";
|
|
1465
|
+
endsWith: "endsWith";
|
|
1466
|
+
}>;
|
|
1467
|
+
path: z.ZodString;
|
|
1468
|
+
value: z.ZodString;
|
|
1469
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1470
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1471
|
+
type: z.ZodLiteral<"number">;
|
|
1472
|
+
op: z.ZodEnum<{
|
|
1473
|
+
gt: "gt";
|
|
1474
|
+
gte: "gte";
|
|
1475
|
+
lt: "lt";
|
|
1476
|
+
lte: "lte";
|
|
1477
|
+
eq: "eq";
|
|
1478
|
+
neq: "neq";
|
|
1479
|
+
}>;
|
|
1480
|
+
path: z.ZodString;
|
|
1481
|
+
value: z.ZodNumber;
|
|
1482
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1483
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1484
|
+
type: z.ZodLiteral<"boolean">;
|
|
1485
|
+
op: z.ZodLiteral<"eq">;
|
|
1486
|
+
path: z.ZodString;
|
|
1487
|
+
value: z.ZodBoolean;
|
|
1488
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1247
1489
|
kind: z.ZodLiteral<"enduserTag">;
|
|
1248
1490
|
op: z.ZodLiteral<"has">;
|
|
1249
1491
|
tag: z.ZodString;
|
|
@@ -1304,6 +1546,9 @@ export declare const RuleSpecSchema: z.ZodObject<{
|
|
|
1304
1546
|
duration_ms: "duration_ms";
|
|
1305
1547
|
records_in: "records_in";
|
|
1306
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";
|
|
1307
1552
|
}>;
|
|
1308
1553
|
}, z.core.$strict>, z.ZodObject<{
|
|
1309
1554
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -1434,6 +1679,38 @@ export declare const RuleSpecSchema: z.ZodObject<{
|
|
|
1434
1679
|
op: z.ZodLiteral<"allOf">;
|
|
1435
1680
|
tags: z.ZodArray<z.ZodString>;
|
|
1436
1681
|
}, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1682
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1683
|
+
type: z.ZodLiteral<"string">;
|
|
1684
|
+
op: z.ZodEnum<{
|
|
1685
|
+
in: "in";
|
|
1686
|
+
eq: "eq";
|
|
1687
|
+
neq: "neq";
|
|
1688
|
+
contains: "contains";
|
|
1689
|
+
startsWith: "startsWith";
|
|
1690
|
+
endsWith: "endsWith";
|
|
1691
|
+
}>;
|
|
1692
|
+
path: z.ZodString;
|
|
1693
|
+
value: z.ZodString;
|
|
1694
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1695
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1696
|
+
type: z.ZodLiteral<"number">;
|
|
1697
|
+
op: z.ZodEnum<{
|
|
1698
|
+
gt: "gt";
|
|
1699
|
+
gte: "gte";
|
|
1700
|
+
lt: "lt";
|
|
1701
|
+
lte: "lte";
|
|
1702
|
+
eq: "eq";
|
|
1703
|
+
neq: "neq";
|
|
1704
|
+
}>;
|
|
1705
|
+
path: z.ZodString;
|
|
1706
|
+
value: z.ZodNumber;
|
|
1707
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1708
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
1709
|
+
type: z.ZodLiteral<"boolean">;
|
|
1710
|
+
op: z.ZodLiteral<"eq">;
|
|
1711
|
+
path: z.ZodString;
|
|
1712
|
+
value: z.ZodBoolean;
|
|
1713
|
+
}, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1437
1714
|
kind: z.ZodLiteral<"enduserTag">;
|
|
1438
1715
|
op: z.ZodLiteral<"has">;
|
|
1439
1716
|
tag: z.ZodString;
|
|
@@ -1494,6 +1771,9 @@ export declare const RuleSpecSchema: z.ZodObject<{
|
|
|
1494
1771
|
duration_ms: "duration_ms";
|
|
1495
1772
|
records_in: "records_in";
|
|
1496
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";
|
|
1497
1777
|
}>;
|
|
1498
1778
|
}, z.core.$strict>, z.ZodObject<{
|
|
1499
1779
|
kind: z.ZodLiteral<"custom">;
|
package/dist/rules/tools.d.ts
CHANGED
|
@@ -16,6 +16,40 @@ export declare const ToolNameConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
16
16
|
value: z.ZodArray<z.ZodString>;
|
|
17
17
|
}, z.core.$strict>], "op">;
|
|
18
18
|
export type ToolNameCondition = z.infer<typeof ToolNameConditionSchema>;
|
|
19
|
+
export declare const ToolArgConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
21
|
+
type: z.ZodLiteral<"string">;
|
|
22
|
+
op: z.ZodEnum<{
|
|
23
|
+
in: "in";
|
|
24
|
+
eq: "eq";
|
|
25
|
+
neq: "neq";
|
|
26
|
+
contains: "contains";
|
|
27
|
+
startsWith: "startsWith";
|
|
28
|
+
endsWith: "endsWith";
|
|
29
|
+
}>;
|
|
30
|
+
path: z.ZodString;
|
|
31
|
+
value: z.ZodString;
|
|
32
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
34
|
+
type: z.ZodLiteral<"number">;
|
|
35
|
+
op: z.ZodEnum<{
|
|
36
|
+
gt: "gt";
|
|
37
|
+
gte: "gte";
|
|
38
|
+
lt: "lt";
|
|
39
|
+
lte: "lte";
|
|
40
|
+
eq: "eq";
|
|
41
|
+
neq: "neq";
|
|
42
|
+
}>;
|
|
43
|
+
path: z.ZodString;
|
|
44
|
+
value: z.ZodNumber;
|
|
45
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
46
|
+
kind: z.ZodLiteral<"toolArg">;
|
|
47
|
+
type: z.ZodLiteral<"boolean">;
|
|
48
|
+
op: z.ZodLiteral<"eq">;
|
|
49
|
+
path: z.ZodString;
|
|
50
|
+
value: z.ZodBoolean;
|
|
51
|
+
}, z.core.$strip>], "type">;
|
|
52
|
+
export type ToolArgCondition = z.infer<typeof ToolArgConditionSchema>;
|
|
19
53
|
export declare const ToolTagConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
54
|
kind: z.ZodLiteral<"toolTag">;
|
|
21
55
|
op: z.ZodLiteral<"has">;
|