@a-company/paradigm 5.10.0 → 5.21.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 (409) hide show
  1. package/dist/accept-orchestration-IUAWQZUN.js +18 -0
  2. package/dist/add-P76GEMGF.js +8 -0
  3. package/dist/agent-UUTYOFTH.js +33 -0
  4. package/dist/agent-loader-EPXURMO7.js +2 -0
  5. package/dist/agent-loader-PYGPX6D2.js +2 -0
  6. package/dist/agent-state-KSQ3S7OB.js +2 -0
  7. package/dist/agents-suggest-HYTFMQD3.js +10 -0
  8. package/dist/aggregate-W66DM3GA.js +10 -0
  9. package/dist/ambient-HYZR42NX.js +35 -0
  10. package/dist/assess-UFPYEJKP.js +9 -0
  11. package/dist/auto-RHJXOZFL.js +14 -0
  12. package/dist/beacon-5QVYV5DF.js +13 -0
  13. package/dist/calibration-OLJYB5HN.js +7 -0
  14. package/dist/check-THVGY4R5.js +14 -0
  15. package/dist/chunk-22ISTMKI.js +31 -0
  16. package/dist/chunk-2QO33NYK.js +3 -0
  17. package/dist/chunk-33LKBMVK.js +134 -0
  18. package/dist/chunk-4QADCWPU.js +7 -0
  19. package/dist/chunk-4TXOVRWD.js +3 -0
  20. package/dist/chunk-4UJ4NIEQ.js +4 -0
  21. package/dist/chunk-4ZGGWZ32.js +3 -0
  22. package/dist/chunk-5TAVYPOV.js +2 -0
  23. package/dist/chunk-6EX37L4Q.js +8 -0
  24. package/dist/chunk-AD5TAD2A.js +5 -0
  25. package/dist/chunk-AGVAHVUA.js +2 -0
  26. package/dist/chunk-AO7ZSRME.js +13 -0
  27. package/dist/chunk-BFD3GFRK.js +2 -0
  28. package/dist/chunk-D34YFK4M.js +6 -0
  29. package/dist/chunk-DVZWCXB6.js +2 -0
  30. package/dist/chunk-EKZDFEJW.js +2 -0
  31. package/dist/chunk-ET5XJTSX.js +2 -0
  32. package/dist/chunk-FYDRENK7.js +3 -0
  33. package/dist/chunk-HMQ5BHP2.js +743 -0
  34. package/dist/chunk-HXKWL3VK.js +29 -0
  35. package/dist/chunk-IZSBGW6E.js +2 -0
  36. package/dist/chunk-J32OPJEX.js +2 -0
  37. package/dist/chunk-JBDMCRPP.js +7 -0
  38. package/dist/chunk-JIXHEBGK.js +7 -0
  39. package/dist/chunk-JNSJVCTU.js +2 -0
  40. package/dist/chunk-JQKKVAAN.js +2 -0
  41. package/dist/chunk-KLBH26PA.js +429 -0
  42. package/dist/chunk-L6K5HNDL.js +24 -0
  43. package/dist/chunk-LKAT7IAK.js +2 -0
  44. package/dist/chunk-M4UMM6DC.js +5 -0
  45. package/dist/chunk-NKYNHSA5.js +424 -0
  46. package/dist/chunk-NW6OKHE6.js +5 -0
  47. package/dist/chunk-NXRVR37G.js +60 -0
  48. package/dist/chunk-ODVKPZZ4.js +2 -0
  49. package/dist/chunk-PUBB7LIT.js +5 -0
  50. package/dist/chunk-Q2J542ST.js +2 -0
  51. package/dist/chunk-QGZRM6ZB.js +2 -0
  52. package/dist/chunk-QNZEG7IT.js +13 -0
  53. package/dist/chunk-QT2LKB3P.js +7 -0
  54. package/dist/chunk-RVRARWSY.js +9 -0
  55. package/dist/chunk-T6IDXUUA.js +2 -0
  56. package/dist/chunk-TYWB5IQJ.js +3 -0
  57. package/dist/chunk-UIKLE3WD.js +2 -0
  58. package/dist/chunk-V7K6CQVX.js +111 -0
  59. package/dist/chunk-VCKKJDLP.js +8 -0
  60. package/dist/chunk-VG7FN2TU.js +4 -0
  61. package/dist/chunk-W5IWDW4Y.js +16 -0
  62. package/dist/chunk-W7C6FFMO.js +8 -0
  63. package/dist/chunk-WESTEMIM.js +10 -0
  64. package/dist/chunk-WR6D3SC6.js +5 -0
  65. package/dist/chunk-WS2N27RX.js +3 -0
  66. package/dist/chunk-XMAV5AG6.js +2 -0
  67. package/dist/chunk-XROULIQN.js +2 -0
  68. package/dist/chunk-XUFYOXOU.js +3 -0
  69. package/dist/chunk-Y4XFVDZC.js +3 -0
  70. package/dist/chunk-Y6KXTQBG.js +2 -0
  71. package/dist/{chunk-GTR2TBIJ.js → chunk-Z2UZUCY6.js} +237 -1047
  72. package/dist/chunk-Z34K6GY2.js +8 -0
  73. package/dist/claude-4LR3LJQZ.js +13 -0
  74. package/dist/claude-cli-UP6HGH7C.js +6 -0
  75. package/dist/claude-code-RLJ4GX77.js +11 -0
  76. package/dist/claude-code-teams-R37HJY3Y.js +29 -0
  77. package/dist/commands-LMUD5L6R.js +455 -0
  78. package/dist/compliance-GZ7UAOG3.js +6 -0
  79. package/dist/conductor-Y5IXELTL.js +4 -0
  80. package/dist/config-schema-HR7LDEQ6.js +2 -0
  81. package/dist/constellation-CG7C4WFE.js +13 -0
  82. package/dist/context-audit-RSSRX6XC.js +6 -0
  83. package/dist/cost-IDNVMAEV.js +10 -0
  84. package/dist/cost-PK4KIF7R.js +2 -0
  85. package/dist/cursor-cli-QKF7Z6M2.js +4 -0
  86. package/dist/cursorrules-U5O4G5T4.js +14 -0
  87. package/dist/decision-loader-2XPZE4EZ.js +2 -0
  88. package/dist/delete-P5VULXR4.js +14 -0
  89. package/dist/diff-RTFUKJHF.js +9 -0
  90. package/dist/discipline-H7LDI6NT.js +2 -0
  91. package/dist/dist-3ZCH25SG.js +2 -0
  92. package/dist/dist-KGRCLBJP-2QAPFYNF.js +39 -0
  93. package/dist/dist-R3RWD35F.js +2 -0
  94. package/dist/dist-VGFSP3XM.js +2 -0
  95. package/dist/dist-VXCZWVVJ.js +2 -0
  96. package/dist/dist-W3XCATBJ.js +2 -0
  97. package/dist/docs-EDQ2STFK.js +2 -0
  98. package/dist/docs-RXPN6CK7.js +12 -0
  99. package/dist/doctor-2T2QL6VM.js +2 -0
  100. package/dist/drift-ILZE5BFJ.js +13 -0
  101. package/dist/echo-UPTQUEDU.js +46 -0
  102. package/dist/edit-GUU3HBVW.js +9 -0
  103. package/dist/event-Y3VXC2RV.js +3 -0
  104. package/dist/explain-files-3GPZUETV.js +4 -0
  105. package/dist/export-CV5KCTPS.js +2 -0
  106. package/dist/flow-S3RQ4YPY.js +11 -0
  107. package/dist/global-C44FW4G2.js +13 -0
  108. package/dist/graduate-3BBSC27A.js +5 -0
  109. package/dist/graph-CNDE5TAT.js +2 -0
  110. package/dist/graph-server-COZR5C3Z.js +14 -0
  111. package/dist/habits-4J2KRYUL.js +42 -0
  112. package/dist/history-UW454SDP.js +12 -0
  113. package/dist/hooks-XH52VGOU.js +2 -0
  114. package/dist/index.js +15 -1039
  115. package/dist/init-24MAQJFM.js +2 -0
  116. package/dist/integrity-UYDOOJDP.js +7 -0
  117. package/dist/integrity-checker-DHGMZQDG.js +2 -0
  118. package/dist/journal-loader-GLH7XFTK.js +2 -0
  119. package/dist/lint-IGKE6UPS.js +26 -0
  120. package/dist/list-5IUGP3ZB.js +7 -0
  121. package/dist/list-YKIQNKGB.js +6 -0
  122. package/dist/lore-loader-RVQI5GXL.js +2 -0
  123. package/dist/lore-loader-XY5MZRR2.js +2 -0
  124. package/dist/lore-server-FC2GMDLT.js +14 -0
  125. package/dist/manual-RXSPSFLL.js +20 -0
  126. package/dist/mcp.js +93 -20484
  127. package/dist/migrate-X5OMAFAQ.js +59 -0
  128. package/dist/migrate-assessments-GEI5WMI2.js +4 -0
  129. package/dist/model-discovery-HMB3YI4L.js +2 -0
  130. package/dist/nomination-engine-XF7TWPAP.js +2 -0
  131. package/dist/notebook-PE3JSYZI.js +11 -0
  132. package/dist/notebook-loader-CENTDDUJ.js +2 -0
  133. package/dist/orchestrate-35HBQ3O3.js +8 -0
  134. package/dist/peers-P2KXU7ZK.js +5 -0
  135. package/dist/persona-STQWZH5P.js +29 -0
  136. package/dist/pipeline-MZUITRVN.js +4 -0
  137. package/dist/platform-server-2KXHGHFV.js +25 -0
  138. package/dist/plugin-update-checker-M7PW434O.js +2 -0
  139. package/dist/portal-check-3JVNLOEP.js +8 -0
  140. package/dist/portal-compliance-2UG4VKWH.js +2 -0
  141. package/dist/probe-5L5BQDGE.js +6 -0
  142. package/dist/project-type-SURTOIG7.js +2 -0
  143. package/dist/promote-NJQDZBZA.js +8 -0
  144. package/dist/providers-4PXMWA7V.js +8 -0
  145. package/dist/quiz-FE5UGAY2.js +10 -0
  146. package/dist/record-YXPB34MY.js +6 -0
  147. package/dist/reindex-PGDQSM42.js +2 -0
  148. package/dist/remember-MJRNTXYS.js +14 -0
  149. package/dist/retag-N5XF3KXP.js +6 -0
  150. package/dist/review-6UAH6V3R.js +11 -0
  151. package/dist/review-77QI6VOC.js +6 -0
  152. package/dist/ripple-ZGDITCGB.js +10 -0
  153. package/dist/roster-FLRZ5J42.js +2 -0
  154. package/dist/sentinel-HYAZ3CO5.js +19 -0
  155. package/dist/sentinel-bridge-VR357PKL.js +2 -0
  156. package/dist/sentinel-mcp.js +38 -3808
  157. package/dist/sentinel.js +1 -34
  158. package/dist/serve-JE6UF5P2.js +8 -0
  159. package/dist/serve-L52ZUTU6.js +10 -0
  160. package/dist/serve-OY6XYL7F.js +12 -0
  161. package/dist/server-2MNROHF6.js +7 -0
  162. package/dist/server-4YNUIK4W.js +8 -0
  163. package/dist/session-tracker-SKOMBDOW.js +2 -0
  164. package/dist/session-work-log-3MNUDEZ6.js +2 -0
  165. package/dist/session-work-log-J2H5OZBR.js +2 -0
  166. package/dist/setup-3F5IK7MO.js +31 -0
  167. package/dist/setup-KPIMRZ4Q.js +2 -0
  168. package/dist/shift-6GCNH666.js +11 -0
  169. package/dist/show-BOAVWZPZ.js +7 -0
  170. package/dist/show-PJ5LFLIL.js +5 -0
  171. package/dist/snapshot-L2G56RPL.js +8 -0
  172. package/dist/spawn-UH5RENSE.js +12 -0
  173. package/dist/status-77M3SDIF.js +8 -0
  174. package/dist/status-A37ECYNJ.js +6 -0
  175. package/dist/summary-ZJLQ6KHB.js +7 -0
  176. package/dist/sweep-HU74OPVW.js +17 -0
  177. package/dist/switch-CTW4PDGI.js +17 -0
  178. package/dist/symphony-3QMBGCZY.js +2 -0
  179. package/dist/symphony-QI63XL62.js +53 -0
  180. package/dist/symphony-loader-XACVV2E3.js +2 -0
  181. package/dist/symphony-peers-U4KHMKGI.js +2 -0
  182. package/dist/symphony-peers-X5NGWXFP.js +2 -0
  183. package/dist/symphony-relay-5GY5JIPT.js +3 -0
  184. package/dist/sync-QRDSFETO.js +2 -0
  185. package/dist/sync-llms-HL5PPW3M.js +15 -0
  186. package/dist/task-loader-NZFDTUQ5.js +2 -0
  187. package/dist/team-WGERKGNP.js +2 -0
  188. package/dist/test-BQJMS4Y2.js +111 -0
  189. package/dist/thread-HFXK65D4.js +41 -0
  190. package/dist/timeline-K3ZFKJ3R.js +6 -0
  191. package/dist/triage-FCWOZASE.js +18 -0
  192. package/dist/tutorial-UC6YQMNN.js +305 -0
  193. package/dist/university-content/courses/.purpose +74 -5
  194. package/dist/university-content/courses/para-701.json +807 -0
  195. package/dist/university-content/plsat/.purpose +3 -2
  196. package/dist/university-ui/assets/{index-BjewBB6s.js → index-CGFJczb1.js} +2 -2
  197. package/dist/university-ui/assets/{index-BjewBB6s.js.map → index-CGFJczb1.js.map} +1 -1
  198. package/dist/university-ui/index.html +1 -1
  199. package/dist/upgrade-B4IOLZYK.js +53 -0
  200. package/dist/validate-C6SMKGYD.js +9 -0
  201. package/dist/validate-LSCDOLBO.js +13 -0
  202. package/dist/validate-VZXTJHGO.js +6 -0
  203. package/dist/watch-LRM5XD46.js +8 -0
  204. package/dist/watch-PZCCUP6K.js +9 -0
  205. package/dist/wisdom-XZ3QKPNP.js +7 -0
  206. package/dist/work-log-loader-DL5GZ2BQ.js +2 -0
  207. package/dist/workspace-2ODL5WLY.js +2 -0
  208. package/package.json +1 -1
  209. package/platform-ui/dist/assets/AmbientSection-DqQ2mfCO.js +1 -0
  210. package/platform-ui/dist/assets/{CanvasSection-DwPTRdIN.js → CanvasSection-DLW0s-Bu.js} +1 -1
  211. package/platform-ui/dist/assets/{DocsSection-BJc_ws4I.js → DocsSection-BQ9Hi51g.js} +1 -1
  212. package/platform-ui/dist/assets/{GitSection-DhqBo1xc.js → GitSection-QQeUX6o3.js} +1 -1
  213. package/platform-ui/dist/assets/{GraphSection-D9fhVnZ0.js → GraphSection-0c9C-w7K.js} +2 -2
  214. package/platform-ui/dist/assets/{GraphSection-BlgXTl53.css → GraphSection-Bbs2a8sC.css} +1 -1
  215. package/platform-ui/dist/assets/LoreSection--t56kCj2.js +1 -0
  216. package/platform-ui/dist/assets/LoreSection-qnmm3o4y.css +1 -0
  217. package/platform-ui/dist/assets/SentinelSection-C4OoME9U.js +1 -0
  218. package/platform-ui/dist/assets/{SymphonySection-BRoBaUSS.js → SymphonySection-B-rvsLxq.js} +1 -1
  219. package/platform-ui/dist/assets/TeamSection-CBFmNEEo.js +1 -0
  220. package/platform-ui/dist/assets/index-Bxp0TVaf.css +1 -0
  221. package/platform-ui/dist/assets/index-DPpOdAtC.js +57 -0
  222. package/platform-ui/dist/index.html +2 -2
  223. package/dist/accept-orchestration-UQLM7PTQ.js +0 -189
  224. package/dist/add-FZRKEGH4.js +0 -81
  225. package/dist/agent-WERIO2XV.js +0 -523
  226. package/dist/agent-loader-TFIANSF4.js +0 -44
  227. package/dist/agent-state-S5DAWPTF.js +0 -24
  228. package/dist/agents-suggest-DNSYJ6IA.js +0 -83
  229. package/dist/aggregate-H57K7PNV.js +0 -88
  230. package/dist/assess-4WVXZLZQ.js +0 -68
  231. package/dist/auto-QFS5NHQU.js +0 -504
  232. package/dist/beacon-KXZXYQHX.js +0 -251
  233. package/dist/calibration-V46G7JTY.js +0 -135
  234. package/dist/check-OWAIWV23.js +0 -175
  235. package/dist/chunk-2IO7JAG2.js +0 -148
  236. package/dist/chunk-2T6BTYBN.js +0 -712
  237. package/dist/chunk-36TKPM5Z.js +0 -400
  238. package/dist/chunk-45MUDW6E.js +0 -804
  239. package/dist/chunk-4BLYIB7J.js +0 -5701
  240. package/dist/chunk-4L3UTYQX.js +0 -677
  241. package/dist/chunk-4NCFWYGG.js +0 -110
  242. package/dist/chunk-54LTTQBH.js +0 -138
  243. package/dist/chunk-5EWAQHFY.js +0 -269
  244. package/dist/chunk-5JGJACDU.js +0 -37
  245. package/dist/chunk-5OUOLN6M.js +0 -659
  246. package/dist/chunk-5VKJBNJL.js +0 -444
  247. package/dist/chunk-6N3JTACN.js +0 -2260
  248. package/dist/chunk-6QC3YGB6.js +0 -114
  249. package/dist/chunk-7N7GSU6K.js +0 -34
  250. package/dist/chunk-ABVQGRF7.js +0 -268
  251. package/dist/chunk-CL7JSK52.js +0 -129
  252. package/dist/chunk-CSD7IHSN.js +0 -152
  253. package/dist/chunk-EDOAWN7J.js +0 -717
  254. package/dist/chunk-EKGMAM62.js +0 -525
  255. package/dist/chunk-EZ3GOCYC.js +0 -132
  256. package/dist/chunk-F3BCHPYT.js +0 -143
  257. package/dist/chunk-FKJUBQU3.js +0 -3081
  258. package/dist/chunk-GT5QGC2H.js +0 -253
  259. package/dist/chunk-GZDFVP2N.js +0 -540
  260. package/dist/chunk-IRKUEJVW.js +0 -405
  261. package/dist/chunk-J2JEQRT3.js +0 -164
  262. package/dist/chunk-JASGXLK3.js +0 -679
  263. package/dist/chunk-KVDYJLTC.js +0 -121
  264. package/dist/chunk-L27I3CPZ.js +0 -357
  265. package/dist/chunk-LHLIAYQ3.js +0 -185
  266. package/dist/chunk-MCMOGQMU.js +0 -145
  267. package/dist/chunk-NQKQG45G.js +0 -688
  268. package/dist/chunk-PBHIFAL4.js +0 -259
  269. package/dist/chunk-PDX44BCA.js +0 -11
  270. package/dist/chunk-PMXRGPRQ.js +0 -305
  271. package/dist/chunk-RAB5IKPR.js +0 -487
  272. package/dist/chunk-RJE5G7WO.js +0 -590
  273. package/dist/chunk-RTHA3XRE.js +0 -880
  274. package/dist/chunk-S2HO5MLR.js +0 -621
  275. package/dist/chunk-S3ORKP3V.js +0 -716
  276. package/dist/chunk-TAIJOFOE.js +0 -124
  277. package/dist/chunk-TXESEO7Y.js +0 -245
  278. package/dist/chunk-UPLDI7CN.js +0 -1334
  279. package/dist/chunk-VL67H5IC.js +0 -506
  280. package/dist/chunk-VPPK3SY4.js +0 -1136
  281. package/dist/chunk-YMDLDELF.js +0 -314
  282. package/dist/chunk-YO6DVTL7.js +0 -99
  283. package/dist/chunk-YRZ5RPEB.js +0 -1561
  284. package/dist/chunk-ZDHLG5VP.js +0 -5676
  285. package/dist/chunk-ZGUAAVMA.js +0 -756
  286. package/dist/chunk-ZSYVKSY6.js +0 -2602
  287. package/dist/claude-FRRWJSTJ.js +0 -362
  288. package/dist/claude-cli-XJLK2X4L.js +0 -276
  289. package/dist/claude-code-HTBA4XRB.js +0 -126
  290. package/dist/claude-code-teams-T4SP24MD.js +0 -199
  291. package/dist/commands-5N4ILTPH.js +0 -5859
  292. package/dist/conductor-CQVGTEQN.js +0 -161
  293. package/dist/config-schema-EA4XALGG.js +0 -154
  294. package/dist/constellation-A26CCGQS.js +0 -225
  295. package/dist/context-audit-RLO3ETRP.js +0 -682
  296. package/dist/cost-BGM32XJU.js +0 -93
  297. package/dist/cost-VI46A4XL.js +0 -174
  298. package/dist/cursor-cli-JVEZGHWQ.js +0 -269
  299. package/dist/cursorrules-HLIKJJZT.js +0 -84
  300. package/dist/decision-loader-WWCLIQPJ.js +0 -20
  301. package/dist/delete-KBRPQLPC.js +0 -56
  302. package/dist/diff-D4X53HAC.js +0 -126
  303. package/dist/discipline-FA4OZXIS.js +0 -24
  304. package/dist/dist-34NA5RS5.js +0 -74
  305. package/dist/dist-5QE2BB2B-5S3T6Y3T.js +0 -6919
  306. package/dist/dist-77JDTVAY.js +0 -62
  307. package/dist/dist-OGTSAZ55.js +0 -1358
  308. package/dist/dist-QK4SQAK7.js +0 -64
  309. package/dist/dist-TA6LSC2Q.js +0 -20
  310. package/dist/docs-PBZB7LYP.js +0 -89
  311. package/dist/docs-QIYKO3BR.js +0 -155
  312. package/dist/doctor-ULBOHEIC.js +0 -11
  313. package/dist/drift-R5NRKFHI.js +0 -251
  314. package/dist/echo-O2LY7CC2.js +0 -248
  315. package/dist/edit-R2HNLMOG.js +0 -63
  316. package/dist/event-25OJKDCE.js +0 -31
  317. package/dist/export-IWVL7XLF.js +0 -38
  318. package/dist/flow-CRRVV3O3.js +0 -185
  319. package/dist/global-3NG5JXUB.js +0 -136
  320. package/dist/graduate-USAWGBJM.js +0 -160
  321. package/dist/graph-VHUMAAS6.js +0 -12
  322. package/dist/graph-server-YL22VBBN.js +0 -116
  323. package/dist/habits-OL5NGPXO.js +0 -1405
  324. package/dist/history-WOWC573W.js +0 -277
  325. package/dist/hooks-HFWSCGPV.js +0 -12
  326. package/dist/integrity-IHO4FZTS.js +0 -194
  327. package/dist/integrity-checker-PSKJA5SB.js +0 -12
  328. package/dist/journal-loader-5EYSBFFY.js +0 -18
  329. package/dist/lint-K6CJGGPH.js +0 -456
  330. package/dist/list-4YK7QKFF.js +0 -57
  331. package/dist/list-ENR7Q4CR.js +0 -56
  332. package/dist/lore-loader-7NO6N6FT.js +0 -26
  333. package/dist/lore-server-UNJY5KC3.js +0 -118
  334. package/dist/manual-G6FISID5.js +0 -204
  335. package/dist/migrate-LS45DNEV.js +0 -889
  336. package/dist/migrate-assessments-RGH4O6IX.js +0 -97
  337. package/dist/model-discovery-D2H3VBGC.js +0 -8
  338. package/dist/nomination-engine-RV5CNO5B.js +0 -42
  339. package/dist/notebook-YWIYGEHV.js +0 -155
  340. package/dist/orchestrate-JLILBBJE.js +0 -324
  341. package/dist/peers-DEOUIZM6.js +0 -82
  342. package/dist/persona-UHAHIVST.js +0 -390
  343. package/dist/pipeline-L4HCSBGN.js +0 -263
  344. package/dist/platform-server-H5YO3DQD.js +0 -1475
  345. package/dist/plugin-update-checker-KRRSGXMV.js +0 -12
  346. package/dist/portal-check-NPYGII2D.js +0 -42
  347. package/dist/portal-compliance-J7DGAPFX.js +0 -18
  348. package/dist/probe-MHL5HQZ2.js +0 -167
  349. package/dist/promote-F6ZYZZAL.js +0 -182
  350. package/dist/providers-GK7PB2OL.js +0 -104
  351. package/dist/quiz-M66SC7F7.js +0 -99
  352. package/dist/record-RA4WR2BO.js +0 -49
  353. package/dist/reindex-5LTD53ZC.js +0 -16
  354. package/dist/remember-HBWJ655S.js +0 -77
  355. package/dist/retag-3OLCVDEQ.js +0 -62
  356. package/dist/review-27ATYTD2.js +0 -33
  357. package/dist/review-57QMURZV.js +0 -334
  358. package/dist/ripple-JPBXP5I3.js +0 -215
  359. package/dist/sentinel-4XIG4STA.js +0 -63
  360. package/dist/sentinel-bridge-MDUXTQRL.js +0 -109
  361. package/dist/serve-CAH3PHE7.js +0 -33
  362. package/dist/serve-INL7SNBK.js +0 -36
  363. package/dist/serve-KBSE36PL.js +0 -49
  364. package/dist/server-54SKYFFY.js +0 -1647
  365. package/dist/server-XUOIO7E6.js +0 -338
  366. package/dist/session-tracker-C4BMD5WG.js +0 -13
  367. package/dist/session-work-log-MZ47OAPB.js +0 -20
  368. package/dist/setup-EDS27WUR.js +0 -25
  369. package/dist/setup-KO5AFC4K.js +0 -296
  370. package/dist/shift-D2JOHHBF.js +0 -668
  371. package/dist/show-5PV5KFJE.js +0 -176
  372. package/dist/show-NQKYX6WQ.js +0 -82
  373. package/dist/snapshot-BK4RBPCG.js +0 -62
  374. package/dist/spawn-RCHNXDHE.js +0 -196
  375. package/dist/status-WGIAQODY.js +0 -71
  376. package/dist/summary-NIRABMF5.js +0 -140
  377. package/dist/sweep-QMHNSIY5.js +0 -934
  378. package/dist/switch-6EJPZDIA.js +0 -232
  379. package/dist/symphony-4OCY36AI.js +0 -791
  380. package/dist/symphony-B75X2MME.js +0 -326
  381. package/dist/symphony-loader-UZGON56V.js +0 -90
  382. package/dist/symphony-peers-2ZQYLRNI.js +0 -34
  383. package/dist/symphony-peers-OL7F6M5S.js +0 -121
  384. package/dist/symphony-relay-UJYUXN65.js +0 -710
  385. package/dist/sync-VEHUH4OA.js +0 -11
  386. package/dist/sync-llms-YHCFIE6X.js +0 -166
  387. package/dist/task-loader-LDYWQSLM.js +0 -20
  388. package/dist/team-O5MIIFMA.js +0 -34
  389. package/dist/test-566CP5KC.js +0 -1017
  390. package/dist/thread-N754I4D5.js +0 -274
  391. package/dist/timeline-M3CICQFE.js +0 -112
  392. package/dist/triage-HHYGT3HY.js +0 -671
  393. package/dist/tutorial-KD22SUNO.js +0 -666
  394. package/dist/upgrade-H5PF32BW.js +0 -551
  395. package/dist/validate-CNKEKO6A.js +0 -134
  396. package/dist/validate-MB5ULIHS.js +0 -39
  397. package/dist/validate-QH3LADM6.js +0 -64
  398. package/dist/watch-2TKP5PVL.js +0 -199
  399. package/dist/watch-ZF4ML6CD.js +0 -111
  400. package/dist/wisdom-AATMGNFA.js +0 -319
  401. package/dist/work-log-loader-5L45XNYZ.js +0 -14
  402. package/dist/workspace-6E6OSRNU.js +0 -21
  403. package/platform-ui/dist/assets/AmbientSection-WtHfNedO.js +0 -1
  404. package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +0 -1
  405. package/platform-ui/dist/assets/LoreSection-CwDDHrz9.js +0 -1
  406. package/platform-ui/dist/assets/SentinelSection-Cl7e5oZ6.js +0 -1
  407. package/platform-ui/dist/assets/TeamSection-CqSIMrKz.js +0 -1
  408. package/platform-ui/dist/assets/index-CfpZFjea.css +0 -1
  409. package/platform-ui/dist/assets/index-F0KL9xrN.js +0 -57
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import {b}from'./chunk-L6K5HNDL.js';import'./chunk-TYWB5IQJ.js';import'./chunk-WESTEMIM.js';import'./chunk-FYDRENK7.js';import'./chunk-IZSBGW6E.js';import'./chunk-AO7ZSRME.js';import'./chunk-NW6OKHE6.js';import'./chunk-EKZDFEJW.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as g from'path';import e from'chalk';async function u(n,s,r){let a=s?g.resolve(s):process.cwd();if(!n){r.json?console.log(JSON.stringify({error:"Orchestration ID required"})):(console.log(e.red(`
3
+ Orchestration ID required.`)),console.log(e.gray(`Usage: paradigm team accept <orchestration-id>
4
+ `)));return}let l=new b(a),o=l.getOrchestration(n);if(!o){r.json?console.log(JSON.stringify({error:"Orchestration not found",id:n})):console.log(e.red(`
5
+ Orchestration not found: ${n}
6
+ `));return}if(o.status!=="completed"){r.json?console.log(JSON.stringify({error:"Cannot accept orchestration",reason:`Status is '${o.status}', expected 'completed'`})):(console.log(e.red(`
7
+ Cannot accept orchestration in '${o.status}' status.`)),console.log(e.gray(`Only completed orchestrations can be accepted.
8
+ `)));return}try{if(await l.accept(n,{note:r.note}),r.json){console.log(JSON.stringify({success:!0,id:n,status:"accepted",artifacts:o.artifacts.length}));return}if(console.log(),console.log(e.green("\u2501".repeat(60))),console.log(e.green(" \u2713 Orchestration Accepted")),console.log(e.green("\u2501".repeat(60))),console.log(),console.log(e.white(` ID: ${n}`)),console.log(e.gray(` Task: ${o.task.slice(0,50)}${o.task.length>50?"...":""}`)),r.note&&console.log(e.gray(` Note: ${r.note}`)),console.log(),o.artifacts.length>0){console.log(e.cyan(" Artifacts accepted:"));for(let t of o.artifacts){let c=t.action==="created"?e.green("+"):t.action==="modified"?e.yellow("~"):e.red("-");console.log(` ${c} ${t.path}`);}console.log();}o.parallelBuilderStats&&(console.log(e.cyan(" Parallel builder stats:")),console.log(e.gray(` Sub-phases: ${o.parallelBuilderStats.totalSubPhases}`)),console.log(e.gray(` Parallel builders: ${o.parallelBuilderStats.totalParallelBuilders}`)),console.log(e.gray(` Files created: ${o.parallelBuilderStats.filesCreated}`)),console.log());}catch(t){r.json?console.log(JSON.stringify({error:t instanceof Error?t.message:String(t)})):console.log(e.red(`
9
+ Error: ${t instanceof Error?t.message:t}
10
+ `));}}async function p(n,s,r){let a=s?g.resolve(s):process.cwd();if(!n){r.json?console.log(JSON.stringify({error:"Orchestration ID required"})):(console.log(e.red(`
11
+ Orchestration ID required.`)),console.log(e.gray(`Usage: paradigm team reject <orchestration-id>
12
+ `)));return}let l=new b(a),o=l.getOrchestration(n);if(!o){r.json?console.log(JSON.stringify({error:"Orchestration not found",id:n})):console.log(e.red(`
13
+ Orchestration not found: ${n}
14
+ `));return}if(o.status!=="completed"){r.json?console.log(JSON.stringify({error:"Cannot reject orchestration",reason:`Status is '${o.status}', expected 'completed'`})):(console.log(e.red(`
15
+ Cannot reject orchestration in '${o.status}' status.`)),console.log(e.gray(`Only completed orchestrations can be rejected.
16
+ `)));return}try{if(await l.reject(n,{reason:r.reason,cleanup:r.cleanup}),r.json){console.log(JSON.stringify({success:!0,id:n,status:"rejected",cleanup:r.cleanup||!1}));return}if(console.log(),console.log(e.red("\u2501".repeat(60))),console.log(e.red(" \u2717 Orchestration Rejected")),console.log(e.red("\u2501".repeat(60))),console.log(),console.log(e.white(` ID: ${n}`)),console.log(e.gray(` Task: ${o.task.slice(0,50)}${o.task.length>50?"...":""}`)),r.reason&&console.log(e.gray(` Reason: ${r.reason}`)),console.log(),r.cleanup&&o.artifacts.length>0){console.log(e.yellow(" Files cleaned up:"));let t=o.artifacts.filter(c=>c.action==="created");for(let c of t)console.log(e.gray(` - ${c.path}`));console.log();}}catch(t){r.json?console.log(JSON.stringify({error:t instanceof Error?t.message:String(t)})):console.log(e.red(`
17
+ Error: ${t instanceof Error?t.message:t}
18
+ `));}}export{u as teamAcceptOrchestrationCommand,p as teamRejectOrchestrationCommand};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import {g,i,f}from'./chunk-D34YFK4M.js';import'./chunk-5TAVYPOV.js';import r from'chalk';import {execSync}from'child_process';import*as y from'os';function b(){try{return execSync("git config user.name",{encoding:"utf-8",timeout:3e3}).trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").slice(0,20)||"unknown"}catch{try{return y.userInfo().username}catch{return "unknown"}}}async function w(i$1,t){let s=process.cwd();t.title||(console.error(r.red(`
3
+ Error: --title is required
4
+ `)),process.exit(1));let a=b(),n=new Date().toISOString().slice(0,10),l=t.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40),u=t.tags?t.tags.split(",").map(e=>e.trim()):[],d=t.symbols?t.symbols.split(",").map(e=>e.trim()):[];if(i$1==="quiz"){let e=`Q-${l}`,p={id:e,title:t.title,description:t.body||"",author:a,created:n,updated:n,tags:u,symbols:d,difficulty:t.difficulty||"beginner",passThreshold:.7,questions:[]};g(s,p),i(s),console.log(r.green(`
5
+ Created quiz: ${e}`)),console.log(r.gray(` Add questions by editing the YAML file
6
+ `));return}let o=`${i$1==="policy"?"P":"N"}-${l}`,g$1={id:o,title:t.title,type:i$1,author:a,created:n,updated:n,tags:u,symbols:d,difficulty:t.difficulty||"beginner",estimatedMinutes:t.minutes?parseInt(t.minutes,10):void 0,prerequisites:[]};f(s,g$1,t.body||""),i(s),console.log(r.green(`
7
+ Created ${i$1}: ${o}`)),console.log(r.gray(` Edit at .paradigm/university/content/${i$1==="policy"?"policies":"notes"}/${o}.md
8
+ `));}export{w as universityAddCommand};
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as c from'fs';import*as y from'path';import*as P from'os';import o from'chalk';import*as m from'js-yaml';var u=y.join(P.homedir(),".paradigm","agents"),S=".paradigm/agents",$=".agent",k={architect:{style:"deliberate",risk:"conservative",verbosity:"detailed"},builder:{style:"rapid",risk:"balanced",verbosity:"concise"},tester:{style:"methodical",risk:"conservative",verbosity:"concise"},reviewer:{style:"deliberate",risk:"conservative",verbosity:"detailed"},security:{style:"methodical",risk:"conservative",verbosity:"detailed"}};async function T(e={}){let s=process.cwd(),r=a.command("agent-list").start("Listing agent profiles",{cwd:s}),t=[];if(!e.project&&c.existsSync(u))try{let i=c.readdirSync(u).filter(l=>l.endsWith($));for(let l of i)try{let d=c.readFileSync(y.join(u,l),"utf-8"),n=m.load(d);n?.id&&t.push(n);}catch{}}catch{}let g=y.join(s,S);if(!e.global&&c.existsSync(g))try{let i=c.readdirSync(g).filter(l=>l.endsWith($));for(let l of i)try{let d=c.readFileSync(y.join(g,l),"utf-8"),n=m.load(d);if(n?.id){let f=t.findIndex(a=>a.id===n.id);f>=0?t[f]=n:t.push(n);}}catch{}}catch{}if(e.json){console.log(JSON.stringify({count:t.length,agents:t.map(C)},null,2)),r.success(`Found ${t.length} agents`);return}if(console.log(o.blue(`
3
+ \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(o.blue("\u2502")+o.white.bold(" paradigm agent list ")+o.blue("\u2502")),console.log(o.blue("\u2502")+o.gray(" Persistent agent identity profiles ")+o.blue("\u2502")),console.log(o.blue(`\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
4
+ `)),t.length===0){console.log(o.yellow(" No .agent profiles found.")),console.log(o.gray(` Create one: paradigm agent create <id> --global
5
+ `)),r.success("No agents found");return}for(let i of t){let d=(i.expertise||[]).sort((n,f)=>f.confidence-n.confidence).slice(0,3).map(n=>`${n.symbol} (${(n.confidence*100).toFixed(0)}%)`).join(", ")||o.gray("none yet");console.log(` ${o.white.bold(i.id)} \u2014 ${o.gray(i.role)}`),console.log(` Style: ${i.personality?.style||"?"} | Risk: ${i.personality?.risk||"?"} | Verbosity: ${i.personality?.verbosity||"?"}`),console.log(` Top expertise: ${d}`),console.log(` Projects: ${Object.keys(i.contexts||{}).join(", ")||o.gray("none")}`),console.log("");}r.success(`Listed ${t.length} agents`);}async function I(e,s={}){let r=process.cwd(),t=a.command("agent-show").start(`Showing agent ${e}`,{cwd:r}),g=x(r,e);if(!g){s.json?console.log(JSON.stringify({error:`Agent "${e}" not found`})):(console.log(o.red(`
6
+ Agent "${e}" not found.`)),console.log(o.gray(` Create: paradigm agent create ${e} --global
7
+ `))),t.error(`Agent ${e} not found`);return}if(s.json){console.log(JSON.stringify(g,null,2)),t.success(`Showed agent ${e}`);return}if(console.log(o.blue(`
8
+ \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(o.blue("\u2502")+o.white.bold(` Agent: ${e}`.padEnd(50))+o.blue("\u2502")),console.log(o.blue(`\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
9
+ `)),console.log(` ${o.white.bold("Role:")} ${g.role}`),console.log(` ${o.white.bold("Description:")} ${g.description}`),console.log(` ${o.white.bold("Version:")} ${g.version}`),console.log(` ${o.white.bold("Created:")} ${g.created}`),console.log(` ${o.white.bold("Updated:")} ${g.updated}`),console.log(""),g.personality){let f=g.personality;console.log(` ${o.white.bold("Personality")}`),console.log(` Style: ${f.style} | Risk: ${f.risk} | Verbosity: ${f.verbosity}`),console.log("");}let i=(g.expertise||[]).sort((f,a)=>a.confidence-f.confidence);if(i.length>0){console.log(` ${o.white.bold("Expertise")} (${i.length} symbols)`),console.log(` ${"Symbol".padEnd(30)} ${"Confidence".padEnd(12)} ${"Sessions".padEnd(10)} Last Touch`),console.log(` ${"-".repeat(70)}`);for(let f of i.slice(0,20)){let a=`${(f.confidence*100).toFixed(0)}%`.padEnd(12),h=String(f.sessions).padEnd(10),p=f.lastTouch?f.lastTouch.split("T")[0]:"\u2014";console.log(` ${f.symbol.padEnd(30)} ${a} ${h} ${p}`);}i.length>20&&console.log(o.gray(` ... and ${i.length-20} more`)),console.log("");}else console.log(o.gray(" No expertise recorded. Run `paradigm agent sync` to bootstrap from lore.\n"));let l=g.transferable||[];if(l.length>0){console.log(` ${o.white.bold("Transferable Patterns")} (${l.length})`);for(let f of l)console.log(` ${f.id}: ${(f.successRate*100).toFixed(0)}% success \u2014 ${f.description}`),console.log(o.gray(` Learned in: ${f.learnedIn} | Applied in: ${f.appliedIn.join(", ")||"none"}`));console.log("");}let d=Object.entries(g.contexts||{});if(d.length>0){console.log(` ${o.white.bold("Project Contexts")} (${d.length})`);for(let[f,a]of d)console.log(` ${o.white(f)}: ${a.sessionsInProject||0} sessions, last active ${a.lastActive?.split("T")[0]||"\u2014"}`),a.defaultModel&&console.log(` Model: ${a.defaultModel}`),a.focus?.length&&console.log(` Focus: ${a.focus.join(", ")}`);console.log("");}let n=g.permissions;n&&(console.log(` ${o.white.bold("Permissions")}`),n.paths?.read?.length&&console.log(` Read: ${n.paths.read.join(", ")}`),n.paths?.write?.length&&console.log(` Write: ${n.paths.write.join(", ")}`),n.paths?.deny?.length&&console.log(` Deny: ${o.red(n.paths.deny.join(", "))}`),n.tools?.allow?.length&&console.log(` Tools allow: ${n.tools.allow.join(", ")}`),n.tools?.deny?.length&&console.log(` Tools deny: ${o.red(n.tools.deny.join(", "))}`),n.dangerous_actions?.length&&console.log(` Requires approval: ${n.dangerous_actions.join(", ")}`),console.log("")),t.success(`Showed agent ${e}`);}async function D(e,s={}){let r=process.cwd(),t=s.global?"global":"project",g=a.command("agent-create").start(`Creating agent ${e} (${t})`,{cwd:r}),i=t==="global"?u:y.join(r,S);c.existsSync(i)||c.mkdirSync(i,{recursive:true});let l=y.join(i,`${e}${$}`);if(c.existsSync(l)){console.log(o.yellow(`
10
+ Agent "${e}" already exists at ${l}`)),console.log(o.gray(" Use `paradigm agent show` to view.\n")),g.error("Agent already exists");return}let d=new Date().toISOString(),n=k[e]||{style:"deliberate",risk:"balanced",verbosity:"concise"},f={id:e,role:s.role||`${e.charAt(0).toUpperCase()+e.slice(1)} agent`,description:s.description||`Persistent identity for the ${e} agent role`,version:"1.0.0",personality:n,expertise:[],transferable:[],contexts:{},created:d,updated:d};if(s.denyPaths){let h=s.denyPaths.split(",").map(p=>p.trim());f.permissions={paths:{deny:h}};}let a$1=m.dump(f,{lineWidth:120,noRefs:true,sortKeys:false});c.writeFileSync(l,a$1,"utf-8"),console.log(o.green(`
11
+ \u2713 Created agent "${e}" at ${l}`)),console.log(o.gray(" Run `paradigm agent sync` to bootstrap expertise from lore.\n")),g.success(`Created agent ${e}`);}async function N(e,s={}){let r=process.cwd(),t=a.command("agent-sync").start(`Syncing expertise for ${e}`,{cwd:r}),g=y.join(r,".paradigm","lore","entries");if(!c.existsSync(g)){console.log(o.yellow(`
12
+ No lore directory found. Nothing to sync from.
13
+ `)),t.error("No lore found");return}let i=x(r,e);if(!i){if(s.dryRun){console.log(o.yellow(`
14
+ Agent "${e}" not found. Would create with --no-dry-run.
15
+ `)),t.success("Dry run \u2014 would create");return}let h=(c.existsSync(y.join(u,`${e}${$}`))?"global":"project")==="global"?u:y.join(r,S);c.existsSync(h)||c.mkdirSync(h,{recursive:true});let p=new Date().toISOString(),w=k[e]||{style:"deliberate",risk:"balanced",verbosity:"concise"};i={id:e,role:`${e.charAt(0).toUpperCase()+e.slice(1)} agent`,description:`Persistent identity for the ${e} agent role`,version:"1.0.0",personality:w,expertise:[],transferable:[],contexts:{},created:p,updated:p};}let l=i.expertise||[],d=0,n=new Set,f=F(g);for(let a of f)if(!(!a.symbols_touched||a.symbols_touched.length===0)){d++;for(let h of a.symbols_touched){n.add(h);let p=l.find(w=>w.symbol===h);p?(p.sessions++,p.lastTouch=a.timestamp||p.lastTouch,a.confidence!=null&&(p.confidence=.7*p.confidence+.3*a.confidence)):l.push({symbol:h,confidence:a.confidence??.5,sessions:1,lastTouch:a.timestamp||new Date().toISOString()});}}if(i.expertise=l,s.json)console.log(JSON.stringify({agentId:e,entriesProcessed:d,symbolsUpdated:n.size,dryRun:!!s.dryRun,topExpertise:l.sort((a,h)=>h.confidence-a.confidence).slice(0,10)},null,2));else if(console.log(o.blue(`
16
+ Syncing expertise for "${e}" from ${d} lore entries...`)),console.log(` ${o.green("\u2713")} ${n.size} symbols updated`),console.log(` ${o.green("\u2713")} ${d} entries processed`),l.length>0){console.log(`
17
+ Top expertise:`);for(let a of l.sort((h,p)=>p.confidence-h.confidence).slice(0,5))console.log(` ${a.symbol}: ${(a.confidence*100).toFixed(0)}% (${a.sessions} sessions)`);}if(s.dryRun)s.json||console.log(o.yellow(`
18
+ Dry run \u2014 no changes written.
19
+ `));else {i.updated=new Date().toISOString();let a=y.join(r,S,`${e}${$}`),h=y.join(u,`${e}${$}`),p=c.existsSync(a)?"project":"global",w=p==="global"?u:y.join(r,S);c.existsSync(w)||c.mkdirSync(w,{recursive:true});let j=p==="global"?h:a;c.writeFileSync(j,m.dump(i,{lineWidth:120,noRefs:true,sortKeys:false}),"utf-8"),s.json||console.log(o.green(`
20
+ \u2713 Saved to ${j}
21
+ `));}t.success(`Synced ${n.size} symbols from ${d} entries`);}async function _(e={}){let s=process.cwd(),r=a.command("agent-roster").start("Agent roster",{cwd:s}),t=[];if(c.existsSync(u))for(let d of c.readdirSync(u).filter(n=>n.endsWith($)))try{let n=m.load(c.readFileSync(y.join(u,d),"utf-8"));n?.id&&t.push(n);}catch{}let g=y.join(s,S);if(c.existsSync(g))for(let d of c.readdirSync(g).filter(n=>n.endsWith($)))try{let n=m.load(c.readFileSync(y.join(g,d),"utf-8"));if(n?.id){let f=t.findIndex(a=>a.id===n.id);f>=0?t[f]=n:t.push(n);}}catch{}let i=t.filter(d=>!d.benched),l=t.filter(d=>d.benched);if(e.json){console.log(JSON.stringify({active:i.map(v),benched:l.map(v)},null,2)),r.success(`${i.length} active, ${l.length} benched`);return}if(console.log(o.blue(`
22
+ \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(o.blue("\u2502")+o.white.bold(" Agent Roster ")+o.blue("\u2502")),console.log(o.blue(`\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
23
+ `)),i.length>0){console.log(o.green.bold(" Active"));for(let d of i)A(d);}if(l.length>0){console.log(o.gray.bold(`
24
+ Benched`));for(let d of l)A(d,true);}t.length===0?console.log(o.yellow(` No agents found.
25
+ `)):console.log(""),r.success(`${i.length} active, ${l.length} benched`);}function A(e,s=false){let r=(e.expertise||[]).sort((n,f)=>f.confidence-n.confidence),t=r[0]?`${r[0].symbol} (${(r[0].confidence*100).toFixed(0)}%)`:o.gray("\u2014"),g=s?o.gray:o.white,i=e.nickname?` (${e.nickname})`:"",l=e.attention?.threshold,d=l!=null?` | thr: ${l.toFixed(2)}`:"";console.log(` ${g.bold(e.id)}${o.gray(i)} \u2014 ${o.gray(e.role)}`),console.log(` Top: ${t} | ${r.length} symbols${d}`);}function v(e){let s=(e.expertise||[]).sort((r,t)=>t.confidence-r.confidence);return {id:e.id,role:e.role,nickname:e.nickname,benched:e.benched||false,expertiseCount:s.length,topExpertise:s.slice(0,3).map(r=>({symbol:r.symbol,confidence:parseFloat(r.confidence.toFixed(2))})),threshold:e.attention?.threshold}}async function L(e){let s=process.cwd(),r=a.command("agent-bench").start(`Benching agent ${e}`,{cwd:s}),t=x(s,e);if(!t){console.log(o.red(`
26
+ Agent "${e}" not found.
27
+ `)),r.error("Not found");return}t.benched=true,t.updated=new Date().toISOString(),R(s,e,t),console.log(o.yellow(`
28
+ \u23F8 Agent "${e}" is now benched.`)),console.log(o.gray(` Maestro will skip this agent during orchestration.
29
+ `)),r.success(`Benched ${e}`);}async function W(e){let s=process.cwd(),r=a.command("agent-activate").start(`Activating agent ${e}`,{cwd:s}),t=x(s,e);if(!t){console.log(o.red(`
30
+ Agent "${e}" not found.
31
+ `)),r.error("Not found");return}t.benched=false,t.updated=new Date().toISOString(),R(s,e,t),console.log(o.green(`
32
+ \u25B6 Agent "${e}" is now active.`)),console.log(o.gray(` Maestro will include this agent in orchestration.
33
+ `)),r.success(`Activated ${e}`);}function R(e,s,r){let t=y.join(e,S,`${s}${$}`);if(c.existsSync(t)){c.writeFileSync(t,m.dump(r,{lineWidth:120,noRefs:true,sortKeys:false}),"utf-8");return}let g=y.join(u,`${s}${$}`),i=u;c.existsSync(i)||c.mkdirSync(i,{recursive:true}),c.writeFileSync(g,m.dump(r,{lineWidth:120,noRefs:true,sortKeys:false}),"utf-8");}function x(e,s){let r=y.join(e,S,`${s}${$}`);if(c.existsSync(r))try{return m.load(c.readFileSync(r,"utf-8"))}catch{}let t=y.join(u,`${s}${$}`);if(c.existsSync(t))try{return m.load(c.readFileSync(t,"utf-8"))}catch{}return null}function C(e){return {id:e.id,role:e.role,personality:e.personality,expertiseCount:(e.expertise||[]).length,topExpertise:(e.expertise||[]).sort((s,r)=>r.confidence-s.confidence).slice(0,3).map(s=>({symbol:s.symbol,confidence:parseFloat(s.confidence.toFixed(2))})),projectContexts:Object.keys(e.contexts||{}),transferableCount:(e.transferable||[]).length}}function F(e){let s=[];try{let r=c.readdirSync(e,{withFileTypes:!0});for(let t of r){if(!t.isDirectory())continue;let g=y.join(e,t.name);try{let i=c.readdirSync(g).filter(l=>l.endsWith(".yaml")||l.endsWith(".yml"));for(let l of i)try{let d=c.readFileSync(y.join(g,l),"utf-8"),n=m.load(d);n?.symbols_touched&&Array.isArray(n.symbols_touched)&&s.push({symbols_touched:n.symbols_touched,confidence:typeof n.confidence=="number"?n.confidence:void 0,timestamp:n.timestamp||t.name});}catch{}}catch{}}}catch{}return s}export{W as agentActivateCommand,L as agentBenchCommand,D as agentCreateCommand,T as agentListCommand,_ as agentRosterCommand,I as agentShowCommand,N as agentSyncCommand};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import {t}from'./chunk-XUFYOXOU.js';export{n as buildProfileEnrichment,p as checkPathPermission,q as checkToolPermission,r as computeIntegrityHash,i as createAgentProfile,a as decayedConfidence,c as isAgentActive,e as listAllGlobalAgentIds,f as loadAgentProfile,g as loadAllAgentProfiles,b as loadProjectRoster,m as mergeAgentProfileWithManifest,j as queryExpertise,h as saveAgentProfile,d as saveProjectRoster,o as syncExpertiseFromLore,l as updateExpertiseFromAssessment,k as updateExpertiseFromLore,s as verifyIntegrity}from'./chunk-XUFYOXOU.js';import'./chunk-5TAVYPOV.js';t();
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{n as buildProfileEnrichment,p as checkPathPermission,q as checkToolPermission,r as computeIntegrityHash,i as createAgentProfile,a as decayedConfidence,c as isAgentActive,e as listAllGlobalAgentIds,f as loadAgentProfile,g as loadAllAgentProfiles,b as loadProjectRoster,m as mergeAgentProfileWithManifest,j as queryExpertise,h as saveAgentProfile,d as saveProjectRoster,o as syncExpertiseFromLore,l as updateExpertiseFromAssessment,k as updateExpertiseFromLore,s as verifyIntegrity}from'./chunk-2QO33NYK.js';import'./chunk-5TAVYPOV.js';
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{d as addPendingWork,f as addProjectPattern,e as completePendingWork,a as loadAgentState,i as loadAllAgentStates,g as loadGlobalAgentState,c as recordAgentSession,b as saveAgentState,h as updateGlobalAgentState}from'./chunk-XROULIQN.js';import'./chunk-5TAVYPOV.js';
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import {a}from'./chunk-TYWB5IQJ.js';import {e}from'./chunk-AO7ZSRME.js';import'./chunk-5TAVYPOV.js';import o from'chalk';async function y(s,g){let r=process.cwd(),t=e(r);t||(g.json?console.log(JSON.stringify({error:"No agents.yaml found"})):console.log(o.red("\nNo agents.yaml found. Run `paradigm team init` first.\n")),process.exit(1));let e$1=a(s,t.agents);if(g.json){console.log(JSON.stringify({task:s,suggestions:e$1},null,2));return}if(console.log(o.cyan(`
3
+ Suggested agents for this task:
4
+ `)),console.log(o.gray(` Task: "${s}"
5
+ `)),e$1.length===0){console.log(o.yellow(` No agents matched. Consider using architect \u2192 builder flow.
6
+ `)),console.log(o.gray(` Tip: Add keyword or symbol triggers to agents.yaml
7
+ `));return}for(let n of e$1){let i=n.confidence==="high"?o.green("\u2605"):n.confidence==="medium"?o.yellow("\u25C6"):o.gray("\u25CB");console.log(` ${i} ${o.white.bold(n.name)} ${o.gray(`(${n.confidence})`)}`),console.log(o.gray(` ${n.reason}`)),console.log(o.gray(` Matched: ${n.triggers_matched.join(", ")}
8
+ `));}if(e$1.length>0){console.log(o.cyan(" Suggested workflow:"));let n=e$1.map(a=>a.name),i=d(n);console.log(o.gray(` ${i.join(" \u2192 ")}
9
+ `)),console.log(o.gray(" Or use MCP orchestration:")),console.log(o.gray(` paradigm_orchestrate_inline({ task: "${s.slice(0,30)}${s.length>30?"...":""}", mode: "plan" })
10
+ `));}}function d(s){let g=["architect","security","builder","reviewer","tester"],r=[],t=new Set(s);for(let e of g)t.has(e)&&(r.push(e),t.delete(e));for(let e of t)r.push(e);return r}export{y as agentsSuggestCommand};
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import {c,l as l$1,m,o as o$1,B}from'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as u from'fs';import*as l from'path';import o from'chalk';import S from'ora';async function A(d){let h=process.cwd(),a=l.resolve(h,d);console.log(o.blue(`
3
+ \u{1F52E} Aggregating Premise...
4
+ `));let c$1=S("Loading sources...").start();try{let e,g=l.join(a,".premise");if(u.existsSync(g)){let{data:r,errors:s}=c(g);if(s.length>0){c$1.warn("Warnings parsing .premise file");for(let n of s)console.log(o.yellow(` \u26A0 ${n}`));console.log(o.gray(` Falling back to directory aggregation...
5
+ `));}if(r&&!s.some(n=>n.includes("Required")))try{e=await l$1(r,a);}catch(n){console.log(o.yellow(` \u26A0 Error using .premise file: ${n.message}`)),console.log(o.gray(` Falling back to directory aggregation...
6
+ `));}}e||(e=await m(a)),c$1.succeed("Aggregated all sources");let w=o$1(e),t=B(w);console.log(o.white(`
7
+ Sources`)),console.log(o.gray("\u2500".repeat(40))),console.log(` Purpose files: ${o.cyan(e.purposeFiles.length.toString())}`),console.log(` Gate files: ${o.cyan(e.portalFiles.length.toString())}`),console.log(o.white(`
8
+ Symbol Index`)),console.log(o.gray("\u2500".repeat(40)));let $=[{prefix:"#",name:"Components",count:t.component,color:o.green},{prefix:"$",name:"Flows",count:t.flow,color:o.yellow},{prefix:"^",name:"Gates",count:t.gate,color:o.red},{prefix:"!",name:"Signals",count:t.signal,color:o.cyan},{prefix:"~",name:"Aspects",count:t.aspect,color:o.magenta}];for(let{prefix:r,name:s,count:n,color:b}of $)n>0&&console.log(` ${b(r)} ${s.padEnd(12)} ${o.cyan(n.toString())}`);let x=Object.values(t).reduce((r,s)=>r+s,0);if(console.log(o.gray("\u2500".repeat(40))),console.log(` Total: ${o.cyan(x.toString())}`),e.errors.length>0){console.log(o.yellow(`
9
+ Errors`)),console.log(o.gray("\u2500".repeat(40)));for(let r of e.errors)console.log(o.red(` \u2717 [${r.source}] ${r.filePath}: ${r.message}`));}console.log("");}catch(e){c$1.fail("Aggregation failed"),console.log(o.red(`Error: ${e.message}
10
+ `)),process.exit(1);}}export{A as premiseAggregateCommand};
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ import {f as f$1,n,g,h}from'./chunk-2QO33NYK.js';import {b as b$2}from'./chunk-PUBB7LIT.js';import {c,b as b$1,d,a}from'./chunk-5TAVYPOV.js';import*as f from'fs';import*as b from'path';import*as P from'js-yaml';import*as Q from'os';var vt={};c(vt,{getJournalStats:()=>ne,loadAllJournalEntries:()=>ee,loadJournalEntries:()=>O,loadJournalEntry:()=>te,recordJournalEntry:()=>z});function G(n){let t=process.env.HOME||process.env.USERPROFILE||"";return b.join(t,".paradigm","agents",n,"journal")}function Zt(){let n=new Date,t=n.toISOString().slice(0,10),e=n.toISOString().slice(11,19).replace(/:/g,""),o=String(Math.floor(Math.random()*999)+1).padStart(3,"0");return `LJ-${t}-${e}-${o}`}function z(n,t){let e=new Date,o=Zt(),i={id:o,agent:n,timestamp:e.toISOString(),...t},r=G(n);f.mkdirSync(r,{recursive:true});let s=b.join(r,`${o}.yaml`);return f.writeFileSync(s,P.dump(i,{lineWidth:120,noRefs:true}),"utf8"),i}function O(n,t){let e=G(n);if(!f.existsSync(e))return [];let o=[],i=f.readdirSync(e).filter(s=>s.endsWith(".yaml"));for(let s of i)try{let a=f.readFileSync(b.join(e,s),"utf8"),c=P.load(a);c&&c.id&&o.push(c);}catch{}let r=o;return t?.trigger&&(r=r.filter(s=>s.trigger===t.trigger)),t?.project&&(r=r.filter(s=>s.project===t.project)),t?.transferable!==void 0&&(r=r.filter(s=>s.transferable===t.transferable)),t?.tag&&(r=r.filter(s=>s.tags?.some(a=>a.startsWith(t.tag)))),t?.dateFrom&&(r=r.filter(s=>s.timestamp>=t.dateFrom)),t?.dateTo&&(r=r.filter(s=>s.timestamp<=t.dateTo)),r.sort((s,a)=>a.timestamp.localeCompare(s.timestamp)),t?.limit&&(r=r.slice(0,t.limit)),r}function te(n,t){let e=G(n),o=b.join(e,`${t}.yaml`);if(!f.existsSync(o))return null;let i=f.readFileSync(o,"utf8");return P.load(i)}function ee(n){let t=process.env.HOME||process.env.USERPROFILE||"",e=b.join(t,".paradigm","agents");if(!f.existsSync(e))return [];let o=[],i=f.readdirSync(e,{withFileTypes:true}).filter(r=>r.isDirectory());for(let r of i){if(n?.agent&&r.name!==n.agent)continue;let s=O(r.name,n);o.push(...s);}return o.sort((r,s)=>s.timestamp.localeCompare(r.timestamp)),n?.limit?o.slice(0,n.limit):o}function ne(n){let t=O(n),e={},o={},i=0;for(let r of t)e[r.trigger]=(e[r.trigger]||0)+1,o[r.project]=(o[r.project]||0)+1,r.transferable&&i++;return {total:t.length,byTrigger:e,byProject:o,transferableCount:i,recentInsights:t.slice(0,5).map(r=>({id:r.id,trigger:r.trigger,insight:r.insight.slice(0,200),timestamp:r.timestamp}))}}var K=b$1(()=>{});var Dt={};c(Dt,{addNotebookEntry:()=>xt,incrementApplied:()=>se,loadNotebookEntries:()=>Et,promoteFromLore:()=>ie,searchNotebooks:()=>re});function Et(n,t,e){let o=new Map,i=b.join(V,n);jt(i,o);let r=b.join(t,Y,n);jt(r,o);let s=Array.from(o.values());if(e?.concepts&&e.concepts.length>0){let a=new Set(e.concepts.map(c=>c.toLowerCase()));s=s.filter(c=>c.concepts.some(d=>a.has(d.toLowerCase())));}if(e?.tags&&e.tags.length>0){let a=new Set(e.tags.map(c=>c.toLowerCase()));s=s.filter(c=>c.tags.some(d=>a.has(d.toLowerCase())));}return s.sort((a,c)=>c.appliedCount-a.appliedCount)}function jt(n,t){if(f.existsSync(n))try{let e=f.readdirSync(n).filter(o=>o.startsWith(oe)&&o.endsWith(X));for(let o of e)try{let i=f.readFileSync(b.join(n,o),"utf-8"),r=P.load(i);r?.id&&t.set(r.id,r);}catch{}}catch{}}function re(n,t,e){let o=Et(n,e),i=t.toLowerCase();return o.filter(r=>r.context.toLowerCase().includes(i)||r.snippet.toLowerCase().includes(i)||r.concepts.some(s=>s.toLowerCase().includes(i))||r.tags.some(s=>s.toLowerCase().includes(i)))}function xt(n,t,e,o){let i=new Date().toISOString(),r=(t.concepts[0]||"entry").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),s=Date.now().toString(36),a=`nb-${r}-${s}`,c={...t,id:a,appliedCount:0,created:i,updated:i},d=e==="global"?b.join(V,n):b.join(o||process.cwd(),Y,n);f.existsSync(d)||f.mkdirSync(d,{recursive:true});let u=`${a}${X}`,l=b.join(d,u),m=P.dump(c,{lineWidth:120,noRefs:true,sortKeys:false});return f.writeFileSync(l,m,"utf-8"),{entry:c,filePath:l}}async function ie(n,t,e,o="global"){let{loadLoreEntry:i}=await import('./lore-loader-XY5MZRR2.js'),r=await i(e,t);if(!r)return null;let s=[];if(r.symbols_touched)for(let d of r.symbols_touched){let u=d.replace(/^[#$^!~]/,"").toLowerCase();s.push(u);}let a=r.summary||"";r.body&&(a+=`
3
+
4
+ `+r.body);let c={source:"lore",loreEntryId:t,originProject:b.basename(e),createdBy:n};return xt(n,{context:r.title||`Promoted from ${t}`,snippet:a,provenance:c,confidence:r.confidence??.7,concepts:s,tags:r.tags||[]},o,e)}function se(n,t,e){let o=b.join(e,Y,n),i=b.join(V,n);for(let r of [o,i]){let s=b.join(r,`${t}${X}`);if(f.existsSync(s))try{let a=f.readFileSync(s,"utf-8"),c=P.load(a);if(c)return c.appliedCount=(c.appliedCount||0)+1,c.updated=new Date().toISOString(),f.writeFileSync(s,P.dump(c,{lineWidth:120,noRefs:!0,sortKeys:!1}),"utf-8"),!0}catch{}}return false}var V,Y,oe,X,Rt=b$1(()=>{V=b.join(Q.homedir(),".paradigm","notebooks"),Y=".paradigm/notebooks",oe="nb-",X=".yaml";});var ft=".paradigm/events",zt="stream.jsonl",I=1e3,N=[];function gt(n){return b.join(n,ft,zt)}function Kt(){let n=Date.now(),t=Math.floor(Math.random()*9999).toString().padStart(4,"0");return `ev-${n}-${t}`}function J(n,t){let e={id:Kt(),timestamp:new Date().toISOString(),...t};N.push(e),N.length>I&&(N=N.slice(-I));try{let o=b.join(n,ft);f.mkdirSync(o,{recursive:!0});let i=gt(n);f.appendFileSync(i,JSON.stringify(e)+`
5
+ `,"utf8"),Vt(i);}catch{}return e}function Vt(n){try{if(f.statSync(n).size>512*1024){let o=f.readFileSync(n,"utf8").trim().split(`
6
+ `);if(o.length>I){let i=o.slice(-I);f.writeFileSync(n,i.join(`
7
+ `)+`
8
+ `,"utf8");}}}catch{}}function yt(n,t){let e=Yt(n);return t?.type&&(e=e.filter(o=>o.type===t.type)),t?.source&&(e=e.filter(o=>o.source===t.source)),t?.symbol&&(e=e.filter(o=>o.symbols?.includes(t.symbol))),t?.agent&&(e=e.filter(o=>o.agent===t.agent)),t?.since&&(e=e.filter(o=>o.timestamp>=t.since)),e.sort((o,i)=>i.timestamp.localeCompare(o.timestamp)),t?.limit&&(e=e.slice(0,t.limit)),e}function Yt(n){let t=gt(n);if(!f.existsSync(t))return [...N];try{return f.readFileSync(t,"utf8").trim().split(`
9
+ `).filter(i=>i.trim()).map(i=>{try{return JSON.parse(i)}catch{return null}}).filter(i=>i!==null)}catch{return [...N]}}function ht(n,t,e){let o=0,i=0,r=0,s=0;if(e.symbols?.length&&n.symbols?.length)for(let u of e.symbols)for(let l of n.symbols)pt(u,l)&&(o=Math.max(o,1));if(e.paths?.length&&n.path){for(let u of e.paths)if(pt(u,n.path)){i=1;break}}if(e.concepts?.length){let u=[n.context||"",...n.keywords||[],n.type].join(" ").toLowerCase(),l=0;for(let m of e.concepts)u.includes(m.toLowerCase())&&l++;e.concepts.length>0&&(r=l/e.concepts.length);}if(e.signals?.length){for(let u of e.signals)if(u.type===n.type){s=1;break}}let a=[o,i,r,s].sort((u,l)=>l-u),c=a[0]*.5+a[1]*.2+a[2]*.15+a[3]*.15,d=e.threshold??.6;return {agentId:t,score:c,breakdown:{symbolMatch:o,pathMatch:i,conceptMatch:r,signalMatch:s},shouldNominate:c>=d,quietReason:c<d?"below-threshold":void 0}}function pt(n,t){if(n===t)return true;let e=n.replace(/\*\*/g,"\xA7\xA7").replace(/\*/g,"[^/]*").replace(/§§/g,".*");try{return new RegExp(`^${e}$`).test(t)}catch{return false}}var M={version:"1.0",default_ring:"project-locked",observation:{allow:["src/**",".paradigm/**","portal.yaml"],deny:[".env*","**/*.key","**/*.pem","**/secrets/**"]},streams:{work_log:{ring:"project-locked",allow_content:["file_paths","symbol_names","outcome"],deny_content:["code_snippets","file_contents","diff_content"]},learning_journal:{ring:"user-scoped",allow_content:["pattern_descriptions","confidence_adjustments","approach_descriptions"],deny_content:["code_snippets","file_contents","symbol_names_with_context"],redaction:[{pattern:"\\b[A-Z_]{2,}_KEY\\b"},{pattern:"password|secret|token"}]},team_decisions:{ring:"project-locked",allow_content:["rationale","alternatives","symbol_references"],deny_content:["implementation_details"]}},upstream:{ring:"creator-upstream",allowed:["task_type","outcome","helpfulness","duration_bucket","error_category"],denied:["code_of_any_kind","file_paths","symbol_names","conversation_content","user_identity"]},network:{ring:"network-public",opt_in:false,if_opted_in:["aggregated_task_success_rates","anonymized_pattern_frequency"]}};var Xt=".paradigm/data-policy.yaml";function St(n){let t=b.join(n,Xt);if(!f.existsSync(t))return {...M};try{let e=f.readFileSync(t,"utf8"),o=P.load(e);return Qt(M,o)}catch{return {...M}}}function Qt(n,t){let e={...n};if(t.version&&(e.version=t.version),t.default_ring&&(e.default_ring=t.default_ring),t.observation&&(e.observation={allow:t.observation.allow||n.observation?.allow,deny:[...n.observation?.deny||[],...t.observation.deny||[]].filter((o,i,r)=>r.indexOf(o)===i)}),t.streams){e.streams={...n.streams};for(let o of ["work_log","learning_journal","team_decisions"])t.streams[o]&&(e.streams[o]={...n.streams?.[o],...t.streams[o],deny_content:[...n.streams?.[o]?.deny_content||[],...t.streams[o]?.deny_content||[]].filter((i,r,s)=>s.indexOf(i)===r)});}return t.upstream&&(e.upstream={...n.upstream,...t.upstream}),t.network&&(e.network={...n.network,...t.network}),t.agent_overrides&&(e.agent_overrides={...n.agent_overrides,...t.agent_overrides}),t.deployment&&(e.deployment={...n.deployment,...t.deployment}),e}function wt(n,t,e){return e&&n.agent_overrides?.[e]?.observation&&n.agent_overrides[e].observation.deny?.some(i=>q(i,t))||n.observation?.deny?.some(o=>q(o,t))?false:n.observation?.allow?.length?n.observation.allow.some(o=>q(o,t)):true}function q(n,t){if(n===t)return true;let e=n.replace(/\*\*/g,"\xA7\xA7").replace(/\*/g,"[^/]*").replace(/§§/g,".*");try{return new RegExp(`^${e}$`).test(t)}catch{return false}}var R=".paradigm/events",ae="nominations.jsonl",ce="debates.jsonl",le=500,de=200,ue=7,me=14,pe=100;function fe(){let n=Date.now(),t=Math.floor(Math.random()*9999).toString().padStart(4,"0");return `nom-${n}-${t}`}function ge(){let n=Date.now(),t=Math.floor(Math.random()*9999).toString().padStart(4,"0");return `dbt-${n}-${t}`}function ye(n,t){let e=g(n),o=St(n),i=[];for(let d of e){if(!d.attention||d.benched||t.path&&!wt(o,t.path,d.id))continue;let u=ht(t,d.id,d.attention);u.shouldNominate&&i.push({profile:d,score:u});}if(i.length===0)return {nominations:[],debates:[]};let r=k(n,{since:new Date(Date.now()-3e4).toISOString()}),s=i.filter(({profile:d})=>!r.find(l=>l.agent===d.id&&l.brief===Nt(d,t,{...i.find(m=>m.profile.id===d.id).score})));if(s.length===0)return {nominations:[],debates:[]};let a=s.map(({profile:d,score:u})=>{let l=he(t,u),m=be(d,t);return {id:fe(),agent:d.id,relevance:u.score,urgency:l,type:m,brief:Nt(d,t,u),triggered_by:[t.id],timestamp:new Date().toISOString(),surfaced:false}});Se(n,a);let c=_e(n,a);return c.length>0&&we(n,c),{nominations:a,debates:c}}function he(n,t){return n.severity==="critical"?"critical":n.severity==="error"||n.type==="compliance-violation"||n.type==="error-encountered"?"high":n.type==="gate-added"||n.type==="route-created"||t.score>=.9?"medium":"low"}function be(n,t){let e=n.collaboration?.stance;return t.type==="compliance-violation"||t.type==="error-encountered"?"warning":t.type==="gate-added"||t.type==="route-created"?"observation":e==="advisory"||e==="lead"?"suggestion":"observation"}function Nt(n,t,e){let o=n.role||n.id;switch(t.type){case "gate-checked":return `${o}: Gate check on ${t.symbols?.join(", ")||"route"} \u2014 verify gate coverage is complete`;case "file-modified":return `${o}: ${t.path||"File"} modified \u2014 review for ${n.id==="security"?"security implications":n.id==="tester"?"test coverage":n.id==="reviewer"?"code quality":"consistency"}`;case "compliance-violation":return `${o}: Compliance violation detected \u2014 ${t.context||"check .purpose and portal.yaml coverage"}`;case "route-created":return `${o}: New route ${t.symbols?.join(", ")||""} \u2014 ${n.id==="security"?"needs gate assignment in portal.yaml":"review route structure"}`;case "gate-added":return `${o}: Gate ${t.symbols?.join(", ")||""} added \u2014 ${n.id==="security"?"verify enforcement points":"check downstream impact"}`;case "decision-made":return `${o}: Decision recorded \u2014 ${t.context?.slice(0,80)||"review for alignment with project patterns"}`;case "work-completed":return `${o}: Work completed on ${t.symbols?.join(", ")||t.context?.slice(0,40)||"task"} \u2014 review outcome`;case "error-encountered":return `${o}: Error detected \u2014 ${t.context?.slice(0,80)||"investigate root cause"}`;default:{let i=e.breakdown.symbolMatch>0?`symbol match on ${t.symbols?.join(", ")||"unknown"}`:e.breakdown.pathMatch>0?`path ${t.path||"unknown"}`:t.context?.slice(0,60)||t.type;return `${o}: ${i}`}}}function _e(n,t){if(t.length<2)return [];let e=[],o=new Map;for(let i of t)for(let r of i.triggered_by){let s=o.get(r)||[];s.push(i),o.set(r,s);}for(let[i,r]of o){if(r.length<2||new Set(r.map(d=>d.agent)).size<2)continue;let a=new Set(r.map(d=>d.type)),c=a.size>1&&a.has("warning")&&a.has("suggestion");e.push({id:ge(),topic:`Multiple agents responded to event ${i}`,nominations:r.map(d=>d.id),type:c?"conflicting":"complementary",overlap_events:[i]});}return e}function Z(n){return b.join(n,R,ae)}function tt(n){return b.join(n,R,ce)}function Se(n,t){try{let e=b.join(n,R);f.mkdirSync(e,{recursive:!0});let o=Z(n),i=t.map(s=>JSON.stringify(s)).join(`
10
+ `)+`
11
+ `;f.appendFileSync(o,i,"utf8"),Tt(o,le);let{nominationTtlDays:r}=U(n);Pt(o,r*24*60*60*1e3);}catch{}}function we(n,t){try{let e=b.join(n,R);f.mkdirSync(e,{recursive:!0});let o=tt(n),i=t.map(s=>JSON.stringify(s)).join(`
12
+ `)+`
13
+ `;f.appendFileSync(o,i,"utf8"),Tt(o,de);let{debateTtlDays:r}=U(n);Pt(o,r*24*60*60*1e3);}catch{}}function Tt(n,t){try{let o=f.readFileSync(n,"utf8").trim().split(`
14
+ `).filter(i=>i.trim());if(o.length>t){let i=o.slice(-t);f.writeFileSync(n,i.join(`
15
+ `)+`
16
+ `,"utf8");}}catch{}}function U(n){let t={nominationTtlDays:ue,debateTtlDays:me};try{let e=b.join(n,".paradigm","config.yaml");if(!f.existsSync(e))return t;let o=a("js-yaml"),i=f.readFileSync(e,"utf8"),s=o.load(i)?.ambient;return s?{nominationTtlDays:typeof s["nomination-ttl-days"]=="number"?s["nomination-ttl-days"]:t.nominationTtlDays,debateTtlDays:typeof s["debate-ttl-days"]=="number"?s["debate-ttl-days"]:t.debateTtlDays}:t}catch{return t}}function Pt(n,t){try{if(!f.existsSync(n))return;let o=f.readFileSync(n,"utf8").trim().split(`
17
+ `).filter(s=>s.trim());if(o.length<=pe)return;let i=Date.now()-t,r=o.filter(s=>{try{let a=JSON.parse(s);return (a.timestamp?new Date(a.timestamp).getTime():Date.now())>=i}catch{return !0}});r.length<o.length&&f.writeFileSync(n,r.join(`
18
+ `)+`
19
+ `,"utf8");}catch{}}function k(n,t){let e=Z(n);if(!f.existsSync(e))return [];try{let i=f.readFileSync(e,"utf8").trim().split(`
20
+ `).filter(r=>r.trim()).map(r=>{try{return JSON.parse(r)}catch{return null}}).filter(r=>r!==null);return t?.agent&&(i=i.filter(r=>r.agent===t.agent)),t?.urgency&&(i=i.filter(r=>r.urgency===t.urgency)),t?.surfaced!==void 0&&(i=i.filter(r=>r.surfaced===t.surfaced)),t?.pending_only&&(i=i.filter(r=>!r.engaged)),t?.since&&(i=i.filter(r=>r.timestamp>=t.since)),i.sort((r,s)=>s.timestamp.localeCompare(r.timestamp)),t?.limit&&(i=i.slice(0,t.limit)),i}catch{return []}}function $t(n){let t=tt(n);if(!f.existsSync(t))return [];try{return f.readFileSync(t,"utf8").trim().split(`
21
+ `).filter(o=>o.trim()).map(o=>{try{return JSON.parse(o)}catch{return null}}).filter(o=>o!==null)}catch{return []}}function Ot(n,t,e,o){let i=Z(n);if(!f.existsSync(i))return false;try{let s=f.readFileSync(i,"utf8").trim().split(`
22
+ `),a=!1,c=s.map(d=>{try{let u=JSON.parse(d);return u.id===t?(u.engaged=!0,u.response=e,o&&(u.reason=o),a=!0,JSON.stringify(u)):d}catch{return d}});if(a&&(f.writeFileSync(i,c.join(`
23
+ `)+`
24
+ `,"utf8"),e==="accepted"||e==="dismissed")){let d=JSON.parse(s.find(l=>{try{return JSON.parse(l).id===t}catch{return !1}}));g(n).find(l=>l.id===d.agent)?.learning?.intrinsic?.feedback?.after_recommendation&&J(n,{type:"work-completed",source:"agent-action",agent:d.agent,context:`Nomination ${t} ${e} \u2014 feedback for learning`,data:{nomination_id:t,response:e}});}return a}catch{return false}}function At(n,t,e,o){let i=tt(n);if(!f.existsSync(i))return false;try{let s=f.readFileSync(i,"utf8").trim().split(`
25
+ `),a=!1,c=s.map(d=>{try{let u=JSON.parse(d);if(u.id===t){u.resolution={chosen:e,reason:o,resolved_by:"human",resolved_at:new Date().toISOString()},a=!0;let l=u.nominations.filter(m=>m!==e);for(let m of l){let y=k(n).find(p=>p.id===m);y&&J(n,{type:"work-completed",source:"agent-action",agent:y.agent,context:`Debate ${t} resolved \u2014 nomination ${m} not chosen`,data:{debate_id:t,chosen:e,reason:o}});}return JSON.stringify(u)}return d}catch{return d}});return a&&f.writeFileSync(i,c.join(`
26
+ `)+`
27
+ `,"utf8"),a}catch{return false}}function Ft(n){let t=b.join(n,R,".last-processed"),e="";try{f.existsSync(t)&&(e=f.readFileSync(t,"utf8").trim());}catch{}let o=b.join(n,R,"stream.jsonl");if(!f.existsSync(o))return {processed:0,nominations:[]};let i=[];try{i=f.readFileSync(o,"utf8").trim().split(`
28
+ `).filter(l=>l.trim()).map(l=>{try{return JSON.parse(l)}catch{return null}}).filter(l=>l!==null);}catch{return {processed:0,nominations:[]}}let r=0;if(e){let u=i.findIndex(l=>l.id===e);u>=0&&(r=u+1);}let s=i.slice(r);if(s.length===0)return {processed:0,nominations:[]};let a=[],c=s.slice(0,50);for(let u of c){let{nominations:l}=ye(n,u);a.push(...l);}let d=c[c.length-1];try{f.mkdirSync(b.join(n,R),{recursive:!0}),f.writeFileSync(t,d.id,"utf8");}catch{}return {processed:c.length,nominations:a}}function Ct(n,t){let e=f$1(n,t);if(!e?.attention)return {adjusted:false,oldThreshold:.6,newThreshold:.6,reason:"No attention config"};let o=e.attention.threshold??.6,{nominationTtlDays:i}=U(n),r=i*24*60*60*1e3,c=k(n,{agent:t}).filter(j=>j.engaged||Date.now()-new Date(j.timestamp).getTime()<r).filter(j=>j.engaged);if(c.length<5)return {adjusted:false,oldThreshold:o,newThreshold:o,reason:`Insufficient data (${c.length}/5 engaged nominations)`};let d=c.filter(j=>j.response==="accepted").length,u=c.filter(j=>j.response==="dismissed").length,l=d/c.length,m=u/c.length,y=o,p="No adjustment needed";if(m>.6?(y=Math.min(.95,o+.05),p=`High dismiss rate (${(m*100).toFixed(0)}%) \u2014 raising threshold to reduce noise`):l>.8&&(y=Math.max(.2,o-.05),p=`High accept rate (${(l*100).toFixed(0)}%) \u2014 lowering threshold to contribute more`),y===o)return {adjusted:false,oldThreshold:o,newThreshold:y,reason:p};e.attention.threshold=y;let g=b.join(n,".paradigm/agents",`${t}.agent`),D=f.existsSync(g)?"project":"global";return h(t,e,D,n),J(n,{type:"work-completed",source:"agent-action",agent:t,context:`Attention threshold adjusted: ${o.toFixed(2)} \u2192 ${y.toFixed(2)} (${p})`,data:{old_threshold:o,new_threshold:y,accept_rate:l,dismiss_rate:m}}),{adjusted:true,oldThreshold:o,newThreshold:y,reason:p}}function et(n,t){let{nominationTtlDays:e}=U(n),o=e*24*60*60*1e3,r=k(n,{agent:t}).filter(l=>l.engaged||Date.now()-new Date(l.timestamp).getTime()<o),s=r.filter(l=>l.response==="accepted").length,a=r.filter(l=>l.response==="dismissed").length,c=r.filter(l=>l.response==="deferred").length,d=r.filter(l=>!l.engaged).length,u=s+a+c;return {total:r.length,accepted:s,dismissed:a,deferred:c,pending:d,acceptRate:u>0?s/u:0}}function It(n){let e=g(n).filter(l=>!l.benched).map(l=>{let m=et(n,l.id),y=0;try{let p=b.join(Q.homedir(),".paradigm","notebooks",l.id);f.existsSync(p)&&(y=f.readdirSync(p).filter(g=>g.endsWith(".yaml")).length);}catch{}return {id:l.id,acceptRate:m.acceptRate,threshold:l.attention?.threshold??.5,expertiseCount:(l.expertise||[]).length,notebookCount:y,transferableCount:(l.transferable||[]).length,totalNominations:m.total}}),o=e.length||1,i=e.reduce((l,m)=>l+m.acceptRate,0)/o,r=e.reduce((l,m)=>l+m.threshold,0)/o,s=e.reduce((l,m)=>l+m.expertiseCount,0),a=e.reduce((l,m)=>l+m.notebookCount,0),c=e.reduce((l,m)=>l+m.transferableCount,0),d=e.reduce((l,m)=>l+m.totalNominations,0),u;return d<10?u="cold-start":i<.5?u="accumulating":i<.7?u="calibrating":u="mature",{agents:e,aggregate:{avgAcceptRate:i,avgThreshold:r,totalExpertise:s,totalNotebooks:a,totalTransferable:c},healthStatus:u}}function nt(n,t){let e,o;try{let c=(K(),d(vt)),d$1=(Rt(),d(Dt));e=c.loadJournalEntries,o=d$1.addNotebookEntry;}catch{return {promoted:0,entries:[]}}let i=e(t,{trigger:"pattern_discovered",limit:100}),r=e(t,{trigger:"human_feedback",limit:100}),s=[...i,...r],a=[];for(let c of s)if(!c.promoted_to_notebook&&!((c.confidence_after??0)<.8))try{let{entry:d}=o(t,{context:c.pattern?.applies_when||c.insight.slice(0,80),snippet:c.pattern?.correct_approach||c.insight,concepts:c.tags||[c.pattern?.id||"learned-pattern"],provenance:{source:"journal-auto-promote",sourceId:c.id,createdBy:t}},"global",n);a.push({journalId:c.id,notebookId:d.id});try{let u=b.join(Q.homedir(),".paradigm","agents",t,"journal");if(f.existsSync(u)){let l=f.readdirSync(u).filter(m=>m.endsWith(".yaml"));for(let m of l){let y=b.join(u,m),p=f.readFileSync(y,"utf8");if(p.includes(c.id)){let g=p.replace(/promoted_to_notebook:.*$/m,`promoted_to_notebook: "${d.id}"`);if(g===p){let D=p.trimEnd().split(`
29
+ `);D.push(`promoted_to_notebook: "${d.id}"`),f.writeFileSync(y,D.join(`
30
+ `)+`
31
+ `,"utf8");}else f.writeFileSync(y,g,"utf8");break}}}}catch{}}catch{}return {promoted:a.length,entries:a}}var ve=".paradigm/surfacing.yaml";function Jt(n){let t=b.join(n,ve),e={default_min_urgency:"low",enable_debates:true};if(!f.existsSync(t))return e;try{let o=a("js-yaml"),i=f.readFileSync(t,"utf8"),r=o.load(i);return {...e,...r}}catch{return e}}function Mt(n,t){let e={critical:0,high:1,medium:2,low:3},o=e[t.default_min_urgency||"low"]??3;return n.filter(i=>{let r=e[i.urgency]??3;if(t.preferences){let s=t.preferences.find(a=>a.agent===i.agent);if(s){if(s.always_show)return true;if(s.mute_unless?.length&&!s.mute_unless.some(c=>i.urgency===c||i.type===c))return false;if(s.min_urgency){let a=e[s.min_urgency]??3;return r<=a}}}return r<=o})}var je=".paradigm/decisions";function Lt(n,t){let e=b.join(n,je);if(!f.existsSync(e))return [];let o=[],i=f.readdirSync(e).filter(s=>s.endsWith(".yaml"));for(let s of i)try{let a=f.readFileSync(b.join(e,s),"utf8"),c=P.load(a);c&&c.id&&o.push(c);}catch{}let r=o;return (r=r.filter(s=>s.status===t.status)),t?.participant&&(r=r.filter(s=>s.participants.some(a=>a.id===t.participant))),t?.symbol&&(r=r.filter(s=>s.symbols_affected?.includes(t.symbol))),t?.tag&&(r=r.filter(s=>s.tags?.some(a=>a.startsWith(t.tag)))),t?.dateFrom&&(r=r.filter(s=>s.timestamp>=t.dateFrom)),t?.dateTo&&(r=r.filter(s=>s.timestamp<=t.dateTo)),r.sort((s,a)=>a.timestamp.localeCompare(s.timestamp)),t?.limit&&(r=r.slice(0,t.limit)),r}K();function Ge(){return [{name:"paradigm_ambient_nominations",description:"Get pending agent nominations \u2014 agents that self-nominated contributions based on recent events. Filters by urgency, agent, pending status. Marks returned nominations as surfaced. ~200 tokens.",inputSchema:{type:"object",properties:{urgency:{type:"string",enum:["critical","high","medium","low"],description:"Filter by urgency level"},agent:{type:"string",description:"Filter by agent ID"},pending_only:{type:"boolean",description:"Only show un-engaged nominations (default: true)"},include_debates:{type:"boolean",description:"Include debate groupings (default: false)"},limit:{type:"number",description:"Max nominations to return (default: 20)"}}},annotations:{readOnlyHint:false,destructiveHint:false}},{name:"paradigm_ambient_events",description:"Query the ambient event stream \u2014 recent tool calls, file edits, gate checks, and other project activity. Filters by type, source, symbol, agent, time window. ~200 tokens.",inputSchema:{type:"object",properties:{type:{type:"string",description:'Event type filter (e.g., "file-modified", "gate-checked", "decision-made")'},source:{type:"string",description:'Event source filter (e.g., "mcp-tool-call", "post-write-hook")'},symbol:{type:"string",description:"Filter events referencing this symbol"},agent:{type:"string",description:"Filter events from this agent"},since:{type:"string",description:'Relative time filter (e.g., "1h", "30m", "2d") or ISO timestamp'},limit:{type:"number",description:"Max events to return (default: 50)"}}},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_ambient_engage",description:"Accept, dismiss, or defer a nomination. Optionally resolves a debate by choosing this nomination over others. ~50 tokens.",inputSchema:{type:"object",properties:{nomination_id:{type:"string",description:"Nomination ID to engage with"},response:{type:"string",enum:["accepted","dismissed","deferred"],description:"How to respond"},resolve_debate:{type:"string",description:"Optional debate ID to resolve by choosing this nomination"},reason:{type:"string",description:"Reason for response \u2014 stored on nomination for learning feedback. Especially valuable for dismissals."}},required:["nomination_id","response"]},annotations:{readOnlyHint:false,destructiveHint:false}},{name:"paradigm_context_compose",description:"Compose full agent session context: profile enrichment + recent decisions + transferable journal entries + pending nominations. Returns a markdown context block for prompt injection. ~300 tokens.",inputSchema:{type:"object",properties:{agent:{type:"string",description:"Agent ID to compose context for"},symbols:{type:"array",items:{type:"string"},description:"Relevant symbols for expertise filtering"},include_nominations:{type:"boolean",description:"Include pending nominations (default: true)"},include_decisions:{type:"boolean",description:"Include recent team decisions (default: true)"},include_journal:{type:"boolean",description:"Include transferable journal entries (default: true)"},max_decisions:{type:"number",description:"Max decisions to include (default: 5)"},max_journal:{type:"number",description:"Max journal entries to include (default: 5)"}},required:["agent"]},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_ambient_promote",description:"Auto-promote high-confidence pattern discoveries from an agent's learning journal to its notebook. Promotes entries with trigger=pattern_discovered and confidence_after >= 0.8. ~100 tokens.",inputSchema:{type:"object",properties:{agent:{type:"string",description:"Agent ID whose journal to scan"}},required:["agent"]},annotations:{readOnlyHint:false,destructiveHint:false}},{name:"paradigm_ambient_learn",description:"Analyze an agent's nomination acceptance/dismissal history and adjust its attention threshold. If >60% dismissed \u2192 raise threshold (less noise). If >80% accepted \u2192 lower threshold (contribute more). Also returns engagement stats. ~100 tokens.",inputSchema:{type:"object",properties:{agent:{type:"string",description:"Agent ID to analyze and adjust"},dry_run:{type:"boolean",description:"If true, return stats without adjusting (default: false)"}},required:["agent"]},annotations:{readOnlyHint:false,destructiveHint:false}},{name:"paradigm_ambient_neverland",description:"Neverland Validation \u2014 aggregate learning metrics across all agents. Shows acceptance rates, threshold drift, expertise growth, notebook counts, cross-project transfer, and overall health status (cold-start \u2192 accumulating \u2192 calibrating \u2192 mature). ~200 tokens.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_ambient_learn_postflight",description:"Postflight learning pass \u2014 converts session work log verdicts into agent journal entries. Reads accepted/dismissed/revised verdicts from the session log, creates journal entries for each agent, then auto-promotes high-confidence entries to notebooks. Typically called at session end by the stop hook. ~200 tokens.",inputSchema:{type:"object",properties:{session_id:{type:"string",description:"Session ID (default: current session)"},dry_run:{type:"boolean",description:"If true, show what would be written without writing (default: false)"}}},annotations:{readOnlyHint:false,destructiveHint:false}}]}function ke(n){let t=Date.now(),e=n.match(/^(\d+)(m|h|d)$/);if(e){let o=parseInt(e[1],10),i=e[2],r=i==="m"?o*6e4:i==="h"?o*36e5:o*864e5;return new Date(t-r).toISOString()}return n}async function ze(n$1,t,e){let o=i=>JSON.stringify(i,null,2);switch(n$1){case "paradigm_ambient_nominations":{Ft(e.rootDir);let r=t.pending_only!==false,s=t.limit||20,a=k(e.rootDir,{agent:t.agent,urgency:t.urgency,pending_only:r,limit:s+20}),c=Jt(e.rootDir);a=Mt(a,c).slice(0,s);let d=b.join(e.rootDir,".paradigm/events/nominations.jsonl");if(f.existsSync(d))try{let l=f.readFileSync(d,"utf8"),m=new Set(a.map(p=>p.id)),y=l.trim().split(`
32
+ `).map(p=>{try{let g=JSON.parse(p);return m.has(g.id)?(g.surfaced=!0,JSON.stringify(g)):p}catch{return p}});f.writeFileSync(d,y.join(`
33
+ `)+`
34
+ `,"utf8");}catch{}let u={count:a.length,nominations:a.map(l=>({id:l.id,agent:l.agent,urgency:l.urgency,type:l.type,brief:l.brief,relevance:l.relevance,timestamp:l.timestamp,engaged:l.engaged,response:l.response}))};if(t.include_debates){let m=$t(e.rootDir).filter(y=>!y.resolution);u.debates=m.map(y=>({id:y.id,topic:y.topic,type:y.type,nominations:y.nominations})),u.debate_count=m.length;}return {text:o(u),handled:true}}case "paradigm_ambient_events":{let i=t.since?ke(t.since):void 0,r=t.limit||50,s=yt(e.rootDir,{type:t.type,source:t.source,symbol:t.symbol,agent:t.agent,since:i,limit:r});return {text:o({count:s.length,events:s.map(a=>({id:a.id,type:a.type,source:a.source,timestamp:a.timestamp,path:a.path,symbols:a.symbols,context:a.context,agent:a.agent,tool:a.tool,severity:a.severity}))}),handled:true}}case "paradigm_ambient_engage":{let i=t.nomination_id,r=t.response,s=t.reason,a=Ot(e.rootDir,i,r,s);if(a)try{let{appendSessionWorkEntry:d}=await import('./session-work-log-3MNUDEZ6.js'),l=k(e.rootDir,{limit:500}).find(m=>m.id===i);d(e.rootDir,{timestamp:new Date().toISOString(),type:"user-verdict",agent:l?.agent,nominationId:i,verdict:r,reason:s});}catch{}let c=false;return t.resolve_debate&&a&&(c=At(e.rootDir,t.resolve_debate,i,t.reason)),{text:o({engaged:a,nomination_id:i,response:r,debate_resolved:c||void 0}),handled:true}}case "paradigm_context_compose":{let i=t.agent,r=t.symbols||[],s=t.include_nominations!==false,a=t.include_decisions!==false,c=t.include_journal!==false,d=t.max_decisions||5,u=t.max_journal||5,l=f$1(e.rootDir,i);if(!l)return {text:o({error:`Agent profile not found: ${i}`}),handled:true};let m=[],y=n(l,r);if(y.trim()&&m.push(y),a){let p=Lt(e.rootDir,{status:"active",limit:d});if(p.length>0){m.push("## Recent Team Decisions");for(let g of p)m.push(`- **${g.title}**: ${g.decision.slice(0,150)}${g.decision.length>150?"...":""}`);m.push("");}}if(c){let p=O(i,{transferable:true,limit:u});if(p.length>0){m.push("## Transferable Insights");for(let g of p)m.push(`- [${g.trigger}] ${g.insight.slice(0,150)}${g.insight.length>150?"...":""}`);m.push("");}}if(s){let p=k(e.rootDir,{pending_only:true,limit:10});if(p.length>0){m.push("## Pending Nominations");for(let g of p)m.push(`- [${g.urgency}] ${g.brief}`);m.push("");}}return {text:o({agent:i,context:m.join(`
35
+ `),sections_included:{profile:true,decisions:a,journal:c,nominations:s}}),handled:true}}case "paradigm_ambient_promote":{let i=t.agent,r=nt(e.rootDir,i);return {text:o({agent:i,promoted:r.promoted,entries:r.entries}),handled:true}}case "paradigm_ambient_learn":{let i=t.agent,r=t.dry_run===true,s=et(e.rootDir,i);if(r)return {text:o({agent:i,dry_run:true,stats:s,note:s.total<5?"Insufficient data for threshold adjustment (need 5+ engaged nominations)":`Accept rate: ${(s.acceptRate*100).toFixed(0)}% \u2014 ${s.acceptRate>.8?"would lower threshold":s.acceptRate<.4?"would raise threshold":"no adjustment needed"}`}),handled:true};let a=Ct(e.rootDir,i);return {text:o({agent:i,...a,stats:s}),handled:true}}case "paradigm_ambient_neverland":{let i=It(e.rootDir);return {text:o(i),handled:true}}case "paradigm_ambient_learn_postflight":return {text:o(await De(e.rootDir,t)),handled:true};default:return {text:`Unknown ambient tool: ${n$1}`,handled:false}}}var Ee={accepted:"human_feedback",dismissed:"confidence_miss",revised:"correction_received"};function xe(n){try{let t=b.join(n,".paradigm","config.yaml");if(f.existsSync(t)){let o=f.readFileSync(t,"utf8").match(/project:\s*["']?([^"'\n]+)["']?/);if(o)return o[1].trim()}}catch{}return b.basename(n)}async function De(n,t={}){let e=t.dry_run===true,o=xe(n),i=b$2(n),r=i.filter(p=>p.type==="user-verdict"&&p.verdict&&p.agent);if(r.length===0)return {sessionEntries:i.length,agentsProcessed:[],journalsWritten:0,journalsByAgent:{},promoted:0,promotedByAgent:{},dryRun:e,details:[]};let s=new Map;for(let p of r){let g=p.agent;s.has(g)||s.set(g,[]),s.get(g).push(p);}let a=i.filter(p=>p.type==="agent-contribution"),c=new Map;for(let p of a)p.agent&&(c.has(p.agent)||c.set(p.agent,[]),c.get(p.agent).push(p));let d=[],u={},l=0;for(let[p,g]of s){u[p]=0;let D=g.filter(h=>h.verdict==="accepted").length;g.filter(h=>h.verdict==="dismissed").length;g.filter(h=>h.verdict==="revised").length;let B=g.length,Bt=B>0?D/B:0;for(let h of g){let H=Ee[h.verdict];if(!H)continue;let Ht=c.get(p)?.shift(),it=Re(h,Ht,{acceptRate:Bt,total:B,accepted:D}),Wt=h.verdict==="accepted"?.85:h.verdict==="revised"?.6:.4,qt={agent:p,verdict:h.verdict,trigger:H,insight:it,symbols:h.symbols};if(d.push(qt),e)u[p]++,l++;else try{z(p,{trigger:H,insight:it,confidence_before:h.verdict==="accepted"?.7:.8,confidence_after:Wt,project:o,transferable:h.verdict==="dismissed",tags:["postflight",`verdict:${h.verdict}`,...(h.symbols||[]).map(Gt=>`symbol:${Gt}`)]}),u[p]++,l++;}catch{}}}let m={},y=0;if(!e)for(let p of s.keys())try{let g=nt(n,p);g.promoted>0&&(m[p]=g.promoted,y+=g.promoted);}catch{}return {sessionEntries:i.length,agentsProcessed:Array.from(s.keys()),journalsWritten:l,journalsByAgent:u,promoted:y,promotedByAgent:m,dryRun:e,details:d}}function Re(n,t,e){let o=n.symbols?.length?` (symbols: ${n.symbols.join(", ")})`:"",i=n.reason?` Reason: ${n.reason}.`:"";switch(n.verdict){case "accepted":return `Contribution accepted by user${o}.${i}`+(t?.contribution?` Original: "${t.contribution.slice(0,120)}".`:"")+` Session accept rate: ${(e.acceptRate*100).toFixed(0)}% (${e.accepted}/${e.total}).`;case "dismissed":return `Contribution dismissed by user${o}.${i}`+(t?.contribution?` Rejected contribution: "${t.contribution.slice(0,120)}".`:"")+` Learn from this dismissal to improve future nominations. Session accept rate: ${(e.acceptRate*100).toFixed(0)}% (${e.accepted}/${e.total}).`;case "revised":return `Contribution revised by user${o}.${i}`+(n.revisionDelta?` Delta: "${n.revisionDelta.slice(0,120)}".`:"")+(t?.contribution?` Original: "${t.contribution.slice(0,120)}".`:"")+` Partial credit \u2014 close but not accurate enough. Session accept rate: ${(e.acceptRate*100).toFixed(0)}% (${e.accepted}/${e.total}).`;default:return `Unknown verdict "${n.verdict}"${o}.${i}`}}export{Ge as getAmbientToolsList,ze as handleAmbientTool,De as runPostflightLearning};
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import {g,f}from'./chunk-WS2N27RX.js';import'./chunk-5TAVYPOV.js';import e from'chalk';async function $(r,o,t){let c=process.cwd();["correct","partial","incorrect"].includes(o)||(console.error(e.red(`
3
+ Invalid verdict: "${o}". Must be one of: correct, partial, incorrect
4
+ `)),process.exit(1));let n=await g(c,r);if(n||(console.error(e.red(`
5
+ Entry not found: ${r}
6
+ `)),process.exit(1)),await f(c,r,{verdict:o,assessed_by:t.assessor||"unknown",assessed_at:new Date().toISOString(),notes:t.notes})){let d={correct:e.green,partial:e.yellow,incorrect:e.red}[o]||e.white;if(console.log(e.green(`
7
+ Assessment recorded for ${r}`)),console.log(` Verdict: ${d(o)}`),n.confidence!=null){let s=(o==="correct"?1:o==="partial"?.5:0)-n.confidence,a=`${s>0?"+":""}${s.toFixed(2)}`,g=Math.abs(s)<=.1?e.green:Math.abs(s)<=.3?e.yellow:e.red;console.log(` Confidence: ${n.confidence.toFixed(2)} | Delta: ${g(a)}`),s>.1?console.log(e.gray(" Under-confident (outcome better than predicted)")):s<-0.1?console.log(e.gray(" Over-confident (outcome worse than predicted)")):console.log(e.gray(" Well-calibrated"));}else console.log(e.gray(" No confidence recorded \u2014 delta not computed"));console.log();}else console.error(e.red(`
8
+ Failed to assess entry: ${r}
9
+ `)),process.exit(1);}export{$ as loreAssessCommand};
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import {e}from'./chunk-UIKLE3WD.js';import'./chunk-5TAVYPOV.js';import*as f from'fs';import*as l from'path';import d from'chalk';import O from'ora';import*as $ from'js-yaml';var S={components:["**/*.tsx","**/*.jsx","**/*.vue","**/components/**/*.ts","**/components/**/*.js"],routes:["**/routes.ts","**/routes.tsx","**/router.ts","**/app.ts","**/server.ts","**/api/**/*.ts","**/pages/**/*.tsx","**/app/**/page.tsx"],auth:["**/middleware/**/*.ts","**/auth/**/*.ts","**/guards/**/*.ts"]},E=["node_modules","dist","build",".next",".nuxt","coverage","__tests__","*.test.*","*.spec.*"];function A(o,t){let n=t.replace(/\*\*/g,"{{DOUBLE}}").replace(/\*/g,"[^/]*").replace(/{{DOUBLE}}/g,".*").replace(/\//g,"\\/");return new RegExp(n).test(o)}function k(o){return E.some(t=>t.includes("*")?A(o,t):o.includes(t))}function v(o,t){let n=[];function s(a){try{let i=f.readdirSync(a,{withFileTypes:!0});for(let p of i){let c=l.join(a,p.name),e=l.relative(o,c);if(!k(e)){if(p.isDirectory())s(c);else if(p.isFile()){for(let u of t)if(A(e,u)){n.push(c);break}}}}}catch{}}return s(o),n}function q(o,t){let n=o.match(/export\s+(?:default\s+)?(?:function|const|class)\s+([A-Z][a-zA-Z0-9]*)/);if(n)return n[1];let s=o.match(/name:\s*['"]([A-Z][a-zA-Z0-9]*)['"]/);if(s)return s[1];let a=l.basename(t,l.extname(t));return /^[A-Z]/.test(a)?a:null}function C(o){let t=[],n=v(o,S.components);for(let s of n)try{let a=f.readFileSync(s,"utf8"),i=l.relative(o,s),p=a.match(/@component\s+([^\n]+)/);if(p){t.push({id:p[1].trim().replace(/[^a-zA-Z0-9-]/g,"-").toLowerCase(),type:"component",description:p[1].trim(),source:i,confidence:"high"});continue}let c=q(a,s);if(c){if(["Index","App","Main","Root"].includes(c))continue;let e=c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();t.push({id:e,type:"component",description:`${c} component`,source:i,confidence:"medium"});}}catch{}return t}function F(o){let t=[],n=v(o,S.routes);for(let s of n)try{let a=f.readFileSync(s,"utf8"),i=l.relative(o,s);if(i.includes("/app/")&&i.endsWith("page.tsx")){let e=i.replace(/^.*\/app/,"").replace(/\/page\.tsx$/,"").replace(/\[([^\]]+)\]/g,":$1")||"/",u=e.replace(/^\//,"").replace(/\//g,"-").replace(/:/g,"").toLowerCase()||"home";t.push({id:`${u}-page`,type:"flow",description:`Page route: ${e}`,source:i,confidence:"high"});continue}let p=a.matchAll(/(?:app|router)\.(get|post|put|patch|delete)\s*\(\s*['"]([^'"]+)['"]/gi);for(let e of p){let[,u,w]=e,m=w.replace(/^\//,"").replace(/\//g,"-").replace(/:/g,"").toLowerCase()||"root";t.push({id:`${u.toLowerCase()}-${m}`,type:"flow",description:`${u.toUpperCase()} ${w}`,source:i,confidence:"high"});}let c=a.matchAll(/<Route[^>]+path=["']([^"']+)["']/gi);for(let e of c){let u=e[1],w=u.replace(/^\//,"").replace(/\//g,"-").replace(/:/g,"").toLowerCase()||"home";t.push({id:`${w}-route`,type:"flow",description:`Route: ${u}`,source:i,confidence:"medium"});}}catch{}return t}function N(o){let t=[],n=v(o,S.auth),s=v(o,["**/*.ts","**/*.tsx","**/*.js","**/*.jsx"]),a=[...new Set([...n,...s.slice(0,100)])],i=[{pattern:/isAuthenticated|requireAuth|authMiddleware|withAuth|useAuth/i,id:"authenticated",desc:"User must be authenticated"},{pattern:/isAdmin|requireAdmin|adminOnly|adminRequired/i,id:"admin-only",desc:"Admin access required"},{pattern:/hasRole|requireRole|checkRole|roleGuard/i,id:"role-required",desc:"Specific role required"},{pattern:/hasPermission|requirePermission|checkPermission|canAccess/i,id:"permission-required",desc:"Specific permission required"},{pattern:/isSubscribed|requireSubscription|premiumOnly|subscriptionRequired|isPremium/i,id:"subscription-required",desc:"Subscription required"},{pattern:/isOwner|requireOwner|ownerOnly/i,id:"owner-only",desc:"Resource owner access required"},{pattern:/isVerified|requireVerification|verifiedOnly/i,id:"verified-required",desc:"Email verification required"},{pattern:/rateLimit|rateLimiter|throttle/i,id:"rate-limited",desc:"Rate limiting applied"},{pattern:/csrf|csrfProtection|xsrf/i,id:"csrf-protected",desc:"CSRF protection required"}],p=[{pattern:/\.rls\s*\(|enableRLS|row.*level.*security/i,id:"rls-enabled",desc:"Row-level security enabled"},{pattern:/auth\.uid\(\)|current_user|session_user/i,id:"user-scoped",desc:"Data scoped to current user"}];for(let c of a)try{let e=f.readFileSync(c,"utf8"),u=l.relative(o,c);for(let{pattern:w,id:m,desc:b}of [...i,...p])w.test(e)&&(t.find(r=>r.id===m)||t.push({id:m,type:"gate",description:b,source:u,confidence:"high"}));/ProtectedRoute|PrivateRoute|AuthRoute|GuardedRoute/i.test(e)&&(t.find(w=>w.id==="route-protected")||t.push({id:"route-protected",type:"gate",description:"Route requires authentication",source:u,confidence:"high"}));}catch{}return t}function T(o){let t=[],n=v(o,["**/*.ts","**/*.tsx","**/*.js","**/*.jsx"]),s=[{pattern:/emit\s*\(\s*['"]([^'"]+)['"]/,type:"event",category:"emit"},{pattern:/dispatch\s*\(\s*\{?\s*type:\s*['"]([^'"]+)['"]/,type:"event",category:"redux"},{pattern:/dispatchEvent\s*\(\s*new\s+\w+\s*\(\s*['"]([^'"]+)['"]/,type:"event",category:"dom"},{pattern:/throw\s+new\s+(\w+Error)/,type:"error",category:"exception"},{pattern:/new\s+(ApiError|HttpError|ValidationError|AuthError)\s*\(/,type:"error",category:"api"},{pattern:/log\.(error|warn)\s*\(\s*['"]([^'"]+)['"]/,type:"log",category:"logging"},{pattern:/console\.(error|warn)\s*\(\s*['"]([^'"]+)['"]/,type:"log",category:"console"},{pattern:/toast\.(success|error|warning|info)\s*\(\s*['"]([^'"]+)['"]/,type:"notification",category:"toast"},{pattern:/notify\s*\(\s*\{[^}]*message:\s*['"]([^'"]+)['"]/,type:"notification",category:"notify"},{pattern:/showNotification\s*\(\s*['"]([^'"]+)['"]/,type:"notification",category:"notification"},{pattern:/track\s*\(\s*['"]([^'"]+)['"]/,type:"analytics",category:"tracking"},{pattern:/analytics\.(track|page|identify)\s*\(\s*['"]([^'"]+)['"]/,type:"analytics",category:"analytics"},{pattern:/gtag\s*\(\s*['"]event['"]\s*,\s*['"]([^'"]+)['"]/,type:"analytics",category:"ga"},{pattern:/log\.signal\s*\(\s*['"]!?([^'"]+)['"]/,type:"signal",category:"paradigm"}],a=new Set;for(let i of n.slice(0,100))try{let p=f.readFileSync(i,"utf8"),c=l.relative(o,i);for(let{pattern:e,type:u,category:w}of s){let m=p.matchAll(new RegExp(e,"gi"));for(let b of m){let r=b[1]||b[2];if(!r||a.has(r)||r.length<3||r.length>50||/^[a-z]$|^%s|^\$\{/.test(r))continue;a.add(r);let g=r.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/Error$/,"").replace(/[^a-zA-Z0-9-]/g,"-").toLowerCase(),y=w==="paradigm"?"high":u==="error"||u==="event"?"medium":"low";t.push({id:g,type:"signal",description:`${u==="error"?"Error: ":u==="analytics"?"Event: ":""}${r}`,source:c,confidence:y});}}}catch{}return t}function L(o,t){let n=new Map;for(let s of o){let a=l.dirname(s.source),i=a,p=a.split(l.sep);p.length>3&&(i=p.slice(0,3).join(l.sep)),(i==="."||i==="")&&(i="."),n.has(i)||n.set(i,[]),n.get(i).push(s);}return n}function z(o,t){let n=o.filter(e=>e.type==="feature"),s=o.filter(e=>e.type==="component"),a=o.filter(e=>e.type==="flow"),i=o.filter(e=>e.type==="gate"),p=o.filter(e=>e.type==="signal"),c={description:`Auto-generated purpose file for ${t||"project root"}`};return n.length>0&&(c.features=Object.fromEntries(n.map(e=>[e.id,{description:e.description}]))),s.length>0&&(c.components=Object.fromEntries(s.map(e=>[e.id,{description:e.description}]))),a.length>0&&(c.flows=Object.fromEntries(a.map(e=>[e.id,{description:e.description}]))),i.length>0&&(c.gates=Object.fromEntries(i.map(e=>[e.id,{description:e.description}]))),p.length>0&&(c.signals=Object.fromEntries(p.map(e=>[e.id,{description:e.description,category:"auto-detected"}]))),$.dump(c,{lineWidth:-1,noRefs:true})}async function Z(o,t){let n=o?l.resolve(o):process.cwd(),s=O();t.json||(console.log(d.blue(`
3
+ \u{1F50D} Paradigm Auto-Scan
4
+ `)),console.log(d.gray(`Analyzing codebase for symbols...
5
+ `)));let a=G(n);if(a&&a!=="auto"&&a!=="custom"){let r=e(a);for(let g of r.components)S.components.includes(g)||S.components.push(g);for(let g of r.routes)S.routes.includes(g)||S.routes.push(g);for(let g of r.auth)S.auth.includes(g)||S.auth.push(g);t.json||console.log(d.gray(` Discipline: ${a} (using discipline-specific scan patterns)
6
+ `));}s.start("Detecting components...");let i=C(n);s.text=`Found ${i.length} components`,s.text="Detecting routes/flows...";let p=F(n);s.text=`Found ${p.length} routes`,s.text="Detecting auth patterns...";let c=N(n);s.text=`Found ${c.length} gates`,s.text="Detecting signals...";let e$1=T(n);s.stop();let u=[...i,...p,...c,...e$1];if(t.json||(console.log(d.cyan("Detected symbols:")),console.log(` Components: ${d.yellow(i.length.toString())}`),console.log(` Flows: ${d.yellow(p.length.toString())}`),console.log(` Gates: ${d.yellow(c.length.toString())}`),console.log(` Signals: ${d.yellow(e$1.length.toString())}`),console.log(` Total: ${d.yellow(u.length.toString())}`),console.log()),u.length===0){t.json?console.log(JSON.stringify({symbols:[],generated:[],skipped:[]})):console.log(d.yellow(`No symbols detected. This might be a non-standard project structure.
7
+ `));return}let w=L(u),m=[],b=[];for(let[r,g]of w){let y=l.join(n,r,".purpose"),x=f.existsSync(y);if(x&&!t.force){b.push(y);continue}let h=z(g,r);m.push({path:y,content:h,symbols:g,isNew:!x});}if(t.json){console.log(JSON.stringify({symbols:u,generated:m.map(r=>({path:l.relative(n,r.path),symbolCount:r.symbols.length,isNew:r.isNew})),skipped:b.map(r=>l.relative(n,r))},null,2));return}if(m.length===0){console.log(d.yellow(`All .purpose files already exist. Use --force to overwrite.
8
+ `));return}console.log(d.cyan("Will generate:"));for(let r of m){let g=l.relative(n,r.path),y=r.isNew?d.green("[new]"):d.yellow("[update]");console.log(` ${y} ${g} (${r.symbols.length} symbols)`);}if(b.length>0&&console.log(d.gray(`
9
+ Skipped ${b.length} existing file(s). Use --force to overwrite.`)),t.dryRun){console.log(d.gray(`
10
+ [Dry run] No files written.
11
+ `));return}console.log(),s.start("Writing .purpose files...");for(let r of m){let g=l.dirname(r.path);f.existsSync(g)||f.mkdirSync(g,{recursive:true}),f.writeFileSync(r.path,r.content);}if(s.succeed(d.green(`Generated ${m.length} .purpose file(s)`)),t.init){let r=l.join(n,"portal.yaml");if(f.existsSync(r)&&!t.force)console.log(d.gray(`
12
+ portal.yaml already exists. Use --force to overwrite.`));else {let y={},x={};for(let h of c)y[`^${h.id}`]={description:h.description,check:`// TODO: implement ${h.id} check`,prizes:[]};for(let h of p)if(h.description.startsWith("GET ")||h.description.startsWith("POST ")||h.description.startsWith("PUT ")||h.description.startsWith("PATCH ")||h.description.startsWith("DELETE ")){let R=h.description,j=c.length>0?c.map(D=>`^${D.id}`):["# TODO: add gates"];x[R]=j;}if(Object.keys(y).length>0||Object.keys(x).length>0){let h={version:"1.0"};Object.keys(y).length>0&&(h.gates=y),Object.keys(x).length>0&&(h.routes=x);let R=$.dump(h,{lineWidth:-1,noRefs:true});f.writeFileSync(r,R),s.succeed(d.green(`Generated portal.yaml with ${Object.keys(y).length} gates and ${Object.keys(x).length} routes`));}else console.log(d.gray(`
13
+ No gates or routes detected for portal.yaml.`));}}console.log(d.gray(`
14
+ Next steps:`)),console.log(d.gray(" 1. Review generated files and adjust descriptions")),console.log(d.gray(" 2. Run `paradigm lint` to validate")),console.log(d.gray(" 3. Run `paradigm index` to build scan index\n"));}function G(o){let t=l.join(o,".paradigm","config.yaml");try{let n=f.readFileSync(t,"utf8");return $.load(n)?.discipline||null}catch{return null}}export{Z as autoScanCommand};
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import {m,o,C,B}from'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as c from'path';import n from'chalk';import O from'ora';function G(u){let o=[],g=[{pattern:"portal.yaml",desc:"Authorization topology"},{pattern:"src/lib/api.ts",desc:"API utilities"},{pattern:"src/lib/api.js",desc:"API utilities"},{pattern:"src/utils/api.ts",desc:"API utilities"},{pattern:"src/hooks/useAuth.ts",desc:"Auth hook"},{pattern:"src/hooks/useAuth.tsx",desc:"Auth hook"},{pattern:"src/context/AuthContext.tsx",desc:"Auth context"},{pattern:"src/store/index.ts",desc:"State store"},{pattern:"src/types/index.ts",desc:"Type definitions"},{pattern:"src/types.ts",desc:"Type definitions"},{pattern:".paradigm/config.yaml",desc:"Paradigm config"},{pattern:"tsconfig.json",desc:"TypeScript config"},{pattern:"package.json",desc:"Package manifest"}];for(let{pattern:r,desc:l}of g){let t=c.join(u,r);i.existsSync(t)&&o.push({path:r,description:l});}return o.slice(0,8)}function E(u){let o=c.join(u,".paradigm","prompts"),g=[];if(i.existsSync(o)){let r=i.readdirSync(o).filter(l=>l.endsWith(".md"));for(let l of r){let t=l.replace(".md","").replace(/-/g," ");g.push({name:t.charAt(0).toUpperCase()+t.slice(1),path:`.paradigm/prompts/${l}`});}}return g.slice(0,6)}function I(u,o,g,r,l){let t=[];t.push(`# Beacon - ${u}`),t.push(""),t.push("> Quick-start orientation for AI agents. Generated by Paradigm."),t.push(""),t.push("## Constellation (Symbol Map)"),t.push(""),t.push("```");let a=o.filter(e=>e.type==="component"),m=o.filter(e=>e.type==="gate");for(let e of a.slice(0,15)){let p=e.references.filter(d=>d.startsWith("^")),b=`${e.symbol.padEnd(20)} \u2192 ${c.dirname(e.filePath).padEnd(25)}`;p.length>0&&(b+=` \u2192 ${p.join(", ")}`),t.push(b);}if(a.length>15&&t.push(`... and ${a.length-15} more components`),t.push("```"),t.push(""),m.length>0){t.push("## Gates (Authorization)"),t.push("");for(let e of m.slice(0,6)){let p=e.description?` - ${e.description}`:"";t.push(`- \`${e.symbol}\`${p}`);}m.length>6&&t.push(`- ... and ${m.length-6} more gates`),t.push("");}if(g.length>0){t.push("## Landmarks (Key Files)"),t.push("");for(let e of g)t.push(`- \`${e.path}\` - ${e.description}`);t.push("");}if(r.length>0){t.push("## Pathways (Common Tasks)"),t.push("");for(let e of r)t.push(`- "${e.name}" \u2192 \`${e.path}\``);t.push("");}return t.push("## Symbol Quick Reference"),t.push(""),t.push("| Symbol | Type | Meaning |"),t.push("|--------|------|---------|"),t.push("| `#` | Component | Any documented code unit |"),t.push("| `$` | Flow | Multi-step process |"),t.push("| `^` | Gate | Authorization checkpoint |"),t.push("| `!` | Signal | Event for side effects |"),t.push("| `~` | Aspect | Rule with code anchor |"),t.push(""),t.push("## For More Context"),t.push(""),t.push("- Full symbol graph: `.paradigm/constellation.json`"),t.push("- Detailed context: `.paradigm/specs/` for detailed specifications"),t.push("- Session history: `.paradigm/thread.md` (if available)"),t.push("- Error mapping: `.paradigm/echoes.yaml` (if available)"),t.push(""),t.push("---"),t.push(`*Generated: ${new Date().toISOString().split("T")[0]}*`),t.push("*Run `paradigm beacon --refresh` to update*"),t.join(`
3
+ `)}async function q(u,o$1={}){let g=process.cwd(),r=u?c.resolve(g,u):g,l=c.basename(r),t=!o$1.json&&!o$1.quiet;t&&console.log(n.blue(`
4
+ \u{1F526} Generating Beacon...
5
+ `));let a$1=o$1.json?null:O("Scanning project...").start(),m$1=a.command("beacon").start("Generating beacon",{project:l});try{let e=c.join(r,".paradigm"),p=o$1.output||c.join(e,"beacon.md");if(!o$1.json&&i.existsSync(p)&&!o$1.refresh){if(a$1?.info("Beacon already exists"),t){console.log(n.gray(` Use --refresh to regenerate
6
+ `)),console.log(n.gray(` Path: ${p}
7
+ `));let w=i.readFileSync(p,"utf8").split(`
8
+ `).slice(0,15);console.log(n.white("Current Beacon (preview):")),console.log(n.gray("\u2500".repeat(40)));for(let f of w)console.log(n.gray(` ${f}`));console.log(n.gray(" ...")),console.log("");}return}let b=await m(r),d=o(b),S=C(d);a$1&&(a$1.text="Finding landmarks...");let $=G(r);a$1&&(a$1.text="Finding pathways...");let j=E(r);if(o$1.json){let h=S.filter(s=>s.type==="component"),w=S.filter(s=>s.type==="gate"),f=B(d),k={project:l,generated:new Date().toISOString(),symbols:{features:h.filter(s=>s.tags?.includes("feature")).map(s=>({symbol:s.symbol,path:c.dirname(s.filePath),portals:s.references.filter(y=>y.startsWith("^")).length>0?s.references.filter(y=>y.startsWith("^")):void 0})),components:h.map(s=>({symbol:s.symbol,path:c.dirname(s.filePath)})),portals:w.map(s=>({symbol:s.symbol,description:s.description}))},landmarks:$,pathways:j,stats:{features:h.filter(s=>s.tags?.includes("feature")).length,components:f.component,portals:f.gate,total:Object.values(f).reduce((s,y)=>s+y,0)}};return console.log(JSON.stringify(k,null,2)),k}a$1&&(a$1.text="Generating beacon...");let F=I(l,S,$,j,r);if(i.existsSync(e)||i.mkdirSync(e,{recursive:!0}),i.writeFileSync(p,F,"utf8"),a.component("beacon-file").success("Beacon file written",{path:p}),a$1?.succeed("Beacon generated"),m$1.success("Beacon generated",{path:p,symbols:S.length}),!o$1.quiet){let h=B(d);console.log(n.white(`
9
+ Beacon Contents`)),console.log(n.gray("\u2500".repeat(40))),console.log(` Components: ${n.green(h.component.toString())}`),console.log(` Flows: ${n.yellow(h.flow.toString())}`),console.log(` Gates: ${n.red(h.gate.toString())}`),console.log(` Signals: ${n.cyan(h.signal.toString())}`),console.log(` Aspects: ${n.magenta(h.aspect.toString())}`),console.log(` Landmarks: ${n.cyan($.length.toString())}`),console.log(` Pathways: ${n.yellow(j.length.toString())}`),console.log(n.gray(`
10
+ Output: ${p}
11
+ `)),console.log(n.white("Tip")),console.log(n.gray("\u2500".repeat(40))),console.log(n.gray(" AI agents should read beacon.md first for quick orientation.")),console.log(n.gray(` Then constellation.json for detailed relationships.
12
+ `));}}catch(e){a$1?.fail("Failed to generate beacon"),m$1.error("Beacon generation failed",{error:e.message}),console.log(n.red(`Error: ${e.message}
13
+ `)),process.exit(1);}}export{q as beaconCommand};
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import {d}from'./chunk-WS2N27RX.js';import'./chunk-5TAVYPOV.js';import o from'chalk';async function L(r){let A=process.cwd(),u=await d(A,{symbol:r.symbol,tag:r.tag,author:r.author,hasAssessment:true});if(u.length===0){r.json?console.log(JSON.stringify({totalAssessed:0,message:"No assessed entries found"},null,2)):(console.log(o.gray(`
3
+ No assessed lore entries found.
4
+ `)),console.log(o.gray(" Use `paradigm lore assess <id> <correct|partial|incorrect>` to assess entries.\n")));return}let F=u.filter(e=>e.confidence!=null),c=u.length,f=F.length,l={correct:0,partial:0,incorrect:0},h=0,$=0,b=0;for(let e of u){let n=e.assessment.verdict;l[n]++;let t=n==="correct"?1:n==="partial"?.5:0;h+=t,e.confidence!=null&&($+=e.confidence,b+=Math.abs(t-e.confidence));}let y=h/c,m=f>0?$/f:null,s=f>0?1-b/f:null,i;if(r.groupBy&&c>0){let e=new Map;for(let n of u){let t=[];r.groupBy==="symbol"?t=n.symbols_touched||[]:r.groupBy==="tag"?t=n.tags||[]:r.groupBy==="type"&&(t=[n.type||"agent-session"]);for(let a of t)e.has(a)||e.set(a,[]),e.get(a).push(n);}i=Array.from(e.entries()).map(([n,t])=>{let a=t.filter(d=>d.confidence!=null),v={correct:0,partial:0,incorrect:0},C=0,B=0,S=0;for(let d of t){let p=d.assessment.verdict;v[p]++;let k=p==="correct"?1:p==="partial"?.5:0;C+=k,d.confidence!=null&&(B+=d.confidence,S+=Math.abs(k-d.confidence));}return {key:n,total:t.length,accuracyRate:C/t.length,avgConfidence:a.length>0?B/a.length:null,calibrationScore:a.length>0?1-S/a.length:null,verdictBreakdown:v}}).sort((n,t)=>t.total-n.total);}if(r.json){console.log(JSON.stringify({totalAssessed:c,totalWithConfidence:f,accuracyRate:Math.round(y*1e3)/1e3,avgConfidence:m!=null?Math.round(m*1e3)/1e3:null,calibrationScore:s!=null?Math.round(s*1e3)/1e3:null,verdictBreakdown:l,...i?{groups:i}:{}},null,2));return}let w=c<5?o.gray(` (Low sample: N=${c}. Stats may not be representative.)`):c<15?o.gray(` (Moderate sample: N=${c}. Trends are directional.)`):"";console.log(o.magenta(`
5
+ Calibration Report (${c} assessed entries)
6
+ `)),w&&console.log(w+`
7
+ `);let g=c;console.log(o.white(" Verdicts:")),console.log(` ${o.green("correct")}: ${l.correct}/${g} (${(l.correct/g*100).toFixed(0)}%)`),console.log(` ${o.yellow("partial")}: ${l.partial}/${g} (${(l.partial/g*100).toFixed(0)}%)`),console.log(` ${o.red("incorrect")}: ${l.incorrect}/${g} (${(l.incorrect/g*100).toFixed(0)}%)`),console.log(),console.log(o.white(" Scores:"));let M=y>=.8?o.green:y>=.5?o.yellow:o.red;if(console.log(` Accuracy rate: ${M(y.toFixed(3))}`),m!=null&&console.log(` Avg confidence: ${m.toFixed(3)}`),s!=null){let e=s>=.9?o.green:s>=.7?o.yellow:o.red;console.log(` Calibration: ${e(s.toFixed(3))} (1.0 = perfect)`);}if(console.log(),i&&i.length>0){console.log(o.white(` By ${r.groupBy}:`));for(let e of i.slice(0,15)){let n=e.accuracyRate>=.8?o.green:e.accuracyRate>=.5?o.yellow:o.red,t=e.calibrationScore!=null?` cal:${e.calibrationScore.toFixed(2)}`:"";console.log(` ${o.cyan(e.key.padEnd(25))} ${n(`acc:${e.accuracyRate.toFixed(2)}`)}${t} (${e.verdictBreakdown.correct}/${e.verdictBreakdown.partial}/${e.verdictBreakdown.incorrect}) N=${e.total}`);}console.log();}}export{L as loreCalibrationCommand};
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import'./chunk-5TAVYPOV.js';import*as o from'fs';import*as r from'path';import*as V from'os';import {exec}from'child_process';import n from'chalk';function m(t,s={}){return new Promise((a,c)=>{exec(t,{timeout:s.timeout||5e3,cwd:s.cwd},(i,e)=>{if(i)return c(i);a(e.trim());});})}function j(t){try{return o.existsSync(t)?JSON.parse(o.readFileSync(t,"utf8")):null}catch{return null}}function R(){let t=[],s=r.join(V.homedir(),".claude","plugins"),a=r.join(s,"marketplaces"),c=r.join(s,"cache");if(!o.existsSync(a))return t;let i;try{i=o.readdirSync(a).filter(e=>{let l=r.join(a,e);return o.statSync(l).isDirectory()&&o.existsSync(r.join(l,".git"))});}catch{return t}for(let e of i){let l=r.join(a,e),u=r.join(l,"plugins");if(!o.existsSync(u))continue;let y;try{y=o.readdirSync(u).filter(d=>o.statSync(r.join(u,d)).isDirectory());}catch{continue}for(let d of y){let b=r.join(u,d,".claude-plugin","plugin.json"),k=j(b);if(!k)continue;let D=k.version||"unknown",h=r.join(c,e,d),S="unknown";if(o.existsSync(h))try{let f=o.readdirSync(h).filter(g=>o.statSync(r.join(h,g)).isDirectory()).sort((g,v)=>{let P=g.split(".").map(Number),C=v.split(".").map(Number);for(let p=0;p<3;p++)if((P[p]||0)!==(C[p]||0))return (P[p]||0)-(C[p]||0);return 0}).reverse();f.length>0&&(S=f[0]);}catch{}let w=e;try{let g=o.readFileSync(r.join(l,".git","config"),"utf8").match(/github\.com[:/]([^/]+\/[^/\s.]+)/);g&&(w=g[1].replace(/\.git$/,""));}catch{}t.push({repo:w,plugin:d,installedVersion:S,marketplacePath:l,localVersion:D});}}return t}async function U(t){let s=null,a="unknown";try{a=await m("git rev-parse HEAD",{cwd:t.marketplacePath});}catch{}try{let l=(await m("git ls-remote origin HEAD",{cwd:t.marketplacePath,timeout:5e3})).match(/^([a-f0-9]+)/);l&&(s=l[1]);}catch{}let c=s!==null&&s!==a,i=t.localVersion!==t.installedVersion&&t.installedVersion!=="unknown";return {repo:t.repo,plugin:t.plugin,installedVersion:t.installedVersion,localVersion:t.localVersion,remoteSha:s,localSha:a,marketplacePath:t.marketplacePath,hasRemoteUpdate:c,hasCacheStale:i}}async function N(t={}){console.log(n.blue(`
3
+ Plugin Update Check
4
+ `));let s=R();if(s.length===0){console.log(n.gray("No Claude Code plugins found in ~/.claude/plugins/marketplaces/")),console.log(n.gray(`Install plugins with: /plugin marketplace add <owner>/<repo>
5
+ `));return}console.log(n.gray(`Checking ${s.length} plugin(s)...
6
+ `));let a=await Promise.all(s.map(e=>U(e))),c=a.filter(e=>e.hasRemoteUpdate||e.hasCacheStale);for(let e of a){let l=e.hasRemoteUpdate?n.yellow("update available"):e.hasCacheStale?n.cyan("restart needed"):n.green("up to date"),u=e.installedVersion!=="unknown"?`${e.installedVersion} \u2192 ${e.localVersion}`:e.localVersion;console.log(` ${n.bold(e.plugin)} ${n.gray(`(${e.repo})`)}`),console.log(` Version: ${u} Status: ${l}`),e.hasRemoteUpdate&&(console.log(n.gray(` Local: ${e.localSha?.slice(0,8)||"?"}`)),console.log(n.gray(` Remote: ${e.remoteSha?.slice(0,8)||"?"}`))),e.remoteSha===null&&console.log(n.gray(" (remote check skipped \u2014 network unavailable)")),console.log();}if(c.length===0){console.log(n.green(`All plugins are up to date.
7
+ `));return}let i=c.filter(e=>e.hasRemoteUpdate);if(t.update&&i.length>0){console.log(n.blue(`Pulling updates...
8
+ `));for(let e of i){process.stdout.write(` ${e.plugin}: `);try{await m("git pull origin main",{cwd:e.marketplacePath,timeout:15e3}),console.log(n.green("updated"));}catch(l){console.log(n.red(`failed \u2014 ${l instanceof Error?l.message:"unknown error"}`));}}console.log(n.yellow(`
9
+ Restart your Claude Code session to apply updates.
10
+ `));}else if(i.length>0){console.log(n.yellow("To pull updates, run:"));for(let e of i)console.log(n.gray(` git -C ${e.marketplacePath} pull origin main`));console.log(n.gray(`
11
+ Or run: paradigm plugin check --update`)),console.log(n.yellow(`
12
+ After updating, restart your Claude Code session.
13
+ `));}else console.log(n.yellow(`Restart your Claude Code session to apply cached updates.
14
+ `));}export{N as pluginCheckCommand};
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ import {a as a$1}from'./chunk-LKAT7IAK.js';import*as i from'fs';import*as a from'path';import*as j from'os';import e from'chalk';import $ from'ora';function A(){let n=j.homedir(),t=a.join(n,".cursor"),s=a.join(process.cwd(),".cursor");return {name:"Cursor",id:"cursor",detected:i.existsSync(t)||i.existsSync(s),configPath:a.join(process.cwd(),".cursor","mcp.json"),configType:"project",instructions:"Restart Cursor to activate MCP"}}function D(){let n=j.homedir(),t,s=false;if(process.platform==="darwin"){let r=a.join(n,"Library","Application Support","Claude");s=i.existsSync(r),t=a.join(r,"claude_desktop_config.json");}else if(process.platform==="win32"){let r=process.env.APPDATA||a.join(n,"AppData","Roaming"),l=a.join(r,"Claude");s=i.existsSync(l),t=a.join(l,"claude_desktop_config.json");}else {let r=a.join(n,".config","Claude");s=i.existsSync(r),t=a.join(r,"claude_desktop_config.json");}return {name:"Claude Desktop",id:"claude-desktop",detected:s,configPath:t,configType:"user",instructions:"Restart Claude Desktop to activate MCP"}}function M(){let n=j.homedir(),t=a.join(n,".continue");return {name:"Continue (VS Code)",id:"continue",detected:i.existsSync(t),configPath:a.join(t,"config.json"),configType:"user",instructions:"Restart VS Code to activate MCP"}}function I(){let n=a.join(process.cwd(),".mcp.json"),t=a.join(process.cwd(),".claude");return {name:"Claude Code",id:"claude-code",detected:i.existsSync(n)||i.existsSync(t),configPath:n,configType:"project",instructions:"Restart Claude Code session to activate MCP"}}function N(){let n=a.join(process.cwd(),".cline");return {name:"Cline (VS Code)",id:"cline",detected:i.existsSync(n),configPath:a.join(process.cwd(),".cline","mcp.json"),configType:"project",instructions:"Restart VS Code to activate MCP"}}function x(){return [A(),I(),D(),M(),N()]}function R(n,t,s){let r=s.toLowerCase().replace(/[^a-z0-9-]/g,"-");return n.id==="continue"?{experimental:{modelContextProtocolServers:[{transport:{type:"stdio",command:"paradigm-mcp",args:["."],cwd:t}}]}}:{mcpServers:{[r]:{command:"paradigm-mcp",args:["."],cwd:t}}}}function T(n,t,s){if(s.id==="continue"){let r=n?.experimental?.modelContextProtocolServers||[],l=t?.experimental?.modelContextProtocolServers||[];return {...n,experimental:{...n?.experimental,modelContextProtocolServers:[...r,...l]}}}return {...n,mcpServers:{...n?.mcpServers,...t?.mcpServers}}}function O(n,t,s){let r=a.dirname(n.configPath);i.existsSync(r)||(i.mkdirSync(r,{recursive:true}),a$1.component("mcp-config").debug("Created config directory",{path:r}));let l=t;if(i.existsSync(n.configPath)&&!s)try{let g=i.readFileSync(n.configPath,"utf8"),c=JSON.parse(g);l=T(c,t,n),a$1.component("mcp-config").debug("Merged with existing config",{client:n.id});}catch{a$1.component("mcp-config").warn("Could not parse existing config, using new",{client:n.id});}return i.writeFileSync(n.configPath,JSON.stringify(l,null,2)+`
3
+ `),a$1.component("mcp-config").success("Config written",{client:n.id,path:n.configPath}),{success:true,message:`Config written to ${n.configPath}`}}function F(n){let t=a.join(process.cwd(),".gitignore"),s=a.relative(process.cwd(),n),r="";if(i.existsSync(t)&&(r=i.readFileSync(t,"utf8"),r.includes(s)||r.includes(a.dirname(s))))return false;let l=`
4
+ # MCP config (contains local paths)
5
+ ${s}
6
+ `;return i.appendFileSync(t,l),true}function b(){let n=a.join(process.cwd(),".paradigm","config.yaml");if(i.existsSync(n)){let s=i.readFileSync(n,"utf8").match(/project:\s*["']?([^"'\n]+)["']?/);if(s)return s[1].trim()}return a.basename(process.cwd())}async function q(n){let t=$(),s=process.cwd(),r=b();console.log(e.blue(`
7
+ \u{1F50C} Paradigm MCP Setup
8
+ `)),i.existsSync(a.join(s,".paradigm"))||i.existsSync(a.join(s,".purpose"))||(console.log(e.yellow("\u26A0\uFE0F No .paradigm/ or .purpose file found.")),console.log(e.gray(" MCP will work, but you should run `paradigm init` first for full functionality.\n"))),t.start("Detecting AI clients...");let g=x(),c=g.filter(o=>o.detected);t.stop(),console.log(e.gray(`Detected AI clients:
9
+ `));for(let o of g){let f=o.detected?e.green("\u2713"):e.gray("\u25CB"),u=o.detected?o.name:e.gray(o.name),d=o.detected?e.gray(o.configType==="project"?"(project-level)":"(user-level)"):e.gray("(not found)");console.log(` ${f} ${u} ${d}`);}if(console.log(),c.length===0){console.log(e.yellow(`No supported AI clients detected.
10
+ `)),console.log(e.gray("Supported clients:")),console.log(e.gray(" - Cursor (https://cursor.sh)")),console.log(e.gray(" - Claude Desktop (https://claude.ai/download)")),console.log(e.gray(" - Continue for VS Code")),console.log(e.gray(` - Cline for VS Code
11
+ `)),console.log(e.gray(`Install one of these clients and run this command again.
12
+ `));return}let p=[];if(n.client)if(n.client==="all")p=c;else {let o=g.find(f=>f.id===n.client);if(!o){console.log(e.red(`Unknown client: ${n.client}`)),console.log(e.gray(`Available: ${g.map(f=>f.id).join(", ")}
13
+ `));return}o.detected||(console.log(e.yellow(`${o.name} not detected on this system.`)),console.log(e.gray(`Proceeding anyway...
14
+ `))),p=[o];}else if(c.length===1)p=c;else {console.log(e.cyan(`Multiple clients detected. Specify which to configure:
15
+ `)),console.log(e.white(" paradigm mcp setup --client=cursor")),console.log(e.white(" paradigm mcp setup --client=claude-desktop")),console.log(e.white(" paradigm mcp setup --client=all")),console.log();return}for(let o of p){t.start(`Configuring ${o.name}...`);let f=a$1.operation(`mcp-setup-${o.id}`).start("Configuring MCP",{client:o.id}),u=R(o,s,r),d=O(o,u,n.force||false);d.success?(t.succeed(`${o.name} configured`),f.success("MCP configured",{client:o.id,path:o.configPath}),console.log(e.gray(` \u2192 ${o.configPath}`)),o.configType==="project"&&n.gitignore!==false&&F(o.configPath)&&(console.log(e.gray(" \u2192 Added to .gitignore")),a$1.component("gitignore").debug("Added MCP config to .gitignore",{path:o.configPath}))):(t.fail(`Failed to configure ${o.name}: ${d.message}`),f.error("MCP configuration failed",{client:o.id,message:d.message}));}if(console.log(e.green(`
16
+ \u2713 MCP setup complete!
17
+ `)),console.log(e.cyan("Next steps:")),[...new Set(p.map(o=>o.instructions))].forEach(o=>{console.log(e.gray(` \u2022 ${o}`));}),console.log(e.gray(`
18
+ Then try asking your AI:`)),console.log(e.white(` "What features are in the ${r} project?"`)),console.log(e.white(' "What would break if I changed @feature-name?"')),console.log(),n.json){let o={project:r,path:s,configured:p.map(f=>({client:f.id,name:f.name,configPath:f.configPath,configType:f.configType}))};console.log(JSON.stringify(o,null,2));}}async function z(n){console.log(e.blue(`
19
+ \u{1F50C} Paradigm MCP Status
20
+ `));let t=x(),s=[];for(let r of t){let l=false,g=[];if(i.existsSync(r.configPath))try{let m=i.readFileSync(r.configPath,"utf8"),o=JSON.parse(m);if(r.id==="continue"){let f=o?.experimental?.modelContextProtocolServers||[];l=f.length>0,g=f.map((u,d)=>`server-${d+1}`);}else {let f=o?.mcpServers||{};l=Object.keys(f).length>0,g=Object.keys(f);}}catch{}let c=r.detected?l?e.green("\u2713"):e.yellow("\u25CB"):e.gray("\u25CB"),p=l?e.green("configured"):r.detected?e.yellow("not configured"):e.gray("not detected");console.log(` ${c} ${r.name}: ${p}`),l&&g.length>0&&console.log(e.gray(` Servers: ${g.join(", ")}`)),s.push({client:r.id,configured:l,path:r.configPath,servers:l?g:void 0});}console.log(),n.json&&console.log(JSON.stringify(s,null,2));}function J(n){if(!i.existsSync(n.configPath))return [];try{let t=i.readFileSync(n.configPath,"utf8"),s=JSON.parse(t);if(n.id==="continue")return (s?.experimental?.modelContextProtocolServers||[]).map((l,g)=>{let c=l?.transport;return {name:`server-${g+1}`,cwd:c?.cwd||"unknown",command:c?.command||"unknown",args:c?.args||[]}});{let r=s?.mcpServers||{};return Object.entries(r).map(([l,g])=>{let c=g;return {name:l,cwd:c?.cwd||"unknown",command:c?.command||"unknown",args:c?.args||[]}})}}catch{return []}}async function W(n){console.log(e.blue(`
21
+ \u{1F50C} Configured MCP Servers
22
+ `));let t=x(),s=process.cwd(),r=[],l=0;for(let g of t){let c=J(g);if(r.push({client:g,servers:c}),c.length===0)continue;l+=c.length;let p=g.configType==="project"?"this project":"user-level";console.log(e.cyan(`${g.name} (${p}):`));for(let m of c){let o=m.cwd===s,f=o?e.green("\u25CF"):e.gray("\u25CB"),u=o?e.green(m.name):e.white(m.name),d=o?e.green("(current)"):e.gray(m.cwd);console.log(` ${f} ${u.padEnd(20)} \u2192 ${d}`);}console.log();}if(l===0?(console.log(e.yellow(`No MCP servers configured.
23
+ `)),console.log(e.gray("Run `paradigm mcp setup` to configure MCP for your AI clients.\n"))):console.log(e.gray(`Total: ${l} server(s) across ${r.filter(g=>g.servers.length>0).length} client(s)
24
+ `)),n.json){let g=r.map(c=>({client:c.client.id,name:c.client.name,configType:c.client.configType,configPath:c.client.configPath,servers:c.servers}));console.log(JSON.stringify(g,null,2));}}async function B(n,t){let s=$(),r=process.cwd(),g=b().toLowerCase().replace(/[^a-z0-9-]/g,"-"),c=n||g;console.log(e.blue(`
25
+ \u{1F50C} Paradigm MCP Remove
26
+ `));let p=x(),m=[];if(t.client)if(t.client==="all")m=p;else {let d=p.find(y=>y.id===t.client);if(!d){console.log(e.red(`Unknown client: ${t.client}`)),console.log(e.gray(`Available: ${p.map(y=>y.id).join(", ")}
27
+ `));return}m=[d];}else m=p;let o=0,f=0,u=[];for(let d of m)if(i.existsSync(d.configPath)){s.start(`Checking ${d.name}...`);try{let y=i.readFileSync(d.configPath,"utf8"),S=JSON.parse(y),w=!1;if(d.id==="continue"){let h=S?.experimental?.modelContextProtocolServers||[],P=h.length,v=h.filter(k=>(k?.transport?.cwd||"")!==r);v.length<P?(S.experimental.modelContextProtocolServers=v,w=!0,o++,u.push({client:d.id,removed:!0,serverName:"server (by path)"})):(f++,u.push({client:d.id,removed:!1,serverName:c}));}else {let h=S?.mcpServers||{};if(h[c])delete h[c],S.mcpServers=h,w=!0,o++,u.push({client:d.id,removed:!0,serverName:c});else {let P=!1;for(let[v,k]of Object.entries(h))if(k?.cwd===r){delete h[v],S.mcpServers=h,w=!0,o++,P=!0,u.push({client:d.id,removed:!0,serverName:v});break}P||(f++,u.push({client:d.id,removed:!1,serverName:c}));}}w?(i.writeFileSync(d.configPath,JSON.stringify(S,null,2)+`
28
+ `),s.succeed(`Removed from ${d.name}`)):s.info(`${d.name}: Server "${c}" not found`);}catch{s.fail(`Error reading ${d.name} config`);}}console.log(),o>0?(console.log(e.green(`\u2713 Removed from ${o} client(s)
29
+ `)),console.log(e.gray(`Remember to restart your AI client(s) for changes to take effect.
30
+ `))):(console.log(e.yellow(`Server "${c}" not found in any client config.
31
+ `)),console.log(e.gray("Use `paradigm mcp list` to see all configured servers.\n"))),t.json&&console.log(JSON.stringify({targetServer:c,projectPath:r,results:u},null,2));}export{x as a,R as b,O as c,b as d,q as e,z as f,J as g,W as h,B as i};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import*as l from'fs';import*as u from'path';import*as S from'os';import*as T from'crypto';import*as d from'js-yaml';var P={architect:{style:"deliberate",risk:"conservative",verbosity:"detailed"},builder:{style:"rapid",risk:"balanced",verbosity:"concise"},tester:{style:"methodical",risk:"conservative",verbosity:"concise"},reviewer:{style:"deliberate",risk:"conservative",verbosity:"detailed"},security:{style:"methodical",risk:"conservative",verbosity:"detailed"},documentor:{style:"methodical",risk:"conservative",verbosity:"concise"}},v={architect:{symbols:["$*","#*"],concepts:["architecture","design","pattern","refactor"],signals:[{type:"flow-modified"},{type:"compliance-violation"}],threshold:.5},builder:{paths:["src/**","lib/**","packages/**"],signals:[{type:"file-modified"},{type:"error-encountered"}],threshold:.7},reviewer:{concepts:["code quality","bug","smell","convention"],signals:[{type:"compliance-violation"}],threshold:.6},tester:{paths:["**/*.test.*","**/*.spec.*"],concepts:["test","coverage","assertion"],signals:[{type:"error-encountered"},{type:"test-result"}],threshold:.5},security:{symbols:["^*","#*-auth","#*-middleware"],paths:["auth/**","middleware/**","guards/**"],concepts:["permission","JWT","session","RBAC","XSS","injection"],signals:[{type:"gate-added"},{type:"route-created"},{type:"gate-checked"},{type:"compliance-violation"}],threshold:.4},documentor:{paths:["**/.purpose","**/portal.yaml",".paradigm/**"],concepts:["purpose","portal","symbol","documentation","component","gate","flow"],signals:[{type:"file-modified"},{type:"compliance-violation"},{type:"work-completed"}],threshold:.3}},w={architect:{stance:"lead",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},builder:{stance:"supportive",with:{architect:{stance:"supportive",can_contradict:false}}},reviewer:{stance:"advisory",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},tester:{stance:"supportive",debate:{will_challenge:false,evidence_required:true,escalate_to_human:false}},security:{stance:"advisory",with:{architect:{stance:"peer",can_contradict:true},builder:{stance:"advisory",review_output:true}},debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},documentor:{stance:"supportive",with:{architect:{stance:"supportive"},builder:{stance:"supportive"},reviewer:{stance:"supportive"},security:{stance:"supportive"}},debate:{will_challenge:false,evidence_required:false,escalate_to_human:false}}};var y=u.join(S.homedir(),".paradigm","agents"),x=".paradigm/agents",h=".agent",E=".paradigm/roster.yaml",b=.3,L=60,$=7,N=.2;function m(e,t){let o=(Date.now()-new Date(t).getTime())/(1e3*60*60*24);if(o<=$)return e;let r=Math.pow(.5,(o-$)/L);return e*r}function F(e){let t=u.join(e,E);if(!l.existsSync(t))return null;try{return d.load(l.readFileSync(t,"utf8"))?.active??null}catch{return null}}function W(e,t){let i=F(t);return i?i.includes(e):true}function U(e,t){let i=u.join(e,E),o=u.dirname(i);l.existsSync(o)||l.mkdirSync(o,{recursive:true});let r={version:"1.0",active:t.sort()};l.writeFileSync(i,d.dump(r,{lineWidth:-1,noRefs:true}),"utf8");}function H(){if(!l.existsSync(y))return [];try{return l.readdirSync(y).filter(e=>e.endsWith(h)).map(e=>e.replace(h,""))}catch{return []}}function j(e,t){let i=u.join(e,x,`${t}${h}`);if(l.existsSync(i))try{let r=l.readFileSync(i,"utf-8");return d.load(r)}catch{}let o=u.join(y,`${t}${h}`);if(l.existsSync(o))try{let r=l.readFileSync(o,"utf-8"),n=d.load(r);if(l.existsSync(i))try{let a=l.readFileSync(i,"utf-8"),f=d.load(a);return R(n,f)}catch{}return n}catch{}return null}function O(e){let t=new Map;if(l.existsSync(y))try{let o=l.readdirSync(y).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(y,r),"utf-8"),a=d.load(n);a?.id&&t.set(a.id,a);}catch{}}catch{}let i=u.join(e,x);if(l.existsSync(i))try{let o=l.readdirSync(i).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(i,r),"utf-8"),a=d.load(n);if(!a?.id)continue;let f=t.get(a.id);f?t.set(a.id,R(f,a)):t.set(a.id,a);}catch{}}catch{}return Array.from(t.values())}function A(e,t,i,o){let r=i==="global"?y:u.join(o||process.cwd(),x);l.existsSync(r)||l.mkdirSync(r,{recursive:true});let n=u.join(r,`${e}${h}`);t.permissions&&(t.integrityHash=k(t)),t.updated=new Date().toISOString();let a=d.dump(t,{lineWidth:120,noRefs:true,sortKeys:false});return l.writeFileSync(n,a,"utf-8"),n}function D(e,t={}){let i=new Date().toISOString(),o={id:e,role:t.role||`${e.charAt(0).toUpperCase()+e.slice(1)} agent`,description:t.description||`Persistent identity for the ${e} agent role`,version:"1.0.0",personality:P[e]||{style:"balanced",risk:"balanced",verbosity:"concise"},expertise:[],transferable:[],contexts:{},created:i,updated:i};P[e]||(o.personality={style:"deliberate",risk:"balanced",verbosity:"concise"}),v[e]&&(o.attention={...v[e]}),w[e]&&(o.collaboration={...w[e]});let r=t.scope||"global",n=A(e,o,r,t.rootDir);return {profile:o,filePath:n}}function G(e,t){let i=O(e),o=[];for(let r of i){let n=(r.expertise||[]).find(a=>a.symbol===t);n&&o.push({agentId:r.id,entry:n});}return o.sort((r,n)=>m(n.entry.confidence,n.entry.lastTouch)-m(r.entry.confidence,r.entry.lastTouch))}function Y(e,t,i){let o=j(e,t);if(!o)return false;let r=new Date().toISOString(),n=o.expertise||[];for(let c of i.symbols_touched){let p=n.find(g=>g.symbol===c);p?(p.sessions++,p.lastTouch=r,i.confidence!=null&&(p.confidence=(1-b)*p.confidence+b*i.confidence)):n.push({symbol:c,confidence:i.confidence??.5,sessions:1,lastTouch:r});}o.expertise=n;let a=I(e);if(a){let c=o.contexts[a]||{focus:[],sessionsInProject:0};c.lastActive=r,c.sessionsInProject=(c.sessionsInProject||0)+1,o.contexts[a]=c;}let f=u.join(e,x,`${t}${h}`),s=l.existsSync(f)?"project":"global";return A(t,o,s,e),true}function J(e,t,i){let o=j(e,t);if(!o)return false;let n={correct:1,partial:.5,incorrect:0}[i.verdict];for(let s of i.symbols_touched){let c=(o.expertise||[]).find(p=>p.symbol===s);c&&(c.confidence=(1-b)*c.confidence+b*n);}let a=u.join(e,x,`${t}${h}`),f=l.existsSync(a)?"project":"global";return A(t,o,f,e),true}function B(e,t,i){return t?{personality:t.personality||null,topExpertise:(t.expertise||[]).sort((o,r)=>m(r.confidence,r.lastTouch)-m(o.confidence,o.lastTouch)).slice(0,10),projectContext:t.contexts?.[i]||null,transferablePatterns:(t.transferable||[]).filter(o=>o.successRate>=.7).map(o=>({id:o.id,description:o.description,successRate:o.successRate}))}:{personality:null,topExpertise:[],projectContext:null,transferablePatterns:[]}}function z(e,t,i,o,r){let n=[];if(e.personality){let s=e.personality;n.push(`## Agent Identity: ${e.id}`),n.push(`**Style:** ${s.style} | **Risk:** ${s.risk} | **Verbosity:** ${s.verbosity}`),n.push("");}let a=(e.expertise||[]).filter(s=>t.length===0||t.includes(s.symbol)).sort((s,c)=>m(c.confidence,c.lastTouch)-m(s.confidence,s.lastTouch)).slice(0,8);if(a.length>0){n.push("## Your Expertise on Relevant Symbols");for(let s of a){let p=1-m(s.confidence,s.lastTouch)/s.confidence,g=s.confidence>0&&p>N?" (aging)":"";n.push(`- \`${s.symbol}\`: confidence ${s.confidence.toFixed(2)} (${s.sessions} sessions)${g}`);}n.push("");}let f=(e.transferable||[]).filter(s=>s.successRate>=.7);if(f.length>0){n.push("## Transferable Patterns");for(let s of f){let c=s.appliedIn?.length||0;n.push(`- ${s.id}: ${(s.successRate*100).toFixed(0)}% success (learned in ${s.learnedIn}${c>0?`, applied in ${c} projects`:""})`);}n.push("");}if(i&&i.length>0){n.push("## Relevant Notebook Entries");for(let s of i.slice(0,5)){n.push(`### ${s.context}`),n.push(`Concepts: ${s.concepts.join(", ")}`),n.push("```");let c=s.snippet.length>300?s.snippet.slice(0,300)+"...":s.snippet;n.push(c),n.push("```"),n.push("");}}if(r){if(n.push(""),n.push("## Your Recent Work on This Project"),r.lastSession){let s=Date.now()-new Date(r.lastSession.date).getTime(),c=Math.floor(s/(3600*1e3)),p=c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`;n.push(`Last session (${p}): ${r.lastSession.summary}`);}if(r.sessionsOnProject&&n.push(`Sessions on this project: ${r.sessionsOnProject}`),r.pendingWork?.length){n.push("**Pending from last session:**");for(let s of r.pendingWork.slice(0,5))n.push(`- ${s}`);}if(r.recentPatterns?.length){n.push("**Project patterns you've learned:**");for(let s of r.recentPatterns.slice(0,5))n.push(`- ${s}`);}n.push("");}if(e.attention){let s=e.attention,c=[];s.symbols?.length&&c.push(`Symbols: ${s.symbols.join(", ")}`),s.paths?.length&&c.push(`Paths: ${s.paths.join(", ")}`),s.concepts?.length&&c.push(`Concepts: ${s.concepts.join(", ")}`),s.signals?.length&&c.push(`Signals: ${s.signals.map(p=>p.type).join(", ")}`),c.length>0&&(n.push(""),n.push("### Attention"),n.push(`Threshold: ${s.threshold??.6}`),n.push(c.join(" | ")));}if(e.collaboration){let s=e.collaboration;if(n.push(""),n.push("### Collaboration"),n.push(`Default stance: ${s.stance||"supportive"}`),s.with)for(let[c,p]of Object.entries(s.with)){let g=[`${c}: ${p.stance||"peer"}`];p.can_contradict&&g.push("can contradict"),p.review_output&&g.push("reviews output"),n.push(`- ${g.join(", ")}`);}if(s.debate){let c=s.debate,p=[];c.will_challenge&&p.push("challenges"),c.evidence_required&&p.push("evidence-based"),c.escalate_to_human&&p.push("escalates to human"),p.length&&n.push(`Debate: ${p.join(", ")}`);}}if(e.nomination){let s=e.nomination;if(n.push(""),n.push("### Nomination"),s.speak_when?.urgency?.length&&n.push(`Always speaks on: ${s.speak_when.urgency.join(", ")}`),s.contribution_style){let c=[];s.contribution_style.brief_first&&c.push("brief first"),s.contribution_style.cite_sources&&c.push("cites sources"),s.contribution_style.offer_action&&c.push("offers action"),c.length&&n.push(`Style: ${c.join(", ")}`);}}if(o){if(o.recentDecisions?.length){n.push(""),n.push("## Recent Team Decisions");for(let s of o.recentDecisions.slice(0,5))n.push(`- **${s.title}**: ${s.decision.slice(0,150)}${s.decision.length>150?"...":""}`);}if(o.journalInsights?.length){n.push(""),n.push("## Transferable Insights");for(let s of o.journalInsights.slice(0,5))n.push(`- [${s.trigger}] ${s.insight.slice(0,150)}${s.insight.length>150?"...":""}`);}if(o.pendingNominations?.length){n.push(""),n.push("## Pending Nominations");for(let s of o.pendingNominations.slice(0,10))n.push(`- [${s.urgency}] ${s.brief}`);}}return n.join(`
3
+ `)}async function X(e,t,i=false){let{loadLoreEntries:o}=await import('./lore-loader-XY5MZRR2.js'),r=await o(e,{limit:500}),n=0,a=new Set,f=j(e,t)||D(t,{rootDir:e}).profile,s=f.expertise||[];for(let c of r)if(!(!c.symbols_touched||c.symbols_touched.length===0)){n++;for(let p of c.symbols_touched){a.add(p);let g=s.find(C=>C.symbol===p);g?(g.sessions++,g.lastTouch=c.timestamp,c.confidence!=null&&(g.confidence=(1-b)*g.confidence+b*c.confidence)):s.push({symbol:p,confidence:c.confidence??.5,sessions:1,lastTouch:c.timestamp});}}if(f.expertise=s,!i){let c=u.join(e,x,`${t}${h}`),p=l.existsSync(c)?"project":"global";A(t,f,p,e);}return {entriesProcessed:n,symbolsUpdated:a.size}}function K(e,t,i){if(!e.permissions?.paths)return {allowed:true};let{read:o,write:r,deny:n}=e.permissions.paths;if(n&&n.length>0){for(let f of n)if(_(f,t))return {allowed:false,reason:`Path denied by pattern: ${f}`}}let a=i==="read"?o:r;if(a&&a.length>0){for(let f of a)if(_(f,t))return {allowed:true};return {allowed:false,reason:`No ${i} pattern matches: ${t}`}}return {allowed:true}}function V(e,t){if(!e.permissions?.tools)return {allowed:true};let{allow:i,deny:o}=e.permissions.tools;if(o&&o.length>0){for(let r of o)if(_(r,t))return {allowed:false,reason:`Tool denied by pattern: ${r}`}}if(i&&i.length>0){for(let r of i)if(_(r,t))return {allowed:true};return {allowed:false,reason:`Tool not in allow list: ${t}`}}return {allowed:true}}function k(e){let t=JSON.stringify({id:e.id,role:e.role,permissions:e.permissions||null});return T.createHash("sha256").update(t).digest("hex")}function Q(e){return e.integrityHash?k(e)===e.integrityHash?{valid:true}:{valid:false,reason:"Integrity hash mismatch \u2014 profile may have been tampered with"}:{valid:true,reason:"No integrity hash stored (pre-4.0 profile)"}}function _(e,t){let i=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(t)}function R(e,t){let i={...e};if(t.role&&(i.role=t.role),t.description&&(i.description=t.description),t.version&&(i.version=t.version),t.personality&&(i.personality={...e.personality,...t.personality}),t.expertise){let o=new Map(e.expertise.map(r=>[r.symbol,r]));for(let r of t.expertise)o.set(r.symbol,r);i.expertise=Array.from(o.values());}if(t.transferable){let o=new Map(e.transferable.map(r=>[r.id,r]));for(let r of t.transferable)o.set(r.id,r);i.transferable=Array.from(o.values());}if(t.contexts){i.contexts={...e.contexts};for(let[o,r]of Object.entries(t.contexts))i.contexts[o]={...i.contexts[o],...r};}return i}function I(e){try{let t=u.join(e,".paradigm","config.yaml");if(l.existsSync(t)){let i=l.readFileSync(t,"utf-8"),o=d.load(i);if(o?.project&&typeof o.project=="string")return o.project}}catch{}return u.basename(e)}export{m as a,F as b,W as c,U as d,H as e,j as f,O as g,A as h,D as i,G as j,Y as k,J as l,B as m,z as n,X as o,K as p,V as q,k as r,Q as s};