@a-company/paradigm 5.28.0 → 5.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/{accept-orchestration-CLT6SAYW.js → accept-orchestration-MIRBLRUJ.js} +1 -1
  2. package/dist/agent-loader-5255KNM7.js +2 -0
  3. package/dist/agent-loader-A5FMBAFJ.js +2 -0
  4. package/dist/ambient-2JZTNXUL.js +35 -0
  5. package/dist/chunk-2Q7RGCJH.js +3 -0
  6. package/dist/chunk-32RBX5YV.js +9 -0
  7. package/dist/chunk-7SWEOPWF.js +2 -0
  8. package/dist/{chunk-DG236EXP.js → chunk-A7KFOJ2F.js} +1 -1
  9. package/dist/chunk-AGSUX2GJ.js +9 -0
  10. package/dist/chunk-C7ZCCKJT.js +3 -0
  11. package/dist/chunk-EAZ3EMOZ.js +29 -0
  12. package/dist/{chunk-VPMJWJ5R.js → chunk-HPAHK4AJ.js} +1 -1
  13. package/dist/chunk-LKFBDUCV.js +11 -0
  14. package/dist/chunk-S7K7UPXL.js +3 -0
  15. package/dist/{chunk-FSOI3CCD.js → chunk-SXO7NC6A.js} +18 -4
  16. package/dist/{chunk-VNQGILQU.js → chunk-TXBSTT64.js} +4 -4
  17. package/dist/chunk-TZZNHUAR.js +2 -0
  18. package/dist/{chunk-WESTEMIM.js → chunk-UDUHSHO4.js} +1 -1
  19. package/dist/chunk-UHQLYIRI.js +3 -0
  20. package/dist/{compliance-5OYNHE5D.js → compliance-Q676YALK.js} +1 -1
  21. package/dist/compliance-health-JNP3P35P.js +4 -0
  22. package/dist/{diff-YM6ZV3UI.js → diff-QHQWLM3L.js} +1 -1
  23. package/dist/doctor-R4UGMR5N.js +2 -0
  24. package/dist/gap-narrator-NTXLUI7I.js +3 -0
  25. package/dist/{hooks-E7HQQ57M.js → hooks-BNWRGACA.js} +1 -1
  26. package/dist/index.js +5 -5
  27. package/dist/mcp.js +92 -53
  28. package/dist/{migrate-WT56YYAM.js → migrate-YQG2FG3J.js} +1 -1
  29. package/dist/{nomination-engine-LMSZ2CAS.js → nomination-engine-W6QTQX2P.js} +1 -1
  30. package/dist/{orchestrate-4L3NJCV5.js → orchestrate-7CJWHLBA.js} +1 -1
  31. package/dist/{project-type-4Y6CESWP.js → project-type-AGO6VUKF.js} +1 -1
  32. package/dist/{providers-4PXMWA7V.js → providers-TBPOE4DI.js} +1 -1
  33. package/dist/reindex-2MRCAIZG.js +2 -0
  34. package/dist/{roster-K2QILE7K.js → roster-TA2GFDR7.js} +1 -1
  35. package/dist/scopes-commands-3V5G6NYV.js +3 -0
  36. package/dist/session-tracker-WSTRV7UP.js +2 -0
  37. package/dist/session-work-log-5UJTJJ22.js +2 -0
  38. package/dist/session-work-log-SLAPEP3M.js +2 -0
  39. package/dist/shift-IKTWYSEQ.js +60 -0
  40. package/dist/{spawn-UH5RENSE.js → spawn-7TCAMD6H.js} +1 -1
  41. package/dist/{symphony-ZQ5OHJTP.js → symphony-IS5TYPXY.js} +2 -2
  42. package/dist/symphony-relay-CIMRXQHI.js +3 -0
  43. package/dist/{team-MKLPUTW7.js → team-WIJVWLII.js} +1 -1
  44. package/dist/university-content/courses/.purpose +52 -8
  45. package/dist/university-content/courses/para-001.json +166 -0
  46. package/dist/university-content/courses/para-101.json +88 -88
  47. package/dist/university-content/courses/para-201.json +27 -55
  48. package/dist/university-content/courses/para-301.json +114 -8
  49. package/dist/university-content/courses/para-401.json +90 -62
  50. package/dist/university-content/courses/para-501.json +55 -0
  51. package/dist/university-ui/assets/{index-CGFJczb1.js → index-DmiLQehB.js} +2 -2
  52. package/dist/university-ui/assets/{index-CGFJczb1.js.map → index-DmiLQehB.js.map} +1 -1
  53. package/dist/university-ui/index.html +1 -1
  54. package/package.json +1 -1
  55. package/dist/agent-loader-CZFB5BDP.js +0 -2
  56. package/dist/agent-loader-EBERCNMO.js +0 -2
  57. package/dist/ambient-S3CXHD7P.js +0 -35
  58. package/dist/chunk-4DVT5IEY.js +0 -2
  59. package/dist/chunk-5KSNYRT7.js +0 -29
  60. package/dist/chunk-AYYS2AMB.js +0 -3
  61. package/dist/chunk-CSXVL2U7.js +0 -9
  62. package/dist/chunk-QWL3LERH.js +0 -3
  63. package/dist/chunk-SL3RZQPW.js +0 -5
  64. package/dist/chunk-U4J5J7GG.js +0 -3
  65. package/dist/chunk-VKGY42FP.js +0 -5
  66. package/dist/doctor-HMQBF2WK.js +0 -2
  67. package/dist/reindex-BSD7ZIEY.js +0 -2
  68. package/dist/session-tracker-FDFL4PZI.js +0 -2
  69. package/dist/session-work-log-5PHOUEQ6.js +0 -2
  70. package/dist/session-work-log-LWEGZ5CN.js +0 -2
  71. package/dist/shift-WNP27SPB.js +0 -11
  72. package/dist/symphony-relay-KBHN3ZMR.js +0 -3
  73. /package/dist/{chunk-IZSBGW6E.js → chunk-HXGYVS2N.js} +0 -0
@@ -48,7 +48,7 @@ component_types:
48
48
  `),{status:"applied",message:"Added component_types glossary to config.yaml",filesModified:[".paradigm/config.yaml"]}):{status:"error",message:"Cannot read config.yaml"}}},ue={id:"add-discipline-config",introducedIn:"3.4.0",description:"Add discipline field to config.yaml",category:"config",auto:true,async check(e){let t=A(e);return t?D(t,"discipline")?{needed:false,reason:"discipline already set"}:{needed:true,reason:"Missing discipline field"}:{needed:false,reason:"No config.yaml found"}},async apply(e,t){if(t.dryRun)return {status:"skipped",message:"Would add discipline to config.yaml"};let n=I(e);if(!n)return {status:"error",message:"Cannot read config.yaml"};let i=n.replace(/^(project:\s*.+)$/m,`$1
49
49
  discipline: auto`);return i===n?x(e,n.trimEnd()+`
50
50
  discipline: auto
