agent-afk 5.84.4 → 5.84.6
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/providers/anthropic-direct/query/date-rollover.d.ts +1 -1
- package/dist/agent/providers/shared/date-rollover.d.ts +1 -0
- package/dist/agent/tools/dispatcher.d.ts +2 -0
- package/dist/agent/tools/repeat-failure-guard.d.ts +14 -0
- package/dist/agent/trace/events.d.ts +9 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/cli.mjs +457 -454
- package/dist/index.mjs +171 -168
- package/dist/telegram.mjs +219 -216
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { refreshEnvironmentDate, } from '../../shared/date-rollover.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function refreshEnvironmentDate(systemPrompt: string, now?: Date, timeZone?: string): string;
|
|
@@ -62,6 +62,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
|
|
|
62
62
|
private readonly readOnlyBash;
|
|
63
63
|
private readonly maxOutputBytes;
|
|
64
64
|
private repeatBreaker;
|
|
65
|
+
private readonly repeatFailureGuard;
|
|
65
66
|
private denialBreaker;
|
|
66
67
|
private suspectedLoopWindow;
|
|
67
68
|
private readonly grantManager;
|
|
@@ -78,6 +79,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
|
|
|
78
79
|
private checkReadOnlyBash;
|
|
79
80
|
private emitPreToolUseBlock;
|
|
80
81
|
private checkRepeatCircuitBreaker;
|
|
82
|
+
private checkRepeatFailureGuard;
|
|
81
83
|
private observeSuspectedLoop;
|
|
82
84
|
private recordForkReadDenial;
|
|
83
85
|
private resetDenialBreaker;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
|
|
2
|
+
export declare const REPEAT_FAILURE_REFUSAL_THRESHOLD = 3;
|
|
3
|
+
export interface RepeatFailureVerdict {
|
|
4
|
+
readonly result: ToolResult;
|
|
5
|
+
readonly count: number;
|
|
6
|
+
readonly tool: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function repeatFailureFingerprint(call: ToolCall): string;
|
|
9
|
+
export declare class RepeatFailureGuard {
|
|
10
|
+
private readonly streaks;
|
|
11
|
+
check(call: ToolCall): RepeatFailureVerdict | null;
|
|
12
|
+
note(call: ToolCall, result: ToolResult): void;
|
|
13
|
+
streakFor(call: ToolCall): number;
|
|
14
|
+
}
|
|
@@ -14,6 +14,7 @@ export declare const ToolFailureClassSchema: z.ZodEnum<{
|
|
|
14
14
|
"hook-block": "hook-block";
|
|
15
15
|
"elicitation-declined": "elicitation-declined";
|
|
16
16
|
"denial-breaker": "denial-breaker";
|
|
17
|
+
"repeat-failure": "repeat-failure";
|
|
17
18
|
}>;
|
|
18
19
|
export declare const ToolCallCompletedPayloadSchema: z.ZodObject<{
|
|
19
20
|
phase: z.ZodLiteral<"completed">;
|
|
@@ -34,6 +35,7 @@ export declare const ToolCallCompletedPayloadSchema: z.ZodObject<{
|
|
|
34
35
|
"hook-block": "hook-block";
|
|
35
36
|
"elicitation-declined": "elicitation-declined";
|
|
36
37
|
"denial-breaker": "denial-breaker";
|
|
38
|
+
"repeat-failure": "repeat-failure";
|
|
37
39
|
}>>;
|
|
38
40
|
batchIndex: z.ZodOptional<z.ZodNumber>;
|
|
39
41
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -64,6 +66,7 @@ export declare const ToolCallPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
64
66
|
"hook-block": "hook-block";
|
|
65
67
|
"elicitation-declined": "elicitation-declined";
|
|
66
68
|
"denial-breaker": "denial-breaker";
|
|
69
|
+
"repeat-failure": "repeat-failure";
|
|
67
70
|
}>>;
|
|
68
71
|
batchIndex: z.ZodOptional<z.ZodNumber>;
|
|
69
72
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -138,6 +141,7 @@ export declare const SubagentFailedPayloadSchema: z.ZodObject<{
|
|
|
138
141
|
"hook-block": "hook-block";
|
|
139
142
|
"elicitation-declined": "elicitation-declined";
|
|
140
143
|
"denial-breaker": "denial-breaker";
|
|
144
|
+
"repeat-failure": "repeat-failure";
|
|
141
145
|
}>>;
|
|
142
146
|
}, z.core.$strip>;
|
|
143
147
|
export declare const SubagentCancelledPayloadSchema: z.ZodObject<{
|
|
@@ -181,6 +185,7 @@ export declare const SubagentLifecyclePayloadSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
181
185
|
"hook-block": "hook-block";
|
|
182
186
|
"elicitation-declined": "elicitation-declined";
|
|
183
187
|
"denial-breaker": "denial-breaker";
|
|
188
|
+
"repeat-failure": "repeat-failure";
|
|
184
189
|
}>>;
|
|
185
190
|
}, z.core.$strip>, z.ZodObject<{
|
|
186
191
|
transition: z.ZodLiteral<"cancelled">;
|
|
@@ -585,6 +590,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
585
590
|
"hook-block": "hook-block";
|
|
586
591
|
"elicitation-declined": "elicitation-declined";
|
|
587
592
|
"denial-breaker": "denial-breaker";
|
|
593
|
+
"repeat-failure": "repeat-failure";
|
|
588
594
|
}>>;
|
|
589
595
|
batchIndex: z.ZodOptional<z.ZodNumber>;
|
|
590
596
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -652,6 +658,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
652
658
|
"hook-block": "hook-block";
|
|
653
659
|
"elicitation-declined": "elicitation-declined";
|
|
654
660
|
"denial-breaker": "denial-breaker";
|
|
661
|
+
"repeat-failure": "repeat-failure";
|
|
655
662
|
}>>;
|
|
656
663
|
}, z.core.$strip>, z.ZodObject<{
|
|
657
664
|
transition: z.ZodLiteral<"cancelled">;
|
|
@@ -904,6 +911,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
904
911
|
"hook-block": "hook-block";
|
|
905
912
|
"elicitation-declined": "elicitation-declined";
|
|
906
913
|
"denial-breaker": "denial-breaker";
|
|
914
|
+
"repeat-failure": "repeat-failure";
|
|
907
915
|
}>>;
|
|
908
916
|
batchIndex: z.ZodOptional<z.ZodNumber>;
|
|
909
917
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -975,6 +983,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
975
983
|
"hook-block": "hook-block";
|
|
976
984
|
"elicitation-declined": "elicitation-declined";
|
|
977
985
|
"denial-breaker": "denial-breaker";
|
|
986
|
+
"repeat-failure": "repeat-failure";
|
|
978
987
|
}>>;
|
|
979
988
|
}, z.core.$strip>, z.ZodObject<{
|
|
980
989
|
transition: z.ZodLiteral<"cancelled">;
|
|
@@ -6,7 +6,7 @@ export interface ToolCallStartedPayload {
|
|
|
6
6
|
inputBytes: number;
|
|
7
7
|
subagentId?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const TOOL_FAILURE_CLASSES: readonly ["policy-refusal", "timeout", "permission-denied", "hook-block", "abort", "elicitation-declined", "denial-breaker"];
|
|
9
|
+
export declare const TOOL_FAILURE_CLASSES: readonly ["policy-refusal", "timeout", "permission-denied", "hook-block", "abort", "elicitation-declined", "denial-breaker", "repeat-failure"];
|
|
10
10
|
export type ToolFailureClass = (typeof TOOL_FAILURE_CLASSES)[number];
|
|
11
11
|
export interface ToolCallCompletedPayload {
|
|
12
12
|
phase: 'completed';
|