agent-afk 5.193.0 → 5.195.0

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.
@@ -0,0 +1,11 @@
1
+ export declare function sniffMimeType(bytes: Buffer): 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | null;
2
+ export type LimitedReadResult = {
3
+ status: 'ok';
4
+ bytes: Buffer;
5
+ } | {
6
+ status: 'too-large';
7
+ bytesRead: number;
8
+ } | {
9
+ status: 'missing-body';
10
+ };
11
+ export declare function readResponseBytesWithLimit(response: Response, maxBytes: number): Promise<LimitedReadResult>;
@@ -0,0 +1,17 @@
1
+ import { type Telegraf } from 'telegraf';
2
+ import type { HandoffRecord } from '../agent/daemon/handoff-store.js';
3
+ export interface SendHandoffOpts {
4
+ bot: Telegraf;
5
+ record: HandoffRecord;
6
+ chatId: number;
7
+ threadId?: number;
8
+ handoffsDir?: string;
9
+ }
10
+ export interface SendHandoffResult {
11
+ ok: boolean;
12
+ messageId?: number;
13
+ }
14
+ export declare function sendHandoffQuestion(opts: SendHandoffOpts): Promise<SendHandoffResult>;
15
+ export declare function registerHandoffAnswerHandlers(bot: Telegraf): void;
16
+ export declare function matchReplyToHandoff(bot: Telegraf, chatId: number, replyToMessageId: number, text: string, handoffsDir?: string): Promise<boolean>;
17
+ export declare function clearPendingTextHandoff(taskId: string): void;
@@ -0,0 +1,7 @@
1
+ export declare const HANDOFF_CALLBACK_PREFIX = "afk:h:";
2
+ export interface ParsedHandoffCallback {
3
+ taskId: string;
4
+ choiceIndex: number;
5
+ }
6
+ export declare function buildHandoffCallback(taskId: string, choiceIndex: number): string;
7
+ export declare function parseHandoffCallback(data: string | undefined | null): ParsedHandoffCallback | null;