agent-afk 5.82.4 → 5.82.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/auth.d.ts +2 -1
- package/dist/agent/providers/anthropic-direct/cache-policy.d.ts +3 -0
- package/dist/agent/providers/anthropic-direct/query/retry-layer.d.ts +3 -0
- package/dist/agent/trace/events.d.ts +4 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/cli.mjs +442 -442
- package/dist/index.mjs +159 -159
- package/dist/telegram.mjs +204 -204
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
|
|
2
2
|
import type { AuthMode } from './types.js';
|
|
3
|
+
export declare const EXTENDED_CACHE_TTL_BETA = "extended-cache-ttl-2025-04-11";
|
|
3
4
|
export declare const OAUTH_BETA_HEADER = "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,extended-cache-ttl-2025-04-11";
|
|
4
5
|
export declare const EFFORT_BETA_HEADER = "effort-2025-11-24";
|
|
5
6
|
export declare const CLI_USER_AGENT = "claude-cli/1.0.0 (external, cli)";
|
|
@@ -13,5 +14,5 @@ export declare function buildClientOptions(token: string, mode: AuthMode, baseUr
|
|
|
13
14
|
baseURL?: string;
|
|
14
15
|
fetch?: typeof fetch;
|
|
15
16
|
};
|
|
16
|
-
export declare function buildRequestHeaders(mode: AuthMode, sessionId: string, requestId: string, withEffort?: boolean): Record<string, string>;
|
|
17
|
+
export declare function buildRequestHeaders(mode: AuthMode, sessionId: string, requestId: string, withEffort?: boolean, extendedCacheTtl?: boolean): Record<string, string>;
|
|
17
18
|
export declare function buildSystemPrefix(mode: AuthMode): ContentBlockParam[] | null;
|
|
@@ -3,5 +3,8 @@ export declare function isCacheEnabled(opts?: {
|
|
|
3
3
|
baseUrl?: string;
|
|
4
4
|
}): boolean;
|
|
5
5
|
export declare function getCacheTtl(): '5m' | '1h';
|
|
6
|
+
export declare function isExtendedCacheTtlActive(opts?: {
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
}): boolean;
|
|
6
9
|
export declare function withSystemBreakpoint(blocks: ContentBlockParam[], ttl: '5m' | '1h'): ContentBlockParam[];
|
|
7
10
|
export declare function withMessagesBreakpoint(messages: MessageParam[], ttl: '5m' | '1h'): MessageParam[];
|
|
@@ -7,6 +7,7 @@ export interface RetryLayerOptions {
|
|
|
7
7
|
client: Anthropic;
|
|
8
8
|
authMode: AuthMode;
|
|
9
9
|
initSessionId: string;
|
|
10
|
+
baseUrl?: string;
|
|
10
11
|
tokenRefresher?: () => Promise<Anthropic | null>;
|
|
11
12
|
autoResumeOnUsageLimit: boolean;
|
|
12
13
|
}
|
|
@@ -14,12 +15,14 @@ export declare class RetryLayer {
|
|
|
14
15
|
private _client;
|
|
15
16
|
private readonly _authMode;
|
|
16
17
|
private readonly initSessionId;
|
|
18
|
+
private readonly baseUrl?;
|
|
17
19
|
private readonly tokenRefresher?;
|
|
18
20
|
private readonly autoResumeOnUsageLimit;
|
|
19
21
|
private refreshPromise;
|
|
20
22
|
private usageLimitWaitPromise;
|
|
21
23
|
constructor(opts: RetryLayerOptions);
|
|
22
24
|
get client(): Anthropic;
|
|
25
|
+
private rotateHeaders;
|
|
23
26
|
get authMode(): AuthMode;
|
|
24
27
|
forceClientRefresh(): Promise<{
|
|
25
28
|
accountId: string;
|
|
@@ -489,6 +489,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
489
489
|
model_ttfb: "model_ttfb";
|
|
490
490
|
interrupt_halt: "interrupt_halt";
|
|
491
491
|
rate_limit: "rate_limit";
|
|
492
|
+
ttfb_timeout: "ttfb_timeout";
|
|
492
493
|
usage_limit_pause: "usage_limit_pause";
|
|
493
494
|
usage_limit_resume: "usage_limit_resume";
|
|
494
495
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
@@ -510,6 +511,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
510
511
|
model_ttfb: "model_ttfb";
|
|
511
512
|
interrupt_halt: "interrupt_halt";
|
|
512
513
|
rate_limit: "rate_limit";
|
|
514
|
+
ttfb_timeout: "ttfb_timeout";
|
|
513
515
|
usage_limit_pause: "usage_limit_pause";
|
|
514
516
|
usage_limit_resume: "usage_limit_resume";
|
|
515
517
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
@@ -841,6 +843,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
841
843
|
model_ttfb: "model_ttfb";
|
|
842
844
|
interrupt_halt: "interrupt_halt";
|
|
843
845
|
rate_limit: "rate_limit";
|
|
846
|
+
ttfb_timeout: "ttfb_timeout";
|
|
844
847
|
usage_limit_pause: "usage_limit_pause";
|
|
845
848
|
usage_limit_resume: "usage_limit_resume";
|
|
846
849
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
@@ -1180,6 +1183,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1180
1183
|
model_ttfb: "model_ttfb";
|
|
1181
1184
|
interrupt_halt: "interrupt_halt";
|
|
1182
1185
|
rate_limit: "rate_limit";
|
|
1186
|
+
ttfb_timeout: "ttfb_timeout";
|
|
1183
1187
|
usage_limit_pause: "usage_limit_pause";
|
|
1184
1188
|
usage_limit_resume: "usage_limit_resume";
|
|
1185
1189
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
@@ -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' | 'usage_limit_pause' | 'usage_limit_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' | 'idle_watchdog_fired' | 'suspected_loop' | 'compaction_disabled';
|
|
209
209
|
export interface SessionPhasePayload {
|
|
210
210
|
phase: SessionPhaseName;
|
|
211
211
|
durationMs?: number;
|