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

Function formatReceipt

src/schedule/receipt.ts:122–137  ·  view source on GitHub ↗
(r: RunReceipt)

Source from the content-addressed store, hash-verified

120
121/** Compact, scannable receipt for a chat message. PURE. */
122export function formatReceipt(r: RunReceipt): string {
123 const lines = ['🧾 Receipt'];
124 const icon = r.status === 'opened' ? '✅ opened' : r.status === 'done' ? '✅ done' : r.status === 'blocked' ? '⛔ blocked' : '❌ failed';
125 lines.push(`status: ${icon}`);
126 if (r.prUrl) lines.push(`PR: ${r.prUrl}`);
127 if (r.branch) lines.push(`branch: ${r.branch}`);
128 if (r.verification?.length) {
129 lines.push('verified: ' + r.verification.map(c => `${c.passed ? '✓' : '✗'} ${c.command}`).join(' · '));
130 }
131 if (r.filesChanged?.length) {
132 const shown = r.filesChanged.slice(0, 4).join(', ');
133 lines.push(`files: ${shown}${r.filesChanged.length > 4 ? ` (+${r.filesChanged.length - 4})` : ''}`);
134 }
135 if (r.status !== 'opened' && r.reason) lines.push(`reason: ${r.reason}`);
136 return lines.join('\n');
137}

Callers 3

index.tsFile · 0.85
runOneFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected