import{V3 as B,W3 as _}from"./cli-0.5.3-ea94acj4.mjs";import{Caa as J,Faa as Q,Yaa as Z}from"./cli-0.5.3-t65dek0m.mjs";import"./cli-0.5.3-kavpx97n.mjs";import"./cli-0.5.3-9bdwhdys.mjs";import"./cli-0.5.3-ttc72eq3.mjs";import"./cli-0.5.3-g75gdzrp.mjs";import"./cli-0.5.3-1rg2r7n7.mjs";import"./cli-0.5.3-6j2jk6dt.mjs";import"./cli-0.5.3-66650sba.mjs";import"./cli-0.5.3-9vh3vpap.mjs";import"./cli-0.5.3-n3cxyxpg.mjs";import"./cli-0.5.3-kbvzmaax.mjs";import"./cli-0.5.3-7wdgps7z.mjs";import"./cli-0.5.3-c8bcrqa4.mjs";import"./cli-0.5.3-qrvd6cmy.mjs";import"./cli-0.5.3-2dk1sk8w.mjs";import{Xma as U}from"./cli-0.5.3-0df3r78b.mjs";function V(){return D={id:`arc_${Date.now()}`,goals:[],decisions:[],milestones:[],knowledgeGraph:{entities:{},relations:[]},currentPhase:"init",startTime:Date.now(),lastUpdateTime:Date.now()},D}function G(){if(!D)return V();return D}function X(){let l=G();if(!l||Object.keys(l.knowledgeGraph.entities).length===0)return"";let C="\\nKnowledge Graph:\\n";for(let w of Object.values(l.knowledgeGraph.entities)){C+=`- [${w.type}] ${w.name}`;let b=Object.entries(w.attributes);if(b.length>0)C+=` (${b.map(([f,$])=>`${f}: ${$}`).join(", ")})`;C+="\\n"}for(let w of l.knowledgeGraph.relations){let b=l.knowledgeGraph.entities[w.sourceId]?.name,f=l.knowledgeGraph.entities[w.targetId]?.name;if(b&&f)C+=`- ${b} --(${w.type})--> ${f}\\n`}return C}function N(){let l=G();if(!l)return"No conversation arc";let C=l.goals.filter((f)=>f.status==="active"||f.status==="pending"),w=l.goals.filter((f)=>f.status==="completed"),b=`Phase: ${l.currentPhase}\\n`;if(b+=`Goals: ${w.length}/${l.goals.length} completed\\n`,C.length>0)b+=`Active: ${C[0].description.slice(0,50)}...\\n`;if(l.decisions.length>0)b+=`Decisions: ${l.decisions.length}\\n`;if(l.milestones.length>0)b+=`Latest milestone: ${l.milestones[l.milestones.length-1].description.slice(0,40)}`;return b+=X(),b}function q(){D=null}function x(){let l=G();if(!l)return null;return{phase:l.currentPhase,goalCount:l.goals.length,completedGoals:l.goals.filter((C)=>C.status==="completed").length,decisionCount:l.decisions.length,milestoneCount:l.milestones.length,durationMs:l.lastUpdateTime-l.startTime}}var D=null;var H=()=>{};var E=async(l,C)=>{let b=(l?String(l):"").trim().toLowerCase().split(/\s+/).filter(Boolean),f=b[0];if(!f||f==="status"){let $=Q(),L=x(),j=G(),S=Object.keys(j?.knowledgeGraph.entities||{}).length,T=$.knowledgeGraphEnabled!==!1?B.green("ENABLED"):B.red("DISABLED"),K=`${B.bold("Knowledge Graph Engine")}: ${T}
`;if(L)K+=`• Stats: ${L.goalCount} goals, ${L.milestoneCount} milestones, ${S} technical facts learned`;return{type:"text",value:K}}if(f==="enable"){let $=b[1],L=$==="yes"||$==="true";if(!L&&!($==="no"||$==="false"))return{type:"text",value:"Usage: /knowledge enable <yes|no>"};return J((S)=>({...S,knowledgeGraphEnabled:L})),{type:"text",value:`✨ Knowledge Graph engine ${L?B.green("enabled"):B.red("disabled")}.`}}if(f==="clear")return q(),{type:"text",value:"\uD83D\uDDD1️ Knowledge graph memory has been cleared for this session."};if(f==="list")return{type:"text",value:N()};return{type:"text",value:`Unknown subcommand: ${f}. Available: enable, clear, status, list`}};var z=U(()=>{H();Z();_()});z();export{E as call};
