agent-afk 5.77.0 → 5.78.1
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/tracing-fetch.d.ts +1 -1
- package/dist/agent/providers/openai-compatible/oneshot.d.ts +14 -0
- package/dist/agent/providers/openai-compatible/query/retry.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query.d.ts +2 -0
- package/dist/agent/quota-cache.d.ts +12 -0
- package/dist/agent/trace/events.d.ts +4 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/cli/commands/interactive/shared.d.ts +1 -0
- package/dist/cli/status-line.d.ts +1 -0
- package/dist/cli.mjs +479 -479
- package/dist/index.mjs +169 -169
- package/dist/telegram.mjs +213 -213
- package/package.json +1 -1
|
@@ -3,4 +3,4 @@ export interface ThrottleInfo {
|
|
|
3
3
|
status: number;
|
|
4
4
|
retryAfterMs?: number;
|
|
5
5
|
}
|
|
6
|
-
export declare function makeTracingFetch(writer: TraceWriter | undefined, baseFetch?: typeof fetch, onThrottle?: (info: ThrottleInfo) => void): typeof fetch;
|
|
6
|
+
export declare function makeTracingFetch(writer: TraceWriter | undefined, baseFetch?: typeof fetch, onThrottle?: (info: ThrottleInfo) => void, onQuota?: (headers: Headers) => void): typeof fetch;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import OpenAI from 'openai';
|
|
2
|
+
export declare class ResponsesSummaryIncompleteError extends Error {
|
|
3
|
+
readonly finishReason: string | null;
|
|
4
|
+
constructor(finishReason: string | null);
|
|
5
|
+
}
|
|
2
6
|
export type OneShotOpenAIClientFactory = (opts: {
|
|
3
7
|
apiKey: string;
|
|
4
8
|
baseURL?: string;
|
|
@@ -16,3 +20,13 @@ export interface OpenAIOneShotInput {
|
|
|
16
20
|
client?: OpenAI;
|
|
17
21
|
}
|
|
18
22
|
export declare function oneShotChatCompletion(input: OpenAIOneShotInput): Promise<string>;
|
|
23
|
+
export interface OpenAIResponsesOneShotInput {
|
|
24
|
+
client: OpenAI;
|
|
25
|
+
model: string;
|
|
26
|
+
system: string;
|
|
27
|
+
user: string;
|
|
28
|
+
isChatGptBackend: boolean;
|
|
29
|
+
maxTokens?: number;
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
}
|
|
32
|
+
export declare function oneShotResponses(input: OpenAIResponsesOneShotInput): Promise<string>;
|
|
@@ -4,5 +4,6 @@ export declare function __setRetryBaseDelay(ms: number | null): void;
|
|
|
4
4
|
export declare function computeBackoffDelay(attempt: number): number;
|
|
5
5
|
export declare const RETRY_AFTER_MAX_WAIT_MS = 120000;
|
|
6
6
|
export declare function retryAfterDelayMs(err: unknown): number | undefined;
|
|
7
|
+
export declare function getErrorStatus(err: unknown): number | undefined;
|
|
7
8
|
export declare function isRetryableConnectionError(err: unknown): boolean;
|
|
8
9
|
export declare function isRetryableStreamError(err: unknown): boolean;
|
|
@@ -34,6 +34,7 @@ export declare class OpenAICompatibleQuery implements ProviderQuery {
|
|
|
34
34
|
private priorTurns;
|
|
35
35
|
private currentModel;
|
|
36
36
|
private currentPermissionMode;
|
|
37
|
+
private responsesCompactionUnavailable;
|
|
37
38
|
private readonly abort;
|
|
38
39
|
private closed;
|
|
39
40
|
private lastUsage;
|
|
@@ -50,6 +51,7 @@ export declare class OpenAICompatibleQuery implements ProviderQuery {
|
|
|
50
51
|
interrupt(): Promise<void>;
|
|
51
52
|
compact(): Promise<ProviderCompactResult>;
|
|
52
53
|
private compactHistory;
|
|
54
|
+
private summarizeViaResponses;
|
|
53
55
|
setModel(model?: string): Promise<void>;
|
|
54
56
|
setPermissionMode(mode: string): Promise<void>;
|
|
55
57
|
setCwd(cwd: string): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface QuotaSnapshot {
|
|
2
|
+
readonly fiveHourUtilization?: number;
|
|
3
|
+
readonly fiveHourResetsAt?: Date;
|
|
4
|
+
readonly sevenDayUtilization?: number;
|
|
5
|
+
readonly sevenDayResetsAt?: Date;
|
|
6
|
+
readonly observedAt: Date;
|
|
7
|
+
}
|
|
8
|
+
export declare function parseQuotaHeaders(headers: Headers): QuotaSnapshot | undefined;
|
|
9
|
+
export declare function recordQuotaSnapshot(snapshot: QuotaSnapshot): void;
|
|
10
|
+
export declare function getQuotaSnapshot(): QuotaSnapshot | undefined;
|
|
11
|
+
export declare function onQuotaUpdate(listener: () => void): () => void;
|
|
12
|
+
export declare function resetQuotaCacheForTests(): void;
|
|
@@ -488,6 +488,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
488
488
|
usage_limit_resume: "usage_limit_resume";
|
|
489
489
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
490
490
|
suspected_loop: "suspected_loop";
|
|
491
|
+
compaction_disabled: "compaction_disabled";
|
|
491
492
|
}>;
|
|
492
493
|
export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
493
494
|
phase: z.ZodEnum<{
|
|
@@ -508,6 +509,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
508
509
|
usage_limit_resume: "usage_limit_resume";
|
|
509
510
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
510
511
|
suspected_loop: "suspected_loop";
|
|
512
|
+
compaction_disabled: "compaction_disabled";
|
|
511
513
|
}>;
|
|
512
514
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
513
515
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -835,6 +837,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
835
837
|
usage_limit_resume: "usage_limit_resume";
|
|
836
838
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
837
839
|
suspected_loop: "suspected_loop";
|
|
840
|
+
compaction_disabled: "compaction_disabled";
|
|
838
841
|
}>;
|
|
839
842
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
840
843
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1170,6 +1173,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1170
1173
|
usage_limit_resume: "usage_limit_resume";
|
|
1171
1174
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
1172
1175
|
suspected_loop: "suspected_loop";
|
|
1176
|
+
compaction_disabled: "compaction_disabled";
|
|
1173
1177
|
}>;
|
|
1174
1178
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
1175
1179
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -202,7 +202,7 @@ export interface BrowserEventPayload {
|
|
|
202
202
|
};
|
|
203
203
|
durationMs: number;
|
|
204
204
|
}
|
|
205
|
-
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';
|
|
205
|
+
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';
|
|
206
206
|
export interface SessionPhasePayload {
|
|
207
207
|
phase: SessionPhaseName;
|
|
208
208
|
durationMs?: number;
|
|
@@ -110,6 +110,7 @@ export declare const REPL_SPINNER_OPTIONS: {
|
|
|
110
110
|
};
|
|
111
111
|
export declare function contextRatio(stats: SessionStats, sampler?: ContextSampler): number;
|
|
112
112
|
export declare function formatStatusFields(stats: SessionStats, sampler?: ContextSampler, gitSampler?: GitStatusSampler): {
|
|
113
|
+
quota?: string | undefined;
|
|
113
114
|
pr?: number | undefined;
|
|
114
115
|
branch?: string | undefined;
|
|
115
116
|
cwd?: string | undefined;
|