feat: add outbound attachment support with media.send tool
Introduces OutboundAttachment type on OutboundMessage, an OutboundAttachmentCollector (push/drain pattern), and a media.send tool that queues files for outbound delivery. Each channel adapter (Telegram, Discord, Slack, WhatsApp) sends attachments after the text reply. Includes 15 tests for collector and tool.
This commit is contained in:
@@ -42,12 +42,26 @@ export interface InboundMessage {
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/** Attachment to send back via a channel adapter. */
|
||||
export interface OutboundAttachment {
|
||||
/** MIME type (e.g. "image/png", "application/pdf"). */
|
||||
mimeType: string;
|
||||
/** Base64-encoded file content. */
|
||||
data?: string;
|
||||
/** URL to the file (alternative to data). */
|
||||
url?: string;
|
||||
/** Suggested filename. */
|
||||
filename?: string;
|
||||
}
|
||||
|
||||
/** Outbound message to send via a channel adapter. */
|
||||
export interface OutboundMessage {
|
||||
/** Response text (markdown). */
|
||||
text: string;
|
||||
/** Original message ID to reply to. */
|
||||
replyTo?: string;
|
||||
/** File or image attachments to send with the response. */
|
||||
attachments?: OutboundAttachment[];
|
||||
/** Platform-specific extras. */
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user