({
text,
originalAttachments,
removedAttachmentIds,
}: {
text: string;
originalAttachments: readonly AttachmentBlock[];
removedAttachmentIds: Iterable<string>;
})
| 39 | } |
| 40 | |
| 41 | export function buildMessageEditContent({ |
| 42 | text, |
| 43 | originalAttachments, |
| 44 | removedAttachmentIds, |
| 45 | }: { |
| 46 | text: string; |
| 47 | originalAttachments: readonly AttachmentBlock[]; |
| 48 | removedAttachmentIds: Iterable<string>; |
| 49 | }): InputContentBlock[] { |
| 50 | const trimmedText = text.trim(); |
| 51 | const textBlocks: InputContentBlock[] = |
| 52 | trimmedText.length > 0 ? [{ type: 'text', text: trimmedText }] : []; |
| 53 | return [ |
| 54 | ...textBlocks, |
| 55 | ...remainingEditableAttachments(originalAttachments, removedAttachmentIds), |
| 56 | ]; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Opaque cursor for conversation list pagination. Encodes the sort key and |
no test coverage detected