agent-afk 5.97.3 → 5.97.5
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/abort-reason.d.ts +4 -0
- package/dist/agent/provider.d.ts +1 -1
- package/dist/agent/providers/anthropic-direct/query.d.ts +1 -1
- package/dist/agent/providers/openai-compatible/query.d.ts +1 -1
- package/dist/agent/providers/router/provider-router.d.ts +1 -1
- package/dist/agent/providers/shared/abort-coordinator.d.ts +2 -1
- package/dist/agent/session/stream-consumer.d.ts +2 -1
- package/dist/agent/trace/events.d.ts +9 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/cli.mjs +541 -532
- package/dist/index.mjs +177 -177
- package/dist/telegram/create-session.d.ts +12 -0
- package/dist/telegram/credentials.d.ts +27 -0
- package/dist/telegram/daemon-version.d.ts +3 -0
- package/dist/telegram/entry.d.ts +1 -0
- package/dist/telegram/env-file-overrides.d.ts +4 -0
- package/dist/telegram/session-anthropic.d.ts +3 -0
- package/dist/telegram/session-context.d.ts +21 -0
- package/dist/telegram/session-openai.d.ts +3 -0
- package/dist/telegram/stats-ticker.d.ts +21 -0
- package/dist/telegram.mjs +315 -306
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolFailureClass } from './trace/types.js';
|
|
2
|
+
export type ProviderAbortReason = 'interrupted' | 'timeout' | 'budget' | 'closed';
|
|
3
|
+
export declare function providerAbortReason(reason: unknown): ProviderAbortReason;
|
|
4
|
+
export declare function abortFailureClass(signal: AbortSignal): ToolFailureClass;
|
package/dist/agent/provider.d.ts
CHANGED
|
@@ -142,7 +142,7 @@ export interface ProviderQueryArgs {
|
|
|
142
142
|
config: AgentConfig;
|
|
143
143
|
}
|
|
144
144
|
export interface ProviderQuery extends AsyncIterable<ProviderEvent> {
|
|
145
|
-
interrupt(): Promise<void>;
|
|
145
|
+
interrupt(reason?: import('./abort-reason.js').ProviderAbortReason): Promise<void>;
|
|
146
146
|
setModel(model?: string): Promise<void>;
|
|
147
147
|
setPermissionMode(mode: string): Promise<void>;
|
|
148
148
|
supportedCommands(): Promise<ProviderCommandInfo[]>;
|
|
@@ -62,7 +62,7 @@ export declare class AnthropicDirectQuery implements ProviderQuery {
|
|
|
62
62
|
constructor(opts: AnthropicDirectQueryOptions);
|
|
63
63
|
[Symbol.asyncIterator](): AsyncIterator<ProviderEvent>;
|
|
64
64
|
private composeSystem;
|
|
65
|
-
interrupt(): Promise<void>;
|
|
65
|
+
interrupt(reason?: import('../../abort-reason.js').ProviderAbortReason): Promise<void>;
|
|
66
66
|
private makeInterruptedTurnEvent;
|
|
67
67
|
setModel(model?: string): Promise<void>;
|
|
68
68
|
setPermissionMode(mode: string): Promise<void>;
|
|
@@ -48,7 +48,7 @@ export declare class OpenAICompatibleQuery implements ProviderQuery {
|
|
|
48
48
|
private clarifyResponsesError;
|
|
49
49
|
private runIteration;
|
|
50
50
|
private dispatchAndAppend;
|
|
51
|
-
interrupt(): Promise<void>;
|
|
51
|
+
interrupt(reason?: import('../../abort-reason.js').ProviderAbortReason): Promise<void>;
|
|
52
52
|
compact(): Promise<ProviderCompactResult>;
|
|
53
53
|
private compactHistory;
|
|
54
54
|
private summarizeViaResponses;
|
|
@@ -34,7 +34,7 @@ export declare class ProviderRouter implements ProviderQuery {
|
|
|
34
34
|
private commitShadowTurn;
|
|
35
35
|
[Symbol.asyncIterator](): AsyncGenerator<ProviderEvent, void, unknown>;
|
|
36
36
|
private driveUntilInit;
|
|
37
|
-
interrupt(): Promise<void>;
|
|
37
|
+
interrupt(reason?: import('../../abort-reason.js').ProviderAbortReason): Promise<void>;
|
|
38
38
|
setModel(model?: string): Promise<void>;
|
|
39
39
|
setPermissionMode(mode: string): Promise<void>;
|
|
40
40
|
setCwd(cwd: string): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ProviderAbortReason } from '../../abort-reason.js';
|
|
2
|
+
export type AbortReason = ProviderAbortReason;
|
|
2
3
|
export declare const CLOSED_SENTINEL: "__closed__";
|
|
3
4
|
export type ClosedSentinel = typeof CLOSED_SENTINEL;
|
|
4
5
|
export declare class AbortCoordinator {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ProviderEvent, ProviderUsage } from '../provider.js';
|
|
2
2
|
import type { Message, OutputEvent, ResponseMetadata, SessionMetadata } from '../types.js';
|
|
3
|
+
import { BudgetExceededError } from '../../utils/errors.js';
|
|
3
4
|
import type { TraceWriter } from '../trace/index.js';
|
|
4
5
|
export type TransformDeps = {
|
|
5
6
|
conversationHistory: Message[];
|
|
@@ -9,7 +10,7 @@ export type TransformDeps = {
|
|
|
9
10
|
resolveInitialization: () => void;
|
|
10
11
|
setLastResponseMetadata: (metadata: ResponseMetadata) => void;
|
|
11
12
|
maxBudgetUsd?: number;
|
|
12
|
-
abortBudget?: (reason:
|
|
13
|
+
abortBudget?: (reason: BudgetExceededError) => void;
|
|
13
14
|
_runningCostUsd?: number;
|
|
14
15
|
_successfulToolNames?: string[];
|
|
15
16
|
traceWriter?: TraceWriter;
|
|
@@ -7,6 +7,7 @@ export declare const ToolCallStartedPayloadSchema: z.ZodObject<{
|
|
|
7
7
|
subagentId: z.ZodOptional<z.ZodString>;
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
export declare const ToolFailureClassSchema: z.ZodEnum<{
|
|
10
|
+
budget: "budget";
|
|
10
11
|
abort: "abort";
|
|
11
12
|
"policy-refusal": "policy-refusal";
|
|
12
13
|
timeout: "timeout";
|
|
@@ -28,6 +29,7 @@ export declare const ToolCallCompletedPayloadSchema: z.ZodObject<{
|
|
|
28
29
|
incompleteReason: z.ZodOptional<z.ZodString>;
|
|
29
30
|
circuitBreaker: z.ZodOptional<z.ZodBoolean>;
|
|
30
31
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
budget: "budget";
|
|
31
33
|
abort: "abort";
|
|
32
34
|
"policy-refusal": "policy-refusal";
|
|
33
35
|
timeout: "timeout";
|
|
@@ -59,6 +61,7 @@ export declare const ToolCallPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
59
61
|
incompleteReason: z.ZodOptional<z.ZodString>;
|
|
60
62
|
circuitBreaker: z.ZodOptional<z.ZodBoolean>;
|
|
61
63
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
budget: "budget";
|
|
62
65
|
abort: "abort";
|
|
63
66
|
"policy-refusal": "policy-refusal";
|
|
64
67
|
timeout: "timeout";
|
|
@@ -135,6 +138,7 @@ export declare const SubagentFailedPayloadSchema: z.ZodObject<{
|
|
|
135
138
|
errorMessage: z.ZodString;
|
|
136
139
|
partialOutputBytes: z.ZodNumber;
|
|
137
140
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
141
|
+
budget: "budget";
|
|
138
142
|
abort: "abort";
|
|
139
143
|
"policy-refusal": "policy-refusal";
|
|
140
144
|
timeout: "timeout";
|
|
@@ -179,6 +183,7 @@ export declare const SubagentLifecyclePayloadSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
179
183
|
errorMessage: z.ZodString;
|
|
180
184
|
partialOutputBytes: z.ZodNumber;
|
|
181
185
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
186
|
+
budget: "budget";
|
|
182
187
|
abort: "abort";
|
|
183
188
|
"policy-refusal": "policy-refusal";
|
|
184
189
|
timeout: "timeout";
|
|
@@ -589,6 +594,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
589
594
|
incompleteReason: z.ZodOptional<z.ZodString>;
|
|
590
595
|
circuitBreaker: z.ZodOptional<z.ZodBoolean>;
|
|
591
596
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
597
|
+
budget: "budget";
|
|
592
598
|
abort: "abort";
|
|
593
599
|
"policy-refusal": "policy-refusal";
|
|
594
600
|
timeout: "timeout";
|
|
@@ -658,6 +664,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
658
664
|
errorMessage: z.ZodString;
|
|
659
665
|
partialOutputBytes: z.ZodNumber;
|
|
660
666
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
667
|
+
budget: "budget";
|
|
661
668
|
abort: "abort";
|
|
662
669
|
"policy-refusal": "policy-refusal";
|
|
663
670
|
timeout: "timeout";
|
|
@@ -918,6 +925,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
918
925
|
incompleteReason: z.ZodOptional<z.ZodString>;
|
|
919
926
|
circuitBreaker: z.ZodOptional<z.ZodBoolean>;
|
|
920
927
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
928
|
+
budget: "budget";
|
|
921
929
|
abort: "abort";
|
|
922
930
|
"policy-refusal": "policy-refusal";
|
|
923
931
|
timeout: "timeout";
|
|
@@ -991,6 +999,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
991
999
|
errorMessage: z.ZodString;
|
|
992
1000
|
partialOutputBytes: z.ZodNumber;
|
|
993
1001
|
failureClass: z.ZodOptional<z.ZodEnum<{
|
|
1002
|
+
budget: "budget";
|
|
994
1003
|
abort: "abort";
|
|
995
1004
|
"policy-refusal": "policy-refusal";
|
|
996
1005
|
timeout: "timeout";
|
|
@@ -6,7 +6,7 @@ export interface ToolCallStartedPayload {
|
|
|
6
6
|
inputBytes: number;
|
|
7
7
|
subagentId?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const TOOL_FAILURE_CLASSES: readonly ["policy-refusal", "timeout", "permission-denied", "hook-block", "abort", "elicitation-declined", "denial-breaker", "repeat-failure"];
|
|
9
|
+
export declare const TOOL_FAILURE_CLASSES: readonly ["policy-refusal", "timeout", "budget", "permission-denied", "hook-block", "abort", "elicitation-declined", "denial-breaker", "repeat-failure"];
|
|
10
10
|
export type ToolFailureClass = (typeof TOOL_FAILURE_CLASSES)[number];
|
|
11
11
|
export declare const BENIGN_FAILURE_CLASSES: ReadonlySet<ToolFailureClass>;
|
|
12
12
|
export interface ToolCallCompletedPayload {
|