@a-company/paradigm 5.34.0 → 5.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/{accept-orchestration-MIRBLRUJ.js → accept-orchestration-36AP7HTX.js} +1 -1
  2. package/dist/{add-P76GEMGF.js → add-FGKNJS3F.js} +1 -1
  3. package/dist/agent-E7LDKJ4O.js +33 -0
  4. package/dist/{agent-loader-5255KNM7.js → agent-loader-2HXKVL6J.js} +1 -1
  5. package/dist/{agent-loader-A5FMBAFJ.js → agent-loader-XS6LIMUG.js} +1 -1
  6. package/dist/{agent-state-KSQ3S7OB.js → agent-state-L7LCPRC3.js} +1 -1
  7. package/dist/{agents-suggest-HYTFMQD3.js → agents-suggest-Y5D6AALG.js} +1 -1
  8. package/dist/{aggregate-W66DM3GA.js → aggregate-OZJRRAQR.js} +1 -1
  9. package/dist/ambient-4NSPAQDJ.js +35 -0
  10. package/dist/{assess-UFPYEJKP.js → assess-AMPVSWK7.js} +1 -1
  11. package/dist/{auto-RHJXOZFL.js → auto-A7VUHCUC.js} +1 -1
  12. package/dist/{beacon-5QVYV5DF.js → beacon-YBLUUTYY.js} +1 -1
  13. package/dist/{calibration-OLJYB5HN.js → calibration-FQ4YVOE4.js} +1 -1
  14. package/dist/{check-THVGY4R5.js → check-46QL3KMQ.js} +1 -1
  15. package/dist/{chunk-AGSUX2GJ.js → chunk-3OMJI5TT.js} +2 -2
  16. package/dist/chunk-3QMRDN65.js +29 -0
  17. package/dist/{chunk-QNZEG7IT.js → chunk-3XGNXXCT.js} +1 -1
  18. package/dist/{chunk-VG7FN2TU.js → chunk-4W5TBL3O.js} +1 -1
  19. package/dist/{chunk-UDUHSHO4.js → chunk-5YHR77AL.js} +1 -1
  20. package/dist/chunk-6PP2RPIZ.js +3 -0
  21. package/dist/{chunk-VCKKJDLP.js → chunk-6QKCUEEY.js} +1 -1
  22. package/dist/{chunk-JBDMCRPP.js → chunk-77WX6HGV.js} +1 -1
  23. package/dist/{chunk-A7KFOJ2F.js → chunk-7PB7AXQE.js} +1 -1
  24. package/dist/chunk-7SGNNVE5.js +3 -0
  25. package/dist/{chunk-WS2N27RX.js → chunk-7YTAA6XA.js} +1 -1
  26. package/dist/chunk-BCOPNVPY.js +11 -0
  27. package/dist/chunk-BRHQJLTG.js +2 -0
  28. package/dist/{chunk-W5IWDW4Y.js → chunk-DG3VCY43.js} +1 -1
  29. package/dist/{chunk-HMQ5BHP2.js → chunk-DOCDDDTD.js} +10 -10
  30. package/dist/chunk-DSYEGRQ2.js +3 -0
  31. package/dist/chunk-EMMMBAID.js +2 -0
  32. package/dist/chunk-F5BSUC2L.js +3 -0
  33. package/dist/chunk-GE3GQALR.js +2 -0
  34. package/dist/chunk-IW5K3RNR.js +8 -0
  35. package/dist/chunk-JIF7OSGH.js +8 -0
  36. package/dist/{chunk-HPAHK4AJ.js → chunk-JUOOVKK6.js} +1 -1
  37. package/dist/chunk-NFQLONFY.js +3 -0
  38. package/dist/chunk-OVDYPOHR.js +2 -0
  39. package/dist/{chunk-33LKBMVK.js → chunk-RLJ5K3J5.js} +1 -1
  40. package/dist/{chunk-HXGYVS2N.js → chunk-RN35IVA2.js} +1 -1
  41. package/dist/{chunk-ODVKPZZ4.js → chunk-W6WVJLHO.js} +1 -1
  42. package/dist/chunk-X54WXWCX.js +111 -0
  43. package/dist/chunk-XHJ27CER.js +2 -0
  44. package/dist/{chunk-32RBX5YV.js → chunk-XNB4TZTD.js} +1 -1
  45. package/dist/chunk-YG5G5GEQ.js +456 -0
  46. package/dist/chunk-Z72SDTBJ.js +3 -0
  47. package/dist/{claude-4LR3LJQZ.js → claude-OX54QSLC.js} +1 -1
  48. package/dist/{claude-cli-UP6HGH7C.js → claude-cli-FHLJQVJC.js} +1 -1
  49. package/dist/{claude-code-RLJ4GX77.js → claude-code-GVGU3A3B.js} +1 -1
  50. package/dist/{claude-code-teams-R37HJY3Y.js → claude-code-teams-ZRHPTGPP.js} +1 -1
  51. package/dist/{compliance-Q676YALK.js → compliance-PHSPVYK2.js} +3 -3
  52. package/dist/{compliance-health-JNP3P35P.js → compliance-health-HCZTJDN7.js} +1 -1
  53. package/dist/{conductor-Y5IXELTL.js → conductor-LYBMM66Z.js} +1 -1
  54. package/dist/{config-schema-GUQY2QN7.js → config-schema-URJW6UZH.js} +1 -1
  55. package/dist/{constellation-CG7C4WFE.js → constellation-PX3ZKMWQ.js} +1 -1
  56. package/dist/{context-audit-XRPT3OU2.js → context-audit-APFKELFT.js} +2 -2
  57. package/dist/{cost-IDNVMAEV.js → cost-B5SAHPOJ.js} +1 -1
  58. package/dist/{cost-PK4KIF7R.js → cost-MMWUDGZC.js} +1 -1
  59. package/dist/{cursor-cli-QKF7Z6M2.js → cursor-cli-Q2HLQ5TE.js} +1 -1
  60. package/dist/{cursorrules-U5O4G5T4.js → cursorrules-3BW6K6D5.js} +1 -1
  61. package/dist/{decision-loader-2XPZE4EZ.js → decision-loader-4KMQVAXZ.js} +1 -1
  62. package/dist/{delete-P5VULXR4.js → delete-7PQZUERZ.js} +1 -1
  63. package/dist/{diff-QHQWLM3L.js → diff-F2HUO2H3.js} +1 -1
  64. package/dist/{discipline-H7LDI6NT.js → discipline-ARFFIXQL.js} +1 -1
  65. package/dist/{dist-W3XCATBJ.js → dist-5IUWRFG6.js} +1 -1
  66. package/dist/{dist-KGRCLBJP-2QAPFYNF.js → dist-KGRCLBJP-R5CCPPXN.js} +1 -1
  67. package/dist/{dist-3ZCH25SG.js → dist-MRZDZ5SX.js} +1 -1
  68. package/dist/{dist-VGFSP3XM.js → dist-OKM6BXTH.js} +1 -1
  69. package/dist/{dist-VXCZWVVJ.js → dist-VWC6FA46.js} +1 -1
  70. package/dist/dist-YUXXIXB3.js +3 -0
  71. package/dist/{docs-EDQ2STFK.js → docs-6WOQILZS.js} +1 -1
  72. package/dist/{docs-5BX2YWYK.js → docs-BI2DO7B2.js} +2 -2
  73. package/dist/doctor-JLTCBMS4.js +2 -0
  74. package/dist/{drift-ILZE5BFJ.js → drift-6QPDKKUO.js} +1 -1
  75. package/dist/{echo-UPTQUEDU.js → echo-3JJDKCNF.js} +1 -1
  76. package/dist/{edit-GUU3HBVW.js → edit-PLCGL5OV.js} +1 -1
  77. package/dist/{enforcement-BEGPQIUN.js → enforcement-5MHSQAXE.js} +1 -1
  78. package/dist/{enforcement-46XWPNSA.js → enforcement-IWABOHMY.js} +1 -1
  79. package/dist/{event-Y3VXC2RV.js → event-5J3GBWKT.js} +1 -1
  80. package/dist/{explain-files-3GPZUETV.js → explain-files-LPHTJL4N.js} +1 -1
  81. package/dist/{export-CV5KCTPS.js → export-NXUFTFPW.js} +1 -1
  82. package/dist/{flow-POQP27WA.js → flow-IT2IVXXT.js} +1 -1
  83. package/dist/{gap-narrator-NTXLUI7I.js → gap-narrator-DVXPWNFN.js} +1 -1
  84. package/dist/{global-C44FW4G2.js → global-J2VTYKCC.js} +1 -1
  85. package/dist/{graduate-3BBSC27A.js → graduate-N2HF4JT6.js} +1 -1
  86. package/dist/graph-VLMP6DW2.js +2 -0
  87. package/dist/{graph-server-COZR5C3Z.js → graph-server-TBHHBFOM.js} +1 -1
  88. package/dist/{habits-GICVMTJL.js → habits-JTMWGVPH.js} +3 -3
  89. package/dist/{history-UW454SDP.js → history-FHS7EC3Z.js} +1 -1
  90. package/dist/{hooks-BNWRGACA.js → hooks-BL6CXRVK.js} +1 -1
  91. package/dist/index.js +9 -9
  92. package/dist/init-ZS7RAR7L.js +2 -0
  93. package/dist/{integrity-UYDOOJDP.js → integrity-UBMZCB77.js} +1 -1
  94. package/dist/{integrity-checker-DHGMZQDG.js → integrity-checker-VSR3ITBL.js} +1 -1
  95. package/dist/journal-loader-EELDB4P2.js +2 -0
  96. package/dist/{lint-IGKE6UPS.js → lint-KQQ2RMSJ.js} +1 -1
  97. package/dist/{list-5IUGP3ZB.js → list-37UCWCOQ.js} +1 -1
  98. package/dist/{list-YKIQNKGB.js → list-6WY4CFUR.js} +1 -1
  99. package/dist/lore-loader-CP5RUJ4A.js +2 -0
  100. package/dist/{lore-loader-XY5MZRR2.js → lore-loader-PBUDKXAJ.js} +1 -1
  101. package/dist/{lore-server-FC2GMDLT.js → lore-server-A3KKZLSY.js} +1 -1
  102. package/dist/{manual-RXSPSFLL.js → manual-HKI6OXB4.js} +1 -1
  103. package/dist/mcp.js +17 -449
  104. package/dist/{migrate-YQG2FG3J.js → migrate-W3KCXLDS.js} +2 -2
  105. package/dist/{migrate-assessments-GEI5WMI2.js → migrate-assessments-D2TOBJ5V.js} +1 -1
  106. package/dist/{model-discovery-HMB3YI4L.js → model-discovery-TWX4A4YD.js} +1 -1
  107. package/dist/{nomination-engine-W6QTQX2P.js → nomination-engine-A24774W4.js} +1 -1
  108. package/dist/{notebook-PE3JSYZI.js → notebook-LXJ2LHUA.js} +1 -1
  109. package/dist/notebook-loader-CF52PNZC.js +2 -0
  110. package/dist/{orchestrate-7CJWHLBA.js → orchestrate-WFCNV2II.js} +1 -1
  111. package/dist/{peers-P2KXU7ZK.js → peers-7TPZTKH7.js} +1 -1
  112. package/dist/{persona-STQWZH5P.js → persona-UGTCFEGT.js} +1 -1
  113. package/dist/{pipeline-MZUITRVN.js → pipeline-7PZ6ILWX.js} +1 -1
  114. package/dist/{platform-server-G6MJIAJS.js → platform-server-YIBX4YDJ.js} +2 -2
  115. package/dist/{plugin-update-checker-M7PW434O.js → plugin-update-checker-2EM4K45U.js} +1 -1
  116. package/dist/{portal-check-Z3OCQEQR.js → portal-check-YSDJRZUR.js} +1 -1
  117. package/dist/{portal-compliance-4MG5F2GI.js → portal-compliance-OBPK2IR5.js} +1 -1
  118. package/dist/{probe-5L5BQDGE.js → probe-WKXR3IN4.js} +1 -1
  119. package/dist/{project-type-AGO6VUKF.js → project-type-MRBJAKC7.js} +1 -1
  120. package/dist/{promote-NJQDZBZA.js → promote-VHBA56KW.js} +2 -2
  121. package/dist/{providers-TBPOE4DI.js → providers-RX7SBLHZ.js} +1 -1
  122. package/dist/{quiz-FE5UGAY2.js → quiz-3SQNPRJ3.js} +1 -1
  123. package/dist/{record-YXPB34MY.js → record-7QJPZZP7.js} +1 -1
  124. package/dist/registry-LR5QACRK.js +20 -0
  125. package/dist/reindex-F7EV3Z34.js +2 -0
  126. package/dist/{remember-MJRNTXYS.js → remember-SFGBTTEE.js} +1 -1
  127. package/dist/{retag-N5XF3KXP.js → retag-GFXUYP7S.js} +1 -1
  128. package/dist/{review-6UAH6V3R.js → review-6KKZWV3A.js} +1 -1
  129. package/dist/{review-77QI6VOC.js → review-GEBSYOZB.js} +1 -1
  130. package/dist/{ripple-ZGDITCGB.js → ripple-4F5ZCXS4.js} +1 -1
  131. package/dist/{roster-TA2GFDR7.js → roster-RI3UC2YI.js} +1 -1
  132. package/dist/scaffold-WA4L2K7J.js +18 -0
  133. package/dist/{scopes-commands-3V5G6NYV.js → scopes-commands-5FFIUDRC.js} +1 -1
  134. package/dist/{sentinel-HYAZ3CO5.js → sentinel-37ZEEWT7.js} +2 -2
  135. package/dist/{sentinel-bridge-VR357PKL.js → sentinel-bridge-EZGFRVFH.js} +1 -1
  136. package/dist/{serve-L52ZUTU6.js → serve-2BXDL35A.js} +2 -2
  137. package/dist/{serve-ZJ3EXVA5.js → serve-2LSTQFFQ.js} +2 -2
  138. package/dist/{serve-OY6XYL7F.js → serve-5JME5QEM.js} +2 -2
  139. package/dist/{server-4YNUIK4W.js → server-AIXFROYL.js} +1 -1
  140. package/dist/{server-2MNROHF6.js → server-XLHIYDTZ.js} +1 -1
  141. package/dist/session-tracker-VSFRNFRL.js +2 -0
  142. package/dist/{session-work-log-SLAPEP3M.js → session-work-log-6GKGUQ5C.js} +1 -1
  143. package/dist/{session-work-log-5UJTJJ22.js → session-work-log-UYMIWWOX.js} +1 -1
  144. package/dist/{setup-KPIMRZ4Q.js → setup-F2N4LUR7.js} +1 -1
  145. package/dist/{setup-3F5IK7MO.js → setup-ZM4JFV5D.js} +2 -2
  146. package/dist/{shift-IKTWYSEQ.js → shift-DDYVQJ75.js} +5 -5
  147. package/dist/{show-PJ5LFLIL.js → show-CZLVYLM5.js} +1 -1
  148. package/dist/{show-BOAVWZPZ.js → show-RFOIR2GQ.js} +1 -1
  149. package/dist/{snapshot-L2G56RPL.js → snapshot-6N564OUJ.js} +1 -1
  150. package/dist/{spawn-7TCAMD6H.js → spawn-HYARN3RL.js} +1 -1
  151. package/dist/{status-A37ECYNJ.js → status-CUG3PKGC.js} +1 -1
  152. package/dist/{status-77M3SDIF.js → status-WBJ6D7BD.js} +1 -1
  153. package/dist/{summary-ZJLQ6KHB.js → summary-2AM4QVPW.js} +1 -1
  154. package/dist/{sweep-HU74OPVW.js → sweep-WHDT7ENV.js} +1 -1
  155. package/dist/{switch-CTW4PDGI.js → switch-HBGIFNF6.js} +1 -1
  156. package/dist/{symphony-IS5TYPXY.js → symphony-CWKKMFAS.js} +25 -25
  157. package/dist/symphony-VTHVTE57.js +2 -0
  158. package/dist/symphony-loader-RYFZOQJS.js +2 -0
  159. package/dist/{symphony-peers-X5NGWXFP.js → symphony-peers-ISJPKX7W.js} +1 -1
  160. package/dist/{symphony-peers-U4KHMKGI.js → symphony-peers-LWBUQ3T4.js} +1 -1
  161. package/dist/symphony-relay-L3BY6RGM.js +3 -0
  162. package/dist/sync-WIFD7UCL.js +2 -0
  163. package/dist/{sync-llms-HL5PPW3M.js → sync-llms-MZ3RQWFX.js} +1 -1
  164. package/dist/{task-loader-NZFDTUQ5.js → task-loader-EU7JLTR3.js} +1 -1
  165. package/dist/team-C3PWO7XL.js +2 -0
  166. package/dist/{test-BQJMS4Y2.js → test-6MUL4EXS.js} +1 -1
  167. package/dist/{thread-HFXK65D4.js → thread-K6UHDIUW.js} +1 -1
  168. package/dist/{timeline-K3ZFKJ3R.js → timeline-S26CQWHT.js} +1 -1
  169. package/dist/tools-4WKLLDFU.js +2 -0
  170. package/dist/{triage-FCWOZASE.js → triage-YF6WYZY4.js} +1 -1
  171. package/dist/{tutorial-UC6YQMNN.js → tutorial-UEBX7Z2G.js} +1 -1
  172. package/dist/{university-FJ7OCOA3.js → university-UMT7PAKE.js} +1 -1
  173. package/dist/university-content/courses/para-201.json +5 -5
  174. package/dist/university-content/courses/para-301.json +10 -10
  175. package/dist/university-content/courses/para-401.json +3 -3
  176. package/dist/university-content/courses/para-501.json +5 -5
  177. package/dist/university-content/courses/para-601.json +1 -1
  178. package/dist/university-content/plsat/v2.0.json +7 -7
  179. package/dist/university-content/plsat/v3.0.json +9 -9
  180. package/dist/university-content/reference.json +4 -4
  181. package/dist/university-ui/assets/{index-DmiLQehB.js → index-CecQrfSn.js} +2 -2
  182. package/dist/university-ui/assets/{index-DmiLQehB.js.map → index-CecQrfSn.js.map} +1 -1
  183. package/dist/university-ui/index.html +1 -1
  184. package/dist/{upgrade-B4IOLZYK.js → upgrade-USW7YJEX.js} +1 -1
  185. package/dist/{validate-LSCDOLBO.js → validate-2PZTNYSS.js} +1 -1
  186. package/dist/{validate-VZXTJHGO.js → validate-KW3YFGTV.js} +1 -1
  187. package/dist/{validate-C6SMKGYD.js → validate-VZGBVTPM.js} +1 -1
  188. package/dist/{watch-LRM5XD46.js → watch-HL3ZOALL.js} +1 -1
  189. package/dist/{watch-PZCCUP6K.js → watch-KQU3S7KE.js} +1 -1
  190. package/dist/{wisdom-XZ3QKPNP.js → wisdom-UU7HOE3M.js} +1 -1
  191. package/dist/{work-log-loader-DL5GZ2BQ.js → work-log-loader-J27XSFCE.js} +1 -1
  192. package/dist/workspace-CE6LNXVI.js +2 -0
  193. package/package.json +5 -1
  194. package/templates/paradigm/specs/context-tracking.md +4 -4
  195. package/dist/agent-UUTYOFTH.js +0 -33
  196. package/dist/ambient-2JZTNXUL.js +0 -35
  197. package/dist/chunk-2Q7RGCJH.js +0 -3
  198. package/dist/chunk-5TAVYPOV.js +0 -2
  199. package/dist/chunk-73R63P7K.js +0 -2
  200. package/dist/chunk-C7ZCCKJT.js +0 -3
  201. package/dist/chunk-CUOEZAVL.js +0 -8
  202. package/dist/chunk-EAZ3EMOZ.js +0 -29
  203. package/dist/chunk-LKFBDUCV.js +0 -11
  204. package/dist/chunk-QGZRM6ZB.js +0 -2
  205. package/dist/chunk-S7K7UPXL.js +0 -3
  206. package/dist/chunk-TXBSTT64.js +0 -111
  207. package/dist/chunk-TZZNHUAR.js +0 -2
  208. package/dist/chunk-UHQLYIRI.js +0 -3
  209. package/dist/chunk-VZLGBGU3.js +0 -8
  210. package/dist/doctor-R4UGMR5N.js +0 -2
  211. package/dist/graph-CNDE5TAT.js +0 -2
  212. package/dist/init-24MAQJFM.js +0 -2
  213. package/dist/journal-loader-GLH7XFTK.js +0 -2
  214. package/dist/lore-loader-RVQI5GXL.js +0 -2
  215. package/dist/notebook-loader-CENTDDUJ.js +0 -2
  216. package/dist/reindex-2MRCAIZG.js +0 -2
  217. package/dist/session-tracker-WSTRV7UP.js +0 -2
  218. package/dist/symphony-43N4R6C2.js +0 -2
  219. package/dist/symphony-loader-XJT43FOS.js +0 -2
  220. package/dist/symphony-relay-CIMRXQHI.js +0 -3
  221. package/dist/sync-QRDSFETO.js +0 -2
  222. package/dist/team-WIJVWLII.js +0 -2
  223. package/dist/workspace-2ODL5WLY.js +0 -2
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import {a}from'./chunk-LKAT7IAK.js';import*as c from'fs/promises';import*as u from'path';import*as g from'crypto';import*as l from'js-yaml';import i from'chalk';var f=".paradigm/adoptions.yaml",y=".paradigm/roster.yaml";function m(s){let r=Object.keys(s).sort(),t={};for(let o of r)t[o]=s[o];let e=JSON.stringify(t);return g.createHash("sha256").update(e).digest("hex")}async function h(s){let r=u.join(s,f);try{let t=await c.readFile(r,"utf-8"),e=l.load(t);if(!e||typeof e!="object")return null;let o=$(e.agents),d=e["integrity-hash"]||e.integrityHash||void 0,n=!0;if(d){let a$1=m(o);a$1!==d&&(n=!1,a.component("adoption").warn("Adoption integrity hash mismatch \u2014 adoptions.yaml may have been tampered with",{expected:d.slice(0,12)+"...",computed:a$1.slice(0,12)+"..."}));}return {version:e.version||"1.0",adoptedAt:e["adopted-at"]||e.adoptedAt||"",projectType:e["project-type"]||e.projectType||"",agents:o,verified:n,integrityHash:d}}catch(t){return t.code==="ENOENT"||a.component("adoption").warn("Failed to parse adoptions.yaml",{error:String(t)}),null}}async function v(s,r){let t=u.join(s,f),e=u.dirname(t);await c.mkdir(e,{recursive:true});let o=m(r.agents),d={version:r.version,"adopted-at":r.adoptedAt,"project-type":r.projectType,"integrity-hash":o,agents:w(r.agents)},n=l.dump(d,{lineWidth:-1,noRefs:true,sortKeys:false,quotingType:'"'});await c.writeFile(t,n,"utf-8");}async function k(s,r,t){let e=await h(s);e||(e=A("unknown")),e.agents[r]=t,await v(s,e),a.component("adoption").debug("Added adoption record",{agentId:r,source:t.source});}async function j(s){let r=u.join(s,y),t=new Date().toISOString(),e={active:[]};try{let d=await c.readFile(r,"utf-8"),n=l.load(d);n&&typeof n=="object"&&(e={version:n.version,active:n.active||[],type:n.type});}catch{a.component("adoption").debug("No roster.yaml found for migration");}let o={version:"1.0",adoptedAt:t,projectType:e.type||"unknown",agents:{}};for(let d of e.active||[])o.agents[d]={adopted:t,source:"core",defaultsAccepted:true};return a.component("adoption").debug("Migrated roster to adoptions",{count:Object.keys(o.agents).length}),o}function A(s){return {version:"1.0",adoptedAt:new Date().toISOString(),projectType:s,agents:{}}}function F(s,r){let t=[],e=i.dim("\u2500".repeat(49)),o=s.filter(n=>n.source==="core"),d=s.filter(n=>n.source==="ecosystem");if(t.push(""),t.push(` ${i.bold("Agent Adoption")}`),t.push(` ${e}`),t.push(` ${i.dim("Detected:")} ${r}`),o.length>0){t.push(""),t.push(` ${i.bold(`Core team (${o.length}):`)}`);for(let n of o){let a=n.nickname?`${n.id} (${n.nickname})`:n.id;t.push(` ${i.white(a.padEnd(22))}${i.gray(n.role)}`);}}if(d.length>0){t.push(""),t.push(` ${i.bold(`Ecosystem (${d.length} detected):`)}`);for(let n of d){let a=n.nickname?`${n.id} (${n.nickname})`:n.id;t.push(` ${i.white(a.padEnd(22))}${i.gray(n.role)}`);}}return t.push(""),t.push(` ${i.dim("All using default scopes.")}`),t.push(` ${i.dim("[Enter]")} accept all ${i.dim("|")} ${i.dim("[r]")} review individually ${i.dim("|")} ${i.dim("[c]")} customize`),t.push(""),t.join(`
3
+ `)}function $(s){if(!s||typeof s!="object")return {};let r={};for(let[t,e]of Object.entries(s)){if(!e||typeof e!="object")continue;let o=e;r[t]={adopted:o.adopted||"",source:o.source||"core",defaultsAccepted:o["defaults-accepted"]!=null?!!o["defaults-accepted"]:o.defaultsAccepted!=null?!!o.defaultsAccepted:true,...o.version!=null&&{version:o.version},...o.overrides!=null&&{overrides:o.overrides},...o["scopes-approved"]!=null&&{scopesApproved:o["scopes-approved"]},...o.scopesApproved!=null&&{scopesApproved:o.scopesApproved},...o["detected-from"]!=null&&{detectedFrom:o["detected-from"]},...o.detectedFrom!=null&&{detectedFrom:o.detectedFrom}};}return r}function w(s){let r={};for(let[t,e]of Object.entries(s)){let o={adopted:e.adopted,source:e.source,"defaults-accepted":e.defaultsAccepted};e.version!=null&&(o.version=e.version),e.overrides!=null&&(o.overrides=e.overrides),e.scopesApproved!=null&&(o["scopes-approved"]=e.scopesApproved),e.detectedFrom!=null&&(o["detected-from"]=e.detectedFrom),r[t]=o;}return r}export{h as a,v as b,k as c,j as d,A as e,F as f};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {a}from'./chunk-EKZDFEJW.js';import'./chunk-5TAVYPOV.js';var w={opus:"claude-opus-4-5-20251101",sonnet:"claude-sonnet-4-20250514",haiku:"claude-haiku-4-20250514"},_=class{name="claude";apiKey=null;baseUrl="https://api.anthropic.com/v1";constructor(){this.apiKey=process.env.ANTHROPIC_API_KEY||null;}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return true}supportsMcp(){return true}getTokenCost(n){return a[n]}async isAvailable(){return !!this.apiKey}async*spawn(n,t){if(!this.apiKey){yield {type:"error",content:"ANTHROPIC_API_KEY not set",timestamp:new Date().toISOString()};return}let e=t.model||"sonnet",o=w[e],l=this.buildSystemPrompt(n,t),a=[{role:"user",content:t.task}],r={input:0,output:0,total:0},p=true,i=0,u=50;for(;p&&i<u;){i++;try{let d=await this.streamRequest(o,l,a,t),m=[],c=null;for await(let s of d)if(s.type==="content_block_start"&&s.content_block)s.content_block.type==="tool_use"&&(c={id:s.content_block.id||"",name:s.content_block.name||"",input:""});else if(s.type==="content_block_delta"&&s.delta)s.delta.type==="text_delta"&&s.delta.text?yield {type:"text",content:s.delta.text,timestamp:new Date().toISOString()}:s.delta.type==="input_json_delta"&&c&&(c.input+=s.delta.partial_json||"");else if(s.type==="content_block_stop"){if(c){let h=JSON.parse(c.input||"{}");m.push({type:"tool_use",id:c.id,name:c.name,input:h}),yield {type:"tool_use",content:`Using tool: ${c.name}`,toolName:c.name,toolInput:h,timestamp:new Date().toISOString()},c=null;}}else if(s.type==="message_delta"&&s.usage)r.input+=s.usage.input_tokens||0,r.output+=s.usage.output_tokens||0,r.total=r.input+r.output;else if(s.type==="message_stop")if(m.some(y=>y.type==="tool_use")){a.push({role:"assistant",content:m});let y=await this.executeTools(m,t);a.push({role:"user",content:y});for(let g of y)g.type==="tool_result"&&(yield {type:"tool_result",content:typeof g.content=="string"?g.content:JSON.stringify(g.content),toolName:g.tool_use_id,toolResult:g.content,timestamp:new Date().toISOString()});m=[];}else p=!1;t.budget?.maxTokens&&r.total>t.budget.maxTokens&&(yield {type:"error",content:`Token budget exceeded: ${r.total} > ${t.budget.maxTokens}`,usage:r,timestamp:new Date().toISOString()},p=!1);}catch(d){yield {type:"error",content:d instanceof Error?d.message:String(d),timestamp:new Date().toISOString()},p=false;}}yield {type:"done",content:"Agent completed",usage:r,timestamp:new Date().toISOString()};}buildSystemPrompt(n,t){let e=[];return e.push(t.context.systemPrompt),e.push(`
2
+ import {a}from'./chunk-EKZDFEJW.js';import'./chunk-XHJ27CER.js';var w={opus:"claude-opus-4-5-20251101",sonnet:"claude-sonnet-4-20250514",haiku:"claude-haiku-4-20250514"},_=class{name="claude";apiKey=null;baseUrl="https://api.anthropic.com/v1";constructor(){this.apiKey=process.env.ANTHROPIC_API_KEY||null;}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return true}supportsMcp(){return true}getTokenCost(n){return a[n]}async isAvailable(){return !!this.apiKey}async*spawn(n,t){if(!this.apiKey){yield {type:"error",content:"ANTHROPIC_API_KEY not set",timestamp:new Date().toISOString()};return}let e=t.model||"sonnet",o=w[e],l=this.buildSystemPrompt(n,t),a=[{role:"user",content:t.task}],r={input:0,output:0,total:0},p=true,i=0,u=50;for(;p&&i<u;){i++;try{let d=await this.streamRequest(o,l,a,t),m=[],c=null;for await(let s of d)if(s.type==="content_block_start"&&s.content_block)s.content_block.type==="tool_use"&&(c={id:s.content_block.id||"",name:s.content_block.name||"",input:""});else if(s.type==="content_block_delta"&&s.delta)s.delta.type==="text_delta"&&s.delta.text?yield {type:"text",content:s.delta.text,timestamp:new Date().toISOString()}:s.delta.type==="input_json_delta"&&c&&(c.input+=s.delta.partial_json||"");else if(s.type==="content_block_stop"){if(c){let h=JSON.parse(c.input||"{}");m.push({type:"tool_use",id:c.id,name:c.name,input:h}),yield {type:"tool_use",content:`Using tool: ${c.name}`,toolName:c.name,toolInput:h,timestamp:new Date().toISOString()},c=null;}}else if(s.type==="message_delta"&&s.usage)r.input+=s.usage.input_tokens||0,r.output+=s.usage.output_tokens||0,r.total=r.input+r.output;else if(s.type==="message_stop")if(m.some(y=>y.type==="tool_use")){a.push({role:"assistant",content:m});let y=await this.executeTools(m,t);a.push({role:"user",content:y});for(let g of y)g.type==="tool_result"&&(yield {type:"tool_result",content:typeof g.content=="string"?g.content:JSON.stringify(g.content),toolName:g.tool_use_id,toolResult:g.content,timestamp:new Date().toISOString()});m=[];}else p=!1;t.budget?.maxTokens&&r.total>t.budget.maxTokens&&(yield {type:"error",content:`Token budget exceeded: ${r.total} > ${t.budget.maxTokens}`,usage:r,timestamp:new Date().toISOString()},p=!1);}catch(d){yield {type:"error",content:d instanceof Error?d.message:String(d),timestamp:new Date().toISOString()},p=false;}}yield {type:"done",content:"Agent completed",usage:r,timestamp:new Date().toISOString()};}buildSystemPrompt(n,t){let e=[];return e.push(t.context.systemPrompt),e.push(`
3
3
  ## Your Role: ${n.name.toUpperCase()}
4
4
  `),e.push(n.role),n.focus&&(e.push(`
5
5
  ### Focus Areas
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {a}from'./chunk-EKZDFEJW.js';import'./chunk-5TAVYPOV.js';import*as x from'fs';import*as f from'path';import {spawn}from'child_process';import {EventEmitter}from'events';var b=class{name="claude-cli";claudePath=null;constructor(){}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return true}supportsMcp(){return true}getTokenCost(r){return a[r]}async isAvailable(){try{let{execSync:r}=await import('child_process'),n=r("which claude",{encoding:"utf-8"}).trim();if(n)return this.claudePath=n,!0}catch{let r=["/usr/local/bin/claude",f.join(process.env.HOME||"",".local/bin/claude"),f.join(process.env.HOME||"",".claude/bin/claude")];for(let n of r)if(x.existsSync(n))return this.claudePath=n,true}return false}async*spawn(r,n){if(!this.claudePath){yield {type:"error",content:"Claude CLI not found",timestamp:new Date().toISOString()};return}let e=this.buildPrompt(r,n);yield {type:"text",content:`Starting ${r.name} agent via CLI (streaming)...
2
+ import {a}from'./chunk-EKZDFEJW.js';import'./chunk-XHJ27CER.js';import*as x from'fs';import*as f from'path';import {spawn}from'child_process';import {EventEmitter}from'events';var b=class{name="claude-cli";claudePath=null;constructor(){}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return true}supportsMcp(){return true}getTokenCost(r){return a[r]}async isAvailable(){try{let{execSync:r}=await import('child_process'),n=r("which claude",{encoding:"utf-8"}).trim();if(n)return this.claudePath=n,!0}catch{let r=["/usr/local/bin/claude",f.join(process.env.HOME||"",".local/bin/claude"),f.join(process.env.HOME||"",".claude/bin/claude")];for(let n of r)if(x.existsSync(n))return this.claudePath=n,true}return false}async*spawn(r,n){if(!this.claudePath){yield {type:"error",content:"Claude CLI not found",timestamp:new Date().toISOString()};return}let e=this.buildPrompt(r,n);yield {type:"text",content:`Starting ${r.name} agent via CLI (streaming)...
3
3
  `,timestamp:new Date().toISOString()};let p=["--print","--permission-mode","acceptEdits","--output-format","stream-json","--no-session-persistence"];n.model&&p.push("--model",n.model),n.workingDirectory&&p.push("--add-dir",n.workingDirectory),p.push("-p",e.slice(0,8e3));let o=new EventEmitter,h={input:0,output:0,total:0},a=null,c=false,u=spawn(this.claudePath,p,{cwd:n.workingDirectory||process.cwd(),env:{...process.env},stdio:["pipe","pipe","pipe"]}),g="";u.stdout?.on("data",t=>{g+=t.toString();let s=g.split(`
4
4
  `);g=s.pop()||"";for(let d of s)if(d.trim())try{let k=JSON.parse(d);o.emit("message",k);}catch{o.emit("text",d);}}),u.stderr?.on("data",t=>{let s=t.toString();s.includes("Error")?a=s:o.emit("progress",s);}),u.on("close",t=>{c=true,o.emit("done",t);}),u.on("error",t=>{a=t.message,o.emit("error",t);});let y=n.timeout||180*1e3,S=setTimeout(()=>{u.kill(),a=`Claude CLI timed out after ${y/1e3}s`,o.emit("timeout");},y),l=[],m=null,i=t=>{m?(m(t),m=null):l.push(t);};for(o.on("message",t=>{if(t.type==="assistant"&&t.message?.content)for(let s of t.message.content)s.type==="text"&&s.text?i({type:"text",content:s.text,timestamp:new Date().toISOString()}):s.type==="tool_use"&&s.name&&i({type:"tool_use",content:`Using tool: ${s.name}`,toolName:s.name,toolInput:s.input,timestamp:new Date().toISOString()});else t.type==="result"&&t.usage&&(h={input:t.usage.input_tokens||0,output:t.usage.output_tokens||0,total:(t.usage.input_tokens||0)+(t.usage.output_tokens||0)});}),o.on("text",t=>{i({type:"text",content:t+`
5
5
  `,timestamp:new Date().toISOString()});}),o.on("progress",t=>{i({type:"text",content:".",timestamp:new Date().toISOString()});}),o.on("done",()=>{clearTimeout(S),i({type:"done",content:"Agent completed",usage:h,timestamp:new Date().toISOString()});}),o.on("timeout",()=>{i({type:"error",content:a||"Timeout",timestamp:new Date().toISOString()});}),o.on("error",t=>{clearTimeout(S),i({type:"error",content:t.message,timestamp:new Date().toISOString()});});!c||l.length>0;)if(l.length>0){let t=l.shift();if(yield t,t.type==="done"||t.type==="error")break}else {let t=await new Promise(s=>{m=s,setTimeout(()=>s(null),100);});if(t&&(yield t,t.type==="done"||t.type==="error"))break}a&&!c&&(yield {type:"error",content:a,timestamp:new Date().toISOString()});}buildPrompt(r,n){let e=[];return e.push(`# ${r.name.toUpperCase()} Agent`),e.push(""),e.push("## Role"),e.push(r.role),e.push(""),e.push("## Task"),e.push(n.task),e.push(""),n.context.systemPrompt&&(e.push("## Context"),e.push(n.context.systemPrompt.slice(0,3e3)),e.push("")),n.context.symbols.length>0&&(e.push("## Symbols"),e.push(n.context.symbols.join(", ")),e.push("")),n.context.handoffContext&&(e.push("## From Previous Agent"),e.push(n.context.handoffContext),e.push("")),e.push("## Instructions"),e.push("Complete the task above. Be concise and focused. Keep response under 500 words."),e.join(`
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {a as a$1}from'./chunk-EKZDFEJW.js';import'./chunk-5TAVYPOV.js';import*as n from'fs';import*as o from'path';import*as i from'js-yaml';var a=class{name="claude-code";tasksDir;constructor(e=process.cwd()){this.tasksDir=o.join(e,".paradigm","tasks");}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return true}supportsMcp(){return true}getTokenCost(e){return a$1[e]}async isAvailable(){let e=o.join(process.env.HOME||"",".claude");return n.existsSync(e)||process.env.CLAUDE_CODE==="1"||process.env.TERM_PROGRAM==="claude"}async*spawn(e,s){let t=this.generateTaskId(e.name),u=o.join(this.tasksDir,`${t}.yaml`);n.existsSync(this.tasksDir)||n.mkdirSync(this.tasksDir,{recursive:true});let p={id:t,agent:e.name,model:s.model||"sonnet",status:"pending",created:new Date().toISOString(),task:s.task,context:{systemPrompt:s.context.systemPrompt,symbols:s.context.symbols,handoffContext:s.context.handoffContext},role:e.role,focus:e.focus};n.writeFileSync(u,i.dump(p)),yield {type:"text",content:`Task created: ${t}
2
+ import {a as a$1}from'./chunk-EKZDFEJW.js';import'./chunk-XHJ27CER.js';import*as n from'fs';import*as o from'path';import*as i from'js-yaml';var a=class{name="claude-code";tasksDir;constructor(e=process.cwd()){this.tasksDir=o.join(e,".paradigm","tasks");}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return true}supportsMcp(){return true}getTokenCost(e){return a$1[e]}async isAvailable(){let e=o.join(process.env.HOME||"",".claude");return n.existsSync(e)||process.env.CLAUDE_CODE==="1"||process.env.TERM_PROGRAM==="claude"}async*spawn(e,s){let t=this.generateTaskId(e.name),u=o.join(this.tasksDir,`${t}.yaml`);n.existsSync(this.tasksDir)||n.mkdirSync(this.tasksDir,{recursive:true});let p={id:t,agent:e.name,model:s.model||"sonnet",status:"pending",created:new Date().toISOString(),task:s.task,context:{systemPrompt:s.context.systemPrompt,symbols:s.context.symbols,handoffContext:s.context.handoffContext},role:e.role,focus:e.focus};n.writeFileSync(u,i.dump(p)),yield {type:"text",content:`Task created: ${t}
3
3
  `,timestamp:new Date().toISOString()},yield {type:"text",content:`
4
4
  ---
5
5
  **To execute this agent, use the Task tool with:**
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {a}from'./chunk-EKZDFEJW.js';import'./chunk-5TAVYPOV.js';import*as n from'fs';import*as o from'path';import*as p from'js-yaml';var l={architect:"opus",security:"opus",reviewer:"sonnet",builder:"haiku",tester:"haiku"},c=class{name="claude-code-teams";tasksDir;constructor(t=process.cwd()){this.tasksDir=o.join(t,".paradigm","tasks","teams");}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return true}supportsMcp(){return true}getTokenCost(t){return a[t]}async isAvailable(){if(!(process.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS==="1"))return false;let s=o.join(process.env.HOME||"",".claude");return n.existsSync(s)||process.env.CLAUDE_CODE==="1"||process.env.TERM_PROGRAM==="claude"}async*spawn(t,s){let e=this.generateTaskId(t.name),a=o.join(this.tasksDir,`${e}.yaml`);n.existsSync(this.tasksDir)||n.mkdirSync(this.tasksDir,{recursive:true});let i=this.buildTeammatePrompt(t,s),r=s.model||l[t.name]||"sonnet",u={id:e,provider:"claude-code-teams",agent:t.name,model:r,status:"pending",created:new Date().toISOString(),task:s.task,teammateConfig:{prompt:i,model:r,delegateMode:t.name==="architect"||t.name==="security",focus:t.focus},context:{symbols:s.context.symbols,handoffContext:s.context.handoffContext}};n.writeFileSync(a,p.dump(u)),yield {type:"text",content:`Agent Teams task created: ${e}
2
+ import {a}from'./chunk-EKZDFEJW.js';import'./chunk-XHJ27CER.js';import*as n from'fs';import*as o from'path';import*as p from'js-yaml';var l={architect:"opus",security:"opus",reviewer:"sonnet",builder:"haiku",tester:"haiku"},c=class{name="claude-code-teams";tasksDir;constructor(t=process.cwd()){this.tasksDir=o.join(t,".paradigm","tasks","teams");}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return true}supportsMcp(){return true}getTokenCost(t){return a[t]}async isAvailable(){if(!(process.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS==="1"))return false;let s=o.join(process.env.HOME||"",".claude");return n.existsSync(s)||process.env.CLAUDE_CODE==="1"||process.env.TERM_PROGRAM==="claude"}async*spawn(t,s){let e=this.generateTaskId(t.name),a=o.join(this.tasksDir,`${e}.yaml`);n.existsSync(this.tasksDir)||n.mkdirSync(this.tasksDir,{recursive:true});let i=this.buildTeammatePrompt(t,s),r=s.model||l[t.name]||"sonnet",u={id:e,provider:"claude-code-teams",agent:t.name,model:r,status:"pending",created:new Date().toISOString(),task:s.task,teammateConfig:{prompt:i,model:r,delegateMode:t.name==="architect"||t.name==="security",focus:t.focus},context:{symbols:s.context.symbols,handoffContext:s.context.handoffContext}};n.writeFileSync(a,p.dump(u)),yield {type:"text",content:`Agent Teams task created: ${e}
3
3
  `,timestamp:new Date().toISOString()},yield {type:"text",content:this.buildSpawnInstruction(t,i,r),timestamp:new Date().toISOString()};let d={subject:`${t.name}: ${s.task.slice(0,80)}`,description:i,activeForm:`Running ${t.name} agent`};yield {type:"text",content:`
4
4
  **Shared task list entry:**
5
5
  \`\`\`json
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import {a,e,d}from'./chunk-73R63P7K.js';import'./chunk-5TAVYPOV.js';import*as c from'fs';import*as p from'path';import {execSync}from'child_process';import n from'chalk';import*as w from'js-yaml';function R(s){return s.match(/(?:^|\s)((?:\/|\.\/|[a-zA-Z0-9_-]+\/)[^\s,;:'"]+\.[a-zA-Z]{1,10})\b/)?.[1]}async function $(s,l){try{let a$1=a(s),f=[];try{f=execSync("git diff --name-only HEAD",{cwd:s,encoding:"utf8",timeout:5e3}).trim().split(`
3
- `).filter(Boolean);}catch{}let i;try{i=execSync("git status --porcelain",{cwd:s,encoding:"utf8",timeout:5e3}).trim()==="";}catch{}let u=p.join(s,"portal.yaml"),g=!1;if(c.existsSync(u))try{let t=c.readFileSync(u,"utf8"),e=w.load(t);g=e?.routes!=null&&Object.keys(e.routes).length>0;}catch{}let r=e({toolsCalled:[],filesModified:f,symbolsTouched:[],loreRecorded:!1,hasPortalRoutes:g,taskAddsRoutes:!1,gitClean:i}),o=d(a$1,l,r),d$1=0;if(o.evaluations.length>0)try{let t=p.join(s,".paradigm","sentinel");if(c.existsSync(t)){let{SentinelStorage:e}=await import('./dist-VGFSP3XM.js'),m=new e(t);for(let b of o.evaluations)m.recordPracticeEvent({habitId:b.habit.id,habitCategory:b.habit.category,result:b.result,engineer:"agent",sessionId:`cli-${Date.now().toString(36)}`,symbolsTouched:[],filesModified:f,notes:b.reason}),d$1++;}}catch{}let h=p.join(s,".paradigm",".habits-blocking");try{if(l==="on-stop"&&o.blocksCompletion){let t=o.evaluations.filter(e=>e.result==="skipped"&&e.habit.severity==="block").map(e=>`${e.habit.name}: ${e.reason}`);c.writeFileSync(h,t.join(`
4
- `),"utf8");}else l==="on-stop"&&c.existsSync(h)&&c.unlinkSync(h);}catch{}return {trigger:l,evaluation:{total:o.summary.total,followed:o.summary.followed,skipped:o.summary.skipped,partial:o.summary.partial,blockingViolations:o.summary.blockingViolations,blocksCompletion:o.blocksCompletion},habits:o.evaluations.map(t=>({id:t.habit.id,name:t.habit.name,category:t.habit.category,severity:t.habit.severity,result:t.result,reason:t.reason,evidence:t.evidence})),recorded:d$1}}catch{return null}}async function P(s,l){let a=p.join(s,".paradigm","aspect-graph.db");if(!c.existsSync(a))return {driftedCount:0,healedCount:0,cleanCount:0,missingCount:0,details:[]};try{let{driftCheckCommand:f}=await import('./drift-ILZE5BFJ.js'),i="",u=console.log;console.log=g=>{i=g;};try{await f({json:!0,autoHeal:l});}finally{console.log=u;}return i?JSON.parse(i):null}catch{return null}}async function B(s){if(!c.existsSync(p.join(s,"portal.yaml")))return null;try{let{checkPortalCompliance:l}=await import('./portal-compliance-4MG5F2GI.js'),a=await l(s);return {status:a.status,declaredButUnusedCount:a.declaredButUnused.length,usedButUndeclaredCount:a.usedButUndeclared.length,properlyDeclaredCount:a.properlyDeclared.length,declaredButUnused:a.declaredButUnused,usedButUndeclared:a.usedButUndeclared,properlyDeclared:a.properlyDeclared}}catch{return null}}async function j(s){try{let{runPostflightLearning:l}=await import('./ambient-2JZTNXUL.js');return await l(s)}catch{return null}}async function A(s){let l=process.cwd(),a=s.trigger||"on-stop",f=s.autoHeal!==false,i=[],u=[],g=await $(l,a),r=await P(l,f),o=await B(l);if(g?.evaluation.blocksCompletion){let t=g.habits.filter(e=>e.result==="skipped"&&e.severity==="block");for(let e of t){let m=`Blocking habit not satisfied: ${e.name} \u2014 ${e.reason}`;i.push(m),u.push({message:m,source:"habits",file:R(e.reason),severity:"blocking"});}}if(r&&r.driftedCount>0){let t=`${r.driftedCount} aspect anchor(s) have drifted (content genuinely changed). Run paradigm_aspect_check to review.`;i.push(t);for(let e of r.details.filter(m=>m.status==="drifted"))u.push({message:`Aspect ~${e.aspectId} drifted at lines ${e.startLine}-${e.endLine}`,source:"drift",file:e.path,severity:"advisory"});u.filter(e=>e.source==="drift").length===0&&u.push({message:t,source:"drift",severity:"advisory"});}if(o&&o.usedButUndeclaredCount>0){let t=`${o.usedButUndeclaredCount} gate(s) used in code but not declared in portal.yaml: ${o.usedButUndeclared.join(", ")}`;i.push(t);for(let e of o.usedButUndeclared)u.push({message:`Gate ^${e} used in code but not declared in portal.yaml`,source:"portal",file:"portal.yaml",severity:"blocking"});}let d=null;s.learn&&(d=await j(l));let h={habits:g,drift:r,portal:o,violations:i,structuredViolations:u,postflight:s.learn?d:void 0};if(s.json)console.log(JSON.stringify(h));else {if(console.log(n.magenta(`
2
+ import {a,e,d}from'./chunk-BRHQJLTG.js';import'./chunk-XHJ27CER.js';import*as c from'fs';import*as p from'path';import {execSync}from'child_process';import n from'chalk';import*as w from'js-yaml';function R(s){return s.match(/(?:^|\s)((?:\/|\.\/|[a-zA-Z0-9_-]+\/)[^\s,;:'"]+\.[a-zA-Z]{1,10})\b/)?.[1]}async function $(s,l){try{let a$1=a(s),f=[];try{f=execSync("git diff --name-only HEAD",{cwd:s,encoding:"utf8",timeout:5e3}).trim().split(`
3
+ `).filter(Boolean);}catch{}let i;try{i=execSync("git status --porcelain",{cwd:s,encoding:"utf8",timeout:5e3}).trim()==="";}catch{}let u=p.join(s,"portal.yaml"),g=!1;if(c.existsSync(u))try{let t=c.readFileSync(u,"utf8"),e=w.load(t);g=e?.routes!=null&&Object.keys(e.routes).length>0;}catch{}let r=e({toolsCalled:[],filesModified:f,symbolsTouched:[],loreRecorded:!1,hasPortalRoutes:g,taskAddsRoutes:!1,gitClean:i}),o=d(a$1,l,r),d$1=0;if(o.evaluations.length>0)try{let t=p.join(s,".paradigm","sentinel");if(c.existsSync(t)){let{SentinelStorage:e}=await import('./dist-OKM6BXTH.js'),m=new e(t);for(let b of o.evaluations)m.recordPracticeEvent({habitId:b.habit.id,habitCategory:b.habit.category,result:b.result,engineer:"agent",sessionId:`cli-${Date.now().toString(36)}`,symbolsTouched:[],filesModified:f,notes:b.reason}),d$1++;}}catch{}let h=p.join(s,".paradigm",".habits-blocking");try{if(l==="on-stop"&&o.blocksCompletion){let t=o.evaluations.filter(e=>e.result==="skipped"&&e.habit.severity==="block").map(e=>`${e.habit.name}: ${e.reason}`);c.writeFileSync(h,t.join(`
4
+ `),"utf8");}else l==="on-stop"&&c.existsSync(h)&&c.unlinkSync(h);}catch{}return {trigger:l,evaluation:{total:o.summary.total,followed:o.summary.followed,skipped:o.summary.skipped,partial:o.summary.partial,blockingViolations:o.summary.blockingViolations,blocksCompletion:o.blocksCompletion},habits:o.evaluations.map(t=>({id:t.habit.id,name:t.habit.name,category:t.habit.category,severity:t.habit.severity,result:t.result,reason:t.reason,evidence:t.evidence})),recorded:d$1}}catch{return null}}async function P(s,l){let a=p.join(s,".paradigm","aspect-graph.db");if(!c.existsSync(a))return {driftedCount:0,healedCount:0,cleanCount:0,missingCount:0,details:[]};try{let{driftCheckCommand:f}=await import('./drift-6QPDKKUO.js'),i="",u=console.log;console.log=g=>{i=g;};try{await f({json:!0,autoHeal:l});}finally{console.log=u;}return i?JSON.parse(i):null}catch{return null}}async function B(s){if(!c.existsSync(p.join(s,"portal.yaml")))return null;try{let{checkPortalCompliance:l}=await import('./portal-compliance-OBPK2IR5.js'),a=await l(s);return {status:a.status,declaredButUnusedCount:a.declaredButUnused.length,usedButUndeclaredCount:a.usedButUndeclared.length,properlyDeclaredCount:a.properlyDeclared.length,declaredButUnused:a.declaredButUnused,usedButUndeclared:a.usedButUndeclared,properlyDeclared:a.properlyDeclared}}catch{return null}}async function j(s){try{let{runPostflightLearning:l}=await import('./ambient-4NSPAQDJ.js');return await l(s)}catch{return null}}async function A(s){let l=process.cwd(),a=s.trigger||"on-stop",f=s.autoHeal!==false,i=[],u=[],g=await $(l,a),r=await P(l,f),o=await B(l);if(g?.evaluation.blocksCompletion){let t=g.habits.filter(e=>e.result==="skipped"&&e.severity==="block");for(let e of t){let m=`Blocking habit not satisfied: ${e.name} \u2014 ${e.reason}`;i.push(m),u.push({message:m,source:"habits",file:R(e.reason),severity:"blocking"});}}if(r&&r.driftedCount>0){let t=`${r.driftedCount} aspect anchor(s) have drifted (content genuinely changed). Run paradigm_aspect_check to review.`;i.push(t);for(let e of r.details.filter(m=>m.status==="drifted"))u.push({message:`Aspect ~${e.aspectId} drifted at lines ${e.startLine}-${e.endLine}`,source:"drift",file:e.path,severity:"advisory"});u.filter(e=>e.source==="drift").length===0&&u.push({message:t,source:"drift",severity:"advisory"});}if(o&&o.usedButUndeclaredCount>0){let t=`${o.usedButUndeclaredCount} gate(s) used in code but not declared in portal.yaml: ${o.usedButUndeclared.join(", ")}`;i.push(t);for(let e of o.usedButUndeclared)u.push({message:`Gate ^${e} used in code but not declared in portal.yaml`,source:"portal",file:"portal.yaml",severity:"blocking"});}let d=null;s.learn&&(d=await j(l));let h={habits:g,drift:r,portal:o,violations:i,structuredViolations:u,postflight:s.learn?d:void 0};if(s.json)console.log(JSON.stringify(h));else {if(console.log(n.magenta(`
5
5
  Paradigm Compliance Check
6
6
  `)),g){let{evaluation:t}=g,e=t.blocksCompletion?n.red:n.green;console.log(n.white(" Habits:")),console.log(` ${e(`${t.followed} followed, ${t.skipped} skipped, ${t.partial} partial`)}`),t.blockingViolations>0&&console.log(n.red(` ${t.blockingViolations} blocking violation(s)`)),console.log();}if(r&&(console.log(n.white(" Drift:")),r.healedCount>0&&console.log(n.green(` Auto-healed: ${r.healedCount} shifted anchor(s)`)),r.cleanCount>0&&console.log(n.green(` Clean: ${r.cleanCount} anchor(s)`)),r.driftedCount>0&&console.log(n.red(` Drifted: ${r.driftedCount} anchor(s)`)),r.missingCount>0&&console.log(n.yellow(` Missing: ${r.missingCount} anchor file(s)`)),console.log()),o){console.log(n.white(" Portal:"));let t=o.status==="compliant"?n.green:o.status==="warnings"?n.yellow:n.red;console.log(` Status: ${t(o.status)}`),o.usedButUndeclaredCount>0&&console.log(n.red(` ${o.usedButUndeclaredCount} undeclared gate(s)`)),console.log();}if(d){if(console.log(n.white(" Postflight Learning:")),d.journalsWritten>0){console.log(n.green(` Journals written: ${d.journalsWritten}`));for(let[t,e]of Object.entries(d.journalsByAgent))e>0&&console.log(n.gray(` ${t}: ${e} entries`));}else console.log(n.gray(" No verdicts to learn from"));d.promoted>0&&console.log(n.green(` Promoted to notebooks: ${d.promoted}`)),console.log();}if(i.length>0){console.log(n.red(` ${i.length} violation(s):`));for(let t of i)console.log(n.red(` - ${t}`));}else console.log(n.green(" All checks passed."));console.log();}i.length>0&&(process.exitCode=1);}export{A as complianceCheckCommand};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as c from'path';var p=".paradigm/events/compliance-history.jsonl",s=10;function C(t,n){try{let e=c.join(t,p),r=c.dirname(e);i.existsSync(r)||i.mkdirSync(r,{recursive:!0});let o={timestamp:new Date().toISOString(),...n},a=JSON.stringify(o)+`
2
+ import'./chunk-XHJ27CER.js';import*as i from'fs';import*as c from'path';var p=".paradigm/events/compliance-history.jsonl",s=10;function C(t,n){try{let e=c.join(t,p),r=c.dirname(e);i.existsSync(r)||i.mkdirSync(r,{recursive:!0});let o={timestamp:new Date().toISOString(),...n},a=JSON.stringify(o)+`
3
3
  `;i.appendFileSync(e,a,"utf8");}catch{}}function d(t,n){try{let e=c.join(t,p);if(!i.existsSync(e))return [];let r=i.readFileSync(e,"utf8").trim().split(`
4
4
  `).filter(o=>o.trim()).map(o=>{try{return JSON.parse(o)}catch{return null}}).filter(o=>o!==null);return n&&n>0?r.slice(-n):r}catch{return []}}function l(t){let n=t.reduce((r,o)=>r+o.checks,0),e=t.reduce((r,o)=>r+o.violations,0);return n===0?0:e/n}function g(t,n=s){let e=d(t,n);if(e.length<2)return null;let r=Math.floor(e.length/2),o=e.slice(0,r),a=e.slice(r),f=l(o),u=l(a)-f,m=.05;return u<-m?"improving":u>m?"degrading":"stable"}function h(t,n){if(!t)return "yellow";if(t==="improving")return "green";let e=0;if(n){let r=d(n,Math.ceil(s/2));e=l(r);}return t==="stable"?e===0?"green":"yellow":e>.2?"red":"orange"}function R(t,n=s){let e=g(t,n);return e?{trend:e,dot:h(e,t)}:null}export{R as getComplianceHealthSummary,g as getComplianceTrend,h as getHealthDot,C as recordComplianceSnapshot};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {a as a$1}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import {execSync,spawn}from'child_process';import*as c from'fs';import*as r from'path';import*as p from'os';import {fileURLToPath}from'url';import e from'chalk';var b=fileURLToPath(import.meta.url),w=r.dirname(b),a=r.join(p.homedir(),".paradigm","conductor","bin","conductor");async function k(t){let n=a$1.command("conductor");if(t.install){await C(t,n);return}let i=x(t,n);if(i){if(t.build){let o=d();if(o){l(o,t,n);let s=r.join(o,".build","release","conductor");f(s,n);return}else n.error("--build requires the Paradigm monorepo"),console.log(e.gray(" Run from inside the a-paradigm repo, or use --install to update the global binary.")),process.exit(1);}f(i,n);}}function x(t,n){if(c.existsSync(a))return a;let i=d();if(i){let o=r.join(i,".build","release","conductor");if(c.existsSync(o)||(n.info("Dev binary not found, building\u2026"),l(i,t,n),c.existsSync(o)))return o}return n.error("Conductor binary not found"),console.log(""),console.log(e.white(" To install Conductor:")),console.log(e.cyan(" cd <paradigm-repo> && paradigm conductor --install")),console.log(""),console.log(e.gray(" This builds the native binary and installs it to ~/.paradigm/conductor/bin/")),console.log(e.gray(" After that, `paradigm conductor` works from any directory.")),console.log(""),process.exit(1),null}async function C(t,n){let i=d();i||(n.error("Cannot install \u2014 not in the Paradigm monorepo"),console.log(e.gray(" Run this command from inside the a-paradigm repository.")),process.exit(1));let o=r.join(i,".build","release","conductor");(!c.existsSync(o)||t.build)&&l(i,t,n),c.existsSync(o)||(n.error("Build did not produce a binary"),process.exit(1));let s=r.dirname(a);c.mkdirSync(s,{recursive:true}),c.copyFileSync(o,a),c.chmodSync(a,493);let m=(c.statSync(a).size/(1024*1024)).toFixed(1);n.success(`Conductor installed (${m} MB)`),console.log(""),console.log(e.green(" \u2713 ")+e.white("Installed to ")+e.cyan("~/.paradigm/conductor/bin/conductor")),console.log(e.green(" \u2713 ")+e.white("Run ")+e.cyan("paradigm conductor")+e.white(" from any directory")),console.log("");}function l(t,n,i){i.info("Building Conductor\u2026");try{execSync("swift build -c release",{cwd:t,stdio:n.verbose?"inherit":"pipe"}),i.success("Build complete");}catch(o){i.error("Build failed");let s=o.message||"";s.includes("xcode-select")?(console.log(e.gray(" Xcode Command Line Tools are required.")),console.log(e.gray(" Install with: xcode-select --install"))):console.log(e.gray(` ${s.slice(0,200)}`)),process.exit(1);}}function f(t,n){n.info("Launching Conductor\u2026"),spawn(t,[],{detached:true,stdio:"ignore"}).unref();let o=t===a;console.log(e.cyan(`
2
+ import {a as a$1}from'./chunk-LKAT7IAK.js';import'./chunk-XHJ27CER.js';import {execSync,spawn}from'child_process';import*as c from'fs';import*as r from'path';import*as p from'os';import {fileURLToPath}from'url';import e from'chalk';var b=fileURLToPath(import.meta.url),w=r.dirname(b),a=r.join(p.homedir(),".paradigm","conductor","bin","conductor");async function k(t){let n=a$1.command("conductor");if(t.install){await C(t,n);return}let i=x(t,n);if(i){if(t.build){let o=d();if(o){l(o,t,n);let s=r.join(o,".build","release","conductor");f(s,n);return}else n.error("--build requires the Paradigm monorepo"),console.log(e.gray(" Run from inside the a-paradigm repo, or use --install to update the global binary.")),process.exit(1);}f(i,n);}}function x(t,n){if(c.existsSync(a))return a;let i=d();if(i){let o=r.join(i,".build","release","conductor");if(c.existsSync(o)||(n.info("Dev binary not found, building\u2026"),l(i,t,n),c.existsSync(o)))return o}return n.error("Conductor binary not found"),console.log(""),console.log(e.white(" To install Conductor:")),console.log(e.cyan(" cd <paradigm-repo> && paradigm conductor --install")),console.log(""),console.log(e.gray(" This builds the native binary and installs it to ~/.paradigm/conductor/bin/")),console.log(e.gray(" After that, `paradigm conductor` works from any directory.")),console.log(""),process.exit(1),null}async function C(t,n){let i=d();i||(n.error("Cannot install \u2014 not in the Paradigm monorepo"),console.log(e.gray(" Run this command from inside the a-paradigm repository.")),process.exit(1));let o=r.join(i,".build","release","conductor");(!c.existsSync(o)||t.build)&&l(i,t,n),c.existsSync(o)||(n.error("Build did not produce a binary"),process.exit(1));let s=r.dirname(a);c.mkdirSync(s,{recursive:true}),c.copyFileSync(o,a),c.chmodSync(a,493);let m=(c.statSync(a).size/(1024*1024)).toFixed(1);n.success(`Conductor installed (${m} MB)`),console.log(""),console.log(e.green(" \u2713 ")+e.white("Installed to ")+e.cyan("~/.paradigm/conductor/bin/conductor")),console.log(e.green(" \u2713 ")+e.white("Run ")+e.cyan("paradigm conductor")+e.white(" from any directory")),console.log("");}function l(t,n,i){i.info("Building Conductor\u2026");try{execSync("swift build -c release",{cwd:t,stdio:n.verbose?"inherit":"pipe"}),i.success("Build complete");}catch(o){i.error("Build failed");let s=o.message||"";s.includes("xcode-select")?(console.log(e.gray(" Xcode Command Line Tools are required.")),console.log(e.gray(" Install with: xcode-select --install"))):console.log(e.gray(` ${s.slice(0,200)}`)),process.exit(1);}}function f(t,n){n.info("Launching Conductor\u2026"),spawn(t,[],{detached:true,stdio:"ignore"}).unref();let o=t===a;console.log(e.cyan(`
3
3
  Paradigm Conductor is running.`)),o&&console.log(e.gray(" Binary: ~/.paradigm/conductor/bin/conductor")),console.log(e.gray(" Look for the waveform icon in your menu bar.")),console.log(e.gray(` Quit via the menu bar icon or Cmd+Q.
4
4
  `));}function d(){let t=r.resolve(w,"..");for(let o=0;o<5;o++){let s=r.join(t,"packages","conductor");if(c.existsSync(r.join(s,"Package.swift")))return s;t=r.dirname(t);}let n=r.join(process.cwd(),"packages","conductor");if(c.existsSync(r.join(n,"Package.swift")))return n;if(c.existsSync(r.join(process.cwd(),"Package.swift"))&&r.basename(process.cwd())==="conductor")return process.cwd();let i=process.cwd();for(let o=0;o<5;o++){i=r.dirname(i);let s=r.join(i,"packages","conductor");if(c.existsSync(r.join(s,"Package.swift")))return s}return null}export{k as conductorCommand};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import'./chunk-5TAVYPOV.js';import {z}from'zod';import*as i from'js-yaml';var p=z.enum(["web","backend","fullstack","api","cli","ml","mobile","game","embedded","devops","data","library","monorepo","custom"]),g=z.enum(["auto","claude","claude-code","cursor-cli","claude-cli","manual"]),r=z.object({name:z.string(),description:z.string(),examples:z.array(z.string()).optional()}).passthrough(),u=z.object({file:z.string().optional(),"core-tags":z.array(z.string()).optional(),"allow-suggestions":z.boolean().optional()}).passthrough(),m=z.object({overview:z.string().optional(),"how-to-use":z.array(z.string()).optional(),"update-rules":z.array(z.string()).optional()}).passthrough(),d=z.object({enforce:z.boolean().optional(),"default-level":z.enum(["debug","info","warn","error"]).optional(),"symbol-mapping":z.record(z.string(),z.string()).optional()}).passthrough(),b=z.object({pattern:z.string(),depth:z.number().optional()}),h=z.object({toolCacheTtlMs:z.number().optional()}).passthrough(),f=z.object({model:z.string().optional(),"context-window":z.number().optional()}).passthrough(),y=z.object({enabled:z.boolean().optional(),"index-file":z.string().optional(),"docs-path":z.string().optional()}).passthrough(),w=z.object({enabled:z.boolean().optional(),"auto-include":z.boolean().optional()}).passthrough(),j=z.object({version:z.string(),project:z.string(),discipline:p.optional(),"agent-provider":g.optional(),"agent-guidelines":m.optional(),"symbol-system":z.record(z.string(),r).optional(),"tag-bank":u.optional(),component_types:z.record(z.string(),z.string()).optional(),logging:d.optional(),"purpose-required":z.array(b).optional(),conventions:z.array(z.string()).optional(),workspace:z.string().optional(),limits:h.optional(),"ai-agent":f.optional(),context:y.optional(),probe:w.optional(),states:z.record(z.string(),z.unknown()).optional(),"custom-symbols":z.record(z.string(),r).optional()}).passthrough(),v=new Set(["version","project","discipline","agent-provider","agent-guidelines","symbol-system","tag-bank","component_types","logging","purpose-required","conventions","workspace","limits","ai-agent","context","probe","states","custom-symbols","docs","features","enforcement","model-resolution"]);function S(l){let s=[],e=[],t;try{t=i.load(l);}catch(n){return {valid:false,warnings:[],errors:[`YAML parse error: ${n.message}`]}}if(!t||typeof t!="object")return {valid:false,warnings:[],errors:["Config must be a YAML object"]};for(let n of Object.keys(t))v.has(n)||s.push(`Unrecognized config key: "${n}"`);let a=j.safeParse(t);if(!a.success)for(let n of a.error.issues){let c=n.path.join(".");e.push(`${c}: ${n.message}`);}return {valid:e.length===0,warnings:s,errors:e}}export{j as paradigmConfigSchema,S as validateConfig};
2
+ import'./chunk-XHJ27CER.js';import {z}from'zod';import*as i from'js-yaml';var p=z.enum(["web","backend","fullstack","api","cli","ml","mobile","game","embedded","devops","data","library","monorepo","custom"]),g=z.enum(["auto","claude","claude-code","cursor-cli","claude-cli","manual"]),r=z.object({name:z.string(),description:z.string(),examples:z.array(z.string()).optional()}).passthrough(),u=z.object({file:z.string().optional(),"core-tags":z.array(z.string()).optional(),"allow-suggestions":z.boolean().optional()}).passthrough(),m=z.object({overview:z.string().optional(),"how-to-use":z.array(z.string()).optional(),"update-rules":z.array(z.string()).optional()}).passthrough(),d=z.object({enforce:z.boolean().optional(),"default-level":z.enum(["debug","info","warn","error"]).optional(),"symbol-mapping":z.record(z.string(),z.string()).optional()}).passthrough(),b=z.object({pattern:z.string(),depth:z.number().optional()}),h=z.object({toolCacheTtlMs:z.number().optional()}).passthrough(),f=z.object({model:z.string().optional(),"context-window":z.number().optional()}).passthrough(),y=z.object({enabled:z.boolean().optional(),"index-file":z.string().optional(),"docs-path":z.string().optional()}).passthrough(),w=z.object({enabled:z.boolean().optional(),"auto-include":z.boolean().optional()}).passthrough(),j=z.object({version:z.string(),project:z.string(),discipline:p.optional(),"agent-provider":g.optional(),"agent-guidelines":m.optional(),"symbol-system":z.record(z.string(),r).optional(),"tag-bank":u.optional(),component_types:z.record(z.string(),z.string()).optional(),logging:d.optional(),"purpose-required":z.array(b).optional(),conventions:z.array(z.string()).optional(),workspace:z.string().optional(),limits:h.optional(),"ai-agent":f.optional(),context:y.optional(),probe:w.optional(),states:z.record(z.string(),z.unknown()).optional(),"custom-symbols":z.record(z.string(),r).optional()}).passthrough(),v=new Set(["version","project","discipline","agent-provider","agent-guidelines","symbol-system","tag-bank","component_types","logging","purpose-required","conventions","workspace","limits","ai-agent","context","probe","states","custom-symbols","docs","features","enforcement","model-resolution"]);function S(l){let s=[],e=[],t;try{t=i.load(l);}catch(n){return {valid:false,warnings:[],errors:[`YAML parse error: ${n.message}`]}}if(!t||typeof t!="object")return {valid:false,warnings:[],errors:["Config must be a YAML object"]};for(let n of Object.keys(t))v.has(n)||s.push(`Unrecognized config key: "${n}"`);let a=j.safeParse(t);if(!a.success)for(let n of a.error.issues){let c=n.path.join(".");e.push(`${c}: ${n.message}`);}return {valid:e.length===0,warnings:s,errors:e}}export{j as paradigmConfigSchema,S as validateConfig};
@@ -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-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(`
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-XHJ27CER.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-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(`
2
+ import {a}from'./chunk-LKAT7IAK.js';import'./chunk-XHJ27CER.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-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(`
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-URJW6UZH.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-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(`
2
+ import {e}from'./chunk-JIXHEBGK.js';import {e as e$1}from'./chunk-QT2LKB3P.js';import'./chunk-XHJ27CER.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-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};
2
+ import {a}from'./chunk-FYDRENK7.js';import {d,c}from'./chunk-EKZDFEJW.js';import'./chunk-XHJ27CER.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-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...
2
+ import {a}from'./chunk-EKZDFEJW.js';import'./chunk-XHJ27CER.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-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(`
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-XHJ27CER.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-5TAVYPOV.js';
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-XHJ27CER.js';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
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(`
2
+ import {g,i as i$1}from'./chunk-7YTAA6XA.js';import'./chunk-XHJ27CER.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-A7KFOJ2F.js';import'./chunk-TYWB5IQJ.js';import'./chunk-UDUHSHO4.js';import'./chunk-FYDRENK7.js';import'./chunk-HXGYVS2N.js';import'./chunk-AO7ZSRME.js';import'./chunk-SHD27BQX.js';import'./chunk-EKZDFEJW.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as a from'path';import o from'chalk';async function D(l,f,t){let d=f?a.resolve(f):process.cwd();if(!l){t.json?console.log(JSON.stringify({error:"Orchestration ID required"})):(console.log(o.red(`
2
+ import {b}from'./chunk-7PB7AXQE.js';import'./chunk-TYWB5IQJ.js';import'./chunk-5YHR77AL.js';import'./chunk-RN35IVA2.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-XHJ27CER.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-5TAVYPOV.js';
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-XHJ27CER.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-5TAVYPOV.js';
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-XHJ27CER.js';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
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+=`
2
+ import'./chunk-XHJ27CER.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,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-5TAVYPOV.js';
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-XHJ27CER.js';
@@ -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-5TAVYPOV.js';
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-XHJ27CER.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-5TAVYPOV.js';
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-XHJ27CER.js';
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import'./chunk-XHJ27CER.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
+ export{d as RegistryClient,h as RegistryError};
@@ -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-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};
2
+ import {a,d,e,f,g,c,h}from'./chunk-BFD3GFRK.js';import'./chunk-XHJ27CER.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-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(`
2
+ import {a,d,e,f,g,b}from'./chunk-BFD3GFRK.js';import'./chunk-XHJ27CER.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-G6MJIAJS.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
4
+ `));try{let{startPlatformServer:i}=await import('./platform-server-YIBX4YDJ.js');await i({projectDir:s,port:e,open:p,sections:["overview","docs"]}),console.log(n.green(` Docs running at ${n.bold(`http://localhost:${e}`)}`)),console.log(n.gray(` Press Ctrl+C to stop
5
5
  `)),await new Promise(()=>{});}catch(i){i.code==="EADDRINUSE"?(console.error(n.red(`
6
6
  Error: Port ${e} is already in use.`)),console.log(n.gray(` Try: paradigm docs serve --port ${e+1}
7
7
  `))):console.error(n.red(`
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{a as doctorCommand}from'./chunk-BCOPNVPY.js';import'./chunk-DOCDDDTD.js';import'./chunk-JQKKVAAN.js';import'./chunk-LKAT7IAK.js';import'./chunk-XHJ27CER.js';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
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(`
2
+ import'./chunk-XHJ27CER.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-5TAVYPOV.js';import*as a from'fs';import*as h from'path';import o from'chalk';var E=`# Echoes - Error to Symbol Mapping
2
+ import {a as a$1}from'./chunk-LKAT7IAK.js';import'./chunk-XHJ27CER.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-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(`
2
+ import {g,h}from'./chunk-7YTAA6XA.js';import'./chunk-XHJ27CER.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
- 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';
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-XHJ27CER.js';
@@ -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-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};
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-XHJ27CER.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,3 +1,3 @@
1
1
  #!/usr/bin/env node
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)+`
2
+ import'./chunk-XHJ27CER.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-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(`
2
+ import'./chunk-XHJ27CER.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-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};
2
+ import {a}from'./chunk-FYDRENK7.js';import'./chunk-XHJ27CER.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-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(`
2
+ import'./chunk-SHD27BQX.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-XHJ27CER.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(`