#!/usr/bin/env node
import {m,o as o$1,B}from'./chunk-T6IDXUUA.js';import {e}from'./chunk-JIXHEBGK.js';import {e as e$1}from'./chunk-QT2LKB3P.js';import {a as a$1}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as l from'fs';import*as a from'path';import o from'chalk';import G from'ora';async function D(){let t=process.cwd();console.log(o.blue(`
\u{1F4CA} Paradigm Status
`)),console.log(o.gray("\u2500".repeat(40)));let i=a$1.command("status").start("Getting project status"),r=G("Scanning project...").start(),p=l.existsSync(a.join(t,".premise")),m$1=l.existsSync(a.join(t,".purpose")),f=l.existsSync(a.join(t,"portal.yaml"));r.stop(),console.log(o.white(`
Configuration Files`)),console.log(o.gray("\u2500".repeat(40))),console.log(`  .premise:     ${p?o.green("\u2713 Found"):o.yellow("\u25CB Not found")}`),console.log(`  .purpose:   ${m$1?o.green("\u2713 Found"):o.yellow("\u25CB Not found")}`),console.log(`  portal.yaml:  ${f?o.green("\u2713 Found"):o.yellow("\u25CB Not found")}`),r.start("Counting files...");let u=await e(t),y=await e$1(t);if(r.stop(),console.log(o.white(`
Source Files`)),console.log(o.gray("\u2500".repeat(40))),console.log(`  Purpose files:  ${o.cyan(u.length.toString())}`),console.log(`  Gate files:     ${o.cyan(y.length.toString())}`),p||m$1||f){r.start("Aggregating symbols...");try{let e=await m(t),b=o$1(e),s=B(b);r.stop(),console.log(o.white(`
Symbol Index`)),console.log(o.gray("\u2500".repeat(40)));let j=[{prefix:"#",name:"Components",count:s.component,color:o.green},{prefix:"$",name:"Flows",count:s.flow,color:o.yellow},{prefix:"^",name:"Gates",count:s.gate,color:o.red},{prefix:"!",name:"Signals",count:s.signal,color:o.cyan},{prefix:"~",name:"Aspects",count:s.aspect,color:o.magenta}];for(let{prefix:n,name:c,count:h,color:C}of j)h>0&&console.log(`  ${C(n)} ${c.padEnd(12)} ${o.cyan(h.toString())}`);let d=Object.values(s).reduce((n,c)=>n+c,0);if(console.log(o.gray("\u2500".repeat(40))),console.log(`  Total:          ${o.cyan(d.toString())}`),i.success("Status retrieved",{symbols:d,files:u.length+y.length}),e.errors.length>0){console.log(o.white(`
Warnings`)),console.log(o.gray("\u2500".repeat(40)));for(let n of e.errors)console.log(o.yellow(`  \u26A0 ${n.source}: ${n.message}`));a$1.command("status").warn("Aggregation had errors",{count:e.errors.length});}}catch(e){r.fail("Failed to aggregate"),i.error("Status failed",{error:e.message}),console.log(o.red(`  Error: ${e.message}`));}}console.log("");}export{D as statusCommand};