#!/usr/bin/env node
import {g}from'./chunk-7YTAA6XA.js';import'./chunk-XHJ27CER.js';import e from'chalk';async function h(s,r){let c=process.cwd(),o=await g(c,s);if(o||(console.error(e.red(`
Entry not found: ${s}
`)),process.exit(1)),r.json){console.log(JSON.stringify(o,null,2));return}let g$1={...{"agent-session":e.hex("#818cf8"),"human-note":e.hex("#34d399"),decision:e.hex("#fbbf24"),review:e.hex("#c084fc"),incident:e.hex("#f87171"),milestone:e.hex("#60a5fa")},retro:e.hex("#fb923c"),insight:e.hex("#a78bfa")},i=o.type||"agent-session",a=g$1[i]||e.white;if(console.log(),console.log(e.white.bold(`  ${o.title}`)),console.log(e.gray(`  ${o.id} \xB7 ${a(i)} \xB7 ${o.timestamp}`)),console.log(),console.log(`  \u{1F464} ${e.white(o.author)}`),o.agent&&console.log(`  \u{1F916} ${e.gray(o.agent.model)}${o.agent.provider?e.gray(` (${o.agent.provider})`):""}`),o.duration_minutes&&console.log(`  \u23F1  ${o.duration_minutes} minutes`),console.log(),console.log(e.gray("  Summary:")),console.log(`  ${o.summary}`),console.log(),o.body){console.log(e.gray("  Body:"));for(let l of o.body.split(`
`))console.log(`    ${l}`);console.log();}if(o.linked_lore&&o.linked_lore.length>0){console.log(e.gray("  Linked lore:"));for(let l of o.linked_lore)console.log(`    ${e.cyan(l)}`);console.log();}if(o.linked_tasks&&o.linked_tasks.length>0){console.log(e.gray("  Linked tasks:"));for(let l of o.linked_tasks)console.log(`    ${e.yellow(l)}`);console.log();}if(o.linked_commits&&o.linked_commits.length>0){console.log(e.gray("  Linked commits:"));for(let l of o.linked_commits)console.log(`    ${e.gray(l)}`);console.log();}if(o.symbols_touched?.length>0&&(console.log(e.gray("  Symbols touched:")),console.log(`  ${o.symbols_touched.map(l=>e.cyan(l)).join("  ")}`),console.log()),o.symbols_created&&o.symbols_created.length>0&&(console.log(e.gray("  Symbols created:")),console.log(`  ${o.symbols_created.map(l=>e.green(l)).join("  ")}`),console.log()),o.files_created&&o.files_created.length>0){console.log(e.gray(`  Files created (${o.files_created.length}):`));for(let l of o.files_created.slice(0,10))console.log(`    ${e.green("+")} ${l}`);o.files_created.length>10&&console.log(e.gray(`    ... and ${o.files_created.length-10} more`)),console.log();}if(o.files_modified&&o.files_modified.length>0){console.log(e.gray(`  Files modified (${o.files_modified.length}):`));for(let l of o.files_modified.slice(0,10))console.log(`    ${e.yellow("~")} ${l}`);o.files_modified.length>10&&console.log(e.gray(`    ... and ${o.files_modified.length-10} more`)),console.log();}if((o.lines_added||o.lines_removed)&&(console.log(`  ${e.green(`+${o.lines_added||0}`)} ${e.red(`-${o.lines_removed||0}`)} lines`),console.log()),o.decisions&&o.decisions.length>0){console.log(e.gray("  Decisions:"));for(let l of o.decisions)console.log(`    ${e.yellow("\u25BA")} ${e.white(l.decision)}`),console.log(`      ${e.gray(l.rationale)}`);console.log();}if(o.errors_encountered&&o.errors_encountered.length>0){console.log(e.gray("  Errors encountered:"));for(let l of o.errors_encountered)console.log(`    ${e.red("\u2717")} ${l.description}`),console.log(`      ${e.green("\u2192")} ${l.resolution}${l.time_to_fix?e.gray(` (${l.time_to_fix})`):""}`);console.log();}if(o.learnings&&o.learnings.length>0){console.log(e.gray("  Learnings:"));for(let l of o.learnings)console.log(`    ${e.blue("\u2022")} ${l}`);console.log();}if(o.verification){let l=o.verification.status==="pass"?e.green("\u2713 pass"):o.verification.status==="fail"?e.red("\u2717 fail"):o.verification.status==="partial"?e.yellow("\u26A0 partial"):e.gray("\xB7 untested");if(console.log(`  Verification: ${l}`),o.verification.details)for(let[n,f]of Object.entries(o.verification.details)){let d=f==="pass"?e.green("\u2713"):e.red("\u2717");console.log(`    ${d} ${n}`);}console.log();}if(o.review){let l=n=>e.yellow("\u2605".repeat(n)+"\u2606".repeat(5-n));console.log(e.gray("  Review:")),console.log(`    Reviewer: ${o.review.reviewer}`),console.log(`    Completeness: ${l(o.review.completeness)}`),console.log(`    Quality: ${l(o.review.quality)}`),o.review.notes&&console.log(`    Notes: ${o.review.notes}`),console.log();}if(o.commit&&console.log(`  Commit: ${e.gray(o.commit)}`),o.git_context){let l=o.git_context;console.log(e.gray("  Git context:")),console.log(`    ${e.gray(l.ref.slice(0,8))} on ${e.cyan(l.branch)}${l.dirty?e.yellow(" (dirty)"):""}`),console.log();}if(o.meta&&Object.keys(o.meta).length>0){console.log(e.gray("  Metadata:"));for(let[l,n]of Object.entries(o.meta))console.log(`    ${e.white(l)}: ${e.gray(String(n))}`);console.log();}o.tags&&o.tags.length>0&&console.log(`  Tags: ${o.tags.map(l=>e.gray(`[${l}]`)).join(" ")}`),console.log();}export{h as loreShowCommand};