@a-company/paradigm 5.37.0 → 5.37.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-36AP7HTX.js → accept-orchestration-SBZVK3H4.js} +1 -1
- package/dist/{add-FGKNJS3F.js → add-P76GEMGF.js} +1 -1
- package/dist/{agent-E7LDKJ4O.js → agent-X6I2YWOB.js} +1 -1
- package/dist/{agent-loader-2HXKVL6J.js → agent-loader-RIVI6QPP.js} +1 -1
- package/dist/{agent-loader-XS6LIMUG.js → agent-loader-RJRVO5GQ.js} +1 -1
- package/dist/{agent-state-L7LCPRC3.js → agent-state-KSQ3S7OB.js} +1 -1
- package/dist/{agents-suggest-Y5D6AALG.js → agents-suggest-HYTFMQD3.js} +1 -1
- package/dist/{aggregate-OZJRRAQR.js → aggregate-W66DM3GA.js} +1 -1
- package/dist/{ambient-4NSPAQDJ.js → ambient-GJAEXF7B.js} +4 -4
- package/dist/{assess-AMPVSWK7.js → assess-UFPYEJKP.js} +1 -1
- package/dist/{auto-A7VUHCUC.js → auto-RHJXOZFL.js} +1 -1
- package/dist/{beacon-YBLUUTYY.js → beacon-5QVYV5DF.js} +1 -1
- package/dist/{calibration-FQ4YVOE4.js → calibration-OLJYB5HN.js} +1 -1
- package/dist/{check-46QL3KMQ.js → check-THVGY4R5.js} +1 -1
- package/dist/{chunk-EMMMBAID.js → chunk-3KVVC4WV.js} +1 -1
- package/dist/{chunk-3QMRDN65.js → chunk-4Q7XYPL4.js} +2 -2
- package/dist/{chunk-3OMJI5TT.js → chunk-4SCKMGTB.js} +2 -2
- package/dist/chunk-5TAVYPOV.js +2 -0
- package/dist/{chunk-6PP2RPIZ.js → chunk-74SGKSRQ.js} +2 -2
- package/dist/{chunk-RN35IVA2.js → chunk-BV5PRPLB.js} +1 -1
- package/dist/{chunk-YG5G5GEQ.js → chunk-CMCQHU46.js} +13 -13
- package/dist/{chunk-JIF7OSGH.js → chunk-CVPKQ3JH.js} +1 -1
- package/dist/{chunk-RLJ5K3J5.js → chunk-D6ZXAI26.js} +1 -1
- package/dist/chunk-EK4ZRIFJ.js +3 -0
- package/dist/{chunk-X54WXWCX.js → chunk-FILLU77P.js} +5 -5
- package/dist/{chunk-7PB7AXQE.js → chunk-J6KWGCHN.js} +1 -1
- package/dist/{chunk-BCOPNVPY.js → chunk-JOHAOLEC.js} +2 -2
- package/dist/{chunk-JUOOVKK6.js → chunk-KFNHCQ4R.js} +1 -1
- package/dist/{chunk-77WX6HGV.js → chunk-LBQBWIEX.js} +1 -1
- package/dist/chunk-MBPLJKE5.js +3 -0
- package/dist/{chunk-W6WVJLHO.js → chunk-ODVKPZZ4.js} +1 -1
- package/dist/{chunk-5YHR77AL.js → chunk-ORDKEGII.js} +1 -1
- package/dist/chunk-QGZRM6ZB.js +2 -0
- package/dist/chunk-QO7YPQXC.js +2 -0
- package/dist/{chunk-DG3VCY43.js → chunk-SUU6M4JH.js} +1 -1
- package/dist/{chunk-XNB4TZTD.js → chunk-UNHTQLYO.js} +1 -1
- package/dist/chunk-UPFCBVXY.js +3 -0
- package/dist/{chunk-6QKCUEEY.js → chunk-VCKKJDLP.js} +1 -1
- package/dist/{chunk-4W5TBL3O.js → chunk-VG7FN2TU.js} +1 -1
- package/dist/{chunk-7YTAA6XA.js → chunk-WS2N27RX.js} +1 -1
- package/dist/{chunk-7SGNNVE5.js → chunk-X3U3IGYT.js} +2 -2
- package/dist/{chunk-IW5K3RNR.js → chunk-ZUAUFZRJ.js} +1 -1
- package/dist/{claude-OX54QSLC.js → claude-4LR3LJQZ.js} +1 -1
- package/dist/{claude-cli-FHLJQVJC.js → claude-cli-UP6HGH7C.js} +1 -1
- package/dist/{claude-code-GVGU3A3B.js → claude-code-RLJ4GX77.js} +1 -1
- package/dist/{claude-code-teams-ZRHPTGPP.js → claude-code-teams-R37HJY3Y.js} +1 -1
- package/dist/{compliance-PHSPVYK2.js → compliance-BPGQMQAX.js} +3 -3
- package/dist/{compliance-health-HCZTJDN7.js → compliance-health-JNP3P35P.js} +1 -1
- package/dist/{conductor-LYBMM66Z.js → conductor-Y5IXELTL.js} +1 -1
- package/dist/{config-schema-URJW6UZH.js → config-schema-GUQY2QN7.js} +1 -1
- package/dist/{constellation-PX3ZKMWQ.js → constellation-CG7C4WFE.js} +1 -1
- package/dist/{context-audit-APFKELFT.js → context-audit-XRPT3OU2.js} +2 -2
- package/dist/{cost-B5SAHPOJ.js → cost-IDNVMAEV.js} +1 -1
- package/dist/{cost-MMWUDGZC.js → cost-PK4KIF7R.js} +1 -1
- package/dist/{cursor-cli-Q2HLQ5TE.js → cursor-cli-QKF7Z6M2.js} +1 -1
- package/dist/{cursorrules-3BW6K6D5.js → cursorrules-U5O4G5T4.js} +1 -1
- package/dist/{decision-loader-4KMQVAXZ.js → decision-loader-2XPZE4EZ.js} +1 -1
- package/dist/{delete-7PQZUERZ.js → delete-P5VULXR4.js} +1 -1
- package/dist/{diff-F2HUO2H3.js → diff-JVEYCXUC.js} +1 -1
- package/dist/{discipline-ARFFIXQL.js → discipline-H7LDI6NT.js} +1 -1
- package/dist/{dist-MRZDZ5SX.js → dist-3ZCH25SG.js} +1 -1
- package/dist/{dist-KGRCLBJP-R5CCPPXN.js → dist-KGRCLBJP-2QAPFYNF.js} +1 -1
- package/dist/{dist-YUXXIXB3.js → dist-QBTQW4ZW.js} +1 -1
- package/dist/{dist-OKM6BXTH.js → dist-VGFSP3XM.js} +1 -1
- package/dist/{dist-VWC6FA46.js → dist-VXCZWVVJ.js} +1 -1
- package/dist/{dist-5IUWRFG6.js → dist-W3XCATBJ.js} +1 -1
- package/dist/{docs-6WOQILZS.js → docs-EDQ2STFK.js} +1 -1
- package/dist/{docs-BI2DO7B2.js → docs-USDAF26F.js} +2 -2
- package/dist/doctor-G37LCXG5.js +2 -0
- package/dist/{drift-6QPDKKUO.js → drift-ILZE5BFJ.js} +1 -1
- package/dist/{echo-3JJDKCNF.js → echo-UPTQUEDU.js} +1 -1
- package/dist/{edit-PLCGL5OV.js → edit-GUU3HBVW.js} +1 -1
- package/dist/{enforcement-IWABOHMY.js → enforcement-46XWPNSA.js} +1 -1
- package/dist/{enforcement-5MHSQAXE.js → enforcement-BEGPQIUN.js} +1 -1
- package/dist/{event-5J3GBWKT.js → event-Y3VXC2RV.js} +1 -1
- package/dist/{explain-files-LPHTJL4N.js → explain-files-3GPZUETV.js} +1 -1
- package/dist/{export-NXUFTFPW.js → export-CV5KCTPS.js} +1 -1
- package/dist/{flow-IT2IVXXT.js → flow-POQP27WA.js} +1 -1
- package/dist/{gap-narrator-DVXPWNFN.js → gap-narrator-NTXLUI7I.js} +1 -1
- package/dist/{global-J2VTYKCC.js → global-C44FW4G2.js} +1 -1
- package/dist/{graduate-N2HF4JT6.js → graduate-3BBSC27A.js} +1 -1
- package/dist/graph-CNDE5TAT.js +2 -0
- package/dist/{graph-server-TBHHBFOM.js → graph-server-COZR5C3Z.js} +1 -1
- package/dist/{habits-JTMWGVPH.js → habits-BX2IRSUI.js} +3 -3
- package/dist/{history-FHS7EC3Z.js → history-UW454SDP.js} +1 -1
- package/dist/{hooks-BL6CXRVK.js → hooks-BNWRGACA.js} +1 -1
- package/dist/index.js +5 -5
- package/dist/init-EHVSM7YY.js +2 -0
- package/dist/{integrity-UBMZCB77.js → integrity-UYDOOJDP.js} +1 -1
- package/dist/{integrity-checker-VSR3ITBL.js → integrity-checker-DHGMZQDG.js} +1 -1
- package/dist/journal-loader-GLH7XFTK.js +2 -0
- package/dist/{lint-KQQ2RMSJ.js → lint-IGKE6UPS.js} +1 -1
- package/dist/{list-37UCWCOQ.js → list-5IUGP3ZB.js} +1 -1
- package/dist/{list-6WY4CFUR.js → list-YKIQNKGB.js} +1 -1
- package/dist/lore-loader-RVQI5GXL.js +2 -0
- package/dist/{lore-loader-PBUDKXAJ.js → lore-loader-XY5MZRR2.js} +1 -1
- package/dist/{lore-server-A3KKZLSY.js → lore-server-FC2GMDLT.js} +1 -1
- package/dist/{manual-HKI6OXB4.js → manual-RXSPSFLL.js} +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{migrate-W3KCXLDS.js → migrate-YQG2FG3J.js} +2 -2
- package/dist/{migrate-assessments-D2TOBJ5V.js → migrate-assessments-GEI5WMI2.js} +1 -1
- package/dist/{model-discovery-TWX4A4YD.js → model-discovery-HMB3YI4L.js} +1 -1
- package/dist/{nomination-engine-A24774W4.js → nomination-engine-KNSOAT4W.js} +1 -1
- package/dist/{notebook-LXJ2LHUA.js → notebook-PE3JSYZI.js} +1 -1
- package/dist/notebook-loader-CENTDDUJ.js +2 -0
- package/dist/{orchestrate-WFCNV2II.js → orchestrate-RCAMBOIB.js} +1 -1
- package/dist/{peers-7TPZTKH7.js → peers-P2KXU7ZK.js} +1 -1
- package/dist/{persona-UGTCFEGT.js → persona-STQWZH5P.js} +1 -1
- package/dist/{pipeline-7PZ6ILWX.js → pipeline-MZUITRVN.js} +1 -1
- package/dist/{platform-server-YIBX4YDJ.js → platform-server-DNAMH4YI.js} +2 -2
- package/dist/{plugin-update-checker-2EM4K45U.js → plugin-update-checker-M7PW434O.js} +1 -1
- package/dist/{portal-check-YSDJRZUR.js → portal-check-Z3OCQEQR.js} +1 -1
- package/dist/{portal-compliance-OBPK2IR5.js → portal-compliance-4MG5F2GI.js} +1 -1
- package/dist/{probe-WKXR3IN4.js → probe-B22G2JKF.js} +1 -1
- package/dist/{project-type-MRBJAKC7.js → project-type-EUCFKEAZ.js} +1 -1
- package/dist/{promote-VHBA56KW.js → promote-NJQDZBZA.js} +2 -2
- package/dist/{providers-RX7SBLHZ.js → providers-AWA7WLLM.js} +1 -1
- package/dist/{quiz-3SQNPRJ3.js → quiz-FE5UGAY2.js} +1 -1
- package/dist/{record-7QJPZZP7.js → record-YXPB34MY.js} +1 -1
- package/dist/{registry-LR5QACRK.js → registry-KOOKFUWD.js} +2 -2
- package/dist/reindex-O3WUCEE2.js +2 -0
- package/dist/{remember-SFGBTTEE.js → remember-MJRNTXYS.js} +1 -1
- package/dist/{retag-GFXUYP7S.js → retag-N5XF3KXP.js} +1 -1
- package/dist/{review-6KKZWV3A.js → review-6UAH6V3R.js} +1 -1
- package/dist/{review-GEBSYOZB.js → review-77QI6VOC.js} +1 -1
- package/dist/{ripple-4F5ZCXS4.js → ripple-ZGDITCGB.js} +1 -1
- package/dist/{roster-RI3UC2YI.js → roster-HV5KYUOI.js} +1 -1
- package/dist/{scaffold-WA4L2K7J.js → scaffold-D57JXPCC.js} +1 -1
- package/dist/{scopes-commands-5FFIUDRC.js → scopes-commands-NSPERZWV.js} +1 -1
- package/dist/{sentinel-37ZEEWT7.js → sentinel-HYAZ3CO5.js} +2 -2
- package/dist/{sentinel-bridge-EZGFRVFH.js → sentinel-bridge-VR357PKL.js} +1 -1
- package/dist/{serve-2BXDL35A.js → serve-L52ZUTU6.js} +2 -2
- package/dist/{serve-5JME5QEM.js → serve-OY6XYL7F.js} +2 -2
- package/dist/{serve-2LSTQFFQ.js → serve-U47GULB6.js} +2 -2
- package/dist/{server-XLHIYDTZ.js → server-2MNROHF6.js} +1 -1
- package/dist/{server-AIXFROYL.js → server-4YNUIK4W.js} +1 -1
- package/dist/session-tracker-D2CH7RJF.js +2 -0
- package/dist/{session-work-log-6GKGUQ5C.js → session-work-log-BX434ZLK.js} +1 -1
- package/dist/{session-work-log-UYMIWWOX.js → session-work-log-NQA7WJEC.js} +1 -1
- package/dist/{setup-ZM4JFV5D.js → setup-3F5IK7MO.js} +2 -2
- package/dist/{setup-F2N4LUR7.js → setup-KPIMRZ4Q.js} +1 -1
- package/dist/{shift-DDYVQJ75.js → shift-RRNL6E4O.js} +3 -3
- package/dist/{show-RFOIR2GQ.js → show-BOAVWZPZ.js} +1 -1
- package/dist/{show-CZLVYLM5.js → show-PJ5LFLIL.js} +1 -1
- package/dist/{snapshot-6N564OUJ.js → snapshot-L2G56RPL.js} +1 -1
- package/dist/{spawn-HYARN3RL.js → spawn-M5BAV252.js} +1 -1
- package/dist/{status-WBJ6D7BD.js → status-77M3SDIF.js} +1 -1
- package/dist/{status-CUG3PKGC.js → status-A37ECYNJ.js} +1 -1
- package/dist/{summary-2AM4QVPW.js → summary-LXLHFRN7.js} +1 -1
- package/dist/{sweep-WHDT7ENV.js → sweep-HU74OPVW.js} +1 -1
- package/dist/{switch-HBGIFNF6.js → switch-CTW4PDGI.js} +1 -1
- package/dist/{symphony-CWKKMFAS.js → symphony-7INZR43F.js} +5 -5
- package/dist/{symphony-VTHVTE57.js → symphony-G6IENE4K.js} +1 -1
- package/dist/{symphony-loader-RYFZOQJS.js → symphony-loader-VA4UREOM.js} +1 -1
- package/dist/{symphony-peers-LWBUQ3T4.js → symphony-peers-U4KHMKGI.js} +1 -1
- package/dist/{symphony-peers-ISJPKX7W.js → symphony-peers-X5NGWXFP.js} +1 -1
- package/dist/{symphony-relay-L3BY6RGM.js → symphony-relay-2RHG25Z4.js} +1 -1
- package/dist/{sync-WIFD7UCL.js → sync-DLUBV5HQ.js} +1 -1
- package/dist/{sync-llms-MZ3RQWFX.js → sync-llms-7CAI74QL.js} +1 -1
- package/dist/{task-loader-EU7JLTR3.js → task-loader-NZFDTUQ5.js} +1 -1
- package/dist/{team-C3PWO7XL.js → team-NSP6PMPS.js} +1 -1
- package/dist/{test-6MUL4EXS.js → test-BQJMS4Y2.js} +1 -1
- package/dist/{thread-K6UHDIUW.js → thread-HFXK65D4.js} +1 -1
- package/dist/{timeline-S26CQWHT.js → timeline-K3ZFKJ3R.js} +1 -1
- package/dist/tools-NNPANZRA.js +2 -0
- package/dist/{triage-YF6WYZY4.js → triage-FCWOZASE.js} +1 -1
- package/dist/{tutorial-UEBX7Z2G.js → tutorial-UC6YQMNN.js} +1 -1
- package/dist/{university-UMT7PAKE.js → university-FJ7OCOA3.js} +1 -1
- package/dist/{upgrade-USW7YJEX.js → upgrade-GX56QE3C.js} +1 -1
- package/dist/{validate-VZGBVTPM.js → validate-C6SMKGYD.js} +1 -1
- package/dist/{validate-2PZTNYSS.js → validate-LSCDOLBO.js} +1 -1
- package/dist/{validate-KW3YFGTV.js → validate-VZXTJHGO.js} +1 -1
- package/dist/{watch-KQU3S7KE.js → watch-PZCCUP6K.js} +1 -1
- package/dist/{watch-HL3ZOALL.js → watch-YCODNIET.js} +1 -1
- package/dist/{wisdom-UU7HOE3M.js → wisdom-XZ3QKPNP.js} +1 -1
- package/dist/{work-log-loader-J27XSFCE.js → work-log-loader-DL5GZ2BQ.js} +1 -1
- package/dist/workspace-MKSQN7B2.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-BRHQJLTG.js +0 -2
- package/dist/chunk-DSYEGRQ2.js +0 -3
- package/dist/chunk-F5BSUC2L.js +0 -3
- package/dist/chunk-NFQLONFY.js +0 -3
- package/dist/chunk-OVDYPOHR.js +0 -2
- package/dist/chunk-XHJ27CER.js +0 -2
- package/dist/doctor-JLTCBMS4.js +0 -2
- package/dist/graph-VLMP6DW2.js +0 -2
- package/dist/init-ZS7RAR7L.js +0 -2
- package/dist/journal-loader-EELDB4P2.js +0 -2
- package/dist/lore-loader-CP5RUJ4A.js +0 -2
- package/dist/notebook-loader-CF52PNZC.js +0 -2
- package/dist/reindex-F7EV3Z34.js +0 -2
- package/dist/session-tracker-VSFRNFRL.js +0 -2
- package/dist/tools-4WKLLDFU.js +0 -2
- package/dist/workspace-CE6LNXVI.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {m as m$1,o,C,B,r}from'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-
|
|
2
|
+
import {m as m$1,o,C,B,r}from'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.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,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a}from'./chunk-LKAT7IAK.js';import'./chunk-
|
|
2
|
+
import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as h from'fs';import*as f from'path';import*as v from'js-yaml';var w=["CLAUDE.md",".cursorrules","AGENTS.md"];function k(i){let e=[];for(let r of w){let t=f.join(i,r);if(h.existsSync(t)){let l=h.readFileSync(t,"utf8");e.push({name:r,content:l,lines:l.split(`
|
|
3
3
|
`)});}}return e}function C(i,e){let r=new Set,t=new Set(["node_modules","dist",".git",".paradigm","coverage","build","__pycache__","target",".next",".nuxt"]);function l(n){let u;try{u=h.readdirSync(n,{withFileTypes:!0});}catch{return}let a=false;for(let o of u){if(t.has(o.name))continue;let s=f.join(n,o.name);if(o.isDirectory())l(s);else if(o.isFile()){let c=f.extname(o.name);e.includes(c)&&(a=true);}}a&&r.add(n);}return l(i),r}function S(i,e){let r=i;for(;;){if(h.existsSync(f.join(r,".purpose")))return true;if(r===e)break;let t=f.dirname(r);if(t===r)break;r=t;}return false}async function $(i){let e=[],r=k(i);if(r.length===0)return e.push({check:"stale-references",status:"advisory",message:"No instruction files found (CLAUDE.md, .cursorrules, AGENTS.md)"}),e;let t=/(?:^|\s|`|"|')([.a-zA-Z0-9_-]+(?:\/[.a-zA-Z0-9_*{}-]+)+\/?)/gm,l=/(?:^|\s|`|"|')([a-zA-Z0-9_-]+\.(?:ts|js|py|rs|go|yaml|yml|json|md|toml))\b/gm,n=[],u=new Set;for(let a of r){let o=[],s;for(t.lastIndex=0;(s=t.exec(a.content))!==null;)o.push(s[1]);for(l.lastIndex=0;(s=l.exec(a.content))!==null;)o.push(s[1]);for(let c of o){let d=c.replace(/\/+$/,"").replace(/`/g,"");if(d.startsWith("http")||d.startsWith("//")||d.includes("*")||d.includes("{")||d.startsWith("paradigm://")||d.startsWith("node_modules/")||u.has(d))continue;u.add(d);let p=/\.(ts|js|py|rs|go|yaml|yml|json|md|toml)(?:\/|$)/.test(d),g=/^(\.|src\/|packages\/|lib\/|app\/|docs\/)/.test(d);if(!p&&!g)continue;let y=f.join(i,d);h.existsSync(y)||n.push(`${a.name}: ${d}`);}}return n.length>0?e.push({check:"stale-references",status:"error",message:`${n.length} dead path reference${n.length>1?"s":""} in instruction files`,details:n,fix:"Update or remove dead paths from instruction files"}):e.push({check:"stale-references",status:"ok",message:"All referenced paths exist"}),e}async function A(i){let e=[],r=k(i),t=f.join(i,".paradigm","config.yaml");if(h.existsSync(t)){let o=h.readFileSync(t,"utf8");r.push({name:"config.yaml",content:o,lines:o.split(`
|
|
4
4
|
`)});}if(r.length===0)return e.push({check:"convention-contradictions",status:"ok",message:"No instruction files to check"}),e;let l=[],n=[],u=[[/\bcamelCase\b/i,"camelCase"],[/\bkebab[- ]?case\b/i,"kebab-case"],[/\bsnake[_ ]?case\b/i,"snake_case"],[/\bPascalCase\b/i,"PascalCase"]];for(let o of r)for(let s=0;s<o.lines.length;s++){let c=o.lines[s];for(let[d,p]of u)if(d.test(c)){let g=c.match(/\b(file|variable|function|class|component|symbol|directory|folder|module|import)\s*nam/i),y=g?g[1].toLowerCase():"general";l.push({scope:y,directive:p,source:o.name,line:s+1});}}let a=new Map;for(let o of l){let s=a.get(o.scope)||[];s.push(o),a.set(o.scope,s);}for(let[o,s]of a){let c=new Set(s.map(p=>p.directive)),d=[["camelCase","kebab-case"],["camelCase","snake_case"],["kebab-case","snake_case"]];for(let[p,g]of d)if(c.has(p)&&c.has(g)){let y=s.find(b=>b.directive===p),m=s.find(b=>b.directive===g);n.push(`${o} naming: ${p} (${y.source}:${y.line}) vs ${g} (${m.source}:${m.line})`);}}return n.length>0?e.push({check:"convention-contradictions",status:"warn",message:`${n.length} potential convention contradiction${n.length>1?"s":""}`,details:n,fix:"Reconcile conflicting naming/style conventions in instruction files"}):e.push({check:"convention-contradictions",status:"ok",message:"No contradictions detected"}),e}var R=new Set(["typescript","tsup","vitest","eslint","prettier","rimraf","tsx","ts-node","nodemon","concurrently","husky","lint-staged","unbuild","turbo","lerna","changesets"]),P=["@types/","@typescript-eslint/","@eslint/"];async function j(i){let e=[],r=f.join(i,"package.json");if(!h.existsSync(r))return e.push({check:"undocumented-stack",status:"ok",message:"No package.json found (not a JS/TS project or monorepo root)"}),e;let t;try{t=JSON.parse(h.readFileSync(r,"utf8"));}catch{return e.push({check:"undocumented-stack",status:"advisory",message:"Could not parse package.json"}),e}let l=new Set([...Object.keys(t.dependencies||{}),...Object.keys(t.devDependencies||{})]),n=[];for(let s of l)R.has(s)||P.some(c=>s.startsWith(c))||n.push(s);if(n.length===0)return e.push({check:"undocumented-stack",status:"ok",message:"No major dependencies to document"}),e;let a=k(i).map(s=>s.content).join(`
|
|
5
|
-
`).toLowerCase(),o=[];for(let s of n){let c=s.toLowerCase(),d=s.includes("/")?s.split("/").pop():s;!a.includes(c)&&!a.includes(d.toLowerCase())&&o.push(s);}return o.length>0?e.push({check:"undocumented-stack",status:"advisory",message:`${o.length} dependenc${o.length>1?"ies":"y"} not mentioned in instruction files`,details:o.slice(0,20),fix:"Consider documenting major dependencies in CLAUDE.md for AI context"}):e.push({check:"undocumented-stack",status:"ok",message:"All major dependencies are documented"}),e}async function E(i){let e=[],t=C(i,[".ts",".js",".py",".rs",".go",".tsx",".jsx"]);if(t.size===0)return e.push({check:"purpose-coverage",status:"ok",message:"No source directories found"}),e;let l=0,n=[];for(let o of t)if(S(o,i))l++;else {let s=f.relative(i,o);n.push(s);}let u=t.size,a=Math.round(l/u*100);return a<80?e.push({check:"purpose-coverage",status:"warn",message:`${a}% purpose coverage (${l}/${u} source directories) \u2014 below 80% threshold`,details:n.slice(0,15),fix:"Create .purpose files in uncovered source directories"}):e.push({check:"purpose-coverage",status:"ok",message:`${a}% purpose coverage (${l}/${u} source directories)`}),e}async function N(i){let e=[],r=f.join(i,".paradigm","scan-index.json");if(!h.existsSync(r))return e.push({check:"orphaned-symbols",status:"advisory",message:"No scan-index.json found \u2014 run paradigm scan first"}),e;let t;try{t=JSON.parse(h.readFileSync(r,"utf8"));}catch{return e.push({check:"orphaned-symbols",status:"advisory",message:"Could not parse scan-index.json"}),e}let l=["components","gates","signals","flows","aspects"],n=new Map,u=new Set;for(let s of l){let c=t[s];if(!(!c||typeof c!="object")){for(let[d,p]of Object.entries(c))if(p.symbol&&n.set(p.symbol,d),p.related&&Array.isArray(p.related))for(let g of p.related)u.add(g);}}let a=new Set;for(let s of l){let c=t[s];if(!(!c||typeof c!="object"))for(let[,d]of Object.entries(c))d.symbol&&d.related&&Array.isArray(d.related)&&d.related.length>0&&a.add(d.symbol);}let o=[];for(let[s]of n)!u.has(s)&&!a.has(s)&&o.push(s);return o.length>0?e.push({check:"orphaned-symbols",status:"advisory",message:`${o.length} isolated symbol${o.length>1?"s":""} (no connections to other symbols)`,details:o.slice(0,20),fix:"Wire isolated symbols into features or remove them from .purpose files"}):e.push({check:"orphaned-symbols",status:"ok",message:"All symbols are connected"}),e}async function F(i){let e=[],r=f.join(i,"portal.yaml");if(!h.existsSync(r))return e.push({check:"stale-portal",status:"ok",message:"No portal.yaml found (no routes to check)"}),e;let t;try{t=v.load(h.readFileSync(r,"utf8"));}catch{return e.push({check:"stale-portal",status:"error",message:"Could not parse portal.yaml"}),e}if(!t?.routes||typeof t.routes!="object")return e.push({check:"stale-portal",status:"ok",message:"No routes defined in portal.yaml"}),e;let l=Object.keys(t.routes),n=[],u=[".ts",".js",".py",".rs",".go"],a=[];function o(c){let d=new Set(["node_modules","dist",".git",".paradigm","coverage","build","target"]);try{let p=h.readdirSync(c,{withFileTypes:!0});for(let g of p){if(d.has(g.name))continue;let y=f.join(c,g.name);if(g.isDirectory())o(y);else if(g.isFile()){let m=f.extname(g.name);u.includes(m)&&a.push(y);}}}catch{}}o(i);let s=a.map(c=>({full:c,name:f.basename(c,f.extname(c)).toLowerCase(),relPath:f.relative(i,c).toLowerCase()}));for(let c of l){let p=c.replace(/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+/i,"").split("/").filter(m=>m&&!m.startsWith(":")&&m!=="api");if(p.length===0)continue;let g=p[0].toLowerCase();s.some(m=>m.name.includes(g)||m.relPath.includes(g))||n.push(c);}return n.length>0?e.push({check:"stale-portal",status:"error",message:`${n.length} portal route${n.length>1?"s":""} with no matching implementation file`,details:n,fix:"Implement missing route handlers or remove stale routes from portal.yaml"}):e.push({check:"stale-portal",status:"ok",message:`All ${l.length} portal routes have matching implementation files`}),e}var _=[{pattern:/\btry to\b/i,label:"try to"},{pattern:/\bmaybe\b/i,label:"maybe"},{pattern:/\bif possible\b/i,label:"if possible"},{pattern:/\bconsider\b(?!-handoff)/i,label:"consider"},{pattern:/\bmight want to\b/i,label:"might want to"},{pattern:/\byou could\b/i,label:"you could"},{pattern:/\boptionally\b/i,label:"optionally"}];async function T(i){let e=[],r=k(i);if(r.length===0)return e.push({check:"instruction-vagueness",status:"ok",message:"No instruction files to check"}),e;let t=[];for(let l of r)for(let n=0;n<l.lines.length;n++){let u=l.lines[n];if(!u.trimStart().startsWith("```")&&!u.trim().startsWith("|---")){for(let{pattern:a,label:o}of _)if(a.test(u)){let s=u.trim(),c=s.length>80?s.slice(0,77)+"...":s;t.push(`${l.name}:${n+1} \u2014 "${o}" \u2014 ${c}`);}}}return t.length>0?e.push({check:"instruction-vagueness",status:"advisory",message:`${t.length} vague phrase${t.length>1?"s":""} in instruction files`,details:t.slice(0,20),fix:"Replace vague language with clear, actionable directives"}):e.push({check:"instruction-vagueness",status:"ok",message:"No vague language detected"}),e}async function I(i){let e=[],r=f.join(i,".paradigm","config.yaml");if(!h.existsSync(r))return e.push({check:"config-schema-validation",status:"advisory",message:"No .paradigm/config.yaml found"}),e;try{let t=h.readFileSync(r,"utf8"),{validateConfig:l}=await import('./config-schema-
|
|
5
|
+
`).toLowerCase(),o=[];for(let s of n){let c=s.toLowerCase(),d=s.includes("/")?s.split("/").pop():s;!a.includes(c)&&!a.includes(d.toLowerCase())&&o.push(s);}return o.length>0?e.push({check:"undocumented-stack",status:"advisory",message:`${o.length} dependenc${o.length>1?"ies":"y"} not mentioned in instruction files`,details:o.slice(0,20),fix:"Consider documenting major dependencies in CLAUDE.md for AI context"}):e.push({check:"undocumented-stack",status:"ok",message:"All major dependencies are documented"}),e}async function E(i){let e=[],t=C(i,[".ts",".js",".py",".rs",".go",".tsx",".jsx"]);if(t.size===0)return e.push({check:"purpose-coverage",status:"ok",message:"No source directories found"}),e;let l=0,n=[];for(let o of t)if(S(o,i))l++;else {let s=f.relative(i,o);n.push(s);}let u=t.size,a=Math.round(l/u*100);return a<80?e.push({check:"purpose-coverage",status:"warn",message:`${a}% purpose coverage (${l}/${u} source directories) \u2014 below 80% threshold`,details:n.slice(0,15),fix:"Create .purpose files in uncovered source directories"}):e.push({check:"purpose-coverage",status:"ok",message:`${a}% purpose coverage (${l}/${u} source directories)`}),e}async function N(i){let e=[],r=f.join(i,".paradigm","scan-index.json");if(!h.existsSync(r))return e.push({check:"orphaned-symbols",status:"advisory",message:"No scan-index.json found \u2014 run paradigm scan first"}),e;let t;try{t=JSON.parse(h.readFileSync(r,"utf8"));}catch{return e.push({check:"orphaned-symbols",status:"advisory",message:"Could not parse scan-index.json"}),e}let l=["components","gates","signals","flows","aspects"],n=new Map,u=new Set;for(let s of l){let c=t[s];if(!(!c||typeof c!="object")){for(let[d,p]of Object.entries(c))if(p.symbol&&n.set(p.symbol,d),p.related&&Array.isArray(p.related))for(let g of p.related)u.add(g);}}let a=new Set;for(let s of l){let c=t[s];if(!(!c||typeof c!="object"))for(let[,d]of Object.entries(c))d.symbol&&d.related&&Array.isArray(d.related)&&d.related.length>0&&a.add(d.symbol);}let o=[];for(let[s]of n)!u.has(s)&&!a.has(s)&&o.push(s);return o.length>0?e.push({check:"orphaned-symbols",status:"advisory",message:`${o.length} isolated symbol${o.length>1?"s":""} (no connections to other symbols)`,details:o.slice(0,20),fix:"Wire isolated symbols into features or remove them from .purpose files"}):e.push({check:"orphaned-symbols",status:"ok",message:"All symbols are connected"}),e}async function F(i){let e=[],r=f.join(i,"portal.yaml");if(!h.existsSync(r))return e.push({check:"stale-portal",status:"ok",message:"No portal.yaml found (no routes to check)"}),e;let t;try{t=v.load(h.readFileSync(r,"utf8"));}catch{return e.push({check:"stale-portal",status:"error",message:"Could not parse portal.yaml"}),e}if(!t?.routes||typeof t.routes!="object")return e.push({check:"stale-portal",status:"ok",message:"No routes defined in portal.yaml"}),e;let l=Object.keys(t.routes),n=[],u=[".ts",".js",".py",".rs",".go"],a=[];function o(c){let d=new Set(["node_modules","dist",".git",".paradigm","coverage","build","target"]);try{let p=h.readdirSync(c,{withFileTypes:!0});for(let g of p){if(d.has(g.name))continue;let y=f.join(c,g.name);if(g.isDirectory())o(y);else if(g.isFile()){let m=f.extname(g.name);u.includes(m)&&a.push(y);}}}catch{}}o(i);let s=a.map(c=>({full:c,name:f.basename(c,f.extname(c)).toLowerCase(),relPath:f.relative(i,c).toLowerCase()}));for(let c of l){let p=c.replace(/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+/i,"").split("/").filter(m=>m&&!m.startsWith(":")&&m!=="api");if(p.length===0)continue;let g=p[0].toLowerCase();s.some(m=>m.name.includes(g)||m.relPath.includes(g))||n.push(c);}return n.length>0?e.push({check:"stale-portal",status:"error",message:`${n.length} portal route${n.length>1?"s":""} with no matching implementation file`,details:n,fix:"Implement missing route handlers or remove stale routes from portal.yaml"}):e.push({check:"stale-portal",status:"ok",message:`All ${l.length} portal routes have matching implementation files`}),e}var _=[{pattern:/\btry to\b/i,label:"try to"},{pattern:/\bmaybe\b/i,label:"maybe"},{pattern:/\bif possible\b/i,label:"if possible"},{pattern:/\bconsider\b(?!-handoff)/i,label:"consider"},{pattern:/\bmight want to\b/i,label:"might want to"},{pattern:/\byou could\b/i,label:"you could"},{pattern:/\boptionally\b/i,label:"optionally"}];async function T(i){let e=[],r=k(i);if(r.length===0)return e.push({check:"instruction-vagueness",status:"ok",message:"No instruction files to check"}),e;let t=[];for(let l of r)for(let n=0;n<l.lines.length;n++){let u=l.lines[n];if(!u.trimStart().startsWith("```")&&!u.trim().startsWith("|---")){for(let{pattern:a,label:o}of _)if(a.test(u)){let s=u.trim(),c=s.length>80?s.slice(0,77)+"...":s;t.push(`${l.name}:${n+1} \u2014 "${o}" \u2014 ${c}`);}}}return t.length>0?e.push({check:"instruction-vagueness",status:"advisory",message:`${t.length} vague phrase${t.length>1?"s":""} in instruction files`,details:t.slice(0,20),fix:"Replace vague language with clear, actionable directives"}):e.push({check:"instruction-vagueness",status:"ok",message:"No vague language detected"}),e}async function I(i){let e=[],r=f.join(i,".paradigm","config.yaml");if(!h.existsSync(r))return e.push({check:"config-schema-validation",status:"advisory",message:"No .paradigm/config.yaml found"}),e;try{let t=h.readFileSync(r,"utf8"),{validateConfig:l}=await import('./config-schema-GUQY2QN7.js'),n=l(t),u=[];for(let a of n.errors)u.push(`Error: ${a}`);for(let a of n.warnings)u.push(`Warning: ${a}`);n.errors.length>0?e.push({check:"config-schema-validation",status:"error",message:`${n.errors.length} schema error${n.errors.length>1?"s":""} in config.yaml`,details:u,fix:"Fix invalid fields in .paradigm/config.yaml"}):n.warnings.length>0?e.push({check:"config-schema-validation",status:"warn",message:`${n.warnings.length} unrecognized key${n.warnings.length>1?"s":""} in config.yaml`,details:u,fix:"Check for typos in .paradigm/config.yaml field names"}):e.push({check:"config-schema-validation",status:"ok",message:"config.yaml schema is valid"});}catch(t){e.push({check:"config-schema-validation",status:"error",message:`Could not validate config.yaml: ${t.message}`});}return e}async function L(i){let e=[],r=[];function t(a){let o=new Set(["node_modules","dist",".git",".paradigm","coverage","build"]);try{let s=h.readdirSync(a,{withFileTypes:!0});for(let c of s){if(o.has(c.name))continue;let d=f.join(a,c.name);c.isDirectory()?t(d):c.name===".purpose"&&r.push(d);}}catch{}}if(t(i),r.length===0)return e.push({check:"purpose-file-health",status:"ok",message:"No .purpose files to check"}),e;let l=[],n=0,u="";for(let a of r)try{let s=h.readFileSync(a,"utf8").split(`
|
|
6
6
|
`).length;if(s>n&&(n=s,u=f.relative(i,a)),s>500){let c=s>1e3?"!!":"!";l.push(`${c} ${f.relative(i,a)} (${s} lines)`);}}catch{continue}return l.length>0?e.push({check:"purpose-file-health",status:"warn",message:`${l.length} oversized .purpose file${l.length>1?"s":""} (largest: ${u} at ${n} lines)`,details:l,fix:"Split large .purpose files by component type or subdirectory"}):e.push({check:"purpose-file-health",status:"ok",message:`${r.length} .purpose files, all under 500 lines`}),e}async function W(i,e){let r=a.command("doctor:context-audit").start("Running context audit checks"),t=[];t.push(...await $(i)),t.push(...await A(i)),t.push(...await j(i)),t.push(...await E(i)),t.push(...await N(i)),t.push(...await F(i)),t.push(...await T(i)),t.push(...await I(i)),t.push(...await L(i));let l=t.filter(a=>a.status==="error").length,n=t.filter(a=>a.status==="warn").length,u=t.filter(a=>a.status==="advisory").length;return l>0?r.error("Context audit found issues",{errors:l,warnings:n,advisories:u}):r.success("Context audit complete",{warnings:n,advisories:u}),t}export{W as runContextAudit};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {e}from'./chunk-JIXHEBGK.js';import {e as e$1}from'./chunk-QT2LKB3P.js';import'./chunk-
|
|
2
|
+
import {e}from'./chunk-JIXHEBGK.js';import {e as e$1}from'./chunk-QT2LKB3P.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
4
|
`)),m.start("Analyzing context files...");let C=await e(s),r=[];for(let e of C){let n=f(e,s);n&&r.push(n);}let A=await e$1(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(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a}from'./chunk-FYDRENK7.js';import {d,c}from'./chunk-EKZDFEJW.js';import'./chunk-
|
|
2
|
+
import {a}from'./chunk-FYDRENK7.js';import {d,c}from'./chunk-EKZDFEJW.js';import'./chunk-5TAVYPOV.js';import*as y from'path';import o from'chalk';async function p(g,n){let m=g?y.resolve(g):process.cwd(),s,a$1;if(n.days){let l=parseInt(n.days);s=new Date,s.setDate(s.getDate()-l);}n.from&&(s=new Date(n.from)),n.to&&(a$1=new Date(n.to));let e=new a(m).getCostSummary(s,a$1);if(n.json){console.log(JSON.stringify(e,null,2));return}if(console.log(),console.log(o.blue("\u2501".repeat(50))),console.log(o.blue(" Orchestration Cost Summary")),console.log(o.blue("\u2501".repeat(50))),console.log(),s||a$1){let l=s?s.toISOString().slice(0,10):"beginning",t=a$1?a$1.toISOString().slice(0,10):"now";console.log(o.gray(` Period: ${l} to ${t}`)),console.log();}if(console.log(o.cyan(" Totals:")),console.log(o.white(` Orchestrations: ${e.orchestrationCount}`)),console.log(o.white(` Total tokens: ${d(e.totalTokens)}`)),console.log(o.white(` Total cost: ${c(e.totalCost)}`)),console.log(),Object.keys(e.byModel).length>0){console.log(o.cyan(" By Model:"));for(let[l,t]of Object.entries(e.byModel)){let c$1=(t.cost/e.totalCost*100).toFixed(1);console.log(o.gray(` ${l.padEnd(8)} ${c(t.cost).padStart(10)} (${c$1}%) - ${t.count} calls`));}console.log();}if(Object.keys(e.byAgent).length>0&&n.detailed){console.log(o.cyan(" By Agent:"));for(let[l,t]of Object.entries(e.byAgent)){let c$1=(t.cost/e.totalCost*100).toFixed(1);console.log(o.gray(` ${l.padEnd(12)} ${c(t.cost).padStart(10)} (${c$1}%) - ${t.count} calls`));}console.log();}if(e.byDay.length>0&&n.detailed){console.log(o.cyan(" By Day (recent):"));let l=e.byDay.slice(-7);for(let t of l){let c$1="\u2588".repeat(Math.ceil(t.cost/e.totalCost*20));console.log(o.gray(` ${t.date} ${c(t.cost).padStart(10)} ${o.blue(c$1)}`));}console.log();}n.detailed&&(console.log(o.cyan(" Model Pricing Reference:")),console.log(o.gray(" opus: $15.00 / $75.00 per 1M tokens (in/out)")),console.log(o.gray(" sonnet: $3.00 / $15.00 per 1M tokens (in/out)")),console.log(o.gray(" haiku: $0.25 / $1.25 per 1M tokens (in/out)")),console.log()),e.totalCost>1&&(console.log(o.yellow(" Tips to reduce costs:")),console.log(o.gray(" - Use haiku for builder/tester agents")),console.log(o.gray(' - Set budget limits: --budget "cost=5"')),console.log(o.gray(' - Compare modes: paradigm team orchestrate "..." --compare')),console.log());}export{p as teamCostCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a}from'./chunk-EKZDFEJW.js';import'./chunk-
|
|
2
|
+
import {a}from'./chunk-EKZDFEJW.js';import'./chunk-5TAVYPOV.js';import*as v from'fs';import*as m from'path';import {execSync,spawn}from'child_process';import {EventEmitter}from'events';var C=class{name="cursor-cli";agentPath=null;constructor(){}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return true}supportsMcp(){return true}getTokenCost(s){return a[s]}async isAvailable(){if(!this.isCursorEnvironment())return false;try{let s=execSync("which agent",{encoding:"utf-8"}).trim();if(s)return this.agentPath=s,!0}catch{let s=["/usr/local/bin/agent",m.join(process.env.HOME||"",".local/bin/agent"),m.join(process.env.HOME||"",".cursor/bin/agent"),"/Applications/Cursor.app/Contents/Resources/app/bin/agent"];for(let n of s)if(v.existsSync(n))return this.agentPath=n,true}return false}isCursorEnvironment(){return process.env.TERM_PROGRAM==="cursor"||!!process.env.CURSOR_SESSION||!!process.env.CURSOR_TRACE_ID||(process.env.VSCODE_CWD?.toLowerCase().includes("cursor")??false)||(process.env.VSCODE_NLS_CONFIG?.toLowerCase().includes("cursor")??false)||process.env.TERM_PROGRAM==="vscode"&&(process.env.VSCODE_GIT_ASKPASS_NODE?.toLowerCase().includes("cursor")??false)}async*spawn(s,n){if(!this.agentPath){yield {type:"error",content:"Cursor agent CLI not found",timestamp:new Date().toISOString()};return}let t=this.buildPrompt(s,n);yield {type:"text",content:`Starting ${s.name} agent via Cursor CLI...
|
|
3
3
|
`,timestamp:new Date().toISOString()};let g=["-p",t.slice(0,8e3)];if(n.model){let e=this.mapToCursorModel(n.model);e&&g.push("--model",e);}let r=new EventEmitter,h="",d={input:0,output:0,total:0},i=null,c=false,a=spawn(this.agentPath,g,{cwd:n.workingDirectory||process.cwd(),env:{...process.env},stdio:["pipe","pipe","pipe"]});a.stdout?.on("data",e=>{let o=e.toString();h+=o,r.emit("text",o);}),a.stderr?.on("data",e=>{let o=e.toString();o.toLowerCase().includes("error")?(i=o,r.emit("error",new Error(o))):r.emit("progress",o);}),a.on("close",e=>{c=true;let o=Math.ceil(h.length/4),y=Math.ceil(t.length/4);d={input:y,output:o,total:y+o},r.emit("done",e);}),a.on("error",e=>{i=e.message,r.emit("error",e);});let f=n.timeout||300*1e3,S=setTimeout(()=>{a.kill(),i=`Cursor agent timed out after ${f/1e3}s`,r.emit("timeout");},f),p=[],l=null,u=e=>{l?(l(e),l=null):p.push(e);};for(r.on("text",e=>{u({type:"text",content:e,timestamp:new Date().toISOString()});}),r.on("progress",e=>{u({type:"text",content:".",timestamp:new Date().toISOString()});}),r.on("done",()=>{clearTimeout(S),u({type:"done",content:"Agent completed",usage:d,timestamp:new Date().toISOString()});}),r.on("timeout",()=>{u({type:"error",content:i||"Timeout",timestamp:new Date().toISOString()});}),r.on("error",e=>{clearTimeout(S),u({type:"error",content:e.message,timestamp:new Date().toISOString()});});!c||p.length>0;)if(p.length>0){let e=p.shift();if(yield e,e.type==="done"||e.type==="error")break}else {let e=await new Promise(o=>{l=o,setTimeout(()=>o(null),100);});if(e&&(yield e,e.type==="done"||e.type==="error"))break}i&&!c&&(yield {type:"error",content:i,timestamp:new Date().toISOString()});}buildPrompt(s,n){let t=[];return t.push(`# ${s.name.toUpperCase()} Agent`),t.push(""),t.push("## Role"),t.push(s.role),t.push(""),t.push("## Task"),t.push(n.task),t.push(""),n.context.systemPrompt&&(t.push("## Context"),t.push(n.context.systemPrompt.slice(0,3e3)),t.push("")),n.context.symbols.length>0&&(t.push("## Symbols"),t.push(n.context.symbols.join(", ")),t.push("")),n.context.handoffContext&&(t.push("## From Previous Agent"),t.push(n.context.handoffContext),t.push("")),t.push("## Instructions"),t.push("Complete the task above. Be concise and focused. Keep response under 500 words."),t.join(`
|
|
4
4
|
`)}mapToCursorModel(s){switch(s){case "opus":return "claude-opus-4-6";case "sonnet":return "claude-sonnet-4-5-20250929";case "haiku":return "claude-haiku-4-5-20251001";default:return null}}};export{C as CursorCliProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {d,a,c as c$1,b}from'./chunk-W7C6FFMO.js';import'./chunk-4TXOVRWD.js';import {c,d as d$1,e as e$1}from'./chunk-JQKKVAAN.js';import'./chunk-
|
|
2
|
+
import {d,a,c as c$1,b}from'./chunk-W7C6FFMO.js';import'./chunk-4TXOVRWD.js';import {c,d as d$1,e as e$1}from'./chunk-JQKKVAAN.js';import'./chunk-5TAVYPOV.js';import*as s from'fs';import*as o from'path';import e from'chalk';import j from'ora';async function D(d$2,a$1){let r=d$2?o.resolve(d$2):process.cwd(),t=o.basename(r),u=o.join(r,".paradigm"),i=j();if(!d(r))if(a$1.init){i.start("Creating .paradigm config...");let n=c(t);s.writeFileSync(u,d$1(n),"utf8"),i.succeed(e.green(".paradigm config created"));}else console.log(e.red(`
|
|
3
3
|
\u274C No .paradigm file found.`)),console.log(e.gray(`
|
|
4
4
|
Run with --init to create a default .paradigm config:`)),console.log(e.cyan(` paradigm cursorrules --init
|
|
5
5
|
`)),process.exit(1);let c$2;try{let n=s.readFileSync(u,"utf8");c$2=e$1(n);}catch(n){let b=n;console.log(e.red(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{f as findDecisionsForSymbol,g as getDecisionSummary,e as loadDecision,d as loadDecisions,a as recordDecision,c as supersedeDecision,b as updateDecision}from'./chunk-Q2J542ST.js';import'./chunk-
|
|
2
|
+
export{f as findDecisionsForSymbol,g as getDecisionSummary,e as loadDecision,d as loadDecisions,a as recordDecision,c as supersedeDecision,b as updateDecision}from'./chunk-Q2J542ST.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {g,i as i$1}from'./chunk-
|
|
2
|
+
import {g,i as i$1}from'./chunk-WS2N27RX.js';import'./chunk-5TAVYPOV.js';import e from'chalk';async function i(n,r){let l=process.cwd(),o=await g(l,n);if(!o){console.error(e.red(`
|
|
3
3
|
Entry not found: ${n}
|
|
4
4
|
`)),process.exitCode=1;return}if(r.dryRun){console.log(e.cyan(`
|
|
5
5
|
[dry-run] Would delete lore entry:`)),console.log(e.white(` ${o.id} - ${o.title}`)),console.log(e.gray(` Type: ${o.type} | Author: ${o.author} | ${o.timestamp}`)),console.log(e.gray(` Symbols: ${(o.symbols_touched||[]).join(", ")}`)),console.log(e.cyan(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {b}from'./chunk-
|
|
2
|
+
import {b}from'./chunk-J6KWGCHN.js';import'./chunk-TYWB5IQJ.js';import'./chunk-ORDKEGII.js';import'./chunk-BV5PRPLB.js';import'./chunk-AO7ZSRME.js';import'./chunk-FYDRENK7.js';import'./chunk-EKZDFEJW.js';import'./chunk-SHD27BQX.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as a from'path';import o from'chalk';async function D(l,f,t){let d=f?a.resolve(f):process.cwd();if(!l){t.json?console.log(JSON.stringify({error:"Orchestration ID required"})):(console.log(o.red(`
|
|
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 DISCIPLINE_MAPPINGS,c as GENERIC_SYMBOL_MAPPING,f as STACK_PRESETS,a as detectDiscipline,g as detectStack,d as getDisciplineConfig,e as getDisciplineScanPatterns,h as getStackConfig,i as listStackPresets}from'./chunk-UIKLE3WD.js';import'./chunk-
|
|
2
|
+
export{b as DISCIPLINE_MAPPINGS,c as GENERIC_SYMBOL_MAPPING,f as STACK_PRESETS,a as detectDiscipline,g as detectStack,d as getDisciplineConfig,e as getDisciplineScanPatterns,h as getStackConfig,i as listStackPresets}from'./chunk-UIKLE3WD.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -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,e as createEmptyPremiseFile,k as createSnapshot,n as createSymbolIndex,E as createSymbolString,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,t as searchSymbols,f as serializePremiseFile,i as updateNodePosition}from'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./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,e as createEmptyPremiseFile,k as createSnapshot,n as createSymbolIndex,E as createSymbolString,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,t as searchSymbols,f as serializePremiseFile,i as updateNodePosition}from'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-5TAVYPOV.js';import*as lt from'fs';import {realpathSync,readlinkSync,readdirSync,readdir as readdir$1,lstatSync}from'fs';import {z as z$1}from'zod';import*as L from'path';import {win32,posix}from'path';import {fileURLToPath}from'url';import {realpath,readlink,readdir,lstat}from'fs/promises';import {EventEmitter}from'events';import Fi from'stream';import {StringDecoder}from'string_decoder';function Mi(t){return typeof t>"u"||t===null}function sr(t){return typeof t=="object"&&t!==null}function rr(t){return Array.isArray(t)?t:Mi(t)?[]:[t]}function nr(t,e){var i,s,r,n;if(e)for(n=Object.keys(e),i=0,s=n.length;i<s;i+=1)r=n[i],t[r]=e[r];return t}function or(t,e){var i="",s;for(s=0;s<e;s+=1)i+=t;return i}function ar(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var lr=Mi,hr=sr,ur=rr,cr=or,pr=ar,fr=nr,O={isNothing:lr,isObject:hr,toArray:ur,repeat:cr,isNegativeZero:pr,extend:fr};function $i(t,e){var i="",s=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(i+='in "'+t.mark.name+'" '),i+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(i+=`
|
|
3
3
|
|
|
4
4
|
`+t.mark.snippet),s+" "+i):s}function It(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=$i(this,false),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||"";}It.prototype=Object.create(Error.prototype);It.prototype.constructor=It;It.prototype.toString=function(t){return this.name+": "+$i(this,t)};var W=It;function pe(t,e,i,s,r){var n="",o="",a=Math.floor(r/2)-1;return s-e>a&&(n=" ... ",e=s-a+n.length),i-s>a&&(o=" ...",i=s+a-o.length),{str:n+t.slice(e,i).replace(/\t/g,"\u2192")+o,pos:s-e+n.length}}function fe(t,e){return O.repeat(" ",e-t.length)+t}function dr(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var i=/\r?\n|\r|\0/g,s=[0],r=[],n,o=-1;n=i.exec(t.buffer);)r.push(n.index),s.push(n.index+n[0].length),t.position<=n.index&&o<0&&(o=s.length-2);o<0&&(o=s.length-1);var a="",l,h,c=Math.min(t.line+e.linesAfter,r.length).toString().length,u=e.maxLength-(e.indent+c+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)h=pe(t.buffer,s[o-l],r[o-l],t.position-(s[o]-s[o-l]),u),a=O.repeat(" ",e.indent)+fe((t.line-l+1).toString(),c)+" | "+h.str+`
|
|
5
5
|
`+a;for(h=pe(t.buffer,s[o],r[o],t.position,u),a+=O.repeat(" ",e.indent)+fe((t.line+1).toString(),c)+" | "+h.str+`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-5TAVYPOV.js';var l="https://api.nevr.land",h=class extends Error{constructor(t,e,a){super(t),this.status=e,this.code=a,this.name="RegistryError";}},d=class{baseUrl;authState=null;authStore;constructor(t){this.baseUrl=(t?.baseUrl??process.env.NEVR_REGISTRY_URL??l).replace(/\/$/,""),this.authStore=t?.authStore??null;}async loadAuth(){if(!this.authStore)return false;try{return this.authState=await this.authStore.load(),this.authState&&this.authState.expiresAt<Date.now()&&await this.refreshAuth(),!!this.authState}catch{return false}}async saveAuth(){this.authStore&&this.authState&&await this.authStore.save(this.authState);}async login(t,e){let a=await this.post("/api/v1/auth/login",{email:t,password:e},false);return this.authState={accessToken:a.access_token,refreshToken:a.refresh_token,expiresAt:Date.now()+a.expires_in*1e3,email:a.user.email},await this.saveAuth(),{email:a.user.email}}async logout(){this.authState=null,this.authStore&&await this.authStore.clear();}async whoami(){if(!this.authState&&!await this.loadAuth())return null;try{return await this.get("/api/v1/auth/me")}catch{return null}}async refreshAuth(){if(this.authState?.refreshToken)try{let t=await this.post("/api/v1/auth/refresh",{refresh_token:this.authState.refreshToken},!1);this.authState.accessToken=t.access_token,this.authState.refreshToken=t.refresh_token,this.authState.expiresAt=Date.now()+t.expires_in*1e3,await this.saveAuth();}catch{this.authState=null;}}get isAuthenticated(){return !!this.authState?.accessToken}get currentEmail(){return this.authState?.email??null}async search(t,e){let a=new URLSearchParams({q:t});return e?.tags&&a.set("tags",e.tags),e?.domain&&a.set("domain",e.domain),e?.page&&a.set("page",String(e.page)),this.get(`/api/v1/agents?${a}`)}async getAgent(t,e){let a=t.replace("@","");return this.get(`/api/v1/agents/${a}/${e}`)}async getVersions(t,e){let a=t.replace("@","");return this.get(`/api/v1/agents/${a}/${e}/versions`)}async registerAgent(t){await this.ensureAuth();let e=t.name,a=t.scope,s=e;if(!a&&e?.includes("/")){let r=e.indexOf("/");a=e.substring(0,r),s=e.substring(r+1);}return this.post("/api/v1/agents",{...t,scope:a,name:s})}async publishVersion(t,e,a,s){await this.ensureAuth();let r=t.replace("@",""),o=`${this.baseUrl}/api/v1/agents/${r}/${e}/versions`,n=new FormData;n.append("package",new Blob([new Uint8Array(a)]),`${e}.nevr.tar.gz`),n.append("manifest",JSON.stringify(s));let i=await fetch(o,{method:"POST",headers:{Authorization:`Bearer ${this.authState.accessToken}`},body:n});if(!i.ok){let u=await i.text();throw new h(`Publish failed: ${u}`,i.status)}return i.json()}async downloadPackage(t,e,a){let s=t.replace("@",""),r=a??"latest",o=`${this.baseUrl}/api/v1/agents/${s}/${e}/${r}/download`,n=await fetch(o,{redirect:"follow"});if(!n.ok)throw new h("Download failed",n.status);let i=Buffer.from(await n.arrayBuffer()),{createHash:u}=await import('crypto'),c=u("sha256").update(i).digest("hex");return {buffer:i,hash:c}}async ensureAuth(){if(!this.authState&&!await this.loadAuth())throw new h("Not authenticated. Run: nevr login",401)}authHeaders(){let t={"Content-Type":"application/json"};return this.authState?.accessToken&&(t.Authorization=`Bearer ${this.authState.accessToken}`),t}async get(t){let e=await fetch(`${this.baseUrl}${t}`,{headers:this.authHeaders()});if(!e.ok){let a=await e.text().catch(()=>"Unknown error");throw new h(a,e.status)}return e.json()}async post(t,e,a=true){a&&await this.ensureAuth();let s=await fetch(`${this.baseUrl}${t}`,{method:"POST",headers:this.authHeaders(),body:JSON.stringify(e)});if(!s.ok){let r=await s.text().catch(()=>"Unknown error");throw new h(r,s.status)}return s.json()}};
|
|
3
3
|
export{d as RegistryClient,h as RegistryError};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{q as ContextEnricher,j as FlowTracker,n as IncidentGrouper,s as PatternImporter,f as PatternMatcher,r as PatternSuggester,k as Sentinel,a as SentinelClient,c as SentinelTransport,p as StatsCalculator,o as TimelineBuilder,b as createSentinelClient,d as createSentinelTransport,l as detectSymbols,e as enableSentinel,m as generateConfig,i as loadAllSeedPatterns,h as loadParadigmPatterns,g as loadUniversalPatterns}from'./chunk-4QADCWPU.js';export{b as DEFAULT_AUTH_CONFIG,c as DEFAULT_RATE_LIMIT_CONFIG,d as DEFAULT_SERVER_CONFIG,h as PARADIGM_SCHEMA,i as SYMPHONY_SCHEMA,a as SentinelStorage,e as loadConfig,g as loadServerConfig,f as writeConfig}from'./chunk-NKYNHSA5.js';import'./chunk-
|
|
2
|
+
export{q as ContextEnricher,j as FlowTracker,n as IncidentGrouper,s as PatternImporter,f as PatternMatcher,r as PatternSuggester,k as Sentinel,a as SentinelClient,c as SentinelTransport,p as StatsCalculator,o as TimelineBuilder,b as createSentinelClient,d as createSentinelTransport,l as detectSymbols,e as enableSentinel,m as generateConfig,i as loadAllSeedPatterns,h as loadParadigmPatterns,g as loadUniversalPatterns}from'./chunk-4QADCWPU.js';export{b as DEFAULT_AUTH_CONFIG,c as DEFAULT_RATE_LIMIT_CONFIG,d as DEFAULT_SERVER_CONFIG,h as PARADIGM_SCHEMA,i as SYMPHONY_SCHEMA,a as SentinelStorage,e as loadConfig,g as loadServerConfig,f as writeConfig}from'./chunk-NKYNHSA5.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{e as findGateFiles,g as formatValidationResult,d as getDefaultGateConfig,a as parseGateConfig,b as parseGateFile,c as serializeGateConfig,f as validateGateConfig}from'./chunk-QT2LKB3P.js';import'./chunk-
|
|
2
|
+
export{e as findGateFiles,g as formatValidationResult,d as getDefaultGateConfig,a as parseGateConfig,b as parseGateFile,c as serializeGateConfig,f as validateGateConfig}from'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{z as ContextEnricher,g as DEFAULT_AUTH_CONFIG,h as DEFAULT_RATE_LIMIT_CONFIG,i as DEFAULT_SERVER_CONFIG,s as FlowTracker,w as IncidentGrouper,m as PARADIGM_SCHEMA,B as PatternImporter,o as PatternMatcher,A as PatternSuggester,n as SYMPHONY_SCHEMA,t as Sentinel,a as SentinelClient,f as SentinelStorage,c as SentinelTransport,y as StatsCalculator,x as TimelineBuilder,b as createSentinelClient,d as createSentinelTransport,u as detectSymbols,e as enableSentinel,v as generateConfig,r as loadAllSeedPatterns,j as loadConfig,q as loadParadigmPatterns,l as loadServerConfig,p as loadUniversalPatterns,k as writeConfig}from'./chunk-KLBH26PA.js';import'./chunk-
|
|
2
|
+
export{z as ContextEnricher,g as DEFAULT_AUTH_CONFIG,h as DEFAULT_RATE_LIMIT_CONFIG,i as DEFAULT_SERVER_CONFIG,s as FlowTracker,w as IncidentGrouper,m as PARADIGM_SCHEMA,B as PatternImporter,o as PatternMatcher,A as PatternSuggester,n as SYMPHONY_SCHEMA,t as Sentinel,a as SentinelClient,f as SentinelStorage,c as SentinelTransport,y as StatsCalculator,x as TimelineBuilder,b as createSentinelClient,d as createSentinelTransport,u as detectSymbols,e as enableSentinel,v as generateConfig,r as loadAllSeedPatterns,j as loadConfig,q as loadParadigmPatterns,l as loadServerConfig,p as loadUniversalPatterns,k as writeConfig}from'./chunk-KLBH26PA.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,d,e,f,g,c,h}from'./chunk-BFD3GFRK.js';import'./chunk-
|
|
2
|
+
import {a,d,e,f,g,c,h}from'./chunk-BFD3GFRK.js';import'./chunk-5TAVYPOV.js';import {Router}from'express';function y(e$1){let a$1=Router();return a$1.get("/manifest",(o,s)=>{try{let t=a(e$1),n=d(e$1,t);s.json(n);}catch(t){s.status(500).json({error:"Failed to build docs manifest",detail:String(t)});}}),a$1.get("/symbol/:id",(o,s)=>{try{let t=e(e$1,o.params.id);if(!t){s.status(404).json({error:`Symbol "${o.params.id}" not found`});return}s.json(t);}catch(t){s.status(500).json({error:"Failed to build symbol page",detail:String(t)});}}),a$1.get("/flow/:id",(o,s)=>{try{let t=f(e$1,o.params.id);if(!t){s.status(404).json({error:`Flow "${o.params.id}" not found`});return}s.json(t);}catch(t){s.status(500).json({error:"Failed to build flow page",detail:String(t)});}}),a$1.get("/portal",(o,s)=>{try{let t=g(e$1);s.json(t);}catch(t){s.status(500).json({error:"Failed to build portal page",detail:String(t)});}}),a$1.get("/page/:slug",(o,s)=>{try{let t=a(e$1),n=c(e$1,o.params.slug,t);if(!n){s.status(404).json({error:`Page "${o.params.slug}" not found`});return}s.json(n);}catch(t){s.status(500).json({error:"Failed to load custom page",detail:String(t)});}}),a$1.get("/search",(o,s)=>{try{let t=o.query.q||"";if(!t){s.json({count:0,results:[]});return}let n=o.query.limit?parseInt(o.query.limit,10):20,u=h(e$1,t,n);s.json({count:u.length,results:u});}catch(t){s.status(500).json({error:"Failed to search docs",detail:String(t)});}}),a$1}export{y as createDocsRouter};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,d,e,f,g,b}from'./chunk-BFD3GFRK.js';import'./chunk-
|
|
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-DNAMH4YI.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(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-5TAVYPOV.js';import*as d from'fs';import*as m from'path';import*as _ from'crypto';import {execSync}from'child_process';import u from'chalk';function x(o){return o.split(`
|
|
3
3
|
`).map(a=>a.trimEnd()).filter(a=>a.trim().length>0).join(`
|
|
4
4
|
`).replace(/\s+/g," ").trim()}function j(o){let a=[],l=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/gm,i;for(;(i=l.exec(o))!==null;)a.push({oldStart:parseInt(i[1],10),oldCount:i[2]!==void 0?parseInt(i[2],10):1,newCount:i[4]!==void 0?parseInt(i[4],10):1});return a}function T(o,a,l,i,c){let h;try{h=execSync(`git diff ${l}..HEAD --unified=0 -- "${a}"`,{cwd:o,encoding:"utf8",timeout:5e3});}catch{return null}if(!h.trim())return null;let p=j(h),s=0;for(let t of p){if(t.oldStart+t.oldCount<=i){s+=t.newCount-t.oldCount;continue}if(t.oldStart<c)return null;break}return s===0?null:{newStart:i+s,newEnd:c+s}}function F(o,a,l,i,c,h,p){let s=m.isAbsolute(a)?a:m.join(o,a);if(!d.existsSync(s))return false;try{let t=d.readFileSync(s,"utf8"),r=i===c?`${l}:${i}`:`${l}:${i}-${c}`,n=h===p?`${l}:${h}`:`${l}:${h}-${p}`;return t.includes(r)?(d.writeFileSync(s,t.replace(r,n),"utf8"),!0):!1}catch{return false}}async function W(o){let a=process.cwd(),l=m.join(a,".paradigm","aspect-graph.db");if(!d.existsSync(l)){o.json?console.log(JSON.stringify({driftedCount:0,healedCount:0,cleanCount:0,missingCount:0,details:[]})):console.log(u.gray("No aspect-graph.db found. Run paradigm_aspect_check to initialize."));return}let i=o.autoHeal!==false;try{let c=(await import('sql.js')).default,h=await c(),p=d.readFileSync(l),s=new h.Database(p),t=[];try{let n=s.prepare("SELECT id, aspect_id, file_path, start_line, end_line, content_hash, normalized_hash, materialized_at_commit, drifted FROM anchors"),g=[];for(;n.step();){let e=n.getAsObject();g.push(e);}n.free();for(let e of g){let S=m.isAbsolute(e.file_path)?e.file_path:m.join(a,e.file_path);if(!d.existsSync(S)){t.push({aspectId:e.aspect_id,path:e.file_path,startLine:e.start_line,endLine:e.end_line,status:"missing"});continue}let C=d.readFileSync(S,"utf8").split(`
|
|
5
5
|
`),D=Math.max(0,e.start_line-1),R=Math.min(C.length,e.end_line),y=C.slice(D,R).join(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a as a$1}from'./chunk-LKAT7IAK.js';import'./chunk-
|
|
2
|
+
import {a as a$1}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as a from'fs';import*as h from'path';import o from'chalk';var E=`# Echoes - Error to Symbol Mapping
|
|
3
3
|
# When errors occur, they echo back to their source symbol.
|
|
4
4
|
# Run \`paradigm echo ERROR_CODE\` to look up context.
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {g,h}from'./chunk-
|
|
2
|
+
import {g,h}from'./chunk-WS2N27RX.js';import'./chunk-5TAVYPOV.js';import s from'chalk';async function u(n,e){let a=process.cwd();if(!await g(a,n)){console.error(s.red(`
|
|
3
3
|
Entry not found: ${n}
|
|
4
4
|
`)),process.exitCode=1;return}let t={};if(e.title&&(t.title=e.title),e.summary&&(t.summary=e.summary),e.type){let r=["agent-session","human-note","decision","review","incident","milestone"];if(!r.includes(e.type)){console.error(s.red(`Invalid type: ${e.type}. Valid: ${r.join(", ")}`)),process.exitCode=1;return}t.type=e.type;}if(e.symbols&&(t.symbols_touched=e.symbols.split(",").map(r=>r.trim())),e.tags&&(t.tags=e.tags.split(",").map(r=>r.trim())),e.learnings&&(t.learnings=e.learnings.split(",").map(r=>r.trim())),Object.keys(t).length===0){console.log(s.yellow(`
|
|
5
5
|
No changes specified. Use --title, --summary, --type, --symbols, --tags, or --learnings.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {g,i,a as a$1,f as f$1,j,d as d$1,e,k,m,l}from'./chunk-KYA4TP26.js';import {h,f,a,g as g$1,d,b}from'./chunk-WR6D3SC6.js';import'./chunk-
|
|
2
|
+
import {g,i,a as a$1,f as f$1,j,d as d$1,e,k,m,l}from'./chunk-KYA4TP26.js';import {h,f,a,g as g$1,d,b}from'./chunk-WR6D3SC6.js';import'./chunk-5TAVYPOV.js';import t from'chalk';async function M(e){let o=process.cwd(),r=g(o),c=i(r),f$1=Object.keys(r.checks);if(e.json){h({level:r.level,orchestration:r.orchestration,overrides:r.checks,resolved:c});return}f("Enforcement Configuration"),a(""),g$1("Level",$(r.level)),g$1("Orchestration threshold",String(r.orchestration.threshold)+" files"),g$1("Detection",r.orchestration.detection),g$1("Overrides",f$1.length>0?String(f$1.length):t.dim("none")),a("");let i$1=30,m=12,b=12;a(" "+t.dim("Check ID".padEnd(i$1))+t.dim("Severity".padEnd(m))+t.dim("Source")),a(" "+t.dim("\u2500".repeat(i$1+m+b)));for(let v of a$1){let j=c[v],D=r.checks[v]!==void 0?t.cyan("override"):t.dim("preset");a(" "+v.padEnd(i$1)+y(j).padEnd(m+10)+D);}a("");}async function U(e){if(!f$1(e)){d(`Invalid level: ${e}. Must be one of: strict, balanced, minimal`),process.exitCode=1;return}let o=process.cwd();try{j(o,e),b(`Enforcement level set to ${$(e)}`);}catch(r){d(`Failed to set level: ${r.message}`),process.exitCode=1;}}async function H(e$1,o){if(!d$1(e$1)){d(`Unknown check ID: ${e$1}`),a(" Valid IDs: "+a$1.join(", ")),process.exitCode=1;return}if(!e(o)){d(`Invalid severity: ${o}. Must be one of: block, warn, off`),process.exitCode=1;return}let r=process.cwd();try{k(r,e$1,o),b(`Override set: ${e$1} = ${y(o)}`);}catch(c){d(`Failed to set override: ${c.message}`),process.exitCode=1;}}async function P(e){let o=process.cwd();if(!e){try{m(o),b("All enforcement overrides cleared");}catch(r){d(`Failed to reset overrides: ${r.message}`),process.exitCode=1;}return}if(!d$1(e)){d(`Unknown check ID: ${e}`),a(" Valid IDs: "+a$1.join(", ")),process.exitCode=1;return}try{l(o,e),b(`Override removed: ${e} (reverted to preset default)`);}catch(r){d(`Failed to reset override: ${r.message}`),process.exitCode=1;}}async function _(e){let o=process.cwd(),r=g(o),c=i(r);if(e.json){h(c);return}f("Resolved Enforcement Checks"),a("");for(let[f,i]of Object.entries(c))a(" "+f.padEnd(30)+y(i));a("");}function y(e){switch(e){case "block":return t.red("block");case "warn":return t.yellow("warn");case "off":return t.dim("off");default:return String(e)}}function $(e){switch(e){case "strict":return t.red(e);case "balanced":return t.yellow(e);case "minimal":return t.green(e);default:return e}}export{H as enforcementOverrideCommand,P as enforcementResetCommand,_ as enforcementResolveCommand,U as enforcementSetCommand,M as enforcementStatusCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{a as CHECK_IDS,n as ensureEnforcementDefaults,h as getCheckSeverity,b as getPreset,c as getPresetSeverity,d as isValidCheckId,f as isValidLevel,e as isValidSeverity,g as loadEnforcementConfig,m as resetAllOverrides,l as resetCheckOverride,i as resolveAllChecks,k as setCheckOverride,j as setEnforcementLevel}from'./chunk-KYA4TP26.js';import'./chunk-
|
|
2
|
+
export{a as CHECK_IDS,n as ensureEnforcementDefaults,h as getCheckSeverity,b as getPreset,c as getPresetSeverity,d as isValidCheckId,f as isValidLevel,e as isValidSeverity,g as loadEnforcementConfig,m as resetAllOverrides,l as resetCheckOverride,i as resolveAllChecks,k as setCheckOverride,j as setEnforcementLevel}from'./chunk-KYA4TP26.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-5TAVYPOV.js';import*as e from'fs';import*as r from'path';async function o(t){let s=process.cwd(),n=r.join(s,".paradigm","events"),a=r.join(n,"stream.jsonl"),c=Date.now(),i=Math.floor(Math.random()*9999).toString().padStart(4,"0"),m={id:`ev-${c}-${i}`,type:t.type,source:t.source,timestamp:new Date().toISOString(),...t.path?{path:t.path}:{},...t.symbols?.length?{symbols:t.symbols}:{},...t.context?{context:t.context}:{},...t.severity?{severity:t.severity}:{}};try{e.mkdirSync(n,{recursive:!0}),e.appendFileSync(a,JSON.stringify(m)+`
|
|
3
3
|
`,"utf8");}catch{}}export{o as eventEmitCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as n from'path';import t from'chalk';async function y(){let s=process.cwd(),c=[{title:"Required (you create and maintain these):",color:t.yellow,entries:[{path:".paradigm/config.yaml",description:"Project configuration \u2014 discipline, conventions, AI settings"},{path:"portal.yaml",description:"Security gates and route protection"},{path:".purpose",description:"Component/flow/gate declarations (one per directory)"}]},{title:"Optional (you can create these):",color:t.cyan,entries:[{path:".paradigm/agents.yaml",description:"Custom agent definitions for this project"},{path:".paradigm/roster.yaml",description:"Which agents are active on this project"},{path:".paradigm/habits.yaml",description:"Behavioral compliance rules"}]},{title:"Auto-generated (do not edit manually):",color:t.magenta,entries:[{path:".paradigm/scan-index.json",description:"Symbol index \u2014 rebuilt by paradigm scan / pre-commit hook"},{path:".paradigm/flow-index.json",description:"Flow index \u2014 rebuilt by paradigm scan"},{path:".paradigm/navigator.yaml",description:"Navigation index \u2014 rebuilt automatically"},{path:".paradigm/team-state.yaml",description:"Orchestration state \u2014 managed by Maestro"},{path:".paradigm/history/",description:"Implementation history \u2014 recorded by hooks",isDirectory:true},{path:".paradigm/events/",description:"Event stream \u2014 written by hooks and tools",isDirectory:true},{path:".paradigm/lore/",description:"Session history \u2014 recorded via paradigm_lore_record",isDirectory:true},{path:".paradigm/notebooks/",description:"Agent knowledge \u2014 managed via paradigm_notebook_add",isDirectory:true}]},{title:"IDE Integration:",color:t.blue,entries:[{path:".cursorrules",description:"Cursor IDE instructions (auto-generated)"},{path:".cursor/rules/",description:"Cursor rule files (auto-generated)",isDirectory:true},{path:".cursor/hooks/",description:"Cursor hook scripts (auto-generated)",isDirectory:true},{path:"CLAUDE.md",description:"Claude Code context file"},{path:"AGENTS.md",description:"Agent definitions for Claude Code"},{path:"plugins/paradigm/",description:"Claude Code plugin (skills, hooks, agents)",isDirectory:true}]}];console.log(t.bold(`
|
|
3
3
|
Paradigm Project Files
|
|
4
4
|
`));for(let o of c){console.log(` ${o.color(o.title)}`);let p=Math.max(...o.entries.map(e=>e.path.length));for(let e of o.entries){let r=n.join(s,e.path),a=e.isDirectory?i.existsSync(r)&&i.statSync(r).isDirectory():i.existsSync(r),d=a?t.green("\u2713"):t.gray("\u2013"),l=" ".repeat(p-e.path.length+2),g=a?t.white(e.path):t.gray(e.path),h=t.gray(e.description);console.log(` ${d} ${g}${l}${h}`);}console.log("");}}export{y as explainFilesCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a}from'./chunk-FYDRENK7.js';import'./chunk-
|
|
2
|
+
import {a}from'./chunk-FYDRENK7.js';import'./chunk-5TAVYPOV.js';import*as f from'path';import u from'chalk';async function l(n,t){let i=n?f.resolve(n):process.cwd(),e,r;t.from&&(e=new Date(t.from)),t.to&&(r=new Date(t.to));let m=new a(i),a$1=t.format||"json",o;a$1==="csv"?o=m.exportToCsv({from:e,to:r}):o=m.exportToJson({from:e,to:r}),t.output?((await import('fs')).writeFileSync(t.output,o),console.log(u.green(`\u2713 Exported to ${t.output}`))):console.log(o);}export{l as teamExportCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-SHD27BQX.js';import {a}from'./chunk-LKAT7IAK.js';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(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-5TAVYPOV.js';var d={"missing-purpose":e=>`${e.target?`"${e.target}"`:"a directory"} is missing a .purpose file. Without it, agents cannot discover what this directory contains or which components live here. The stop hook will block if source files were modified in a directory with no .purpose. Fix: run paradigm_purpose_init for this directory, then add components with paradigm_purpose_add_component.`,"stale-purpose":e=>{let t=e.target?`"${e.target}"`:"a .purpose file",n=e.context?.ageHours!=null?` (${e.context.ageHours}h old)`:"";return `The .purpose file at ${t}${n} has not been updated since the last code change in its directory. Stale purposes mislead agents about what components exist, causing incorrect context injection. Fix: update the .purpose to reflect any added, removed, or changed components, then run paradigm_reindex.`},"missing-gate":e=>`${e.target?`"${e.target}"`:"a route or endpoint"} appears to require authentication or authorization but has no gate declared in portal.yaml. Gates are how Paradigm tracks security enforcement \u2014 missing gates mean agents cannot verify that the route is protected. Fix: add the gate to portal.yaml using paradigm_portal_add_route or paradigm_purpose_add_component with the appropriate gates array.`,"orphan-signal":e=>`${e.target?`"${e.target}"`:"a signal"} is emitted in code but not declared in any .purpose file. Undeclared signals cannot be traced by agents during ripple analysis, meaning downstream effects may be missed when the signal's emitter changes. Fix: add the signal to the nearest .purpose file under its component's signals array (e.g., signals: ["!${e.target||"event-name"}"]). `,"undocumented-flow":e=>`${e.target?`"${e.target}"`:"a multi-step flow"} spans multiple components but has no $flow declaration. Flows with 3 or more steps should be documented so agents can reason about the sequence end-to-end. Without a flow record, agents may implement duplicate logic or miss ordering constraints. Fix: add a flow entry to .paradigm/flows.yaml with the steps and participants.`,"aspect-drift":e=>`${e.target?`"${e.target}"`:"an aspect anchor"} has drifted \u2014 the code at the anchored location no longer matches the fingerprint recorded when the aspect was first applied. This means the aspect may no longer be enforced correctly at that site. Drift is common after refactors that move or rewrite anchored code. Fix: re-anchor the aspect at its new location using paradigm_aspect_anchor, then delete the stale anchor.`,"portal-mismatch":e=>`${e.target?`"${e.target}"`:"a portal.yaml entry"} has a mismatch between what portal.yaml declares and what the code enforces. This could mean a gate is declared but never applied in middleware, or code enforces a check that is not tracked in portal.yaml. Both directions create audit gaps. Fix: reconcile portal.yaml with actual middleware usage \u2014 run paradigm portal check to see specifics.`,"missing-test":e=>`${e.target?`"${e.target}"`:"a component"} has no associated test file. Agents are expected to write tests alongside every implementation. Missing tests increase regression risk and reduce confidence scores for the affected component. Fix: create a test file alongside the implementation (e.g., ${e.target?e.target.replace(/\.[^.]+$/,".test$&"):"component.test.ts"}).`,"uncovered-route":e=>`${e.target?`"${e.target}"`:"a route"} appears in the codebase but is not listed in portal.yaml. All routes \u2014 protected or public \u2014 should be tracked in portal.yaml so the full API surface is visible to agents and reviewers. Uncovered routes are invisible to ripple analysis and gate audits. Fix: add the route to portal.yaml with paradigm_portal_add_route.`,"broken-reference":e=>`${e.target?`"${e.target}"`:"a symbol reference"} references a symbol or file that no longer exists. Broken references in .purpose files cause agents to load stale context and may indicate a renamed or deleted component. Fix: update the reference to the new symbol name, or remove it if the component was deleted. Run paradigm_reindex after fixing to regenerate the scan index.`,"missing-description":e=>`${e.target?`"${e.target}"`:"a component or gate"} has no description. Descriptions are required for agents to understand purpose and context during context injection. Without descriptions, agents may misapply the component or skip it when it would have been relevant. Fix: add a description field to the component or gate entry in its .purpose or portal.yaml file.`,"enforcement-level-violation":e=>{let t=e.target?`"${e.target}"`:"a data category",n=e.context?.ring,a=e.context?.boundary;return `${t} is being transmitted across a boundary (${a||"unknown boundary"}) that exceeds its trust ring${n?` (Ring: ${n})`:""}. Data policy requires project-locked content to never leave the project boundary. This gap could expose internal compliance data externally. Fix: check the data-policy.yaml configuration and ensure the content category is listed in the deny_content for the relevant stream.`},"index-stale":e=>{let t=e.target?`"${e.target}"`:"the scan index",n=e.context?.ageHours,a=n!=null?` (${n} hours old)`:"";return `${t}${a} is stale. The scan index drives context injection, navigator, and ripple analysis. When the index is out of date, agents work from stale symbol maps and may miss recently added components or references. Fix: run paradigm_reindex (or "paradigm index") to regenerate the index.`}};function g(e,t){let n=d[e];return n?n({...t,type:e}):`Unknown check type "${e}" \u2014 no narration template available.`}function h(e){let t=[],n=[],a=[];for(let r of e){let p=g(r.type,r),i=r.severity??"improvement",c={type:r.type,target:r.target,narration:p,severity:i};i==="blocking"?t.push(c):i==="note"?a.push(c):n.push(c);}let o=t.length+n.length+a.length,s=l(t,n,a);return {gapCount:o,blocking:t,improvement:n,note:a,narrative:s}}function l(e,t,n){let a=[],o=e.length+t.length+n.length;if(o===0)return "No gaps found. All enforcement checks passed.";let s=u(e,t,n);if(a.push(`Found ${o} gap${o!==1?"s":""} across ${s} check type${s!==1?"s":""}.`),a.push(""),e.length>0){a.push(`BLOCKING (${e.length})`),a.push("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");for(let r of e)a.push(`[${r.type}]${r.target?` \u2014 ${r.target}`:""}`),a.push(r.narration),a.push("");}if(t.length>0){a.push(`IMPROVEMENTS (${t.length})`),a.push("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");for(let r of t)a.push(`[${r.type}]${r.target?` \u2014 ${r.target}`:""}`),a.push(r.narration),a.push("");}if(n.length>0){a.push(`NOTES (${n.length})`),a.push("\u2500\u2500\u2500\u2500\u2500\u2500");for(let r of n)a.push(`[${r.type}]${r.target?` \u2014 ${r.target}`:""}`),a.push(r.narration),a.push("");}return a.join(`
|
|
3
3
|
`).trimEnd()}function u(e,t,n){let a=new Set;for(let o of [...e,...t,...n])a.add(o.type);return a.size}export{h as narrateAllGaps,g as narrateGap};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a}from'./chunk-LKAT7IAK.js';import'./chunk-
|
|
2
|
+
import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as o from'fs';import*as c from'path';import l from'chalk';import b from'ora';function D(t){let a=t.match(/^(\d+)(d|h|m)$/);if(!a)return null;let[,e,s]=a,n=parseInt(e,10);switch(s){case "d":return n*24*60*60*1e3;case "h":return n*60*60*1e3;case "m":return n*60*1e3;default:return null}}function m(t,a){let e=[];if(!o.existsSync(t))return e;let s=o.readdirSync(t,{withFileTypes:true});for(let n of s){let f=c.join(t,n.name);if(n.isDirectory())e.push(...m(f,a));else if(n.isFile())try{let u=o.statSync(f),r=Date.now()-u.mtimeMs;if(r>a){let d=Math.floor(r/864e5);e.push({path:f,age:`${d}d`});}}catch{}}return e}async function v(t){let a$1=process.env.HOME||process.env.USERPROFILE||"~",e=c.join(a$1,".paradigm"),s=b();if(!o.existsSync(e)){console.log(l.yellow(`
|
|
3
3
|
No ~/.paradigm/ directory found.
|
|
4
4
|
`));return}let n=t.olderThan||"90d",f=D(n);f||(console.log(l.red(`
|
|
5
5
|
Invalid duration: ${n}`)),console.log(l.gray(`Use format: 90d, 30d, 7d, 24h, etc.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-5TAVYPOV.js';import*as d from'fs';import*as u from'path';import o from'chalk';import*as p from'js-yaml';function h(e){let r=u.join(e,".paradigm","graduation.yaml");if(!d.existsSync(r))return {states:{}};try{let a=d.readFileSync(r,"utf8");return p.load(a)||{states:{}}}catch{return {states:{}}}}var g={"explore-before-implement":"Explore Before Implementing","ripple-before-modify":"Ripple Before Modifying","check-fragility":"Check Fragility","wisdom-before-implement":"Check Team Wisdom","verify-before-done":"Verify Before Done","postflight-compliance":"Postflight Compliance","test-new-components":"Test New Components","purpose-coverage":"Purpose File Coverage","record-lore-for-significant":"Record Lore for Significant Changes","confidence-on-decisions":"Confidence on Decisions","gates-for-routes":"Gates for Routes","university-content-valid":"University Content Valid","university-onboarded":"University Onboarding"};({hook:o.green,habit:o.yellow,mcp:o.red});async function v(e){let r=process.cwd(),n=h(r).states||{};if(e.json){console.log(JSON.stringify({states:n},null,2));return}console.log(o.blue(`
|
|
3
3
|
\u26A1 Automation Tier Status
|
|
4
4
|
`)),console.log(o.gray("\u2500".repeat(60)));let t={hook:[],habit:[],mcp:[]},m=new Set([...Object.keys(g),...Object.keys(n)]);for(let s of m){let i=n[s]||{},l=i.tier||"habit";t[l]||(t[l]=[]),t[l].push({id:s,state:i});}let c=t.hook.length,f=t.habit.length,w=t.mcp.length,k=c+f+w;if(console.log(` ${o.green(`${c} hook`)} ${o.yellow(`${f} habit`)} ${o.red(`${w} mcp`)} (${k} total)
|
|
5
5
|
`),t.hook.length>0){console.log(o.green.bold(" \u26A1 Hooks (zero context cost)"));for(let{id:s,state:i}of t.hook){let l=g[s]||s,y=i.graduatedAt?` \u2014 graduated ${i.graduatedAt.split("T")[0]}`:"";console.log(` ${o.green("\u25CF")} ${l} ${o.gray(`(${s})${y}`)}`);}console.log();}if(t.habit.length>0){console.log(o.yellow.bold(" \u{1F4AD} Habits (agent-reminded)"));for(let{id:s,state:i}of t.habit){let l=g[s]||s,y=i.neverGraduate?o.gray(" \u{1F512} never-graduate"):"",b=i.cooldownUntil&&new Date(i.cooldownUntil)>new Date?o.gray(` \u23F3 cooldown until ${i.cooldownUntil.split("T")[0]}`):"";console.log(` ${o.yellow("\u25CF")} ${l} ${o.gray(`(${s})`)}${y}${b}`);}console.log();}if(t.mcp.length>0){console.log(o.red.bold(" \u{1F527} MCP Tools (manual, high token cost)"));for(let{id:s,state:i}of t.mcp){let l=g[s]||s;console.log(` ${o.red("\u25CF")} ${l} ${o.gray(`(${s})`)}`);}console.log();}if(c>0){let s=c*150;console.log(o.gray(` Estimated savings: ~${s} tokens/session from ${c} graduated habit(s)`));}console.log();}function $(e,r){let a=u.join(e,".paradigm","graduation.yaml"),n=u.dirname(a);d.existsSync(n)||d.mkdirSync(n,{recursive:true});let t=p.dump(r,{lineWidth:120,noRefs:true,sortKeys:true});d.writeFileSync(a,t,"utf8");}async function G(e){let r=process.cwd(),a=h(r);a.states||(a.states={});let n=a.states[e]||{};if(n.tier==="hook"){console.log(o.yellow(`${e} is already graduated to hook tier.`));return}if(n.neverGraduate){console.log(o.red(`${e} is marked as never-graduate (requires agent cognition).`));return}a.states[e]={...n,tier:"hook",graduatedAt:new Date().toISOString(),complianceAtGraduation:100,failureCount:0},$(r,a);let t=g[e]||e;console.log(o.green(`${o.bold("\u26A1")} Graduated "${t}" to hook tier.`)),console.log(o.gray(" MCP evaluation will skip this habit. Stop hook enforces compliance."));}async function D(e,r){let a=process.cwd(),n=h(a);n.states||(n.states={});let t=n.states[e]||{};if(t.tier!=="hook"){console.log(o.yellow(`${e} is not at hook tier (currently: ${t.tier||"habit"}).`));return}let m=r.cooldown?parseInt(r.cooldown):14,c=new Date;c.setDate(c.getDate()+m),n.states[e]={...t,tier:"habit",demotedAt:new Date().toISOString(),cooldownUntil:c.toISOString()},$(a,n);let f=g[e]||e;console.log(o.yellow(`${o.bold("\u{1F4AD}")} Demoted "${f}" back to habit tier.`)),console.log(o.gray(` Cooldown: ${m} days (until ${c.toISOString().split("T")[0]}).`)),console.log(o.gray(" MCP evaluation will resume checking this habit."));}export{D as graduateDemoteCommand,G as graduatePromoteCommand,v as graduateStatusCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,b}from'./chunk-Y6KXTQBG.js';import'./chunk-
|
|
2
|
+
import {a,b}from'./chunk-Y6KXTQBG.js';import'./chunk-5TAVYPOV.js';import l from'express';import*as c from'path';import*as h from'fs';import {fileURLToPath}from'url';import a$1 from'chalk';var f=fileURLToPath(import.meta.url),d=c.dirname(f),p={component(s){let t=a$1.magenta(`#${s}`);return {info:(o,e)=>{let r=e?a$1.gray(` ${Object.entries(e).map(([n,i])=>`${n}=${i}`).join(" ")}`):"";console.log(`${a$1.blue("i")} ${t} ${o}${r}`);},success:(o,e)=>{let r=e?a$1.gray(` ${Object.entries(e).map(([n,i])=>`${n}=${i}`).join(" ")}`):"";console.log(`${a$1.green("+")} ${t} ${o}${r}`);},warn:(o,e)=>{let r=e?a$1.gray(` ${Object.entries(e).map(([n,i])=>`${n}=${i}`).join(" ")}`):"";console.log(`${a$1.yellow("!")} ${t} ${o}${r}`);},error:(o,e)=>{let r=e?a$1.gray(` ${Object.entries(e).map(([n,i])=>`${n}=${i}`).join(" ")}`):"";console.error(`${a$1.red("x")} ${t} ${o}${r}`);}}}};function y(s){let t=l();t.use(l.json()),t.use((e,r,n)=>{if(r.header("Access-Control-Allow-Origin","*"),r.header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),r.header("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){r.sendStatus(204);return}n();}),t.use("/api/symbols",a(s.projectDir)),t.use("/api/graphs",b(s.projectDir)),t.get("/api/health",(e,r)=>{r.json({status:"ok",timestamp:new Date().toISOString()});});let o=c.join(d,"..","graph-ui","dist");return h.existsSync(o)||(o=c.join(d,"..","..","graph-ui","dist")),h.existsSync(o)?(t.use(l.static(o)),t.get("{*path}",(e,r)=>{e.path.startsWith("/api")||r.sendFile(c.join(o,"index.html"));})):t.get("/",(e,r)=>{r.send(`
|
|
3
3
|
<html>
|
|
4
4
|
<head><title>Paradigm Graph</title></head>
|
|
5
5
|
<body style="background:#0a0a0f;color:#e2e8f0;font-family:system-ui;display:flex;align-items:center;justify-content:center;height:100vh;margin:0">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,b,c,e,d}from'./chunk-
|
|
2
|
+
import {a,b,c,e,d}from'./chunk-QO7YPQXC.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
|
-
`));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-
|
|
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
|
|
6
6
|
`)),console.log(o.white(` Total habits: ${r.length} (${i.length} active)`));let l=new Map;for(let c of i)l.set(c.trigger,(l.get(c.trigger)||0)+1);for(let[c,s]of l)console.log(o.gray(` ${c}: ${s} habit(s)`));if(console.log(),n&&n.total>0){let c=n.rate>=80?o.green:n.rate>=60?o.yellow:o.red;if(console.log(o.white(` Compliance Rate: ${c(`${n.rate}%`)}`)),console.log(o.gray(` Followed: ${n.followed} | Skipped: ${n.skipped} | Partial: ${n.partial}`)),console.log(o.gray(` Total events: ${n.total}
|
|
7
7
|
`)),n.byCategory.length>0){console.log(o.white(" By Category:"));for(let s of n.byCategory){let y=s.rate>=80?o.green:s.rate>=60?o.yellow:o.red,d="\u2588".repeat(Math.round(s.rate/5))+"\u2591".repeat(20-Math.round(s.rate/5));console.log(` ${s.category.padEnd(15)} ${y(d)} ${y(`${s.rate}%`)} (${s.total})`);}}}else console.log(o.gray(" No practice events recorded yet.")),console.log(o.gray(` Call paradigm_habits_check via MCP to start recording.
|
|
@@ -35,7 +35,7 @@ ${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$1){let t=process.cwd(),r=e$1.trigger,i;try{i=a(t);}catch(f){console.log(o.red("Failed to load habits:"),f.message),process.exitCode=1;return}let n=e$1.files?e$1.files.split(",").map(f=>f.trim()).filter(Boolean):N(t),l=e$1.symbols?e$1.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$1=e({toolsCalled:[],filesModified:n,symbolsTouched:l,loreRecorded:false,hasPortalRoutes:y,taskAddsRoutes:false,gitClean:c}),a$1=d(i,r,d$1),m=0;if(e$1.record&&a$1.evaluations.length>0)try{let f=u.join(t,".paradigm","sentinel");if(g.existsSync(f)){let{SentinelStorage:b}=await import('./dist-
|
|
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$1){let t=process.cwd(),r=e$1.trigger,i;try{i=a(t);}catch(f){console.log(o.red("Failed to load habits:"),f.message),process.exitCode=1;return}let n=e$1.files?e$1.files.split(",").map(f=>f.trim()).filter(Boolean):N(t),l=e$1.symbols?e$1.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$1=e({toolsCalled:[],filesModified:n,symbolsTouched:l,loreRecorded:false,hasPortalRoutes:y,taskAddsRoutes:false,gitClean:c}),a$1=d(i,r,d$1),m=0;if(e$1.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,notes:h.reason}),m++;}}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
39
|
`),"utf8");}else r==="on-stop"&&g.existsSync(v)&&g.unlinkSync(v);}catch{}e$1.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},null,2)):U(a$1,m),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})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-5TAVYPOV.js';import*as s from'fs';import*as y from'path';import t from'chalk';import*as u from'js-yaml';var f=".paradigm/history";async function v(o,r={}){let n=process.cwd(),c=y.join(n,f);if(!s.existsSync(c)){console.log(t.yellow("No history directory found.")),console.log(t.gray("Run `paradigm history init` to create .paradigm/history/"));return}let e=x(y.join(c,"index.yaml")),i=w(y.join(c,"log.jsonl"));if(r.json){if(o){let l=e?.by_symbol?.[o],g=i.filter(a=>a.symbols.includes(o));console.log(JSON.stringify({symbol:o,summary:l,entries:g},null,2));}else console.log(JSON.stringify({index:e,entries:i.slice(-(r.limit||20))},null,2));return}if(console.log(t.magenta(`
|
|
3
3
|
History
|
|
4
4
|
`)),o){let l=e?.by_symbol?.[o],g=i.filter(a=>a.symbols.includes(o)).slice(-(r.limit||10));if(console.log(t.cyan(` Symbol: ${o}
|
|
5
5
|
`)),l){let a=l.fragility==="critical"||l.fragility==="high"?t.red:l.fragility==="medium"?t.yellow:t.green;console.log(t.white(" Summary:")),console.log(t.gray(` Total changes: ${l.total_changes}`)),console.log(t.gray(` Last modified: ${l.last_modified}`)),console.log(t.gray(` Stability: ${(l.stability_score*100).toFixed(0)}%`)),console.log(a(` Fragility: ${l.fragility}`)),console.log();}g.length>0&&(console.log(t.white(" Recent changes:")),g.forEach(a=>{let p=a.type==="rollback"?t.red:a.type==="validate"?a.result==="pass"?t.green:t.red:t.blue;console.log(p(` [${a.type}] ${a.description||a.id}`)+t.gray(` - ${a.author.id} @ ${a.ts.split("T")[0]}`));}));return}let m=Object.keys(e?.by_symbol||{});console.log(t.white(` Tracked symbols: ${m.length}`)),console.log(t.white(` Total entries: ${i.length}`)),console.log();let h=e?.fragile_symbols||[];h.length>0&&(console.log(t.red(" Fragile symbols:")),h.slice(0,5).forEach(l=>{console.log(t.gray(` [${l.fragility}] ${l.symbol}`));}),console.log());let b=i.slice(-10);b.length>0&&(console.log(t.white(" Recent entries:")),b.reverse().forEach(l=>{let g=l.type==="rollback"?t.red:l.type==="validate"?l.result==="pass"?t.green:t.red:t.blue;console.log(g(` [${l.type}] ${l.symbols.join(", ")}`)+t.gray(` - ${l.ts.split("T")[0]}`));}));}async function H(o={}){let r=process.cwd(),n=y.join(r,f);if(s.existsSync(n)&&!o.force){console.log(t.yellow("History directory already exists.")),console.log(t.gray("Use --force to reinitialize"));return}s.mkdirSync(n,{recursive:true}),s.writeFileSync(y.join(n,"log.jsonl"),"");let c={version:"1.0",generated:new Date().toISOString(),by_symbol:{},co_changes:[],fragile_symbols:[]};s.writeFileSync(y.join(n,"index.yaml"),u.dump(c,{lineWidth:-1}));let e={version:"1.0",total_validations:0,pass_rate:0,by_symbol:{}};s.writeFileSync(y.join(n,"validation.yaml"),u.dump(e,{lineWidth:-1})),console.log(t.green("History directory initialized!")),console.log(t.gray(` ${n}/`)),console.log(t.gray(" log.jsonl")),console.log(t.gray(" index.yaml")),console.log(t.gray(" validation.yaml"));}async function E(o={}){let r=process.cwd(),n=y.join(r,f,"index.yaml");if(!s.existsSync(n)){console.log(t.yellow("No history index found.")),console.log(t.gray("Run `paradigm history reindex` to generate"));return}let e=x(n)?.fragile_symbols||[];if(o.json){console.log(JSON.stringify({fragile:e},null,2));return}if(console.log(t.magenta(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{a as hooksInstallCommand,c as hooksStatusCommand,b as hooksUninstallCommand}from'./chunk-SXO7NC6A.js';import'./chunk-
|
|
2
|
+
export{a as hooksInstallCommand,c as hooksStatusCommand,b as hooksUninstallCommand}from'./chunk-SXO7NC6A.js';import'./chunk-5TAVYPOV.js';
|