#!/usr/bin/env node
import {a as a$4,c,b as b$2,d as d$3,e as e$1}from'./chunk-UHQLYIRI.js';import {b}from'./chunk-HPAHK4AJ.js';import'./chunk-A7KFOJ2F.js';import'./chunk-TYWB5IQJ.js';import'./chunk-UDUHSHO4.js';import'./chunk-FYDRENK7.js';import'./chunk-HXGYVS2N.js';import {d as d$2}from'./chunk-AO7ZSRME.js';import'./chunk-Y4XFVDZC.js';import {a as a$6}from'./chunk-SXO7NC6A.js';import {d as d$1}from'./chunk-W5IWDW4Y.js';import {a as a$3,b as b$1}from'./chunk-TZZNHUAR.js';import'./chunk-SHD27BQX.js';import {a as a$7}from'./chunk-LKFBDUCV.js';import'./chunk-EKZDFEJW.js';import {a as a$1}from'./chunk-33LKBMVK.js';import {b as b$3}from'./chunk-JBDMCRPP.js';import'./chunk-4TXOVRWD.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-VCKKJDLP.js';import'./chunk-WR6D3SC6.js';import {a as a$2}from'./chunk-UIKLE3WD.js';import {a as a$5}from'./chunk-QNZEG7IT.js';import'./chunk-HMQ5BHP2.js';import'./chunk-JQKKVAAN.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as s from'fs';import*as ne from'os';import*as d from'path';import e from'chalk';import ke from'ora';import*as h from'js-yaml';import*as v from'fs/promises';var ae=[{path:".paradigm/config.yaml",defaultContent:['version: "2.0"','project: ""','description: ""','initialized: ""'].join(`
`)+`
`},{path:".paradigm/agents.yaml",defaultContent:['version: "1.0"',"agents: []"].join(`
`)+`
`},{path:".paradigm/roster.yaml",defaultContent:['version: "1.0"',"active: []"].join(`
`)+`
`},{path:".paradigm/adoptions.yaml",defaultContent:['version: "1.0"','adopted-at: ""','project-type: ""',"agents: {}"].join(`
`)+`
`},{path:".paradigm/team-state.yaml",defaultContent:['version: "1.0"',"models: {}","state: {}"].join(`
`)+`
`},{path:".paradigm/fixtures.yaml",defaultContent:['version: "1.0"',"fixtures: []"].join(`
`)+`
`},{path:".paradigm/navigator.yaml",defaultContent:['version: "1.0"',"entries: []"].join(`
`)+`
`},{path:".paradigm/flows.yaml",defaultContent:['version: "1.0"',"flows: []"].join(`
`)+`
`},{path:".paradigm/tags.yaml",defaultContent:['version: "1.0"',"tags: []"].join(`
`)+`
`},{path:".paradigm/habits.yaml",defaultContent:['version: "1.0"',"habits: []"].join(`
`)+`
`},{path:".paradigm/graduation.yaml",defaultContent:['version: "1.0"',"graduations: []"].join(`
`)+`
`},{path:"portal.yaml",defaultContent:['version: "2.0"',"gates: []","routes: []"].join(`
`)+`
`},{path:".purpose",defaultContent:['version: "2.0"',"id: root",'description: ""',"components: []"].join(`
`)+`
`},{path:".premise",defaultContent:['version: "1.0"','premise: ""'].join(`
`)+`
`},{path:".paradigm/events/stream.jsonl",defaultContent:""},{path:".paradigm/events/nominations.jsonl",defaultContent:""},{path:".paradigm/events/debates.jsonl",defaultContent:""},{path:".paradigm/events/notebook-refs.jsonl",defaultContent:""},{path:".paradigm/events/session-log.jsonl",defaultContent:""},{path:".paradigm/history/index.yaml",defaultContent:['version: "1.0"',"entries: []"].join(`
`)+`
`},{path:".paradigm/history/log.jsonl",defaultContent:""},{path:".paradigm/lore/timeline.yaml",defaultContent:['version: "1.0"',"entries: []"].join(`
`)+`
`},{path:".paradigm/wisdom/antipatterns.yaml",defaultContent:['version: "1.0"',"antipatterns: []"].join(`
`)+`
`},{path:".paradigm/personas/index.yaml",defaultContent:['version: "1.0"',"personas: {}"].join(`
`)+`
`},{path:".paradigm/protocols/index.yaml",defaultContent:['version: "1.0"',"protocols: []"].join(`
`)+`
`},{path:".paradigm/notebooks/",defaultContent:"",isDir:true},{path:".paradigm/university/config.yaml",defaultContent:['version: "1.0"',"enabled: true","auto-enroll: true"].join(`
`)+`
`},{path:".paradigm/university/index.yaml",defaultContent:['version: "1.0"',"entries: []"].join(`
`)+`
`},{path:".paradigm/university/content/notes/",defaultContent:"",isDir:true},{path:".paradigm/university/content/policies/",defaultContent:"",isDir:true},{path:".paradigm/university/content/quizzes/",defaultContent:"",isDir:true},{path:".paradigm/university/content/paths/",defaultContent:"",isDir:true},{path:"CLAUDE.md",defaultContent:`# Project Context

