agent-afk 5.322.19 → 5.323.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/dist/agent/outcomes/schema.d.ts +1 -1
- package/dist/agent/risk-classifier.d.ts +3 -0
- package/dist/agent/trace/events.d.ts +68 -14
- package/dist/agent/trace/events.subagent-lifecycle.d.ts +3 -3
- package/dist/agent/trace/types.d.ts +1 -0
- package/dist/cli.mjs +428 -415
- package/dist/improve/schemas.d.ts +2 -2
- package/dist/index.mjs +199 -199
- package/dist/insights/aggregators/guardrail-false-positives.d.ts +12 -0
- package/dist/insights/aggregators/index.d.ts +2 -1
- package/dist/insights/html.guardrail-false-positives.d.ts +2 -0
- package/dist/insights/index.d.ts +2 -0
- package/dist/insights/types.d.ts +1 -0
- package/dist/telegram.mjs +215 -215
- package/package.json +4 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export type RiskLevel = 'safe' | 'medium' | 'high';
|
|
2
|
+
export declare const RISK_CATEGORIES: readonly ["read-only", "bash-destructive", "bash-mutating", "bash-background", "workspace-write", "credential-path", "workspace-escape", "network-mutation", "schedule-mutation", "mcp-destructive", "mcp-unknown", "worktree-mutation", "browser-action", "remote-exec", "outbound-message", "unknown"];
|
|
3
|
+
export type RiskCategory = (typeof RISK_CATEGORIES)[number];
|
|
2
4
|
export interface RiskVerdict {
|
|
3
5
|
level: RiskLevel;
|
|
4
6
|
reason?: string;
|
|
7
|
+
category: RiskCategory;
|
|
5
8
|
}
|
|
6
9
|
export interface RiskContext {
|
|
7
10
|
cwd: string;
|
|
@@ -26,9 +26,9 @@ export declare const ToolCallCompletedPayloadSchema: z.ZodObject<{
|
|
|
26
26
|
circuitBreaker: z.ZodOptional<z.ZodBoolean>;
|
|
27
27
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
28
28
|
abort: "abort";
|
|
29
|
-
budget: "budget";
|
|
30
29
|
"policy-refusal": "policy-refusal";
|
|
31
30
|
timeout: "timeout";
|
|
31
|
+
budget: "budget";
|
|
32
32
|
"permission-denied": "permission-denied";
|
|
33
33
|
"hook-block": "hook-block";
|
|
34
34
|
"elicitation-declined": "elicitation-declined";
|
|
@@ -64,9 +64,9 @@ export declare const ToolCallPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
64
64
|
circuitBreaker: z.ZodOptional<z.ZodBoolean>;
|
|
65
65
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
66
66
|
abort: "abort";
|
|
67
|
-
budget: "budget";
|
|
68
67
|
"policy-refusal": "policy-refusal";
|
|
69
68
|
timeout: "timeout";
|
|
69
|
+
budget: "budget";
|
|
70
70
|
"permission-denied": "permission-denied";
|
|
71
71
|
"hook-block": "hook-block";
|
|
72
72
|
"elicitation-declined": "elicitation-declined";
|
|
@@ -118,6 +118,24 @@ export declare const HookDecisionPayloadSchema: z.ZodObject<{
|
|
|
118
118
|
unrecognised: "unrecognised";
|
|
119
119
|
"hard-block": "hard-block";
|
|
120
120
|
}>>;
|
|
121
|
+
riskCategory: z.ZodOptional<z.ZodEnum<{
|
|
122
|
+
unknown: "unknown";
|
|
123
|
+
"read-only": "read-only";
|
|
124
|
+
"bash-destructive": "bash-destructive";
|
|
125
|
+
"bash-mutating": "bash-mutating";
|
|
126
|
+
"bash-background": "bash-background";
|
|
127
|
+
"workspace-write": "workspace-write";
|
|
128
|
+
"credential-path": "credential-path";
|
|
129
|
+
"workspace-escape": "workspace-escape";
|
|
130
|
+
"network-mutation": "network-mutation";
|
|
131
|
+
"schedule-mutation": "schedule-mutation";
|
|
132
|
+
"mcp-destructive": "mcp-destructive";
|
|
133
|
+
"mcp-unknown": "mcp-unknown";
|
|
134
|
+
"worktree-mutation": "worktree-mutation";
|
|
135
|
+
"browser-action": "browser-action";
|
|
136
|
+
"remote-exec": "remote-exec";
|
|
137
|
+
"outbound-message": "outbound-message";
|
|
138
|
+
}>>;
|
|
121
139
|
}, z.core.$strip>;
|
|
122
140
|
export declare const HookSummaryPayloadSchema: z.ZodObject<{
|
|
123
141
|
scope: z.ZodLiteral<"root-session-including-subagents">;
|
|
@@ -181,16 +199,16 @@ export declare const BudgetPayloadSchema: z.ZodObject<{
|
|
|
181
199
|
}, z.core.$strip>;
|
|
182
200
|
export declare const AbortOriginSchema: z.ZodEnum<{
|
|
183
201
|
cascade: "cascade";
|
|
184
|
-
budget: "budget";
|
|
185
202
|
timeout: "timeout";
|
|
203
|
+
budget: "budget";
|
|
186
204
|
user_signal: "user_signal";
|
|
187
205
|
hook_block: "hook_block";
|
|
188
206
|
}>;
|
|
189
207
|
export declare const AbortPayloadSchema: z.ZodObject<{
|
|
190
208
|
origin: z.ZodEnum<{
|
|
191
209
|
cascade: "cascade";
|
|
192
|
-
budget: "budget";
|
|
193
210
|
timeout: "timeout";
|
|
211
|
+
budget: "budget";
|
|
194
212
|
user_signal: "user_signal";
|
|
195
213
|
hook_block: "hook_block";
|
|
196
214
|
}>;
|
|
@@ -200,8 +218,8 @@ export declare const AbortPayloadSchema: z.ZodObject<{
|
|
|
200
218
|
export declare const ClosureReasonSchema: z.ZodEnum<{
|
|
201
219
|
abort: "abort";
|
|
202
220
|
timeout: "timeout";
|
|
203
|
-
model_end_turn: "model_end_turn";
|
|
204
221
|
truncated: "truncated";
|
|
222
|
+
model_end_turn: "model_end_turn";
|
|
205
223
|
iteration_cap: "iteration_cap";
|
|
206
224
|
budget_exceeded: "budget_exceeded";
|
|
207
225
|
hook_blocked: "hook_blocked";
|
|
@@ -211,8 +229,8 @@ export declare const ClosurePayloadSchema: z.ZodObject<{
|
|
|
211
229
|
reason: z.ZodEnum<{
|
|
212
230
|
abort: "abort";
|
|
213
231
|
timeout: "timeout";
|
|
214
|
-
model_end_turn: "model_end_turn";
|
|
215
232
|
truncated: "truncated";
|
|
233
|
+
model_end_turn: "model_end_turn";
|
|
216
234
|
iteration_cap: "iteration_cap";
|
|
217
235
|
budget_exceeded: "budget_exceeded";
|
|
218
236
|
hook_blocked: "hook_blocked";
|
|
@@ -331,9 +349,9 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
331
349
|
circuitBreaker: z.ZodOptional<z.ZodBoolean>;
|
|
332
350
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
333
351
|
abort: "abort";
|
|
334
|
-
budget: "budget";
|
|
335
352
|
"policy-refusal": "policy-refusal";
|
|
336
353
|
timeout: "timeout";
|
|
354
|
+
budget: "budget";
|
|
337
355
|
"permission-denied": "permission-denied";
|
|
338
356
|
"hook-block": "hook-block";
|
|
339
357
|
"elicitation-declined": "elicitation-declined";
|
|
@@ -377,6 +395,24 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
377
395
|
unrecognised: "unrecognised";
|
|
378
396
|
"hard-block": "hard-block";
|
|
379
397
|
}>>;
|
|
398
|
+
riskCategory: z.ZodOptional<z.ZodEnum<{
|
|
399
|
+
unknown: "unknown";
|
|
400
|
+
"read-only": "read-only";
|
|
401
|
+
"bash-destructive": "bash-destructive";
|
|
402
|
+
"bash-mutating": "bash-mutating";
|
|
403
|
+
"bash-background": "bash-background";
|
|
404
|
+
"workspace-write": "workspace-write";
|
|
405
|
+
"credential-path": "credential-path";
|
|
406
|
+
"workspace-escape": "workspace-escape";
|
|
407
|
+
"network-mutation": "network-mutation";
|
|
408
|
+
"schedule-mutation": "schedule-mutation";
|
|
409
|
+
"mcp-destructive": "mcp-destructive";
|
|
410
|
+
"mcp-unknown": "mcp-unknown";
|
|
411
|
+
"worktree-mutation": "worktree-mutation";
|
|
412
|
+
"browser-action": "browser-action";
|
|
413
|
+
"remote-exec": "remote-exec";
|
|
414
|
+
"outbound-message": "outbound-message";
|
|
415
|
+
}>>;
|
|
380
416
|
}, z.core.$strip>;
|
|
381
417
|
}, z.core.$strip>, z.ZodObject<{
|
|
382
418
|
kind: z.ZodLiteral<"hook_summary">;
|
|
@@ -429,9 +465,9 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
429
465
|
partialOutputBytes: z.ZodNumber;
|
|
430
466
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
431
467
|
abort: "abort";
|
|
432
|
-
budget: "budget";
|
|
433
468
|
"policy-refusal": "policy-refusal";
|
|
434
469
|
timeout: "timeout";
|
|
470
|
+
budget: "budget";
|
|
435
471
|
"permission-denied": "permission-denied";
|
|
436
472
|
"hook-block": "hook-block";
|
|
437
473
|
"elicitation-declined": "elicitation-declined";
|
|
@@ -520,8 +556,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
520
556
|
payload: z.ZodObject<{
|
|
521
557
|
origin: z.ZodEnum<{
|
|
522
558
|
cascade: "cascade";
|
|
523
|
-
budget: "budget";
|
|
524
559
|
timeout: "timeout";
|
|
560
|
+
budget: "budget";
|
|
525
561
|
user_signal: "user_signal";
|
|
526
562
|
hook_block: "hook_block";
|
|
527
563
|
}>;
|
|
@@ -554,8 +590,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
554
590
|
reason: z.ZodEnum<{
|
|
555
591
|
abort: "abort";
|
|
556
592
|
timeout: "timeout";
|
|
557
|
-
model_end_turn: "model_end_turn";
|
|
558
593
|
truncated: "truncated";
|
|
594
|
+
model_end_turn: "model_end_turn";
|
|
559
595
|
iteration_cap: "iteration_cap";
|
|
560
596
|
budget_exceeded: "budget_exceeded";
|
|
561
597
|
hook_blocked: "hook_blocked";
|
|
@@ -761,9 +797,9 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
761
797
|
circuitBreaker: z.ZodOptional<z.ZodBoolean>;
|
|
762
798
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
763
799
|
abort: "abort";
|
|
764
|
-
budget: "budget";
|
|
765
800
|
"policy-refusal": "policy-refusal";
|
|
766
801
|
timeout: "timeout";
|
|
802
|
+
budget: "budget";
|
|
767
803
|
"permission-denied": "permission-denied";
|
|
768
804
|
"hook-block": "hook-block";
|
|
769
805
|
"elicitation-declined": "elicitation-declined";
|
|
@@ -809,6 +845,24 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
809
845
|
unrecognised: "unrecognised";
|
|
810
846
|
"hard-block": "hard-block";
|
|
811
847
|
}>>;
|
|
848
|
+
riskCategory: z.ZodOptional<z.ZodEnum<{
|
|
849
|
+
unknown: "unknown";
|
|
850
|
+
"read-only": "read-only";
|
|
851
|
+
"bash-destructive": "bash-destructive";
|
|
852
|
+
"bash-mutating": "bash-mutating";
|
|
853
|
+
"bash-background": "bash-background";
|
|
854
|
+
"workspace-write": "workspace-write";
|
|
855
|
+
"credential-path": "credential-path";
|
|
856
|
+
"workspace-escape": "workspace-escape";
|
|
857
|
+
"network-mutation": "network-mutation";
|
|
858
|
+
"schedule-mutation": "schedule-mutation";
|
|
859
|
+
"mcp-destructive": "mcp-destructive";
|
|
860
|
+
"mcp-unknown": "mcp-unknown";
|
|
861
|
+
"worktree-mutation": "worktree-mutation";
|
|
862
|
+
"browser-action": "browser-action";
|
|
863
|
+
"remote-exec": "remote-exec";
|
|
864
|
+
"outbound-message": "outbound-message";
|
|
865
|
+
}>>;
|
|
812
866
|
}, z.core.$strip>;
|
|
813
867
|
}, z.core.$strip>, z.ZodObject<{
|
|
814
868
|
ts: z.ZodString;
|
|
@@ -865,9 +919,9 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
865
919
|
partialOutputBytes: z.ZodNumber;
|
|
866
920
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
867
921
|
abort: "abort";
|
|
868
|
-
budget: "budget";
|
|
869
922
|
"policy-refusal": "policy-refusal";
|
|
870
923
|
timeout: "timeout";
|
|
924
|
+
budget: "budget";
|
|
871
925
|
"permission-denied": "permission-denied";
|
|
872
926
|
"hook-block": "hook-block";
|
|
873
927
|
"elicitation-declined": "elicitation-declined";
|
|
@@ -962,8 +1016,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
962
1016
|
payload: z.ZodObject<{
|
|
963
1017
|
origin: z.ZodEnum<{
|
|
964
1018
|
cascade: "cascade";
|
|
965
|
-
budget: "budget";
|
|
966
1019
|
timeout: "timeout";
|
|
1020
|
+
budget: "budget";
|
|
967
1021
|
user_signal: "user_signal";
|
|
968
1022
|
hook_block: "hook_block";
|
|
969
1023
|
}>;
|
|
@@ -1004,8 +1058,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1004
1058
|
reason: z.ZodEnum<{
|
|
1005
1059
|
abort: "abort";
|
|
1006
1060
|
timeout: "timeout";
|
|
1007
|
-
model_end_turn: "model_end_turn";
|
|
1008
1061
|
truncated: "truncated";
|
|
1062
|
+
model_end_turn: "model_end_turn";
|
|
1009
1063
|
iteration_cap: "iteration_cap";
|
|
1010
1064
|
budget_exceeded: "budget_exceeded";
|
|
1011
1065
|
hook_blocked: "hook_blocked";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const ToolFailureClassSchema: z.ZodEnum<{
|
|
3
3
|
abort: "abort";
|
|
4
|
-
budget: "budget";
|
|
5
4
|
"policy-refusal": "policy-refusal";
|
|
6
5
|
timeout: "timeout";
|
|
6
|
+
budget: "budget";
|
|
7
7
|
"permission-denied": "permission-denied";
|
|
8
8
|
"hook-block": "hook-block";
|
|
9
9
|
"elicitation-declined": "elicitation-declined";
|
|
@@ -56,9 +56,9 @@ export declare const SubagentFailedPayloadSchema: z.ZodObject<{
|
|
|
56
56
|
partialOutputBytes: z.ZodNumber;
|
|
57
57
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
58
58
|
abort: "abort";
|
|
59
|
-
budget: "budget";
|
|
60
59
|
"policy-refusal": "policy-refusal";
|
|
61
60
|
timeout: "timeout";
|
|
61
|
+
budget: "budget";
|
|
62
62
|
"permission-denied": "permission-denied";
|
|
63
63
|
"hook-block": "hook-block";
|
|
64
64
|
"elicitation-declined": "elicitation-declined";
|
|
@@ -126,9 +126,9 @@ export declare const SubagentLifecyclePayloadSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
126
126
|
partialOutputBytes: z.ZodNumber;
|
|
127
127
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
128
128
|
abort: "abort";
|
|
129
|
-
budget: "budget";
|
|
130
129
|
"policy-refusal": "policy-refusal";
|
|
131
130
|
timeout: "timeout";
|
|
131
|
+
budget: "budget";
|
|
132
132
|
"permission-denied": "permission-denied";
|
|
133
133
|
"hook-block": "hook-block";
|
|
134
134
|
"elicitation-declined": "elicitation-declined";
|
|
@@ -41,6 +41,7 @@ export interface HookDecisionPayload {
|
|
|
41
41
|
injectedContextBytes?: number;
|
|
42
42
|
durationMs?: number;
|
|
43
43
|
approvalOutcome?: AfkApprovalOutcome;
|
|
44
|
+
riskCategory?: import('../risk-classifier.js').RiskCategory;
|
|
44
45
|
}
|
|
45
46
|
export interface HookSummaryPayload {
|
|
46
47
|
scope: 'root-session-including-subagents';
|