agent-afk 5.123.2 → 5.123.4
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/cli/formatter.block.d.ts +3 -0
- package/dist/cli/formatter.d.ts +4 -2
- package/dist/cli/formatter.list.d.ts +2 -0
- package/dist/cli/formatter.table.d.ts +2 -0
- package/dist/cli.mjs +523 -523
- package/dist/index.mjs +200 -200
- package/dist/telegram/streaming.body.d.ts +6 -0
- package/dist/telegram/streaming.d.ts +3 -14
- package/dist/telegram/streaming.preview.d.ts +17 -0
- package/dist/telegram/streaming.retry.d.ts +13 -0
- package/dist/telegram.mjs +252 -252
- package/package.json +1 -1
|
@@ -4,21 +4,10 @@ import type { IAgentSession, ResponseMetadata } from '../agent/types.js';
|
|
|
4
4
|
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
|
|
5
5
|
import { formatTelegramActivity, formatTelegramAgentLabel, renderSubagentFooter } from './streaming.activity.js';
|
|
6
6
|
export { formatTelegramActivity, formatTelegramAgentLabel, renderSubagentFooter };
|
|
7
|
+
export { replyWithFloodRetry } from './streaming.retry.js';
|
|
8
|
+
export { renderProgressRegion, renderInterleavedPreview } from './streaming.preview.js';
|
|
9
|
+
export type { ProgressEntry } from './streaming.preview.js';
|
|
7
10
|
export { StreamTimeoutError };
|
|
8
|
-
export declare function replyWithFloodRetry(reply: (text: string, extra?: {
|
|
9
|
-
parse_mode?: 'HTML';
|
|
10
|
-
}) => Promise<unknown>, text: string, extra?: {
|
|
11
|
-
parse_mode?: 'HTML';
|
|
12
|
-
}, opts?: {
|
|
13
|
-
maxRetries?: number;
|
|
14
|
-
sleep?: (ms: number) => Promise<void>;
|
|
15
|
-
}): Promise<void>;
|
|
16
|
-
export declare function renderProgressRegion(lines: readonly string[]): string;
|
|
17
|
-
export type ProgressEntry = {
|
|
18
|
-
readonly label: string;
|
|
19
|
-
readonly at: number;
|
|
20
|
-
};
|
|
21
|
-
export declare function renderInterleavedPreview(text: string, entries: readonly ProgressEntry[]): string;
|
|
22
11
|
export declare function renderActivityReceipt(toolRounds: number, elapsedMs: number): string;
|
|
23
12
|
export declare function streamResponse(ctx: Context, session: IAgentSession, content: string | ContentBlockParam[], logger?: (...args: unknown[]) => void, options?: {
|
|
24
13
|
cleanFinal?: boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const MAX_PROGRESS_LINES = 6;
|
|
2
|
+
export declare const MAX_PROGRESS_ENTRIES = 32;
|
|
3
|
+
export type ProgressEntry = {
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly at: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function renderProgressRegion(lines: readonly string[]): string;
|
|
8
|
+
export declare function safeSplicePoint(text: string, pos: number): number;
|
|
9
|
+
export declare function renderInterleavedPreview(text: string, entries: readonly ProgressEntry[]): string;
|
|
10
|
+
export interface LivePreviewState {
|
|
11
|
+
readonly accumulated: string;
|
|
12
|
+
readonly progressEntries: readonly ProgressEntry[];
|
|
13
|
+
readonly progressGateOpen: boolean;
|
|
14
|
+
readonly subagentSteps: number;
|
|
15
|
+
readonly recentSubagentSteps: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function computeLivePreview(state: LivePreviewState): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const MAX_FLOOD_RETRIES = 2;
|
|
2
|
+
export declare const MAX_RETRY_AFTER_MS = 30000;
|
|
3
|
+
export declare const DEFAULT_FLOOD_BACKOFF_MS = 1000;
|
|
4
|
+
export declare const realSleep: (ms: number) => Promise<void>;
|
|
5
|
+
export declare function floodRetryAfterMs(e: unknown): number | null;
|
|
6
|
+
export declare function replyWithFloodRetry(reply: (text: string, extra?: {
|
|
7
|
+
parse_mode?: 'HTML';
|
|
8
|
+
}) => Promise<unknown>, text: string, extra?: {
|
|
9
|
+
parse_mode?: 'HTML';
|
|
10
|
+
}, opts?: {
|
|
11
|
+
maxRetries?: number;
|
|
12
|
+
sleep?: (ms: number) => Promise<void>;
|
|
13
|
+
}): Promise<void>;
|