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

@@ -34,6 +34,16 @@ export function getAgentOutputText(output: {
return stringifyLegacyAgentResult(output.result);
}
export function getAgentOutputAttachments(output: {
output?: StructuredAgentOutput;
}): NonNullable<
Extract<StructuredAgentOutput, { visibility: 'public' }>['attachments']
> {
const structured = getStructuredAgentOutput(output);
if (structured?.visibility !== 'public') return [];
return structured.attachments ?? [];
}
export function hasAgentOutputPayload(output: {
output?: StructuredAgentOutput;
result?: string | object | null;