agent-afk 5.276.10 → 5.276.11

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.
@@ -0,0 +1,9 @@
1
+ import type { TraceSink } from '../../../trace/index.js';
2
+ export type ConnectionOutcome<TEvent> = {
3
+ ok: true;
4
+ stream: AsyncIterable<TEvent>;
5
+ } | {
6
+ ok: false;
7
+ error: unknown;
8
+ };
9
+ export declare function runConnectionPhase<TEvent>(createStream: (signal: AbortSignal) => Promise<AsyncIterable<TEvent>>, streamSignal: AbortSignal, userSignal: AbortSignal, traceWriter: TraceSink | undefined, resolvedModel: string): Promise<ConnectionOutcome<TEvent>>;
@@ -18,5 +18,7 @@ export interface StreamDriveContext {
18
18
  initSessionId: string;
19
19
  currentModel: string;
20
20
  isClosed: () => boolean;
21
+ ttfbTimeoutMs?: number;
22
+ stallTimeoutMs?: number;
21
23
  }
22
24
  export declare function driveStream<TEvent>(ctx: StreamDriveContext, strategy: StreamDriveStrategy<TEvent>): AsyncGenerator<ProviderEvent, IterationResult | null>;
@@ -0,0 +1,2 @@
1
+ import type { TraceSink } from '../../../trace/index.js';
2
+ export declare function emitAndSleepRetry(traceWriter: TraceSink | undefined, resolvedModel: string, delayMs: number, sleepSignal: AbortSignal, userSignal: AbortSignal, meta: Record<string, string | number | boolean>): Promise<boolean>;
@@ -0,0 +1,20 @@
1
+ export interface RetryAction {
2
+ kind: 'retry';
3
+ delay: number;
4
+ source: 'stream';
5
+ reason: 'stall_timeout' | 'ttfb_timeout' | 'retry-after' | 'backoff';
6
+ attempt: number;
7
+ }
8
+ export interface FatalAction {
9
+ kind: 'fatal';
10
+ error: Error;
11
+ }
12
+ export interface FallThroughAction {
13
+ kind: 'fall-through';
14
+ error: unknown;
15
+ }
16
+ export type StreamErrorAction = RetryAction | FatalAction | FallThroughAction;
17
+ export declare function classifyStreamError(err: unknown, contentYieldedThisAttempt: boolean, streamRetries: number, stallMs: number): {
18
+ action: StreamErrorAction;
19
+ newStreamRetries: number;
20
+ };
@@ -0,0 +1,9 @@
1
+ import { type FirstByteTimeoutHandle } from '../../shared/first-byte-timeout.js';
2
+ import { type StreamStallHandle } from '../../shared/stream-stall-timeout.js';
3
+ export interface StreamAttemptTimeouts {
4
+ ttfb: FirstByteTimeoutHandle;
5
+ stall: StreamStallHandle;
6
+ signal: AbortSignal;
7
+ dispose(): void;
8
+ }
9
+ export declare function armAttemptTimeouts(turnSignal: AbortSignal, ttfbMs: number, stallMs: number): StreamAttemptTimeouts;
@@ -0,0 +1,3 @@
1
+ export declare const REINFORCED_LABEL = "reinforced";
2
+ export declare const WEAKENED_LABEL = "partially weakened";
3
+ export declare function stripTrailingAnnotation(description: string, label: string): string;
@@ -0,0 +1,2 @@
1
+ import type { Readable } from 'node:stream';
2
+ export declare function confirmSpec(lines: string[], question?: string, input?: Readable): Promise<boolean>;