Add structured Discord attachments

This commit is contained in:
ejclaw
2026-04-25 09:20:28 +09:00
parent bdaecb2552
commit 83b7aef494
25 changed files with 892 additions and 53 deletions

View File

@@ -11,9 +11,10 @@ import { resolvePairedTurnRunOwnership } from './paired-turn-run-ownership.js';
import { normalizeMessageForDedupe } from './router.js';
import type { ExecuteTurnFn } from './message-runtime-types.js';
import type {
AgentType,
Channel,
NewMessage,
AgentType,
OutboundAttachment,
PairedRoomRole,
RegisteredGroup,
} from './types.js';
@@ -100,6 +101,7 @@ interface CreateExecuteTurnDeps {
clearSession: (groupFolder: string, opts?: { allRoles?: boolean }) => void;
deliverFinalText: (args: {
text: string;
attachments?: OutboundAttachment[];
chatJid: string;
runId: string;
channel: Channel;
@@ -202,6 +204,9 @@ export function createExecuteTurn(deps: CreateExecuteTurnDeps): ExecuteTurnFn {
try {
return await deps.deliverFinalText({
text,
...(options?.attachments?.length
? { attachments: options.attachments }
: {}),
chatJid,
runId,
channel,