51
- `):x(e,i),{status:"applied",message:"Added discipline: auto to config.yaml",filesModified:[".paradigm/config.yaml"]}}},fe={id:"sync-templates",introducedIn:"evergreen",description:"Update specs/ and docs/ from installed CLI templates",category:"template",auto:true,async check(e){let t=$();if(!t)return {needed:false,reason:"Templates directory not found"};let n=[],i=["specs","docs","prompts"];for(let r of i){let a=p.join(t,r),d=p.join(e,".paradigm",r);if(o.existsSync(a))try{let g=o.readdirSync(a).filter(m=>o.statSync(p.join(a,m)).isFile());for(let m of g)o.existsSync(p.join(d,m))||n.push(`${r}/${m}`);}catch{}}return n.length===0?{needed:false,reason:"All templates are up to date"}:{needed:true,reason:`${n.length} new template file(s) available`,details:n.map(r=>`New: ${r}`)}},async apply(e,t){let n=$();if(!n)return {status:"error",message:"Templates directory not found"};let i=p.basename(e),r=[],a=["specs","docs","prompts"];for(let d of a){let g=p.join(n,d),m=p.join(e,".paradigm",d);if(o.existsSync(g)){t.dryRun||o.mkdirSync(m,{recursive:true});try{let S=o.readdirSync(g,{withFileTypes:!0});for(let k of S){if(k.isDirectory())continue;let M=p.join(m,k.name);if(!o.existsSync(M)){if(t.dryRun){r.push(`${d}/${k.name}`);continue}let c=o.readFileSync(p.join(g,k.name),"utf8");c=c.replace(/\{\{PROJECT_NAME\}\}/g,i),o.writeFileSync(M,c,"utf8"),r.push(`${d}/${k.name}`);}}}catch{}}}return t.dryRun?{status:"skipped",message:`Would copy ${r.length} template file(s)`}:r.length===0?{status:"skipped",message:"No new templates to sync"}:{status:"applied",message:`Synced ${r.length} template file(s)`,filesCreated:r.map(d=>`.paradigm/${d}`)}}},me={id:"refresh-hooks",introducedIn:"evergreen",description:"Reinstall hook scripts from plugin",category:"hook",auto:true,async check(e){let t=[p.join(e,".claude","hooks"),p.join(e,".cursor","hooks")];for(let i of t)if(o.existsSync(i))try{if(o.readdirSync(i).some(a=>a.includes("paradigm")))return {needed:!1,reason:"Hooks are installed"}}catch{}let n=p.join(e,".claude","settings.local.json");if(o.existsSync(n))try{if(JSON.parse(o.readFileSync(n,"utf8")).hooks)return {needed:!1,reason:"Plugin-managed hooks are configured"}}catch{}return {needed:true,reason:"No paradigm hooks found"}},async apply(e,t){if(t.dryRun)return {status:"skipped",message:"Would reinstall hooks"};try{let{hooksInstallCommand:n}=await import('./hooks-E7HQQ57M.js');return await n({force:!0}),{status:"applied",message:"Hooks reinstalled"}}catch(n){return {status:"error",message:`Hook install failed: ${n.message}`}}}},b=[Q,X,Z,ee,te,ne,se,ue,de,le,re,oe,ie,ae,ce,pe,ge,fe,me];var he=createRequire(import.meta.url),{version:W}=he("../package.json");function C(e){let t=p.join(e,".paradigm","migrate.yaml");if(!o.existsSync(t))return null;try{let n=o.readFileSync(t,"utf8");return F.load(n)}catch{return null}}async function V(e){let t=p.join(e,".paradigm"),n=C(e),i=n?.applied.map(l=>l.id)??[],r="unknown",a=p.join(t,"config.yaml");if(o.existsSync(a))try{let l=F.load(o.readFileSync(a,"utf8"));r=String(l.version??"unknown");}catch{}let g=["specs","docs","prompts","lore","tasks","protocols","personas"].filter(l=>!o.existsSync(p.join(t,l))),m=["discipline","tag-bank","purpose-required","component_types"],S=[];if(o.existsSync(a))try{let l=F.load(o.readFileSync(a,"utf8"));S=m.filter(h=>{let j=h.replace(/-/g,"_");return !(h in l)&&!(j in l)&&!(h.replace(/_/g,"-")in l)});}catch{}let k=[],M=$();if(M){let l=["specs","docs"];for(let h of l){let j=p.join(M,h),L=p.join(t,h);if(o.existsSync(j)&&o.existsSync(L)){let J=o.readdirSync(j).filter(R=>!o.statSync(p.join(j,R)).isDirectory());for(let R of J){let Y=p.join(L,R);o.existsSync(Y)||k.push(`${h}/${R}`);}}}}let c=!o.existsSync(p.join(e,".claude","hooks")),u=[];for(let l of b){let h=l.introducedIn==="evergreen";if(i.includes(l.id)&&!h)continue;(await l.check(e)).needed&&u.push(l);}return {configVersion:r,cliVersion:W,pendingMigrations:u,appliedIds:i,health:{missingDirectories:g,missingConfigFields:S,staleTemplates:k,hooksOutdated:c}}}async function U(e){let t=[],n=new Date().toISOString();for(let i of b){if(i.introducedIn==="evergreen")continue;(await i.check(e)).needed||t.push({id:i.id,appliedAt:n,cliVersion:W});}return t}function $(){let e=new URL(import.meta.url).pathname,t=p.dirname(e),n=[p.join(t,"..","..","..","templates","paradigm"),p.join(t,"..","..","templates","paradigm"),p.join(t,"..","templates","paradigm")];for(let i of n)if(o.existsSync(i))return i;return null}var ke=createRequire(import.meta.url),{version:N}=ke("../package.json");async function B(e){let t=C(e);if(t)return t;let n=await U(e);return {version:"1.0",cliVersion:N,lastMigrated:new Date().toISOString(),applied:n}}function _(e,t){let n=p.join(e,".paradigm","migrate.yaml");o.mkdirSync(p.dirname(n),{recursive:true}),t.cliVersion=N,t.lastMigrated=new Date().toISOString(),o.writeFileSync(n,F.dump(t,{indent:2,lineWidth:120,noRefs:true,sortKeys:false,quotingType:'"'}),"utf8");}async function E(e,t,n,i){let r={applied:0,skipped:0,errors:0,manual:0,results:[]},a=new Date().toISOString();for(let d of t){if(!d.auto){r.manual++,r.results.push({id:d.id,result:{status:"skipped",message:"Manual review recommended"}});continue}try{let g=await d.apply(e,n);r.results.push({id:d.id,result:g}),g.status==="applied"?(r.applied++,i.applied.push({id:d.id,appliedAt:a,cliVersion:N})):g.status==="skipped"?r.skipped++:r.errors++;}catch(g){r.errors++,r.results.push({id:d.id,result:{status:"error",message:g.message}});}}return r}async function _e(e={}){let t=process.cwd(),n=p.join(t,".paradigm");if((!o.existsSync(n)||!o.statSync(n).isDirectory())&&!(o.existsSync(n)&&o.statSync(n).isFile())){e.quiet||console.log(s.yellow("\n No .paradigm/ directory found. Run `paradigm init` or `paradigm shift` first.\n"));return}let i=we();e.quiet||i.start("Detecting project state...");let r=await V(t);e.quiet||i.stop();let a=await B(t),d=r.pendingMigrations;if(e.only&&e.only.length>0&&(d=d.filter(c=>e.only.includes(c.id))),e.category&&(d=d.filter(c=>c.category===e.category)),e.force){let c=e.only?b.filter(u=>e.only.includes(u.id)):e.category?b.filter(u=>u.category===e.category):b;d=[];for(let u of c)((await u.check(t)).needed||e.force)&&d.push(u);}let g=d.filter(c=>c.auto),m=d.filter(c=>!c.auto);if(e.list){Me(a,r,e);return}if(e.quiet){if(g.length===0)return;let c=await E(t,g,e,a);return _(t,a),c}let S=C(t);if(console.log(s.blue(`
51
+ `):x(e,i),{status:"applied",message:"Added discipline: auto to config.yaml",filesModified:[".paradigm/config.yaml"]}}},fe={id:"sync-templates",introducedIn:"evergreen",description:"Update specs/ and docs/ from installed CLI templates",category:"template",auto:true,async check(e){let t=$();if(!t)return {needed:false,reason:"Templates directory not found"};let n=[],i=["specs","docs","prompts"];for(let r of i){let a=p.join(t,r),d=p.join(e,".paradigm",r);if(o.existsSync(a))try{let g=o.readdirSync(a).filter(m=>o.statSync(p.join(a,m)).isFile());for(let m of g)o.existsSync(p.join(d,m))||n.push(`${r}/${m}`);}catch{}}return n.length===0?{needed:false,reason:"All templates are up to date"}:{needed:true,reason:`${n.length} new template file(s) available`,details:n.map(r=>`New: ${r}`)}},async apply(e,t){let n=$();if(!n)return {status:"error",message:"Templates directory not found"};let i=p.basename(e),r=[],a=["specs","docs","prompts"];for(let d of a){let g=p.join(n,d),m=p.join(e,".paradigm",d);if(o.existsSync(g)){t.dryRun||o.mkdirSync(m,{recursive:true});try{let S=o.readdirSync(g,{withFileTypes:!0});for(let k of S){if(k.isDirectory())continue;let M=p.join(m,k.name);if(!o.existsSync(M)){if(t.dryRun){r.push(`${d}/${k.name}`);continue}let c=o.readFileSync(p.join(g,k.name),"utf8");c=c.replace(/\{\{PROJECT_NAME\}\}/g,i),o.writeFileSync(M,c,"utf8"),r.push(`${d}/${k.name}`);}}}catch{}}}return t.dryRun?{status:"skipped",message:`Would copy ${r.length} template file(s)`}:r.length===0?{status:"skipped",message:"No new templates to sync"}:{status:"applied",message:`Synced ${r.length} template file(s)`,filesCreated:r.map(d=>`.paradigm/${d}`)}}},me={id:"refresh-hooks",introducedIn:"evergreen",description:"Reinstall hook scripts from plugin",category:"hook",auto:true,async check(e){let t=[p.join(e,".claude","hooks"),p.join(e,".cursor","hooks")];for(let i of t)if(o.existsSync(i))try{if(o.readdirSync(i).some(a=>a.includes("paradigm")))return {needed:!1,reason:"Hooks are installed"}}catch{}let n=p.join(e,".claude","settings.local.json");if(o.existsSync(n))try{if(JSON.parse(o.readFileSync(n,"utf8")).hooks)return {needed:!1,reason:"Plugin-managed hooks are configured"}}catch{}return {needed:true,reason:"No paradigm hooks found"}},async apply(e,t){if(t.dryRun)return {status:"skipped",message:"Would reinstall hooks"};try{let{hooksInstallCommand:n}=await import('./hooks-BNWRGACA.js');return await n({force:!0}),{status:"applied",message:"Hooks reinstalled"}}catch(n){return {status:"error",message:`Hook install failed: ${n.message}`}}}},b=[Q,X,Z,ee,te,ne,se,ue,de,le,re,oe,ie,ae,ce,pe,ge,fe,me];var he=createRequire(import.meta.url),{version:W}=he("../package.json");function C(e){let t=p.join(e,".paradigm","migrate.yaml");if(!o.existsSync(t))return null;try{let n=o.readFileSync(t,"utf8");return F.load(n)}catch{return null}}async function V(e){let t=p.join(e,".paradigm"),n=C(e),i=n?.applied.map(l=>l.id)??[],r="unknown",a=p.join(t,"config.yaml");if(o.existsSync(a))try{let l=F.load(o.readFileSync(a,"utf8"));r=String(l.version??"unknown");}catch{}let g=["specs","docs","prompts","lore","tasks","protocols","personas"].filter(l=>!o.existsSync(p.join(t,l))),m=["discipline","tag-bank","purpose-required","component_types"],S=[];if(o.existsSync(a))try{let l=F.load(o.readFileSync(a,"utf8"));S=m.filter(h=>{let j=h.replace(/-/g,"_");return !(h in l)&&!(j in l)&&!(h.replace(/_/g,"-")in l)});}catch{}let k=[],M=$();if(M){let l=["specs","docs"];for(let h of l){let j=p.join(M,h),L=p.join(t,h);if(o.existsSync(j)&&o.existsSync(L)){let J=o.readdirSync(j).filter(R=>!o.statSync(p.join(j,R)).isDirectory());for(let R of J){let Y=p.join(L,R);o.existsSync(Y)||k.push(`${h}/${R}`);}}}}let c=!o.existsSync(p.join(e,".claude","hooks")),u=[];for(let l of b){let h=l.introducedIn==="evergreen";if(i.includes(l.id)&&!h)continue;(await l.check(e)).needed&&u.push(l);}return {configVersion:r,cliVersion:W,pendingMigrations:u,appliedIds:i,health:{missingDirectories:g,missingConfigFields:S,staleTemplates:k,hooksOutdated:c}}}async function U(e){let t=[],n=new Date().toISOString();for(let i of b){if(i.introducedIn==="evergreen")continue;(await i.check(e)).needed||t.push({id:i.id,appliedAt:n,cliVersion:W});}return t}function $(){let e=new URL(import.meta.url).pathname,t=p.dirname(e),n=[p.join(t,"..","..","..","templates","paradigm"),p.join(t,"..","..","templates","paradigm"),p.join(t,"..","templates","paradigm")];for(let i of n)if(o.existsSync(i))return i;return null}var ke=createRequire(import.meta.url),{version:N}=ke("../package.json");async function B(e){let t=C(e);if(t)return t;let n=await U(e);return {version:"1.0",cliVersion:N,lastMigrated:new Date().toISOString(),applied:n}}function _(e,t){let n=p.join(e,".paradigm","migrate.yaml");o.mkdirSync(p.dirname(n),{recursive:true}),t.cliVersion=N,t.lastMigrated=new Date().toISOString(),o.writeFileSync(n,F.dump(t,{indent:2,lineWidth:120,noRefs:true,sortKeys:false,quotingType:'"'}),"utf8");}async function E(e,t,n,i){let r={applied:0,skipped:0,errors:0,manual:0,results:[]},a=new Date().toISOString();for(let d of t){if(!d.auto){r.manual++,r.results.push({id:d.id,result:{status:"skipped",message:"Manual review recommended"}});continue}try{let g=await d.apply(e,n);r.results.push({id:d.id,result:g}),g.status==="applied"?(r.applied++,i.applied.push({id:d.id,appliedAt:a,cliVersion:N})):g.status==="skipped"?r.skipped++:r.errors++;}catch(g){r.errors++,r.results.push({id:d.id,result:{status:"error",message:g.message}});}}return r}async function _e(e={}){let t=process.cwd(),n=p.join(t,".paradigm");if((!o.existsSync(n)||!o.statSync(n).isDirectory())&&!(o.existsSync(n)&&o.statSync(n).isFile())){e.quiet||console.log(s.yellow("\n No .paradigm/ directory found. Run `paradigm init` or `paradigm shift` first.\n"));return}let i=we();e.quiet||i.start("Detecting project state...");let r=await V(t);e.quiet||i.stop();let a=await B(t),d=r.pendingMigrations;if(e.only&&e.only.length>0&&(d=d.filter(c=>e.only.includes(c.id))),e.category&&(d=d.filter(c=>c.category===e.category)),e.force){let c=e.only?b.filter(u=>e.only.includes(u.id)):e.category?b.filter(u=>u.category===e.category):b;d=[];for(let u of c)((await u.check(t)).needed||e.force)&&d.push(u);}let g=d.filter(c=>c.auto),m=d.filter(c=>!c.auto);if(e.list){Me(a,r,e);return}if(e.quiet){if(g.length===0)return;let c=await E(t,g,e,a);return _(t,a),c}let S=C(t);if(console.log(s.blue(`
52
52
  \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(s.blue("\u2502")+s.white.bold(" paradigm migrate ")+s.blue("\u2502")),console.log(s.blue("\u2502")+s.gray(" Bring your project up to date ")+s.blue("\u2502")),console.log(s.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
53
53
  `)),console.log(s.white(` Project: ${s.cyan(p.basename(t))}`)),console.log(s.white(` Config version: ${s.cyan(r.configVersion)}`)),console.log(s.white(` CLI version: ${s.cyan(r.cliVersion)}`)),console.log(s.white(` Last migrated: ${s.cyan(S?.lastMigrated??"never")}`)),console.log(""),d.length===0){console.log(s.green(` All migrations are up to date.
54
54
  `)),S||(_(t,a),e.verbose&&console.log(s.gray(` Created .paradigm/migrate.yaml with bootstrap state.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import {v}from'./chunk-5KSNYRT7.js';export{o as adjustAttentionFromFeedback,u as applySurfacingRules,s as autoPromoteJournalEntries,g as detectDebates,n as emitAndProcess,k as engageNomination,r as forwardNominationsToRelay,q as getNeverlandMetrics,p as getNominationStats,j as loadDebates,i as loadNominations,t as loadSurfacingConfig,h as persistNominations,f as processEvent,m as processPendingEvents,l as resolveDebate}from'./chunk-5KSNYRT7.js';import'./chunk-QWL3LERH.js';import'./chunk-QGZRM6ZB.js';import'./chunk-VG7FN2TU.js';import'./chunk-5TAVYPOV.js';v();
2
+ import {v}from'./chunk-EAZ3EMOZ.js';export{o as adjustAttentionFromFeedback,u as applySurfacingRules,s as autoPromoteJournalEntries,g as detectDebates,n as emitAndProcess,k as engageNomination,r as forwardNominationsToRelay,q as getNeverlandMetrics,p as getNominationStats,j as loadDebates,i as loadNominations,t as loadSurfacingConfig,h as persistNominations,f as processEvent,m as processPendingEvents,l as resolveDebate}from'./chunk-EAZ3EMOZ.js';import'./chunk-2Q7RGCJH.js';import'./chunk-QGZRM6ZB.js';import'./chunk-VG7FN2TU.js';import'./chunk-5TAVYPOV.js';v();
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {a,b}from'./chunk-DG236EXP.js';import'./chunk-TYWB5IQJ.js';import'./chunk-WESTEMIM.js';import'./chunk-FYDRENK7.js';import'./chunk-IZSBGW6E.js';import {e as e$1}from'./chunk-AO7ZSRME.js';import'./chunk-SHD27BQX.js';import {d,c}from'./chunk-EKZDFEJW.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as S from'path';import e from'chalk';import O from'ora';async function I(o,n,t){let i=n?S.resolve(n):process.cwd();if(!o){t.json?console.log(JSON.stringify({error:"Task is required"})):(console.log(e.red(`
2
+ import {a,b}from'./chunk-A7KFOJ2F.js';import'./chunk-TYWB5IQJ.js';import'./chunk-UDUHSHO4.js';import'./chunk-FYDRENK7.js';import'./chunk-HXGYVS2N.js';import {e as e$1}from'./chunk-AO7ZSRME.js';import'./chunk-SHD27BQX.js';import {d,c}from'./chunk-EKZDFEJW.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as S from'path';import e from'chalk';import O from'ora';async function I(o,n,t){let i=n?S.resolve(n):process.cwd();if(!o){t.json?console.log(JSON.stringify({error:"Task is required"})):(console.log(e.red(`
3
3
  Task is required.`)),console.log(e.gray(`Example: paradigm team orchestrate "Build @payment-system with Stripe"
4
4
  `)));return}if(!e$1(i)){t.json?console.log(JSON.stringify({error:"Team not configured"})):console.log(e.yellow("\nTeam not configured. Run `paradigm team init` first.\n"));return}let f="faceted";t.solo&&(f="solo"),t.faceted&&(f="faceted");let g;if(t.budget){let s=t.budget.split(",");g={};for(let l of s){let[a,r]=l.split("=");a==="tokens"&&(g.maxTokens=parseInt(r)),a==="cost"&&(g.maxCostUsd=parseFloat(r)),a==="warn"&&(g.warnAtPercent=parseInt(r));}}let c=O({text:"Initializing orchestrator...",isSilent:t.quiet||t.json}).start(),y=new a(i);try{await y.initialize();}catch(s){c.fail("Failed to initialize orchestrator"),t.json?console.log(JSON.stringify({error:s instanceof Error?s.message:String(s)})):console.log(e.red(`
5
5
  Error: ${s instanceof Error?s.message:s}
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export{b as ROSTER_SUGGESTIONS,a as detectProjectType}from'./chunk-4DVT5IEY.js';import'./chunk-5TAVYPOV.js';
2
+ export{b as ROSTER_SUGGESTIONS,a as detectProjectType}from'./chunk-TZZNHUAR.js';import'./chunk-5TAVYPOV.js';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {c,e as e$1,b as b$1,d}from'./chunk-IZSBGW6E.js';import'./chunk-5TAVYPOV.js';import*as f from'path';import e from'chalk';async function b(t,r){let s=t?f.resolve(t):process.cwd();if(r.set){try{await c(r.set,s),r.json?console.log(JSON.stringify({success:!0,provider:r.set})):(console.log(e.green(`
2
+ import {c,e as e$1,b as b$1,d}from'./chunk-HXGYVS2N.js';import'./chunk-5TAVYPOV.js';import*as f from'path';import e from'chalk';async function b(t,r){let s=t?f.resolve(t):process.cwd();if(r.set){try{await c(r.set,s),r.json?console.log(JSON.stringify({success:!0,provider:r.set})):(console.log(e.green(`
3
3
  \u2713 Provider set to: ${r.set}
4
4
  `)),r.set==="auto"?console.log(e.gray(`Will auto-detect best available provider.
5
5
  `)):console.log(e.gray(`Will use ${r.set} if available, otherwise fall back.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{ma as getReindexToolsList,na as handleReindexTool,oa as rebuildStaticFiles}from'./chunk-TXBSTT64.js';import'./chunk-M4UMM6DC.js';import'./chunk-ODVKPZZ4.js';import'./chunk-S7K7UPXL.js';import'./chunk-AGSUX2GJ.js';import'./chunk-5TAVYPOV.js';
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import {a as a$1,f,c,e,g as g$1,b as b$1,d}from'./chunk-WR6D3SC6.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as g from'fs';import*as m from'path';import*as b from'os';import r from'chalk';import*as $ from'js-yaml';var x=m.join(b.homedir(),".paradigm","agents"),O=".agent";function C(){return m.join(process.cwd(),".paradigm","roster.yaml")}function k(){let n=C();if(!g.existsSync(n))return null;try{return $.load(g.readFileSync(n,"utf-8"))}catch{return null}}function F(n){let s=C(),c=m.dirname(s);g.existsSync(c)||g.mkdirSync(c,{recursive:true}),g.writeFileSync(s,$.dump(n,{lineWidth:-1,noRefs:true,sortKeys:false}),"utf-8");}function E(){if(!g.existsSync(x))return [];try{return g.readdirSync(x).filter(n=>n.endsWith(O)).map(n=>n.replace(O,"")).sort()}catch{return []}}function P(n){let s=m.join(x,`${n}${O}`);if(!g.existsSync(s))return null;try{let c=$.load(g.readFileSync(s,"utf-8"));return {id:c.id||n,nickname:c.nickname,role:c.role||"Unknown"}}catch{return null}}async function U(n={}){let s=process.cwd(),c$1=a.command("agent-roster-show").start("Showing project roster",{cwd:s}),o=E().length,i=k();if(!i){n.json?a$1(JSON.stringify({roster:null,message:"No roster configured",totalAgents:o})):(f("Agent Roster"),a$1(""),c(`No roster configured \u2014 all ${o} agents are active.`),e(` Run ${r.cyan("paradigm agent roster init")} to create one.`),a$1("")),c$1.success("No roster found");return}let t=i.active||[];if(n.json){let h=t.map(y=>P(y)||{id:y,role:"Unknown"});a$1(JSON.stringify({count:t.length,total:o,project:i.project,type:i.type,agents:h},null,2)),c$1.success(`${t.length} of ${o} agents active`);return}f("Agent Roster"),a$1("");let a$2="ID".padEnd(16),l="Nickname".padEnd(12);a$1(` ${r.dim(a$2)} ${r.dim(l)} ${r.dim("Role")}`),a$1(` ${r.dim("-".repeat(16))} ${r.dim("-".repeat(12))} ${r.dim("-".repeat(30))}`);for(let h of t.sort()){let y=P(h),f=y?.nickname||r.dim("\u2014"),S=y?.role||r.dim("Unknown");a$1(` ${r.white.bold(h.padEnd(16))} ${f.toString().padEnd(12)} ${r.gray(S)}`);}a$1(""),a$1(` ${r.cyan(String(t.length))} of ${r.cyan(String(o))} agents active on this project`),i.type&&g$1("Project type",i.type),a$1(""),c$1.success(`${t.length} of ${o} agents active`);}async function G(n={}){let s=process.cwd(),c$1=a.command("agent-roster-init").start("Initializing project roster",{cwd:s}),u=C();if(g.existsSync(u)&&!n.force){let S=k()?.active?.length??0;n.json?a$1(JSON.stringify({error:"Roster already exists",count:S})):(c(`Roster already exists with ${S} agents.`),e(` Use ${r.cyan("--force")} to reinitialize, or ${r.cyan("paradigm agent roster add/remove")} to modify.`)),c$1.error("Roster already exists");return}let{detectProjectType:o,ROSTER_SUGGESTIONS:i}=await import('./project-type-4Y6CESWP.js'),t=o(s),a$2=i[t]||i.generic,l=m.basename(s),d=m.join(s,".paradigm","config.yaml");if(g.existsSync(d))try{let f=$.load(g.readFileSync(d,"utf-8"));f?.project&&typeof f.project=="string"&&(l=f.project);}catch{}let h={version:"1.0",project:l,type:t,active:a$2.sort()};F(h);let y=E();n.json?a$1(JSON.stringify({created:true,project:l,type:t,active:a$2.sort(),count:a$2.length,total:y.length},null,2)):(f("Agent Roster Initialized"),a$1(""),g$1("Project",l),g$1("Detected type",t),g$1("Active agents",`${a$2.length} of ${y.length}`),a$1(""),a$1(` ${r.cyan(a$2.sort().join(", "))}`),a$1(""),b$1(`Roster written to ${r.dim(".paradigm/roster.yaml")}`),e(` Modify with ${r.cyan("paradigm agent roster add/remove <agent-id>")}`),a$1("")),c$1.success(`Created roster: ${a$2.length} agents for ${t}`);}async function _(n,s={}){let c=process.cwd(),u=a.command("agent-roster-add").start(`Adding agents: ${n.join(", ")}`,{cwd:c}),o=k();if(!o){s.json?a$1(JSON.stringify({error:"No roster found. Run `paradigm agent roster init` first."})):(d("No roster found."),e(` Run ${r.cyan("paradigm agent roster init")} first.`)),u.error("No roster found");return}let i=E(),t=[],a$2=[],l=[];for(let d of n){if(!i.includes(d)){t.push(d);continue}if(o.active.includes(d)){a$2.push(d);continue}o.active.push(d),l.push(d);}l.length>0&&(o.active.sort(),F(o)),s.json?a$1(JSON.stringify({added:l,alreadyActive:a$2,invalid:t,total:o.active.length},null,2)):(l.length>0&&b$1(`Added: ${r.cyan(l.join(", "))}`),a$2.length>0&&e(` Already active: ${a$2.join(", ")}`),t.length>0&&(d(`Unknown agent(s): ${t.join(", ")}`),e(` Available: ${i.join(", ")}`)),l.length>0&&a$1(` Roster now has ${r.cyan(String(o.active.length))} active agents.`)),u.success(`Added ${l.length}, skipped ${a$2.length}, invalid ${t.length}`);}async function z(n,s={}){let c$1=process.cwd(),u=a.command("agent-roster-remove").start(`Removing agents: ${n.join(", ")}`,{cwd:c$1}),o=k();if(!o){s.json?a$1(JSON.stringify({error:"No roster found. Run `paradigm agent roster init` first."})):(d("No roster found."),e(` Run ${r.cyan("paradigm agent roster init")} first.`)),u.error("No roster found");return}let i=[],t=[];for(let a of n){let l=o.active.indexOf(a);if(l<0){i.push(a);continue}o.active.splice(l,1),t.push(a);}t.length>0&&F(o),s.json?a$1(JSON.stringify({removed:t,notFound:i,total:o.active.length},null,2)):(t.length>0&&b$1(`Removed: ${r.cyan(t.join(", "))}`),i.length>0&&c(`Not in roster: ${i.join(", ")}`),t.length>0&&a$1(` Roster now has ${r.cyan(String(o.active.length))} active agents.`)),u.success(`Removed ${t.length}, not found ${i.length}`);}export{_ as rosterAddCommand,G as rosterInitCommand,z as rosterRemoveCommand,U as rosterShowCommand};
2
+ import {a as a$1,f,c,e,g as g$1,b as b$1,d}from'./chunk-WR6D3SC6.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as g from'fs';import*as m from'path';import*as b from'os';import r from'chalk';import*as $ from'js-yaml';var x=m.join(b.homedir(),".paradigm","agents"),O=".agent";function C(){return m.join(process.cwd(),".paradigm","roster.yaml")}function k(){let n=C();if(!g.existsSync(n))return null;try{return $.load(g.readFileSync(n,"utf-8"))}catch{return null}}function F(n){let s=C(),c=m.dirname(s);g.existsSync(c)||g.mkdirSync(c,{recursive:true}),g.writeFileSync(s,$.dump(n,{lineWidth:-1,noRefs:true,sortKeys:false}),"utf-8");}function E(){if(!g.existsSync(x))return [];try{return g.readdirSync(x).filter(n=>n.endsWith(O)).map(n=>n.replace(O,"")).sort()}catch{return []}}function P(n){let s=m.join(x,`${n}${O}`);if(!g.existsSync(s))return null;try{let c=$.load(g.readFileSync(s,"utf-8"));return {id:c.id||n,nickname:c.nickname,role:c.role||"Unknown"}}catch{return null}}async function U(n={}){let s=process.cwd(),c$1=a.command("agent-roster-show").start("Showing project roster",{cwd:s}),o=E().length,i=k();if(!i){n.json?a$1(JSON.stringify({roster:null,message:"No roster configured",totalAgents:o})):(f("Agent Roster"),a$1(""),c(`No roster configured \u2014 all ${o} agents are active.`),e(` Run ${r.cyan("paradigm agent roster init")} to create one.`),a$1("")),c$1.success("No roster found");return}let t=i.active||[];if(n.json){let h=t.map(y=>P(y)||{id:y,role:"Unknown"});a$1(JSON.stringify({count:t.length,total:o,project:i.project,type:i.type,agents:h},null,2)),c$1.success(`${t.length} of ${o} agents active`);return}f("Agent Roster"),a$1("");let a$2="ID".padEnd(16),l="Nickname".padEnd(12);a$1(` ${r.dim(a$2)} ${r.dim(l)} ${r.dim("Role")}`),a$1(` ${r.dim("-".repeat(16))} ${r.dim("-".repeat(12))} ${r.dim("-".repeat(30))}`);for(let h of t.sort()){let y=P(h),f=y?.nickname||r.dim("\u2014"),S=y?.role||r.dim("Unknown");a$1(` ${r.white.bold(h.padEnd(16))} ${f.toString().padEnd(12)} ${r.gray(S)}`);}a$1(""),a$1(` ${r.cyan(String(t.length))} of ${r.cyan(String(o))} agents active on this project`),i.type&&g$1("Project type",i.type),a$1(""),c$1.success(`${t.length} of ${o} agents active`);}async function G(n={}){let s=process.cwd(),c$1=a.command("agent-roster-init").start("Initializing project roster",{cwd:s}),u=C();if(g.existsSync(u)&&!n.force){let S=k()?.active?.length??0;n.json?a$1(JSON.stringify({error:"Roster already exists",count:S})):(c(`Roster already exists with ${S} agents.`),e(` Use ${r.cyan("--force")} to reinitialize, or ${r.cyan("paradigm agent roster add/remove")} to modify.`)),c$1.error("Roster already exists");return}let{detectProjectType:o,ROSTER_SUGGESTIONS:i}=await import('./project-type-AGO6VUKF.js'),t=o(s),a$2=i[t]||i.generic,l=m.basename(s),d=m.join(s,".paradigm","config.yaml");if(g.existsSync(d))try{let f=$.load(g.readFileSync(d,"utf-8"));f?.project&&typeof f.project=="string"&&(l=f.project);}catch{}let h={version:"1.0",project:l,type:t,active:a$2.sort()};F(h);let y=E();n.json?a$1(JSON.stringify({created:true,project:l,type:t,active:a$2.sort(),count:a$2.length,total:y.length},null,2)):(f("Agent Roster Initialized"),a$1(""),g$1("Project",l),g$1("Detected type",t),g$1("Active agents",`${a$2.length} of ${y.length}`),a$1(""),a$1(` ${r.cyan(a$2.sort().join(", "))}`),a$1(""),b$1(`Roster written to ${r.dim(".paradigm/roster.yaml")}`),e(` Modify with ${r.cyan("paradigm agent roster add/remove <agent-id>")}`),a$1("")),c$1.success(`Created roster: ${a$2.length} agents for ${t}`);}async function _(n,s={}){let c=process.cwd(),u=a.command("agent-roster-add").start(`Adding agents: ${n.join(", ")}`,{cwd:c}),o=k();if(!o){s.json?a$1(JSON.stringify({error:"No roster found. Run `paradigm agent roster init` first."})):(d("No roster found."),e(` Run ${r.cyan("paradigm agent roster init")} first.`)),u.error("No roster found");return}let i=E(),t=[],a$2=[],l=[];for(let d of n){if(!i.includes(d)){t.push(d);continue}if(o.active.includes(d)){a$2.push(d);continue}o.active.push(d),l.push(d);}l.length>0&&(o.active.sort(),F(o)),s.json?a$1(JSON.stringify({added:l,alreadyActive:a$2,invalid:t,total:o.active.length},null,2)):(l.length>0&&b$1(`Added: ${r.cyan(l.join(", "))}`),a$2.length>0&&e(` Already active: ${a$2.join(", ")}`),t.length>0&&(d(`Unknown agent(s): ${t.join(", ")}`),e(` Available: ${i.join(", ")}`)),l.length>0&&a$1(` Roster now has ${r.cyan(String(o.active.length))} active agents.`)),u.success(`Added ${l.length}, skipped ${a$2.length}, invalid ${t.length}`);}async function z(n,s={}){let c$1=process.cwd(),u=a.command("agent-roster-remove").start(`Removing agents: ${n.join(", ")}`,{cwd:c$1}),o=k();if(!o){s.json?a$1(JSON.stringify({error:"No roster found. Run `paradigm agent roster init` first."})):(d("No roster found."),e(` Run ${r.cyan("paradigm agent roster init")} first.`)),u.error("No roster found");return}let i=[],t=[];for(let a of n){let l=o.active.indexOf(a);if(l<0){i.push(a);continue}o.active.splice(l,1),t.push(a);}t.length>0&&F(o),s.json?a$1(JSON.stringify({removed:t,notFound:i,total:o.active.length},null,2)):(t.length>0&&b$1(`Removed: ${r.cyan(t.join(", "))}`),i.length>0&&c(`Not in roster: ${i.join(", ")}`),t.length>0&&a$1(` Roster now has ${r.cyan(String(o.active.length))} active agents.`)),u.success(`Removed ${t.length}, not found ${i.length}`);}export{_ as rosterAddCommand,G as rosterInitCommand,z as rosterRemoveCommand,U as rosterShowCommand};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import {a as a$2}from'./chunk-UHQLYIRI.js';import {h,f,a as a$1,e,d,b,g as g$1,c}from'./chunk-WR6D3SC6.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import g from'chalk';import*as v from'fs/promises';import*as $ from'path';import*as S from'js-yaml';var F=".paradigm/adoptions.yaml",E=".paradigm/.pending-scope-reviews";function k(e,o){let s=e?.permissions??[],r=o.permissions??[],n=new Map;for(let p of s)n.set(p.id,p);let t=new Map;for(let p of r)t.set(p.id,p);let i=[],d=[],a=[],f=[];for(let p of r){let j=n.get(p.id);j?j.description!==p.description?(i.push({scope:p,status:"expanded"}),f.push(p)):(i.push({scope:p,status:"kept"}),f.push(p)):(i.push({scope:p,status:"new"}),d.push(p));}for(let p of s)t.has(p.id)||(i.push({scope:p,status:"removed"}),a.push(p));let m=d.length>0;return {agentId:"",previousVersion:e?.version??"0.0.0",newVersion:o.version,added:d,removed:a,kept:f,entries:i,requiresApproval:m}}function D(e,o,s,r){let n=[];s&&r?n.push(` Updating ${g.white.bold(o)} ${g.dim(s)} ${g.dim("\u2192")} ${g.dim(r)}...`):n.push(` Scopes for ${g.white.bold(o)}:`),n.push(""),n.push(` ${g.dim("Scope changes:")}`),n.push(` ${g.dim("\u2500".repeat(49))}`);for(let i of e.entries){let d=i.scope.id,a=i.scope.description;switch(i.status){case "kept":n.push(` ${g.dim("[kept]")} ${d.padEnd(24)} ${g.dim(a)}`);break;case "expanded":n.push(` ${g.yellow("[expanded]")} ${d.padEnd(24)} ${g.yellow(a)}`);break;case "new":n.push(` ${g.green("+")} ${g.green("[new]")} ${g.green(d.padEnd(24))} ${g.green(a)}`);break;case "removed":n.push(` ${g.red("-")} ${g.red("[removed]")} ${g.red(d.padEnd(24))} ${g.red(a)}`);break}}n.push("");let t=[];return e.added.length>0&&t.push(g.green(`${e.added.length} new`)),e.removed.length>0&&t.push(g.red(`${e.removed.length} removed`)),e.kept.length>0&&t.push(g.dim(`${e.kept.length} unchanged`)),t.length>0&&n.push(` ${t.join(", ")}`),n.join(`
3
+ `)}async function O(e){let o=$.join(e,F);try{let s=await v.readFile(o,"utf-8");return S.load(s)??null}catch{return null}}async function V(e,o){let s=$.join(e,F),r=$.dirname(s);await v.mkdir(r,{recursive:true}),await v.writeFile(s,S.dump(o,{lineWidth:120,noRefs:true,sortKeys:false}),"utf-8");}async function q(e,o,s){a.component("#scopes-approval").info("Approving scopes",{agentId:o});let n=await O(e);n||(n={version:"1.0","adopted-at":"","project-type":"",agents:{}});let t=n.agents??{},i=new Date().toISOString().split("T")[0],d={...s,approved:i};t[o]||(t[o]={}),t[o]["scopes-approved"]=i,t[o].scopes=d,n.agents=t,await V(e,n),await C(e,o),a.component("#scopes-approval").info("Scopes approved",{agentId:o,date:i});}async function T(e,o){a.component("#scopes-denial").info("Denying scopes",{agentId:o});let s=await O(e);s||(s={version:"1.0","adopted-at":"","project-type":"",agents:{}});let r=s.agents??{};r[o]||(r[o]={}),r[o]["scopes-denied"]=new Date().toISOString().split("T")[0],s.agents=r,await V(e,s),await C(e,o),a.component("#scopes-denial").info("Scopes denied",{agentId:o});}async function R(e){let o=$.join(e,E);try{let s=await v.readFile(o,"utf-8"),r=S.load(s);if(!r?.reviews)return {};let n={};for(let[t,i]of Object.entries(r.reviews))n[t]={old:i.old??void 0,new:i.new};return n}catch{return {}}}async function C(e,o){let s=$.join(e,E);try{let r=await v.readFile(s,"utf-8"),n=S.load(r);if(!n?.reviews)return;delete n.reviews[o],Object.keys(n.reviews).length===0?await v.unlink(s):await v.writeFile(s,S.dump(n,{lineWidth:120,noRefs:!0,sortKeys:!1}),"utf-8");}catch{}}async function U(e$1,o={}){let s=process.cwd(),r=a.command("agent-review").start("Reviewing agent scopes",{cwd:s,id:e$1}),n=await R(s),t=Object.keys(n);if(t.length===0){o.json?h({pending:0,agents:[]}):(f("Agent Scope Reviews"),a$1(""),e(" No pending scope reviews."),a$1("")),r.success("No pending reviews");return}if(!e$1){if(o.json){let a=t.map(f=>{let m=n[f],p=k(m.old,m.new);return {id:f,added:p.added.length,removed:p.removed.length,kept:p.kept.length,requiresApproval:p.requiresApproval}});h({pending:t.length,agents:a});}else {f("Pending Scope Reviews"),a$1(""),a$1(` ${g.cyan(String(t.length))} agent(s) with pending scope changes:`),a$1("");for(let a of t){let f=n[a],m=k(f.old,f.new),p=m.added.length>0?g.green(`+${m.added.length} new`):"",j=m.removed.length>0?g.red(`-${m.removed.length} removed`):"",M=[p,j].filter(Boolean).join(", ");a$1(` ${g.white.bold(a.padEnd(20))} ${M||g.dim("description changes only")}`);}a$1(""),e(` Review individually: ${g.cyan("paradigm agent review <id>")}`),e(` Quick approve: ${g.cyan("paradigm agent approve <id>")}`),a$1("");}r.success(`${t.length} pending reviews listed`);return}let i=n[e$1];if(!i){o.json?h({error:`No pending review for agent "${e$1}"`}):(d(`No pending scope review for agent "${e$1}".`),t.length>0&&e(` Pending reviews exist for: ${t.join(", ")}`)),r.error(`No pending review for ${e$1}`);return}let d$1=k(i.old,i.new);d$1.agentId=e$1,o.json?h({agentId:e$1,diff:{previousVersion:d$1.previousVersion,newVersion:d$1.newVersion,added:d$1.added,removed:d$1.removed,kept:d$1.kept,requiresApproval:d$1.requiresApproval}}):(f("Scope Review"),a$1(""),a$1(D(d$1,e$1,d$1.previousVersion,d$1.newVersion)),a$1(""),d$1.requiresApproval?(e(` To approve: ${g.cyan(`paradigm agent approve ${e$1}`)}`),e(` To deny: ${g.cyan(`paradigm agent deny ${e$1}`)}`)):(e(" No new scopes \u2014 description changes only. Auto-approvable."),e(` Approve: ${g.cyan(`paradigm agent approve ${e$1}`)}`)),a$1("")),r.success(`Showed review for ${e$1}`);}async function H(e$1,o={}){let s=process.cwd(),r=a.command("agent-approve").start("Approving agent scopes",{cwd:s,id:e$1}),n=await R(s),t=n[e$1];if(!t){if(o.json)h({error:`No pending review for agent "${e$1}"`});else {d(`No pending scope review for agent "${e$1}".`);let i=Object.keys(n);i.length>0?e(` Pending reviews exist for: ${i.join(", ")}`):e(" No pending reviews.");}r.error(`No pending review for ${e$1}`);return}await q(s,e$1,t.new),o.json?h({agentId:e$1,approved:true,scopeVersion:t.new.version,permissions:t.new.permissions.length}):(b(`Scopes approved for ${g.white.bold(e$1)}`),g$1("Scope version",t.new.version),g$1("Permissions",String(t.new.permissions.length)),a$1("")),r.success(`Approved scopes for ${e$1}`);}async function J(e$1,o={}){let s=process.cwd(),r=a.command("agent-deny").start("Denying agent scopes",{cwd:s,id:e$1}),n=await R(s);if(!n[e$1]){if(o.json)h({error:`No pending review for agent "${e$1}"`});else {d(`No pending scope review for agent "${e$1}".`);let i=Object.keys(n);i.length>0?e(` Pending reviews exist for: ${i.join(", ")}`):e(" No pending reviews.");}r.error(`No pending review for ${e$1}`);return}await T(s,e$1),o.json?h({agentId:e$1,denied:true,message:"Agent will continue using previously approved scopes."}):(c(`Scopes denied for ${g.white.bold(e$1)}`),e(" Agent will continue using previously approved scopes."),a$1("")),r.success(`Denied scopes for ${e$1}`);}async function X(e$1,o={}){let s=process.cwd(),r=a.command("agent-scopes").start("Showing agent scopes",{cwd:s,id:e$1}),n=await a$2(s);if(!n||!n.agents[e$1]){o.json?h({error:`Agent "${e$1}" not found in adoptions`}):(d(`Agent "${e$1}" not found in adoption records.`),e(` Run ${g.cyan("paradigm shift")} to initialize adoptions.`)),r.error(`Agent ${e$1} not in adoptions`);return}let t=n.agents[e$1],a$3=(await W(s))?.agents?.[e$1]?.scopes;if(o.json){h({agentId:e$1,source:t.source,scopesApproved:t.scopesApproved||null,scopes:a$3||null}),r.success(`Showed scopes for ${e$1}`);return}if(f(`Scopes: ${e$1}`),a$1(""),g$1("Source",t.source),g$1("Adopted",t.adopted),!a$3||!a$3.permissions||a$3.permissions.length===0){a$1(""),e(" No scopes declared. Agent is using default permissions."),a$1(""),r.success(`No scopes for ${e$1}`);return}g$1("Scope version",a$3.version),a$3.approved&&g$1("Approved",a$3.approved),a$1(""),a$1(` ${g.bold("Permissions:")}`);for(let f of a$3.permissions){let p=a$3.dangerous?.includes(f.id)?g.yellow(f.id.padEnd(24)):g.white(f.id.padEnd(24));a$1(` ${p} ${g.gray(f.description)}`);}if(a$3.dangerous&&a$3.dangerous.length>0){a$1(""),a$1(` ${g.yellow("Dangerous scopes")} (require runtime confirmation):`);for(let f of a$3.dangerous)a$1(` ${g.yellow(f)}`);}a$1(""),r.success(`Showed scopes for ${e$1}`);}async function W(e){let o=await import('fs/promises'),s=await import('path'),r=await import('js-yaml'),n=s.join(e,".paradigm","adoptions.yaml");try{let t=await o.readFile(n,"utf-8");return r.load(t)??null}catch{return null}}export{H as agentApproveCommand,J as agentDenyCommand,U as agentReviewCommand,X as agentScopesCommand};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{i as MODEL_PRICING,j as getSessionTracker,k as resetSessionTracker}from'./chunk-S7K7UPXL.js';import'./chunk-AGSUX2GJ.js';import'./chunk-5TAVYPOV.js';
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{a as appendSessionWorkEntry,i as clearActivityMetrics,c as clearSessionWorkLog,l as countNotebookReferences,e as getAgentEntries,f as getAgentVerdicts,d as getContributingAgents,k as getNotebookReferences,h as getSessionActivitySummary,b as readSessionWorkLog,g as recordActivityMetric,j as recordNotebookReference}from'./chunk-32RBX5YV.js';import'./chunk-5TAVYPOV.js';
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import {n}from'./chunk-AGSUX2GJ.js';export{a as appendSessionWorkEntry,i as clearActivityMetrics,c as clearSessionWorkLog,l as countNotebookReferences,e as getAgentEntries,f as getAgentVerdicts,d as getContributingAgents,k as getNotebookReferences,h as getSessionActivitySummary,b as readSessionWorkLog,g as recordActivityMetric,j as recordNotebookReference}from'./chunk-AGSUX2GJ.js';import'./chunk-5TAVYPOV.js';n();
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+ 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(`
3
+ `)+`
4
+ `},{path:".paradigm/agents.yaml",defaultContent:['version: "1.0"',"agents: []"].join(`
5
+ `)+`
6
+ `},{path:".paradigm/roster.yaml",defaultContent:['version: "1.0"',"active: []"].join(`
7
+ `)+`
8
+ `},{path:".paradigm/adoptions.yaml",defaultContent:['version: "1.0"','adopted-at: ""','project-type: ""',"agents: {}"].join(`
9
+ `)+`
10
+ `},{path:".paradigm/team-state.yaml",defaultContent:['version: "1.0"',"models: {}","state: {}"].join(`
11
+ `)+`
12
+ `},{path:".paradigm/fixtures.yaml",defaultContent:['version: "1.0"',"fixtures: []"].join(`
13
+ `)+`
14
+ `},{path:".paradigm/navigator.yaml",defaultContent:['version: "1.0"',"entries: []"].join(`
15
+ `)+`
16
+ `},{path:".paradigm/flows.yaml",defaultContent:['version: "1.0"',"flows: []"].join(`
17
+ `)+`
18
+ `},{path:".paradigm/tags.yaml",defaultContent:['version: "1.0"',"tags: []"].join(`
19
+ `)+`
20
+ `},{path:".paradigm/habits.yaml",defaultContent:['version: "1.0"',"habits: []"].join(`
21
+ `)+`
22
+ `},{path:".paradigm/graduation.yaml",defaultContent:['version: "1.0"',"graduations: []"].join(`
23
+ `)+`
24
+ `},{path:"portal.yaml",defaultContent:['version: "2.0"',"gates: []","routes: []"].join(`
25
+ `)+`
26
+ `},{path:".purpose",defaultContent:['version: "2.0"',"id: root",'description: ""',"components: []"].join(`
27
+ `)+`
28
+ `},{path:".premise",defaultContent:['version: "1.0"','premise: ""'].join(`
29
+ `)+`
30
+ `},{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(`
31
+ `)+`
32
+ `},{path:".paradigm/history/log.jsonl",defaultContent:""},{path:".paradigm/lore/timeline.yaml",defaultContent:['version: "1.0"',"entries: []"].join(`
33
+ `)+`
34
+ `},{path:".paradigm/wisdom/antipatterns.yaml",defaultContent:['version: "1.0"',"antipatterns: []"].join(`
35
+ `)+`
36
+ `},{path:".paradigm/personas/index.yaml",defaultContent:['version: "1.0"',"personas: {}"].join(`
37
+ `)+`
38
+ `},{path:".paradigm/protocols/index.yaml",defaultContent:['version: "1.0"',"protocols: []"].join(`
39
+ `)+`
40
+ `},{path:".paradigm/notebooks/",defaultContent:"",isDir:true},{path:".paradigm/university/config.yaml",defaultContent:['version: "1.0"',"enabled: true","auto-enroll: true"].join(`
41
+ `)+`
42
+ `},{path:".paradigm/university/index.yaml",defaultContent:['version: "1.0"',"entries: []"].join(`
43
+ `)+`
44
+ `},{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
45
+
46
+ Generated by paradigm shift.
47
+ `},{path:"AGENTS.md",defaultContent:`# Agents
48
+
49
+ Generated by paradigm shift.
50
+ `},{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(`
51
+ `)}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(`
52
+ \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
53
+ `)),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
54
+ 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()+`
55
+ workspace: "${u}"
56
+ `;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()+`
57
+ workspace: "${b}"
58
+ `;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
59
+ `));}catch(t){console.log(e.yellow(` \u26A0 Team init warning: ${t.message}
60
+ `));}}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};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {b as b$1}from'./chunk-WESTEMIM.js';import'./chunk-FYDRENK7.js';import {d}from'./chunk-IZSBGW6E.js';import {e}from'./chunk-AO7ZSRME.js';import {d as d$1}from'./chunk-EKZDFEJW.js';import'./chunk-5TAVYPOV.js';import*as b from'path';import r from'chalk';import x from'ora';async function J(t,m,o){let f=m?b.resolve(m):process.cwd();if(!o.task){o.json?console.log(JSON.stringify({error:'Task is required. Use --task "..."'})):(console.log(r.red(`
2
+ import {b as b$1}from'./chunk-UDUHSHO4.js';import'./chunk-FYDRENK7.js';import {d}from'./chunk-HXGYVS2N.js';import {e}from'./chunk-AO7ZSRME.js';import {d as d$1}from'./chunk-EKZDFEJW.js';import'./chunk-5TAVYPOV.js';import*as b from'path';import r from'chalk';import x from'ora';async function J(t,m,o){let f=m?b.resolve(m):process.cwd();if(!o.task){o.json?console.log(JSON.stringify({error:'Task is required. Use --task "..."'})):(console.log(r.red(`
3
3
  Task is required. Use --task "..."`)),console.log(r.gray(`Example: paradigm team spawn architect --task "Design the payment API"
4
4
  `)));return}let a=e(f);if(!a){o.json?console.log(JSON.stringify({error:"Team not configured"})):console.log(r.yellow("\nTeam not configured. Run `paradigm team init` first.\n"));return}if(!a.agents[t]){o.json?console.log(JSON.stringify({error:`Unknown agent: ${t}`,available:Object.keys(a.agents)})):(console.log(r.red(`
5
5
  Unknown agent: ${t}`)),console.log(r.gray(`Available agents: ${Object.keys(a.agents).join(", ")}
@@ -2,7 +2,7 @@
2
2
  import {b as b$1,i,h,f,a,c,d,q as q$1,k,e as e$1,o,t,u,g,p as p$1,m,n,s,r,x,v,A,w,y,z}from'./chunk-CUOEZAVL.js';import'./chunk-5TAVYPOV.js';import e from'chalk';import*as b from'path';import*as p from'fs';import*as q from'os';async function te(s){let o=process.cwd();if(s.remote){await Y(o,s.remote);return}let r=b$1(o);console.log(e.green(`\u2713 Joined as ${e.bold(r.id)}`));let i$1=i().filter(l=>l.id!==r.id);if(i$1.length>0){console.log(e.cyan(`
3
3
  Found ${i$1.length} other session${i$1.length!==1?"s":""}:`));for(let l of i$1){let t=h(l)?e.yellow("asleep"):e.green("awake");console.log(` ${e.white(l.id)} \u2014 ${l.name} [${t}]`);}}else console.log(e.gray(`
4
4
  No other sessions found. Open another terminal and run "paradigm symphony join".`));console.log(e.gray(`
5
- Tip: Set up polling with: /loop 10s paradigm_symphony_poll`));}async function Y(s,o){let{SymphonyRelay:r}=await import('./symphony-relay-KBHN3ZMR.js'),n,i;if(o.includes("#")){let c=o.split("#");n=c[0],i=c[1];}else n=o;n.includes(":")||(n=`${n}:3939`);let l=f(s);l||(l=b$1(s));let t;if(i)t=i,console.log(e.cyan(`
5
+ Tip: Set up polling with: /loop 10s paradigm_symphony_poll`));}async function Y(s,o){let{SymphonyRelay:r}=await import('./symphony-relay-CIMRXQHI.js'),n,i;if(o.includes("#")){let c=o.split("#");n=c[0],i=c[1];}else n=o;n.includes(":")||(n=`${n}:3939`);let l=f(s);l||(l=b$1(s));let t;if(i)t=i,console.log(e.cyan(`
6
6
  Connecting to ${n} with embedded pairing code...`));else if(console.log(e.cyan(`
7
7
  Connecting to ${n}...`)),console.log(e.white(" Enter the 6-digit pairing code shown on the host:")),t=await K(" Code: "),t=t.trim(),!/^\d{6}$/.test(t)){console.log(e.red(" Invalid code. Must be 6 digits."));return}let a=new r({mode:"client",peerId:l.id,events:{onPeerConnected:(c,g)=>{console.log(e.green(` \u2713 Connected to ${e.bold(g)} (${c})`));},onPeerDisconnected:c=>{console.log(e.yellow(` Peer ${c} disconnected. Reconnecting...`));},onMessageRelayed:(c,g,y)=>{console.log(e.gray(` \u2190 Message ${c.slice(0,8)} from ${g} \u2192 ${y}`));},onError:c=>{console.log(e.red(` Error: ${c.message}`));}}});try{await a.connectToServer(n,t),console.log(e.green(`
8
8
  \u2713 Paired and connected!`)),console.log(e.gray(" Messages from remote agents will appear in your inbox.")),console.log(e.gray(` Press Ctrl+C to disconnect.
@@ -28,7 +28,7 @@ import {b as b$1,i,h,f,a,c,d,q as q$1,k,e as e$1,o,t,u,g,p as p$1,m,n,s,r,x,v,A,
28
28
  `));for(let n of r){let i=new Date(n.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});console.log(` ${e.cyan(n.sender.name)} ${e.gray(`[${n.intent}]`)} ${e.gray(i)}`);let l=n.content.text.split(`
29
29
  `);for(let t of l)console.log(` ${t}`);n.symbols.length>0&&console.log(` ${e.gray(`Symbols: ${n.symbols.join(", ")}`)}`),n.content.decision&&console.log(` ${e.green(`Decision: ${n.content.decision}`)}`),console.log();}}async function de(s,o){let r$1=p$1(s);if(!r$1){console.log(e.red(`Thread not found: ${s}`));return}r(s,o.decision)?(console.log(e.green(`\u2713 Thread resolved: ${r$1.topic}`)),o.decision&&console.log(e.gray(` Decision: ${o.decision}`)),console.log(e.gray(` Tip: Record this as lore with "paradigm lore record --title 'Thread: ${r$1.topic}'"`))):console.log(e.red("Failed to resolve thread."));}async function ye(s){e$1();let o=process.cwd(),r=f(o),n=d(),i=q$1("active"),l=x("pending"),t=r?k(r.id):[],{loadPeers:a}=await import('./symphony-peers-X5NGWXFP.js'),g=a().filter(d=>!d.revoked);if(s.json){console.log(JSON.stringify({identity:r?{id:r.id,project:r.project,role:r.role}:null,agents:n.map(d=>({id:d.id,status:h(d)?"asleep":"awake",statusBlurb:d.statusBlurb})),peers:g.map(d=>({id:d.id,address:d.address,agents:d.agents?.length??0,lastSeen:d.lastSeen})),activeThreads:i.length,unreadMessages:t.length,pendingFileRequests:l.length},null,2));return}console.log(e.cyan(`
30
30
  Symphony Status
31
- `)),console.log(r?` ${e.white("Identity:")} ${r.id}`:` ${e.yellow("Not joined.")} Run "paradigm symphony join" to join.`);let y=n.filter(d=>!h(d)).length;console.log(` ${e.white("Agents:")} ${n.length} joined (${y} awake)`);for(let d of n){let h$1=h(d)?e.yellow("asleep"):e.green("awake"),u=d.statusBlurb?e.gray(` \u2014 ${d.statusBlurb}`):"";console.log(` ${e.white(d.id)} [${h$1}]${u}`);}if(g.length>0){let d=g.reduce((h,u)=>h+(u.agents?.length??0),0);console.log(` ${e.white("Peers:")} ${g.length} connected (${d} remote agents)`);for(let h of g){let u=h.agents?.length??0;console.log(` ${e.white(h.id)} at ${h.address} (${u} agent${u!==1?"s":""})`);}}else console.log(` ${e.white("Peers:")} ${e.gray('none (run "paradigm symphony serve" to accept connections)')}`);console.log(` ${e.white("Threads:")} ${i.length} active`),console.log(` ${e.white("Unread:")} ${t.length} note${t.length!==1?"s":""}`),console.log(` ${e.white("File Requests:")} ${l.length} pending`),console.log();}async function pe(s){let o=parseInt(s.port||"3939",10),r=process.cwd(),{SymphonyRelay:n}=await import('./symphony-relay-KBHN3ZMR.js'),i=f(r);i||(i=b$1(r)),console.log(e.cyan(`
31
+ `)),console.log(r?` ${e.white("Identity:")} ${r.id}`:` ${e.yellow("Not joined.")} Run "paradigm symphony join" to join.`);let y=n.filter(d=>!h(d)).length;console.log(` ${e.white("Agents:")} ${n.length} joined (${y} awake)`);for(let d of n){let h$1=h(d)?e.yellow("asleep"):e.green("awake"),u=d.statusBlurb?e.gray(` \u2014 ${d.statusBlurb}`):"";console.log(` ${e.white(d.id)} [${h$1}]${u}`);}if(g.length>0){let d=g.reduce((h,u)=>h+(u.agents?.length??0),0);console.log(` ${e.white("Peers:")} ${g.length} connected (${d} remote agents)`);for(let h of g){let u=h.agents?.length??0;console.log(` ${e.white(h.id)} at ${h.address} (${u} agent${u!==1?"s":""})`);}}else console.log(` ${e.white("Peers:")} ${e.gray('none (run "paradigm symphony serve" to accept connections)')}`);console.log(` ${e.white("Threads:")} ${i.length} active`),console.log(` ${e.white("Unread:")} ${t.length} note${t.length!==1?"s":""}`),console.log(` ${e.white("File Requests:")} ${l.length} pending`),console.log();}async function pe(s){let o=parseInt(s.port||"3939",10),r=process.cwd(),{SymphonyRelay:n}=await import('./symphony-relay-CIMRXQHI.js'),i=f(r);i||(i=b$1(r)),console.log(e.cyan(`
32
32
  Starting Symphony relay server...
33
33
  `));let l=new n({mode:"server",peerId:i.id,port:o,events:{onPeerConnected:(t,a)=>{console.log(e.green(` \u2713 Peer connected: ${e.bold(a)} (${t})`));let c=l.getRemoteAgents();c.length>0&&console.log(e.gray(` Remote agents: ${c.map(g=>g.id).join(", ")}`));},onPeerDisconnected:t=>{console.log(e.yellow(` Peer disconnected: ${t}`));},onPeerAuthFailed:(t,a)=>{console.log(e.red(` Auth failed from ${t}: ${a}`));},onMessageRelayed:(t,a,c)=>{console.log(e.gray(` \u2194 Relayed ${t.slice(0,8)} from ${a} to ${c}`));},onError:t=>{console.log(e.red(` Error: ${t.message}`));}}});try{let t=await l.startServer(),a=Q();if(console.log(e.green(` \u2713 Symphony relay listening on port ${o}`)),console.log(),console.log(e.white(" Pairing Code:")),console.log(),console.log(e.bold.cyan(` ${t.code.slice(0,3)} ${t.code.slice(3)}`)),console.log(),console.log(e.gray(" Share this code with the person connecting.")),console.log(e.gray(` Code rotates every 5 minutes.
34
34
  `)),console.log(e.white(" LAN connect:")),console.log(e.gray(` paradigm symphony join --remote ${a}:${o}`)),s.public){let g=`${a}:${o}#${t.code}`;console.log(),console.log(e.white(" Internet connect (connection string):")),console.log(e.cyan(` paradigm symphony join --remote ${g}`)),console.log(e.gray(" (Requires port 3939 reachable: port forward, VPN, or SSH tunnel)"));}console.log(e.gray(`
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import {a}from'./chunk-7SWEOPWF.js';import {k,l,n,f as f$1,m as m$1,c as c$1,j,i}from'./chunk-J32OPJEX.js';import {d,j as j$1,l as l$1,h}from'./chunk-CUOEZAVL.js';import'./chunk-5TAVYPOV.js';import*as f from'fs';import*as m from'path';import*as A from'os';import*as v from'crypto';import {WebSocketServer,WebSocket}from'ws';var q=m.join(A.homedir(),".paradigm","score"),W=2e3,x=3e4,D=1e4,L=3,H=6e4,R=1e3,U=3e4;function c(p,e){p.readyState===WebSocket.OPEN&&p.send(JSON.stringify(e));}function C(p){try{let e=typeof p=="string"?p:String(p);return JSON.parse(e)}catch{return null}}var O=class p{wss=null;wsClient=null;mode;pairingState=null;connectedPeers=new Map;seenMessageIds=new Set;outboxWatchInterval=null;keepaliveInterval=null;reconnectTimer=null;reconnectDelay=R;outboxPositions=new Map;events;myPeerId;port;stopped=false;failedAuthAttempts=new Map;pongTimers=new Map;serverAddress=null;serverCode=null;static MAX_SEEN_IDS=1e4;constructor(e){this.mode=e.mode,this.myPeerId=e.peerId,this.port=e.port??3939,this.events=e.events??{};}async startServer(){if(this.mode!=="server")throw new Error('startServer() requires mode "server"');return this.pairingState=k(),this.wss=new WebSocketServer({port:this.port}),this.wss.on("connection",(e,t)=>{let n=t.socket.remoteAddress??"unknown";if(this.isRateLimited(n)){c(e,{type:"auth_fail",reason:"Too many failed attempts \u2014 try again later"}),e.close();return}let s=v.randomBytes(32).toString("hex");c(e,{type:"hello",version:"1.0",peerId:this.myPeerId,challenge:s});let i=false;e.on("message",r=>{let o=C(r);if(o){if(!i){this.handleServerAuth(e,o,s,n).then(a=>{a&&(i=true,this.registerPeerConnection(a,e));}).catch(a=>{this.events.onError?.(a instanceof Error?a:new Error(String(a)));});return}this.handleAuthenticatedFrame(e,o);}}),e.on("close",()=>{i&&this.handlePeerDisconnect(e);}),e.on("error",r=>{this.events.onError?.(r);});}),this.wss.on("error",e=>{this.events.onError?.(e);}),await new Promise((e,t)=>{this.wss.on("listening",e),this.wss.on("error",t);}),this.startOutboxWatcher(),this.startKeepalive(),this.pairingState}async handleServerAuth(e,t,n$1,s){if(t.type!=="auth")return c(e,{type:"auth_fail",reason:"Expected auth frame"}),e.close(),null;if(!this.pairingState||!l(this.pairingState,t.code)){this.recordFailedAuth(s);let a="Invalid or expired pairing code";return c(e,{type:"auth_fail",reason:a}),this.events.onPeerAuthFailed?.(s,a),e.close(),null}let i=this.pairingState.codeHash;if(!n(n$1,i,t.proof)){this.recordFailedAuth(s);let a="HMAC proof verification failed";return c(e,{type:"auth_fail",reason:a}),this.events.onPeerAuthFailed?.(s,a),e.close(),null}let r=this.getLocalAgentSummaries(),o=this.myPeerId;return c(e,{type:"auth_ok",peerId:this.myPeerId,displayName:o,agents:r}),f$1({id:t.peerId,displayName:t.peerId,address:s,sharedSecret:this.pairingState.sharedSecret,connectedAt:new Date().toISOString(),lastSeen:new Date().toISOString(),revoked:false,agents:[]}),t.peerId}async connectToServer(e,t){if(this.mode!=="client")throw new Error('connectToServer() requires mode "client"');this.serverAddress=e,this.serverCode=t,await this.attemptConnection(e,t);}attemptConnection(e,t){return new Promise((n,s)=>{if(this.stopped){s(new Error("Relay has been stopped"));return}let i=e.includes("://")?e:`ws://${e}`,r=new WebSocket(i),o=false;r.on("open",()=>{this.wsClient=r;}),r.on("message",a=>{let d=C(a);if(d)switch(d.type){case "hello":{let y=v.createHash("sha256").update(t).digest("hex"),N=m$1(d.challenge,y);c(r,{type:"auth",peerId:this.myPeerId,code:t,proof:N});break}case "auth_ok":{f$1({id:d.peerId,displayName:d.displayName,address:e,sharedSecret:t,connectedAt:new Date().toISOString(),lastSeen:new Date().toISOString(),revoked:false,agents:d.agents}),c(r,{type:"agents_sync",agents:this.getLocalAgentSummaries()}),this.registerPeerConnection(d.peerId,r),this.startOutboxWatcher(),this.startKeepalive(),this.reconnectDelay=R,o||(o=true,n());break}case "auth_fail":{o||(o=true,s(new Error(`Auth failed: ${d.reason}`))),r.close();break}default:this.handleAuthenticatedFrame(r,d);break}}),r.on("close",()=>{this.handlePeerDisconnect(r),o?this.stopped||this.scheduleReconnect():(o=true,s(new Error("Connection closed before auth completed")));}),r.on("error",a=>{this.events.onError?.(a),o||(o=true,s(a));});})}handleAuthenticatedFrame(e,t){switch(t.type){case "message":this.handleIncomingMessage(e,t.message,t.origin);break;case "message_ack":break;case "nomination_forward":this.handleNominationForward(e,t.nomination,t.origin);break;case "agents_sync":this.handleAgentsSync(e,t.agents);break;case "agent_joined":{let n=this.peerIdForSocket(e);if(n){let i=c$1().find(r=>r.id===n);if(i){let r=[...i.agents||[],t.agent];j(n,r);}}break}case "agent_left":{let n=this.peerIdForSocket(e);if(n){let i=c$1().find(r=>r.id===n);if(i){let r=(i.agents||[]).filter(o=>o.id!==t.agentId);j(n,r);}}break}case "peer_leaving":this.handlePeerDisconnect(e),e.close();break;case "ping":c(e,{type:"pong"});break;case "pong":this.handlePong(e);break;}}handleIncomingMessage(e,t,n){let s=t.contentType;if(s&&a.includes(s)){c(e,{type:"message_ack",messageId:t.id});return}if(this.seenMessageIds.has(t.id)){c(e,{type:"message_ack",messageId:t.id});return}this.addToSeenIds(t.id);let i=d();if(t.recipients&&t.recipients.length>0)for(let r of t.recipients){let o=i.find(a=>a.id===r.id);o&&(j$1(o.id,t),this.events.onMessageRelayed?.(t.id,n,o.id));}else for(let r of i)j$1(r.id,t),this.events.onMessageRelayed?.(t.id,n,r.id);if(this.mode==="server"){let r=this.peerIdForSocket(e);for(let[o,a]of this.connectedPeers)o!==r&&o!==n&&c(a,{type:"message",message:t,origin:n});}c(e,{type:"message_ack",messageId:t.id});}handleNominationForward(e,t,n){if(!t?.id)return;let s={...t,remote_origin:n,forwarded_at:new Date().toISOString()};try{let i=m.join(A.homedir(),".paradigm","events");f.mkdirSync(i,{recursive:!0});let r=m.join(i,"nominations.jsonl");f.appendFileSync(r,JSON.stringify(s)+`
3
+ `,"utf8");}catch{}if(this.mode==="server")for(let[i,r]of this.connectedPeers)r!==e&&r.readyState===WebSocket.OPEN&&c(r,{type:"nomination_forward",nomination:s,origin:n});c(e,{type:"nomination_ack",nominationId:t.id});}handleAgentsSync(e,t){let n=this.peerIdForSocket(e);n&&(j(n,t),i(n));}startOutboxWatcher(){this.outboxWatchInterval||(this.outboxWatchInterval=setInterval(()=>{if(this.connectedPeers.size!==0)try{let e=d();for(let t of e){let n=l$1(t.id),s=this.outboxPositions.get(t.id)??0;if(n.length<=s)continue;let i=n.slice(s);for(let r of i){if(this.seenMessageIds.has(r.id))continue;let o=r.contentType;if(o&&a.includes(o))continue;this.addToSeenIds(r.id);let a$1={type:"message",message:r,origin:this.myPeerId};for(let[d,y]of this.connectedPeers)c(y,a$1);}this.outboxPositions.set(t.id,n.length);}}catch(e){this.events.onError?.(e instanceof Error?e:new Error(String(e)));}},W));}stopOutboxWatcher(){this.outboxWatchInterval&&(clearInterval(this.outboxWatchInterval),this.outboxWatchInterval=null);}startKeepalive(){this.keepaliveInterval||(this.keepaliveInterval=setInterval(()=>{for(let[e,t]of this.connectedPeers){c(t,{type:"ping"});let n=setTimeout(()=>{this.handlePeerDisconnect(t),t.terminate();},D);this.pongTimers.set(e,n);}},x));}stopKeepalive(){this.keepaliveInterval&&(clearInterval(this.keepaliveInterval),this.keepaliveInterval=null);for(let e of this.pongTimers.values())clearTimeout(e);this.pongTimers.clear();}handlePong(e){let t=this.peerIdForSocket(e);if(t){let n=this.pongTimers.get(t);n&&(clearTimeout(n),this.pongTimers.delete(t)),i(t);}}registerPeerConnection(e,t){let n=this.connectedPeers.get(e);n&&n!==t&&n.close(),this.connectedPeers.set(e,t),i(e),this.events.onPeerConnected?.(e,e);}handlePeerDisconnect(e){let t=this.peerIdForSocket(e);if(!t)return;this.connectedPeers.delete(t);let n=this.pongTimers.get(t);n&&(clearTimeout(n),this.pongTimers.delete(t)),this.events.onPeerDisconnected?.(t);}peerIdForSocket(e){for(let[t,n]of this.connectedPeers)if(n===e)return t;return null}scheduleReconnect(){if(this.stopped||this.mode!=="client"||!this.serverAddress||!this.serverCode)return;this.stopOutboxWatcher(),this.stopKeepalive(),this.wsClient=null;let e=this.reconnectDelay;this.reconnectDelay=Math.min(this.reconnectDelay*2,U),this.reconnectTimer=setTimeout(()=>{this.stopped||this.attemptConnection(this.serverAddress,this.serverCode).catch(t=>{this.events.onError?.(t instanceof Error?t:new Error(String(t)));});},e);}isRateLimited(e){let t=this.failedAuthAttempts.get(e);return t?Date.now()<t.cooldownUntil?true:t.count>=L?(t.cooldownUntil=Date.now()+H,true):false:false}recordFailedAuth(e){let t=this.failedAuthAttempts.get(e);t?t.count++:this.failedAuthAttempts.set(e,{count:1,cooldownUntil:0});}addToSeenIds(e){if(this.seenMessageIds.add(e),this.seenMessageIds.size>p.MAX_SEEN_IDS){let t=Array.from(this.seenMessageIds),n=Math.floor(t.length/2);this.seenMessageIds=new Set(t.slice(n));}}getLocalAgentSummaries(){return d().map(e=>({id:e.id,project:e.project,role:e.role,status:h(e)?"asleep":"awake"}))}stop(){this.stopped=true;for(let[e,t]of this.connectedPeers)c(t,{type:"peer_leaving"}),t.close();this.connectedPeers.clear(),this.wsClient&&(this.wsClient.close(),this.wsClient=null),this.stopOutboxWatcher(),this.stopKeepalive(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.wss&&(this.wss.close(),this.wss=null);}getConnectedPeers(){return Array.from(this.connectedPeers.keys())}getRemoteAgents(){let e=[],t=c$1();for(let n of this.connectedPeers.keys()){let s=t.find(i=>i.id===n);if(s?.agents)for(let i of s.agents)e.push({...i,peerId:n});}return e}rotatePairingCode(){if(this.mode!=="server")throw new Error('rotatePairingCode() requires mode "server"');return this.pairingState=k(),this.pairingState}};export{q as SCORE_DIR,O as SymphonyRelay};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export{e as teamAcceptCommand,f as teamCheckCommand,d as teamHandoffCommand,g as teamHistoryCommand,b as teamInitCommand,a as teamModelsCommand,h as teamResetCommand,c as teamStatusCommand}from'./chunk-VPMJWJ5R.js';import'./chunk-DG236EXP.js';import'./chunk-TYWB5IQJ.js';import'./chunk-WESTEMIM.js';import'./chunk-FYDRENK7.js';import'./chunk-IZSBGW6E.js';import'./chunk-AO7ZSRME.js';import'./chunk-Y4XFVDZC.js';import'./chunk-SHD27BQX.js';import'./chunk-EKZDFEJW.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';
2
+ export{e as teamAcceptCommand,f as teamCheckCommand,d as teamHandoffCommand,g as teamHistoryCommand,b as teamInitCommand,a as teamModelsCommand,h as teamResetCommand,c as teamStatusCommand}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'./chunk-AO7ZSRME.js';import'./chunk-Y4XFVDZC.js';import'./chunk-SHD27BQX.js';import'./chunk-EKZDFEJW.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';
@@ -1,9 +1,29 @@
1
1
  version: 2.0.0
2
2
  name: university-courses
3
- description: Course content for Paradigm University — 7 courses, 75 lessons. Each lesson is mapped to the Paradigm concepts it teaches so that ripple analysis can identify which lessons need updating when a concept changes.
3
+ description: Course content for Paradigm University — 8 courses, 82 lessons. Each lesson is mapped to the Paradigm concepts it teaches so that ripple analysis can identify which lessons need updating when a concept changes.
4
4
 
5
5
  components:
6
- # PARA 101: Foundations (9 lessons)
6
+ # PARA 001: Quick Start (3 lessons)
7
+
8
+ para-001-shift-setup:
9
+ description: "Quick Start — Your First paradigm shift: one-command setup, what gets created"
10
+ file: para-001.json
11
+ tags: [course-content, para-001]
12
+ references: ["#shift-command", "#enforcement-hooks"]
13
+
14
+ para-001-meet-the-team:
15
+ description: "Quick Start — Meet Your Agent Team: 8 core agents, tiers, Maestro model"
16
+ file: para-001.json
17
+ tags: [course-content, para-001]
18
+ references: ["#orchestration", "#agent-loader"]
19
+
20
+ para-001-build-something:
21
+ description: "Quick Start — Build With the Team: full orchestration loop, quick-check, commit conventions"
22
+ file: para-001.json
23
+ tags: [course-content, para-001]
24
+ references: ["#orchestration", "#symbol-system", "#enforcement-hooks"]
25
+
26
+ # PARA 101: Foundations (9 lessons — reordered: first-steps at position 2)
7
27
 
8
28
  para-101-welcome:
9
29
  description: "Welcome to Paradigm — three pillars, why structured context matters"
@@ -74,7 +94,7 @@ components:
74
94
  references: ["#aspect-anchoring"]
75
95
 
76
96
  para-201-aspect-graph:
77
- description: "Aspect Graph — symbol relationships, graph visualization"
97
+ description: "Aspect Graph Introduction condensed overview, 5 categories, 7 MCP tools, pointer to PARA 501 for internals"
78
98
  file: para-201.json
79
99
  tags: [course-content, para-201]
80
100
  references: ["#symbol-graph", "#aspect-anchoring"]
@@ -121,7 +141,7 @@ components:
121
141
  tags: [course-content, para-201]
122
142
  references: ["#flow-validation", "#portal-protocol", "#aspect-anchoring", "#symbol-system"]
123
143
 
124
- # PARA 301: Operations (11 lessons)
144
+ # PARA 301: Operations (13 lessons — added enforcement-levels and paradigm-shift)
125
145
 
126
146
  para-301-history-system:
127
147
  description: "History System — implementation history, event tracking"
@@ -153,6 +173,18 @@ components:
153
173
  tags: [course-content, para-301]
154
174
  references: ["#navigation"]
155
175
 
176
+ para-301-enforcement-levels:
177
+ description: "Enforcement Levels — minimal/balanced/strict, 13 checks, per-check overrides, progression strategy"
178
+ file: para-301.json
179
+ tags: [course-content, para-301]
180
+ references: ["#enforcement-hooks", "#enforcement-presets"]
181
+
182
+ para-301-paradigm-shift:
183
+ description: "The paradigm shift Command — 6-step onboarding, flags, when to re-run, idempotent setup"
184
+ file: para-301.json
185
+ tags: [course-content, para-301]
186
+ references: ["#shift-command", "#scan-index", "#enforcement-hooks"]
187
+
156
188
  para-301-navigation-system:
157
189
  description: "Navigation System — paradigm_navigate, find/explore/context intents"
158
190
  file: para-301.json
@@ -189,7 +221,7 @@ components:
189
221
  tags: [course-content, para-301]
190
222
  references: ["#lore-system", "#wisdom-system", "#ripple-analysis", "#navigation", "#sentinel", "#protocol-system"]
191
223
 
192
- # PARA 401: Orchestration (11 lessons)
224
+ # PARA 401: Orchestration (12 lessons — added quick-check, updated agent-roles with Rune + roster bridge)
193
225
 
194
226
  para-401-mcp-tools-overview:
195
227
  description: "MCP Tools Overview — 95 tools, token budgets, query vs file read"
@@ -204,10 +236,10 @@ components:
204
236
  references: ["#orchestration"]
205
237
 
206
238
  para-401-agent-roles:
207
- description: "Agent Roles — architect, builder, reviewer, tester, security"
239
+ description: "Agent Roles — 8 core + 54 total, three-tier hierarchy, Rune compliance, facets, handoff, reviewer protocol"
208
240
  file: para-401.json
209
241
  tags: [course-content, para-401]
210
- references: ["#orchestration"]
242
+ references: ["#orchestration", "#agent-loader"]
211
243
 
212
244
  para-401-provider-cascade:
213
245
  description: "Provider Cascade — auto, claude, claude-code, cursor-cli, manual"
@@ -221,6 +253,12 @@ components:
221
253
  tags: [course-content, para-401]
222
254
  references: ["#orchestration", "#pm-governance"]
223
255
 
256
+ para-401-quick-check:
257
+ description: "Quick-Check: Ask Before You Build — lightweight risk assessment, Jinx + reviewer, GREENLIGHT vs ESCALATE"
258
+ file: para-401.json
259
+ tags: [course-content, para-401]
260
+ references: ["#orchestration"]
261
+
224
262
  para-401-pm-governance:
225
263
  description: "PM Governance — preflight, postflight, compliance checks"
226
264
  file: para-401.json
@@ -256,7 +294,7 @@ components:
256
294
  type: lesson
257
295
  tags: [university, notebooks, agent-identity, permissions]
258
296
 
259
- # PARA 501: Advanced Systems (14 lessons)
297
+ # PARA 501: Advanced Systems (15 lessons — added conductor-workspace)
260
298
 
261
299
  para-501-lore-system:
262
300
  description: "Lore System — entries, types, arcs, linked entries, timeline"
@@ -324,6 +362,12 @@ components:
324
362
  tags: [course-content, para-501]
325
363
  references: ["#PlatformServer", "#PlatformWebSocket", "#AgentPresenceManager", "#UserStateTracker", "#AgentCommandRoute", "#PlatformTools", "#AgentStore", "#AgentToast", "#AgentCallout"]
326
364
 
365
+ para-501-conductor-workspace:
366
+ description: "Conductor: Visual Mission Control — workspace tiling, Symphony integration, task protocol, agent health, local ML"
367
+ file: para-501.json
368
+ tags: [course-content, para-501]
369
+ references: ["#conductor", "#orchestration"]
370
+
327
371
  para-501-review-compliance:
328
372
  description: "University lesson: Automated Review Pipeline — paradigm review, compliance-checker, dynamic tool loading, response format"
329
373
  type: lesson