agent-afk 5.276.10 → 5.276.12

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.
@@ -177,6 +177,7 @@ export interface ProviderQuery extends AsyncIterable<ProviderEvent> {
177
177
  setBeforeNextRound?(cb: (() => string | undefined) | undefined): void;
178
178
  reauth?(): Promise<{
179
179
  accountId: string;
180
+ oldAccountId: string;
180
181
  swapped: boolean;
181
182
  } | null>;
182
183
  close(): void | Promise<void>;
@@ -12,6 +12,7 @@ export interface RetryTierContext {
12
12
  rotateHeaders(runInput: Pick<RunTurnInput, 'effort' | 'fastMode'>): Record<string, string>;
13
13
  forceClientRefresh(): Promise<{
14
14
  accountId: string;
15
+ oldAccountId: string;
15
16
  swapped: boolean;
16
17
  } | null>;
17
18
  getUsageLimitWait(): Promise<UsageLimitWaitResult> | null;
@@ -14,6 +14,7 @@ export interface RetryLayerOptions {
14
14
  }
15
15
  export declare class RetryLayer {
16
16
  private _client;
17
+ private _clientToken;
17
18
  private readonly _authMode;
18
19
  private readonly initSessionId;
19
20
  private readonly baseUrl?;
@@ -30,6 +31,7 @@ export declare class RetryLayer {
30
31
  private tierContext;
31
32
  forceClientRefresh(): Promise<{
32
33
  accountId: string;
34
+ oldAccountId: string;
33
35
  swapped: boolean;
34
36
  } | null>;
35
37
  turnWithRetries(runInput: RunTurnInput, isClosed: () => boolean): AsyncGenerator<ProviderEvent, void, void>;
@@ -47,6 +47,7 @@ export declare class AnthropicDirectQuery implements ProviderQuery {
47
47
  accountInfo(): Promise<ProviderAccountInfo>;
48
48
  reauth(): Promise<{
49
49
  accountId: string;
50
+ oldAccountId: string;
50
51
  swapped: boolean;
51
52
  } | null>;
52
53
  rewindFiles(_userMessageId: string, _options?: {
@@ -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;
@@ -42,6 +42,7 @@ export declare class ProviderRouter implements ProviderQuery {
42
42
  setSystemPrompt(basePrompt: string | undefined): boolean;
43
43
  reauth(): Promise<{
44
44
  accountId: string;
45
+ oldAccountId: string;
45
46
  swapped: boolean;
46
47
  } | null>;
47
48
  supportedCommands(): Promise<ProviderCommandInfo[]>;
@@ -54,6 +54,7 @@ export declare class AgentSession implements IAgentSession {
54
54
  setCwd(cwd: string): void;
55
55
  reauth(): Promise<{
56
56
  accountId: string;
57
+ oldAccountId: string;
57
58
  swapped: boolean;
58
59
  } | null>;
59
60
  getPrePlanMode(): PermissionMode | undefined;
@@ -19,6 +19,7 @@ export declare function setSystemPrompt(basePrompt: string | undefined, deps: Co
19
19
  export declare function setCwd(cwd: string, deps: ConfigDeps): void;
20
20
  export declare function reauth(deps: ConfigDeps): Promise<{
21
21
  accountId: string;
22
+ oldAccountId: string;
22
23
  swapped: boolean;
23
24
  } | null>;
24
25
  export declare function takePendingPlanExitSeed(deps: ConfigDeps): Promise<{
@@ -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;
@@ -1 +1,3 @@
1
1
  export declare function describeCredentialSource(): string;
2
+ export type CredentialSourceId = 'ANTHROPIC_API_KEY' | 'CLAUDE_CODE_OAUTH_TOKEN' | 'claude-code-keychain' | 'claude-code-session-refresh';
3
+ export declare function credentialSourceId(): CredentialSourceId | null;
@@ -0,0 +1,2 @@
1
+ import type { Readable } from 'node:stream';
2
+ export declare function confirmSpec(lines: string[], question?: string, input?: Readable): Promise<boolean>;