agent-afk 5.84.0 → 5.84.2
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/subagent/handle.d.ts +1 -0
- package/dist/agent/subagent/pause-ceiling.d.ts +29 -0
- package/dist/agent/subagent/pause-window.d.ts +4 -0
- package/dist/agent/timeout.d.ts +5 -0
- package/dist/agent/trace/events.d.ts +4 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/cli.mjs +453 -453
- package/dist/index.mjs +166 -166
- package/dist/telegram.mjs +213 -213
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
|
44
44
|
private parentId;
|
|
45
45
|
private currentTrace;
|
|
46
46
|
private lastStreamedContent;
|
|
47
|
+
private pauseCeiling;
|
|
47
48
|
private lastStopReason;
|
|
48
49
|
constructor(id: string, session: IAgentSession, controller: AbortController, abortGraph: AbortGraph, outputSchema: ZodType<T> | undefined, timeoutMs: number, hookRegistry: HookRegistry | undefined, onTerminal: () => void, parentInputStreamRef?: ReturnType<IAgentSession["getInputStreamRef"]> | undefined, parentAbortSignal?: AbortSignal | undefined, agentType?: string | undefined, progressSink?: SubagentProgressSink, parentId?: string, traceWriter?: TraceWriter | undefined, onSubagentSucceeded?: ((usage: SubagentTrace["usage"], costUsd: number | undefined) => void) | undefined, idleTimeoutMs?: number);
|
|
49
50
|
get status(): SubagentStatus;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TimeoutExtender } from '../timeout.js';
|
|
2
|
+
import type { OutputEvent } from '../types/session-types.js';
|
|
3
|
+
export declare const SUBAGENT_MAX_PAUSE_EXTENSION_MS: number;
|
|
4
|
+
export interface PauseExtensionGrantInfo {
|
|
5
|
+
grantMs: number;
|
|
6
|
+
totalGrantedMs: number;
|
|
7
|
+
remainingCapMs: number;
|
|
8
|
+
grantCount: number;
|
|
9
|
+
pauseDescription: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare class PauseAwareCeiling implements TimeoutExtender {
|
|
12
|
+
private readonly baseTimeoutMs;
|
|
13
|
+
private readonly maxExtensionMs;
|
|
14
|
+
private pauseStartedAtMs;
|
|
15
|
+
private pauseWindowCapMs;
|
|
16
|
+
private closedCreditMs;
|
|
17
|
+
private lastPauseDescription;
|
|
18
|
+
private grantedMs;
|
|
19
|
+
private grantCount;
|
|
20
|
+
private readonly onGrant?;
|
|
21
|
+
constructor(baseTimeoutMs: number, maxExtensionMs?: number, onGrant?: (info: PauseExtensionGrantInfo) => void);
|
|
22
|
+
onEvent(event: OutputEvent): void;
|
|
23
|
+
private openPauseCreditMs;
|
|
24
|
+
private closePause;
|
|
25
|
+
private closeExpiredPause;
|
|
26
|
+
onDeadline(): number;
|
|
27
|
+
describe(): string | undefined;
|
|
28
|
+
get totalGrantedMs(): number;
|
|
29
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OutputEvent } from '../types/session-types.js';
|
|
2
|
+
export declare const PAUSE_WINDOW_SLACK_MS = 30000;
|
|
3
|
+
export declare function pauseWindowMs(event: OutputEvent, now?: number): number | undefined;
|
|
4
|
+
export declare function describePauseEvent(event: OutputEvent): string | undefined;
|
package/dist/agent/timeout.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export declare const DEFAULT_SESSION_TIMEOUT_MS = 0;
|
|
2
2
|
export declare const RESET_DRAIN_TIMEOUT_MS = 5000;
|
|
3
|
+
export interface TimeoutExtender {
|
|
4
|
+
onDeadline(): number;
|
|
5
|
+
describe?(): string | undefined;
|
|
6
|
+
}
|
|
3
7
|
export interface WithTimeoutOptions {
|
|
4
8
|
controller?: AbortController;
|
|
5
9
|
label?: string;
|
|
10
|
+
extender?: TimeoutExtender;
|
|
6
11
|
}
|
|
7
12
|
export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, options?: WithTimeoutOptions): Promise<T>;
|
|
@@ -495,6 +495,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
495
495
|
overload_pause: "overload_pause";
|
|
496
496
|
overload_resume: "overload_resume";
|
|
497
497
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
498
|
+
pause_extension_granted: "pause_extension_granted";
|
|
498
499
|
suspected_loop: "suspected_loop";
|
|
499
500
|
compaction_disabled: "compaction_disabled";
|
|
500
501
|
}>;
|
|
@@ -519,6 +520,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
519
520
|
overload_pause: "overload_pause";
|
|
520
521
|
overload_resume: "overload_resume";
|
|
521
522
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
523
|
+
pause_extension_granted: "pause_extension_granted";
|
|
522
524
|
suspected_loop: "suspected_loop";
|
|
523
525
|
compaction_disabled: "compaction_disabled";
|
|
524
526
|
}>;
|
|
@@ -853,6 +855,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
853
855
|
overload_pause: "overload_pause";
|
|
854
856
|
overload_resume: "overload_resume";
|
|
855
857
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
858
|
+
pause_extension_granted: "pause_extension_granted";
|
|
856
859
|
suspected_loop: "suspected_loop";
|
|
857
860
|
compaction_disabled: "compaction_disabled";
|
|
858
861
|
}>;
|
|
@@ -1195,6 +1198,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1195
1198
|
overload_pause: "overload_pause";
|
|
1196
1199
|
overload_resume: "overload_resume";
|
|
1197
1200
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
1201
|
+
pause_extension_granted: "pause_extension_granted";
|
|
1198
1202
|
suspected_loop: "suspected_loop";
|
|
1199
1203
|
compaction_disabled: "compaction_disabled";
|
|
1200
1204
|
}>;
|
|
@@ -205,7 +205,7 @@ export interface BrowserEventPayload {
|
|
|
205
205
|
};
|
|
206
206
|
durationMs: number;
|
|
207
207
|
}
|
|
208
|
-
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'suspected_loop' | 'compaction_disabled';
|
|
208
|
+
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled';
|
|
209
209
|
export interface SessionPhasePayload {
|
|
210
210
|
phase: SessionPhaseName;
|
|
211
211
|
durationMs?: number;
|