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:
William Valentin
2026-02-07 09:09:00 -08:00
parent 1e6f6bb5a4
commit b9bfee9c5b
15 changed files with 576 additions and 21 deletions
+14
View File
@@ -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>;
}