@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
@@ -1,1136 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- init_agent_loader,
4
- loadAgentProfile,
5
- loadAllAgentProfiles,
6
- saveAgentProfile
7
- } from "./chunk-RJE5G7WO.js";
8
- import {
9
- init_journal_loader,
10
- journal_loader_exports
11
- } from "./chunk-MCMOGQMU.js";
12
- import {
13
- __esm,
14
- __export,
15
- __require,
16
- __toCommonJS
17
- } from "./chunk-7N7GSU6K.js";
18
-
19
- // ../paradigm-mcp/src/utils/event-stream.ts
20
- import * as fs from "fs";
21
- import * as path from "path";
22
- function getStreamPath(rootDir) {
23
- return path.join(rootDir, EVENTS_DIR, STREAM_FILE);
24
- }
25
- function generateEventId() {
26
- const now = Date.now();
27
- const rand = Math.floor(Math.random() * 9999).toString().padStart(4, "0");
28
- return `ev-${now}-${rand}`;
29
- }
30
- function emitEvent(rootDir, event) {
31
- const full = {
32
- id: generateEventId(),
33
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
34
- ...event
35
- };
36
- memoryStream.push(full);
37
- if (memoryStream.length > DEFAULT_MAX_EVENTS) {
38
- memoryStream = memoryStream.slice(-DEFAULT_MAX_EVENTS);
39
- }
40
- try {
41
- const dir = path.join(rootDir, EVENTS_DIR);
42
- fs.mkdirSync(dir, { recursive: true });
43
- const streamPath = getStreamPath(rootDir);
44
- fs.appendFileSync(streamPath, JSON.stringify(full) + "\n", "utf8");
45
- pruneIfNeeded(streamPath);
46
- } catch {
47
- }
48
- return full;
49
- }
50
- function pruneIfNeeded(streamPath) {
51
- try {
52
- const stat = fs.statSync(streamPath);
53
- if (stat.size > 512 * 1024) {
54
- const content = fs.readFileSync(streamPath, "utf8");
55
- const lines = content.trim().split("\n");
56
- if (lines.length > DEFAULT_MAX_EVENTS) {
57
- const kept = lines.slice(-DEFAULT_MAX_EVENTS);
58
- fs.writeFileSync(streamPath, kept.join("\n") + "\n", "utf8");
59
- }
60
- }
61
- } catch {
62
- }
63
- }
64
- function queryEvents(rootDir, opts) {
65
- let events = loadEventsFromDisk(rootDir);
66
- if (opts?.type) events = events.filter((e) => e.type === opts.type);
67
- if (opts?.source) events = events.filter((e) => e.source === opts.source);
68
- if (opts?.symbol) events = events.filter((e) => e.symbols?.includes(opts.symbol));
69
- if (opts?.agent) events = events.filter((e) => e.agent === opts.agent);
70
- if (opts?.since) events = events.filter((e) => e.timestamp >= opts.since);
71
- events.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
72
- if (opts?.limit) events = events.slice(0, opts.limit);
73
- return events;
74
- }
75
- function loadEventsFromDisk(rootDir) {
76
- const streamPath = getStreamPath(rootDir);
77
- if (!fs.existsSync(streamPath)) return [...memoryStream];
78
- try {
79
- const content = fs.readFileSync(streamPath, "utf8");
80
- const events = content.trim().split("\n").filter((line) => line.trim()).map((line) => {
81
- try {
82
- return JSON.parse(line);
83
- } catch {
84
- return null;
85
- }
86
- }).filter((e) => e !== null);
87
- return events;
88
- } catch {
89
- return [...memoryStream];
90
- }
91
- }
92
- function scoreEventForAgent(event, agentId, attention) {
93
- let symbolMatch = 0;
94
- let pathMatch = 0;
95
- let conceptMatch = 0;
96
- let signalMatch = 0;
97
- if (attention.symbols?.length && event.symbols?.length) {
98
- for (const pattern of attention.symbols) {
99
- for (const symbol of event.symbols) {
100
- if (matchGlob(pattern, symbol)) {
101
- symbolMatch = Math.max(symbolMatch, 1);
102
- }
103
- }
104
- }
105
- }
106
- if (attention.paths?.length && event.path) {
107
- for (const pattern of attention.paths) {
108
- if (matchGlob(pattern, event.path)) {
109
- pathMatch = 1;
110
- break;
111
- }
112
- }
113
- }
114
- if (attention.concepts?.length) {
115
- const eventText = [
116
- event.context || "",
117
- ...event.keywords || [],
118
- event.type
119
- ].join(" ").toLowerCase();
120
- let matched = 0;
121
- for (const concept of attention.concepts) {
122
- if (eventText.includes(concept.toLowerCase())) {
123
- matched++;
124
- }
125
- }
126
- if (attention.concepts.length > 0) {
127
- conceptMatch = matched / attention.concepts.length;
128
- }
129
- }
130
- if (attention.signals?.length) {
131
- for (const signal of attention.signals) {
132
- if (signal.type === event.type) {
133
- signalMatch = 1;
134
- break;
135
- }
136
- }
137
- }
138
- const dimensions = [symbolMatch, pathMatch, conceptMatch, signalMatch].sort((a, b) => b - a);
139
- const score = dimensions[0] * 0.5 + dimensions[1] * 0.2 + dimensions[2] * 0.15 + dimensions[3] * 0.15;
140
- const threshold = attention.threshold ?? 0.6;
141
- return {
142
- agentId,
143
- score,
144
- breakdown: { symbolMatch, pathMatch, conceptMatch, signalMatch },
145
- shouldNominate: score >= threshold,
146
- quietReason: score < threshold ? "below-threshold" : void 0
147
- };
148
- }
149
- function matchGlob(pattern, value) {
150
- if (pattern === value) return true;
151
- const regex = pattern.replace(/\*\*/g, "\xA7\xA7").replace(/\*/g, "[^/]*").replace(/§§/g, ".*");
152
- try {
153
- return new RegExp(`^${regex}$`).test(value);
154
- } catch {
155
- return false;
156
- }
157
- }
158
- var EVENTS_DIR, STREAM_FILE, DEFAULT_MAX_EVENTS, memoryStream;
159
- var init_event_stream = __esm({
160
- "../paradigm-mcp/src/utils/event-stream.ts"() {
161
- "use strict";
162
- EVENTS_DIR = ".paradigm/events";
163
- STREAM_FILE = "stream.jsonl";
164
- DEFAULT_MAX_EVENTS = 1e3;
165
- memoryStream = [];
166
- }
167
- });
168
-
169
- // ../paradigm-mcp/src/types/data-policy.ts
170
- var DEFAULT_DATA_POLICY;
171
- var init_data_policy = __esm({
172
- "../paradigm-mcp/src/types/data-policy.ts"() {
173
- "use strict";
174
- DEFAULT_DATA_POLICY = {
175
- version: "1.0",
176
- default_ring: "project-locked",
177
- observation: {
178
- allow: ["src/**", ".paradigm/**", "portal.yaml"],
179
- deny: [".env*", "**/*.key", "**/*.pem", "**/secrets/**"]
180
- },
181
- streams: {
182
- work_log: {
183
- ring: "project-locked",
184
- allow_content: ["file_paths", "symbol_names", "outcome"],
185
- deny_content: ["code_snippets", "file_contents", "diff_content"]
186
- },
187
- learning_journal: {
188
- ring: "user-scoped",
189
- allow_content: ["pattern_descriptions", "confidence_adjustments", "approach_descriptions"],
190
- deny_content: ["code_snippets", "file_contents", "symbol_names_with_context"],
191
- redaction: [
192
- { pattern: "\\b[A-Z_]{2,}_KEY\\b" },
193
- { pattern: "password|secret|token" }
194
- ]
195
- },
196
- team_decisions: {
197
- ring: "project-locked",
198
- allow_content: ["rationale", "alternatives", "symbol_references"],
199
- deny_content: ["implementation_details"]
200
- }
201
- },
202
- upstream: {
203
- ring: "creator-upstream",
204
- allowed: ["task_type", "outcome", "helpfulness", "duration_bucket", "error_category"],
205
- denied: ["code_of_any_kind", "file_paths", "symbol_names", "conversation_content", "user_identity"]
206
- },
207
- network: {
208
- ring: "network-public",
209
- opt_in: false,
210
- if_opted_in: ["aggregated_task_success_rates", "anonymized_pattern_frequency"]
211
- }
212
- };
213
- }
214
- });
215
-
216
- // ../paradigm-mcp/src/utils/data-policy-loader.ts
217
- import * as fs2 from "fs";
218
- import * as path2 from "path";
219
- import * as yaml from "js-yaml";
220
- function loadDataPolicy(rootDir) {
221
- const filePath = path2.join(rootDir, POLICY_FILE);
222
- if (!fs2.existsSync(filePath)) {
223
- return { ...DEFAULT_DATA_POLICY };
224
- }
225
- try {
226
- const content = fs2.readFileSync(filePath, "utf8");
227
- const userPolicy = yaml.load(content);
228
- return mergePolicy(DEFAULT_DATA_POLICY, userPolicy);
229
- } catch {
230
- return { ...DEFAULT_DATA_POLICY };
231
- }
232
- }
233
- function mergePolicy(base, override) {
234
- const merged = { ...base };
235
- if (override.version) merged.version = override.version;
236
- if (override.default_ring) merged.default_ring = override.default_ring;
237
- if (override.observation) {
238
- merged.observation = {
239
- allow: override.observation.allow || base.observation?.allow,
240
- deny: [
241
- ...base.observation?.deny || [],
242
- ...override.observation.deny || []
243
- ].filter((v, i, a) => a.indexOf(v) === i)
244
- // deduplicate
245
- };
246
- }
247
- if (override.streams) {
248
- merged.streams = { ...base.streams };
249
- for (const key of ["work_log", "learning_journal", "team_decisions"]) {
250
- if (override.streams[key]) {
251
- merged.streams[key] = {
252
- ...base.streams?.[key],
253
- ...override.streams[key],
254
- deny_content: [
255
- ...base.streams?.[key]?.deny_content || [],
256
- ...override.streams[key]?.deny_content || []
257
- ].filter((v, i, a) => a.indexOf(v) === i)
258
- };
259
- }
260
- }
261
- }
262
- if (override.upstream) merged.upstream = { ...base.upstream, ...override.upstream };
263
- if (override.network) merged.network = { ...base.network, ...override.network };
264
- if (override.agent_overrides) merged.agent_overrides = { ...base.agent_overrides, ...override.agent_overrides };
265
- if (override.deployment) merged.deployment = { ...base.deployment, ...override.deployment };
266
- return merged;
267
- }
268
- function canObservePath(policy, filePath, agentId) {
269
- if (agentId && policy.agent_overrides?.[agentId]?.observation) {
270
- const agentObs = policy.agent_overrides[agentId].observation;
271
- if (agentObs.deny?.some((p) => matchGlob2(p, filePath))) return false;
272
- }
273
- if (policy.observation?.deny?.some((p) => matchGlob2(p, filePath))) {
274
- return false;
275
- }
276
- if (policy.observation?.allow?.length) {
277
- return policy.observation.allow.some((p) => matchGlob2(p, filePath));
278
- }
279
- return true;
280
- }
281
- function filterContent(content, policy, stream) {
282
- const streamRules = policy.streams?.[stream];
283
- if (!streamRules) return { filtered: content, redacted: [] };
284
- const redacted = [];
285
- let result = content;
286
- if (streamRules.redaction) {
287
- for (const pattern of streamRules.redaction) {
288
- try {
289
- const regex = new RegExp(pattern.pattern, "gi");
290
- const matches = result.match(regex);
291
- if (matches) {
292
- redacted.push(...matches);
293
- result = result.replace(regex, pattern.replacement || "[REDACTED]");
294
- }
295
- } catch {
296
- }
297
- }
298
- }
299
- return { filtered: result, redacted };
300
- }
301
- function matchGlob2(pattern, value) {
302
- if (pattern === value) return true;
303
- const regex = pattern.replace(/\*\*/g, "\xA7\xA7").replace(/\*/g, "[^/]*").replace(/§§/g, ".*");
304
- try {
305
- return new RegExp(`^${regex}$`).test(value);
306
- } catch {
307
- return false;
308
- }
309
- }
310
- var POLICY_FILE;
311
- var init_data_policy_loader = __esm({
312
- "../paradigm-mcp/src/utils/data-policy-loader.ts"() {
313
- "use strict";
314
- init_data_policy();
315
- POLICY_FILE = ".paradigm/data-policy.yaml";
316
- }
317
- });
318
-
319
- // ../paradigm-mcp/src/utils/notebook-loader.ts
320
- var notebook_loader_exports = {};
321
- __export(notebook_loader_exports, {
322
- addNotebookEntry: () => addNotebookEntry,
323
- incrementApplied: () => incrementApplied,
324
- loadNotebookEntries: () => loadNotebookEntries,
325
- promoteFromLore: () => promoteFromLore,
326
- searchNotebooks: () => searchNotebooks
327
- });
328
- import * as fs3 from "fs";
329
- import * as path3 from "path";
330
- import * as os from "os";
331
- import * as yaml2 from "js-yaml";
332
- function loadNotebookEntries(agentId, rootDir, filter) {
333
- const entries = /* @__PURE__ */ new Map();
334
- const globalDir = path3.join(GLOBAL_NOTEBOOKS_DIR, agentId);
335
- loadEntriesFromDir(globalDir, entries);
336
- const projectDir = path3.join(rootDir, PROJECT_NOTEBOOKS_DIR, agentId);
337
- loadEntriesFromDir(projectDir, entries);
338
- let result = Array.from(entries.values());
339
- if (filter?.concepts && filter.concepts.length > 0) {
340
- const conceptSet = new Set(filter.concepts.map((c) => c.toLowerCase()));
341
- result = result.filter(
342
- (e) => e.concepts.some((c) => conceptSet.has(c.toLowerCase()))
343
- );
344
- }
345
- if (filter?.tags && filter.tags.length > 0) {
346
- const tagSet = new Set(filter.tags.map((t) => t.toLowerCase()));
347
- result = result.filter(
348
- (e) => e.tags.some((t) => tagSet.has(t.toLowerCase()))
349
- );
350
- }
351
- return result.sort((a, b) => b.appliedCount - a.appliedCount);
352
- }
353
- function loadEntriesFromDir(dir, entries) {
354
- if (!fs3.existsSync(dir)) return;
355
- try {
356
- const files = fs3.readdirSync(dir).filter(
357
- (f) => f.startsWith(NOTEBOOK_PREFIX) && f.endsWith(NOTEBOOK_EXT)
358
- );
359
- for (const file of files) {
360
- try {
361
- const content = fs3.readFileSync(path3.join(dir, file), "utf-8");
362
- const entry = yaml2.load(content);
363
- if (entry?.id) {
364
- entries.set(entry.id, entry);
365
- }
366
- } catch {
367
- }
368
- }
369
- } catch {
370
- }
371
- }
372
- function searchNotebooks(agentId, query, rootDir) {
373
- const all = loadNotebookEntries(agentId, rootDir);
374
- const q = query.toLowerCase();
375
- return all.filter(
376
- (e) => e.context.toLowerCase().includes(q) || e.snippet.toLowerCase().includes(q) || e.concepts.some((c) => c.toLowerCase().includes(q)) || e.tags.some((t) => t.toLowerCase().includes(q))
377
- );
378
- }
379
- function addNotebookEntry(agentId, entry, scope, rootDir) {
380
- const now = (/* @__PURE__ */ new Date()).toISOString();
381
- const conceptSlug = (entry.concepts[0] || "entry").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
382
- const timestamp = Date.now().toString(36);
383
- const id = `nb-${conceptSlug}-${timestamp}`;
384
- const fullEntry = {
385
- ...entry,
386
- id,
387
- appliedCount: 0,
388
- created: now,
389
- updated: now
390
- };
391
- const dir = scope === "global" ? path3.join(GLOBAL_NOTEBOOKS_DIR, agentId) : path3.join(rootDir || process.cwd(), PROJECT_NOTEBOOKS_DIR, agentId);
392
- if (!fs3.existsSync(dir)) {
393
- fs3.mkdirSync(dir, { recursive: true });
394
- }
395
- const fileName = `${id}${NOTEBOOK_EXT}`;
396
- const filePath = path3.join(dir, fileName);
397
- const content = yaml2.dump(fullEntry, {
398
- lineWidth: 120,
399
- noRefs: true,
400
- sortKeys: false
401
- });
402
- fs3.writeFileSync(filePath, content, "utf-8");
403
- return { entry: fullEntry, filePath };
404
- }
405
- async function promoteFromLore(agentId, loreEntryId, rootDir, scope = "global") {
406
- const { loadLoreEntry } = await import("./lore-loader-7NO6N6FT.js");
407
- const loreEntry = await loadLoreEntry(rootDir, loreEntryId);
408
- if (!loreEntry) return null;
409
- const concepts = [];
410
- if (loreEntry.symbols_touched) {
411
- for (const sym of loreEntry.symbols_touched) {
412
- const clean = sym.replace(/^[#$^!~]/, "").toLowerCase();
413
- concepts.push(clean);
414
- }
415
- }
416
- let snippet = loreEntry.summary || "";
417
- if (loreEntry.body) {
418
- snippet += "\n\n" + loreEntry.body;
419
- }
420
- const provenance = {
421
- source: "lore",
422
- loreEntryId,
423
- originProject: path3.basename(rootDir),
424
- createdBy: agentId
425
- };
426
- return addNotebookEntry(
427
- agentId,
428
- {
429
- context: loreEntry.title || `Promoted from ${loreEntryId}`,
430
- snippet,
431
- provenance,
432
- confidence: loreEntry.confidence ?? 0.7,
433
- concepts,
434
- tags: loreEntry.tags || []
435
- },
436
- scope,
437
- rootDir
438
- );
439
- }
440
- function incrementApplied(agentId, entryId, rootDir) {
441
- const projectDir = path3.join(rootDir, PROJECT_NOTEBOOKS_DIR, agentId);
442
- const globalDir = path3.join(GLOBAL_NOTEBOOKS_DIR, agentId);
443
- for (const dir of [projectDir, globalDir]) {
444
- const filePath = path3.join(dir, `${entryId}${NOTEBOOK_EXT}`);
445
- if (fs3.existsSync(filePath)) {
446
- try {
447
- const content = fs3.readFileSync(filePath, "utf-8");
448
- const entry = yaml2.load(content);
449
- if (entry) {
450
- entry.appliedCount = (entry.appliedCount || 0) + 1;
451
- entry.updated = (/* @__PURE__ */ new Date()).toISOString();
452
- fs3.writeFileSync(filePath, yaml2.dump(entry, {
453
- lineWidth: 120,
454
- noRefs: true,
455
- sortKeys: false
456
- }), "utf-8");
457
- return true;
458
- }
459
- } catch {
460
- }
461
- }
462
- }
463
- return false;
464
- }
465
- var GLOBAL_NOTEBOOKS_DIR, PROJECT_NOTEBOOKS_DIR, NOTEBOOK_PREFIX, NOTEBOOK_EXT;
466
- var init_notebook_loader = __esm({
467
- "../paradigm-mcp/src/utils/notebook-loader.ts"() {
468
- "use strict";
469
- GLOBAL_NOTEBOOKS_DIR = path3.join(os.homedir(), ".paradigm", "notebooks");
470
- PROJECT_NOTEBOOKS_DIR = ".paradigm/notebooks";
471
- NOTEBOOK_PREFIX = "nb-";
472
- NOTEBOOK_EXT = ".yaml";
473
- }
474
- });
475
-
476
- // ../paradigm-mcp/src/utils/nomination-engine.ts
477
- import * as fs4 from "fs";
478
- import * as os2 from "os";
479
- import * as path4 from "path";
480
- function generateNominationId() {
481
- const now = Date.now();
482
- const rand = Math.floor(Math.random() * 9999).toString().padStart(4, "0");
483
- return `nom-${now}-${rand}`;
484
- }
485
- function generateDebateId() {
486
- const now = Date.now();
487
- const rand = Math.floor(Math.random() * 9999).toString().padStart(4, "0");
488
- return `dbt-${now}-${rand}`;
489
- }
490
- function processEvent(rootDir, event) {
491
- const profiles = loadAllAgentProfiles(rootDir);
492
- const policy = loadDataPolicy(rootDir);
493
- const scores = [];
494
- for (const profile of profiles) {
495
- if (!profile.attention) continue;
496
- if (profile.benched) continue;
497
- if (event.path && !canObservePath(policy, event.path, profile.id)) {
498
- continue;
499
- }
500
- const score = scoreEventForAgent(event, profile.id, profile.attention);
501
- if (score.shouldNominate) {
502
- scores.push({ profile, score });
503
- }
504
- }
505
- if (scores.length === 0) {
506
- return { nominations: [], debates: [] };
507
- }
508
- const recentNominations = loadNominations(rootDir, { since: new Date(Date.now() - 3e4).toISOString() });
509
- const deduped = scores.filter(({ profile }) => {
510
- const recent = recentNominations.find(
511
- (n) => n.agent === profile.id && n.brief === generateBrief(profile, event, { ...scores.find((s) => s.profile.id === profile.id).score })
512
- );
513
- return !recent;
514
- });
515
- if (deduped.length === 0) {
516
- return { nominations: [], debates: [] };
517
- }
518
- const nominations = deduped.map(({ profile, score }) => {
519
- const urgency = deriveUrgency(event, score);
520
- const type = deriveNominationType(profile, event);
521
- return {
522
- id: generateNominationId(),
523
- agent: profile.id,
524
- relevance: score.score,
525
- urgency,
526
- type,
527
- brief: generateBrief(profile, event, score),
528
- triggered_by: [event.id],
529
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
530
- surfaced: false
531
- };
532
- });
533
- persistNominations(rootDir, nominations);
534
- const debates = detectDebates(rootDir, nominations);
535
- if (debates.length > 0) {
536
- persistDebates(rootDir, debates);
537
- }
538
- return { nominations, debates };
539
- }
540
- function deriveUrgency(event, score) {
541
- if (event.severity === "critical") return "critical";
542
- if (event.severity === "error") return "high";
543
- if (event.type === "compliance-violation") return "high";
544
- if (event.type === "error-encountered") return "high";
545
- if (event.type === "gate-added" || event.type === "route-created") return "medium";
546
- if (score.score >= 0.9) return "medium";
547
- return "low";
548
- }
549
- function deriveNominationType(profile, event) {
550
- const stance = profile.collaboration?.stance;
551
- if (event.type === "compliance-violation" || event.type === "error-encountered") return "warning";
552
- if (event.type === "gate-added" || event.type === "route-created") return "observation";
553
- if (stance === "advisory") return "suggestion";
554
- if (stance === "lead") return "suggestion";
555
- if (stance === "observer") return "observation";
556
- return "observation";
557
- }
558
- function generateBrief(profile, event, score) {
559
- const role = profile.role || profile.id;
560
- switch (event.type) {
561
- case "gate-checked":
562
- return `${role}: Gate check on ${event.symbols?.join(", ") || "route"} \u2014 verify gate coverage is complete`;
563
- case "file-modified":
564
- return `${role}: ${event.path || "File"} modified \u2014 review for ${profile.id === "security" ? "security implications" : profile.id === "tester" ? "test coverage" : profile.id === "reviewer" ? "code quality" : "consistency"}`;
565
- case "compliance-violation":
566
- return `${role}: Compliance violation detected \u2014 ${event.context || "check .purpose and portal.yaml coverage"}`;
567
- case "route-created":
568
- return `${role}: New route ${event.symbols?.join(", ") || ""} \u2014 ${profile.id === "security" ? "needs gate assignment in portal.yaml" : "review route structure"}`;
569
- case "gate-added":
570
- return `${role}: Gate ${event.symbols?.join(", ") || ""} added \u2014 ${profile.id === "security" ? "verify enforcement points" : "check downstream impact"}`;
571
- case "decision-made":
572
- return `${role}: Decision recorded \u2014 ${event.context?.slice(0, 80) || "review for alignment with project patterns"}`;
573
- case "work-completed":
574
- return `${role}: Work completed on ${event.symbols?.join(", ") || event.context?.slice(0, 40) || "task"} \u2014 review outcome`;
575
- case "error-encountered":
576
- return `${role}: Error detected \u2014 ${event.context?.slice(0, 80) || "investigate root cause"}`;
577
- default: {
578
- const matchDetail = score.breakdown.symbolMatch > 0 ? `symbol match on ${event.symbols?.join(", ") || "unknown"}` : score.breakdown.pathMatch > 0 ? `path ${event.path || "unknown"}` : event.context?.slice(0, 60) || event.type;
579
- return `${role}: ${matchDetail}`;
580
- }
581
- }
582
- }
583
- function detectDebates(rootDir, newNominations) {
584
- if (newNominations.length < 2) return [];
585
- const debates = [];
586
- const byEvent = /* @__PURE__ */ new Map();
587
- for (const nom of newNominations) {
588
- for (const eventId of nom.triggered_by) {
589
- const group = byEvent.get(eventId) || [];
590
- group.push(nom);
591
- byEvent.set(eventId, group);
592
- }
593
- }
594
- for (const [eventId, group] of byEvent) {
595
- if (group.length < 2) continue;
596
- const agents = new Set(group.map((n) => n.agent));
597
- if (agents.size < 2) continue;
598
- const types = new Set(group.map((n) => n.type));
599
- const isConflicting = types.size > 1 && types.has("warning") && types.has("suggestion");
600
- debates.push({
601
- id: generateDebateId(),
602
- topic: `Multiple agents responded to event ${eventId}`,
603
- nominations: group.map((n) => n.id),
604
- type: isConflicting ? "conflicting" : "complementary",
605
- overlap_events: [eventId]
606
- });
607
- }
608
- return debates;
609
- }
610
- function getNominationsPath(rootDir) {
611
- return path4.join(rootDir, EVENTS_DIR2, NOMINATIONS_FILE);
612
- }
613
- function getDebatesPath(rootDir) {
614
- return path4.join(rootDir, EVENTS_DIR2, DEBATES_FILE);
615
- }
616
- function persistNominations(rootDir, nominations) {
617
- try {
618
- const dir = path4.join(rootDir, EVENTS_DIR2);
619
- fs4.mkdirSync(dir, { recursive: true });
620
- const filePath = getNominationsPath(rootDir);
621
- const lines = nominations.map((n) => JSON.stringify(n)).join("\n") + "\n";
622
- fs4.appendFileSync(filePath, lines, "utf8");
623
- pruneFile(filePath, MAX_NOMINATIONS);
624
- } catch {
625
- }
626
- }
627
- function persistDebates(rootDir, debates) {
628
- try {
629
- const dir = path4.join(rootDir, EVENTS_DIR2);
630
- fs4.mkdirSync(dir, { recursive: true });
631
- const filePath = getDebatesPath(rootDir);
632
- const lines = debates.map((d) => JSON.stringify(d)).join("\n") + "\n";
633
- fs4.appendFileSync(filePath, lines, "utf8");
634
- pruneFile(filePath, MAX_DEBATES);
635
- } catch {
636
- }
637
- }
638
- function pruneFile(filePath, maxLines) {
639
- try {
640
- const content = fs4.readFileSync(filePath, "utf8");
641
- const lines = content.trim().split("\n").filter((l) => l.trim());
642
- if (lines.length > maxLines) {
643
- const kept = lines.slice(-maxLines);
644
- fs4.writeFileSync(filePath, kept.join("\n") + "\n", "utf8");
645
- }
646
- } catch {
647
- }
648
- }
649
- function loadNominations(rootDir, filter) {
650
- const filePath = getNominationsPath(rootDir);
651
- if (!fs4.existsSync(filePath)) return [];
652
- try {
653
- const content = fs4.readFileSync(filePath, "utf8");
654
- let nominations = content.trim().split("\n").filter((line) => line.trim()).map((line) => {
655
- try {
656
- return JSON.parse(line);
657
- } catch {
658
- return null;
659
- }
660
- }).filter((n) => n !== null);
661
- if (filter?.agent) nominations = nominations.filter((n) => n.agent === filter.agent);
662
- if (filter?.urgency) nominations = nominations.filter((n) => n.urgency === filter.urgency);
663
- if (filter?.surfaced !== void 0) nominations = nominations.filter((n) => n.surfaced === filter.surfaced);
664
- if (filter?.pending_only) nominations = nominations.filter((n) => !n.engaged);
665
- if (filter?.since) nominations = nominations.filter((n) => n.timestamp >= filter.since);
666
- nominations.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
667
- if (filter?.limit) nominations = nominations.slice(0, filter.limit);
668
- return nominations;
669
- } catch {
670
- return [];
671
- }
672
- }
673
- function loadDebates(rootDir) {
674
- const filePath = getDebatesPath(rootDir);
675
- if (!fs4.existsSync(filePath)) return [];
676
- try {
677
- const content = fs4.readFileSync(filePath, "utf8");
678
- return content.trim().split("\n").filter((line) => line.trim()).map((line) => {
679
- try {
680
- return JSON.parse(line);
681
- } catch {
682
- return null;
683
- }
684
- }).filter((d) => d !== null);
685
- } catch {
686
- return [];
687
- }
688
- }
689
- function engageNomination(rootDir, nominationId, response, reason) {
690
- const filePath = getNominationsPath(rootDir);
691
- if (!fs4.existsSync(filePath)) return false;
692
- try {
693
- const content = fs4.readFileSync(filePath, "utf8");
694
- const lines = content.trim().split("\n");
695
- let found = false;
696
- const updated = lines.map((line) => {
697
- try {
698
- const nom = JSON.parse(line);
699
- if (nom.id === nominationId) {
700
- nom.engaged = true;
701
- nom.response = response;
702
- if (reason) nom.reason = reason;
703
- found = true;
704
- return JSON.stringify(nom);
705
- }
706
- return line;
707
- } catch {
708
- return line;
709
- }
710
- });
711
- if (found) {
712
- fs4.writeFileSync(filePath, updated.join("\n") + "\n", "utf8");
713
- if (response === "accepted" || response === "dismissed") {
714
- const nom = JSON.parse(lines.find((l) => {
715
- try {
716
- return JSON.parse(l).id === nominationId;
717
- } catch {
718
- return false;
719
- }
720
- }));
721
- const profile = loadAllAgentProfiles(rootDir).find((p) => p.id === nom.agent);
722
- if (profile?.learning?.intrinsic?.feedback?.after_recommendation) {
723
- emitEvent(rootDir, {
724
- type: "work-completed",
725
- source: "agent-action",
726
- agent: nom.agent,
727
- context: `Nomination ${nominationId} ${response} \u2014 feedback for learning`,
728
- data: { nomination_id: nominationId, response }
729
- });
730
- }
731
- }
732
- }
733
- return found;
734
- } catch {
735
- return false;
736
- }
737
- }
738
- function resolveDebate(rootDir, debateId, chosenNominationId, reason) {
739
- const filePath = getDebatesPath(rootDir);
740
- if (!fs4.existsSync(filePath)) return false;
741
- try {
742
- const content = fs4.readFileSync(filePath, "utf8");
743
- const lines = content.trim().split("\n");
744
- let found = false;
745
- const updated = lines.map((line) => {
746
- try {
747
- const debate = JSON.parse(line);
748
- if (debate.id === debateId) {
749
- debate.resolution = {
750
- chosen: chosenNominationId,
751
- reason,
752
- resolved_by: "human",
753
- resolved_at: (/* @__PURE__ */ new Date()).toISOString()
754
- };
755
- found = true;
756
- const nonChosen = debate.nominations.filter((id) => id !== chosenNominationId);
757
- for (const loserId of nonChosen) {
758
- const loserNom = loadNominations(rootDir).find((n) => n.id === loserId);
759
- if (loserNom) {
760
- emitEvent(rootDir, {
761
- type: "work-completed",
762
- source: "agent-action",
763
- agent: loserNom.agent,
764
- context: `Debate ${debateId} resolved \u2014 nomination ${loserId} not chosen`,
765
- data: { debate_id: debateId, chosen: chosenNominationId, reason }
766
- });
767
- }
768
- }
769
- return JSON.stringify(debate);
770
- }
771
- return line;
772
- } catch {
773
- return line;
774
- }
775
- });
776
- if (found) {
777
- fs4.writeFileSync(filePath, updated.join("\n") + "\n", "utf8");
778
- }
779
- return found;
780
- } catch {
781
- return false;
782
- }
783
- }
784
- function processPendingEvents(rootDir) {
785
- const lastProcessedPath = path4.join(rootDir, EVENTS_DIR2, ".last-processed");
786
- let lastProcessedId = "";
787
- try {
788
- if (fs4.existsSync(lastProcessedPath)) {
789
- lastProcessedId = fs4.readFileSync(lastProcessedPath, "utf8").trim();
790
- }
791
- } catch {
792
- }
793
- const streamPath = path4.join(rootDir, EVENTS_DIR2, "stream.jsonl");
794
- if (!fs4.existsSync(streamPath)) return { processed: 0, nominations: [] };
795
- let events = [];
796
- try {
797
- const content = fs4.readFileSync(streamPath, "utf8");
798
- events = content.trim().split("\n").filter((line) => line.trim()).map((line) => {
799
- try {
800
- return JSON.parse(line);
801
- } catch {
802
- return null;
803
- }
804
- }).filter((e) => e !== null);
805
- } catch {
806
- return { processed: 0, nominations: [] };
807
- }
808
- let startIdx = 0;
809
- if (lastProcessedId) {
810
- const idx = events.findIndex((e) => e.id === lastProcessedId);
811
- if (idx >= 0) startIdx = idx + 1;
812
- }
813
- const pending = events.slice(startIdx);
814
- if (pending.length === 0) return { processed: 0, nominations: [] };
815
- const allNominations = [];
816
- const toProcess = pending.slice(0, 50);
817
- for (const event of toProcess) {
818
- const { nominations } = processEvent(rootDir, event);
819
- allNominations.push(...nominations);
820
- }
821
- const lastEvent = toProcess[toProcess.length - 1];
822
- try {
823
- fs4.mkdirSync(path4.join(rootDir, EVENTS_DIR2), { recursive: true });
824
- fs4.writeFileSync(lastProcessedPath, lastEvent.id, "utf8");
825
- } catch {
826
- }
827
- return { processed: toProcess.length, nominations: allNominations };
828
- }
829
- function emitAndProcess(rootDir, event, opts) {
830
- const policy = loadDataPolicy(rootDir);
831
- if (event.path && !canObservePath(policy, event.path)) {
832
- const emitted2 = emitEvent(rootDir, event);
833
- return { event: emitted2, nominations: [], debates: [] };
834
- }
835
- const emitted = emitEvent(rootDir, event);
836
- if (opts?.skipNominations) {
837
- return { event: emitted, nominations: [], debates: [] };
838
- }
839
- const { nominations, debates } = processEvent(rootDir, emitted);
840
- if (nominations.length > 0) {
841
- forwardNominationsToRelay(rootDir, nominations);
842
- }
843
- return { event: emitted, nominations, debates };
844
- }
845
- function adjustAttentionFromFeedback(rootDir, agentId) {
846
- const profile = loadAgentProfile(rootDir, agentId);
847
- if (!profile?.attention) {
848
- return { adjusted: false, oldThreshold: 0.6, newThreshold: 0.6, reason: "No attention config" };
849
- }
850
- const oldThreshold = profile.attention.threshold ?? 0.6;
851
- const STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
852
- const allNominations = loadNominations(rootDir, { agent: agentId });
853
- const active = allNominations.filter(
854
- (n) => n.engaged || Date.now() - new Date(n.timestamp).getTime() < STALE_THRESHOLD_MS
855
- );
856
- const engaged = active.filter((n) => n.engaged);
857
- if (engaged.length < 5) {
858
- return { adjusted: false, oldThreshold, newThreshold: oldThreshold, reason: `Insufficient data (${engaged.length}/5 engaged nominations)` };
859
- }
860
- const accepted = engaged.filter((n) => n.response === "accepted").length;
861
- const dismissed = engaged.filter((n) => n.response === "dismissed").length;
862
- const acceptRate = accepted / engaged.length;
863
- const dismissRate = dismissed / engaged.length;
864
- let newThreshold = oldThreshold;
865
- let reason = "No adjustment needed";
866
- if (dismissRate > 0.6) {
867
- newThreshold = Math.min(0.95, oldThreshold + 0.05);
868
- reason = `High dismiss rate (${(dismissRate * 100).toFixed(0)}%) \u2014 raising threshold to reduce noise`;
869
- } else if (acceptRate > 0.8) {
870
- newThreshold = Math.max(0.2, oldThreshold - 0.05);
871
- reason = `High accept rate (${(acceptRate * 100).toFixed(0)}%) \u2014 lowering threshold to contribute more`;
872
- }
873
- if (newThreshold === oldThreshold) {
874
- return { adjusted: false, oldThreshold, newThreshold, reason };
875
- }
876
- profile.attention.threshold = newThreshold;
877
- const projectPath = path4.join(rootDir, ".paradigm/agents", `${agentId}.agent`);
878
- const scope = fs4.existsSync(projectPath) ? "project" : "global";
879
- saveAgentProfile(agentId, profile, scope, rootDir);
880
- emitEvent(rootDir, {
881
- type: "work-completed",
882
- source: "agent-action",
883
- agent: agentId,
884
- context: `Attention threshold adjusted: ${oldThreshold.toFixed(2)} \u2192 ${newThreshold.toFixed(2)} (${reason})`,
885
- data: { old_threshold: oldThreshold, new_threshold: newThreshold, accept_rate: acceptRate, dismiss_rate: dismissRate }
886
- });
887
- return { adjusted: true, oldThreshold, newThreshold, reason };
888
- }
889
- function getNominationStats(rootDir, agentId) {
890
- const STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
891
- const allNominations = loadNominations(rootDir, { agent: agentId });
892
- const nominations = allNominations.filter(
893
- (n) => n.engaged || Date.now() - new Date(n.timestamp).getTime() < STALE_THRESHOLD_MS
894
- );
895
- const accepted = nominations.filter((n) => n.response === "accepted").length;
896
- const dismissed = nominations.filter((n) => n.response === "dismissed").length;
897
- const deferred = nominations.filter((n) => n.response === "deferred").length;
898
- const pending = nominations.filter((n) => !n.engaged).length;
899
- const engaged = accepted + dismissed + deferred;
900
- return {
901
- total: nominations.length,
902
- accepted,
903
- dismissed,
904
- deferred,
905
- pending,
906
- acceptRate: engaged > 0 ? accepted / engaged : 0
907
- };
908
- }
909
- function getNeverlandMetrics(rootDir) {
910
- const profiles = loadAllAgentProfiles(rootDir);
911
- const agentMetrics = profiles.filter((p) => !p.benched).map((p) => {
912
- const stats = getNominationStats(rootDir, p.id);
913
- let notebookCount = 0;
914
- try {
915
- const nbDir = path4.join(os2.homedir(), ".paradigm", "notebooks", p.id);
916
- if (fs4.existsSync(nbDir)) {
917
- notebookCount = fs4.readdirSync(nbDir).filter((f) => f.endsWith(".yaml")).length;
918
- }
919
- } catch {
920
- }
921
- return {
922
- id: p.id,
923
- acceptRate: stats.acceptRate,
924
- threshold: p.attention?.threshold ?? 0.5,
925
- expertiseCount: (p.expertise || []).length,
926
- notebookCount,
927
- transferableCount: (p.transferable || []).length,
928
- totalNominations: stats.total
929
- };
930
- });
931
- const count = agentMetrics.length || 1;
932
- const avgAcceptRate = agentMetrics.reduce((s, a) => s + a.acceptRate, 0) / count;
933
- const avgThreshold = agentMetrics.reduce((s, a) => s + a.threshold, 0) / count;
934
- const totalExpertise = agentMetrics.reduce((s, a) => s + a.expertiseCount, 0);
935
- const totalNotebooks = agentMetrics.reduce((s, a) => s + a.notebookCount, 0);
936
- const totalTransferable = agentMetrics.reduce((s, a) => s + a.transferableCount, 0);
937
- const totalNominations = agentMetrics.reduce((s, a) => s + a.totalNominations, 0);
938
- let healthStatus;
939
- if (totalNominations < 10) {
940
- healthStatus = "cold-start";
941
- } else if (avgAcceptRate < 0.5) {
942
- healthStatus = "accumulating";
943
- } else if (avgAcceptRate < 0.7) {
944
- healthStatus = "calibrating";
945
- } else {
946
- healthStatus = "mature";
947
- }
948
- return {
949
- agents: agentMetrics,
950
- aggregate: {
951
- avgAcceptRate,
952
- avgThreshold,
953
- totalExpertise,
954
- totalNotebooks,
955
- totalTransferable
956
- },
957
- healthStatus
958
- };
959
- }
960
- function forwardNominationsToRelay(rootDir, nominations) {
961
- if (nominations.length === 0) return;
962
- const outboxDir = path4.join(os2.homedir(), ".paradigm", "score", "outbox");
963
- if (!fs4.existsSync(outboxDir)) return;
964
- try {
965
- const outboxFile = path4.join(outboxDir, `nom-${Date.now()}.json`);
966
- const message = {
967
- type: "nomination_forward",
968
- nominations: nominations.map((n) => ({ ...n })),
969
- origin: detectLocalProject(rootDir),
970
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
971
- };
972
- fs4.writeFileSync(outboxFile, JSON.stringify(message), "utf8");
973
- } catch {
974
- }
975
- }
976
- function detectLocalProject(rootDir) {
977
- try {
978
- const configPath = path4.join(rootDir, ".paradigm", "config.yaml");
979
- if (fs4.existsSync(configPath)) {
980
- const content = fs4.readFileSync(configPath, "utf8");
981
- const match = content.match(/project:\s*(.+)/);
982
- if (match) return match[1].trim();
983
- }
984
- } catch {
985
- }
986
- return path4.basename(rootDir);
987
- }
988
- function autoPromoteJournalEntries(rootDir, agentId) {
989
- let loadJournalEntries;
990
- let addNotebookEntry2;
991
- try {
992
- const journalMod = (init_journal_loader(), __toCommonJS(journal_loader_exports));
993
- const notebookMod = (init_notebook_loader(), __toCommonJS(notebook_loader_exports));
994
- loadJournalEntries = journalMod.loadJournalEntries;
995
- addNotebookEntry2 = notebookMod.addNotebookEntry;
996
- } catch {
997
- return { promoted: 0, entries: [] };
998
- }
999
- const patternEntries = loadJournalEntries(agentId, { trigger: "pattern_discovered", limit: 100 });
1000
- const feedbackEntries = loadJournalEntries(agentId, { trigger: "human_feedback", limit: 100 });
1001
- const journal = [...patternEntries, ...feedbackEntries];
1002
- const promoted = [];
1003
- for (const entry of journal) {
1004
- if (entry.promoted_to_notebook) continue;
1005
- if ((entry.confidence_after ?? 0) < 0.8) continue;
1006
- try {
1007
- const { entry: nbEntry } = addNotebookEntry2(
1008
- agentId,
1009
- {
1010
- context: entry.pattern?.applies_when || entry.insight.slice(0, 80),
1011
- snippet: entry.pattern?.correct_approach || entry.insight,
1012
- concepts: entry.tags || [entry.pattern?.id || "learned-pattern"],
1013
- provenance: {
1014
- source: "journal-auto-promote",
1015
- sourceId: entry.id,
1016
- createdBy: agentId
1017
- }
1018
- },
1019
- "global",
1020
- rootDir
1021
- );
1022
- promoted.push({ journalId: entry.id, notebookId: nbEntry.id });
1023
- try {
1024
- const journalDir = path4.join(os2.homedir(), ".paradigm", "agents", agentId, "journal");
1025
- if (fs4.existsSync(journalDir)) {
1026
- const files = fs4.readdirSync(journalDir).filter((f) => f.endsWith(".yaml"));
1027
- for (const file of files) {
1028
- const filePath = path4.join(journalDir, file);
1029
- const content = fs4.readFileSync(filePath, "utf8");
1030
- if (content.includes(entry.id)) {
1031
- const updated = content.replace(
1032
- /promoted_to_notebook:.*$/m,
1033
- `promoted_to_notebook: "${nbEntry.id}"`
1034
- );
1035
- if (updated === content) {
1036
- const lines = content.trimEnd().split("\n");
1037
- lines.push(`promoted_to_notebook: "${nbEntry.id}"`);
1038
- fs4.writeFileSync(filePath, lines.join("\n") + "\n", "utf8");
1039
- } else {
1040
- fs4.writeFileSync(filePath, updated, "utf8");
1041
- }
1042
- break;
1043
- }
1044
- }
1045
- }
1046
- } catch {
1047
- }
1048
- } catch {
1049
- }
1050
- }
1051
- return { promoted: promoted.length, entries: promoted };
1052
- }
1053
- function loadSurfacingConfig(rootDir) {
1054
- const filePath = path4.join(rootDir, SURFACING_FILE);
1055
- const defaults = {
1056
- default_min_urgency: "low",
1057
- enable_debates: true
1058
- };
1059
- if (!fs4.existsSync(filePath)) return defaults;
1060
- try {
1061
- const yaml3 = __require("js-yaml");
1062
- const content = fs4.readFileSync(filePath, "utf8");
1063
- const parsed = yaml3.load(content);
1064
- return { ...defaults, ...parsed };
1065
- } catch {
1066
- return defaults;
1067
- }
1068
- }
1069
- function applySurfacingRules(nominations, config) {
1070
- const urgencyOrder = { critical: 0, high: 1, medium: 2, low: 3 };
1071
- const minUrgency = urgencyOrder[config.default_min_urgency || "low"] ?? 3;
1072
- return nominations.filter((n) => {
1073
- const nomUrgency = urgencyOrder[n.urgency] ?? 3;
1074
- if (config.preferences) {
1075
- const agentPref = config.preferences.find((p) => p.agent === n.agent);
1076
- if (agentPref) {
1077
- if (agentPref.always_show) return true;
1078
- if (agentPref.mute_unless?.length) {
1079
- const matchesMute = agentPref.mute_unless.some(
1080
- (condition) => n.urgency === condition || n.type === condition
1081
- );
1082
- if (!matchesMute) return false;
1083
- }
1084
- if (agentPref.min_urgency) {
1085
- const agentMin = urgencyOrder[agentPref.min_urgency] ?? 3;
1086
- return nomUrgency <= agentMin;
1087
- }
1088
- }
1089
- }
1090
- return nomUrgency <= minUrgency;
1091
- });
1092
- }
1093
- var EVENTS_DIR2, NOMINATIONS_FILE, DEBATES_FILE, MAX_NOMINATIONS, MAX_DEBATES, SURFACING_FILE;
1094
- var init_nomination_engine = __esm({
1095
- "../paradigm-mcp/src/utils/nomination-engine.ts"() {
1096
- init_event_stream();
1097
- init_data_policy_loader();
1098
- init_agent_loader();
1099
- EVENTS_DIR2 = ".paradigm/events";
1100
- NOMINATIONS_FILE = "nominations.jsonl";
1101
- DEBATES_FILE = "debates.jsonl";
1102
- MAX_NOMINATIONS = 500;
1103
- MAX_DEBATES = 200;
1104
- SURFACING_FILE = ".paradigm/surfacing.yaml";
1105
- }
1106
- });
1107
-
1108
- export {
1109
- queryEvents,
1110
- init_event_stream,
1111
- loadDataPolicy,
1112
- filterContent,
1113
- init_data_policy_loader,
1114
- loadNotebookEntries,
1115
- searchNotebooks,
1116
- addNotebookEntry,
1117
- promoteFromLore,
1118
- init_notebook_loader,
1119
- processEvent,
1120
- detectDebates,
1121
- persistNominations,
1122
- loadNominations,
1123
- loadDebates,
1124
- engageNomination,
1125
- resolveDebate,
1126
- processPendingEvents,
1127
- emitAndProcess,
1128
- adjustAttentionFromFeedback,
1129
- getNominationStats,
1130
- getNeverlandMetrics,
1131
- forwardNominationsToRelay,
1132
- autoPromoteJournalEntries,
1133
- loadSurfacingConfig,
1134
- applySurfacingRules,
1135
- init_nomination_engine
1136
- };