import type { ReplyPayload } from "../auto-reply/types.js"; import type { AgentEvent, BridgeCallbacks } from "./types.js"; /** Options for the delivery adapter. */ export type DeliveryAdapterOptions = { /** * Maximum characters per message chunk. * Different channels have different limits: * - Discord: 2000 chars * - Telegram: 4096 chars * - Slack: ~40000 chars (block-based) * Default: 4000 (safe default for most channels) */ chunkLimit?: number | undefined; }; /** * Converts AgentEvent async iterable into channel-deliverable ReplyPayload chunks. * * Handles: * - Text accumulation and chunking at channel limits * - Progressive streaming via BridgeCallbacks * - Tool result formatting * - Error event formatting */ export declare class DeliveryAdapter { private readonly chunkLimit; constructor(options?: DeliveryAdapterOptions); /** * Process an event stream, invoking callbacks for real-time delivery * and returning final payloads for post-execution delivery. * * @param events - AgentEvent async iterable from runtime.execute() * @param callbacks - Optional streaming callbacks for real-time delivery * @returns Final ReplyPayload array for post-execution delivery */ process(events: AsyncIterable, callbacks?: BridgeCallbacks): Promise; }