@a-company/paradigm 7.0.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accept-orchestration-YO2V2WYA.js → accept-orchestration-XW44LF5Y.js} +1 -1
- package/dist/add-CBDU23S2.js +12 -0
- package/dist/{aggregate-KZICPVT3.js → aggregate-H7SB2UYT.js} +1 -1
- package/dist/ambient-OW5M5LVN.js +2 -0
- package/dist/{ambient-OX7YJ4PJ.js → ambient-TFLZFV5Y.js} +1 -1
- package/dist/ambient-VCTUHHIG.js +2 -0
- package/dist/arch-loader-YVOS3QRY.js +2 -0
- package/dist/{beacon-52EWNZPK.js → beacon-WVN264OT.js} +1 -1
- package/dist/calibrate-PHVP7RPH.js +4 -0
- package/dist/captain-CAXGHC2V.js +2 -0
- package/dist/captain-CWCLFOXV.js +2 -0
- package/dist/{chunk-QDP4G53M.js → chunk-27EK3OQZ.js} +4 -4
- package/dist/chunk-2KK4JQ55.js +17 -0
- package/dist/chunk-3I3TITBA.js +25 -0
- package/dist/chunk-3YM5ABNX.js +2 -0
- package/dist/{chunk-47YPID6H.js → chunk-6HYRS3PH.js} +21 -21
- package/dist/{chunk-S3UVQ5RV.js → chunk-6VZSOQ7Y.js} +1 -1
- package/dist/chunk-727PXENG.js +2 -0
- package/dist/chunk-A5EEY6NO.js +3 -0
- package/dist/{chunk-DLMDHS2X.js → chunk-ASBK55FU.js} +1 -1
- package/dist/{chunk-4GC35IFF.js → chunk-D6BSCELB.js} +1 -1
- package/dist/{chunk-G6DK3ND3.js → chunk-DH7QVZDI.js} +9 -0
- package/dist/chunk-ECO3LHCE.js +2 -0
- package/dist/chunk-FG3M6VVO.js +30 -0
- package/dist/chunk-FNYYQNJY.js +2 -0
- package/dist/{chunk-ROU3F2HZ.js → chunk-HSY75GRR.js} +3 -3
- package/dist/chunk-K6TLYNRQ.js +7 -0
- package/dist/chunk-K7KT6FL3.js +25 -0
- package/dist/chunk-KAUGQMXU.js +4 -0
- package/dist/chunk-M7JHVVDW.js +6 -0
- package/dist/chunk-NFN5UUJB.js +2 -0
- package/dist/chunk-NRP2KJ6I.js +33 -0
- package/dist/{chunk-WROJSWAO.js → chunk-QPQBXRXX.js} +1 -1
- package/dist/chunk-RVXQNS6K.js +30 -0
- package/dist/chunk-RZRFYGND.js +504 -0
- package/dist/chunk-UNSI6DVD.js +93 -0
- package/dist/{chunk-JCGCPAHF.js → chunk-USYV5QYU.js} +1 -1
- package/dist/chunk-VOPJ47QY.js +2 -0
- package/dist/{chunk-QBIQ2FYB.js → chunk-W3VWORQZ.js} +1 -1
- package/dist/chunk-WMTES556.js +2 -0
- package/dist/chunk-XBK244QR.js +6 -0
- package/dist/chunk-XSKIXXFW.js +504 -0
- package/dist/{chunk-MBSY57RN.js → chunk-Y76OIMDO.js} +1 -1
- package/dist/chunk-YYRP7FLC.js +2 -0
- package/dist/{compliance-MLG4W6S4.js → compliance-3M6COUCO.js} +3 -3
- package/dist/{constellation-RHZAEFV7.js → constellation-TIKNCZWR.js} +1 -1
- package/dist/{cost-24UZSS2P.js → cost-VTHZQKO4.js} +2 -2
- package/dist/{diff-MC6AXLKX.js → diff-Z2YSIRC4.js} +1 -1
- package/dist/{dist-TNE4GFT7.js → dist-PW5YPGFF.js} +1 -1
- package/dist/{docs-3YFNNZRV.js → docs-OWJ7EPD7.js} +1 -1
- package/dist/github-4X4MYINS.js +4 -0
- package/dist/{habits-BX2IRSUI.js → habits-UA7YT3CG.js} +3 -3
- package/dist/{hooks-AXBWYJ5V.js → hooks-XXJ7CSGJ.js} +1 -1
- package/dist/index.js +9 -9
- package/dist/{init-F4MSKZIW.js → init-QPMLEQWQ.js} +1 -1
- package/dist/{integrity-7TKX3DZ4.js → integrity-FRGF5BFS.js} +1 -1
- package/dist/journal-loader-CNNA4EAU.js +2 -0
- package/dist/lint-Y4P3MHBV.js +26 -0
- package/dist/list-5XRLWD7K.js +12 -0
- package/dist/mcp.js +1 -1
- package/dist/{migrate-5M4KUQ2L.js → migrate-LIVXILOO.js} +1 -1
- package/dist/{nomination-engine-AQHU2KBU.js → nomination-engine-EFXDEPZN.js} +1 -1
- package/dist/nomination-engine-YRHZZZUN.js +2 -0
- package/dist/notebook-loader-TZVIMNDJ.js +2 -0
- package/dist/{orchestrate-GMYEBA5T.js → orchestrate-C5NM5MFN.js} +1 -1
- package/dist/orchestration-EVWQWTOV.js +2 -0
- package/dist/orchestration-UP3KFUJT.js +2 -0
- package/dist/{platform-server-WIBVYHIV.js → platform-server-FXF3XFHM.js} +1 -1
- package/dist/{probe-27ARJKRO.js → probe-G3TKOJYW.js} +1 -1
- package/dist/quiz-QKIKAVL7.js +10 -0
- package/dist/registry-NEW4OJ44.js +2 -0
- package/dist/reindex-QZYOD5K4.js +2 -0
- package/dist/{reindex-XTRF23F7.js → reindex-W67B2LQP.js} +1 -1
- package/dist/remember-KZYAY77S.js +14 -0
- package/dist/{review-BRO2UP4M.js → review-WHRNLW2W.js} +1 -1
- package/dist/{ripple-KCVDS3WE.js → ripple-B6U7263T.js} +1 -1
- package/dist/{serve-2PKJP65E.js → serve-6RNZYK2I.js} +2 -2
- package/dist/{serve-SMGWGJLM.js → serve-ZT2Z54NK.js} +1 -1
- package/dist/{setup-5V2AGLQ6.js → setup-L5OP24US.js} +3 -3
- package/dist/{shift-JBCEDCGA.js → shift-UDKXCIW7.js} +3 -3
- package/dist/{show-N5LGB5B2.js → show-VXNGIJE4.js} +3 -3
- package/dist/{snapshot-YMX5QRBM.js → snapshot-MT5L6XE4.js} +1 -1
- package/dist/{spawn-PHA2SVQ3.js → spawn-I6XG57S2.js} +1 -1
- package/dist/status-45KIG32R.js +6 -0
- package/dist/{status-3GJXI4IK.js → status-4QGKLOP6.js} +4 -4
- package/dist/{summary-RPU2BS3Q.js → summary-6QNVQZJV.js} +1 -1
- package/dist/symphony-KQJ6HIXB.js +53 -0
- package/dist/symphony-VDNDFK7H.js +2 -0
- package/dist/symphony-relay-ASMKPDEE.js +3 -0
- package/dist/task-KFND4HLF.js +3 -0
- package/dist/task-loader-HBZ3KRH2.js +2 -0
- package/dist/task-loader-IO4UVFUD.js +2 -0
- package/dist/task-settlement-NF7PFSNE.js +3 -0
- package/dist/task-settlement-TATNPY6L.js +3 -0
- package/dist/team-6WNNLBAO.js +2 -0
- package/dist/thread-2A7QKU72.js +41 -0
- package/dist/tools-GDWT74O6.js +2 -0
- package/dist/tools-SDWAFQMQ.js +142 -0
- package/dist/university-ui/assets/{index-B8hm_MdR.js → index-AbTjHBCf.js} +2 -2
- package/dist/university-ui/assets/{index-B8hm_MdR.js.map → index-AbTjHBCf.js.map} +1 -1
- package/dist/university-ui/index.html +1 -1
- package/dist/validate-OZTX3FYX.js +13 -0
- package/dist/validate-RIMSY3RP.js +9 -0
- package/dist/{workspace-6POCBPDY.js → workspace-4D4TQ637.js} +1 -1
- package/package.json +1 -1
- package/dist/add-V6XR7DU5.js +0 -12
- package/dist/agent-loader-VGBPL3TH.js +0 -2
- package/dist/ambient-7HBJHJL2.js +0 -2
- package/dist/ambient-SST5CLEC.js +0 -35
- package/dist/captain-YUP3KVCA.js +0 -2
- package/dist/chunk-3MZ4J2LF.js +0 -2
- package/dist/chunk-6AKNXD22.js +0 -32
- package/dist/chunk-7SWEOPWF.js +0 -2
- package/dist/chunk-CVPKQ3JH.js +0 -8
- package/dist/chunk-EKNLG73M.js +0 -6
- package/dist/chunk-FRQRREJ6.js +0 -29
- package/dist/chunk-GD4F2HC6.js +0 -3
- package/dist/chunk-JIXHEBGK.js +0 -7
- package/dist/chunk-K54L6CFR.js +0 -25
- package/dist/chunk-MBPLJKE5.js +0 -3
- package/dist/chunk-QEQCPVF5.js +0 -4
- package/dist/chunk-QGZRM6ZB.js +0 -2
- package/dist/chunk-QO7YPQXC.js +0 -2
- package/dist/chunk-S4J337EQ.js +0 -504
- package/dist/chunk-V6MIKLMY.js +0 -18
- package/dist/journal-loader-GLH7XFTK.js +0 -2
- package/dist/lint-IGKE6UPS.js +0 -26
- package/dist/list-NC3QGT75.js +0 -12
- package/dist/lore-loader-D2ISOASW.js +0 -2
- package/dist/notebook-loader-6DYFMNJ2.js +0 -2
- package/dist/orchestration-G5MAY6IA.js +0 -2
- package/dist/quiz-TNV6APBM.js +0 -10
- package/dist/remember-MJRNTXYS.js +0 -14
- package/dist/session-work-log-QXPAXY5K.js +0 -2
- package/dist/status-ENAI35NL.js +0 -6
- package/dist/symphony-7INZR43F.js +0 -53
- package/dist/symphony-G6IENE4K.js +0 -2
- package/dist/symphony-relay-2RHG25Z4.js +0 -3
- package/dist/task-loader-IGQQ6ZFL.js +0 -2
- package/dist/task-settlement-NW4XMJGJ.js +0 -3
- package/dist/team-J2YXPEGX.js +0 -2
- package/dist/thread-HFXK65D4.js +0 -41
- package/dist/tools-HNJ7D5IO.js +0 -2
- package/dist/validate-IQG7DBFC.js +0 -9
- package/dist/validate-LSCDOLBO.js +0 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,
|
|
3
|
-
`).filter(Boolean);}catch{}let l;try{l=execSync("git status --porcelain",{cwd:s,encoding:"utf8",timeout:5e3}).trim()==="";}catch{}let c=m.join(s,"portal.yaml"),f=!1;if(u.existsSync(c))try{let t=u.readFileSync(c,"utf8"),e=w.load(t);f=e?.routes!=null&&Object.keys(e.routes).length>0;}catch{}let i=
|
|
4
|
-
`),"utf8");}else a$1==="on-stop"&&u.existsSync(h)&&u.unlinkSync(h);}catch{}return {trigger:a$1,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:g}}catch{return null}}async function P(s,a){let r=m.join(s,".paradigm","aspect-graph.db");if(!u.existsSync(r))return {driftedCount:0,healedCount:0,cleanCount:0,missingCount:0,details:[]};try{let{driftCheckCommand:d}=await import('./drift-ILZE5BFJ.js'),l="",c=console.log;console.log=f=>{l=f;};try{await d({json:!0,autoHeal:a});}finally{console.log=c;}return l?JSON.parse(l):null}catch{return null}}async function B(s){if(!u.existsSync(m.join(s,"portal.yaml")))return null;try{let{checkPortalCompliance:a}=await import('./portal-compliance-JONQ4SOP.js'),r=await a(s);return {status:r.status,declaredButUnusedCount:r.declaredButUnused.length,usedButUndeclaredCount:r.usedButUndeclared.length,properlyDeclaredCount:r.properlyDeclared.length,declaredButUnused:r.declaredButUnused,usedButUndeclared:r.usedButUndeclared,properlyDeclared:r.properlyDeclared,portalError:r.portalError,...r.nearMatches&&r.nearMatches.length>0?{suggestions:r.nearMatches.map(d=>({gate:d.gate,didYouMean:d.didYouMean,distance:d.distance}))}:{}}}catch{return null}}async function j(s){try{let{runPostflightLearning:a}=await import('./ambient-
|
|
2
|
+
import {a}from'./chunk-FNYYQNJY.js';import {n as n$1,m as m$1}from'./chunk-WMTES556.js';import'./chunk-5TAVYPOV.js';import*as u from'fs';import*as m from'path';import {execSync}from'child_process';import n from'chalk';import*as w from'js-yaml';function $(s){return s.match(/(?:^|\s)((?:\/|\.\/|[a-zA-Z0-9_-]+\/)[^\s,;:'"]+\.[a-zA-Z]{1,10})\b/)?.[1]}async function R(s,a$1){try{let r=a(s),d=[];try{d=execSync("git diff --name-only HEAD",{cwd:s,encoding:"utf8",timeout:5e3}).trim().split(`
|
|
3
|
+
`).filter(Boolean);}catch{}let l;try{l=execSync("git status --porcelain",{cwd:s,encoding:"utf8",timeout:5e3}).trim()==="";}catch{}let c=m.join(s,"portal.yaml"),f=!1;if(u.existsSync(c))try{let t=u.readFileSync(c,"utf8"),e=w.load(t);f=e?.routes!=null&&Object.keys(e.routes).length>0;}catch{}let i=n$1({toolsCalled:[],filesModified:d,symbolsTouched:[],loreRecorded:!1,hasPortalRoutes:f,taskAddsRoutes:!1,gitClean:l}),o=m$1(r,a$1,i),g=0;if(o.evaluations.length>0)try{let t=m.join(s,".paradigm","sentinel");if(u.existsSync(t)){let{SentinelStorage:e}=await import('./dist-VGFSP3XM.js'),p=new e(t);for(let b of o.evaluations)p.recordPracticeEvent({habitId:b.habit.id,habitCategory:b.habit.category,result:b.result,engineer:"agent",sessionId:`cli-${Date.now().toString(36)}`,symbolsTouched:[],filesModified:d,notes:b.reason}),g++;}}catch{}let h=m.join(s,".paradigm",".habits-blocking");try{if(a$1==="on-stop"&&o.blocksCompletion){let t=o.evaluations.filter(e=>e.result==="skipped"&&e.habit.severity==="block").map(e=>`${e.habit.name}: ${e.reason}`);u.writeFileSync(h,t.join(`
|
|
4
|
+
`),"utf8");}else a$1==="on-stop"&&u.existsSync(h)&&u.unlinkSync(h);}catch{}return {trigger:a$1,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:g}}catch{return null}}async function P(s,a){let r=m.join(s,".paradigm","aspect-graph.db");if(!u.existsSync(r))return {driftedCount:0,healedCount:0,cleanCount:0,missingCount:0,details:[]};try{let{driftCheckCommand:d}=await import('./drift-ILZE5BFJ.js'),l="",c=console.log;console.log=f=>{l=f;};try{await d({json:!0,autoHeal:a});}finally{console.log=c;}return l?JSON.parse(l):null}catch{return null}}async function B(s){if(!u.existsSync(m.join(s,"portal.yaml")))return null;try{let{checkPortalCompliance:a}=await import('./portal-compliance-JONQ4SOP.js'),r=await a(s);return {status:r.status,declaredButUnusedCount:r.declaredButUnused.length,usedButUndeclaredCount:r.usedButUndeclared.length,properlyDeclaredCount:r.properlyDeclared.length,declaredButUnused:r.declaredButUnused,usedButUndeclared:r.usedButUndeclared,properlyDeclared:r.properlyDeclared,portalError:r.portalError,...r.nearMatches&&r.nearMatches.length>0?{suggestions:r.nearMatches.map(d=>({gate:d.gate,didYouMean:d.didYouMean,distance:d.distance}))}:{}}}catch{return null}}async function j(s){try{let{runPostflightLearning:a}=await import('./ambient-VCTUHHIG.js');return await a(s)}catch{return null}}async function A(s){let a=process.cwd(),r=s.trigger||"on-stop",d=s.autoHeal!==false,l=[],c=[],f=await R(a,r),i=await P(a,d),o=await B(a);if(f?.evaluation.blocksCompletion){let t=f.habits.filter(e=>e.result==="skipped"&&e.severity==="block");for(let e of t){let p=`Blocking habit not satisfied: ${e.name} \u2014 ${e.reason}`;l.push(p),c.push({message:p,source:"habits",file:$(e.reason),severity:"blocking"});}}if(i&&i.driftedCount>0){let t=`${i.driftedCount} aspect anchor(s) have drifted (content genuinely changed). Run paradigm_aspect_check to review.`;l.push(t);for(let e of i.details.filter(p=>p.status==="drifted"))c.push({message:`Aspect ~${e.aspectId} drifted at lines ${e.startLine}-${e.endLine}`,source:"drift",file:e.path,severity:"advisory"});c.filter(e=>e.source==="drift").length===0&&c.push({message:t,source:"drift",severity:"advisory"});}if(o&&o.portalError?.kind==="unparseable"){let e=`portal.yaml unparseable: ${o.portalError.errorClass} \u2014 run 'paradigm doctor' for details`;l.push(e),c.push({message:e,source:"portal",file:"portal.yaml",severity:"blocking"});}else if(o&&o.usedButUndeclaredCount>0){let t=o.usedButUndeclared.filter(e=>e!=="__portal_unparseable__");if(t.length>0){let e=`${t.length} gate(s) used in code but not declared in portal.yaml: ${t.join(", ")}`;l.push(e);for(let p of t)c.push({message:`Gate ^${p} used in code but not declared in portal.yaml`,source:"portal",file:"portal.yaml",severity:"blocking"});}}let g=null;s.learn&&(g=await j(a));let h={habits:f,drift:i,portal:o,violations:l,structuredViolations:c,postflight:s.learn?g:void 0};if(s.json)console.log(JSON.stringify(h));else {if(console.log(n.magenta(`
|
|
5
5
|
Paradigm Compliance Check
|
|
6
6
|
`)),f){let{evaluation:t}=f,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(i&&(console.log(n.white(" Drift:")),i.healedCount>0&&console.log(n.green(` Auto-healed: ${i.healedCount} shifted anchor(s)`)),i.cleanCount>0&&console.log(n.green(` Clean: ${i.cleanCount} anchor(s)`)),i.driftedCount>0&&console.log(n.red(` Drifted: ${i.driftedCount} anchor(s)`)),i.missingCount>0&&console.log(n.yellow(` Missing: ${i.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(g){if(console.log(n.white(" Postflight Learning:")),g.journalsWritten>0){console.log(n.green(` Journals written: ${g.journalsWritten}`));for(let[t,e]of Object.entries(g.journalsByAgent))e>0&&console.log(n.gray(` ${t}: ${e} entries`));}else console.log(n.gray(" No verdicts to learn from"));g.promoted>0&&console.log(n.green(` Promoted to notebooks: ${g.promoted}`)),console.log();}if(l.length>0){console.log(n.red(` ${l.length} violation(s):`));for(let t of l)console.log(n.red(` - ${t}`));}else console.log(n.green(" All checks passed."));console.log();}l.length>0&&(process.exitCode=1);}export{A as complianceCheckCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {m as m$1,o,C,B,r}from'./chunk-
|
|
2
|
+
import {m as m$1,o,C,B,r}from'./chunk-D6BSCELB.js';import'./chunk-K6TLYNRQ.js';import'./chunk-ZJQY5PPP.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as u from'fs';import*as m from'path';import e from'chalk';import F from'ora';function I(t){let o={gates:[],signals:[],components:[],flows:[],aspects:[]};for(let r of t){if(!r||r.length<2)continue;switch(r[0]){case "^":o.gates.push(r);break;case "!":o.signals.push(r);break;case "#":o.components.push(r);break;case "$":o.flows.push(r);break;case "~":o.aspects.push(r);break}}return o}function T(t,o){let r$1={},g={},l=B(t),a=C(t);for(let s of a){let n=I(s.references),i={type:s.type,path:s.filePath,references:s.references,referencedBy:s.referencedBy};s.description&&(i.description=s.description),s.tags&&s.tags.length>0&&(i.tags=s.tags),n.gates.length>0&&(i.gates=n.gates),n.signals.length>0&&(i.signals=n.signals),n.components.length>0&&(i.components=n.components),n.flows.length>0&&(i.flows=n.flows),n.aspects.length>0&&(i.aspects=n.aspects),r$1[s.symbol]=i;}let y=r(t,"flow");for(let s of y){let n=s.data,i=n?.sequence||n?.gates||s.references;g[s.symbol]={description:s.description,sequence:i};}return {version:"1.0",generated:new Date().toISOString(),project:o,stats:{components:l.component,flows:l.flow,gates:l.gate,signals:l.signal,aspects:l.aspect,total:Object.values(l).reduce((s,n)=>s+n,0)},stars:r$1,orbits:g}}async function z(t,o$1={}){let r=process.cwd(),g=t?m.resolve(r,t):r,l=m.basename(g),a$1=o$1.format||"json";o$1.quiet||console.log(e.blue(`
|
|
3
3
|
\u2728 Building Constellation...
|
|
4
4
|
`));let y=F("Aggregating symbols...").start(),s=a.command("constellation").start("Building constellation",{project:l});try{let n=await m$1(g),i=o(n);a.operation("aggregate").debug("Symbols aggregated",{count:C(i).length}),y.text="Building constellation...";let p=T(i,l),$=m.join(g,".paradigm");u.existsSync($)||u.mkdirSync($,{recursive:!0});let h=o$1.output||m.join($,`constellation.${a$1}`),S;if(a$1==="yaml"?S=d(p):S=JSON.stringify(p,null,2),u.writeFileSync(h,S,"utf8"),a.component("constellation-file").success("Constellation written",{path:h,format:a$1}),y.succeed("Constellation built"),s.success("Constellation built",{path:h,stars:Object.keys(p.stars).length}),!o$1.quiet){console.log(e.white(`
|
|
5
5
|
Constellation Stats`)),console.log(e.gray("\u2500".repeat(40)));let f=p.stats,q=[{symbol:"#",name:"Components",count:f.components,color:e.green},{symbol:"$",name:"Flows",count:f.flows,color:e.yellow},{symbol:"^",name:"Gates",count:f.gates,color:e.red},{symbol:"!",name:"Signals",count:f.signals,color:e.cyan},{symbol:"~",name:"Aspects",count:f.aspects,color:e.magenta}];for(let{symbol:c,name:R,count:O,color:E}of q)O>0&&console.log(` ${E(c)} ${R.padEnd(12)} ${e.cyan(O.toString())}`);console.log(e.gray("\u2500".repeat(40))),console.log(` Total stars: ${e.cyan(f.total.toString())}`),console.log(` Total orbits: ${e.cyan(Object.keys(p.orbits).length.toString())}`),console.log(e.gray(`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import {f as f$1}from'./chunk-K6TLYNRQ.js';import {e}from'./chunk-ZJQY5PPP.js';import'./chunk-5TAVYPOV.js';import*as v from'fs';import*as l from'path';import o from'chalk';import D from'ora';function Q(t){let a=t.length;return Math.ceil(a/3.5)}function f(t,a){try{let s=v.readFileSync(t,"utf8"),m=Buffer.byteLength(s,"utf8"),C=Q(s),r=l.relative(a,t);return {path:t,relativePath:r,tokens:C,bytes:m}}catch{return null}}function i(t){return t<1e3?t.toString():`${(t/1e3).toFixed(1)}k`}async function L(t,a){let s=t?l.resolve(t):process.cwd(),m=D();a.json||console.log(o.blue(`
|
|
3
3
|
\u{1F4B0} Paradigm Cost Analysis
|
|
4
|
-
`)),m.start("Analyzing context files...");let C=await
|
|
4
|
+
`)),m.start("Analyzing context files...");let C=await f$1(s),r=[];for(let e of C){let n=f(e,s);n&&r.push(n);}let A=await e(s),y=[];for(let e of A){let n=f(e,s);n&&y.push(n);}let R=l.join(s,".paradigm","scan-index.json"),h=f(R,s),I=l.join(s,".cursorrules"),q=l.join(s,".cursor","rules","paradigm.mdc"),g=f(I,s);g||(g=f(q,s)),m.stop();let x=r.reduce((e,n)=>e+n.tokens,0),F=y.reduce((e,n)=>e+n.tokens,0),b=h?.tokens||0,P=g?.tokens||0,w=x+F+b,u=w+P,T=150,k=T*7,c=u>0?Math.round((1-k/u)*100):0,d=[],M=r.filter(e=>e.tokens>500);M.length>0&&d.push(`${M.length} .purpose file(s) exceed 500 tokens. Consider splitting large features.`);let N=l.join(s,".cursor","mcp.json"),$=v.existsSync(N);$||d.push("MCP not configured. Run `paradigm mcp setup` to enable dynamic context (80%+ savings)."),h||d.push("No scan-index.json found. Run `paradigm index` for visual discovery support."),r.length<3&&d.push("Few .purpose files found. Add more context for better AI understanding.");let O={static:{purposeFiles:r,portalFiles:y,scanIndex:h,cursorrules:g,total:u},dynamic:{avgQueryTokens:T,typicalConversation:k},savings:{percentage:Math.max(0,c),description:c>0?`${c}% fewer tokens with MCP vs static context`:"MCP provides on-demand context loading"},recommendations:d};if(a.json){console.log(JSON.stringify(O,null,2));return}if(console.log(o.white("Context Token Analysis")),console.log(o.gray("\u2500".repeat(50))),console.log(o.cyan(`
|
|
5
5
|
Static Context (loaded every conversation):`)),console.log(` .purpose files (${r.length}):`.padEnd(35)+o.yellow(i(x)+" tokens")),console.log(` portal.yaml (${y.length}):`.padEnd(35)+o.yellow(i(F)+" tokens")),h&&console.log(" scan-index.json:".padEnd(35)+o.yellow(i(b)+" tokens")),g&&console.log(" .cursorrules:".padEnd(35)+o.yellow(i(P)+" tokens")),console.log(o.gray("\u2500".repeat(50))),console.log(" Static Total:".padEnd(35)+o.yellow.bold(i(u)+" tokens")),console.log(o.cyan(`
|
|
6
6
|
Dynamic Context (MCP on-demand):`)),console.log(" Avg query response:".padEnd(35)+o.green(i(T)+" tokens")),console.log(" Typical conversation (~7 queries):".padEnd(35)+o.green(i(k)+" tokens")),console.log(o.cyan(`
|
|
7
7
|
Potential Savings:`)),c>0){let e=c>70?o.green:c>40?o.yellow:o.white;console.log(" MCP vs Static:".padEnd(35)+e.bold(`${c}% reduction`));let n=u/1e3*.01,p=k/1e3*.01,j=n-p;j>.001&&console.log(" Est. savings per conversation:".padEnd(35)+o.green(`~$${j.toFixed(4)}`));}if(a.detailed&&r.length>0){console.log(o.cyan(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {b}from'./chunk-
|
|
2
|
+
import {b}from'./chunk-NRP2KJ6I.js';import'./chunk-TYWB5IQJ.js';import'./chunk-ASBK55FU.js';import'./chunk-ECLUYHAR.js';import'./chunk-YXLGVOZO.js';import'./chunk-FYDRENK7.js';import'./chunk-3YM5ABNX.js';import'./chunk-EK4ZRIFJ.js';import'./chunk-EKZDFEJW.js';import'./chunk-LPBCQM5Y.js';import'./chunk-D6BSCELB.js';import'./chunk-K6TLYNRQ.js';import'./chunk-ZJQY5PPP.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,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{b as PREFIX_TO_TYPE,a as SYMBOL_PREFIXES,j as addConnection,h as addPremiseNode,m as aggregateFromDirectory,l as aggregateFromPremise,o as buildSymbolIndex,J as checkAspectAnchors,e as createEmptyPremiseFile,k as createSnapshot,n as createSymbolIndex,E as createSymbolString,I as detectAnchorBaseMismatch,v as getAllComponentTypes,C as getAllSymbols,A as getAllTags,G as getAutocompleteSuggestions,w as getChildComponents,u as getComponentsByType,g as getDefaultPremiseContent,y as getReferencesFrom,x as getReferencesTo,p as getSymbol,q as getSymbolById,B as getSymbolCounts,s as getSymbolsBySource,z as getSymbolsByTag,r as getSymbolsByType,F as isValidSymbol,d as parsePremiseContent,c as parsePremiseFile,D as parseSymbol,H as resolveAnchorPath,t as searchSymbols,f as serializePremiseFile,i as updateNodePosition}from'./chunk-
|
|
2
|
+
export{b as PREFIX_TO_TYPE,a as SYMBOL_PREFIXES,j as addConnection,h as addPremiseNode,m as aggregateFromDirectory,l as aggregateFromPremise,o as buildSymbolIndex,J as checkAspectAnchors,e as createEmptyPremiseFile,k as createSnapshot,n as createSymbolIndex,E as createSymbolString,I as detectAnchorBaseMismatch,v as getAllComponentTypes,C as getAllSymbols,A as getAllTags,G as getAutocompleteSuggestions,w as getChildComponents,u as getComponentsByType,g as getDefaultPremiseContent,y as getReferencesFrom,x as getReferencesTo,p as getSymbol,q as getSymbolById,B as getSymbolCounts,s as getSymbolsBySource,z as getSymbolsByTag,r as getSymbolsByType,F as isValidSymbol,d as parsePremiseContent,c as parsePremiseFile,D as parseSymbol,H as resolveAnchorPath,t as searchSymbols,f as serializePremiseFile,i as updateNodePosition}from'./chunk-D6BSCELB.js';import'./chunk-K6TLYNRQ.js';import'./chunk-ZJQY5PPP.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {a,d,e,f,g,b}from'./chunk-BFD3GFRK.js';import'./chunk-5TAVYPOV.js';import n from'chalk';import*as t from'fs';import*as o from'path';import {fileURLToPath}from'url';async function C(c){let s=process.cwd(),e=parseInt(c.port||"3850",10),p=c.open!==false;console.log(n.cyan(`
|
|
3
3
|
Starting Paradigm Docs...
|
|
4
|
-
`));try{let{startPlatformServer:i}=await import('./platform-server-
|
|
4
|
+
`));try{let{startPlatformServer:i}=await import('./platform-server-FXF3XFHM.js');await i({projectDir:s,port:e,open:p,sections:["overview","docs"]}),console.log(n.green(` Docs running at ${n.bold(`http://localhost:${e}`)}`)),console.log(n.gray(` Press Ctrl+C to stop
|
|
5
5
|
`)),await new Promise(()=>{});}catch(i){i.code==="EADDRINUSE"?(console.error(n.red(`
|
|
6
6
|
Error: Port ${e} is already in use.`)),console.log(n.gray(` Try: paradigm docs serve --port ${e+1}
|
|
7
7
|
`))):console.error(n.red(`
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {a}from'./chunk-NFN5UUJB.js';import {b as b$1,a as a$1}from'./chunk-EK4ZRIFJ.js';import'./chunk-5TAVYPOV.js';import {execFileSync}from'child_process';b$1();function f(t){if(!t)return {labels:[]};switch(t.kind){case "human":return {assignee:t.ref,labels:[]};case "archetype":return {labels:[`paradigm:agent/${t.ref}`]};case "peer":return {labels:[`paradigm:peer/${t.ref}`]};default:return {labels:[]}}}var b="gh";function l(t){let e=t.match(/^([^/\s]+\/[^/#\s]+)#\d+$/);if(e)return e[1];let r=t.match(/github\.com\/([^/]+\/[^/]+)\/issues\/\d+/);if(r)return r[1]}function y(t){let e=t.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);return e?`${e[1]}#${e[2]}`:void 0}var d=class{id="github";repo;run;constructor(e={}){this.repo=e.repo,this.run=e.run??(r=>execFileSync(b,r,{encoding:"utf8",timeout:2e4}));}capabilities(){return {push:true,comment:true,pull:false,close:true}}async isAvailable(){try{return this.run(["auth","status"]),!0}catch{return false}}async push(e){let r=this.resolveRepo(e),i=this.renderBody(e),n=f(e.claimant),o=["issue","create","--title",e.blurb,"--body",i];r&&o.push("--repo",r),n.assignee&&o.push("--assignee","@me");let u=this.run(o).trim(),a=u.split(`
|
|
3
|
+
`).map(c=>c.trim()).find(c=>/github\.com\//.test(c)),p=a?y(a):void 0;if(!p)throw a$1.component("#github-provider").warn("Could not parse issue ref from gh output",{stdout:u}),new Error(`gh issue create did not return a parseable issue URL: ${u||"(empty)"}`);return a$1.component("#github-provider").info("Pushed task to GitHub",{taskId:e.id,ref:p}),{ref:p,url:a}}async comment(e,r){let i=l(e.ref)??this.repo,n=["issue","comment",e.ref,"--body",r];i&&n.push("--repo",i),this.run(n),a$1.component("#github-provider").info("Commented on GitHub issue",{ref:e.ref});}async close(e){let r=l(e.ref)??this.repo,i=["issue","close",e.ref];r&&i.push("--repo",r),this.run(i),a$1.component("#github-provider").info("Closed GitHub issue",{ref:e.ref});}resolveRepo(e){if(e.external_ref?.ref){let r=l(e.external_ref.ref);if(r)return r}return this.repo}renderBody(e){let r=[];return r.push(`Synced from Paradigm task \`${e.id}\`.`),r.push(""),e.claimant&&r.push(`Claimant: \`${e.claimant.kind}:${e.claimant.ref}\``),r.push(`Priority: ${e.priority}`),e.tags.length>0&&r.push(`Tags: ${e.tags.join(", ")}`),r.push(""),r.push("\u2014 Pushed one-way by Paradigm sync (Phase 2a). Edits here do not flow back."),r.join(`
|
|
4
|
+
`)}};a("github",()=>new d);export{d as GithubProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,b,c,
|
|
2
|
+
import {a,b,c}from'./chunk-FNYYQNJY.js';import {n,m}from'./chunk-WMTES556.js';import'./chunk-5TAVYPOV.js';import*as g from'fs';import*as u from'path';import {execSync}from'child_process';import o from'chalk';import*as C from'js-yaml';var $=".paradigm/habits.yaml",G=new Set(["explore-before-implement","ripple-before-modify","check-fragility","wisdom-before-implement","verify-before-done","postflight-compliance","test-new-components","purpose-coverage","record-lore-for-significant","gates-for-routes"]),x=["discovery","verification","testing","documentation","collaboration","security"],E=["preflight","postflight","on-stop","on-commit"],I=["advisory","warn","block"],P=["tool-called","file-exists","file-modified","lore-recorded","symbols-registered","gates-declared","tests-exist","git-clean"];function T(e,t){let r=u.join(e,$),i=F(r,t);if(i)return {source:"project",...i};let n=process.env.HOME||process.env.USERPROFILE||"~",l=u.join(n,".paradigm","habits.yaml"),c=F(l,t);return c?{source:"global",...c}:G.has(t)?{source:"seed",filePath:"",index:-1}:null}function F(e,t){if(!g.existsSync(e))return null;try{let r=g.readFileSync(e,"utf8"),i=C.load(r);if(!i?.habits)return null;let n=i.habits.findIndex(l=>l.id===t);return n===-1?null:{filePath:e,index:n}}catch{return null}}function D(e){let t=g.readFileSync(e,"utf8"),r=C.load(t);return r.habits||(r.habits=[]),r.overrides||(r.overrides={}),r}function w(e,t){g.writeFileSync(e,C.dump(t,{lineWidth:80,noRefs:true}),"utf8");}function L(e){let t=u.join(e,$);if(!g.existsSync(t)){let r=u.dirname(t);g.existsSync(r)||g.mkdirSync(r,{recursive:true}),w(t,{version:"1.0",habits:[],overrides:{}});}return t}async function J(e){let t=process.cwd(),r;try{r=a(t);}catch(s){console.log(o.red("Failed to load habits:"),s.message);return}if(e.trigger&&(r=r.filter(s=>s.trigger===e.trigger)),e.category&&(r=r.filter(s=>s.category===e.category)),e.json){console.log(JSON.stringify(r,null,2));return}let i=r.filter(s=>s.enabled),n=r.filter(s=>!s.enabled);console.log(o.magenta(`
|
|
3
3
|
Habits (${i.length} active, ${n.length} disabled)
|
|
4
4
|
`));let l=["preflight","postflight","on-stop","on-commit"];for(let s of l){let y=r.filter(d=>d.trigger===s);if(y.length!==0){console.log(o.cyan(` ${s}:`));for(let d of y){let a=d.enabled?o.green("ON"):o.gray("OFF"),m=d.severity==="block"?o.red(d.severity):d.severity==="warn"?o.yellow(d.severity):o.gray(d.severity);console.log(` ${a} ${o.white(d.id)} [${m}] - ${d.name}`),console.log(o.gray(` ${d.description}`));}console.log();}}let c=u.join(t,$);g.existsSync(c)?console.log(o.gray(` Config: ${$}`)):console.log(o.gray(" Config: using seed habits only (run 'paradigm habits init' to customize)")),console.log();}async function W(e){let t=process.cwd(),r;try{r=a(t);}catch(c){console.log(o.red("Failed to load habits:"),c.message);return}let i=b(r),n=null;try{let{SentinelStorage:c}=await import('./dist-VGFSP3XM.js'),s=u.join(t,".paradigm","sentinel");if(g.existsSync(s)){let y=new c(s),d=e.period||"30d",a=parseInt(d.replace("d",""),10)||30,m=d==="all"?void 0:new Date(Date.now()-a*24*60*60*1e3).toISOString(),v=y.getComplianceRate({dateFrom:m}),f=y.getPracticeEvents({dateFrom:m,limit:500}),b=new Map;for(let h of f){let p=h.habitCategory,S=b.get(p)||{followed:0,skipped:0,partial:0};S[h.result]++,b.set(p,S);}let j=Array.from(b.entries()).map(([h,p])=>{let S=p.followed+p.skipped+p.partial,O=S>0?Math.round((p.followed+p.partial*.5)/S*100):100;return {category:h,rate:O,total:S}}).sort((h,p)=>h.rate-p.rate);n={total:v.total,followed:v.followed,skipped:v.skipped,partial:v.partial,rate:v.rate,byCategory:j};}}catch{}if(e.json){console.log(JSON.stringify({habits:{total:r.length,enabled:i.length},practice:n},null,2));return}console.log(o.magenta(`
|
|
5
5
|
Habits Practice Profile
|
|
@@ -35,8 +35,8 @@ ${C.dump({version:"1.0",habits:[],overrides:{"verify-before-done":{severity:"war
|
|
|
35
35
|
# enabled: false # Disable this habit
|
|
36
36
|
`;g.writeFileSync(r,l,"utf8"),c(t),console.log(o.green(`Created ${$}`)),console.log(o.gray(" 10 seed habits are active by default.")),console.log(o.gray(" Use overrides section to tune severity or disable habits.")),console.log(o.gray(" Run `paradigm habits list` to see all habits.\n"));}async function q(e){let t=process.cwd(),r=u.join(t,$);if(!g.existsSync(r)){console.log(o.yellow(`No ${$} found. Run 'paradigm habits init' first.`));return}if(!x.includes(e.category)){console.log(o.red(`Invalid category: ${e.category}. Valid: ${x.join(", ")}`));return}if(!E.includes(e.trigger)){console.log(o.red(`Invalid trigger: ${e.trigger}. Valid: ${E.join(", ")}`));return}if(e.severity&&!I.includes(e.severity)){console.log(o.red(`Invalid severity: ${e.severity}. Valid: ${I.join(", ")}`));return}let i=e.checkType||"tool-called";if(!P.includes(i)){console.log(o.red(`Invalid check-type: ${i}. Valid: ${P.join(", ")}`));return}let n;try{let a=g.readFileSync(r,"utf8");n=C.load(a),n.habits||(n.habits=[]);}catch(a){console.log(o.red("Failed to parse habits.yaml:"),a.message);return}if(new Set([...n.habits.map(a=>a.id),...a(t).map(a=>a.id)]).has(e.id)){console.log(o.yellow(`Habit "${e.id}" already exists.`));return}let c$1=e.tools?e.tools.split(",").map(a=>a.trim()):[],s=e.patterns?e.patterns.split(",").map(a=>a.trim()):[],y={};i==="tool-called"&&c$1.length>0&&(y.tools=c$1),(i==="file-exists"||i==="file-modified"||i==="tests-exist")&&s.length>0&&(y.patterns=s);let d={id:e.id,name:e.name,description:e.description,category:e.category,trigger:e.trigger,severity:e.severity||"advisory",check:{type:i,params:y},enabled:true};n.habits.push(d),w(r,n),c(t),console.log(o.green(`Added habit: ${e.id}`)),console.log(o.gray(` Name: ${e.name}`)),console.log(o.gray(` Category: ${e.category} | Trigger: ${e.trigger} | Severity: ${e.severity||"advisory"}`)),console.log(o.gray(` Check: ${i}`)),c$1.length>0&&console.log(o.gray(` Tools: ${c$1.join(", ")}`)),s.length>0&&console.log(o.gray(` Patterns: ${s.join(", ")}`)),console.log();}async function z(e,t){let r=process.cwd();if(t.category&&!x.includes(t.category)){console.log(o.red(`Invalid category: ${t.category}. Valid: ${x.join(", ")}`));return}if(t.trigger&&!E.includes(t.trigger)){console.log(o.red(`Invalid trigger: ${t.trigger}. Valid: ${E.join(", ")}`));return}if(t.severity&&!I.includes(t.severity)){console.log(o.red(`Invalid severity: ${t.severity}. Valid: ${I.join(", ")}`));return}if(t.checkType&&!P.includes(t.checkType)){console.log(o.red(`Invalid check-type: ${t.checkType}. Valid: ${P.join(", ")}`));return}let i=T(r,e);if(!i){console.log(o.red(`Habit not found: ${e}`));return}if(i.source==="seed"){if(["name","description","category","trigger","checkType","patterns","tools"].some(m=>t[m]!==void 0)){console.log(o.yellow(`"${e}" is a seed habit. Only --severity and --enabled can be changed.`)),console.log(o.gray(" Other fields require creating a custom habit with the same functionality."));return}if(!t.severity&&t.enabled===void 0){console.log(o.yellow("No changes specified. Use --severity or --enabled for seed habits."));return}let d=L(r),a=D(d);a.overrides||(a.overrides={}),a.overrides[e]||(a.overrides[e]={}),t.severity&&(a.overrides[e].severity=t.severity),t.enabled!==void 0&&(a.overrides[e].enabled=t.enabled==="true"),w(d,a),c(r),console.log(o.green(`Updated seed habit override: ${e}`)),t.severity&&console.log(o.gray(` Severity: ${t.severity}`)),t.enabled!==void 0&&console.log(o.gray(` Enabled: ${t.enabled}`)),console.log();return}let n=D(i.filePath),l=n.habits[i.index];t.name&&(l.name=t.name),t.description&&(l.description=t.description),t.category&&(l.category=t.category),t.trigger&&(l.trigger=t.trigger),t.severity&&(l.severity=t.severity),t.enabled!==void 0&&(l.enabled=t.enabled==="true"),t.checkType&&(l.check.type=t.checkType),t.tools&&(l.check.params.tools=t.tools.split(",").map(s=>s.trim())),t.patterns&&(l.check.params.patterns=t.patterns.split(",").map(s=>s.trim())),n.habits[i.index]=l,w(i.filePath,n),c(r);let c$1=i.source==="global"?"(global)":"(project)";console.log(o.green(`Updated habit: ${e} ${o.gray(c$1)}`)),console.log();}async function Q(e,t){let r=process.cwd(),i=T(r,e);if(!i){console.log(o.red(`Habit not found: ${e}`));return}if(i.source==="seed"){console.log(o.yellow(`"${e}" is a seed habit and cannot be removed.`)),console.log(o.gray(` Use: paradigm habits edit ${e} --enabled false`));return}let n=D(i.filePath),l=n.habits[i.index];if(!t.yes){console.log(o.yellow(`
|
|
37
37
|
Will remove habit: ${l.name} (${e})`)),console.log(o.gray(` Source: ${i.source} (${i.filePath})`)),console.log(o.gray(` Use --yes to confirm.
|
|
38
|
-
`));return}n.habits.splice(i.index,1),w(i.filePath,n),c(r),console.log(o.green(`Removed habit: ${e}`)),console.log();}async function X(e,t){let r=process.cwd(),i=t==="enable",n=T(r,e);if(!n){console.log(o.red(`Habit not found: ${e}`));return}if(n.source==="seed"){let c$1=L(r),s=D(c$1);s.overrides||(s.overrides={}),s.overrides[e]||(s.overrides[e]={}),s.overrides[e].enabled=i,w(c$1,s),c(r),console.log(o.green(`${i?"Enabled":"Disabled"} seed habit: ${e}`)),console.log();return}let l=D(n.filePath);l.habits[n.index].enabled=i,w(n.filePath,l),c(r),console.log(o.green(`${i?"Enabled":"Disabled"} habit: ${e}`)),console.log();}async function Z(e
|
|
39
|
-
`),"utf8");}else r==="on-stop"&&g.existsSync(v)&&g.unlinkSync(v);}catch{}e
|
|
38
|
+
`));return}n.habits.splice(i.index,1),w(i.filePath,n),c(r),console.log(o.green(`Removed habit: ${e}`)),console.log();}async function X(e,t){let r=process.cwd(),i=t==="enable",n=T(r,e);if(!n){console.log(o.red(`Habit not found: ${e}`));return}if(n.source==="seed"){let c$1=L(r),s=D(c$1);s.overrides||(s.overrides={}),s.overrides[e]||(s.overrides[e]={}),s.overrides[e].enabled=i,w(c$1,s),c(r),console.log(o.green(`${i?"Enabled":"Disabled"} seed habit: ${e}`)),console.log();return}let l=D(n.filePath);l.habits[n.index].enabled=i,w(n.filePath,l),c(r),console.log(o.green(`${i?"Enabled":"Disabled"} habit: ${e}`)),console.log();}async function Z(e){let t=process.cwd(),r=e.trigger,i;try{i=a(t);}catch(f){console.log(o.red("Failed to load habits:"),f.message),process.exitCode=1;return}let n$1=e.files?e.files.split(",").map(f=>f.trim()).filter(Boolean):N(t),l=e.symbols?e.symbols.split(",").map(f=>f.trim()).filter(Boolean):[],c;try{c=execSync("git status --porcelain",{cwd:t,encoding:"utf8",timeout:5e3}).trim()==="";}catch{}let s=u.join(t,"portal.yaml"),y=false;if(g.existsSync(s))try{let f=g.readFileSync(s,"utf8"),b=C.load(f);y=b?.routes!=null&&Object.keys(b.routes).length>0;}catch{}let d=n({toolsCalled:[],filesModified:n$1,symbolsTouched:l,loreRecorded:false,hasPortalRoutes:y,taskAddsRoutes:false,gitClean:c}),a$1=m(i,r,d),m$1=0;if(e.record&&a$1.evaluations.length>0)try{let f=u.join(t,".paradigm","sentinel");if(g.existsSync(f)){let{SentinelStorage:b}=await import('./dist-VGFSP3XM.js'),j=new b(f);for(let h of a$1.evaluations)j.recordPracticeEvent({habitId:h.habit.id,habitCategory:h.habit.category,result:h.result,engineer:"agent",sessionId:`cli-${Date.now().toString(36)}`,symbolsTouched:l,filesModified:n$1,notes:h.reason}),m$1++;}}catch{}let v=u.join(t,".paradigm",".habits-blocking");try{if(r==="on-stop"&&a$1.blocksCompletion){let f=a$1.evaluations.filter(b=>b.result==="skipped"&&b.habit.severity==="block").map(b=>`${b.habit.name}: ${b.reason}`);g.writeFileSync(v,f.join(`
|
|
39
|
+
`),"utf8");}else r==="on-stop"&&g.existsSync(v)&&g.unlinkSync(v);}catch{}e.json?console.log(JSON.stringify({trigger:r,evaluation:{total:a$1.summary.total,followed:a$1.summary.followed,skipped:a$1.summary.skipped,partial:a$1.summary.partial,blockingViolations:a$1.summary.blockingViolations,blocksCompletion:a$1.blocksCompletion},habits:a$1.evaluations.map(f=>({id:f.habit.id,name:f.habit.name,category:f.habit.category,severity:f.habit.severity,result:f.result,reason:f.reason,evidence:f.evidence})),recorded:m$1},null,2)):U(a$1,m$1),a$1.blocksCompletion&&(process.exitCode=1);}function N(e){try{return execSync("git diff --name-only HEAD",{cwd:e,encoding:"utf8",timeout:5e3}).trim().split(`
|
|
40
40
|
`).filter(Boolean)}catch{return []}}function U(e,t){let{summary:r}=e;console.log(o.magenta(`
|
|
41
41
|
Habits Check (${e.trigger})
|
|
42
42
|
`));for(let i of e.evaluations){let n=i.result==="followed"?o.green("PASS"):i.result==="skipped"?i.habit.severity==="block"?o.red("BLOCK"):o.yellow("SKIP"):o.gray("PART"),l=i.habit.severity==="block"?o.red(i.habit.severity):i.habit.severity==="warn"?o.yellow(i.habit.severity):o.gray(i.habit.severity);console.log(` ${n} ${o.white(i.habit.id)} [${l}]`),console.log(o.gray(` ${i.reason}`));}console.log(),console.log(o.white(` Summary: ${r.followed} followed, ${r.skipped} skipped, ${r.partial} partial`)),r.blockingViolations>0&&console.log(o.red(` ${r.blockingViolations} blocking violation(s) \u2014 exit code 1`)),t>0&&console.log(o.gray(` Recorded ${t} practice event(s) to Sentinel`)),console.log();}export{q as habitsAddCommand,Z as habitsCheckCommand,z as habitsEditCommand,Y as habitsInitCommand,J as habitsListCommand,Q as habitsRemoveCommand,W as habitsStatusCommand,X as habitsToggleCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{a as hooksInstallCommand,c as hooksStatusCommand,b as hooksUninstallCommand}from'./chunk-
|
|
2
|
+
export{a as hooksInstallCommand,c as hooksStatusCommand,b as hooksUninstallCommand}from'./chunk-DH7QVZDI.js';import'./chunk-5TAVYPOV.js';
|