#!/usr/bin/env node
import {g,h}from'./chunk-7YTAA6XA.js';import'./chunk-XHJ27CER.js';import s from'chalk';async function u(n,e){let a=process.cwd();if(!await g(a,n)){console.error(s.red(`
  Entry not found: ${n}
`)),process.exitCode=1;return}let t={};if(e.title&&(t.title=e.title),e.summary&&(t.summary=e.summary),e.type){let r=["agent-session","human-note","decision","review","incident","milestone"];if(!r.includes(e.type)){console.error(s.red(`Invalid type: ${e.type}. Valid: ${r.join(", ")}`)),process.exitCode=1;return}t.type=e.type;}if(e.symbols&&(t.symbols_touched=e.symbols.split(",").map(r=>r.trim())),e.tags&&(t.tags=e.tags.split(",").map(r=>r.trim())),e.learnings&&(t.learnings=e.learnings.split(",").map(r=>r.trim())),Object.keys(t).length===0){console.log(s.yellow(`
  No changes specified. Use --title, --summary, --type, --symbols, --tags, or --learnings.
`));return}if(await h(a,n,t)){console.log(s.green(`
  Updated lore entry: ${n}`));for(let[r,i]of Object.entries(t)){let c=Array.isArray(i)?i.join(", "):String(i);console.log(s.gray(`    ${r}: ${c}`));}console.log();}else console.error(s.red(`
  Failed to update: ${n}
`)),process.exitCode=1;}export{u as loreEditCommand};