agent-afk 5.51.0 → 5.51.1
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/default-hook-registry.d.ts +1 -0
- package/dist/agent/subagent.d.ts +2 -0
- package/dist/agent/trace/events.d.ts +51 -0
- package/dist/agent/trace/types.d.ts +5 -1
- package/dist/cli.mjs +432 -432
- package/dist/config/env.d.ts +1 -0
- package/dist/index.mjs +148 -148
- package/dist/telegram/afk-hook-bundle.d.ts +11 -0
- package/dist/telegram/handlers/afk.d.ts +5 -0
- package/dist/telegram/watch.d.ts +2 -1
- package/dist/telegram.mjs +217 -217
- package/package.json +2 -1
package/dist/agent/subagent.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export type { SubagentStatus, SubagentResult, SubagentTrace, SubagentHandle };
|
|
|
14
14
|
export declare const DENY_ELICITATION: NonNullable<AgentConfig['onElicitation']>;
|
|
15
15
|
export declare const SUBAGENT_DEFAULT_MAX_TOOL_USE_ITERATIONS = 50;
|
|
16
16
|
export declare const SUBAGENT_DEFAULT_TIMEOUT_MS: number;
|
|
17
|
+
export declare function resolveSubagentTimeoutMs(): number;
|
|
17
18
|
export declare const SUBAGENT_BACKGROUND_TIMEOUT_MS: number;
|
|
18
19
|
export interface ForkParent {
|
|
19
20
|
sessionId?: string;
|
|
@@ -26,6 +27,7 @@ export interface ForkSubagentOptions<T = unknown> {
|
|
|
26
27
|
outputSchema?: ZodType<T>;
|
|
27
28
|
agentType: string;
|
|
28
29
|
parentId?: string;
|
|
30
|
+
promptHead?: string;
|
|
29
31
|
denyElicitations?: boolean;
|
|
30
32
|
phaseRole?: PhaseRole;
|
|
31
33
|
}
|
|
@@ -96,6 +96,7 @@ export declare const HookDecisionPayloadSchema: z.ZodObject<{
|
|
|
96
96
|
unrecognised: "unrecognised";
|
|
97
97
|
decline: "decline";
|
|
98
98
|
cancel: "cancel";
|
|
99
|
+
"hard-block": "hard-block";
|
|
99
100
|
}>>;
|
|
100
101
|
}, z.core.$strip>;
|
|
101
102
|
export declare const SubagentStartedPayloadSchema: z.ZodObject<{
|
|
@@ -105,6 +106,8 @@ export declare const SubagentStartedPayloadSchema: z.ZodObject<{
|
|
|
105
106
|
model: z.ZodString;
|
|
106
107
|
allowedTools: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
107
108
|
systemPromptHash: z.ZodOptional<z.ZodString>;
|
|
109
|
+
promptHead: z.ZodOptional<z.ZodString>;
|
|
110
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
108
111
|
}, z.core.$strip>;
|
|
109
112
|
export declare const SubagentSucceededPayloadSchema: z.ZodObject<{
|
|
110
113
|
transition: z.ZodLiteral<"succeeded">;
|
|
@@ -121,6 +124,15 @@ export declare const SubagentFailedPayloadSchema: z.ZodObject<{
|
|
|
121
124
|
errorClass: z.ZodString;
|
|
122
125
|
errorMessage: z.ZodString;
|
|
123
126
|
partialOutputBytes: z.ZodNumber;
|
|
127
|
+
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
abort: "abort";
|
|
129
|
+
"policy-refusal": "policy-refusal";
|
|
130
|
+
timeout: "timeout";
|
|
131
|
+
"permission-denied": "permission-denied";
|
|
132
|
+
"hook-block": "hook-block";
|
|
133
|
+
"elicitation-declined": "elicitation-declined";
|
|
134
|
+
"denial-breaker": "denial-breaker";
|
|
135
|
+
}>>;
|
|
124
136
|
}, z.core.$strip>;
|
|
125
137
|
export declare const SubagentCancelledPayloadSchema: z.ZodObject<{
|
|
126
138
|
transition: z.ZodLiteral<"cancelled">;
|
|
@@ -129,6 +141,7 @@ export declare const SubagentCancelledPayloadSchema: z.ZodObject<{
|
|
|
129
141
|
cascade: "cascade";
|
|
130
142
|
explicit: "explicit";
|
|
131
143
|
}>;
|
|
144
|
+
timeout: z.ZodOptional<z.ZodBoolean>;
|
|
132
145
|
}, z.core.$strip>;
|
|
133
146
|
export declare const SubagentLifecyclePayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
134
147
|
transition: z.ZodLiteral<"started">;
|
|
@@ -137,6 +150,8 @@ export declare const SubagentLifecyclePayloadSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
137
150
|
model: z.ZodString;
|
|
138
151
|
allowedTools: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
139
152
|
systemPromptHash: z.ZodOptional<z.ZodString>;
|
|
153
|
+
promptHead: z.ZodOptional<z.ZodString>;
|
|
154
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
140
155
|
}, z.core.$strip>, z.ZodObject<{
|
|
141
156
|
transition: z.ZodLiteral<"succeeded">;
|
|
142
157
|
subagentId: z.ZodString;
|
|
@@ -151,6 +166,15 @@ export declare const SubagentLifecyclePayloadSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
151
166
|
errorClass: z.ZodString;
|
|
152
167
|
errorMessage: z.ZodString;
|
|
153
168
|
partialOutputBytes: z.ZodNumber;
|
|
169
|
+
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
170
|
+
abort: "abort";
|
|
171
|
+
"policy-refusal": "policy-refusal";
|
|
172
|
+
timeout: "timeout";
|
|
173
|
+
"permission-denied": "permission-denied";
|
|
174
|
+
"hook-block": "hook-block";
|
|
175
|
+
"elicitation-declined": "elicitation-declined";
|
|
176
|
+
"denial-breaker": "denial-breaker";
|
|
177
|
+
}>>;
|
|
154
178
|
}, z.core.$strip>, z.ZodObject<{
|
|
155
179
|
transition: z.ZodLiteral<"cancelled">;
|
|
156
180
|
subagentId: z.ZodString;
|
|
@@ -158,6 +182,7 @@ export declare const SubagentLifecyclePayloadSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
158
182
|
cascade: "cascade";
|
|
159
183
|
explicit: "explicit";
|
|
160
184
|
}>;
|
|
185
|
+
timeout: z.ZodOptional<z.ZodBoolean>;
|
|
161
186
|
}, z.core.$strip>], "transition">;
|
|
162
187
|
export declare const BackgroundAgentStartedPayloadSchema: z.ZodObject<{
|
|
163
188
|
transition: z.ZodLiteral<"started">;
|
|
@@ -560,6 +585,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
560
585
|
unrecognised: "unrecognised";
|
|
561
586
|
decline: "decline";
|
|
562
587
|
cancel: "cancel";
|
|
588
|
+
"hard-block": "hard-block";
|
|
563
589
|
}>>;
|
|
564
590
|
}, z.core.$strip>;
|
|
565
591
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -571,6 +597,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
571
597
|
model: z.ZodString;
|
|
572
598
|
allowedTools: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
573
599
|
systemPromptHash: z.ZodOptional<z.ZodString>;
|
|
600
|
+
promptHead: z.ZodOptional<z.ZodString>;
|
|
601
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
574
602
|
}, z.core.$strip>, z.ZodObject<{
|
|
575
603
|
transition: z.ZodLiteral<"succeeded">;
|
|
576
604
|
subagentId: z.ZodString;
|
|
@@ -585,6 +613,15 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
585
613
|
errorClass: z.ZodString;
|
|
586
614
|
errorMessage: z.ZodString;
|
|
587
615
|
partialOutputBytes: z.ZodNumber;
|
|
616
|
+
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
617
|
+
abort: "abort";
|
|
618
|
+
"policy-refusal": "policy-refusal";
|
|
619
|
+
timeout: "timeout";
|
|
620
|
+
"permission-denied": "permission-denied";
|
|
621
|
+
"hook-block": "hook-block";
|
|
622
|
+
"elicitation-declined": "elicitation-declined";
|
|
623
|
+
"denial-breaker": "denial-breaker";
|
|
624
|
+
}>>;
|
|
588
625
|
}, z.core.$strip>, z.ZodObject<{
|
|
589
626
|
transition: z.ZodLiteral<"cancelled">;
|
|
590
627
|
subagentId: z.ZodString;
|
|
@@ -592,6 +629,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
592
629
|
cascade: "cascade";
|
|
593
630
|
explicit: "explicit";
|
|
594
631
|
}>;
|
|
632
|
+
timeout: z.ZodOptional<z.ZodBoolean>;
|
|
595
633
|
}, z.core.$strip>], "transition">;
|
|
596
634
|
}, z.core.$strip>, z.ZodObject<{
|
|
597
635
|
kind: z.ZodLiteral<"background_agent">;
|
|
@@ -854,6 +892,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
854
892
|
unrecognised: "unrecognised";
|
|
855
893
|
decline: "decline";
|
|
856
894
|
cancel: "cancel";
|
|
895
|
+
"hard-block": "hard-block";
|
|
857
896
|
}>>;
|
|
858
897
|
}, z.core.$strip>;
|
|
859
898
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -867,6 +906,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
867
906
|
model: z.ZodString;
|
|
868
907
|
allowedTools: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
869
908
|
systemPromptHash: z.ZodOptional<z.ZodString>;
|
|
909
|
+
promptHead: z.ZodOptional<z.ZodString>;
|
|
910
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
870
911
|
}, z.core.$strip>, z.ZodObject<{
|
|
871
912
|
transition: z.ZodLiteral<"succeeded">;
|
|
872
913
|
subagentId: z.ZodString;
|
|
@@ -881,6 +922,15 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
881
922
|
errorClass: z.ZodString;
|
|
882
923
|
errorMessage: z.ZodString;
|
|
883
924
|
partialOutputBytes: z.ZodNumber;
|
|
925
|
+
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
926
|
+
abort: "abort";
|
|
927
|
+
"policy-refusal": "policy-refusal";
|
|
928
|
+
timeout: "timeout";
|
|
929
|
+
"permission-denied": "permission-denied";
|
|
930
|
+
"hook-block": "hook-block";
|
|
931
|
+
"elicitation-declined": "elicitation-declined";
|
|
932
|
+
"denial-breaker": "denial-breaker";
|
|
933
|
+
}>>;
|
|
884
934
|
}, z.core.$strip>, z.ZodObject<{
|
|
885
935
|
transition: z.ZodLiteral<"cancelled">;
|
|
886
936
|
subagentId: z.ZodString;
|
|
@@ -888,6 +938,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
888
938
|
cascade: "cascade";
|
|
889
939
|
explicit: "explicit";
|
|
890
940
|
}>;
|
|
941
|
+
timeout: z.ZodOptional<z.ZodBoolean>;
|
|
891
942
|
}, z.core.$strip>], "transition">;
|
|
892
943
|
}, z.core.$strip>, z.ZodObject<{
|
|
893
944
|
ts: z.ZodString;
|
|
@@ -24,7 +24,7 @@ export interface ToolCallCompletedPayload {
|
|
|
24
24
|
}
|
|
25
25
|
export type ToolCallPayload = ToolCallStartedPayload | ToolCallCompletedPayload;
|
|
26
26
|
export type HookEventName = 'PreToolUse' | 'PostToolUse' | 'PostToolUseFailure' | 'SessionStart' | 'SessionEnd' | 'SubagentStart' | 'SubagentStop';
|
|
27
|
-
export type AfkApprovalOutcome = 'approved' | 'denied' | 'unrecognised' | 'timeout' | 'decline' | 'cancel';
|
|
27
|
+
export type AfkApprovalOutcome = 'approved' | 'denied' | 'unrecognised' | 'timeout' | 'decline' | 'cancel' | 'hard-block';
|
|
28
28
|
export interface HookDecisionPayload {
|
|
29
29
|
hookEvent: HookEventName;
|
|
30
30
|
decision?: 'block' | 'approve';
|
|
@@ -41,6 +41,8 @@ export interface SubagentStartedPayload {
|
|
|
41
41
|
model: string;
|
|
42
42
|
allowedTools?: readonly string[];
|
|
43
43
|
systemPromptHash?: string;
|
|
44
|
+
promptHead?: string;
|
|
45
|
+
agentType?: string;
|
|
44
46
|
}
|
|
45
47
|
export interface SubagentSucceededPayload {
|
|
46
48
|
transition: 'succeeded';
|
|
@@ -57,11 +59,13 @@ export interface SubagentFailedPayload {
|
|
|
57
59
|
errorClass: string;
|
|
58
60
|
errorMessage: string;
|
|
59
61
|
partialOutputBytes: number;
|
|
62
|
+
failureClass?: ToolFailureClass;
|
|
60
63
|
}
|
|
61
64
|
export interface SubagentCancelledPayload {
|
|
62
65
|
transition: 'cancelled';
|
|
63
66
|
subagentId: string;
|
|
64
67
|
source: 'cascade' | 'explicit';
|
|
68
|
+
timeout?: boolean;
|
|
65
69
|
}
|
|
66
70
|
export type SubagentLifecyclePayload = SubagentStartedPayload | SubagentSucceededPayload | SubagentFailedPayload | SubagentCancelledPayload;
|
|
67
71
|
export interface BackgroundAgentStartedPayload {
|