#!/usr/bin/env node
import {b}from'./chunk-J6KWGCHN.js';import'./chunk-TYWB5IQJ.js';import'./chunk-ORDKEGII.js';import'./chunk-BV5PRPLB.js';import'./chunk-AO7ZSRME.js';import'./chunk-FYDRENK7.js';import'./chunk-EKZDFEJW.js';import'./chunk-SHD27BQX.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as a from'path';import o from'chalk';async function D(l,f,t){let d=f?a.resolve(f):process.cwd();if(!l){t.json?console.log(JSON.stringify({error:"Orchestration ID required"})):(console.log(o.red(`
Orchestration ID required.`)),console.log(o.gray(`Usage: paradigm team diff <orchestration-id>
`)));return}let e=new b(d).getOrchestration(l);if(!e){t.json?console.log(JSON.stringify({error:"Orchestration not found",id:l})):console.log(o.red(`
Orchestration not found: ${l}
`));return}if(t.json){console.log(JSON.stringify({id:e.id,task:e.task,status:e.status,artifacts:e.artifacts},null,2));return}if(console.log(),console.log(o.blue("\u2501".repeat(60))),console.log(o.blue(`  Diff: ${e.id}`)),console.log(o.blue("\u2501".repeat(60))),console.log(),console.log(o.gray(`  Task: ${e.task.slice(0,50)}${e.task.length>50?"...":""}`)),console.log(o.gray(`  Status: ${e.status}`)),console.log(),e.artifacts.length===0){console.log(o.gray("  No file changes in this orchestration.")),console.log();return}console.log(o.cyan("  Files Changed:")),console.log();let s=[],r=[],c=[];for(let n of e.artifacts)n.action==="created"?s.push(n.path):n.action==="modified"?r.push(n.path):n.action==="deleted"&&c.push(n.path);if(s.length>0){console.log(o.green("  Created:"));for(let n of s)if(console.log(o.green(`    + ${n}`)),t.full){let h=a.join(d,n);if(i.existsSync(h)){let g=i.readFileSync(h,"utf-8"),m=g.split(`
`).slice(0,20);for(let p of m)console.log(o.gray(`      \u2502 ${p}`));g.split(`
`).length>20&&console.log(o.gray(`      \u2502 ... (${g.split(`
`).length-20} more lines)`));}}console.log();}if(r.length>0){console.log(o.yellow("  Modified:"));for(let n of r)console.log(o.yellow(`    ~ ${n}`));console.log();}if(c.length>0){console.log(o.red("  Deleted:"));for(let n of c)console.log(o.red(`    - ${n}`));console.log();}console.log(o.gray("\u2500".repeat(60))),console.log(o.gray(`  Summary: ${s.length} created, ${r.length} modified, ${c.length} deleted`)),console.log(),e.status==="completed"&&(console.log(o.cyan("  Actions:")),console.log(o.gray(`    paradigm team accept ${e.id}  # Accept these changes`)),console.log(o.gray(`    paradigm team reject ${e.id}  # Reject and cleanup`)),console.log());}export{D as teamDiffCommand};