agent-afk 5.78.0 → 5.78.2
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/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/tools/dispatcher.d.ts +3 -0
- package/dist/agent/trace/events.d.ts +7 -0
- package/dist/agent/trace/types.d.ts +2 -1
- package/dist/cli.mjs +467 -467
- package/dist/index.mjs +161 -161
- package/dist/telegram.mjs +207 -207
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -32,6 +32,7 @@ export interface SessionToolDispatcherOptions {
|
|
|
32
32
|
env?: Record<string, string>;
|
|
33
33
|
sessionId?: string;
|
|
34
34
|
parentSessionId?: string;
|
|
35
|
+
subagentId?: string;
|
|
35
36
|
sessionGrantManager?: GrantManager;
|
|
36
37
|
traceWriter?: TraceWriter;
|
|
37
38
|
readOnlyBash?: boolean;
|
|
@@ -55,6 +56,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
|
|
|
55
56
|
private readonly _env;
|
|
56
57
|
private readonly sessionId;
|
|
57
58
|
private readonly parentSessionId;
|
|
59
|
+
private readonly subagentId;
|
|
58
60
|
private readonly sessionGrantManager;
|
|
59
61
|
private readonly traceWriter;
|
|
60
62
|
private readonly readOnlyBash;
|
|
@@ -74,6 +76,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
|
|
|
74
76
|
setResolveBase(newCwd: string): void;
|
|
75
77
|
get toolDefs(): readonly AnthropicToolDef[];
|
|
76
78
|
private checkReadOnlyBash;
|
|
79
|
+
private emitPreToolUseBlock;
|
|
77
80
|
private checkRepeatCircuitBreaker;
|
|
78
81
|
private observeSuspectedLoop;
|
|
79
82
|
private recordForkReadDenial;
|
|
@@ -87,6 +87,7 @@ export declare const HookDecisionPayloadSchema: z.ZodObject<{
|
|
|
87
87
|
decision: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"block">, z.ZodLiteral<"approve">]>>;
|
|
88
88
|
reason: z.ZodOptional<z.ZodString>;
|
|
89
89
|
blockedTool: z.ZodOptional<z.ZodString>;
|
|
90
|
+
subagentId: z.ZodOptional<z.ZodString>;
|
|
90
91
|
injectedContextBytes: z.ZodOptional<z.ZodNumber>;
|
|
91
92
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
92
93
|
approvalOutcome: z.ZodOptional<z.ZodEnum<{
|
|
@@ -488,6 +489,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
488
489
|
usage_limit_resume: "usage_limit_resume";
|
|
489
490
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
490
491
|
suspected_loop: "suspected_loop";
|
|
492
|
+
compaction_disabled: "compaction_disabled";
|
|
491
493
|
}>;
|
|
492
494
|
export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
493
495
|
phase: z.ZodEnum<{
|
|
@@ -508,6 +510,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
508
510
|
usage_limit_resume: "usage_limit_resume";
|
|
509
511
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
510
512
|
suspected_loop: "suspected_loop";
|
|
513
|
+
compaction_disabled: "compaction_disabled";
|
|
511
514
|
}>;
|
|
512
515
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
513
516
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -588,6 +591,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
588
591
|
decision: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"block">, z.ZodLiteral<"approve">]>>;
|
|
589
592
|
reason: z.ZodOptional<z.ZodString>;
|
|
590
593
|
blockedTool: z.ZodOptional<z.ZodString>;
|
|
594
|
+
subagentId: z.ZodOptional<z.ZodString>;
|
|
591
595
|
injectedContextBytes: z.ZodOptional<z.ZodNumber>;
|
|
592
596
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
593
597
|
approvalOutcome: z.ZodOptional<z.ZodEnum<{
|
|
@@ -835,6 +839,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
835
839
|
usage_limit_resume: "usage_limit_resume";
|
|
836
840
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
837
841
|
suspected_loop: "suspected_loop";
|
|
842
|
+
compaction_disabled: "compaction_disabled";
|
|
838
843
|
}>;
|
|
839
844
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
840
845
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -901,6 +906,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
901
906
|
decision: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"block">, z.ZodLiteral<"approve">]>>;
|
|
902
907
|
reason: z.ZodOptional<z.ZodString>;
|
|
903
908
|
blockedTool: z.ZodOptional<z.ZodString>;
|
|
909
|
+
subagentId: z.ZodOptional<z.ZodString>;
|
|
904
910
|
injectedContextBytes: z.ZodOptional<z.ZodNumber>;
|
|
905
911
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
906
912
|
approvalOutcome: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1170,6 +1176,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1170
1176
|
usage_limit_resume: "usage_limit_resume";
|
|
1171
1177
|
idle_watchdog_fired: "idle_watchdog_fired";
|
|
1172
1178
|
suspected_loop: "suspected_loop";
|
|
1179
|
+
compaction_disabled: "compaction_disabled";
|
|
1173
1180
|
}>;
|
|
1174
1181
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
1175
1182
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -30,6 +30,7 @@ export interface HookDecisionPayload {
|
|
|
30
30
|
decision?: 'block' | 'approve';
|
|
31
31
|
reason?: string;
|
|
32
32
|
blockedTool?: string;
|
|
33
|
+
subagentId?: string;
|
|
33
34
|
injectedContextBytes?: number;
|
|
34
35
|
durationMs?: number;
|
|
35
36
|
approvalOutcome?: AfkApprovalOutcome;
|
|
@@ -202,7 +203,7 @@ export interface BrowserEventPayload {
|
|
|
202
203
|
};
|
|
203
204
|
durationMs: number;
|
|
204
205
|
}
|
|
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';
|
|
206
|
+
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
207
|
export interface SessionPhasePayload {
|
|
207
208
|
phase: SessionPhaseName;
|
|
208
209
|
durationMs?: number;
|