{"version":3,"file":"manifest.mjs","names":[],"sources":["../../src/files-touched/manifest.ts"],"sourcesContent":["/**\n * Files-touched manifest renderer.\n *\n * Pi-runtime-free so it can be imported from tests, the preview CLI, and\n * any consumer that doesn't pull `@earendil-works/pi-tui`.\n */\n\nimport type { FilesTouchedEntry } from '@live-compaction/files-touched/types';\n\nexport const FILES_TOUCHED_HEADING = '## Files touched';\nexport const FILES_TOUCHED_LEGEND = 'R=read, W=write, E=edit, M=move/rename, D=delete';\n\nexport function formatManifestOperations(file: FilesTouchedEntry): string {\n\tconst ops: string[] = [];\n\tif (file.operations.has('read')) ops.push('R');\n\tif (file.operations.has('write')) ops.push('W');\n\tif (file.operations.has('edit')) ops.push('E');\n\tif (file.operations.has('move')) ops.push('M');\n\tif (file.operations.has('delete')) ops.push('D');\n\treturn ops.join('');\n}\n\nexport function renderFilesTouchedManifestBlock(\n\tfiles: FilesTouchedEntry[],\n\theading = FILES_TOUCHED_HEADING,\n): string {\n\tif (files.length === 0) return '';\n\n\tconst lines = files\n\t\t.map((f) => {\n\t\t\tconst ops = formatManifestOperations(f);\n\t\t\tconst displayPath = f.displayPath || f.path;\n\t\t\tif (!ops || !displayPath) return null;\n\t\t\treturn `${ops}  ${displayPath}`;\n\t\t})\n\t\t.filter((line): line is string => line !== null);\n\n\tif (lines.length === 0) return '';\n\n\treturn [heading, FILES_TOUCHED_LEGEND, '', '```text', ...lines, '```'].join('\\n');\n}\n"],"mappings":";AASA,MAAa,wBAAwB;AACrC,MAAa,uBAAuB;AAEpC,SAAgB,yBAAyB,MAAiC;CACzE,MAAM,MAAgB,CAAC;CACvB,IAAI,KAAK,WAAW,IAAI,MAAM,GAAG,IAAI,KAAK,GAAG;CAC7C,IAAI,KAAK,WAAW,IAAI,OAAO,GAAG,IAAI,KAAK,GAAG;CAC9C,IAAI,KAAK,WAAW,IAAI,MAAM,GAAG,IAAI,KAAK,GAAG;CAC7C,IAAI,KAAK,WAAW,IAAI,MAAM,GAAG,IAAI,KAAK,GAAG;CAC7C,IAAI,KAAK,WAAW,IAAI,QAAQ,GAAG,IAAI,KAAK,GAAG;CAC/C,OAAO,IAAI,KAAK,EAAE;AACnB;AAEA,SAAgB,gCACf,OACA,UAAU,uBACD;CACT,IAAI,MAAM,WAAW,GAAG,OAAO;CAE/B,MAAM,QAAQ,MACZ,KAAK,MAAM;EACX,MAAM,MAAM,yBAAyB,CAAC;EACtC,MAAM,cAAc,EAAE,eAAe,EAAE;EACvC,IAAI,CAAC,OAAO,CAAC,aAAa,OAAO;EACjC,OAAO,GAAG,IAAI,IAAI;CACnB,CAAC,CAAC,CACD,QAAQ,SAAyB,SAAS,IAAI;CAEhD,IAAI,MAAM,WAAW,GAAG,OAAO;CAE/B,OAAO;EAAC;EAAS;EAAsB;EAAI;EAAW,GAAG;EAAO;CAAK,CAAC,CAAC,KAAK,IAAI;AACjF"}