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.
- package/dist/agent/provider.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query/retry-context.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query/retry-layer.d.ts +2 -0
- package/dist/agent/providers/anthropic-direct/query-runtime.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query/stream-drive.connection.d.ts +9 -0
- package/dist/agent/providers/openai-compatible/query/stream-drive.d.ts +2 -0
- package/dist/agent/providers/openai-compatible/query/stream-drive.retry.d.ts +2 -0
- package/dist/agent/providers/openai-compatible/query/stream-drive.stream-error.d.ts +20 -0
- package/dist/agent/providers/openai-compatible/query/stream-timeouts.d.ts +9 -0
- package/dist/agent/providers/router/provider-router.d.ts +1 -0
- package/dist/agent/session/agent-session.d.ts +1 -0
- package/dist/agent/session/session-config.d.ts +1 -0
- package/dist/agent/spine/spine-hook.annotations.d.ts +3 -0
- package/dist/cli/auth-wizard.describe-source.d.ts +2 -0
- package/dist/cli/commands/whatif.confirm.d.ts +2 -0
- package/dist/cli.mjs +308 -308
- package/dist/index.mjs +125 -125
- package/dist/telegram.mjs +146 -146
- package/package.json +1 -1
package/dist/agent/provider.d.ts
CHANGED
|
@@ -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[]>;
|
|
@@ -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<{
|