Add structured Discord attachments

This commit is contained in:
ejclaw
2026-04-25 09:20:28 +09:00
parent 65dd82ba6b
commit 4e329a7717
24 changed files with 891 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;