(filePath: string)
| 110 | |
| 111 | /** Read a receipt JSON file QodeX wrote at end-of-run. Returns null if absent/unreadable. */ |
| 112 | export async function readReceiptFile(filePath: string): Promise<RunReceipt | null> { |
| 113 | try { |
| 114 | const { promises: fs } = await import('fs'); |
| 115 | const raw = await fs.readFile(filePath, 'utf-8'); |
| 116 | const obj = JSON.parse(raw); |
| 117 | return coerce(obj); |
| 118 | } catch { return null; } |
| 119 | } |
| 120 | |
| 121 | /** Compact, scannable receipt for a chat message. PURE. */ |
| 122 | export function formatReceipt(r: RunReceipt): string { |
no test coverage detected