MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / pasteLabel

Function pasteLabel

src/cli/components/editor-logic.ts:76–82  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

74
75/** Short, human label for a pasted blob, e.g. "Pasted 42 lines (1.2 KB)". */
76export function pasteLabel(s: string): string {
77 const lines = countLines(s);
78 const bytes = Buffer.byteLength(s, 'utf8');
79 const size = bytes >= 1024 ? `${(bytes / 1024).toFixed(1)} KB` : `${bytes} B`;
80 const lineStr = lines === 1 ? '1 line' : `${lines} lines`;
81 return `Pasted ${lineStr} (${size})`;
82}
83
84// ── Attachment chips (pasted blobs / images / dropped files & folders) ──────────
85export interface Attachment { kind: 'paste' | 'image' | 'dir' | 'file'; label: string; payload: string; }

Callers 2

ChatInputFunction · 0.85

Calls 1

countLinesFunction · 0.85

Tested by

no test coverage detected