Generated by paradigm shift.
`},{path:"AGENTS.md",defaultContent:`# Agents

Generated by paradigm shift.
`},{path:".cursor/rules/",defaultContent:"",isDir:true},{path:".claude/hooks/",defaultContent:"",isDir:true}];async function Y(o){let n=[],l=[];for(let r of ae){let f=d.join(o,r.path);if(r.isDir)await Q(f)?l.push(r.path):(await v.mkdir(f,{recursive:true}),n.push(r.path));else if(await Q(f))l.push(r.path);else {let i=d.dirname(f);await v.mkdir(i,{recursive:true}),await v.writeFile(f,r.defaultContent,"utf-8"),n.push(r.path);}}return {created:n,existed:l}}async function Q(o){try{return await v.access(o),!0}catch{return  false}}var ie=4,se=50,ce=['description: ""',"components: []","description: ''"],le={"claude-code":["opus","sonnet","haiku"],cursor:["sonnet","sonnet","haiku"],fallback:["sonnet","sonnet","sonnet"]};async function Z(o){let n=await Promise.allSettled([de(o),me(o),fe(o),pe(o),ue(o),ge(o),he(o),ye(o),we()]),l=[];for(let i of n)i.status==="fulfilled"&&i.value&&l.push(i.value);l.sort((i,j)=>i.priority-j.priority);let r=l.filter(i=>i.type==="action"),f=l.filter(i=>i.type==="info");return [...r.slice(0,ie),...f]}function ee(o){if(o.length===0)return "";let n=o.filter(p=>p.type==="action"),l=o.filter(p=>p.type==="info"),r=[];r.push(""),r.push(e.bold("  Recommendations")),r.push(e.gray("  "+"\u2500".repeat(49)));for(let p=0;p<n.length;p++){let i=n[p],j=e.white(`  ${p+1}. `),w=e.white(i.message);i.command?(r.push(j+w),r.push("     "+e.cyan(i.command))):r.push(j+w);}if(l.length>0){r.push("");for(let p of l)r.push(e.dim("  "+p.message));}let f=n.length;if(f>0){r.push("");let p=f===1?"item needs":"items need";r.push(e.dim(`  ${f} ${p} attention.`));}return r.push(""),r.join(`
`)}async function de(o){let n=d.join(o,".purpose");try{let l=await v.readFile(n,"utf-8");if(l.trim().length<se)return {id:"empty-purpose",priority:1,message:"Edit `.purpose` to define your project's features",command:void 0,type:"action"};if(ce.some(f=>l.includes(f)))return {id:"empty-purpose",priority:1,message:"Edit `.purpose` to define your project's features",command:void 0,type:"action"}}catch{return {id:"empty-purpose",priority:1,message:"Edit `.purpose` to define your project's features",command:void 0,type:"action"}}return null}async function me(o){let n=["src","packages","apps"];for(let r of n){let f=d.join(o,r);if(!s.existsSync(f))continue;if(await te(f))return null}return n.some(r=>s.existsSync(d.join(o,r)))?{id:"no-sub-purpose",priority:2,message:"Add `.purpose` files to feature directories",command:void 0,type:"action"}:null}async function fe(o){let n=d.join(o,"portal.yaml");try{let l=await v.readFile(n,"utf-8"),r=l.includes("gates:")&&!l.match(/gates:\s*(\[\]|\{\})\s*$/m)&&!l.match(/gates:\s*(\[\]|\{\})\s*\n/),f=l.includes("routes:")&&!l.match(/routes:\s*(\[\]|\{\})\s*$/m)&&!l.match(/routes:\s*(\[\]|\{\})\s*\n/);if(!r&&!f)return {id:"empty-portal",priority:3,message:"Define auth gates in `portal.yaml` if your project has auth",command:void 0,type:"action"}}catch{return {id:"empty-portal",priority:3,message:"Define auth gates in `portal.yaml` if your project has auth",command:void 0,type:"action"}}return null}async function pe(o){let n=d.join(o,".paradigm","agents.yaml");try{let l=await v.readFile(n,"utf-8");if(l.includes("agents: []")||l.trim().length<40)return {id:"agents-unconfigured",priority:4,message:"Review agent roles",command:"paradigm agent list",type:"action"}}catch{return null}return null}async function ue(o){let n=d.join(o,".paradigm",".pending-scope-reviews");return s.existsSync(n)?{id:"pending-scope-reviews",priority:2,message:"Review agent scopes",command:"paradigm agent review",type:"action"}:null}async function ge(o){let n=d.join(o,".paradigm","config.yaml");try{let l=await v.readFile(n,"utf-8");if(!l.includes("model-resolution"))return null;let r=l.match(/tier-1:\s*(\S+)/),f=l.match(/tier-2:\s*(\S+)/),p=l.match(/tier-3:\s*(\S+)/);if(!r||!f||!p)return null;let i=[r[1].replace(/['"]/g,""),f[1].replace(/['"]/g,""),p[1].replace(/['"]/g,"")];if(Object.values(le).some(w=>w[0]===i[0]&&w[1]===i[1]&&w[2]===i[2]))return {id:"model-tiers-default",priority:5,message:"Fine-tune model tiers",command:"paradigm team models",type:"action"}}catch{return null}return null}async function he(o){let n=d.join(o,".paradigm","lore","entries");try{if((await v.readdir(n)).filter(f=>!f.startsWith(".")).length===0)return {id:"no-lore",priority:8,message:"Lore records automatically as you work",command:void 0,type:"info"}}catch{return {id:"no-lore",priority:8,message:"Lore records automatically as you work",command:void 0,type:"info"}}return null}async function ye(o){let n=d.join(o,".paradigm","notebooks");try{if((await v.readdir(n)).filter(f=>!f.startsWith(".")).length===0)return {id:"no-notebooks",priority:8,message:"Agent notebooks build over time",command:void 0,type:"info"}}catch{return {id:"no-notebooks",priority:8,message:"Agent notebooks build over time",command:void 0,type:"info"}}return null}async function we(){return {id:"verify-not-run",priority:6,message:"Verify setup health",command:"paradigm doctor --verify",type:"action"}}async function te(o,n=0){if(n>4)return  false;try{let l=await v.readdir(o,{withFileTypes:!0});for(let r of l)if(!(r.isDirectory()&&["node_modules","dist",".git",".next",".paradigm","build","out","target",".turbo"].includes(r.name))&&(r.name===".purpose"&&!r.isDirectory()||r.isDirectory()&&await te(d.join(o,r.name),n+1)))return !0}catch{a.operation("shift-recommendations").debug("Could not read directory",{dir:o});}return  false}var oe=new Set(["architect","builder","reviewer","security","advocate","tester","compliance","documentor"]),M={architect:{nickname:"Apex",role:"System design, specifications"},builder:{nickname:"Kit",role:"Implementation, tests"},reviewer:{nickname:"Judge",role:"Code quality, compliance"},security:{nickname:"Aegis",role:"Auth flows, vulnerability scanning"},advocate:{nickname:"Jinx",role:"Stress testing, edge cases"},tester:{nickname:"Probe",role:"Unit and integration tests"},compliance:{nickname:"Rune",role:"Symbol compliance enforcement"},documentor:{nickname:"Scribe",role:".purpose, portal.yaml maintenance"}};function Se(o){let n=[],l=d.join(ne.homedir(),".paradigm","agents");for(let[r,f]of Object.entries(o.agents)){let p,i=r,j=d.join(l,`${r}.agent`);if(s.existsSync(j))try{let x=s.readFileSync(j,"utf8"),C=h.load(x);C?.nickname&&(p=C.nickname),C?.role&&(i=C.role);}catch{}!p&&M[r]&&(p=M[r].nickname,i=M[r].role);let w=f.source==="core"||f.source==="ecosystem"?f.source:oe.has(r)?"core":"ecosystem";n.push({id:r,nickname:p,role:i,source:w});}return n}async function _e(o={}){let n=process.cwd(),l=d.basename(n),r=d.join(n,".paradigm"),f=s.existsSync(r)&&s.statSync(r).isDirectory();console.log(e.blue(`
\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(e.blue("\u2502")+e.white.bold("  paradigm shift                                 ")+e.blue("\u2502")),console.log(e.blue("\u2502")+e.gray("  Full project setup in one command              ")+e.blue("\u2502")),console.log(e.blue(`\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
`)),console.log(e.white(`  \u{1F4C1} Project: ${e.cyan(l)}`)),console.log(e.white(`  \u{1F4CD} Status: ${f?e.green("Paradigm detected"):e.yellow("New project")}`)),console.log("");let p=a.command("shift").start("Running paradigm shift",{project:l}),i=ke();if(!f||o.force){i.start("Step 1/6: Initializing Paradigm...");try{await a$1({force:o.force,quick:!0,name:l,stack:o.stack}),i.succeed(e.green("Paradigm initialized"));}catch(t){i.fail(e.red(`Init failed: ${t.message}`)),p.error("Shift failed at init",{error:t.message});return}}else {i.succeed(e.gray("Step 1/6: Already initialized (use --force to reinit)"));let t=d.join(r,"config.yaml");if(s.existsSync(t))try{let a=s.readFileSync(t,"utf8"),c=h.load(a);if(!c.discipline||c.discipline==="auto"){let m=a$2(n);if(m!=="backend"){let u=a.replace(/^discipline:\s*auto\b.*$/m,`discipline: ${m}`);u!==a&&(s.writeFileSync(t,u,"utf8"),console.log(e.green(`  \u2713 Detected discipline: ${e.cyan(m)} (updated config.yaml)`)));}else if(!c.discipline){let u=a.replace(/^(project:\s*.+)$/m,`$1
discipline: ${m}`);u!==a&&(s.writeFileSync(t,u,"utf8"),console.log(e.green(`  \u2713 Added discipline: ${e.cyan(m)} to config.yaml`)));}}}catch(a$1){a.operation("shift").debug("Discipline detection failed",{error:a$1.message});}}if(f){i.start("Step 1b/6: Checking for migrations...");try{let{migrateCommand:t}=await import('./migrate-YQG2FG3J.js');await t({apply:!0,quiet:!0,noSync:!0}),i.succeed(e.green("Migrations applied"));}catch(t){i.warn(e.yellow(`Migration warning: ${t.message}`));}}{let t=d.join(r,"config.yaml");if(o.workspace&&s.existsSync(t)){let a$1=o.workspacePath?d.resolve(n,o.workspacePath):d.join(d.dirname(n),".paradigm-workspace");if(s.existsSync(a$1))try{let c=h.load(s.readFileSync(a$1,"utf8")),m=d.basename(n),u=d.dirname(a$1),g="./"+d.relative(u,n);if(c.members.some(b=>d.resolve(u,b.path)===n))console.log(e.green(`  \u2713 Already a member of workspace: ${e.cyan(c.name)}`));else {let b=d$1(m,n);c.members.push({name:m,path:g,...b&&{role:b}}),s.writeFileSync(a$1,h.dump(c,{indent:2,lineWidth:120,noRefs:!0,sortKeys:!1,quotingType:'"'}),"utf8"),console.log(e.green(`  \u2713 Joined workspace: ${e.cyan(c.name)} (added as member)`));}}catch(c){console.log(e.yellow(`  \u26A0 Failed to join workspace: ${c.message}`));}else try{let c=d.basename(n),m=d.dirname(a$1),u="./"+d.relative(m,n),g=d$1(c,n),y={version:"1.0",name:o.workspace,members:[{name:c,path:u,...g&&{role:g}}]};s.mkdirSync(d.dirname(a$1),{recursive:!0}),s.writeFileSync(a$1,h.dump(y,{indent:2,lineWidth:120,noRefs:!0,sortKeys:!1,quotingType:'"'}),"utf8"),console.log(e.green(`  \u2713 Created workspace: ${e.cyan(o.workspace)} at ${e.gray(d.relative(n,a$1))}`));}catch(c){console.log(e.yellow(`  \u26A0 Failed to create workspace: ${c.message}`));}try{let c=s.readFileSync(t,"utf8"),m=h.load(c),u=d.relative(n,a$1);if(m.workspace!==u){if(m.workspace){let g=c.replace(/^workspace:\s*.*$/m,`workspace: "${u}"`);s.writeFileSync(t,g,"utf8");}else {let g=c.trimEnd()+`
workspace: "${u}"
`;s.writeFileSync(t,g,"utf8");}console.log(e.green("  \u2713 Linked workspace in config.yaml"));}}catch(c){a.operation("shift").debug("Workspace config link failed",{error:c.message});}}else if(s.existsSync(t))try{let a=s.readFileSync(t,"utf8");if(!h.load(a).workspace){let m=d.dirname(n);for(let u=0;u<3;u++){let g=d.join(m,".paradigm-workspace");if(s.existsSync(g)){let b=d.relative(n,g),re=a.trimEnd()+`
workspace: "${b}"
`;s.writeFileSync(t,re,"utf8"),console.log(e.green(`  \u2713 Found workspace: ${e.cyan(b)} (added to config.yaml)`));break}let y=d.dirname(m);if(y===m)break;m=y;}}}catch(a$1){a.operation("shift").debug("Workspace auto-detect failed",{error:a$1.message});}}if(!d$2(n)||o.force){console.log(e.cyan("  Step 2/6: Initializing team configuration..."));try{await b(n,{force:o.force,json:!1,configureModels:o.configureModels||!1,noConfigureModels:!o.configureModels}),console.log(e.green(`  \u2713 Team configuration initialized
`));}catch(t){console.log(e.yellow(`  \u26A0 Team init warning: ${t.message}
`));}}else i.succeed(e.gray("Step 2/6: Team already configured (use --force to reinit)"));let w=d.join(n,".paradigm","roster.yaml");if(!s.existsSync(w)||o.force)try{let t=a$3(n),a=b$1[t]||b$1.generic,c={version:"1.0",project:l,type:t,active:a.sort()};s.writeFileSync(w,h.dump(c,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(`  \u2713 Agent roster set: ${e.cyan(a.length)} agents for ${e.cyan(t)}`));}catch(t){a.operation("shift").debug("Roster setup failed",{error:t.message});}else try{let a=h.load(s.readFileSync(w,"utf8"))?.active?.length??0;console.log(e.gray(`  \u2713 Agent roster exists (${a} agents active)`));}catch{console.log(e.gray("  \u2713 Agent roster exists"));}{let t=d.join(n,".paradigm","adoptions.yaml"),a$1=s.existsSync(t);try{let c$1=a$3(n),m=a$1?await a$4(n):null,u=m&&Object.keys(m.agents).length>0;if(!u&&s.existsSync(w))m=await c(n),await b$2(n,m),a.operation("shift").debug("Migrated roster to adoptions",{count:Object.keys(m.agents).length});else if(!u){m=d$3(c$1);let g=s.existsSync(w)?h.load(s.readFileSync(w,"utf8")):{active:[]},y=new Date().toISOString();for(let b of g.active||[])m.agents[b]={adopted:y,source:oe.has(b)?"core":"ecosystem",defaultsAccepted:!0};Object.keys(m.agents).length>0&&await b$2(n,m);}if(m&&Object.keys(m.agents).length>0){let g=Se(m),y=e$1(g,c$1);console.log(y),console.log(e.green(`  \u2713 ${Object.keys(m.agents).length} agents adopted`));}}catch(c){a.operation("shift").debug("Adoption ceremony failed",{error:c.message});}}{let t=d.join(r,"config.yaml");if(s.existsSync(t))try{let a=s.readFileSync(t,"utf8"),c=h.load(a);if(!c["model-resolution"]||o.force){let{ModelDiscovery:m}=await import('./model-discovery-HMB3YI4L.js'),g=new m(n).detectEnvironment(),y;g==="claude-code"?y={"tier-1":"opus","tier-2":"sonnet","tier-3":"haiku"}:g==="cursor"?y={"tier-1":"sonnet","tier-2":"sonnet","tier-3":"haiku"}:y={"tier-1":"sonnet","tier-2":"sonnet","tier-3":"sonnet"},c["model-resolution"]=y,s.writeFileSync(t,h.dump(c,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(`  \u2713 Model tiers configured for ${e.cyan(g)}: tier-1=${y["tier-1"]}, tier-2=${y["tier-2"]}, tier-3=${y["tier-3"]}`));}}catch(a$1){a.operation("shift").debug("Model tier config failed",{error:a$1.message});}}try{let{ensureEnforcementDefaults:t}=await import('./enforcement-BEGPQIUN.js');t(n)&&console.log(e.green(`  \u2713 Enforcement config initialized (${e.cyan("balanced")} preset)`));}catch(t){a.operation("shift").debug("Enforcement config setup failed",{error:t.message});}{i.start("Ensuring core files...");try{let{created:t,existed:a}=await Y(n);i.succeed(e.green(`Core files ensured: ${e.cyan(String(t.length))} created, ${e.cyan(String(a.length))} already existed`));}catch(t){i.warn(e.yellow(`Guaranteed files warning: ${t.message}`));}}if(o.quick)i.succeed(e.gray("Step 3/6: Skipped scan (--quick mode)"));else {i.start("Step 3/6: Scanning and indexing symbols...");try{await b$3(n,{quiet:!0}),i.succeed(e.green("Symbols indexed"));}catch(t){i.warn(e.yellow(`Scan warning: ${t.message}`));}}{let t=d.join(r,"config.yaml");if(s.existsSync(t))try{if(h.load(s.readFileSync(t,"utf8")).workspace){i.start("Step 3b/6: Reindexing workspace members...");try{let{workspaceReindexCommand:c}=await import('./workspace-2ODL5WLY.js');await c({quiet:!0}),i.succeed(e.green("Workspace members reindexed"));}catch(c){i.warn(e.yellow(`Workspace reindex: ${c.message}`));}}}catch(a$1){a.operation("shift").debug("Workspace config read failed",{error:a$1.message});}}let x=d.join(n,"portal.yaml");s.existsSync(x)||s.writeFileSync(x,h.dump({version:"1.0.0",gates:{},routes:{}},{lineWidth:-1,noRefs:true}),"utf8");let C=d.join(n,".paradigm","lore");s.existsSync(C)||s.mkdirSync(C,{recursive:true});let I=d.join(n,".paradigm","university");for(let t of ["content/notes","content/policies","content/quizzes","content/paths","diplomas"]){let a=d.join(I,t);s.existsSync(a)||s.mkdirSync(a,{recursive:true});}let N=d.join(I,"config.yaml");if(!s.existsSync(N)){let t="Project";try{let c=d.join(n,".paradigm","config.yaml");if(s.existsSync(c)){let m=h.load(s.readFileSync(c,"utf8"));m.project&&typeof m.project=="string"&&(t=m.project);}}catch{}let a={branding:{name:`${t} University`,tagline:`Learn the ${t} codebase`,institution:t},theme:{primary:"#6366f1",secondary:"#8b5cf6",accent:"#f59e0b",background:"#0f172a",surface:"#1e293b",text:"#f8fafc",textMuted:"#94a3b8",success:"#22c55e",error:"#ef4444",font:"Inter, system-ui, sans-serif"},content:{categories:[],defaultDifficulty:"beginner",requireApproval:false},diplomas:{includeGlobalPLSAT:true}};s.writeFileSync(N,h.dump(a,{lineWidth:-1,noRefs:true}),"utf8");}i.start("Step 4/6: Syncing IDE configurations...");try{let t=o.ide?[o.ide]:["claude","cursor","copilot","windsurf","agents"],a=[];for(let c of t)try{await a$5(c,{quiet:!0,force:!0}),a.push(c);}catch{}a.length>0?i.succeed(e.green(`IDE configs synced: ${a.join(", ")}`)):i.warn(e.yellow("No IDE configs to sync"));}catch(t){i.warn(e.yellow(`Sync warning: ${t.message}`));}i.start("Step 5/6: Installing hooks...");try{await a$6({force:o.force}),i.succeed(e.green("Hooks installed (git + Claude Code + Cursor)"));}catch(t){i.warn(e.yellow(`Hooks warning: ${t.message}`));}if(o.verify){i.start("Step 6/6: Running health checks...");try{await a$7({quiet:!0})?i.succeed(e.green("All health checks passed")):i.warn(e.yellow("Some health checks need attention"));}catch(t){i.warn(e.yellow(`Doctor warning: ${t.message}`));}}else i.succeed(e.gray("Step 6/6: Skipped verify (use --verify to check health)"));console.log(""),console.log(e.blue("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")),console.log(e.blue("\u2502")+e.white.bold("  \u2728 Paradigm shift complete!                    ")+e.blue("\u2502")),console.log(e.blue("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")),console.log(""),console.log(e.white("  Created/Updated:")),console.log(e.gray("  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));let O=[{path:".paradigm/config.yaml",desc:"Project configuration"},{path:".paradigm/navigator.yaml",desc:"Symbol navigation map"},{path:".paradigm/agents.yaml",desc:"Team agent configuration"},{path:".paradigm/adoptions.yaml",desc:"Agent adoption records"},{path:".purpose",desc:"Root feature definitions"},{path:".paradigm/lore/",desc:"Project lore timeline",isDir:true},{path:"portal.yaml",desc:"Authorization gates"},{path:".paradigm/roster.yaml",desc:"Agent roster for this project"},{path:"CLAUDE.md",desc:"Claude Code AI instructions"},{path:"AGENTS.md",desc:"Universal AI agent instructions"},{path:".cursor/rules/",desc:"Cursor AI instructions",isDir:true},{path:".claude/hooks/",desc:"Claude Code enforcement hooks",isDir:true,optional:true},{path:".cursor/hooks/",desc:"Cursor enforcement hooks",isDir:true,optional:true}],G=d.join(r,"config.yaml");if(s.existsSync(G))try{let t=h.load(s.readFileSync(G,"utf8"));if(typeof t.workspace=="string"){let a=d.resolve(n,t.workspace),c=d.relative(n,a);O.push({path:c,desc:"Multi-project workspace",optional:!0});}}catch(t){a.operation("shift").debug("Summary config read failed",{error:t.message});}for(let t of O){let a=d.join(n,t.path);s.existsSync(a)?console.log(e.green("  \u2713 ")+e.white(t.path.padEnd(28))+e.gray(t.desc)):t.optional||console.log(e.yellow("  \u25CB ")+e.gray(t.path.padEnd(28))+e.gray(`(${t.desc})`));}try{let t=await Z(n),a=ee(t);a&&console.log(a);}catch(t){a.operation("shift").debug("Recommendations engine failed",{error:t.message}),console.log(""),console.log(e.white("  Next steps:")),console.log(e.gray("  "+"\u2500".repeat(49))),console.log(e.white("  1. ")+e.gray("Edit ")+e.cyan(".purpose")+e.gray(" to define your features")),console.log(e.white("  2. ")+e.gray("Run ")+e.cyan("paradigm shift --verify")+e.gray(" to check health")),console.log("");}p.success("Paradigm shift complete",{project:l});}export{_e as shiftCommand};