@a-company/paradigm 5.21.0 → 5.21.1
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.
- package/dist/{accept-orchestration-IUAWQZUN.js → accept-orchestration-CLT6SAYW.js} +1 -1
- package/dist/{chunk-L6K5HNDL.js → chunk-DG236EXP.js} +1 -1
- package/dist/chunk-SHD27BQX.js +6 -0
- package/dist/{chunk-RVRARWSY.js → chunk-UONPO7SC.js} +1 -1
- package/dist/{chunk-NXRVR37G.js → chunk-VPMJWJ5R.js} +1 -1
- package/dist/{compliance-GZ7UAOG3.js → compliance-33HC4D5Z.js} +1 -1
- package/dist/{diff-RTFUKJHF.js → diff-YM6ZV3UI.js} +1 -1
- package/dist/doctor-PA7EAJO2.js +2 -0
- package/dist/{flow-S3RQ4YPY.js → flow-POQP27WA.js} +1 -1
- package/dist/index.js +4 -4
- package/dist/{orchestrate-35HBQ3O3.js → orchestrate-4L3NJCV5.js} +1 -1
- package/dist/{portal-check-3JVNLOEP.js → portal-check-Z3OCQEQR.js} +1 -1
- package/dist/{portal-compliance-2UG4VKWH.js → portal-compliance-4MG5F2GI.js} +1 -1
- package/dist/{shift-6GCNH666.js → shift-3IP3E5KJ.js} +1 -1
- package/dist/{team-WGERKGNP.js → team-MKLPUTW7.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-NW6OKHE6.js +0 -5
- package/dist/doctor-2T2QL6VM.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {b}from'./chunk-
|
|
2
|
+
import {b}from'./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-SHD27BQX.js';import'./chunk-EKZDFEJW.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as g from'path';import e from'chalk';async function u(n,s,r){let a=s?g.resolve(s):process.cwd();if(!n){r.json?console.log(JSON.stringify({error:"Orchestration ID required"})):(console.log(e.red(`
|
|
3
3
|
Orchestration ID required.`)),console.log(e.gray(`Usage: paradigm team accept <orchestration-id>
|
|
4
4
|
`)));return}let l=new b(a),o=l.getOrchestration(n);if(!o){r.json?console.log(JSON.stringify({error:"Orchestration not found",id:n})):console.log(e.red(`
|
|
5
5
|
Orchestration not found: ${n}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a as a$3}from'./chunk-TYWB5IQJ.js';import {b,a as a$1}from'./chunk-WESTEMIM.js';import {a}from'./chunk-FYDRENK7.js';import {e}from'./chunk-AO7ZSRME.js';import {a as a$2,b as b$2}from'./chunk-NW6OKHE6.js';import {b as b$1}from'./chunk-EKZDFEJW.js';import {o,t,x}from'./chunk-T6IDXUUA.js';import'minimatch';import*as w from'fs';import*as C from'path';import*as F from'js-yaml';import {spawn}from'child_process';var ee=["should","what","how","why","recommend","analyze","compare","evaluate","assess","review","explain","describe","investigate","which","best practice","trade-off","tradeoff","pros and cons","decision"],te=["document","write docs","readme",".purpose","purpose file","jsdoc","tsdoc","comments","docstring","api docs","changelog","architecture doc"],se=["bug","fix","broken","not working","issue","error","crash","fails","failing","wrong","incorrect","doesn't work","doesn't","cant","can't","regression","patch"],re=["rename","refactor","migrate","restructure","move","reorganize","clean up","cleanup","consolidate","extract","inline","simplify","modularize","decouple","split","merge"],ne=["auth","authentication","authorization","permission","admin","delete","purge","password","credential","token","secret","key","encrypt","decrypt","hash","session","oauth","jwt","api key","role","access","gate","portal","sensitive","private","security","vulnerability","xss","sql injection","csrf"],oe=/[@#$%^!?&~][a-zA-Z0-9_-]+/g,Y={analysis:{agents:["architect"],models:{architect:"opus"},costMultiplier:{min:.3,max:.5}},documentation:{agents:["architect"],models:{architect:"sonnet"},costMultiplier:{min:.25,max:.45}},bugfix:{agents:["security","builder"],models:{security:"opus",builder:"haiku"},costMultiplier:{min:.5,max:.8}},refactor:{agents:["architect","builder"],models:{architect:"opus",builder:"haiku"},costMultiplier:{min:.6,max:.85}},feature:{agents:["architect","security","builder","tester"],models:{architect:"opus",security:"opus",builder:"haiku",tester:"haiku"},costMultiplier:{min:.8,max:1.2}}};function ie(f){let s=f.match(oe)||[];return [...new Set(s)]}function $(f,s){let e=f.toLowerCase();return s.filter(t=>e.includes(t.toLowerCase()))}function ae(f,s,e,t){let n=0;e.length>=5?n+=2:e.length>=2&&(n+=1);let o=f.split(/\s+/).length;o>=100?n+=2:o>=50&&(n+=1);let r=new Set(e.map(a=>a[0]));return r.size>=4?n+=2:r.size>=2&&(n+=1),e.some(a=>a.startsWith("^"))&&(n+=1),e.some(a=>a.startsWith("$"))&&(n+=1),s==="feature"&&(n+=1),s==="refactor"&&(n+=1),n>=5?"high":n>=2?"medium":"low"}function le(f,s,e){if($(f,ne).length>0||s.some(n=>n.startsWith("^")))return true;return false}function K(f,s){let e=ie(f),t=$(f,ee),n=$(f,te),o=$(f,se),r=$(f,re),a,i;t.length>0&&o.length===0&&r.length===0?(a="analysis",i=t):n.length>0&&o.length===0?(a="documentation",i=n):o.length>0?(a="bugfix",i=o):r.length>0?(a="refactor",i=r):(a="feature",i=[]);let l=Y[a],g=le(f,e),c=[...l.agents];g&&!c.includes("security")&&(c=["security",...c]);let p=ae(f,a,e),h={...l.costMultiplier};return p==="high"?(h.min*=1.2,h.max*=1.3):p==="low"&&(h.min*=.8,h.max*=.9),g&&!l.agents.includes("security")&&(h.min+=.15,h.max+=.2),{type:a,complexity:p,recommendedAgents:c,securityRequired:g,costMultiplier:h,matchedKeywords:i,symbols:e}}function B(f,s){let e=Y[s.type];return f==="security"&&s.securityRequired?"opus":e.models[f]||"sonnet"}var ce=/[@#$%^!?&~][a-zA-Z][a-zA-Z0-9_-]*/g,ue=[/\.(get|post|put|patch|delete)\s*\(\s*['"`]([^'"`]+)['"`]/gi,/export\s+(async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE)/gi,/export\s+(async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE)/gi,/\.(get|post|put|patch|delete)\s*\(\s*['"`]([^'"`]+)['"`]/gi],de=["endpoint","route","api","handler","get","post","put","patch","delete","rest","crud","controller"];function V(f,s,e$1){let t$1=f.toLowerCase(),n=f.match(ce)||[],o=[...new Set(n)],r=o.map(d=>{let u=t(e$1,d),y=u.length>0?u[0]:null;return {symbol:d,exists:!!y,type:y?.type,description:y?.description}}),a=r.filter(d=>d.exists).map(d=>{let u=x(e$1,d.symbol),y=new Set;for(let b of u){let S=x(e$1,b.symbol);for(let O of S)O.symbol!==d.symbol&&!u.find(v=>v.symbol===O.symbol)&&y.add(O.symbol);}let k=u.length+y.size,m="low";return k>10?m="high":k>3&&(m="medium"),{symbol:d.symbol,directDependents:u.length,indirectDependents:y.size,impact:m}}),i=a$2(s),l={exists:!!i,gateCount:i?b$2(i).length:0,gates:i?b$2(i).map(d=>`^${d}`):[],routeCount:i?.routes?Object.keys(i.routes).length:0},g=de.some(d=>t$1.includes(d)),c=e(s),p=c?a$3(f,c.agents).map(d=>({name:d.name,confidence:d.confidence,reason:d.reason})):[],h=[];return r.some(d=>d.exists)&&h.push("ripple-analysis"),g&&h.push("portal-compliance"),o.some(d=>d.startsWith("^"))&&h.push("gate-validation"),o.some(d=>d.startsWith("!"))&&h.push("signal-registration"),h.push("purpose-coverage"),{affectedSymbols:r,rippleAnalysis:a,portalStatus:l,taskAddsRoutes:g,suggestedAgents:p,requiredChecks:h}}function H(f,s,e,t$1){let n=[],o=a$2(e),r=o?b$2(o):[],a=o?.routes?Object.keys(o.routes):[];for(let p of f){let h=C.isAbsolute(p)?p:C.join(e,p);if(!w.existsSync(h))continue;let d;try{d=w.readFileSync(h,"utf-8");}catch{continue}for(let u of ue){u.lastIndex=0;let y;for(;(y=u.exec(d))!==null;){let k=y[2]||y[0];k&&k.startsWith("/")&&(!a.some(b=>b.replace(/\s+(GET|POST|PUT|PATCH|DELETE)\s*$/,"").trim()===k)&&o?n.push({type:"missing-portal-gate",severity:"warning",message:`Route "${k}" found in ${C.relative(e,h)} but not declared in portal.yaml`,file:C.relative(e,h),suggestion:"Add this route to portal.yaml with appropriate ^gates. Run paradigm_gates_for_route to get suggestions."}):!o&&k.startsWith("/api/")&&n.push({type:"missing-portal-gate",severity:"warning",message:`API route "${k}" found but no portal.yaml exists`,file:C.relative(e,h),suggestion:"Create portal.yaml to declare gates for API routes. Run: paradigm portal init"}));}}}for(let p of s)t(t$1,p).length===0&&n.push({type:"unregistered-symbol",severity:"error",message:`Symbol "${p}" was touched but is not registered in any .purpose file`,suggestion:`Add "${p}" to the nearest .purpose file. Use paradigm_purpose_add_component or paradigm_purpose_add_signal.`});for(let p of s)if(p.startsWith("^")){let h=p.slice(1);r.includes(h)||n.push({type:"missing-portal-gate",severity:"error",message:`Gate "${p}" is referenced but not declared in portal.yaml`,suggestion:`Add ${p} to portal.yaml with description and check expression.`});}f.length>=5&&s.length>=3&&n.push({type:"uncaptured-wisdom",severity:"warning",message:`Large change (${f.length} files, ${s.length} symbols) \u2014 consider recording architectural decisions`,suggestion:"Use paradigm_wisdom_record to capture any decisions or antipatterns discovered during this task."});let i=n.filter(p=>p.severity==="error").length,l=n.filter(p=>p.severity==="warning").length,g=4,c="pass";return i>0?c="violations":l>0&&(c="warnings"),{status:c,violations:n,summary:{totalChecks:g,passed:g-(i>0?1:0)-(l>0?1:0),warnings:l,errors:i},blocksCompletion:i>0}}var pe={architect:"opus",security:"opus",reviewer:"sonnet",builder:"haiku",tester:"haiku"},he=["auth","permission","admin","delete","purge","password","credential","token","secret","key","encrypt","decrypt","hash","session","oauth","jwt","role","access control","vulnerability","injection","xss","csrf"];function me(f,s){let e=f.toLowerCase(),t=he.some(r=>e.includes(r.toLowerCase())),n=f.includes("^"),o=false;return t||n||o}var ye=["rename","refactor","migrate","restructure","move","reorganize"];function be(f){let s=f.toLowerCase();return ye.some(e=>s.includes(e))}var E=class{spawner;auditLogger;rootDir;constructor(s){this.rootDir=s,this.spawner=new b(s),this.auditLogger=new a(s);}async initialize(){await this.spawner.initialize();}async orchestrate(s,e={}){let t=e.mode||"faceted",n=Date.now(),o$1=this.generateOrchestrationId(),r={success:false,mode:t,orchestrationId:o$1,task:s,agentsSpawned:0,totalTokens:{input:0,output:0,total:0},totalCost:0,duration_ms:0,agentResults:[]};try{let a;if(e.pmGovernance?.enabled)try{let{aggregateFromDirectory:l}=await import('./dist-3ZCH25SG.js'),g=await l(this.rootDir),c=o(g);a=V(s,this.rootDir,c);}catch{}if(t==="solo"){let l=await this.runSoloMode(s,e);r.agentsSpawned=1,r.agentResults=[l],r.success=l.success,l.relay&&(r.totalTokens=l.relay.metrics.tokens_used,r.totalCost=b$1(r.totalTokens,e.orchestratorModel||"opus"));}else {let l=await this.runFacetedMode(s,e);r.agentsSpawned=l.results.length,r.agentResults=l.results,r.totalTokens=l.totalTokens,r.totalCost=l.totalCost,r.success=l.success,r.parallelBuilderStats=l.parallelBuilderStats;}if(e.pmGovernance?.enabled&&a)try{let{aggregateFromDirectory:l}=await import('./dist-3ZCH25SG.js'),g=await l(this.rootDir),c=o(g),p=[],h=[];for(let u of r.agentResults)u.relay?.outputs?.artifacts&&p.push(...u.relay.outputs.artifacts.map(y=>y.path));for(let u of a.affectedSymbols)h.push(u.symbol);let d=H(p,h,this.rootDir,c);r.complianceReport={preflight:a,postflight:d},e.pmGovernance.blockOnViolations&&d.blocksCompletion&&(r.success=!1);}catch{r.complianceReport={preflight:a};}r.duration_ms=Date.now()-n;let i=this.auditLogger.startOrchestration(o$1,s,t);return i.completed=new Date().toISOString(),i.status=r.success?"success":"failed",i.totals={duration_ms:r.duration_ms,tokens:r.totalTokens.total,cost_usd:r.totalCost,agents_spawned:r.agentsSpawned,files_created:0,files_modified:0},this.auditLogger.saveOrchestration(i),r.log=i,r}catch(a){return r.error=a instanceof Error?a.message:String(a),r.duration_ms=Date.now()-n,r}}async compare(s,e={}){let t=await this.orchestrate(s,{...e,mode:"solo"}),n=await this.orchestrate(s,{...e,mode:"faceted"}),o=t.totalTokens.total-n.totalTokens.total,r=t.totalCost-n.totalCost,a=t.duration_ms-n.duration_ms,i="tie";return n.success&&!t.success?i="faceted":t.success&&!n.success?i="solo":n.totalCost<t.totalCost*.8?i="faceted":t.totalCost<n.totalCost*.8&&(i="solo"),{solo:t,faceted:n,comparison:{winner:i,tokensSaved:o,costDiff:r,timeDiff:a,soloSucceeded:t.success,facetedSucceeded:n.success}}}async runSoloMode(s,e$1){let n=e(this.rootDir)?.team.default_agent||"architect",o=e$1.orchestratorModel||"opus",r={model:o,workingDirectory:e$1.workingDirectory||this.rootDir,mcpServerPath:e$1.mcpServerPath,budget:e$1.budget,onMessage:e$1.onMessage?i=>e$1.onMessage("solo",i):void 0,onCheckpoint:e$1.onCheckpoint};e$1.onAgentStart&&e$1.onAgentStart("solo",s,o);let a=await this.spawner.spawn(n,s,r);return e$1.onAgentComplete&&e$1.onAgentComplete("solo",a,o),a}async runFacetedMode(s,e$1){let t=e(this.rootDir);if(!t)return {success:false,results:[],totalTokens:{input:0,output:0,total:0},totalCost:0};let n="";if(be(s)){let d=a$1(s);if(d.length>0){let u=[];u.push(`## Auto-Ripple Analysis
|
|
2
|
+
import {a as a$3}from'./chunk-TYWB5IQJ.js';import {b,a as a$1}from'./chunk-WESTEMIM.js';import {a}from'./chunk-FYDRENK7.js';import {e}from'./chunk-AO7ZSRME.js';import {a as a$2,b as b$2}from'./chunk-SHD27BQX.js';import {b as b$1}from'./chunk-EKZDFEJW.js';import {o,t,x}from'./chunk-T6IDXUUA.js';import'minimatch';import*as w from'fs';import*as C from'path';import*as F from'js-yaml';import {spawn}from'child_process';var ee=["should","what","how","why","recommend","analyze","compare","evaluate","assess","review","explain","describe","investigate","which","best practice","trade-off","tradeoff","pros and cons","decision"],te=["document","write docs","readme",".purpose","purpose file","jsdoc","tsdoc","comments","docstring","api docs","changelog","architecture doc"],se=["bug","fix","broken","not working","issue","error","crash","fails","failing","wrong","incorrect","doesn't work","doesn't","cant","can't","regression","patch"],re=["rename","refactor","migrate","restructure","move","reorganize","clean up","cleanup","consolidate","extract","inline","simplify","modularize","decouple","split","merge"],ne=["auth","authentication","authorization","permission","admin","delete","purge","password","credential","token","secret","key","encrypt","decrypt","hash","session","oauth","jwt","api key","role","access","gate","portal","sensitive","private","security","vulnerability","xss","sql injection","csrf"],oe=/[@#$%^!?&~][a-zA-Z0-9_-]+/g,Y={analysis:{agents:["architect"],models:{architect:"opus"},costMultiplier:{min:.3,max:.5}},documentation:{agents:["architect"],models:{architect:"sonnet"},costMultiplier:{min:.25,max:.45}},bugfix:{agents:["security","builder"],models:{security:"opus",builder:"haiku"},costMultiplier:{min:.5,max:.8}},refactor:{agents:["architect","builder"],models:{architect:"opus",builder:"haiku"},costMultiplier:{min:.6,max:.85}},feature:{agents:["architect","security","builder","tester"],models:{architect:"opus",security:"opus",builder:"haiku",tester:"haiku"},costMultiplier:{min:.8,max:1.2}}};function ie(f){let s=f.match(oe)||[];return [...new Set(s)]}function $(f,s){let e=f.toLowerCase();return s.filter(t=>e.includes(t.toLowerCase()))}function ae(f,s,e,t){let n=0;e.length>=5?n+=2:e.length>=2&&(n+=1);let o=f.split(/\s+/).length;o>=100?n+=2:o>=50&&(n+=1);let r=new Set(e.map(a=>a[0]));return r.size>=4?n+=2:r.size>=2&&(n+=1),e.some(a=>a.startsWith("^"))&&(n+=1),e.some(a=>a.startsWith("$"))&&(n+=1),s==="feature"&&(n+=1),s==="refactor"&&(n+=1),n>=5?"high":n>=2?"medium":"low"}function le(f,s,e){if($(f,ne).length>0||s.some(n=>n.startsWith("^")))return true;return false}function K(f,s){let e=ie(f),t=$(f,ee),n=$(f,te),o=$(f,se),r=$(f,re),a,i;t.length>0&&o.length===0&&r.length===0?(a="analysis",i=t):n.length>0&&o.length===0?(a="documentation",i=n):o.length>0?(a="bugfix",i=o):r.length>0?(a="refactor",i=r):(a="feature",i=[]);let l=Y[a],g=le(f,e),c=[...l.agents];g&&!c.includes("security")&&(c=["security",...c]);let p=ae(f,a,e),h={...l.costMultiplier};return p==="high"?(h.min*=1.2,h.max*=1.3):p==="low"&&(h.min*=.8,h.max*=.9),g&&!l.agents.includes("security")&&(h.min+=.15,h.max+=.2),{type:a,complexity:p,recommendedAgents:c,securityRequired:g,costMultiplier:h,matchedKeywords:i,symbols:e}}function B(f,s){let e=Y[s.type];return f==="security"&&s.securityRequired?"opus":e.models[f]||"sonnet"}var ce=/[@#$%^!?&~][a-zA-Z][a-zA-Z0-9_-]*/g,ue=[/\.(get|post|put|patch|delete)\s*\(\s*['"`]([^'"`]+)['"`]/gi,/export\s+(async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE)/gi,/export\s+(async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE)/gi,/\.(get|post|put|patch|delete)\s*\(\s*['"`]([^'"`]+)['"`]/gi],de=["endpoint","route","api","handler","get","post","put","patch","delete","rest","crud","controller"];function V(f,s,e$1){let t$1=f.toLowerCase(),n=f.match(ce)||[],o=[...new Set(n)],r=o.map(d=>{let u=t(e$1,d),y=u.length>0?u[0]:null;return {symbol:d,exists:!!y,type:y?.type,description:y?.description}}),a=r.filter(d=>d.exists).map(d=>{let u=x(e$1,d.symbol),y=new Set;for(let b of u){let S=x(e$1,b.symbol);for(let O of S)O.symbol!==d.symbol&&!u.find(v=>v.symbol===O.symbol)&&y.add(O.symbol);}let k=u.length+y.size,m="low";return k>10?m="high":k>3&&(m="medium"),{symbol:d.symbol,directDependents:u.length,indirectDependents:y.size,impact:m}}),i=a$2(s),l={exists:!!i,gateCount:i?b$2(i).length:0,gates:i?b$2(i).map(d=>`^${d}`):[],routeCount:i?.routes?Object.keys(i.routes).length:0},g=de.some(d=>t$1.includes(d)),c=e(s),p=c?a$3(f,c.agents).map(d=>({name:d.name,confidence:d.confidence,reason:d.reason})):[],h=[];return r.some(d=>d.exists)&&h.push("ripple-analysis"),g&&h.push("portal-compliance"),o.some(d=>d.startsWith("^"))&&h.push("gate-validation"),o.some(d=>d.startsWith("!"))&&h.push("signal-registration"),h.push("purpose-coverage"),{affectedSymbols:r,rippleAnalysis:a,portalStatus:l,taskAddsRoutes:g,suggestedAgents:p,requiredChecks:h}}function H(f,s,e,t$1){let n=[],o=a$2(e),r=o?b$2(o):[],a=o?.routes?Object.keys(o.routes):[];for(let p of f){let h=C.isAbsolute(p)?p:C.join(e,p);if(!w.existsSync(h))continue;let d;try{d=w.readFileSync(h,"utf-8");}catch{continue}for(let u of ue){u.lastIndex=0;let y;for(;(y=u.exec(d))!==null;){let k=y[2]||y[0];k&&k.startsWith("/")&&(!a.some(b=>b.replace(/\s+(GET|POST|PUT|PATCH|DELETE)\s*$/,"").trim()===k)&&o?n.push({type:"missing-portal-gate",severity:"warning",message:`Route "${k}" found in ${C.relative(e,h)} but not declared in portal.yaml`,file:C.relative(e,h),suggestion:"Add this route to portal.yaml with appropriate ^gates. Run paradigm_gates_for_route to get suggestions."}):!o&&k.startsWith("/api/")&&n.push({type:"missing-portal-gate",severity:"warning",message:`API route "${k}" found but no portal.yaml exists`,file:C.relative(e,h),suggestion:"Create portal.yaml to declare gates for API routes. Run: paradigm portal init"}));}}}for(let p of s)t(t$1,p).length===0&&n.push({type:"unregistered-symbol",severity:"error",message:`Symbol "${p}" was touched but is not registered in any .purpose file`,suggestion:`Add "${p}" to the nearest .purpose file. Use paradigm_purpose_add_component or paradigm_purpose_add_signal.`});for(let p of s)if(p.startsWith("^")){let h=p.slice(1);r.includes(h)||n.push({type:"missing-portal-gate",severity:"error",message:`Gate "${p}" is referenced but not declared in portal.yaml`,suggestion:`Add ${p} to portal.yaml with description and check expression.`});}f.length>=5&&s.length>=3&&n.push({type:"uncaptured-wisdom",severity:"warning",message:`Large change (${f.length} files, ${s.length} symbols) \u2014 consider recording architectural decisions`,suggestion:"Use paradigm_wisdom_record to capture any decisions or antipatterns discovered during this task."});let i=n.filter(p=>p.severity==="error").length,l=n.filter(p=>p.severity==="warning").length,g=4,c="pass";return i>0?c="violations":l>0&&(c="warnings"),{status:c,violations:n,summary:{totalChecks:g,passed:g-(i>0?1:0)-(l>0?1:0),warnings:l,errors:i},blocksCompletion:i>0}}var pe={architect:"opus",security:"opus",reviewer:"sonnet",builder:"haiku",tester:"haiku"},he=["auth","permission","admin","delete","purge","password","credential","token","secret","key","encrypt","decrypt","hash","session","oauth","jwt","role","access control","vulnerability","injection","xss","csrf"];function me(f,s){let e=f.toLowerCase(),t=he.some(r=>e.includes(r.toLowerCase())),n=f.includes("^"),o=false;return t||n||o}var ye=["rename","refactor","migrate","restructure","move","reorganize"];function be(f){let s=f.toLowerCase();return ye.some(e=>s.includes(e))}var E=class{spawner;auditLogger;rootDir;constructor(s){this.rootDir=s,this.spawner=new b(s),this.auditLogger=new a(s);}async initialize(){await this.spawner.initialize();}async orchestrate(s,e={}){let t=e.mode||"faceted",n=Date.now(),o$1=this.generateOrchestrationId(),r={success:false,mode:t,orchestrationId:o$1,task:s,agentsSpawned:0,totalTokens:{input:0,output:0,total:0},totalCost:0,duration_ms:0,agentResults:[]};try{let a;if(e.pmGovernance?.enabled)try{let{aggregateFromDirectory:l}=await import('./dist-3ZCH25SG.js'),g=await l(this.rootDir),c=o(g);a=V(s,this.rootDir,c);}catch{}if(t==="solo"){let l=await this.runSoloMode(s,e);r.agentsSpawned=1,r.agentResults=[l],r.success=l.success,l.relay&&(r.totalTokens=l.relay.metrics.tokens_used,r.totalCost=b$1(r.totalTokens,e.orchestratorModel||"opus"));}else {let l=await this.runFacetedMode(s,e);r.agentsSpawned=l.results.length,r.agentResults=l.results,r.totalTokens=l.totalTokens,r.totalCost=l.totalCost,r.success=l.success,r.parallelBuilderStats=l.parallelBuilderStats;}if(e.pmGovernance?.enabled&&a)try{let{aggregateFromDirectory:l}=await import('./dist-3ZCH25SG.js'),g=await l(this.rootDir),c=o(g),p=[],h=[];for(let u of r.agentResults)u.relay?.outputs?.artifacts&&p.push(...u.relay.outputs.artifacts.map(y=>y.path));for(let u of a.affectedSymbols)h.push(u.symbol);let d=H(p,h,this.rootDir,c);r.complianceReport={preflight:a,postflight:d},e.pmGovernance.blockOnViolations&&d.blocksCompletion&&(r.success=!1);}catch{r.complianceReport={preflight:a};}r.duration_ms=Date.now()-n;let i=this.auditLogger.startOrchestration(o$1,s,t);return i.completed=new Date().toISOString(),i.status=r.success?"success":"failed",i.totals={duration_ms:r.duration_ms,tokens:r.totalTokens.total,cost_usd:r.totalCost,agents_spawned:r.agentsSpawned,files_created:0,files_modified:0},this.auditLogger.saveOrchestration(i),r.log=i,r}catch(a){return r.error=a instanceof Error?a.message:String(a),r.duration_ms=Date.now()-n,r}}async compare(s,e={}){let t=await this.orchestrate(s,{...e,mode:"solo"}),n=await this.orchestrate(s,{...e,mode:"faceted"}),o=t.totalTokens.total-n.totalTokens.total,r=t.totalCost-n.totalCost,a=t.duration_ms-n.duration_ms,i="tie";return n.success&&!t.success?i="faceted":t.success&&!n.success?i="solo":n.totalCost<t.totalCost*.8?i="faceted":t.totalCost<n.totalCost*.8&&(i="solo"),{solo:t,faceted:n,comparison:{winner:i,tokensSaved:o,costDiff:r,timeDiff:a,soloSucceeded:t.success,facetedSucceeded:n.success}}}async runSoloMode(s,e$1){let n=e(this.rootDir)?.team.default_agent||"architect",o=e$1.orchestratorModel||"opus",r={model:o,workingDirectory:e$1.workingDirectory||this.rootDir,mcpServerPath:e$1.mcpServerPath,budget:e$1.budget,onMessage:e$1.onMessage?i=>e$1.onMessage("solo",i):void 0,onCheckpoint:e$1.onCheckpoint};e$1.onAgentStart&&e$1.onAgentStart("solo",s,o);let a=await this.spawner.spawn(n,s,r);return e$1.onAgentComplete&&e$1.onAgentComplete("solo",a,o),a}async runFacetedMode(s,e$1){let t=e(this.rootDir);if(!t)return {success:false,results:[],totalTokens:{input:0,output:0,total:0},totalCost:0};let n="";if(be(s)){let d=a$1(s);if(d.length>0){let u=[];u.push(`## Auto-Ripple Analysis
|
|
3
3
|
`),u.push("The following symbols are affected by this refactoring:"),u.push("");for(let y of d.slice(0,5))u.push(`- **${y}**: Check dependencies before renaming/moving`);u.push(""),u.push("**Recommendation:** Run `paradigm_ripple` for each symbol before making changes."),n=u.join(`
|
|
4
4
|
`);}}let o=this.planAgentSequence(s,t.agents),r=this.groupByStage(o),a=[],i={input:0,output:0,total:0},l=0,g=new Map,c=true,p,h=Array.from(r.keys()).sort((d,u)=>d-u);for(let d of h){let u=r.get(d)||[];if(u.length===0)continue;if(e$1.checkpoints?.beforeAgentSpawn&&e$1.onCheckpoint){let m=u.map(S=>S.agent).join(", ");if(!await e$1.onCheckpoint(`Stage ${d}: Spawn ${m}${u.length>1?" (parallel)":""}`)){c=false;break}}let y=u.map(async m=>{let b=e$1.agentBudgets?.[m.agent]?.maxTokens?"haiku":m.model||pe[m.agent]||"sonnet",S="";if(m.dependsOn.length>0){let R=m.dependsOn.map(I=>g.get(I)).filter(Boolean);R.length>0&&(S=R.join(`
|
|
5
5
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import*as m from'fs';import*as h from'path';import*as R from'js-yaml';import {execFileSync}from'child_process';var G=["node_modules",".git","dist","build","coverage",".paradigm","vendor","__pycache__",".next","target"];function S(e){let t=h.join(e,"portal.yaml");if(!m.existsSync(t))return null;try{let n=m.readFileSync(t,"utf-8");return R.load(n)}catch{return null}}function C(e){let t=new Set;if(e.gates)for(let n of Object.keys(e.gates)){let s=n.startsWith("^")?n.slice(1):n;t.add(s);}if(e.routes)for(let n of Object.values(e.routes)){let s=Array.isArray(n)?n:n.gates||[];for(let o of s){let a=o.startsWith("^")?o.slice(1):o;t.add(a);}}return Array.from(t)}function B(e){let t=new Set;if(e.routes)for(let n of Object.values(e.routes)){let s=Array.isArray(n)?n:n.gates||[];for(let o of s){let a=o.startsWith("^")?o.slice(1):o;t.add(a);}}return t}function E(e,t){let n={encoding:"utf-8",maxBuffer:10485760,stdio:["ignore","pipe","pipe"]};try{let i=["-n","--no-ignore-vcs",...G.flatMap(u=>["--glob",`!${u}/**`]),"--engine","auto",t,e];return execFileSync("rg",i,n)}catch{}let o=["-rn",...G.map(a=>`--exclude-dir=${a}`),"-E",t,"--",e];try{return execFileSync("grep",o,n)}catch(a){return a?.code===1||a?.status===1,""}}var P=["**/.purpose","**/portal.yaml","**/.paradigm/**/*.yaml","**/.paradigm/**/*.yml"];function x(e){let t=[];for(let o of P){h.join(e,o);let i;try{i=execFileSync("find",[e,"-path","*/node_modules","-prune","-o","-path","*/.git","-prune","-o","(","-name",".purpose","-o","-name","portal.yaml",")","-print"],{encoding:"utf-8",maxBuffer:5242880}).split(`
|
|
3
|
+
`).filter(Boolean);}catch{i=[];}for(let u of i)try{let p=m.readFileSync(u,"utf-8").split(`
|
|
4
|
+
`);for(let l=0;l<p.length;l++){let d=p[l],g=d.matchAll(/\^([a-z][a-z0-9-]+)/g);for(let c of g)t.push({gate:c[1],file:h.relative(e,u),line:l+1,context:d.trim().slice(0,100),matchType:"symbol"});}}catch{}}let s=[{pattern:`checkGate\\s*\\(['"]([^'"]+)['"]`,type:"function"},{pattern:`requireGate\\s*\\(['"]([^'"]+)['"]`,type:"function"},{pattern:`@Gate\\s*\\(['"]?([^'"\\)]+)['"]?\\)`,type:"function"}];for(let{pattern:o,type:a}of s){let i=E(e,o);for(let u of i.split(`
|
|
5
|
+
`).filter(Boolean)){let f=u.match(/^(.+?):(\d+):(.*)$/);if(f){let[,p,l,d]=f,g=d.match(new RegExp(o));if(g&&g[1]){let c=g[1].startsWith("^")?g[1].slice(1):g[1];t.push({gate:c,file:h.relative(e,p),line:parseInt(l,10),context:d.trim().slice(0,100),matchType:a});}}}}return t}function $(e){return [...new Set(e.map(t=>t.gate))]}async function w(e){let t=S(e);if(!t){let r=x(e),U=$(r);return U.length===0?{status:"compliant",declaredButUnused:[],routeAttachedUnused:[],orphanUnused:[],usedButUndeclared:[],properlyDeclared:[],suggestions:["No portal.yaml found, and no gate references detected in code."],references:[]}:{status:"violations",declaredButUnused:[],routeAttachedUnused:[],orphanUnused:[],usedButUndeclared:U,properlyDeclared:[],suggestions:["Gate references found in code but no portal.yaml exists.","Create a portal.yaml file to declare these gates:",...U.map(b=>` - ^${b}`),"","Run: paradigm portal init"],references:r}}let n=C(t),s=B(t),o=x(e),a=$(o),i=new Set(n),u=new Set(a),f=n.filter(r=>!u.has(r)),p=f.filter(r=>s.has(r)),l=f.filter(r=>!s.has(r)),d=a.filter(r=>!i.has(r)),g=n.filter(r=>u.has(r)),c=[];if(p.length>0){c.push("Gates documented on routes but no checkGate/requireGate in code:");for(let r of p)c.push(` - ^${r} (documented on routes; if enforced by middleware, this may be intentional)`);c.push("");}if(l.length>0){c.push("Orphan gates (declared but never on a route or in code):");for(let r of l)c.push(` - ^${r} (add to a route or remove from portal.yaml)`);c.push("");}if(d.length>0){c.push("Gates used in code but not declared in portal.yaml:");for(let r of d)c.push(` - ^${r} (add to portal.yaml with proper definition)`);c.push("");}let y="compliant";return d.length>0?y="violations":f.length>0&&(y="warnings"),{status:y,declaredButUnused:f,routeAttachedUnused:p,orphanUnused:l,usedButUndeclared:d,properlyDeclared:g,suggestions:c,references:o}}function _(e){let t=[],n=e.status==="compliant"?"\u2713":e.status==="warnings"?"\u26A0":"\u2717";if(t.push(`Portal Compliance: ${n} ${e.status.toUpperCase()}`),t.push(""),t.push(`Properly Declared: ${e.properlyDeclared.length}`),e.routeAttachedUnused.length>0&&t.push(`Route-Attached, No Code: ${e.routeAttachedUnused.length}`),e.orphanUnused.length>0&&t.push(`Orphan Gates: ${e.orphanUnused.length}`),e.usedButUndeclared.length>0&&t.push(`Used but Undeclared: ${e.usedButUndeclared.length}`),t.push(""),e.properlyDeclared.length>0){t.push("Gates in Use:");for(let s of e.properlyDeclared)t.push(` \u2713 ^${s}`);t.push("");}if(e.routeAttachedUnused.length>0){t.push("Route-Attached (no checkGate/requireGate in code):");for(let s of e.routeAttachedUnused)t.push(` \u26A0 ^${s}`);t.push("");}if(e.orphanUnused.length>0){t.push("Orphan Gates (declared but never on route or in code):");for(let s of e.orphanUnused)t.push(` \u26A0 ^${s}`);t.push("");}if(e.usedButUndeclared.length>0){t.push("Undeclared Gates (used but not in portal.yaml):");for(let s of e.usedButUndeclared){t.push(` \u2717 ^${s}`);let o=e.references.filter(a=>a.gate===s).slice(0,3);for(let a of o)t.push(` at ${a.file}:${a.line}`);}t.push("");}if(e.suggestions.length>0&&e.status!=="compliant"){t.push("Suggestions:");for(let s of e.suggestions)s&&t.push(` ${s}`);}return t.join(`
|
|
6
|
+
`)}function k(e){if(e.status==="compliant")return {status:"ok",message:`${e.properlyDeclared.length} gates properly declared`};if(e.status==="warnings"){let t=[];return e.routeAttachedUnused.length>0&&t.push(`${e.routeAttachedUnused.length} route-attached`),e.orphanUnused.length>0&&t.push(`${e.orphanUnused.length} orphan`),{status:"warn",message:t.length>0?t.join(", ")+" gate(s)":`${e.declaredButUnused.length} unused gates`}}return {status:"error",message:`${e.usedButUndeclared.length} gates used but not declared`}}export{S as a,C as b,x as c,w as d,_ as e,k as f};
|
|
@@ -3,7 +3,7 @@ import {c as c$1,a as a$1}from'./chunk-HMQ5BHP2.js';import {e as e$1}from'./chun
|
|
|
3
3
|
\u{1FA7A} Paradigm Doctor
|
|
4
4
|
`)),console.log(q?c.gray(`Running context audit checks...
|
|
5
5
|
`):c.gray(`Checking Paradigm setup...
|
|
6
|
-
`)));let L=a.command("doctor").start("Running health checks");if(!q){let M=function(t){let a=[];try{let n=e.readdirSync(t,{withFileTypes:!0});for(let o of n){if(o.name==="node_modules"||o.name==="dist"||o.name===".git")continue;let m=i.join(t,o.name);o.isDirectory()?a.push(...M(m)):o.name===".purpose"&&a.push(m);}}catch{}return a};let r=i.join(l,".paradigm");if(e.existsSync(r))if(e.statSync(r).isFile())s.push({name:".paradigm",status:"warn",message:"Legacy file format (should be directory)",fix:"paradigm upgrade --all"});else {s.push({name:".paradigm/",status:"ok",message:"Directory exists"});let a=i.join(r,"config.yaml");if(e.existsSync(a))try{let d=e.readFileSync(a,"utf8");e$1(d),s.push({name:".paradigm/config.yaml",status:"ok",message:"Valid YAML"});}catch(d){s.push({name:".paradigm/config.yaml",status:"error",message:`Invalid YAML: ${d.message}`,fix:"Check YAML syntax"});}else s.push({name:".paradigm/config.yaml",status:"missing",message:"Config file not found",fix:"paradigm init --force"});let n=["logger.md","scan.md","symbols.md"],o=i.join(r,"specs");if(e.existsSync(o))for(let d of n){let w=i.join(o,d);e.existsSync(w)?s.push({name:`.paradigm/specs/${d}`,status:"ok",message:"Present"}):s.push({name:`.paradigm/specs/${d}`,status:"missing",message:"Spec file not found",fix:"paradigm upgrade --all"});}else s.push({name:".paradigm/specs/",status:"missing",message:"Specs directory not found",fix:"paradigm upgrade --all"});let m=i.join(r,"docs");e.existsSync(m)?s.push({name:".paradigm/docs/",status:"ok",message:"Directory exists"}):s.push({name:".paradigm/docs/",status:"missing",message:"Docs directory not found",fix:"paradigm upgrade --all"});let h=i.join(r,"prompts");e.existsSync(h)?s.push({name:".paradigm/prompts/",status:"ok",message:"Directory exists"}):s.push({name:".paradigm/prompts/",status:"missing",message:"Prompts directory not found",fix:"paradigm upgrade --all"});let u=i.join(r,"scan-index.json"),g=i.join(l,".paradigm-scan-index.json");if(e.existsSync(u)){let d=e.statSync(u),w=Date.now()-d.mtime.getTime(),y=Math.floor(w/(1e3*60*60));y>24?s.push({name:".paradigm/scan-index.json",status:"warn",message:`Stale (${y} hours old)`,fix:"paradigm index"}):s.push({name:".paradigm/scan-index.json",status:"ok",message:y>0?`${y} hours old`:"Fresh"});}else e.existsSync(g)?s.push({name:"scan-index",status:"warn",message:"Using legacy location",fix:"paradigm index"}):s.push({name:".paradigm/scan-index.json",status:"missing",message:"Not generated",fix:"paradigm index"});}else s.push({name:".paradigm/",status:"missing",message:"Not initialized",fix:"paradigm init"});let f=c$1(l);if(f.detected){let t=a$1(f.detected);if(t){let a=i.join(l,t.outputPath);e.existsSync(a)?s.push({name:t.outputPath,status:"ok",message:`Present (${f.detected})`}):s.push({name:t.outputPath,status:"missing",message:`Not generated for ${f.detected}`,fix:"paradigm sync"});}}let p=i.join(l,".premise");e.existsSync(p)?s.push({name:".premise",status:"ok",message:"Present"}):s.push({name:".premise",status:"missing",message:"Not found (optional)"});let j=i.join(l,".purpose");e.existsSync(j)?s.push({name:".purpose",status:"ok",message:"Present"}):s.push({name:".purpose",status:"warn",message:"Root .purpose not found",fix:"paradigm init"});let P=i.join(l,".paradigm","config.yaml");if(e.existsSync(P))try{let t=e.readFileSync(P,"utf8"),n=x.load(t)?.["purpose-required"];if(n&&Array.isArray(n)){let o=[];for(let m of n){if(!m.pattern)continue;let{glob:h}=await import('glob'),u=await h(m.pattern,{cwd:l,nodir:!1});for(let g of u){let d=i.join(l,g);try{e.statSync(d).isDirectory()&&!e.existsSync(i.join(d,".purpose"))&&o.push(g);}catch{}}}o.length>0?s.push({name:"Purpose-required",status:"warn",message:`${o.length} director${o.length===1?"y":"ies"} missing .purpose: ${o.join(", ")}`,fix:"Create .purpose files with paradigm_purpose_init + paradigm_purpose_add_component"}):s.push({name:"Purpose-required",status:"ok",message:"All required directories have .purpose files"});}}catch{}let F=/\[NEEDS CLARIFICATION:\s*[^\]]+\]/gi,v=0,T=M(l);for(let t of T)try{let n=e.readFileSync(t,"utf8").match(F);n&&(v+=n.length);}catch{}v>0?s.push({name:"Clarification markers",status:"warn",message:`${v} [NEEDS CLARIFICATION] marker${v>1?"s":""} found in .purpose files`,fix:"Resolve open clarification markers before shipping"}):T.length>0&&s.push({name:"Clarification markers",status:"ok",message:"No unresolved markers"});let E=i.join(l,"portal.yaml");if(e.existsSync(E))try{let t=e.readFileSync(E,"utf8"),a=x.load(t);if(a?.version&&a?.gates){let n=Object.keys(a.gates||{}).length,o=Object.keys(a.routes||{}).length;s.push({name:"portal.yaml",status:"ok",message:`Valid (${n} gates, ${o} routes)`});}else s.push({name:"portal.yaml",status:"warn",message:"Missing version or gates section",fix:'Add version: "1.0" and gates: {} to portal.yaml'});}catch(t){s.push({name:"portal.yaml",status:"error",message:`Invalid YAML: ${t.message}`,fix:"Check YAML syntax in portal.yaml"});}if(e.existsSync(E))try{let{checkPortalCompliance:t,getComplianceSummary:a}=await import('./portal-compliance-2UG4VKWH.js'),n=await t(l),o=a(n);s.push({name:"Portal compliance",status:o.status,message:o.message,fix:o.status!=="ok"?"paradigm portal check":void 0});}catch{}let W=i.join(l,".paradigm","flows.yaml");if(e.existsSync(W))try{let t=e.readFileSync(W,"utf8"),a=x.load(t);if(a?.version&&a?.flows){let n=Object.keys(a.flows||{}).length,o=Object.entries(a.flows||{}).filter(([,m])=>!m?.steps||(m.steps?.length??0)===0);o.length>0?s.push({name:".paradigm/flows.yaml",status:"warn",message:`${n} flows defined, ${o.length} have no steps`,fix:"Add steps to empty flow definitions"}):s.push({name:".paradigm/flows.yaml",status:"ok",message:`Valid (${n} flows)`});}else s.push({name:".paradigm/flows.yaml",status:"warn",message:"Missing version or flows section",fix:'Ensure flows.yaml has version: "1.0" and flows: {}'});}catch(t){s.push({name:".paradigm/flows.yaml",status:"error",message:`Invalid YAML: ${t.message}`,fix:"Check YAML syntax in flows.yaml"});}let Y=i.join(l,".paradigm","lore");if(e.existsSync(Y))try{let t=e.readdirSync(Y).filter(a=>a.endsWith(".yaml"));t.length===0?s.push({name:"Lore entries",status:"warn",message:"Lore directory exists but no entries found",fix:"Record a lore entry: paradigm lore record"}):s.push({name:"Lore entries",status:"ok",message:`${t.length} lore file${t.length>1?"s":""}`});}catch{s.push({name:"Lore entries",status:"warn",message:"Could not read lore directory"});}let U=i.join(l,".paradigm","university");if(e.existsSync(U))try{let t=i.join(U,"content"),a=0,n=0;if(e.existsSync(t))for(let o of ["notes","policies","quizzes","paths"]){let m=i.join(t,o);e.existsSync(m)&&(a+=e.readdirSync(m).filter(h=>h.endsWith(".md")||h.endsWith(".yaml")).length);}if(a===0)s.push({name:"University content",status:"warn",message:"University directory exists but no content found",fix:'Add content: paradigm university add note --title "Getting Started"'});else {let o=i.join(t,"quizzes");if(e.existsSync(o))for(let h of e.readdirSync(o).filter(u=>u.endsWith(".yaml")))try{let u=x.load(e.readFileSync(i.join(o,h),"utf8"));if(u?.questions)for(let g of u.questions)g.choices&&g.correct&&!(g.correct in g.choices)&&n++;}catch{}let m=i.join(t,"paths");if(e.existsSync(m))for(let h of e.readdirSync(m).filter(u=>u.endsWith(".yaml")))try{let u=x.load(e.readFileSync(i.join(m,h),"utf8"));if(u?.steps){for(let g of u.steps)if(g.content&&!g.content.startsWith("plsat:")){let d=!1;for(let w of ["notes","policies","quizzes","paths"]){let y=i.join(t,w);if(e.existsSync(y)&&e.readdirSync(y).some(Z=>Z.startsWith(g.content))){d=!0;break}}d||n++;}}}catch{}n>0?s.push({name:"University content",status:"warn",message:`${a} items, ${n} issue${n>1?"s":""}`,fix:"Run: paradigm university validate --deep"}):s.push({name:"University content",status:"ok",message:`${a} content item${a>1?"s":""}`});}}catch{s.push({name:"University content",status:"warn",message:"Could not read university directory"});}let H=i.join(l,".claude","hooks.json"),X=i.join(l,"plugins","paradigm","hooks.json");if(e.existsSync(H)){let t=e.statSync(H),a=Date.now()-t.mtime.getTime(),n=Math.floor(a/(1e3*60*60*24));n>30?s.push({name:"Claude Code hooks",status:"warn",message:`Hooks are ${n} days old \u2014 may be outdated`,fix:"paradigm hooks install"}):s.push({name:"Claude Code hooks",status:"ok",message:n>0?`${n} days old`:"Fresh"});}else e.existsSync(X)?s.push({name:"Claude Code hooks",status:"ok",message:"Using plugin hooks"}):s.push({name:"Claude Code hooks",status:"missing",message:"No hooks installed",fix:"paradigm hooks install"});let _=i.join(l,".paradigm","habits.yaml");if(e.existsSync(_))try{let t=e.readFileSync(_,"utf8"),a=x.load(t);if(a?.version&&Array.isArray(a?.habits)){let n=a.habits.filter(o=>o.enabled!==!1).length;s.push({name:"Habits config",status:"ok",message:`Valid (${n}/${a.habits.length} enabled)`});}else s.push({name:"Habits config",status:"warn",message:"Missing version or habits array",fix:"Regenerate habits.yaml with paradigm habits init"});}catch(t){s.push({name:"Habits config",status:"error",message:`Invalid YAML: ${t.message}`,fix:"Check YAML syntax in habits.yaml"});}let G=i.join(l,"AGENTS.md");if(e.existsSync(G)){let t=e.statSync(G),a=Date.now()-t.mtime.getTime(),n=Math.floor(a/(1e3*60*60*24));n>60?s.push({name:"AGENTS.md",status:"warn",message:`${n} days since last update \u2014 may be stale`,fix:"paradigm sync"}):s.push({name:"AGENTS.md",status:"ok",message:n>0?`Updated ${n} days ago`:"Fresh"});}}let I=0,N=0,S=0;for(let r of s){let f,p;switch(r.status){case "ok":f="\u2713",p=c.green;break;case "warn":f="\u26A0",p=c.yellow,N++;break;case "error":f="\u2717",p=c.red,I++;break;case "missing":f="\u25CB",p=c.gray,S++;break}if(!k){let j=r.name.padEnd(30);console.log(` ${p(f)} ${j} ${p(r.message)}`),r.fix&&console.log(c.gray(` \u2514\u2500 Fix: ${r.fix}`));}}let{runContextAudit:Q}=await import('./context-audit-RSSRX6XC.js'),D=await Q(l,{quiet:k}),z=0,O=0,$=0;!k&&D.length>0&&(console.log(""),console.log(c.blue(" Context Audit")),console.log(c.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")));for(let r of D){let f,p;switch(r.status){case "ok":f="\u2713",p=c.green;break;case "warn":f="\u26A0",p=c.yellow,O++;break;case "error":f="\u2717",p=c.red,z++;break;case "advisory":f="\u2139",p=c.cyan,$++;break}if(!k){let j=r.check.padEnd(30);if(console.log(` ${p(f)} ${j} ${p(r.message)}`),r.details&&r.details.length>0){let P=r.details.slice(0,5);for(let F of P)console.log(c.gray(` \u2502 ${F}`));r.details.length>5&&console.log(c.gray(` \u2502 ... and ${r.details.length-5} more`));}r.fix&&console.log(c.gray(` \u2514\u2500 Fix: ${r.fix}`));}}let C=I+z,b=N+O,R=C+b+S===0;if(!k)if(console.log(""),R)console.log(c.green(`\u2728 All checks passed!
|
|
6
|
+
`)));let L=a.command("doctor").start("Running health checks");if(!q){let M=function(t){let a=[];try{let n=e.readdirSync(t,{withFileTypes:!0});for(let o of n){if(o.name==="node_modules"||o.name==="dist"||o.name===".git")continue;let m=i.join(t,o.name);o.isDirectory()?a.push(...M(m)):o.name===".purpose"&&a.push(m);}}catch{}return a};let r=i.join(l,".paradigm");if(e.existsSync(r))if(e.statSync(r).isFile())s.push({name:".paradigm",status:"warn",message:"Legacy file format (should be directory)",fix:"paradigm upgrade --all"});else {s.push({name:".paradigm/",status:"ok",message:"Directory exists"});let a=i.join(r,"config.yaml");if(e.existsSync(a))try{let d=e.readFileSync(a,"utf8");e$1(d),s.push({name:".paradigm/config.yaml",status:"ok",message:"Valid YAML"});}catch(d){s.push({name:".paradigm/config.yaml",status:"error",message:`Invalid YAML: ${d.message}`,fix:"Check YAML syntax"});}else s.push({name:".paradigm/config.yaml",status:"missing",message:"Config file not found",fix:"paradigm init --force"});let n=["logger.md","scan.md","symbols.md"],o=i.join(r,"specs");if(e.existsSync(o))for(let d of n){let w=i.join(o,d);e.existsSync(w)?s.push({name:`.paradigm/specs/${d}`,status:"ok",message:"Present"}):s.push({name:`.paradigm/specs/${d}`,status:"missing",message:"Spec file not found",fix:"paradigm upgrade --all"});}else s.push({name:".paradigm/specs/",status:"missing",message:"Specs directory not found",fix:"paradigm upgrade --all"});let m=i.join(r,"docs");e.existsSync(m)?s.push({name:".paradigm/docs/",status:"ok",message:"Directory exists"}):s.push({name:".paradigm/docs/",status:"missing",message:"Docs directory not found",fix:"paradigm upgrade --all"});let h=i.join(r,"prompts");e.existsSync(h)?s.push({name:".paradigm/prompts/",status:"ok",message:"Directory exists"}):s.push({name:".paradigm/prompts/",status:"missing",message:"Prompts directory not found",fix:"paradigm upgrade --all"});let u=i.join(r,"scan-index.json"),g=i.join(l,".paradigm-scan-index.json");if(e.existsSync(u)){let d=e.statSync(u),w=Date.now()-d.mtime.getTime(),y=Math.floor(w/(1e3*60*60));y>24?s.push({name:".paradigm/scan-index.json",status:"warn",message:`Stale (${y} hours old)`,fix:"paradigm index"}):s.push({name:".paradigm/scan-index.json",status:"ok",message:y>0?`${y} hours old`:"Fresh"});}else e.existsSync(g)?s.push({name:"scan-index",status:"warn",message:"Using legacy location",fix:"paradigm index"}):s.push({name:".paradigm/scan-index.json",status:"missing",message:"Not generated",fix:"paradigm index"});}else s.push({name:".paradigm/",status:"missing",message:"Not initialized",fix:"paradigm init"});let f=c$1(l);if(f.detected){let t=a$1(f.detected);if(t){let a=i.join(l,t.outputPath);e.existsSync(a)?s.push({name:t.outputPath,status:"ok",message:`Present (${f.detected})`}):s.push({name:t.outputPath,status:"missing",message:`Not generated for ${f.detected}`,fix:"paradigm sync"});}}let p=i.join(l,".premise");e.existsSync(p)?s.push({name:".premise",status:"ok",message:"Present"}):s.push({name:".premise",status:"missing",message:"Not found (optional)"});let j=i.join(l,".purpose");e.existsSync(j)?s.push({name:".purpose",status:"ok",message:"Present"}):s.push({name:".purpose",status:"warn",message:"Root .purpose not found",fix:"paradigm init"});let P=i.join(l,".paradigm","config.yaml");if(e.existsSync(P))try{let t=e.readFileSync(P,"utf8"),n=x.load(t)?.["purpose-required"];if(n&&Array.isArray(n)){let o=[];for(let m of n){if(!m.pattern)continue;let{glob:h}=await import('glob'),u=await h(m.pattern,{cwd:l,nodir:!1});for(let g of u){let d=i.join(l,g);try{e.statSync(d).isDirectory()&&!e.existsSync(i.join(d,".purpose"))&&o.push(g);}catch{}}}o.length>0?s.push({name:"Purpose-required",status:"warn",message:`${o.length} director${o.length===1?"y":"ies"} missing .purpose: ${o.join(", ")}`,fix:"Create .purpose files with paradigm_purpose_init + paradigm_purpose_add_component"}):s.push({name:"Purpose-required",status:"ok",message:"All required directories have .purpose files"});}}catch{}let F=/\[NEEDS CLARIFICATION:\s*[^\]]+\]/gi,v=0,T=M(l);for(let t of T)try{let n=e.readFileSync(t,"utf8").match(F);n&&(v+=n.length);}catch{}v>0?s.push({name:"Clarification markers",status:"warn",message:`${v} [NEEDS CLARIFICATION] marker${v>1?"s":""} found in .purpose files`,fix:"Resolve open clarification markers before shipping"}):T.length>0&&s.push({name:"Clarification markers",status:"ok",message:"No unresolved markers"});let E=i.join(l,"portal.yaml");if(e.existsSync(E))try{let t=e.readFileSync(E,"utf8"),a=x.load(t);if(a?.version&&a?.gates){let n=Object.keys(a.gates||{}).length,o=Object.keys(a.routes||{}).length;s.push({name:"portal.yaml",status:"ok",message:`Valid (${n} gates, ${o} routes)`});}else s.push({name:"portal.yaml",status:"warn",message:"Missing version or gates section",fix:'Add version: "1.0" and gates: {} to portal.yaml'});}catch(t){s.push({name:"portal.yaml",status:"error",message:`Invalid YAML: ${t.message}`,fix:"Check YAML syntax in portal.yaml"});}if(e.existsSync(E))try{let{checkPortalCompliance:t,getComplianceSummary:a}=await import('./portal-compliance-4MG5F2GI.js'),n=await t(l),o=a(n);s.push({name:"Portal compliance",status:o.status,message:o.message,fix:o.status!=="ok"?"paradigm portal check":void 0});}catch{}let W=i.join(l,".paradigm","flows.yaml");if(e.existsSync(W))try{let t=e.readFileSync(W,"utf8"),a=x.load(t);if(a?.version&&a?.flows){let n=Object.keys(a.flows||{}).length,o=Object.entries(a.flows||{}).filter(([,m])=>!m?.steps||(m.steps?.length??0)===0);o.length>0?s.push({name:".paradigm/flows.yaml",status:"warn",message:`${n} flows defined, ${o.length} have no steps`,fix:"Add steps to empty flow definitions"}):s.push({name:".paradigm/flows.yaml",status:"ok",message:`Valid (${n} flows)`});}else s.push({name:".paradigm/flows.yaml",status:"warn",message:"Missing version or flows section",fix:'Ensure flows.yaml has version: "1.0" and flows: {}'});}catch(t){s.push({name:".paradigm/flows.yaml",status:"error",message:`Invalid YAML: ${t.message}`,fix:"Check YAML syntax in flows.yaml"});}let Y=i.join(l,".paradigm","lore");if(e.existsSync(Y))try{let t=e.readdirSync(Y).filter(a=>a.endsWith(".yaml"));t.length===0?s.push({name:"Lore entries",status:"warn",message:"Lore directory exists but no entries found",fix:"Record a lore entry: paradigm lore record"}):s.push({name:"Lore entries",status:"ok",message:`${t.length} lore file${t.length>1?"s":""}`});}catch{s.push({name:"Lore entries",status:"warn",message:"Could not read lore directory"});}let U=i.join(l,".paradigm","university");if(e.existsSync(U))try{let t=i.join(U,"content"),a=0,n=0;if(e.existsSync(t))for(let o of ["notes","policies","quizzes","paths"]){let m=i.join(t,o);e.existsSync(m)&&(a+=e.readdirSync(m).filter(h=>h.endsWith(".md")||h.endsWith(".yaml")).length);}if(a===0)s.push({name:"University content",status:"warn",message:"University directory exists but no content found",fix:'Add content: paradigm university add note --title "Getting Started"'});else {let o=i.join(t,"quizzes");if(e.existsSync(o))for(let h of e.readdirSync(o).filter(u=>u.endsWith(".yaml")))try{let u=x.load(e.readFileSync(i.join(o,h),"utf8"));if(u?.questions)for(let g of u.questions)g.choices&&g.correct&&!(g.correct in g.choices)&&n++;}catch{}let m=i.join(t,"paths");if(e.existsSync(m))for(let h of e.readdirSync(m).filter(u=>u.endsWith(".yaml")))try{let u=x.load(e.readFileSync(i.join(m,h),"utf8"));if(u?.steps){for(let g of u.steps)if(g.content&&!g.content.startsWith("plsat:")){let d=!1;for(let w of ["notes","policies","quizzes","paths"]){let y=i.join(t,w);if(e.existsSync(y)&&e.readdirSync(y).some(Z=>Z.startsWith(g.content))){d=!0;break}}d||n++;}}}catch{}n>0?s.push({name:"University content",status:"warn",message:`${a} items, ${n} issue${n>1?"s":""}`,fix:"Run: paradigm university validate --deep"}):s.push({name:"University content",status:"ok",message:`${a} content item${a>1?"s":""}`});}}catch{s.push({name:"University content",status:"warn",message:"Could not read university directory"});}let H=i.join(l,".claude","hooks.json"),X=i.join(l,"plugins","paradigm","hooks.json");if(e.existsSync(H)){let t=e.statSync(H),a=Date.now()-t.mtime.getTime(),n=Math.floor(a/(1e3*60*60*24));n>30?s.push({name:"Claude Code hooks",status:"warn",message:`Hooks are ${n} days old \u2014 may be outdated`,fix:"paradigm hooks install"}):s.push({name:"Claude Code hooks",status:"ok",message:n>0?`${n} days old`:"Fresh"});}else e.existsSync(X)?s.push({name:"Claude Code hooks",status:"ok",message:"Using plugin hooks"}):s.push({name:"Claude Code hooks",status:"missing",message:"No hooks installed",fix:"paradigm hooks install"});let _=i.join(l,".paradigm","habits.yaml");if(e.existsSync(_))try{let t=e.readFileSync(_,"utf8"),a=x.load(t);if(a?.version&&Array.isArray(a?.habits)){let n=a.habits.filter(o=>o.enabled!==!1).length;s.push({name:"Habits config",status:"ok",message:`Valid (${n}/${a.habits.length} enabled)`});}else s.push({name:"Habits config",status:"warn",message:"Missing version or habits array",fix:"Regenerate habits.yaml with paradigm habits init"});}catch(t){s.push({name:"Habits config",status:"error",message:`Invalid YAML: ${t.message}`,fix:"Check YAML syntax in habits.yaml"});}let G=i.join(l,"AGENTS.md");if(e.existsSync(G)){let t=e.statSync(G),a=Date.now()-t.mtime.getTime(),n=Math.floor(a/(1e3*60*60*24));n>60?s.push({name:"AGENTS.md",status:"warn",message:`${n} days since last update \u2014 may be stale`,fix:"paradigm sync"}):s.push({name:"AGENTS.md",status:"ok",message:n>0?`Updated ${n} days ago`:"Fresh"});}}let I=0,N=0,S=0;for(let r of s){let f,p;switch(r.status){case "ok":f="\u2713",p=c.green;break;case "warn":f="\u26A0",p=c.yellow,N++;break;case "error":f="\u2717",p=c.red,I++;break;case "missing":f="\u25CB",p=c.gray,S++;break}if(!k){let j=r.name.padEnd(30);console.log(` ${p(f)} ${j} ${p(r.message)}`),r.fix&&console.log(c.gray(` \u2514\u2500 Fix: ${r.fix}`));}}let{runContextAudit:Q}=await import('./context-audit-RSSRX6XC.js'),D=await Q(l,{quiet:k}),z=0,O=0,$=0;!k&&D.length>0&&(console.log(""),console.log(c.blue(" Context Audit")),console.log(c.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")));for(let r of D){let f,p;switch(r.status){case "ok":f="\u2713",p=c.green;break;case "warn":f="\u26A0",p=c.yellow,O++;break;case "error":f="\u2717",p=c.red,z++;break;case "advisory":f="\u2139",p=c.cyan,$++;break}if(!k){let j=r.check.padEnd(30);if(console.log(` ${p(f)} ${j} ${p(r.message)}`),r.details&&r.details.length>0){let P=r.details.slice(0,5);for(let F of P)console.log(c.gray(` \u2502 ${F}`));r.details.length>5&&console.log(c.gray(` \u2502 ... and ${r.details.length-5} more`));}r.fix&&console.log(c.gray(` \u2514\u2500 Fix: ${r.fix}`));}}let C=I+z,b=N+O,R=C+b+S===0;if(!k)if(console.log(""),R)console.log(c.green(`\u2728 All checks passed!
|
|
7
7
|
`));else {let r=[];C>0&&r.push(c.red(`${C} error${C>1?"s":""}`)),b>0&&r.push(c.yellow(`${b} warning${b>1?"s":""}`)),S>0&&r.push(c.gray(`${S} missing`)),$>0&&r.push(c.cyan(`${$} advisor${$>1?"ies":"y"}`)),console.log(`${r.join(", ")} found.
|
|
8
8
|
`),console.log(c.gray(`Run the suggested commands to fix issues.
|
|
9
9
|
`));}return R?L.success("All health checks passed",{total:s.length+D.length}):L.error("Health checks found issues",{errors:C,warnings:b,missing:S,advisories:$}),R}export{rs as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {b}from'./chunk-
|
|
2
|
+
import {b}from'./chunk-DG236EXP.js';import {e,f,c,d,l,h,g,k,i,m as m$1,o,n,j,b as b$1,a as a$1}from'./chunk-AO7ZSRME.js';import {a}from'./chunk-Y4XFVDZC.js';import*as $ from'fs';import*as m from'path';import e$1 from'chalk';import E from'prompts';function F(){return process.env.CLAUDE_CODE==="1"||process.env.TERM_PROGRAM==="claude"?false:!!(process.env.TERM_PROGRAM==="cursor"||process.env.CURSOR_SESSION||process.env.CURSOR_TRACE_ID||process.env.VSCODE_CWD&&process.env.VSCODE_CWD.toLowerCase().includes("cursor")||process.env.VSCODE_NLS_CONFIG&&process.env.VSCODE_NLS_CONFIG.toLowerCase().includes("cursor")||process.env.TERM_PROGRAM==="vscode"&&process.env.VSCODE_GIT_ASKPASS_NODE?.toLowerCase().includes("cursor")||process.stdin.isTTY)}async function T(g){let n=new a(g),c=await n.discover();console.log(e$1.cyan(`
|
|
3
3
|
Configure Agent Models
|
|
4
4
|
`)),console.log(e$1.gray(` Environment: ${c.source}`)),console.log(e$1.gray(` Available: ${c.models.length} models
|
|
5
5
|
`));let i={},o=n.groupByTier(c.models),a$2=t=>{let r=a$1[t],s=r.tier==="high"?o.high:r.tier==="medium"?o.medium:o.low,l=[];for(let f of s){let P=l.length===0;l.push({title:P?`${f.name} (recommended)`:f.name,value:f.id,description:`${f.provider} - ${r.tier} tier`});}let u=o.high.filter(f=>!s.includes(f)),y=o.medium.filter(f=>!s.includes(f)),v=o.low.filter(f=>!s.includes(f));for(let f of u)l.push({title:f.name,value:f.id,description:`${f.provider} - high tier`});for(let f of y)l.push({title:f.name,value:f.id,description:`${f.provider} - medium tier`});for(let f of v)l.push({title:f.name,value:f.id,description:`${f.provider} - low tier`});return l};for(let t of ["architect","builder","tester","reviewer","security"]){let r=a$1[t],s=t.charAt(0).toUpperCase()+t.slice(1),l=a$2(t),u=await E({type:"select",name:"model",message:`${s} (${r.description})`,choices:l,initial:0},{onCancel:()=>{console.log(e$1.yellow(`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {a,e,d}from'./chunk-ET5XJTSX.js';import'./chunk-5TAVYPOV.js';import*as c from'fs';import*as p from'path';import {execSync}from'child_process';import n from'chalk';import*as w from'js-yaml';function R(s){return s.match(/(?:^|\s)((?:\/|\.\/|[a-zA-Z0-9_-]+\/)[^\s,;:'"]+\.[a-zA-Z]{1,10})\b/)?.[1]}async function $(s,l){try{let a$1=a(s),f=[];try{f=execSync("git diff --name-only HEAD",{cwd:s,encoding:"utf8",timeout:5e3}).trim().split(`
|
|
3
3
|
`).filter(Boolean);}catch{}let i;try{i=execSync("git status --porcelain",{cwd:s,encoding:"utf8",timeout:5e3}).trim()==="";}catch{}let u=p.join(s,"portal.yaml"),g=!1;if(c.existsSync(u))try{let t=c.readFileSync(u,"utf8"),e=w.load(t);g=e?.routes!=null&&Object.keys(e.routes).length>0;}catch{}let r=e({toolsCalled:[],filesModified:f,symbolsTouched:[],loreRecorded:!1,hasPortalRoutes:g,taskAddsRoutes:!1,gitClean:i}),o=d(a$1,l,r),d$1=0;if(o.evaluations.length>0)try{let t=p.join(s,".paradigm","sentinel");if(c.existsSync(t)){let{SentinelStorage:e}=await import('./dist-VGFSP3XM.js'),m=new e(t);for(let b of o.evaluations)m.recordPracticeEvent({habitId:b.habit.id,habitCategory:b.habit.category,result:b.result,engineer:"agent",sessionId:`cli-${Date.now().toString(36)}`,symbolsTouched:[],filesModified:f,notes:b.reason}),d$1++;}}catch{}let h=p.join(s,".paradigm",".habits-blocking");try{if(l==="on-stop"&&o.blocksCompletion){let t=o.evaluations.filter(e=>e.result==="skipped"&&e.habit.severity==="block").map(e=>`${e.habit.name}: ${e.reason}`);c.writeFileSync(h,t.join(`
|
|
4
|
-
`),"utf8");}else l==="on-stop"&&c.existsSync(h)&&c.unlinkSync(h);}catch{}return {trigger:l,evaluation:{total:o.summary.total,followed:o.summary.followed,skipped:o.summary.skipped,partial:o.summary.partial,blockingViolations:o.summary.blockingViolations,blocksCompletion:o.blocksCompletion},habits:o.evaluations.map(t=>({id:t.habit.id,name:t.habit.name,category:t.habit.category,severity:t.habit.severity,result:t.result,reason:t.reason,evidence:t.evidence})),recorded:d$1}}catch{return null}}async function P(s,l){let a=p.join(s,".paradigm","aspect-graph.db");if(!c.existsSync(a))return {driftedCount:0,healedCount:0,cleanCount:0,missingCount:0,details:[]};try{let{driftCheckCommand:f}=await import('./drift-ILZE5BFJ.js'),i="",u=console.log;console.log=g=>{i=g;};try{await f({json:!0,autoHeal:l});}finally{console.log=u;}return i?JSON.parse(i):null}catch{return null}}async function B(s){if(!c.existsSync(p.join(s,"portal.yaml")))return null;try{let{checkPortalCompliance:l}=await import('./portal-compliance-
|
|
4
|
+
`),"utf8");}else l==="on-stop"&&c.existsSync(h)&&c.unlinkSync(h);}catch{}return {trigger:l,evaluation:{total:o.summary.total,followed:o.summary.followed,skipped:o.summary.skipped,partial:o.summary.partial,blockingViolations:o.summary.blockingViolations,blocksCompletion:o.blocksCompletion},habits:o.evaluations.map(t=>({id:t.habit.id,name:t.habit.name,category:t.habit.category,severity:t.habit.severity,result:t.result,reason:t.reason,evidence:t.evidence})),recorded:d$1}}catch{return null}}async function P(s,l){let a=p.join(s,".paradigm","aspect-graph.db");if(!c.existsSync(a))return {driftedCount:0,healedCount:0,cleanCount:0,missingCount:0,details:[]};try{let{driftCheckCommand:f}=await import('./drift-ILZE5BFJ.js'),i="",u=console.log;console.log=g=>{i=g;};try{await f({json:!0,autoHeal:l});}finally{console.log=u;}return i?JSON.parse(i):null}catch{return null}}async function B(s){if(!c.existsSync(p.join(s,"portal.yaml")))return null;try{let{checkPortalCompliance:l}=await import('./portal-compliance-4MG5F2GI.js'),a=await l(s);return {status:a.status,declaredButUnusedCount:a.declaredButUnused.length,usedButUndeclaredCount:a.usedButUndeclared.length,properlyDeclaredCount:a.properlyDeclared.length,declaredButUnused:a.declaredButUnused,usedButUndeclared:a.usedButUndeclared,properlyDeclared:a.properlyDeclared}}catch{return null}}async function j(s){try{let{runPostflightLearning:l}=await import('./ambient-HYZR42NX.js');return await l(s)}catch{return null}}async function A(s){let l=process.cwd(),a=s.trigger||"on-stop",f=s.autoHeal!==false,i=[],u=[],g=await $(l,a),r=await P(l,f),o=await B(l);if(g?.evaluation.blocksCompletion){let t=g.habits.filter(e=>e.result==="skipped"&&e.severity==="block");for(let e of t){let m=`Blocking habit not satisfied: ${e.name} \u2014 ${e.reason}`;i.push(m),u.push({message:m,source:"habits",file:R(e.reason),severity:"blocking"});}}if(r&&r.driftedCount>0){let t=`${r.driftedCount} aspect anchor(s) have drifted (content genuinely changed). Run paradigm_aspect_check to review.`;i.push(t);for(let e of r.details.filter(m=>m.status==="drifted"))u.push({message:`Aspect ~${e.aspectId} drifted at lines ${e.startLine}-${e.endLine}`,source:"drift",file:e.path,severity:"advisory"});u.filter(e=>e.source==="drift").length===0&&u.push({message:t,source:"drift",severity:"advisory"});}if(o&&o.usedButUndeclaredCount>0){let t=`${o.usedButUndeclaredCount} gate(s) used in code but not declared in portal.yaml: ${o.usedButUndeclared.join(", ")}`;i.push(t);for(let e of o.usedButUndeclared)u.push({message:`Gate ^${e} used in code but not declared in portal.yaml`,source:"portal",file:"portal.yaml",severity:"blocking"});}let d=null;s.learn&&(d=await j(l));let h={habits:g,drift:r,portal:o,violations:i,structuredViolations:u,postflight:s.learn?d:void 0};if(s.json)console.log(JSON.stringify(h));else {if(console.log(n.magenta(`
|
|
5
5
|
Paradigm Compliance Check
|
|
6
6
|
`)),g){let{evaluation:t}=g,e=t.blocksCompletion?n.red:n.green;console.log(n.white(" Habits:")),console.log(` ${e(`${t.followed} followed, ${t.skipped} skipped, ${t.partial} partial`)}`),t.blockingViolations>0&&console.log(n.red(` ${t.blockingViolations} blocking violation(s)`)),console.log();}if(r&&(console.log(n.white(" Drift:")),r.healedCount>0&&console.log(n.green(` Auto-healed: ${r.healedCount} shifted anchor(s)`)),r.cleanCount>0&&console.log(n.green(` Clean: ${r.cleanCount} anchor(s)`)),r.driftedCount>0&&console.log(n.red(` Drifted: ${r.driftedCount} anchor(s)`)),r.missingCount>0&&console.log(n.yellow(` Missing: ${r.missingCount} anchor file(s)`)),console.log()),o){console.log(n.white(" Portal:"));let t=o.status==="compliant"?n.green:o.status==="warnings"?n.yellow:n.red;console.log(` Status: ${t(o.status)}`),o.usedButUndeclaredCount>0&&console.log(n.red(` ${o.usedButUndeclaredCount} undeclared gate(s)`)),console.log();}if(d){if(console.log(n.white(" Postflight Learning:")),d.journalsWritten>0){console.log(n.green(` Journals written: ${d.journalsWritten}`));for(let[t,e]of Object.entries(d.journalsByAgent))e>0&&console.log(n.gray(` ${t}: ${e} entries`));}else console.log(n.gray(" No verdicts to learn from"));d.promoted>0&&console.log(n.green(` Promoted to notebooks: ${d.promoted}`)),console.log();}if(i.length>0){console.log(n.red(` ${i.length} violation(s):`));for(let t of i)console.log(n.red(` - ${t}`));}else console.log(n.green(" All checks passed."));console.log();}i.length>0&&(process.exitCode=1);}export{A as complianceCheckCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {b}from'./chunk-
|
|
2
|
+
import {b}from'./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-SHD27BQX.js';import'./chunk-EKZDFEJW.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as a from'path';import o from'chalk';async function D(l,f,t){let d=f?a.resolve(f):process.cwd();if(!l){t.json?console.log(JSON.stringify({error:"Orchestration ID required"})):(console.log(o.red(`
|
|
3
3
|
Orchestration ID required.`)),console.log(o.gray(`Usage: paradigm team diff <orchestration-id>
|
|
4
4
|
`)));return}let e=new b(d).getOrchestration(l);if(!e){t.json?console.log(JSON.stringify({error:"Orchestration not found",id:l})):console.log(o.red(`
|
|
5
5
|
Orchestration not found: ${l}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-SHD27BQX.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as g from'fs';import*as u from'path';import l from'chalk';import*as m from'js-yaml';import {execSync}from'child_process';function y(e){return Object.entries(e.flows).map(([s,t])=>({id:s,...t}))}function w(e){let s=u.join(e,".paradigm","flows.yaml");if(!g.existsSync(s))return null;try{let t=g.readFileSync(s,"utf-8");return m.load(t)}catch{return null}}function b(e){let s=[];try{let t=execSync(`find "${e}" -name ".purpose" -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null || true`,{encoding:"utf-8"});for(let i of t.split(`
|
|
3
3
|
`).filter(Boolean))try{let n=g.readFileSync(i,"utf-8").match(/flows:\s*\n([\s\S]*?)(?=\n[a-z_]+:|$)/);if(n){let r=m.load(`flows:
|
|
4
4
|
${n[1]}`);if(r&&typeof r=="object"&&"flows"in r){let c=r.flows;for(let[a,d]of Object.entries(c))s.push({id:a,...d,definedIn:u.relative(e,i)});}}}catch{}}catch{}return s}function F(e){let s=[],t=w(e);if(t){let o=y(t);for(let n of o)n.definedIn=".paradigm/flows.yaml",s.push(n);}let i=b(e);for(let o of i)s.some(n=>n.id===o.id)||s.push(o);return s}function $(e){let s=[];s.push("```mermaid"),s.push("flowchart TD"),s.push(` START([${p(e.trigger)}])`);let t="START";for(let i=0;i<e.steps.length;i++){let o=e.steps[i],n=`S${i}`,r=p(o.symbol);switch(o.type){case "gate":{let c=o;if(s.push(` ${n}{${r}}`),s.push(` ${t} --> ${n}`),c.failResponse||o.errorSignal){let a=`DENY${i}`,d=c.failResponse||o.errorSignal||"Denied";s.push(` ${a}[/${p(d)}/]`),s.push(` ${n} -->|deny| ${a}`);}break}case "action":s.push(` ${n}[${r}]`),s.push(` ${t} -->|${o.optional?"optional":"allow"}| ${n}`);break;case "signal":s.push(` ${n}([${r}])`),s.push(` ${t} --> ${n}`);break}t=n;}e.successSignal&&(s.push(` SUCCESS([${p(e.successSignal)}])`),s.push(` ${t} --> SUCCESS`)),s.push(""),s.push(" classDef gate fill:#f9d71c,stroke:#333,color:#000"),s.push(" classDef action fill:#4a90d9,stroke:#333,color:#fff"),s.push(" classDef signal fill:#50c878,stroke:#333,color:#fff");for(let i=0;i<e.steps.length;i++){let o=e.steps[i];s.push(` class S${i} ${o.type}`);}return s.push("```"),s.join(`
|
|
5
5
|
`)}function p(e){return e.replace(/"/g,'\\"').replace(/[[\]{}()]/g,"")}async function L(e,s){let t=process.cwd();w(t)||(console.log(l.red(`
|
package/dist/index.js
CHANGED
|
@@ -3,14 +3,14 @@ import {Command}from'commander';import l from'chalk';import {createRequire}from'
|
|
|
3
3
|
${l.magenta("\u2554\u2550\u2557")}${l.cyan("\u250C\u2500\u2510\u252C\u2500\u2510\u250C\u2500\u2510\u250C\u252C\u2510\u252C \u250C\u2500\u2510\u250C\u252C\u2510")}
|
|
4
4
|
${l.magenta("\u2560\u2550\u255D")}${l.cyan("\u251C\u2500\u2524\u251C\u252C\u2518\u251C\u2500\u2524 \u2502\u2502\u2502 \u251C\u2500\u2510\u2502\u2502\u2502")}
|
|
5
5
|
${l.magenta("\u2569 ")}${l.cyan("\u2534 \u2534\u2534\u2514\u2500\u2534 \u2534\u2500\u2534\u2518\u2534 \u2514\u2500\u2518\u2534 \u2534")} ${l.gray(`v${F}`)}
|
|
6
|
-
`;i.name("paradigm").description("Unified developer tools ecosystem").version(F).addHelpText("before",$);i.command("init").description("Initialize Paradigm in the current project").option("-f, --force","Overwrite existing files").option("--name <name>","Project name").option("--ide <ide>","Target IDE: cursor, copilot, windsurf, claude").option("--stack <stack>","Stack preset (e.g., nextjs, fastapi, swift-ios). Auto-detected if omitted.").option("--migrate","Output migration prompt for existing IDE files").option("--quick","Non-interactive mode with smart defaults").option("--dry-run","Show what would be created without creating").action(async t=>{let{initCommand:o}=await import('./init-24MAQJFM.js');await o(t);});i.command("shift").description("Full project setup in one command (init + team init + scan + sync all IDEs + doctor)").option("-f, --force","Reinitialize even if already setup").option("-q, --quick","Skip slow operations (scan)").option("--verify","Run health checks after setup").option("--ide <ide>","Target specific IDE instead of all").option("--configure-models","Force model configuration prompts for team agents").option("--stack <stack>","Stack preset (e.g., nextjs, fastapi, swift-ios). Auto-detected if omitted.").option("--workspace <name>","Create or join a multi-project workspace with this name (creates ../.paradigm-workspace)").option("--workspace-path <path>","Custom workspace file location (default: ../.paradigm-workspace)").action(async t=>{let{shiftCommand:o}=await import('./shift-
|
|
6
|
+
`;i.name("paradigm").description("Unified developer tools ecosystem").version(F).addHelpText("before",$);i.command("init").description("Initialize Paradigm in the current project").option("-f, --force","Overwrite existing files").option("--name <name>","Project name").option("--ide <ide>","Target IDE: cursor, copilot, windsurf, claude").option("--stack <stack>","Stack preset (e.g., nextjs, fastapi, swift-ios). Auto-detected if omitted.").option("--migrate","Output migration prompt for existing IDE files").option("--quick","Non-interactive mode with smart defaults").option("--dry-run","Show what would be created without creating").action(async t=>{let{initCommand:o}=await import('./init-24MAQJFM.js');await o(t);});i.command("shift").description("Full project setup in one command (init + team init + scan + sync all IDEs + doctor)").option("-f, --force","Reinitialize even if already setup").option("-q, --quick","Skip slow operations (scan)").option("--verify","Run health checks after setup").option("--ide <ide>","Target specific IDE instead of all").option("--configure-models","Force model configuration prompts for team agents").option("--stack <stack>","Stack preset (e.g., nextjs, fastapi, swift-ios). Auto-detected if omitted.").option("--workspace <name>","Create or join a multi-project workspace with this name (creates ../.paradigm-workspace)").option("--workspace-path <path>","Custom workspace file location (default: ../.paradigm-workspace)").action(async t=>{let{shiftCommand:o}=await import('./shift-3IP3E5KJ.js');await o(t);});i.command("presets").description("List available stack presets for paradigm init/shift").option("-d, --discipline <discipline>","Filter by discipline (e.g., fullstack, api, mobile)").action(async t=>{let{listStackPresets:o}=await import('./discipline-H7LDI6NT.js'),a=(await import('chalk')).default,n=o(t.discipline);if(n.length===0){console.log(a.yellow(`
|
|
7
7
|
No presets found${t.discipline?` for discipline: ${t.discipline}`:""}
|
|
8
8
|
`));return}console.log(a.blue(`
|
|
9
9
|
Available Stack Presets
|
|
10
10
|
`)),console.log(a.gray(` Use with: paradigm init --stack <id> or paradigm shift --stack <id>
|
|
11
11
|
`));let A=new Map;for(let v of n){let O=A.get(v.discipline)||[];O.push(v),A.set(v.discipline,O);}for(let[v,O]of A){console.log(a.white(` ${v}`));for(let L of O)console.log(a.cyan(` ${L.id.padEnd(20)}`)+a.gray(L.name));console.log("");}console.log(a.gray(` ${n.length} presets available. Auto-detected when --stack is omitted.
|
|
12
|
-
`));});var B=i.command("event").description("Ambient event stream commands");B.command("emit").description("Emit an event to the ambient event stream (fast, for hook integration)").requiredOption("--type <type>","Event type (e.g., file-modified, compliance-violation)").requiredOption("--source <source>","Event source (e.g., post-write-hook, stop-hook)").option("--path <path>","File path (if applicable)").option("--symbols <symbols...>","Paradigm symbols referenced").option("--context <context>","Brief context snippet").option("--severity <severity>","Severity: info, warning, error, critical").action(async t=>{let{eventEmitCommand:o}=await import('./event-Y3VXC2RV.js');await o(t);});i.command("setup [path]").description("Interactive setup wizard for Paradigm").option("-y, --yes","Accept all defaults (non-interactive)").option("-f, --force","Overwrite existing .paradigm config").action(async(t,o)=>{let{setupCommand:a}=await import('./setup-3F5IK7MO.js');await a(t,o);});i.command("status").alias("st").description("Show project status and symbol counts").action(async()=>{let{statusCommand:t}=await import('./status-77M3SDIF.js');await t();});var E=i.command("purpose").description("Purpose-related commands");E.command("remember [path]").description("Aggregate and display purpose context").action(async(t=".")=>{let{purposeRememberCommand:o}=await import('./remember-MJRNTXYS.js');await o(t);});E.command("validate [path]").description("Validate purpose files").action(async(t=".")=>{let{purposeValidateCommand:o}=await import('./validate-LSCDOLBO.js');await o(t);});var C=i.command("portal").description("Portal-related commands");C.command("validate [path]").description("Validate portal.yaml configuration").action(async(t="./portal.yaml")=>{let{gateValidateCommand:o}=await import('./validate-VZXTJHGO.js');await o(t);});C.command("check").description("Check portal gate implementation compliance (declared vs used)").option("--json","Output as JSON").action(async t=>{let{portalCheckCommand:o}=await import('./portal-check-
|
|
12
|
+
`));});var B=i.command("event").description("Ambient event stream commands");B.command("emit").description("Emit an event to the ambient event stream (fast, for hook integration)").requiredOption("--type <type>","Event type (e.g., file-modified, compliance-violation)").requiredOption("--source <source>","Event source (e.g., post-write-hook, stop-hook)").option("--path <path>","File path (if applicable)").option("--symbols <symbols...>","Paradigm symbols referenced").option("--context <context>","Brief context snippet").option("--severity <severity>","Severity: info, warning, error, critical").action(async t=>{let{eventEmitCommand:o}=await import('./event-Y3VXC2RV.js');await o(t);});i.command("setup [path]").description("Interactive setup wizard for Paradigm").option("-y, --yes","Accept all defaults (non-interactive)").option("-f, --force","Overwrite existing .paradigm config").action(async(t,o)=>{let{setupCommand:a}=await import('./setup-3F5IK7MO.js');await a(t,o);});i.command("status").alias("st").description("Show project status and symbol counts").action(async()=>{let{statusCommand:t}=await import('./status-77M3SDIF.js');await t();});var E=i.command("purpose").description("Purpose-related commands");E.command("remember [path]").description("Aggregate and display purpose context").action(async(t=".")=>{let{purposeRememberCommand:o}=await import('./remember-MJRNTXYS.js');await o(t);});E.command("validate [path]").description("Validate purpose files").action(async(t=".")=>{let{purposeValidateCommand:o}=await import('./validate-LSCDOLBO.js');await o(t);});var C=i.command("portal").description("Portal-related commands");C.command("validate [path]").description("Validate portal.yaml configuration").action(async(t="./portal.yaml")=>{let{gateValidateCommand:o}=await import('./validate-VZXTJHGO.js');await o(t);});C.command("check").description("Check portal gate implementation compliance (declared vs used)").option("--json","Output as JSON").action(async t=>{let{portalCheckCommand:o}=await import('./portal-check-Z3OCQEQR.js');await o(t);});C.command("test [path]").description("Test portals and generate test files").option("--generate","Generate test files from portal.yaml").option("--portal <portalId>","Test specific portal").option("--component","Validate component access").option("--framework <framework>","Test framework (jest, vitest, mocha)","jest").option("--output <dir>","Output directory for generated tests","tests/portals").action(async(t,o)=>{let{gateTestCommand:a}=await import('./test-BQJMS4Y2.js');await a(t,o);});C.command("watch [path]").alias("w").description("Launch the Portal Viewer - real-time visualization dashboard").option("-p, --port <port>","WebSocket port for SDK connections","42196").option("-u, --ui-port <port>","HTTP port for UI","42195").option("-c, --config <path>","Path to portal.yaml config").option("--no-open","Do not auto-open browser").action(async(t,o)=>{let{portalWatchCommand:a}=await import('./watch-PZCCUP6K.js');await a(t,o);});C.command("report <session>").description("Generate a report from a session file").option("-f, --format <format>","Output format: json, markdown, slack, discord","markdown").option("-o, --output <path>","Output file path").action(async(t,o)=>{let{portalReportCommand:a}=await import('./watch-PZCCUP6K.js');await a(t,o);});C.command("export [path]").description("Export portal configuration in json, csv, or markdown format").option("-f, --format <format>","Output format: json, csv, markdown","json").option("-o, --output <path>","Output file path").option("-c, --config <path>","Path to portal.yaml").action(async(t,o)=>{let{portalExportCommand:a}=await import('./watch-PZCCUP6K.js');await a(t,o);});var T=i.command("premise").description("Premise-related commands");T.command("aggregate [path]").description("Aggregate all sources into symbol index").action(async(t=".")=>{let{premiseAggregateCommand:o}=await import('./aggregate-W66DM3GA.js');await o(t);});T.command("snapshot <name>").description("Create a timeline snapshot").option("-d, --description <desc>","Snapshot description").action(async(t,o)=>{let{premiseSnapshotCommand:a}=await import('./snapshot-L2G56RPL.js');await a(t,o.description);});i.command("sync [ide]").description("Generate IDE instruction files from .paradigm/ config").option("--all","Sync all supported IDEs").option("-f, --force","Overwrite existing files").option("--mcp","Generate MCP configuration (default: true)").option("--no-mcp","Skip MCP configuration generation").option("--nested","Generate nested CLAUDE.md files for directories with .purpose").action(async(t,o)=>{let{syncCommand:a}=await import('./sync-QRDSFETO.js');await a(t,o);});i.command("sync-llms").description("Generate llms.txt \u2014 LLM-readable project summary").option("-o, --output <path>","Output path (default: ./llms.txt)").action(async t=>{let{syncLlmsCommand:o}=await import('./sync-llms-HL5PPW3M.js');await o(t);});i.command("cursorrules [path]").description("[DEPRECATED] Use `paradigm sync cursor` instead").option("-a, --append","Append to existing .cursorrules").option("-f, --force","Overwrite existing .cursorrules").option("-p, --preview","Preview output without writing").option("--init","Create default .paradigm config if missing").option("--with-scan","Include probe protocol section").action(async(t,o)=>{console.log("\x1B[33m\u26A0\uFE0F `paradigm cursorrules` is deprecated. Use `paradigm sync cursor` instead.\x1B[0m\n");let{cursorrrulesCommand:a}=await import('./cursorrules-U5O4G5T4.js');await a(t,o);});i.command("index [path]").description("Generate probe index for visual discovery").option("-o, --output <path>","Output path for probe-index.json").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{indexCommand:a}=await import('./probe-5L5BQDGE.js');await a(t,o);});var W=i.command("probe").description("Probe-related commands");W.command("index [path]").description("Generate probe index (alias for `paradigm index`)").option("-o, --output <path>","Output path for probe-index.json").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{indexCommand:a}=await import('./probe-5L5BQDGE.js');await a(t,o);});i.command("migrate").description("Detect and apply migrations to bring project up to date").option("--dry-run","Preview changes without applying").option("--apply","Apply all auto migrations without prompting").option("-f, --force","Re-run previously applied migrations").option("--only <ids...>","Run specific migrations by ID").option("--category <cat>","Run migrations in a category (directory, config, template, hook)").option("--no-sync","Skip template sync").option("--list","List all migrations and their status").option("-v, --verbose","Show detailed output").action(async t=>{let{migrateCommand:o}=await import('./migrate-X5OMAFAQ.js');await o(t);});i.command("upgrade [path]").description("(Deprecated) Upgrade project with new Paradigm features \u2014 use `paradigm migrate`").option("--features <features...>","Features to upgrade (probe, logger)").option("--all","Apply all available upgrades").option("--from-horizon","Migrate from Horizon to Paradigm").option("--dry-run","Show what would be upgraded without making changes").option("-f, --force","Force re-upgrade even if already configured").action(async(t,o)=>{let{upgradeCommand:a}=await import('./upgrade-B4IOLZYK.js');await a(t,o);});i.command("lint [path]").description("Validate .purpose files for schema errors").option("-f, --fix","Auto-fix issues where possible").option("-s, --strict","Fail on warnings (not just errors)").option("-q, --quiet","Suppress output except errors").option("--json","Output as JSON").option("--auto-populate","Scan for undocumented source dirs and suggest .purpose entries (use with --fix to write)").action(async(t,o)=>{let{lintCommand:a}=await import('./lint-IGKE6UPS.js');await a(t,o);});i.command("cost [path]").description("Analyze token costs for AI context").option("-d, --detailed","Show detailed breakdown by file").option("--json","Output as JSON").action(async(t,o)=>{let{costCommand:a}=await import('./cost-IDNVMAEV.js');await a(t,o);});i.command("explain-files").alias("files").description("Explain all Paradigm config and generated files").action(async()=>{let{explainFilesCommand:t}=await import('./explain-files-3GPZUETV.js');await t();});var M=i.command("scan").description("Visual discovery and auto-generation commands");M.command("auto [path]").description("Auto-generate .purpose files from code analysis").option("-n, --dry-run","Show what would be generated without writing").option("-f, --force","Overwrite existing .purpose files").option("--json","Output as JSON").option("--init","Full project initialization: generate .purpose files + portal.yaml").action(async(t,o)=>{let{autoScanCommand:a}=await import('./auto-RHJXOZFL.js');await a(t,o);});M.action(()=>{console.log(`
|
|
13
13
|
Usage: paradigm scan <command>
|
|
14
|
-
`),console.log("Commands:"),console.log(" auto [path] Auto-generate .purpose files from code analysis"),console.log("\nRun `paradigm scan auto --help` for options.\n");});var P=i.command("flow").description("Flow management commands");P.command("diagram <flowId>").description("Generate Mermaid diagram for a flow").option("-o, --output <path>","Output file path").action(async(t,o)=>{let{flowDiagramCommand:a}=await import('./flow-
|
|
14
|
+
`),console.log("Commands:"),console.log(" auto [path] Auto-generate .purpose files from code analysis"),console.log("\nRun `paradigm scan auto --help` for options.\n");});var P=i.command("flow").description("Flow management commands");P.command("diagram <flowId>").description("Generate Mermaid diagram for a flow").option("-o, --output <path>","Output file path").action(async(t,o)=>{let{flowDiagramCommand:a}=await import('./flow-POQP27WA.js');await a(t,o);});P.action(()=>{P.outputHelp();});var s=i.command("team").description("Multi-agent orchestration commands");s.command("init [path]").description("Initialize team configuration with default agents").option("-f, --force","Overwrite existing configuration").option("--configure-models","Force model configuration prompts").option("--no-configure-models","Skip model configuration").option("--json","Output as JSON").action(async(t,o)=>{let{teamInitCommand:a}=await import('./team-MKLPUTW7.js');await a(t,{...o,configureModels:o.configureModels,noConfigureModels:o.configureModels===false});});s.command("status [path]").description("Show current team status").option("--running","Show only running orchestrations").option("--id <id>","Show specific orchestration").option("--json","Output as JSON").action(async(t,o)=>{let{teamStatusCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});s.command("handoff [path]").description("Hand off current task to another agent").requiredOption("-t, --to <agent>","Target agent name").option("-s, --summary <text>","Summary of what was done").option("--json","Output as JSON").action(async(t,o)=>{let{teamHandoffCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});s.command("accept [handoff-id] [path]").description("Accept a pending handoff").option("-n, --note <text>","Acceptance note").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamAcceptCommand:n}=await import('./team-MKLPUTW7.js');await n(t,o,a);});s.command("check [path]").description("Check for conflicts and team health issues").option("--json","Output as JSON").action(async(t,o)=>{let{teamCheckCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});s.command("history [path]").description("Show full activity log").option("-l, --limit <number>","Number of entries to show","50").option("--json","Output as JSON").action(async(t,o)=>{let{teamHistoryCommand:a}=await import('./team-MKLPUTW7.js');await a(t,{...o,limit:parseInt(o.limit)});});s.command("reset [path]").description("Reset team state for fresh start").option("-f, --force","Force reset even with pending work").option("--json","Output as JSON").action(async(t,o)=>{let{teamResetCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});s.command("spawn <agent> [path]").description("Spawn an AI agent to work on a task").requiredOption("-t, --task <task>","Task for the agent to perform").option("-m, --model <model>","Model to use: opus, sonnet, haiku").option("-p, --provider <provider>","Provider: auto, claude, claude-code, claude-cli, manual").option("--budget <budget>",'Budget limits (e.g., "tokens=100000,cost=2")').option("--timeout <ms>","Timeout in milliseconds").option("--checkpoint","Pause for approval before writes/deletes").option("-q, --quiet","Suppress output").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamSpawnCommand:n}=await import('./spawn-UH5RENSE.js');await n(t,o,a);});s.command("orchestrate <task> [path]").description("Orchestrate a multi-agent task").option("--solo","Run in solo mode (single Claude)").option("--faceted","Run in faceted mode (multi-agent, default)").option("--compare","Run both modes and compare results").option("--background","Run in background mode (returns immediately)").option("--notify <methods>","Notification methods: bell,desktop,file,webhook (default: bell)").option("-m, --model <model>","Orchestrator model: opus, sonnet, haiku").option("-p, --provider <provider>","Provider: auto, claude, claude-code, claude-cli, manual").option("--budget <budget>",'Budget limits (e.g., "tokens=500000,cost=5")').option("--checkpoint","Pause for approval between agents").option("--live","Stream agent output live").option("--pm","Enable PM governance (compliance checks before/after)").option("-q, --quiet","Suppress output").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamOrchestrateCommand:n}=await import('./orchestrate-4L3NJCV5.js');await n(t,o,a);});s.command("diff <orchestration-id> [path]").description("Show diff of changes from a completed orchestration").option("--full","Show full file contents").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamDiffCommand:n}=await import('./diff-YM6ZV3UI.js');await n(t,o,a);});s.command("accept-orch <orchestration-id> [path]").description("Accept orchestration changes").option("-n, --note <text>","Acceptance note").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamAcceptOrchestrationCommand:n}=await import('./accept-orchestration-CLT6SAYW.js');await n(t,o,a);});s.command("reject-orch <orchestration-id> [path]").description("Reject orchestration changes").option("-r, --reason <text>","Rejection reason").option("--cleanup","Delete created files").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamRejectOrchestrationCommand:n}=await import('./accept-orchestration-CLT6SAYW.js');await n(t,o,a);});s.command("cost [path]").description("Show cost summary for orchestrations").option("--from <date>","From date (ISO format)").option("--to <date>","To date (ISO format)").option("--days <n>","Last N days").option("-d, --detailed","Show detailed breakdown").option("--json","Output as JSON").action(async(t,o)=>{let{teamCostCommand:a}=await import('./cost-PK4KIF7R.js');await a(t,o);});s.command("export [path]").description("Export orchestration data").option("-f, --format <format>","Output format: json, csv","json").option("--from <date>","From date (ISO format)").option("--to <date>","To date (ISO format)").option("-o, --output <file>","Output file path").action(async(t,o)=>{let{teamExportCommand:a}=await import('./export-CV5KCTPS.js');await a(t,o);});s.command("providers [path]").description("Show available agent providers and their status").option("--set <provider>","Set preferred provider: auto, claude, claude-code, claude-cli, manual").option("--json","Output as JSON").action(async(t,o)=>{let{teamProvidersCommand:a}=await import('./providers-4PXMWA7V.js');await a(t,o);});s.command("models [path]").description("Configure or view agent model assignments").option("--refresh","Refresh model cache from environment").option("--json","Output as JSON").action(async(t,o)=>{let{teamModelsCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});var G=s.command("agents").description("Agent management commands");G.command("suggest <task>").description("Suggest agents for a task based on triggers").option("--json","Output as JSON").action(async(t,o)=>{let{agentsSuggestCommand:a}=await import('./agents-suggest-HYTFMQD3.js');await a(t,o);});G.action(()=>{console.log(`
|
|
15
15
|
Usage: paradigm team agents <command>
|
|
16
|
-
`),console.log("Commands:"),console.log(" suggest <task> Suggest agents for a task based on triggers"),console.log("\nRun `paradigm team agents suggest --help` for options.\n");});s.action(async()=>{let{teamStatusCommand:t}=await import('./team-WGERKGNP.js');await t(void 0,{});});var z=i.command("plugin").description("Plugin management commands");z.command("check").description("Check for updates to installed Claude Code plugins").option("-u, --update","Pull latest changes for all stale marketplace clones").action(async t=>{let{pluginCheckCommand:o}=await import('./check-THVGY4R5.js');await o(t);});z.action(async()=>{let{pluginCheckCommand:t}=await import('./check-THVGY4R5.js');await t({});});var k=i.command("workspace").description("Multi-project workspace commands");k.command("init").description("Create a .paradigm-workspace file from sibling projects").option("-n, --name <name>","Workspace name (default: directory name)").option("-f, --force","Overwrite existing workspace file").action(async t=>{let{workspaceInitCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});k.command("status").description("Show workspace member status and symbol counts").option("--json","Output as JSON").action(async t=>{let{workspaceStatusCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});k.command("reindex").description("Rebuild scan-index.json for all workspace members").option("-q, --quiet","Suppress progress output").action(async t=>{let{workspaceReindexCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});k.action(async()=>{let{workspaceStatusCommand:t}=await import('./workspace-2ODL5WLY.js');await t({});});i.command("doctor").description("Health check - validate Paradigm setup").option("--context","Run only context audit checks (CLAUDE.md quality)").action(async t=>{let{doctorCommand:o}=await import('./doctor-2T2QL6VM.js');await o(t);});i.command("integrity").description("Symbol integrity check \u2014 broken refs, duplicates, orphans, missing anchors").option("--json","Output machine-readable JSON").action(async t=>{let{integrityCommand:o}=await import('./integrity-UYDOOJDP.js');await o(t);});i.command("review").description("Automated two-stage review pipeline \u2014 spec compliance + code quality").option("--pr <number>","Review a PR via gh CLI").option("--ci","Exit 1 on blocking findings").option("--deep","Include code quality checks (eval, secrets, console.log)").option("--json","Output machine-readable JSON").action(async t=>{let{reviewCommand:o}=await import('./review-6UAH6V3R.js');await o(t);});i.command("sweep").description("Entropy detection and cleanup \u2014 find orphaned symbols, stale purpose files, phantom gates").option("--dry","Report only, no fixes applied").option("--skip-fix","Same as --dry").option("-q, --quiet","Minimal output").action(async t=>{let{sweepCommand:o}=await import('./sweep-HU74OPVW.js');await o(t);});var Q=i.command("drift").description("Aspect anchor drift detection");Q.command("check").description("Check aspect anchors for drift and auto-heal shifted anchors").option("--json","Output as JSON").option("--auto-heal","Auto-heal shifted anchors (default: true)").option("--no-auto-heal","Disable auto-healing").action(async t=>{let{driftCheckCommand:o}=await import('./drift-ILZE5BFJ.js');await o(t);});var I=i.command("global").description("Manage Global Brain (~/.paradigm/)");I.command("clean").description("Remove old files from ~/.paradigm/ (Global Brain rotation)").option("--older-than <duration>","Remove files older than duration (e.g., 90d, 30d, 7d)","90d").option("-n, --dry-run","Show what would be deleted without deleting").action(async t=>{let{globalCleanCommand:o}=await import('./global-C44FW4G2.js');await o(t);});I.action(()=>{I.outputHelp();});i.command("watch").description("Watch for changes and auto-sync IDE files").action(async()=>{let{watchCommand:t}=await import('./watch-LRM5XD46.js');await t();});i.command("summary").description("Generate .paradigm/project.md with project stats").action(async()=>{let{summaryCommand:t}=await import('./summary-ZJLQ6KHB.js');await t();});i.command("constellation [path]").alias("const").description("Generate .paradigm/constellation.json - symbol relationship graph for AI agents").option("-f, --format <format>","Output format: json or yaml","json").option("-o, --output <path>","Custom output path").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{constellationCommand:a}=await import('./constellation-CG7C4WFE.js');await a(t,o);});i.command("beacon [path]").description("Generate .paradigm/beacon.md - quick-start orientation for AI agents").option("-r, --refresh","Regenerate even if beacon exists").option("-o, --output <path>","Custom output path").option("--json","Output as JSON (for AI agent queries)").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{beaconCommand:a}=await import('./beacon-5QVYV5DF.js');await a(t,o);});i.command("ripple <symbol> [path]").description("Show change impact analysis for a symbol").option("-d, --depth <depth>","Analysis depth (default: 1)","1").option("--json","Output as JSON").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{rippleCommand:n}=await import('./ripple-ZGDITCGB.js');await n(t,o,a);});var b=i.command("thread").description("Session continuity - pass context between AI agent sessions");b.command("show [path]").alias("s").description("Show current thread").option("--json","Output as JSON (for AI agent queries)").action(async(t,o)=>{let{threadShowCommand:a}=await import('./thread-HFXK65D4.js');await a(t,o);});b.command("save <message> [path]").description("Save activity to the thread trail").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadSaveCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("todo <task> [path]").description("Add a loose end (unfinished task)").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadTodoCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("note <note> [path]").description("Add a breadcrumb (note for next agent)").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadNoteCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("clear [path]").description("Clear the thread").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{threadClearCommand:a}=await import('./thread-HFXK65D4.js');await a(t,o);});b.option("--json","Output as JSON (for AI agent queries)").action(async t=>{let{threadShowCommand:o}=await import('./thread-HFXK65D4.js');await o(void 0,t);});var j=i.command("echo").description("Error-to-symbol mapping - find related symbols for error codes");j.command("lookup <errorCode> [path]").alias("l").description("Look up an error code").option("--json","Output as JSON (for AI agent queries)").action(async(t,o,a)=>{let{echoCommand:n}=await import('./echo-UPTQUEDU.js');await n(t,o,a);});j.command("init [path]").description("Create .paradigm/echoes.yaml template").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{echoInitCommand:a}=await import('./echo-UPTQUEDU.js');await a(t,o);});j.command("list [path]").alias("ls").description("List all error mappings").action(async t=>{let{echoListCommand:o}=await import('./echo-UPTQUEDU.js');await o(t);});j.argument("[errorCode]","Error code to look up").option("--json","Output as JSON (for AI agent queries)").action(async(t,o)=>{if(t){let{echoCommand:a}=await import('./echo-UPTQUEDU.js');await a(t,void 0,o);}else {let{echoListCommand:a}=await import('./echo-UPTQUEDU.js');await a();}});var u=i.command("tutorial").description("Interactive tutorial system");u.command("start [path]").description("Start the tutorial").action(async t=>{let{tutorialStartCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("step [n] [path]").description("Show tutorial step").action(async(t,o)=>{let{tutorialStepCommand:a}=await import('./tutorial-UC6YQMNN.js');await a(o,t);});u.command("checkpoint [path]").description("Validate current checkpoint").action(async t=>{let{tutorialCheckpointCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("next [path]").description("Move to next step").action(async t=>{let{tutorialNextCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("status [path]").description("Show tutorial progress").action(async t=>{let{tutorialStatusCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("reset [path]").description("Reset tutorial to beginning").action(async t=>{let{tutorialResetCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("bugs [path]").description("List intentional bugs").action(async t=>{let{tutorialBugsCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});var w=i.command("mcp").description("MCP server configuration for AI clients");w.command("setup").description("Configure MCP server for detected AI clients").option("-c, --client <client>","Target client: cursor, claude-desktop, continue, cline, all").option("-f, --force","Overwrite existing config").option("--json","Output as JSON").option("--no-gitignore","Do not add config to .gitignore").action(async t=>{let{mcpSetupCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("status").description("Show MCP configuration status across clients").option("--json","Output as JSON").action(async t=>{let{mcpStatusCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("list").alias("ls").description("List all configured MCP servers across all clients").option("--json","Output as JSON").action(async t=>{let{mcpListCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("remove [server]").alias("rm").description("Remove MCP server from client configs").option("-c, --client <client>","Target client: cursor, claude-desktop, continue, cline, all").option("-f, --force","Skip confirmation").option("--json","Output as JSON").action(async(t,o)=>{let{mcpRemoveCommand:a}=await import('./setup-KPIMRZ4Q.js');await a(t,o);});w.command("use-dev").description("Switch MCP configs to use local dev build").option("-c, --client <client>","Target client: cursor, claude-desktop, claude-code, continue, cline").option("--json","Output as JSON").action(async t=>{let{mcpUseDevCommand:o}=await import('./switch-CTW4PDGI.js');await o(t);});w.command("use-prod").description("Switch MCP configs back to global production binary").option("-c, --client <client>","Target client: cursor, claude-desktop, claude-code, continue, cline").option("--json","Output as JSON").action(async t=>{let{mcpUseProdCommand:o}=await import('./switch-CTW4PDGI.js');await o(t);});w.action(async()=>{let{mcpSwitchStatusCommand:t}=await import('./switch-CTW4PDGI.js');await t({});});i.command("promote").description("Copy local build to production (~/.paradigm-cli/)").option("-f, --force","Create production directory if missing").option("--skip-build","Skip npm run build step").option("--json","Output as JSON").action(async t=>{let{promoteCommand:o}=await import('./promote-NJQDZBZA.js');await o(t);});var S=i.command("wisdom").description("Team wisdom - preferences, antipatterns, decisions, expertise");S.command("show [symbol]").description("Display wisdom for symbols or overview").option("--json","Output as JSON").action(async(t,o)=>{let{wisdomShowCommand:a}=await import('./wisdom-XZ3QKPNP.js');await a(t,o);});S.command("init").description("Initialize wisdom directory with templates").option("-f, --force","Overwrite existing files").action(async t=>{let{wisdomInitCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});S.command("add-antipattern").description("Add a new antipattern").requiredOption("--id <id>","Antipattern ID (e.g., api-001)").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--description <desc>","What NOT to do").requiredOption("--reason <reason>","Why this is bad").requiredOption("--alternative <alt>","What to do instead").action(async t=>{let{wisdomAddAntipatternCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});S.command("decide").description("Create a new decision record (ADR)").requiredOption("--id <id>","Decision ID (e.g., 001)").requiredOption("--title <title>","Decision title").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--context <context>","Context/problem").requiredOption("--decision <decision>","The decision made").option("--status <status>","Status: proposed, accepted","proposed").action(async t=>{let{wisdomDecideCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});S.command("expert [query]").description("Find experts for symbols or areas").option("--json","Output as JSON").action(async(t,o)=>{let{wisdomExpertCommand:a}=await import('./wisdom-XZ3QKPNP.js');await a(t,o);});S.option("--json","Output as JSON").action(async t=>{let{wisdomShowCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(void 0,t);});var y=i.command("history").description("Implementation history - tracking changes, validation, fragility");y.command("show [symbol]").description("Display history for symbols or overview").option("--json","Output as JSON").option("-l, --limit <number>","Number of entries","10").action(async(t,o)=>{let{historyShowCommand:a}=await import('./history-UW454SDP.js');await a(t,{...o,limit:parseInt(o.limit)});});y.command("init").description("Initialize history directory").option("-f, --force","Overwrite existing files").action(async t=>{let{historyInitCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("fragile").description("Show fragile symbols that need extra care").option("--json","Output as JSON").action(async t=>{let{historyFragileCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("reindex").description("Regenerate index from log").action(async()=>{let{historyReindexCommand:t}=await import('./history-UW454SDP.js');await t();});y.command("record").description("Record an implementation event").requiredOption("--type <type>","Type: implement, refactor, rollback").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--description <desc>","What was done").option("--intent <intent>","Intent: feature, fix, refactor").option("--commit <hash>","Git commit hash").option("--reason <reason>","Reason for rollback").action(async t=>{let{historyRecordCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("validate").description("Record a validation result").requiredOption("--result <result>","Result: pass, fail, partial").option("--ref <id>","Implementation ID being validated").option("--passed <n>","Tests passed").option("--failed <n>","Tests failed").action(async t=>{let{historyValidateCommand:o}=await import('./history-UW454SDP.js');await o({...t,passed:t.passed?parseInt(t.passed):void 0,failed:t.failed?parseInt(t.failed):void 0});});y.option("--json","Output as JSON").action(async t=>{let{historyShowCommand:o}=await import('./history-UW454SDP.js');await o(void 0,t);});var x=i.command("hooks").description("Git hooks for automatic history capture");x.command("install").description("Install git hooks, Claude Code hooks, and Cursor hooks").option("-f, --force","Overwrite existing hooks").option("--post-commit","Only install post-commit hook").option("--pre-push","Only install pre-push hook").option("--claude-code","Only install Claude Code hooks (stop + pre-commit)").option("--cursor","Only install Cursor hooks (.cursor/hooks.json)").option("--dry-run","Show what would be installed without making changes").action(async t=>{let{hooksInstallCommand:o}=await import('./hooks-XH52VGOU.js');await o(t);});x.command("uninstall").description("Remove paradigm hooks (git hooks, or --cursor for Cursor hooks)").option("--cursor","Remove Cursor hooks instead of git hooks").option("--dry-run","Show what would be removed without making changes").action(async t=>{let{hooksUninstallCommand:o}=await import('./hooks-XH52VGOU.js');await o(t);});x.command("status").description("Check git hooks status").action(async()=>{let{hooksStatusCommand:t}=await import('./hooks-XH52VGOU.js');await t();});x.action(async()=>{let{hooksStatusCommand:t}=await import('./hooks-XH52VGOU.js');await t();});var r=i.command("triage").description("Semantic error triage - incident management and pattern matching");r.command("list").alias("ls").description("List recent incidents with matched patterns").option("-l, --limit <number>","Maximum incidents to show","10").option("-s, --status <status>","Filter by status: open, investigating, resolved, wont-fix, all").option("--symbol <symbol>","Filter by symbol (e.g., @checkout, ^auth)").option("-e, --env <environment>","Filter by environment").option("--search <text>","Search in error messages").option("--from <date>","Filter from date (ISO format)").option("--to <date>","Filter to date (ISO format)").option("--json","Output as JSON").action(async t=>{let{triageListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("show <id>").description("Show full incident details").option("--timeline","Include flow timeline").option("--json","Output as JSON").action(async(t,o)=>{let{triageShowCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("resolve <id>").description("Mark incident as resolved").option("-p, --pattern <patternId>","Pattern that led to resolution").option("-c, --commit <hash>","Git commit hash of fix").option("--pr <url>","Pull request URL").option("-n, --notes <text>","Resolution notes").option("--wont-fix","Mark as will not fix").action(async(t,o)=>{let{triageResolveCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("note <id> <note>").description("Add a note to an incident").action(async(t,o)=>{let{triageNoteCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("link <id1> <id2>").description("Link two related incidents").action(async(t,o)=>{let{triageLinkCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});var g=r.command("patterns").description("Manage failure patterns");g.command("list").alias("ls").description("List all patterns").option("--source <source>","Filter by source: manual, suggested, imported, community").option("--min-confidence <score>","Minimum confidence score").option("--json","Output as JSON").action(async t=>{let{triagePatternsListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("show <id>").description("Show pattern details").option("--json","Output as JSON").action(async(t,o)=>{let{triagePatternsShowCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});g.command("add").description("Create a new pattern").requiredOption("--id <id>","Pattern ID (kebab-case)").requiredOption("--name <name>","Human-readable name").option("--description <text>","Pattern description").option("--symbols <pairs>",'Symbol criteria (e.g., "feature:@checkout,gate:^auth")').option("--error-contains <keywords>","Error keywords (comma-separated)").option("--missing-signals <signals>","Expected missing signals (comma-separated)").option("--strategy <strategy>","Resolution strategy: retry, fallback, fix-data, fix-code, ignore, escalate","fix-code").option("--priority <priority>","Priority: low, medium, high, critical","medium").option("--code-hint <text>","Code hint for resolution").option("--tags <tags>","Tags (comma-separated)").option("--from-incident <id>","Generate suggestion from incident").action(async t=>{let{triagePatternsAddCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("delete <id>").alias("rm").description("Delete a pattern").action(async t=>{let{triagePatternsDeleteCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("test <id>").description("Test pattern against historical incidents").option("-l, --limit <number>","Max incidents to test against","100").option("--json","Output as JSON").action(async(t,o)=>{let{triagePatternsTestCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});g.command("seed").description("Load built-in seed patterns").action(async()=>{let{triagePatternsSeedCommand:t}=await import('./triage-FCWOZASE.js');await t();});g.action(async()=>{let{triagePatternsListCommand:t}=await import('./triage-FCWOZASE.js');await t({});});r.command("export <type>").description("Export patterns or full backup (type: patterns, backup)").option("-o, --output <path>","Output file path").option("--include-private","Include private patterns").action(async(t,o)=>{let{triageExportCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("import <file>").description("Import patterns from JSON file").option("--overwrite","Overwrite existing patterns").action(async(t,o)=>{let{triageImportCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("restore <file>").description("Restore from full backup").action(async t=>{let{triageRestoreCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("stats").description("Show statistics dashboard").option("-p, --period <period>","Time period: 1d, 7d, 30d, 90d","7d").option("--symbol <symbol>","Show health for specific symbol").option("--json","Output as JSON").action(async t=>{let{triageStatsCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("record").description("Manually record an incident").requiredOption("--error <message>","Error message").requiredOption("-e, --env <environment>","Environment").option("--feature <symbol>","Feature symbol (@...)").option("--component <symbol>","Component symbol (#...)").option("--flow <symbol>","Flow symbol ($...)").option("--gate <symbol>","Gate symbol (^...)").option("--signal <symbol>","Signal symbol (!...)").option("--state <symbol>","State symbol (%...)").option("--integration <symbol>","Integration symbol (&...)").option("--service <name>","Service name").option("--version <version>","App version").option("--stack <trace>","Stack trace").option("--json","Output as JSON").action(async t=>{let{triageRecordCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.option("-l, --limit <number>","Maximum incidents to show","10").option("-s, --status <status>","Filter by status").option("--json","Output as JSON").action(async t=>{let{triageListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});var c=i.command("lore").description("Project lore - timeline of everything that happened to this project");c.command("list").alias("ls").description("List recent lore entries").option("--author <author>","Filter by author").option("--type <type>","Filter by type: agent-session, human-note, decision, review, incident, milestone, retro, insight").option("--symbol <symbol>","Filter by symbol").option("--tags <tags>","Filter by tags (comma-separated)").option("--from <date>","Filter from date (ISO format, e.g., 2026-02-20)").option("--to <date>","Filter to date (ISO format)").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{loreListCommand:o}=await import('./list-YKIQNKGB.js');await o(t);});c.command("show <id>").description("Show full detail for a lore entry").option("--json","Output as JSON").action(async(t,o)=>{let{loreShowCommand:a}=await import('./show-PJ5LFLIL.js');await a(t,o);});c.command("record").description("Record a new lore entry (human note, milestone, etc.)").option("--type <type>","Entry type: human-note, decision, milestone, retro, insight","human-note").option("--author <author>","Author name").option("--title <title>","Entry title").option("--summary <summary>","Entry summary").option("--symbols <symbols>","Comma-separated symbols").option("--tags <tags>","Comma-separated tags").option("--files-modified <files>","Comma-separated files modified").option("--files-created <files>","Comma-separated files created").option("--commit <hash>","Git commit hash").option("--learnings <items>","Comma-separated learnings").option("--duration <minutes>","Duration in minutes").option("--meta <json>",`Project-defined metadata as JSON (e.g., '{"sprint": 12}')`).option("--body <text>","Long-form content (detailed notes, rationale, etc.)").option("--link-lore <ids>","Comma-separated lore entry IDs to link").option("--link-commits <shas>","Comma-separated git commit SHAs to link").option("--confidence <number>","Confidence in correctness (0.0 to 1.0)").action(async t=>{let{loreRecordCommand:o}=await import('./record-YXPB34MY.js');await o(t);});c.command("review <id>").description("Add a review to a lore entry").option("--reviewer <name>","Reviewer name").option("--completeness <n>","Completeness score (1-5)","3").option("--quality <n>","Quality score (1-5)","3").option("--notes <text>","Review notes").action(async(t,o)=>{let{loreReviewCommand:a}=await import('./review-77QI6VOC.js');await a(t,o);});c.command("assess <id> <verdict>").description("Record an assessment verdict on a lore entry (correct/partial/incorrect)").option("--assessor <name>","Assessor name").option("--notes <text>","Assessment notes").action(async(t,o,a)=>{let{loreAssessCommand:n}=await import('./assess-UFPYEJKP.js');await n(t,o,a);});c.command("calibration").description("Show calibration statistics across assessed lore entries").option("--symbol <symbol>","Filter by symbol").option("--tag <tag>","Filter by tag").option("--author <author>","Filter by author").option("--group-by <dimension>","Group by: symbol, tag, type").option("--json","Output as JSON").action(async t=>{let{loreCalibrationCommand:o}=await import('./calibration-OLJYB5HN.js');await o(t);});c.command("edit <id>").description("Edit an existing lore entry").option("--title <title>","New title").option("--summary <summary>","New summary").option("--type <type>","New type: agent-session, human-note, decision, review, incident, milestone").option("--symbols <symbols>","Comma-separated symbols").option("--tags <tags>","Comma-separated tags").option("--learnings <items>","Comma-separated learnings").action(async(t,o)=>{let{loreEditCommand:a}=await import('./edit-GUU3HBVW.js');await a(t,o);});c.command("delete <id>").description("Delete a lore entry").option("-y, --yes","Skip confirmation").option("--dry-run","Show what would be deleted without making changes").action(async(t,o)=>{let{loreDeleteCommand:a}=await import('./delete-P5VULXR4.js');await a(t,o);});c.command("migrate-assessments").description("Migrate assessment entries to lore with arc: tags").option("--dry-run","Show what would be migrated without making changes").action(async t=>{let{loreMigrateAssessmentsCommand:o}=await import('./migrate-assessments-GEI5WMI2.js');await o(t);});c.command("retag").description("Add or remove tags from matching lore entries").option("--add <tag>","Tag to add").option("--remove <tag>","Tag to remove").option("--type <type>","Filter by entry type").option("--symbol <symbol>","Filter by symbol").option("--author <author>","Filter by author").option("--from <date>","Filter from date").option("--to <date>","Filter to date").option("--tags <tags>","Filter by existing tags (comma-separated)").option("--dry-run","Show what would change without making changes").action(async t=>{let{loreRetagCommand:o}=await import('./retag-N5XF3KXP.js');await o(t);});c.command("timeline").description("Show lore timeline grouped by date with hot symbols and authors").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{loreTimelineCommand:o}=await import('./timeline-K3ZFKJ3R.js');await o(t);});c.option("-p, --port <port>","Port to run on","3840").option("--no-open","Don't open browser automatically").action(async t=>{let{loreServeCommand:o}=await import('./serve-L52ZUTU6.js');await o(void 0,t);});i.command("serve").description("Launch Paradigm Platform \u2014 unified development management UI").option("-p, --port <port>","Port to run on","3850").option("--no-open","Don't open browser automatically").option("--sections <list>","Comma-separated sections to enable (e.g., lore,graph,git)").action(async t=>{let{serveCommand:o}=await import('./serve-JE6UF5P2.js');await o(t);});var K=i.command("graph").description("Interactive symbol relationship graph").argument("[path]","Project directory",void 0).option("-p, --port <port>","Port to run on","3841").option("--no-open","Don't open browser automatically").action(async(t,o)=>{let{graphCommand:a}=await import('./graph-CNDE5TAT.js');await a(t,o);});K.command("generate").description("Generate a named graph file in .paradigm/graphs/").argument("<name>","Graph name (used as filename: {name}.graph.json)").argument("[path]","Project directory",void 0).option("-s, --symbols <list>","Comma-separated symbol names to include").option("-g, --group <spec...>",'Group spec: "Label:#sym1,#sym2" (repeatable)').option("-l, --link <spec...>",'Link spec: "Source>Target:label" (repeatable)').action(async(t,o,a)=>{let{graphGenerateCommand:n}=await import('./graph-CNDE5TAT.js');await n(t,o,a);});var m=i.command("habits").description("Behavioral habits - practice tracking and compliance");m.command("list").alias("ls").description("List all configured habits").option("--trigger <trigger>","Filter by trigger: preflight, postflight, on-stop, on-commit").option("--category <category>","Filter by category: discovery, verification, testing, documentation, collaboration, security").option("--json","Output as JSON").action(async t=>{let{habitsListCommand:o}=await import('./habits-4J2KRYUL.js');await o(t);});m.command("status").description("Show practice profile with compliance rates").option("-p, --period <period>","Time period: 7d, 30d, 90d, all","30d").option("--json","Output as JSON").action(async t=>{let{habitsStatusCommand:o}=await import('./habits-4J2KRYUL.js');await o(t);});m.command("init").description("Initialize habits.yaml with seed habits").option("-f, --force","Overwrite existing file").action(async t=>{let{habitsInitCommand:o}=await import('./habits-4J2KRYUL.js');await o(t);});m.command("check").description("Evaluate habit compliance for a trigger point").requiredOption("-t, --trigger <trigger>","Trigger: preflight, postflight, on-stop, on-commit").option("--record","Record practice events to Sentinel").option("--json","Output as JSON").option("--files <files>","Comma-separated files modified (default: git diff)").option("--symbols <symbols>","Comma-separated symbols touched").action(async t=>{let{habitsCheckCommand:o}=await import('./habits-4J2KRYUL.js');await o(t);});m.command("add").description("Add a custom habit").requiredOption("--id <id>","Habit ID (kebab-case)").requiredOption("--name <name>","Human-readable name").requiredOption("--description <desc>","What this habit enforces").requiredOption("--category <category>","Category: discovery, verification, testing, documentation, collaboration, security").requiredOption("--trigger <trigger>","Trigger: preflight, postflight, on-stop, on-commit").option("--severity <severity>","Severity: advisory, warn, block","advisory").option("--tools <tools>","Comma-separated tools to check (for tool-called check type)").option("--check-type <type>","Check type: tool-called, file-exists, file-modified, lore-recorded, symbols-registered, gates-declared, tests-exist, git-clean","tool-called").option("--patterns <patterns>","Comma-separated patterns (for file-exists, file-modified, tests-exist check types)").action(async t=>{let{habitsAddCommand:o}=await import('./habits-4J2KRYUL.js');await o({...t,checkType:t.checkType});});m.command("edit <id>").description("Edit a habit (seed habits: only severity/enabled; custom: all fields)").option("--name <name>","New name").option("--description <desc>","New description").option("--category <category>","New category").option("--trigger <trigger>","New trigger").option("--severity <severity>","New severity: advisory, warn, block").option("--enabled <bool>","Enable or disable: true, false").option("--check-type <type>","New check type").option("--patterns <patterns>","Comma-separated patterns").option("--tools <tools>","Comma-separated tools").action(async(t,o)=>{let{habitsEditCommand:a}=await import('./habits-4J2KRYUL.js');await a(t,{...o,checkType:o.checkType});});m.command("remove <id>").description("Remove a custom habit (seed habits cannot be removed, only disabled)").option("-y, --yes","Skip confirmation").action(async(t,o)=>{let{habitsRemoveCommand:a}=await import('./habits-4J2KRYUL.js');await a(t,o);});m.command("enable <id>").description("Enable a habit").action(async t=>{let{habitsToggleCommand:o}=await import('./habits-4J2KRYUL.js');await o(t,"enable");});m.command("disable <id>").description("Disable a habit").action(async t=>{let{habitsToggleCommand:o}=await import('./habits-4J2KRYUL.js');await o(t,"disable");});m.action(async()=>{let{habitsListCommand:t}=await import('./habits-4J2KRYUL.js');await t({});});var R=i.command("graduate").description("Automation tier graduation \u2014 migrate habits to hooks");R.command("status",{isDefault:true}).description("Show current automation tier of every habit").option("--json","Output as JSON").action(async t=>{let{graduateStatusCommand:o}=await import('./graduate-3BBSC27A.js');await o(t);});R.command("promote <habitId>").description("Graduate a habit to hook tier (skip MCP evaluation)").action(async t=>{let{graduatePromoteCommand:o}=await import('./graduate-3BBSC27A.js');await o(t);});R.command("demote <habitId>").description("Demote a habit from hook back to habit tier").option("--cooldown <days>","Cooldown period in days before re-graduation","14").action(async(t,o)=>{let{graduateDemoteCommand:a}=await import('./graduate-3BBSC27A.js');await a(t,o);});var h=i.command("persona").description("Personas \u2014 actor-driven journey testing");h.command("list",{isDefault:true}).alias("ls").description("List all personas").option("--tag <tag>","Filter by tag").option("--trigger <type>","Filter by trigger type (root, invitation, signup, api)").option("--gate <gate>","Filter by gate usage").option("--json","Output as JSON").action(async t=>{let{personaListCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});h.command("show <id>").description("Show full persona detail").option("--json","Output as JSON").action(async(t,o)=>{let{personaShowCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("validate [id]").description("Validate persona schema and cross-references").option("--json","Output as JSON").action(async(t,o)=>{let{personaValidateCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("coverage").description("Coverage report \u2014 routes and gates with/without persona coverage").option("--json","Output as JSON").action(async t=>{let{personaCoverageCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});h.command("run <id>").description("Execute persona journey against a running server").requiredOption("--base-url <url>","Base URL (e.g. http://localhost:3000)").option("--dry-run","Show steps without making HTTP requests").option("--json","Output as JSON").action(async(t,o)=>{let{personaRunCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("affected <symbol>").description("Show which personas reference a given symbol (gate, flow, signal)").option("--json","Output as JSON").action(async(t,o)=>{let{personaAffectedCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("delete <id>").description("Delete a persona").action(async t=>{let{personaDeleteCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});var X=i.command("sentinel").description("Sentinel \u2014 semantic error monitoring");X.command("defend [path]",{isDefault:true}).description("Launch the Sentinel UI - unified codebase intelligence visualizer").option("-p, --port <port>","Port to run on","3838").option("--no-open","Don't open browser automatically").action(async(t,o)=>{let{sentinelCommand:a}=await import('./sentinel-HYAZ3CO5.js');await a(t,o);});i.command("conductor").description("Launch Paradigm Conductor \u2014 multimodal mission control for Claude Code sessions").option("--build","Force rebuild the native binary").option("--install","Install Conductor binary to ~/.paradigm/conductor/bin/").option("-v, --verbose","Show build output").action(async t=>{let{conductorCommand:o}=await import('./conductor-Y5IXELTL.js');await o(t);});var p=i.command("university").description("Per-project university - knowledge base, quizzes, learning paths & PLSAT certification");p.command("serve").description("Launch Paradigm University learning platform").option("-p, --port <port>","Port to run on","3839").option("--no-open","Don't open browser automatically").action(async t=>{let{universityServeCommand:o}=await import('./serve-OY6XYL7F.js');await o(void 0,t);});p.command("list").alias("ls").description("List university content").option("--type <type>","Filter by type: note, policy, guide, runbook, quiz, path").option("--tag <tag>","Filter by tag").option("--difficulty <level>","Filter by difficulty: beginner, intermediate, advanced").option("--symbol <symbol>","Filter by Paradigm symbol").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{universityListCommand:o}=await import('./list-5IUGP3ZB.js');await o(t);});p.command("add <type>").description("Create university content (note, policy, guide, runbook, quiz)").option("--title <title>","Content title (required)").option("--body <text>","Content body (markdown)").option("--tags <tags>","Comma-separated tags").option("--symbols <symbols>","Comma-separated Paradigm symbols").option("--difficulty <level>","Difficulty: beginner, intermediate, advanced").option("--minutes <n>","Estimated reading time in minutes").action(async(t,o)=>{let{universityAddCommand:a}=await import('./add-P76GEMGF.js');await a(t,o);});p.command("show <id>").description("Show a content item in full").option("--json","Output as JSON").action(async(t,o)=>{let{universityShowCommand:a}=await import('./show-BOAVWZPZ.js');await a(t,o);});p.command("quiz <id>").description("Take an interactive quiz in the terminal").action(async t=>{let{universityQuizCommand:o}=await import('./quiz-FE5UGAY2.js');await o(t);});p.command("status").description("Show university content overview and completion stats").option("--json","Output as JSON").action(async t=>{let{universityStatusCommand:o}=await import('./status-A37ECYNJ.js');await o(t);});p.command("validate").description("Validate university content integrity").option("--deep","Enable deep cross-reference checks against scan-index").option("--id <id>","Validate a specific content item").option("--json","Output as JSON").action(async t=>{let{universityValidateCommand:o}=await import('./validate-C6SMKGYD.js');await o(t);});p.option("-p, --port <port>","Port to run on","3839").option("--no-open","Don't open browser automatically").action(async t=>{let{universityServeCommand:o}=await import('./serve-OY6XYL7F.js');await o(void 0,t);});var D=i.command("docs").description("Auto-generated documentation from the symbol graph");D.command("serve").description("Launch interactive docs viewer in browser").option("-p, --port <port>","Port number (default: 3850)").option("--no-open","Do not open browser automatically").action(async t=>{let{docsServeCommand:o}=await import('./docs-RXPN6CK7.js');await o(t);});D.command("build").description("Build static documentation site").option("-o, --output <dir>","Output directory (default: from config or .paradigm/docs-site)").action(async t=>{let{docsBuildCommand:o}=await import('./docs-RXPN6CK7.js');await o(t);});D.action(async()=>{let{docsServeCommand:t}=await import('./docs-RXPN6CK7.js');await t({});});var f=i.command("pipeline").description("Spec pipeline \u2014 structured feature workflow with configurable gates");f.command("start <description>").description("Create a new pipeline for a feature").option("--template <template>","Pipeline template (add-feature, bug-fix, security-change, refactor)","add-feature").option("--gates <gates>","Custom gate modes: specify,plan,task,implement,validate").action(async(t,o)=>{let{pipelineStartCommand:a}=await import('./pipeline-MZUITRVN.js');await a(t,o);});f.command("status [feature]").description("Show pipeline status").action(async t=>{let{pipelineStatusCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("advance <feature>").description("Advance pipeline past current gate").action(async t=>{let{pipelineAdvanceCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("configure <feature>").description("Change gate mode on active pipeline").requiredOption("--stage <stage>","Stage to configure").requiredOption("--gate <gate>","New gate mode (auto, manual, sentinel)").option("--reason <reason>","Reason for change").action(async(t,o)=>{let{pipelineConfigureCommand:a}=await import('./pipeline-MZUITRVN.js');await a(t,o);});f.command("abort <feature>").description("Cancel a pipeline").action(async t=>{let{pipelineAbortCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("list").description("List all active pipelines").action(async()=>{let{pipelineListCommand:t}=await import('./pipeline-MZUITRVN.js');await t();});f.action(async()=>{let{pipelineListCommand:t}=await import('./pipeline-MZUITRVN.js');await t();});var e=i.command("symphony").description("Symphony \u2014 agent-to-agent messaging for multi-session collaboration");e.command("join").description("Join this session to the Symphony network").option("--remote <ip>","Connect to remote Symphony server").action(async t=>{let{symphonyJoinCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("leave").description("Remove this session from the Symphony network").action(async()=>{let{symphonyLeaveCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("whoami").description("Show this agent's identity and linked peers").action(async()=>{let{symphonyWhoamiCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("list").alias("ls").description("List all joined agents").option("--json","Output as JSON").action(async t=>{let{symphonyListCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("send <message>").description("Send a note to agents").option("--to <agent>","Send to specific agent (omit for broadcast)").option("--thread <id>","Reply to existing thread").action(async(t,o)=>{let{symphonySendCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("read").description("Show unread notes").action(async()=>{let{symphonyReadCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("inbox").description("Show unread notes (alias for read)").action(async()=>{let{symphonyReadCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("threads").description("List all threads").option("--json","Output as JSON").action(async t=>{let{symphonyThreadsCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("thread <id>").description("Show full thread conversation").action(async t=>{let{symphonyThreadCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("resolve <id>").description("Mark a thread as resolved").option("--decision <text>","Decision text to record").action(async(t,o)=>{let{symphonyResolveCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("status").description("Show Symphony network status").option("--json","Output as JSON").action(async t=>{let{symphonyStatusCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("serve").description("Start Symphony relay server for cross-machine networking").option("--port <port>","Port to listen on","3939").option("--public","Show connection string for internet access").action(async t=>{let{symphonyServeCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});var N=e.command("peers").description("Manage trusted remote peers");N.command("list",{isDefault:true}).description("List trusted peers and their agents").option("--json","Output as JSON").action(async t=>{let{symphonyPeersCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});N.command("revoke <id>").description("Revoke trust for a peer (disconnects immediately)").action(async t=>{let{symphonyPeersRevokeCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});N.command("forget").description("Clear all peer trust records").option("--force","Skip confirmation").action(async t=>{let{symphonyPeersForgetCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});N.action(async()=>{let{symphonyPeersCommand:t}=await import('./peers-P2KXU7ZK.js');await t({});});e.command("request <file>").description("Request a file from another agent").option("--from <agent>","Agent to request from").option("--reason <text>","Why this file is needed").action(async(t,o)=>{let{symphonyRequestCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("requests").description("List pending file requests").action(async()=>{let{symphonyRequestsCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("approve <id>").description("Approve a file request").option("--redact","Strip sensitive lines before sending").action(async(t,o)=>{let{symphonyApproveCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("deny <id>").description("Deny a file request").option("--reason <text>","Reason for denial").action(async(t,o)=>{let{symphonyDenyCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("watch").description("Watch inbox in real-time \u2014 zero AI tokens, pure file monitoring").option("--interval <ms>","Poll interval in milliseconds (default: 2000)").option("--thread <id>","Only show messages from this thread").option("--quiet","Minimal output \u2014 messages only, no header").action(async t=>{let{symphonyWatchCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.action(async()=>{let{symphonyStatusCommand:t}=await import('./symphony-QI63XL62.js');await t({});});var q=i.command("notebook").description("Agent notebook management \u2014 curated snippet libraries");q.command("list").alias("ls").description("List notebook entries").option("--agent <id>","Filter by agent ID").option("--json","Output as JSON").action(async t=>{let{notebookListCommand:o}=await import('./notebook-PE3JSYZI.js');await o(t);});q.command("show <id>").description("Show a specific notebook entry").option("--agent <id>","Agent ID").option("--json","Output as JSON").action(async(t,o)=>{let{notebookShowCommand:a}=await import('./notebook-PE3JSYZI.js');await a(t,o);});q.command("export").description("Export notebook entries").option("--agent <id>","Filter by agent ID").option("--format <format>","Output format: yaml or json (default: yaml)").action(async t=>{let{notebookExportCommand:o}=await import('./notebook-PE3JSYZI.js');await o(t);});q.action(async()=>{let{notebookListCommand:t}=await import('./notebook-PE3JSYZI.js');await t({});});var d=i.command("agent").description("Agent identity management \u2014 persistent profiles with expertise tracking");d.command("list").alias("ls").description("List all agent identity profiles").option("--json","Output as JSON").option("--global","Show only global profiles").option("--project","Show only project-level profiles").action(async t=>{let{agentListCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.command("show <id>").description("Show full agent profile with expertise table").option("--json","Output as JSON").action(async(t,o)=>{let{agentShowCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,o);});d.command("create <id>").description("Create a new .agent identity file").option("-r, --role <role>","Agent role description").option("-d, --description <desc>","Extended description").option("-g, --global","Create in global ~/.paradigm/agents/ (default)").option("--deny-paths <patterns>",'Comma-separated glob patterns to deny (e.g., ".env*,*.key")').action(async(t,o)=>{let{agentCreateCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,{...o,global:o.global!==false});});d.command("sync <id>").description("Bootstrap expertise from existing project lore").option("-n, --dry-run","Show what would change without writing").option("--json","Output as JSON").action(async(t,o)=>{let{agentSyncCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,o);});var J=d.command("roster").description("Manage per-project agent roster (.paradigm/roster.yaml)");J.command("init").description("Create a roster based on detected project type").option("-f, --force","Overwrite existing roster").option("--json","Output as JSON").action(async t=>{let{rosterInitCommand:o}=await import('./roster-FLRZ5J42.js');await o(t);});J.command("add <ids...>").description("Add one or more agents to the active roster").option("--json","Output as JSON").action(async(t,o)=>{let{rosterAddCommand:a}=await import('./roster-FLRZ5J42.js');await a(t,o);});J.command("remove <ids...>").description("Remove one or more agents from the active roster").option("--json","Output as JSON").action(async(t,o)=>{let{rosterRemoveCommand:a}=await import('./roster-FLRZ5J42.js');await a(t,o);});J.option("--json","Output as JSON").action(async t=>{let{rosterShowCommand:o}=await import('./roster-FLRZ5J42.js');await o(t);});d.command("bench <id>").description("Bench an agent \u2014 Maestro will skip it during orchestration").action(async t=>{let{agentBenchCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.command("activate <id>").description("Activate a benched agent \u2014 restore to Maestro orchestration").action(async t=>{let{agentActivateCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.action(async()=>{let{agentListCommand:t}=await import('./agent-UUTYOFTH.js');await t({});});i.command("compliance-check").description("Run all compliance checks (habits, drift, portal) in a single process").option("--json","Output as JSON").option("--auto-heal","Auto-heal drift violations").option("--trigger <event>","Trigger context (e.g., on-stop)","on-stop").option("--learn","Run postflight learning pass (convert session verdicts to journal entries)").action(async t=>{let{complianceCheckCommand:o}=await import('./compliance-GZ7UAOG3.js');await o(t);});i.parse();
|
|
16
|
+
`),console.log("Commands:"),console.log(" suggest <task> Suggest agents for a task based on triggers"),console.log("\nRun `paradigm team agents suggest --help` for options.\n");});s.action(async()=>{let{teamStatusCommand:t}=await import('./team-MKLPUTW7.js');await t(void 0,{});});var z=i.command("plugin").description("Plugin management commands");z.command("check").description("Check for updates to installed Claude Code plugins").option("-u, --update","Pull latest changes for all stale marketplace clones").action(async t=>{let{pluginCheckCommand:o}=await import('./check-THVGY4R5.js');await o(t);});z.action(async()=>{let{pluginCheckCommand:t}=await import('./check-THVGY4R5.js');await t({});});var k=i.command("workspace").description("Multi-project workspace commands");k.command("init").description("Create a .paradigm-workspace file from sibling projects").option("-n, --name <name>","Workspace name (default: directory name)").option("-f, --force","Overwrite existing workspace file").action(async t=>{let{workspaceInitCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});k.command("status").description("Show workspace member status and symbol counts").option("--json","Output as JSON").action(async t=>{let{workspaceStatusCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});k.command("reindex").description("Rebuild scan-index.json for all workspace members").option("-q, --quiet","Suppress progress output").action(async t=>{let{workspaceReindexCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});k.action(async()=>{let{workspaceStatusCommand:t}=await import('./workspace-2ODL5WLY.js');await t({});});i.command("doctor").description("Health check - validate Paradigm setup").option("--context","Run only context audit checks (CLAUDE.md quality)").action(async t=>{let{doctorCommand:o}=await import('./doctor-PA7EAJO2.js');await o(t);});i.command("integrity").description("Symbol integrity check \u2014 broken refs, duplicates, orphans, missing anchors").option("--json","Output machine-readable JSON").action(async t=>{let{integrityCommand:o}=await import('./integrity-UYDOOJDP.js');await o(t);});i.command("review").description("Automated two-stage review pipeline \u2014 spec compliance + code quality").option("--pr <number>","Review a PR via gh CLI").option("--ci","Exit 1 on blocking findings").option("--deep","Include code quality checks (eval, secrets, console.log)").option("--json","Output machine-readable JSON").action(async t=>{let{reviewCommand:o}=await import('./review-6UAH6V3R.js');await o(t);});i.command("sweep").description("Entropy detection and cleanup \u2014 find orphaned symbols, stale purpose files, phantom gates").option("--dry","Report only, no fixes applied").option("--skip-fix","Same as --dry").option("-q, --quiet","Minimal output").action(async t=>{let{sweepCommand:o}=await import('./sweep-HU74OPVW.js');await o(t);});var Q=i.command("drift").description("Aspect anchor drift detection");Q.command("check").description("Check aspect anchors for drift and auto-heal shifted anchors").option("--json","Output as JSON").option("--auto-heal","Auto-heal shifted anchors (default: true)").option("--no-auto-heal","Disable auto-healing").action(async t=>{let{driftCheckCommand:o}=await import('./drift-ILZE5BFJ.js');await o(t);});var I=i.command("global").description("Manage Global Brain (~/.paradigm/)");I.command("clean").description("Remove old files from ~/.paradigm/ (Global Brain rotation)").option("--older-than <duration>","Remove files older than duration (e.g., 90d, 30d, 7d)","90d").option("-n, --dry-run","Show what would be deleted without deleting").action(async t=>{let{globalCleanCommand:o}=await import('./global-C44FW4G2.js');await o(t);});I.action(()=>{I.outputHelp();});i.command("watch").description("Watch for changes and auto-sync IDE files").action(async()=>{let{watchCommand:t}=await import('./watch-LRM5XD46.js');await t();});i.command("summary").description("Generate .paradigm/project.md with project stats").action(async()=>{let{summaryCommand:t}=await import('./summary-ZJLQ6KHB.js');await t();});i.command("constellation [path]").alias("const").description("Generate .paradigm/constellation.json - symbol relationship graph for AI agents").option("-f, --format <format>","Output format: json or yaml","json").option("-o, --output <path>","Custom output path").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{constellationCommand:a}=await import('./constellation-CG7C4WFE.js');await a(t,o);});i.command("beacon [path]").description("Generate .paradigm/beacon.md - quick-start orientation for AI agents").option("-r, --refresh","Regenerate even if beacon exists").option("-o, --output <path>","Custom output path").option("--json","Output as JSON (for AI agent queries)").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{beaconCommand:a}=await import('./beacon-5QVYV5DF.js');await a(t,o);});i.command("ripple <symbol> [path]").description("Show change impact analysis for a symbol").option("-d, --depth <depth>","Analysis depth (default: 1)","1").option("--json","Output as JSON").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{rippleCommand:n}=await import('./ripple-ZGDITCGB.js');await n(t,o,a);});var b=i.command("thread").description("Session continuity - pass context between AI agent sessions");b.command("show [path]").alias("s").description("Show current thread").option("--json","Output as JSON (for AI agent queries)").action(async(t,o)=>{let{threadShowCommand:a}=await import('./thread-HFXK65D4.js');await a(t,o);});b.command("save <message> [path]").description("Save activity to the thread trail").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadSaveCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("todo <task> [path]").description("Add a loose end (unfinished task)").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadTodoCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("note <note> [path]").description("Add a breadcrumb (note for next agent)").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadNoteCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("clear [path]").description("Clear the thread").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{threadClearCommand:a}=await import('./thread-HFXK65D4.js');await a(t,o);});b.option("--json","Output as JSON (for AI agent queries)").action(async t=>{let{threadShowCommand:o}=await import('./thread-HFXK65D4.js');await o(void 0,t);});var j=i.command("echo").description("Error-to-symbol mapping - find related symbols for error codes");j.command("lookup <errorCode> [path]").alias("l").description("Look up an error code").option("--json","Output as JSON (for AI agent queries)").action(async(t,o,a)=>{let{echoCommand:n}=await import('./echo-UPTQUEDU.js');await n(t,o,a);});j.command("init [path]").description("Create .paradigm/echoes.yaml template").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{echoInitCommand:a}=await import('./echo-UPTQUEDU.js');await a(t,o);});j.command("list [path]").alias("ls").description("List all error mappings").action(async t=>{let{echoListCommand:o}=await import('./echo-UPTQUEDU.js');await o(t);});j.argument("[errorCode]","Error code to look up").option("--json","Output as JSON (for AI agent queries)").action(async(t,o)=>{if(t){let{echoCommand:a}=await import('./echo-UPTQUEDU.js');await a(t,void 0,o);}else {let{echoListCommand:a}=await import('./echo-UPTQUEDU.js');await a();}});var u=i.command("tutorial").description("Interactive tutorial system");u.command("start [path]").description("Start the tutorial").action(async t=>{let{tutorialStartCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("step [n] [path]").description("Show tutorial step").action(async(t,o)=>{let{tutorialStepCommand:a}=await import('./tutorial-UC6YQMNN.js');await a(o,t);});u.command("checkpoint [path]").description("Validate current checkpoint").action(async t=>{let{tutorialCheckpointCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("next [path]").description("Move to next step").action(async t=>{let{tutorialNextCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("status [path]").description("Show tutorial progress").action(async t=>{let{tutorialStatusCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("reset [path]").description("Reset tutorial to beginning").action(async t=>{let{tutorialResetCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("bugs [path]").description("List intentional bugs").action(async t=>{let{tutorialBugsCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});var w=i.command("mcp").description("MCP server configuration for AI clients");w.command("setup").description("Configure MCP server for detected AI clients").option("-c, --client <client>","Target client: cursor, claude-desktop, continue, cline, all").option("-f, --force","Overwrite existing config").option("--json","Output as JSON").option("--no-gitignore","Do not add config to .gitignore").action(async t=>{let{mcpSetupCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("status").description("Show MCP configuration status across clients").option("--json","Output as JSON").action(async t=>{let{mcpStatusCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("list").alias("ls").description("List all configured MCP servers across all clients").option("--json","Output as JSON").action(async t=>{let{mcpListCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("remove [server]").alias("rm").description("Remove MCP server from client configs").option("-c, --client <client>","Target client: cursor, claude-desktop, continue, cline, all").option("-f, --force","Skip confirmation").option("--json","Output as JSON").action(async(t,o)=>{let{mcpRemoveCommand:a}=await import('./setup-KPIMRZ4Q.js');await a(t,o);});w.command("use-dev").description("Switch MCP configs to use local dev build").option("-c, --client <client>","Target client: cursor, claude-desktop, claude-code, continue, cline").option("--json","Output as JSON").action(async t=>{let{mcpUseDevCommand:o}=await import('./switch-CTW4PDGI.js');await o(t);});w.command("use-prod").description("Switch MCP configs back to global production binary").option("-c, --client <client>","Target client: cursor, claude-desktop, claude-code, continue, cline").option("--json","Output as JSON").action(async t=>{let{mcpUseProdCommand:o}=await import('./switch-CTW4PDGI.js');await o(t);});w.action(async()=>{let{mcpSwitchStatusCommand:t}=await import('./switch-CTW4PDGI.js');await t({});});i.command("promote").description("Copy local build to production (~/.paradigm-cli/)").option("-f, --force","Create production directory if missing").option("--skip-build","Skip npm run build step").option("--json","Output as JSON").action(async t=>{let{promoteCommand:o}=await import('./promote-NJQDZBZA.js');await o(t);});var S=i.command("wisdom").description("Team wisdom - preferences, antipatterns, decisions, expertise");S.command("show [symbol]").description("Display wisdom for symbols or overview").option("--json","Output as JSON").action(async(t,o)=>{let{wisdomShowCommand:a}=await import('./wisdom-XZ3QKPNP.js');await a(t,o);});S.command("init").description("Initialize wisdom directory with templates").option("-f, --force","Overwrite existing files").action(async t=>{let{wisdomInitCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});S.command("add-antipattern").description("Add a new antipattern").requiredOption("--id <id>","Antipattern ID (e.g., api-001)").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--description <desc>","What NOT to do").requiredOption("--reason <reason>","Why this is bad").requiredOption("--alternative <alt>","What to do instead").action(async t=>{let{wisdomAddAntipatternCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});S.command("decide").description("Create a new decision record (ADR)").requiredOption("--id <id>","Decision ID (e.g., 001)").requiredOption("--title <title>","Decision title").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--context <context>","Context/problem").requiredOption("--decision <decision>","The decision made").option("--status <status>","Status: proposed, accepted","proposed").action(async t=>{let{wisdomDecideCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});S.command("expert [query]").description("Find experts for symbols or areas").option("--json","Output as JSON").action(async(t,o)=>{let{wisdomExpertCommand:a}=await import('./wisdom-XZ3QKPNP.js');await a(t,o);});S.option("--json","Output as JSON").action(async t=>{let{wisdomShowCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(void 0,t);});var y=i.command("history").description("Implementation history - tracking changes, validation, fragility");y.command("show [symbol]").description("Display history for symbols or overview").option("--json","Output as JSON").option("-l, --limit <number>","Number of entries","10").action(async(t,o)=>{let{historyShowCommand:a}=await import('./history-UW454SDP.js');await a(t,{...o,limit:parseInt(o.limit)});});y.command("init").description("Initialize history directory").option("-f, --force","Overwrite existing files").action(async t=>{let{historyInitCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("fragile").description("Show fragile symbols that need extra care").option("--json","Output as JSON").action(async t=>{let{historyFragileCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("reindex").description("Regenerate index from log").action(async()=>{let{historyReindexCommand:t}=await import('./history-UW454SDP.js');await t();});y.command("record").description("Record an implementation event").requiredOption("--type <type>","Type: implement, refactor, rollback").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--description <desc>","What was done").option("--intent <intent>","Intent: feature, fix, refactor").option("--commit <hash>","Git commit hash").option("--reason <reason>","Reason for rollback").action(async t=>{let{historyRecordCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("validate").description("Record a validation result").requiredOption("--result <result>","Result: pass, fail, partial").option("--ref <id>","Implementation ID being validated").option("--passed <n>","Tests passed").option("--failed <n>","Tests failed").action(async t=>{let{historyValidateCommand:o}=await import('./history-UW454SDP.js');await o({...t,passed:t.passed?parseInt(t.passed):void 0,failed:t.failed?parseInt(t.failed):void 0});});y.option("--json","Output as JSON").action(async t=>{let{historyShowCommand:o}=await import('./history-UW454SDP.js');await o(void 0,t);});var x=i.command("hooks").description("Git hooks for automatic history capture");x.command("install").description("Install git hooks, Claude Code hooks, and Cursor hooks").option("-f, --force","Overwrite existing hooks").option("--post-commit","Only install post-commit hook").option("--pre-push","Only install pre-push hook").option("--claude-code","Only install Claude Code hooks (stop + pre-commit)").option("--cursor","Only install Cursor hooks (.cursor/hooks.json)").option("--dry-run","Show what would be installed without making changes").action(async t=>{let{hooksInstallCommand:o}=await import('./hooks-XH52VGOU.js');await o(t);});x.command("uninstall").description("Remove paradigm hooks (git hooks, or --cursor for Cursor hooks)").option("--cursor","Remove Cursor hooks instead of git hooks").option("--dry-run","Show what would be removed without making changes").action(async t=>{let{hooksUninstallCommand:o}=await import('./hooks-XH52VGOU.js');await o(t);});x.command("status").description("Check git hooks status").action(async()=>{let{hooksStatusCommand:t}=await import('./hooks-XH52VGOU.js');await t();});x.action(async()=>{let{hooksStatusCommand:t}=await import('./hooks-XH52VGOU.js');await t();});var r=i.command("triage").description("Semantic error triage - incident management and pattern matching");r.command("list").alias("ls").description("List recent incidents with matched patterns").option("-l, --limit <number>","Maximum incidents to show","10").option("-s, --status <status>","Filter by status: open, investigating, resolved, wont-fix, all").option("--symbol <symbol>","Filter by symbol (e.g., @checkout, ^auth)").option("-e, --env <environment>","Filter by environment").option("--search <text>","Search in error messages").option("--from <date>","Filter from date (ISO format)").option("--to <date>","Filter to date (ISO format)").option("--json","Output as JSON").action(async t=>{let{triageListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("show <id>").description("Show full incident details").option("--timeline","Include flow timeline").option("--json","Output as JSON").action(async(t,o)=>{let{triageShowCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("resolve <id>").description("Mark incident as resolved").option("-p, --pattern <patternId>","Pattern that led to resolution").option("-c, --commit <hash>","Git commit hash of fix").option("--pr <url>","Pull request URL").option("-n, --notes <text>","Resolution notes").option("--wont-fix","Mark as will not fix").action(async(t,o)=>{let{triageResolveCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("note <id> <note>").description("Add a note to an incident").action(async(t,o)=>{let{triageNoteCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("link <id1> <id2>").description("Link two related incidents").action(async(t,o)=>{let{triageLinkCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});var g=r.command("patterns").description("Manage failure patterns");g.command("list").alias("ls").description("List all patterns").option("--source <source>","Filter by source: manual, suggested, imported, community").option("--min-confidence <score>","Minimum confidence score").option("--json","Output as JSON").action(async t=>{let{triagePatternsListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("show <id>").description("Show pattern details").option("--json","Output as JSON").action(async(t,o)=>{let{triagePatternsShowCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});g.command("add").description("Create a new pattern").requiredOption("--id <id>","Pattern ID (kebab-case)").requiredOption("--name <name>","Human-readable name").option("--description <text>","Pattern description").option("--symbols <pairs>",'Symbol criteria (e.g., "feature:@checkout,gate:^auth")').option("--error-contains <keywords>","Error keywords (comma-separated)").option("--missing-signals <signals>","Expected missing signals (comma-separated)").option("--strategy <strategy>","Resolution strategy: retry, fallback, fix-data, fix-code, ignore, escalate","fix-code").option("--priority <priority>","Priority: low, medium, high, critical","medium").option("--code-hint <text>","Code hint for resolution").option("--tags <tags>","Tags (comma-separated)").option("--from-incident <id>","Generate suggestion from incident").action(async t=>{let{triagePatternsAddCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("delete <id>").alias("rm").description("Delete a pattern").action(async t=>{let{triagePatternsDeleteCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("test <id>").description("Test pattern against historical incidents").option("-l, --limit <number>","Max incidents to test against","100").option("--json","Output as JSON").action(async(t,o)=>{let{triagePatternsTestCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});g.command("seed").description("Load built-in seed patterns").action(async()=>{let{triagePatternsSeedCommand:t}=await import('./triage-FCWOZASE.js');await t();});g.action(async()=>{let{triagePatternsListCommand:t}=await import('./triage-FCWOZASE.js');await t({});});r.command("export <type>").description("Export patterns or full backup (type: patterns, backup)").option("-o, --output <path>","Output file path").option("--include-private","Include private patterns").action(async(t,o)=>{let{triageExportCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("import <file>").description("Import patterns from JSON file").option("--overwrite","Overwrite existing patterns").action(async(t,o)=>{let{triageImportCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("restore <file>").description("Restore from full backup").action(async t=>{let{triageRestoreCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("stats").description("Show statistics dashboard").option("-p, --period <period>","Time period: 1d, 7d, 30d, 90d","7d").option("--symbol <symbol>","Show health for specific symbol").option("--json","Output as JSON").action(async t=>{let{triageStatsCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("record").description("Manually record an incident").requiredOption("--error <message>","Error message").requiredOption("-e, --env <environment>","Environment").option("--feature <symbol>","Feature symbol (@...)").option("--component <symbol>","Component symbol (#...)").option("--flow <symbol>","Flow symbol ($...)").option("--gate <symbol>","Gate symbol (^...)").option("--signal <symbol>","Signal symbol (!...)").option("--state <symbol>","State symbol (%...)").option("--integration <symbol>","Integration symbol (&...)").option("--service <name>","Service name").option("--version <version>","App version").option("--stack <trace>","Stack trace").option("--json","Output as JSON").action(async t=>{let{triageRecordCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.option("-l, --limit <number>","Maximum incidents to show","10").option("-s, --status <status>","Filter by status").option("--json","Output as JSON").action(async t=>{let{triageListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});var c=i.command("lore").description("Project lore - timeline of everything that happened to this project");c.command("list").alias("ls").description("List recent lore entries").option("--author <author>","Filter by author").option("--type <type>","Filter by type: agent-session, human-note, decision, review, incident, milestone, retro, insight").option("--symbol <symbol>","Filter by symbol").option("--tags <tags>","Filter by tags (comma-separated)").option("--from <date>","Filter from date (ISO format, e.g., 2026-02-20)").option("--to <date>","Filter to date (ISO format)").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{loreListCommand:o}=await import('./list-YKIQNKGB.js');await o(t);});c.command("show <id>").description("Show full detail for a lore entry").option("--json","Output as JSON").action(async(t,o)=>{let{loreShowCommand:a}=await import('./show-PJ5LFLIL.js');await a(t,o);});c.command("record").description("Record a new lore entry (human note, milestone, etc.)").option("--type <type>","Entry type: human-note, decision, milestone, retro, insight","human-note").option("--author <author>","Author name").option("--title <title>","Entry title").option("--summary <summary>","Entry summary").option("--symbols <symbols>","Comma-separated symbols").option("--tags <tags>","Comma-separated tags").option("--files-modified <files>","Comma-separated files modified").option("--files-created <files>","Comma-separated files created").option("--commit <hash>","Git commit hash").option("--learnings <items>","Comma-separated learnings").option("--duration <minutes>","Duration in minutes").option("--meta <json>",`Project-defined metadata as JSON (e.g., '{"sprint": 12}')`).option("--body <text>","Long-form content (detailed notes, rationale, etc.)").option("--link-lore <ids>","Comma-separated lore entry IDs to link").option("--link-commits <shas>","Comma-separated git commit SHAs to link").option("--confidence <number>","Confidence in correctness (0.0 to 1.0)").action(async t=>{let{loreRecordCommand:o}=await import('./record-YXPB34MY.js');await o(t);});c.command("review <id>").description("Add a review to a lore entry").option("--reviewer <name>","Reviewer name").option("--completeness <n>","Completeness score (1-5)","3").option("--quality <n>","Quality score (1-5)","3").option("--notes <text>","Review notes").action(async(t,o)=>{let{loreReviewCommand:a}=await import('./review-77QI6VOC.js');await a(t,o);});c.command("assess <id> <verdict>").description("Record an assessment verdict on a lore entry (correct/partial/incorrect)").option("--assessor <name>","Assessor name").option("--notes <text>","Assessment notes").action(async(t,o,a)=>{let{loreAssessCommand:n}=await import('./assess-UFPYEJKP.js');await n(t,o,a);});c.command("calibration").description("Show calibration statistics across assessed lore entries").option("--symbol <symbol>","Filter by symbol").option("--tag <tag>","Filter by tag").option("--author <author>","Filter by author").option("--group-by <dimension>","Group by: symbol, tag, type").option("--json","Output as JSON").action(async t=>{let{loreCalibrationCommand:o}=await import('./calibration-OLJYB5HN.js');await o(t);});c.command("edit <id>").description("Edit an existing lore entry").option("--title <title>","New title").option("--summary <summary>","New summary").option("--type <type>","New type: agent-session, human-note, decision, review, incident, milestone").option("--symbols <symbols>","Comma-separated symbols").option("--tags <tags>","Comma-separated tags").option("--learnings <items>","Comma-separated learnings").action(async(t,o)=>{let{loreEditCommand:a}=await import('./edit-GUU3HBVW.js');await a(t,o);});c.command("delete <id>").description("Delete a lore entry").option("-y, --yes","Skip confirmation").option("--dry-run","Show what would be deleted without making changes").action(async(t,o)=>{let{loreDeleteCommand:a}=await import('./delete-P5VULXR4.js');await a(t,o);});c.command("migrate-assessments").description("Migrate assessment entries to lore with arc: tags").option("--dry-run","Show what would be migrated without making changes").action(async t=>{let{loreMigrateAssessmentsCommand:o}=await import('./migrate-assessments-GEI5WMI2.js');await o(t);});c.command("retag").description("Add or remove tags from matching lore entries").option("--add <tag>","Tag to add").option("--remove <tag>","Tag to remove").option("--type <type>","Filter by entry type").option("--symbol <symbol>","Filter by symbol").option("--author <author>","Filter by author").option("--from <date>","Filter from date").option("--to <date>","Filter to date").option("--tags <tags>","Filter by existing tags (comma-separated)").option("--dry-run","Show what would change without making changes").action(async t=>{let{loreRetagCommand:o}=await import('./retag-N5XF3KXP.js');await o(t);});c.command("timeline").description("Show lore timeline grouped by date with hot symbols and authors").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{loreTimelineCommand:o}=await import('./timeline-K3ZFKJ3R.js');await o(t);});c.option("-p, --port <port>","Port to run on","3840").option("--no-open","Don't open browser automatically").action(async t=>{let{loreServeCommand:o}=await import('./serve-L52ZUTU6.js');await o(void 0,t);});i.command("serve").description("Launch Paradigm Platform \u2014 unified development management UI").option("-p, --port <port>","Port to run on","3850").option("--no-open","Don't open browser automatically").option("--sections <list>","Comma-separated sections to enable (e.g., lore,graph,git)").action(async t=>{let{serveCommand:o}=await import('./serve-JE6UF5P2.js');await o(t);});var K=i.command("graph").description("Interactive symbol relationship graph").argument("[path]","Project directory",void 0).option("-p, --port <port>","Port to run on","3841").option("--no-open","Don't open browser automatically").action(async(t,o)=>{let{graphCommand:a}=await import('./graph-CNDE5TAT.js');await a(t,o);});K.command("generate").description("Generate a named graph file in .paradigm/graphs/").argument("<name>","Graph name (used as filename: {name}.graph.json)").argument("[path]","Project directory",void 0).option("-s, --symbols <list>","Comma-separated symbol names to include").option("-g, --group <spec...>",'Group spec: "Label:#sym1,#sym2" (repeatable)').option("-l, --link <spec...>",'Link spec: "Source>Target:label" (repeatable)').action(async(t,o,a)=>{let{graphGenerateCommand:n}=await import('./graph-CNDE5TAT.js');await n(t,o,a);});var m=i.command("habits").description("Behavioral habits - practice tracking and compliance");m.command("list").alias("ls").description("List all configured habits").option("--trigger <trigger>","Filter by trigger: preflight, postflight, on-stop, on-commit").option("--category <category>","Filter by category: discovery, verification, testing, documentation, collaboration, security").option("--json","Output as JSON").action(async t=>{let{habitsListCommand:o}=await import('./habits-4J2KRYUL.js');await o(t);});m.command("status").description("Show practice profile with compliance rates").option("-p, --period <period>","Time period: 7d, 30d, 90d, all","30d").option("--json","Output as JSON").action(async t=>{let{habitsStatusCommand:o}=await import('./habits-4J2KRYUL.js');await o(t);});m.command("init").description("Initialize habits.yaml with seed habits").option("-f, --force","Overwrite existing file").action(async t=>{let{habitsInitCommand:o}=await import('./habits-4J2KRYUL.js');await o(t);});m.command("check").description("Evaluate habit compliance for a trigger point").requiredOption("-t, --trigger <trigger>","Trigger: preflight, postflight, on-stop, on-commit").option("--record","Record practice events to Sentinel").option("--json","Output as JSON").option("--files <files>","Comma-separated files modified (default: git diff)").option("--symbols <symbols>","Comma-separated symbols touched").action(async t=>{let{habitsCheckCommand:o}=await import('./habits-4J2KRYUL.js');await o(t);});m.command("add").description("Add a custom habit").requiredOption("--id <id>","Habit ID (kebab-case)").requiredOption("--name <name>","Human-readable name").requiredOption("--description <desc>","What this habit enforces").requiredOption("--category <category>","Category: discovery, verification, testing, documentation, collaboration, security").requiredOption("--trigger <trigger>","Trigger: preflight, postflight, on-stop, on-commit").option("--severity <severity>","Severity: advisory, warn, block","advisory").option("--tools <tools>","Comma-separated tools to check (for tool-called check type)").option("--check-type <type>","Check type: tool-called, file-exists, file-modified, lore-recorded, symbols-registered, gates-declared, tests-exist, git-clean","tool-called").option("--patterns <patterns>","Comma-separated patterns (for file-exists, file-modified, tests-exist check types)").action(async t=>{let{habitsAddCommand:o}=await import('./habits-4J2KRYUL.js');await o({...t,checkType:t.checkType});});m.command("edit <id>").description("Edit a habit (seed habits: only severity/enabled; custom: all fields)").option("--name <name>","New name").option("--description <desc>","New description").option("--category <category>","New category").option("--trigger <trigger>","New trigger").option("--severity <severity>","New severity: advisory, warn, block").option("--enabled <bool>","Enable or disable: true, false").option("--check-type <type>","New check type").option("--patterns <patterns>","Comma-separated patterns").option("--tools <tools>","Comma-separated tools").action(async(t,o)=>{let{habitsEditCommand:a}=await import('./habits-4J2KRYUL.js');await a(t,{...o,checkType:o.checkType});});m.command("remove <id>").description("Remove a custom habit (seed habits cannot be removed, only disabled)").option("-y, --yes","Skip confirmation").action(async(t,o)=>{let{habitsRemoveCommand:a}=await import('./habits-4J2KRYUL.js');await a(t,o);});m.command("enable <id>").description("Enable a habit").action(async t=>{let{habitsToggleCommand:o}=await import('./habits-4J2KRYUL.js');await o(t,"enable");});m.command("disable <id>").description("Disable a habit").action(async t=>{let{habitsToggleCommand:o}=await import('./habits-4J2KRYUL.js');await o(t,"disable");});m.action(async()=>{let{habitsListCommand:t}=await import('./habits-4J2KRYUL.js');await t({});});var R=i.command("graduate").description("Automation tier graduation \u2014 migrate habits to hooks");R.command("status",{isDefault:true}).description("Show current automation tier of every habit").option("--json","Output as JSON").action(async t=>{let{graduateStatusCommand:o}=await import('./graduate-3BBSC27A.js');await o(t);});R.command("promote <habitId>").description("Graduate a habit to hook tier (skip MCP evaluation)").action(async t=>{let{graduatePromoteCommand:o}=await import('./graduate-3BBSC27A.js');await o(t);});R.command("demote <habitId>").description("Demote a habit from hook back to habit tier").option("--cooldown <days>","Cooldown period in days before re-graduation","14").action(async(t,o)=>{let{graduateDemoteCommand:a}=await import('./graduate-3BBSC27A.js');await a(t,o);});var h=i.command("persona").description("Personas \u2014 actor-driven journey testing");h.command("list",{isDefault:true}).alias("ls").description("List all personas").option("--tag <tag>","Filter by tag").option("--trigger <type>","Filter by trigger type (root, invitation, signup, api)").option("--gate <gate>","Filter by gate usage").option("--json","Output as JSON").action(async t=>{let{personaListCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});h.command("show <id>").description("Show full persona detail").option("--json","Output as JSON").action(async(t,o)=>{let{personaShowCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("validate [id]").description("Validate persona schema and cross-references").option("--json","Output as JSON").action(async(t,o)=>{let{personaValidateCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("coverage").description("Coverage report \u2014 routes and gates with/without persona coverage").option("--json","Output as JSON").action(async t=>{let{personaCoverageCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});h.command("run <id>").description("Execute persona journey against a running server").requiredOption("--base-url <url>","Base URL (e.g. http://localhost:3000)").option("--dry-run","Show steps without making HTTP requests").option("--json","Output as JSON").action(async(t,o)=>{let{personaRunCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("affected <symbol>").description("Show which personas reference a given symbol (gate, flow, signal)").option("--json","Output as JSON").action(async(t,o)=>{let{personaAffectedCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("delete <id>").description("Delete a persona").action(async t=>{let{personaDeleteCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});var X=i.command("sentinel").description("Sentinel \u2014 semantic error monitoring");X.command("defend [path]",{isDefault:true}).description("Launch the Sentinel UI - unified codebase intelligence visualizer").option("-p, --port <port>","Port to run on","3838").option("--no-open","Don't open browser automatically").action(async(t,o)=>{let{sentinelCommand:a}=await import('./sentinel-HYAZ3CO5.js');await a(t,o);});i.command("conductor").description("Launch Paradigm Conductor \u2014 multimodal mission control for Claude Code sessions").option("--build","Force rebuild the native binary").option("--install","Install Conductor binary to ~/.paradigm/conductor/bin/").option("-v, --verbose","Show build output").action(async t=>{let{conductorCommand:o}=await import('./conductor-Y5IXELTL.js');await o(t);});var p=i.command("university").description("Per-project university - knowledge base, quizzes, learning paths & PLSAT certification");p.command("serve").description("Launch Paradigm University learning platform").option("-p, --port <port>","Port to run on","3839").option("--no-open","Don't open browser automatically").action(async t=>{let{universityServeCommand:o}=await import('./serve-OY6XYL7F.js');await o(void 0,t);});p.command("list").alias("ls").description("List university content").option("--type <type>","Filter by type: note, policy, guide, runbook, quiz, path").option("--tag <tag>","Filter by tag").option("--difficulty <level>","Filter by difficulty: beginner, intermediate, advanced").option("--symbol <symbol>","Filter by Paradigm symbol").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{universityListCommand:o}=await import('./list-5IUGP3ZB.js');await o(t);});p.command("add <type>").description("Create university content (note, policy, guide, runbook, quiz)").option("--title <title>","Content title (required)").option("--body <text>","Content body (markdown)").option("--tags <tags>","Comma-separated tags").option("--symbols <symbols>","Comma-separated Paradigm symbols").option("--difficulty <level>","Difficulty: beginner, intermediate, advanced").option("--minutes <n>","Estimated reading time in minutes").action(async(t,o)=>{let{universityAddCommand:a}=await import('./add-P76GEMGF.js');await a(t,o);});p.command("show <id>").description("Show a content item in full").option("--json","Output as JSON").action(async(t,o)=>{let{universityShowCommand:a}=await import('./show-BOAVWZPZ.js');await a(t,o);});p.command("quiz <id>").description("Take an interactive quiz in the terminal").action(async t=>{let{universityQuizCommand:o}=await import('./quiz-FE5UGAY2.js');await o(t);});p.command("status").description("Show university content overview and completion stats").option("--json","Output as JSON").action(async t=>{let{universityStatusCommand:o}=await import('./status-A37ECYNJ.js');await o(t);});p.command("validate").description("Validate university content integrity").option("--deep","Enable deep cross-reference checks against scan-index").option("--id <id>","Validate a specific content item").option("--json","Output as JSON").action(async t=>{let{universityValidateCommand:o}=await import('./validate-C6SMKGYD.js');await o(t);});p.option("-p, --port <port>","Port to run on","3839").option("--no-open","Don't open browser automatically").action(async t=>{let{universityServeCommand:o}=await import('./serve-OY6XYL7F.js');await o(void 0,t);});var D=i.command("docs").description("Auto-generated documentation from the symbol graph");D.command("serve").description("Launch interactive docs viewer in browser").option("-p, --port <port>","Port number (default: 3850)").option("--no-open","Do not open browser automatically").action(async t=>{let{docsServeCommand:o}=await import('./docs-RXPN6CK7.js');await o(t);});D.command("build").description("Build static documentation site").option("-o, --output <dir>","Output directory (default: from config or .paradigm/docs-site)").action(async t=>{let{docsBuildCommand:o}=await import('./docs-RXPN6CK7.js');await o(t);});D.action(async()=>{let{docsServeCommand:t}=await import('./docs-RXPN6CK7.js');await t({});});var f=i.command("pipeline").description("Spec pipeline \u2014 structured feature workflow with configurable gates");f.command("start <description>").description("Create a new pipeline for a feature").option("--template <template>","Pipeline template (add-feature, bug-fix, security-change, refactor)","add-feature").option("--gates <gates>","Custom gate modes: specify,plan,task,implement,validate").action(async(t,o)=>{let{pipelineStartCommand:a}=await import('./pipeline-MZUITRVN.js');await a(t,o);});f.command("status [feature]").description("Show pipeline status").action(async t=>{let{pipelineStatusCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("advance <feature>").description("Advance pipeline past current gate").action(async t=>{let{pipelineAdvanceCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("configure <feature>").description("Change gate mode on active pipeline").requiredOption("--stage <stage>","Stage to configure").requiredOption("--gate <gate>","New gate mode (auto, manual, sentinel)").option("--reason <reason>","Reason for change").action(async(t,o)=>{let{pipelineConfigureCommand:a}=await import('./pipeline-MZUITRVN.js');await a(t,o);});f.command("abort <feature>").description("Cancel a pipeline").action(async t=>{let{pipelineAbortCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("list").description("List all active pipelines").action(async()=>{let{pipelineListCommand:t}=await import('./pipeline-MZUITRVN.js');await t();});f.action(async()=>{let{pipelineListCommand:t}=await import('./pipeline-MZUITRVN.js');await t();});var e=i.command("symphony").description("Symphony \u2014 agent-to-agent messaging for multi-session collaboration");e.command("join").description("Join this session to the Symphony network").option("--remote <ip>","Connect to remote Symphony server").action(async t=>{let{symphonyJoinCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("leave").description("Remove this session from the Symphony network").action(async()=>{let{symphonyLeaveCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("whoami").description("Show this agent's identity and linked peers").action(async()=>{let{symphonyWhoamiCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("list").alias("ls").description("List all joined agents").option("--json","Output as JSON").action(async t=>{let{symphonyListCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("send <message>").description("Send a note to agents").option("--to <agent>","Send to specific agent (omit for broadcast)").option("--thread <id>","Reply to existing thread").action(async(t,o)=>{let{symphonySendCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("read").description("Show unread notes").action(async()=>{let{symphonyReadCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("inbox").description("Show unread notes (alias for read)").action(async()=>{let{symphonyReadCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("threads").description("List all threads").option("--json","Output as JSON").action(async t=>{let{symphonyThreadsCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("thread <id>").description("Show full thread conversation").action(async t=>{let{symphonyThreadCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("resolve <id>").description("Mark a thread as resolved").option("--decision <text>","Decision text to record").action(async(t,o)=>{let{symphonyResolveCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("status").description("Show Symphony network status").option("--json","Output as JSON").action(async t=>{let{symphonyStatusCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.command("serve").description("Start Symphony relay server for cross-machine networking").option("--port <port>","Port to listen on","3939").option("--public","Show connection string for internet access").action(async t=>{let{symphonyServeCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});var N=e.command("peers").description("Manage trusted remote peers");N.command("list",{isDefault:true}).description("List trusted peers and their agents").option("--json","Output as JSON").action(async t=>{let{symphonyPeersCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});N.command("revoke <id>").description("Revoke trust for a peer (disconnects immediately)").action(async t=>{let{symphonyPeersRevokeCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});N.command("forget").description("Clear all peer trust records").option("--force","Skip confirmation").action(async t=>{let{symphonyPeersForgetCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});N.action(async()=>{let{symphonyPeersCommand:t}=await import('./peers-P2KXU7ZK.js');await t({});});e.command("request <file>").description("Request a file from another agent").option("--from <agent>","Agent to request from").option("--reason <text>","Why this file is needed").action(async(t,o)=>{let{symphonyRequestCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("requests").description("List pending file requests").action(async()=>{let{symphonyRequestsCommand:t}=await import('./symphony-QI63XL62.js');await t();});e.command("approve <id>").description("Approve a file request").option("--redact","Strip sensitive lines before sending").action(async(t,o)=>{let{symphonyApproveCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("deny <id>").description("Deny a file request").option("--reason <text>","Reason for denial").action(async(t,o)=>{let{symphonyDenyCommand:a}=await import('./symphony-QI63XL62.js');await a(t,o);});e.command("watch").description("Watch inbox in real-time \u2014 zero AI tokens, pure file monitoring").option("--interval <ms>","Poll interval in milliseconds (default: 2000)").option("--thread <id>","Only show messages from this thread").option("--quiet","Minimal output \u2014 messages only, no header").action(async t=>{let{symphonyWatchCommand:o}=await import('./symphony-QI63XL62.js');await o(t);});e.action(async()=>{let{symphonyStatusCommand:t}=await import('./symphony-QI63XL62.js');await t({});});var q=i.command("notebook").description("Agent notebook management \u2014 curated snippet libraries");q.command("list").alias("ls").description("List notebook entries").option("--agent <id>","Filter by agent ID").option("--json","Output as JSON").action(async t=>{let{notebookListCommand:o}=await import('./notebook-PE3JSYZI.js');await o(t);});q.command("show <id>").description("Show a specific notebook entry").option("--agent <id>","Agent ID").option("--json","Output as JSON").action(async(t,o)=>{let{notebookShowCommand:a}=await import('./notebook-PE3JSYZI.js');await a(t,o);});q.command("export").description("Export notebook entries").option("--agent <id>","Filter by agent ID").option("--format <format>","Output format: yaml or json (default: yaml)").action(async t=>{let{notebookExportCommand:o}=await import('./notebook-PE3JSYZI.js');await o(t);});q.action(async()=>{let{notebookListCommand:t}=await import('./notebook-PE3JSYZI.js');await t({});});var d=i.command("agent").description("Agent identity management \u2014 persistent profiles with expertise tracking");d.command("list").alias("ls").description("List all agent identity profiles").option("--json","Output as JSON").option("--global","Show only global profiles").option("--project","Show only project-level profiles").action(async t=>{let{agentListCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.command("show <id>").description("Show full agent profile with expertise table").option("--json","Output as JSON").action(async(t,o)=>{let{agentShowCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,o);});d.command("create <id>").description("Create a new .agent identity file").option("-r, --role <role>","Agent role description").option("-d, --description <desc>","Extended description").option("-g, --global","Create in global ~/.paradigm/agents/ (default)").option("--deny-paths <patterns>",'Comma-separated glob patterns to deny (e.g., ".env*,*.key")').action(async(t,o)=>{let{agentCreateCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,{...o,global:o.global!==false});});d.command("sync <id>").description("Bootstrap expertise from existing project lore").option("-n, --dry-run","Show what would change without writing").option("--json","Output as JSON").action(async(t,o)=>{let{agentSyncCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,o);});var J=d.command("roster").description("Manage per-project agent roster (.paradigm/roster.yaml)");J.command("init").description("Create a roster based on detected project type").option("-f, --force","Overwrite existing roster").option("--json","Output as JSON").action(async t=>{let{rosterInitCommand:o}=await import('./roster-FLRZ5J42.js');await o(t);});J.command("add <ids...>").description("Add one or more agents to the active roster").option("--json","Output as JSON").action(async(t,o)=>{let{rosterAddCommand:a}=await import('./roster-FLRZ5J42.js');await a(t,o);});J.command("remove <ids...>").description("Remove one or more agents from the active roster").option("--json","Output as JSON").action(async(t,o)=>{let{rosterRemoveCommand:a}=await import('./roster-FLRZ5J42.js');await a(t,o);});J.option("--json","Output as JSON").action(async t=>{let{rosterShowCommand:o}=await import('./roster-FLRZ5J42.js');await o(t);});d.command("bench <id>").description("Bench an agent \u2014 Maestro will skip it during orchestration").action(async t=>{let{agentBenchCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.command("activate <id>").description("Activate a benched agent \u2014 restore to Maestro orchestration").action(async t=>{let{agentActivateCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.action(async()=>{let{agentListCommand:t}=await import('./agent-UUTYOFTH.js');await t({});});i.command("compliance-check").description("Run all compliance checks (habits, drift, portal) in a single process").option("--json","Output as JSON").option("--auto-heal","Auto-heal drift violations").option("--trigger <event>","Trigger context (e.g., on-stop)","on-stop").option("--learn","Run postflight learning pass (convert session verdicts to journal entries)").action(async t=>{let{complianceCheckCommand:o}=await import('./compliance-33HC4D5Z.js');await o(t);});i.parse();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,b}from'./chunk-
|
|
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(`
|
|
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,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {d,e}from'./chunk-
|
|
2
|
+
import {d,e}from'./chunk-SHD27BQX.js';import'./chunk-5TAVYPOV.js';import n from'chalk';async function c(l){let s=process.cwd(),e$1=await d(s);if(l.json)console.log(JSON.stringify({status:e$1.status,declaredButUnusedCount:e$1.declaredButUnused.length,usedButUndeclaredCount:e$1.usedButUndeclared.length,properlyDeclaredCount:e$1.properlyDeclared.length,declaredButUnused:e$1.declaredButUnused,usedButUndeclared:e$1.usedButUndeclared,properlyDeclared:e$1.properlyDeclared}));else {let o=e(e$1);e$1.status==="compliant"?console.log(n.green(`
|
|
3
3
|
${o}
|
|
4
4
|
`)):e$1.status==="warnings"?console.log(n.yellow(`
|
|
5
5
|
${o}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{d as checkPortalCompliance,b as extractDeclaredGates,c as findGateReferences,e as formatComplianceReport,f as getComplianceSummary,a as loadPortalConfig}from'./chunk-
|
|
2
|
+
export{d as checkPortalCompliance,b as extractDeclaredGates,c as findGateReferences,e as formatComplianceReport,f as getComplianceSummary,a as loadPortalConfig}from'./chunk-SHD27BQX.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {b}from'./chunk-
|
|
2
|
+
import {b}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 {d as d$2}from'./chunk-AO7ZSRME.js';import'./chunk-Y4XFVDZC.js';import {a as a$5}from'./chunk-Z2UZUCY6.js';import {d as d$1}from'./chunk-W5IWDW4Y.js';import {a as a$3,b as b$1}from'./chunk-AGVAHVUA.js';import'./chunk-SHD27BQX.js';import {a as a$6}from'./chunk-UONPO7SC.js';import'./chunk-EKZDFEJW.js';import {a as a$1}from'./chunk-33LKBMVK.js';import {b as b$2}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$4}from'./chunk-QNZEG7IT.js';import'./chunk-HMQ5BHP2.js';import'./chunk-JQKKVAAN.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as r from'fs';import*as n from'path';import e from'chalk';import U from'ora';import*as d from'js-yaml';async function te(l={}){let s=process.cwd(),h=n.basename(s),u=n.join(s,".paradigm"),k=r.existsSync(u)&&r.statSync(u).isDirectory();console.log(e.blue(`
|
|
3
3
|
\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
|
|
4
4
|
`)),console.log(e.white(` \u{1F4C1} Project: ${e.cyan(h)}`)),console.log(e.white(` \u{1F4CD} Status: ${k?e.green("Paradigm detected"):e.yellow("New project")}`)),console.log("");let j=a.command("shift").start("Running paradigm shift",{project:h}),i=U();if(!k||l.force){i.start("Step 1/6: Initializing Paradigm...");try{await a$1({force:l.force,quick:!0,name:h,stack:l.stack}),i.succeed(e.green("Paradigm initialized"));}catch(t){i.fail(e.red(`Init failed: ${t.message}`)),j.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=n.join(u,"config.yaml");if(r.existsSync(t))try{let o=r.readFileSync(t,"utf8"),a=d.load(o);if(!a.discipline||a.discipline==="auto"){let c=a$2(s);if(c!=="backend"){let f=o.replace(/^discipline:\s*auto\b.*$/m,`discipline: ${c}`);f!==o&&(r.writeFileSync(t,f,"utf8"),console.log(e.green(` \u2713 Detected discipline: ${e.cyan(c)} (updated config.yaml)`)));}else if(!a.discipline){let f=o.replace(/^(project:\s*.+)$/m,`$1
|
|
5
5
|
discipline: ${c}`);f!==o&&(r.writeFileSync(t,f,"utf8"),console.log(e.green(` \u2713 Added discipline: ${e.cyan(c)} to config.yaml`)));}}}catch(o){a.operation("shift").debug("Discipline detection failed",{error:o.message});}}if(k){i.start("Step 1b/6: Checking for migrations...");try{let{migrateCommand:t}=await import('./migrate-X5OMAFAQ.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=n.join(u,"config.yaml");if(l.workspace&&r.existsSync(t)){let o=l.workspacePath?n.resolve(s,l.workspacePath):n.join(n.dirname(s),".paradigm-workspace");if(r.existsSync(o))try{let a=d.load(r.readFileSync(o,"utf8")),c=n.basename(s),f=n.dirname(o),g="./"+n.relative(f,s);if(a.members.some(y=>n.resolve(f,y.path)===s))console.log(e.green(` \u2713 Already a member of workspace: ${e.cyan(a.name)}`));else {let y=d$1(c,s);a.members.push({name:c,path:g,...y&&{role:y}}),r.writeFileSync(o,d.dump(a,{indent:2,lineWidth:120,noRefs:!0,sortKeys:!1,quotingType:'"'}),"utf8"),console.log(e.green(` \u2713 Joined workspace: ${e.cyan(a.name)} (added as member)`));}}catch(a){console.log(e.yellow(` \u26A0 Failed to join workspace: ${a.message}`));}else try{let a=n.basename(s),c=n.dirname(o),f="./"+n.relative(c,s),g=d$1(a,s),p={version:"1.0",name:l.workspace,members:[{name:a,path:f,...g&&{role:g}}]};r.mkdirSync(n.dirname(o),{recursive:!0}),r.writeFileSync(o,d.dump(p,{indent:2,lineWidth:120,noRefs:!0,sortKeys:!1,quotingType:'"'}),"utf8"),console.log(e.green(` \u2713 Created workspace: ${e.cyan(l.workspace)} at ${e.gray(n.relative(s,o))}`));}catch(a){console.log(e.yellow(` \u26A0 Failed to create workspace: ${a.message}`));}try{let a=r.readFileSync(t,"utf8"),c=d.load(a),f=n.relative(s,o);if(c.workspace!==f){if(c.workspace){let g=a.replace(/^workspace:\s*.*$/m,`workspace: "${f}"`);r.writeFileSync(t,g,"utf8");}else {let g=a.trimEnd()+`
|
|
@@ -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-
|
|
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';
|
package/package.json
CHANGED
package/dist/chunk-NW6OKHE6.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import*as y from'fs';import*as h from'path';import*as R from'js-yaml';import {execFileSync}from'child_process';var A=["node_modules",".git","dist","build","coverage",".paradigm","vendor","__pycache__",".next","target"];function S(e){let t=h.join(e,"portal.yaml");if(!y.existsSync(t))return null;try{let n=y.readFileSync(t,"utf-8");return R.load(n)}catch{return null}}function B(e){let t=new Set;if(e.gates)for(let n of Object.keys(e.gates)){let s=n.startsWith("^")?n.slice(1):n;t.add(s);}if(e.routes)for(let n of Object.values(e.routes)){let s=Array.isArray(n)?n:n.gates||[];for(let r of s){let a=r.startsWith("^")?r.slice(1):r;t.add(a);}}return Array.from(t)}function P(e){let t=new Set;if(e.routes)for(let n of Object.values(e.routes)){let s=Array.isArray(n)?n:n.gates||[];for(let r of s){let a=r.startsWith("^")?r.slice(1):r;t.add(a);}}return t}function x(e,t){let n={encoding:"utf-8",maxBuffer:10485760,stdio:["ignore","pipe","pipe"]};try{let i=["-n","--no-ignore-vcs",...A.flatMap(l=>["--glob",`!${l}/**`]),"--engine","auto",t,e];return execFileSync("rg",i,n)}catch{}let r=["-rn",...A.map(a=>`--exclude-dir=${a}`),"-E",t,"--",e];try{return execFileSync("grep",r,n)}catch(a){return a?.code===1||a?.status===1,""}}function $(e){let t=[],s=x(e,"\\^[a-zA-Z][a-zA-Z0-9_-]+");for(let a of s.split(`
|
|
3
|
-
`).filter(Boolean)){let i=a.match(/^(.+?):(\d+):(.*)$/);if(i){let[,l,d,u]=i,g=u.match(/\^([a-zA-Z][a-zA-Z0-9_-]+)/);g&&t.push({gate:g[1],file:h.relative(e,l),line:parseInt(d,10),context:u.trim().slice(0,100),matchType:"symbol"});}}let r=[{pattern:`checkGate\\s*\\(['"]([^'"]+)['"]`,type:"function"},{pattern:`requireGate\\s*\\(['"]([^'"]+)['"]`,type:"function"},{pattern:`gate:\\s*['"]([^'"]+)['"]`,type:"config"},{pattern:`@Gate\\s*\\(['"]?([^'"\\)]+)['"]?\\)`,type:"function"}];for(let{pattern:a,type:i}of r){let l=x(e,a);for(let d of l.split(`
|
|
4
|
-
`).filter(Boolean)){let u=d.match(/^(.+?):(\d+):(.*)$/);if(u){let[,g,f,m]=u,c=m.match(new RegExp(a));if(c&&c[1]){let p=c[1].startsWith("^")?c[1].slice(1):c[1];t.push({gate:p,file:h.relative(e,g),line:parseInt(f,10),context:m.trim().slice(0,100),matchType:i});}}}}return t}function b(e){return [...new Set(e.map(t=>t.gate))]}async function w(e){let t=S(e);if(!t){let o=$(e),U=b(o);return U.length===0?{status:"compliant",declaredButUnused:[],routeAttachedUnused:[],orphanUnused:[],usedButUndeclared:[],properlyDeclared:[],suggestions:["No portal.yaml found, and no gate references detected in code."],references:[]}:{status:"violations",declaredButUnused:[],routeAttachedUnused:[],orphanUnused:[],usedButUndeclared:U,properlyDeclared:[],suggestions:["Gate references found in code but no portal.yaml exists.","Create a portal.yaml file to declare these gates:",...U.map(C=>` - ^${C}`),"","Run: paradigm portal init"],references:o}}let n=B(t),s=P(t),r=$(e),a=b(r),i=new Set(n),l=new Set(a),d=n.filter(o=>!l.has(o)),u=d.filter(o=>s.has(o)),g=d.filter(o=>!s.has(o)),f=a.filter(o=>!i.has(o)),m=n.filter(o=>l.has(o)),c=[];if(u.length>0){c.push("Gates documented on routes but no checkGate/requireGate in code:");for(let o of u)c.push(` - ^${o} (documented on routes; if enforced by middleware, this may be intentional)`);c.push("");}if(g.length>0){c.push("Orphan gates (declared but never on a route or in code):");for(let o of g)c.push(` - ^${o} (add to a route or remove from portal.yaml)`);c.push("");}if(f.length>0){c.push("Gates used in code but not declared in portal.yaml:");for(let o of f)c.push(` - ^${o} (add to portal.yaml with proper definition)`);c.push("");}let p="compliant";return f.length>0?p="violations":d.length>0&&(p="warnings"),{status:p,declaredButUnused:d,routeAttachedUnused:u,orphanUnused:g,usedButUndeclared:f,properlyDeclared:m,suggestions:c,references:r}}function k(e){let t=[],n=e.status==="compliant"?"\u2713":e.status==="warnings"?"\u26A0":"\u2717";if(t.push(`Portal Compliance: ${n} ${e.status.toUpperCase()}`),t.push(""),t.push(`Properly Declared: ${e.properlyDeclared.length}`),e.routeAttachedUnused.length>0&&t.push(`Route-Attached, No Code: ${e.routeAttachedUnused.length}`),e.orphanUnused.length>0&&t.push(`Orphan Gates: ${e.orphanUnused.length}`),e.usedButUndeclared.length>0&&t.push(`Used but Undeclared: ${e.usedButUndeclared.length}`),t.push(""),e.properlyDeclared.length>0){t.push("Gates in Use:");for(let s of e.properlyDeclared)t.push(` \u2713 ^${s}`);t.push("");}if(e.routeAttachedUnused.length>0){t.push("Route-Attached (no checkGate/requireGate in code):");for(let s of e.routeAttachedUnused)t.push(` \u26A0 ^${s}`);t.push("");}if(e.orphanUnused.length>0){t.push("Orphan Gates (declared but never on route or in code):");for(let s of e.orphanUnused)t.push(` \u26A0 ^${s}`);t.push("");}if(e.usedButUndeclared.length>0){t.push("Undeclared Gates (used but not in portal.yaml):");for(let s of e.usedButUndeclared){t.push(` \u2717 ^${s}`);let r=e.references.filter(a=>a.gate===s).slice(0,3);for(let a of r)t.push(` at ${a.file}:${a.line}`);}t.push("");}if(e.suggestions.length>0&&e.status!=="compliant"){t.push("Suggestions:");for(let s of e.suggestions)s&&t.push(` ${s}`);}return t.join(`
|
|
5
|
-
`)}function N(e){if(e.status==="compliant")return {status:"ok",message:`${e.properlyDeclared.length} gates properly declared`};if(e.status==="warnings"){let t=[];return e.routeAttachedUnused.length>0&&t.push(`${e.routeAttachedUnused.length} route-attached`),e.orphanUnused.length>0&&t.push(`${e.orphanUnused.length} orphan`),{status:"warn",message:t.length>0?t.join(", ")+" gate(s)":`${e.declaredButUnused.length} unused gates`}}return {status:"error",message:`${e.usedButUndeclared.length} gates used but not declared`}}export{S as a,B as b,$ as c,w as d,k as e,N as f};
|
package/dist/doctor-2T2QL6VM.js
DELETED