/** * Inbound file transport. Telegram messages can carry file attachments; this * turns them into AG-UI multimodal message content the agent's model can * read — images, audio, video, and documents as their respective binary parts — * downloading each from the Telegram Bot API file endpoint. * * The bridge is transport-only: it delivers the bytes to the agent and lets * the app decide what to do with them. Anything it can't represent is skipped * with a short note so the agent knows a file was dropped and why. */ /** The subset of a Telegram file object we use. */ export interface TelegramFileRef { fileId: string; fileName?: string; mimeType?: string; size?: number; } /** A base64 data source, shared by every binary media part. */ type MediaDataSource = { type: "data"; value: string; mimeType: string; }; /** * AG-UI multimodal content parts (shape the runtime's converter expects). * * Binary media (image/audio/video/document) is passed straight through as a * data part; the agent's model decides what it can actually consume. */ export type AgentContentPart = { type: "text"; text: string; } | { type: "image"; source: MediaDataSource; } | { type: "audio"; source: MediaDataSource; } | { type: "video"; source: MediaDataSource; } | { type: "document"; source: MediaDataSource; }; /** Tunables for inbound file handling (all optional; sane defaults). */ export interface FileDeliveryConfig { /** Skip a single file larger than this many bytes. Default 8 MiB. */ maxBytesPerFile?: number; /** Process at most this many files per message. Default 5. */ maxFiles?: number; } /** * Download a message's files and turn them into AG-UI content parts. Returns * the parts plus human-readable `notes` for anything skipped (appended to the * message as a text part by the caller). * * @param files List of Telegram file references to process. * @param token Telegram bot token used to build the download URL. * @param getFilePath Resolves a fileId to a Telegram file path (e.g. via getFile API). * @param config Optional delivery configuration. */ export declare function buildFileContentParts(files: TelegramFileRef[], token: string, getFilePath: (fileId: string) => Promise, config?: FileDeliveryConfig): Promise<{ parts: AgentContentPart[]; notes: string[]; }>; export {}; //# sourceMappingURL=download-files.d.ts.map