MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / buildMessageEditContent

Function buildMessageEditContent

packages/kilo-chat/src/utils.ts:41–57  ·  view source on GitHub ↗
({
  text,
  originalAttachments,
  removedAttachmentIds,
}: {
  text: string;
  originalAttachments: readonly AttachmentBlock[];
  removedAttachmentIds: Iterable<string>;
})

Source from the content-addressed store, hash-verified

39}
40
41export 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

Callers 3

buildEditContentFunction · 0.90

Calls 1

Tested by

no test coverage detected