@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,53 @@
1
+ #!/usr/bin/env node
2
+ import {b as b$1,i,h,f,a,c,d,q as q$1,k,e as e$1,o,t,u,g,p as p$1,m,n,s,r,x,v,A,w,y,z}from'./chunk-Z34K6GY2.js';import'./chunk-5TAVYPOV.js';import e from'chalk';import*as b from'path';import*as p from'fs';import*as q from'os';async function te(s){let o=process.cwd();if(s.remote){await Y(o,s.remote);return}let r=b$1(o);console.log(e.green(`\u2713 Joined as ${e.bold(r.id)}`));let i$1=i().filter(l=>l.id!==r.id);if(i$1.length>0){console.log(e.cyan(`
3
+ Found ${i$1.length} other session${i$1.length!==1?"s":""}:`));for(let l of i$1){let t=h(l)?e.yellow("asleep"):e.green("awake");console.log(` ${e.white(l.id)} \u2014 ${l.name} [${t}]`);}}else console.log(e.gray(`
4
+ No other sessions found. Open another terminal and run "paradigm symphony join".`));console.log(e.gray(`
5
+ Tip: Set up polling with: /loop 10s paradigm_symphony_poll`));}async function Y(s,o){let{SymphonyRelay:r}=await import('./symphony-relay-5GY5JIPT.js'),n,i;if(o.includes("#")){let c=o.split("#");n=c[0],i=c[1];}else n=o;n.includes(":")||(n=`${n}:3939`);let l=f(s);l||(l=b$1(s));let t;if(i)t=i,console.log(e.cyan(`
6
+ Connecting to ${n} with embedded pairing code...`));else if(console.log(e.cyan(`
7
+ Connecting to ${n}...`)),console.log(e.white(" Enter the 6-digit pairing code shown on the host:")),t=await K(" Code: "),t=t.trim(),!/^\d{6}$/.test(t)){console.log(e.red(" Invalid code. Must be 6 digits."));return}let a=new r({mode:"client",peerId:l.id,events:{onPeerConnected:(c,g)=>{console.log(e.green(` \u2713 Connected to ${e.bold(g)} (${c})`));},onPeerDisconnected:c=>{console.log(e.yellow(` Peer ${c} disconnected. Reconnecting...`));},onMessageRelayed:(c,g,y)=>{console.log(e.gray(` \u2190 Message ${c.slice(0,8)} from ${g} \u2192 ${y}`));},onError:c=>{console.log(e.red(` Error: ${c.message}`));}}});try{await a.connectToServer(n,t),console.log(e.green(`
8
+ \u2713 Paired and connected!`)),console.log(e.gray(" Messages from remote agents will appear in your inbox.")),console.log(e.gray(` Press Ctrl+C to disconnect.
9
+ `)),process.on("SIGINT",()=>{console.log(e.yellow(`
10
+ Disconnecting...`)),a.stop(),process.exit(0);}),await new Promise(()=>{});}catch(c){console.log(e.red(` Failed to connect: ${c.message}`)),a.stop();}}function K(s){return new Promise(o=>{process.stdout.write(s);let r="";process.stdin.setEncoding("utf-8"),process.stdin.resume(),process.stdin.once("data",n=>{r=n.toString(),process.stdin.pause(),o(r);});})}async function se(){let s=process.cwd(),o=a(s),r=c(o);console.log(r?e.green(`\u2713 Left the score: ${o}`):e.yellow("No active part found for this project."));}async function re(){let s=process.cwd(),o=f(s);if(!o){console.log(e.yellow('Not joined. Run "paradigm symphony join" first.'));return}let n=d().filter(t=>t.id!==o.id),i=q$1("active"),l=k(o.id);console.log(e.cyan(`
11
+ ${e.bold(o.id)}`)),console.log(e.gray(` Project: ${o.project}`)),console.log(e.gray(` Role: ${o.role}`)),console.log(e.gray(` PID: ${o.pid}`)),console.log(e.gray(` Started: ${o.startedAt}`)),o.statusBlurb&&console.log(e.white(` Status: ${o.statusBlurb}`)),console.log(`
12
+ ${e.white(`${n.length} linked peer${n.length!==1?"s":""}`)} \u2014 ${e.white(`${i.length} active thread${i.length!==1?"s":""}`)} \u2014 ${e.white(`${l.length} unread`)}`);}async function ie(s){e$1();let o=d(),{loadPeers:r}=await import('./symphony-peers-X5NGWXFP.js'),n=r(),i=[];for(let t of n)if(!t.revoked)for(let a of t.agents||[])i.push({...a,peerId:t.id});let l=o.length+i.length;if(s.json){console.log(JSON.stringify({local:o,remote:i},null,2));return}if(l===0){console.log(e.yellow('No agents joined. Run "paradigm symphony join" in each terminal.'));return}console.log(e.cyan(`
13
+ Symphony Agents (${l})
14
+ `)),console.log(e.gray(` ${"AGENT ID".padEnd(30)} ${"PROJECT".padEnd(15)} ${"ROLE".padEnd(10)} STATUS`)),console.log(e.gray(` ${"\u2500".repeat(30)} ${"\u2500".repeat(15)} ${"\u2500".repeat(10)} ${"\u2500".repeat(8)}`));for(let t of o){let a=h(t)?e.yellow("asleep"):e.green("awake");console.log(` ${e.white(t.id.padEnd(30))} ${t.project.padEnd(15)} ${t.role.padEnd(10)} ${a}`),t.statusBlurb&&console.log(` ${e.gray(` \u2514 ${t.statusBlurb}`)}`);}if(i.length>0){console.log(e.gray(`
15
+ ${"\u2500".repeat(65)}`)),console.log(e.cyan(` Remote Agents (${i.length})
16
+ `));for(let t of i){let a=t.status==="awake"?e.green("awake"):e.yellow("asleep"),c=e.magenta(`(remote: ${t.peerId})`);console.log(` ${e.white(t.id.padEnd(30))} ${t.project.padEnd(15)} ${t.role.padEnd(10)} ${a} ${c}`);}}console.log();}async function le(s,o$1){let r=process.cwd(),n=f(r);n||(n=b$1(r),console.log(e.gray(`Auto-joined as ${n.id}`)));let i={id:n.id,name:n.name,type:"human",project:n.project,role:n.role},l;o$1.to&&(l=[{id:o$1.to,name:o$1.to,type:"agent"}]);let t$1=o$1.thread;if(!t$1){let g=s.length>60?s.slice(0,60)+"...":s;t$1=o(g,i).id;}let a=t({sender:i,recipients:l,intent:"context",text:s,threadRoot:t$1}),c=u(a);console.log(e.green(`\u2713 Sent to ${c} agent${c!==1?"s":""}`)),console.log(e.gray(` Thread: ${t$1}`)),console.log(e.gray(` Note: ${a.id}`));}async function ce(){let s=process.cwd(),o=f(s);if(!o){console.log(e.yellow('Not joined. Run "paradigm symphony join" first.'));return}g(o.id);let r=k(o.id);if(r.length===0){console.log(e.gray(`
17
+ No unread notes.
18
+ `));return}let n$1=new Map;for(let l of r){let t=l.threadRoot||"direct";n$1.has(t)||n$1.set(t,[]),n$1.get(t).push(l);}console.log(e.cyan(`
19
+ ${r.length} unread note${r.length!==1?"s":""}
20
+ `));for(let[l,t]of n$1){let a=l;if(l!=="direct"){let c=p$1(l);c&&(a=`${c.topic} (${l})`);}console.log(e.white(` \u250C\u2500 ${a}`));for(let c=0;c<t.length;c++){let g=t[c],y=c===t.length-1,d=y?" \u2514\u2500":" \u251C\u2500",h=new Date(g.timestamp).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});console.log(`${d} ${e.cyan(g.sender.name)} ${e.gray(`[${g.intent}]`)} ${e.gray(h)}`);let u=g.content.text.split(`
21
+ `),m=y?" ":" \u2502 ";for(let $ of u)console.log(`${m}${$}`);g.symbols.length>0&&console.log(`${m}${e.gray(`Symbols: ${g.symbols.join(", ")}`)}`);}console.log();}let i=r[r.length-1].id;m(o.id,i),n(o.id);}async function ae(s){let o=q$1();if(s.json){console.log(JSON.stringify(o,null,2));return}if(o.length===0){console.log(e.gray(`
22
+ No threads.
23
+ `));return}console.log(e.cyan(`
24
+ Threads (${o.length})
25
+ `)),console.log(e.gray(` ${"ID".padEnd(14)} ${"TOPIC".padEnd(35)} ${"MSGS".padEnd(6)} ${"STATUS".padEnd(10)} LAST ACTIVITY`)),console.log(e.gray(` ${"\u2500".repeat(14)} ${"\u2500".repeat(35)} ${"\u2500".repeat(6)} ${"\u2500".repeat(10)} ${"\u2500".repeat(20)}`));for(let r of o){let n=r.topic.length>33?r.topic.slice(0,33)+"..":r.topic,i=r.status==="active"?e.green("active"):e.gray("resolved"),l=new Date(r.lastActivity).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});console.log(` ${e.white(r.id.padEnd(14))} ${n.padEnd(35)} ${String(r.messageCount).padEnd(6)} ${i.padEnd(10)} ${e.gray(l)}`);}console.log();}async function ge(s$1){let o=p$1(s$1);if(!o){console.log(e.red(`Thread not found: ${s$1}`));return}let r=s(s$1);console.log(e.cyan(`
26
+ Thread: ${o.topic}`)),console.log(e.gray(` ID: ${o.id} | Status: ${o.status} | Notes: ${o.messageCount}`)),console.log(e.gray(` Participants: ${o.participants.map(n=>n.name).join(", ")}`)),o.decision&&console.log(e.green(` Decision: ${o.decision}`)),console.log(e.gray(`
27
+ ${"\u2500".repeat(60)}
28
+ `));for(let n of r){let i=new Date(n.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});console.log(` ${e.cyan(n.sender.name)} ${e.gray(`[${n.intent}]`)} ${e.gray(i)}`);let l=n.content.text.split(`
29
+ `);for(let t of l)console.log(` ${t}`);n.symbols.length>0&&console.log(` ${e.gray(`Symbols: ${n.symbols.join(", ")}`)}`),n.content.decision&&console.log(` ${e.green(`Decision: ${n.content.decision}`)}`),console.log();}}async function de(s,o){let r$1=p$1(s);if(!r$1){console.log(e.red(`Thread not found: ${s}`));return}r(s,o.decision)?(console.log(e.green(`\u2713 Thread resolved: ${r$1.topic}`)),o.decision&&console.log(e.gray(` Decision: ${o.decision}`)),console.log(e.gray(` Tip: Record this as lore with "paradigm lore record --title 'Thread: ${r$1.topic}'"`))):console.log(e.red("Failed to resolve thread."));}async function ye(s){e$1();let o=process.cwd(),r=f(o),n=d(),i=q$1("active"),l=x("pending"),t=r?k(r.id):[],{loadPeers:a}=await import('./symphony-peers-X5NGWXFP.js'),g=a().filter(d=>!d.revoked);if(s.json){console.log(JSON.stringify({identity:r?{id:r.id,project:r.project,role:r.role}:null,agents:n.map(d=>({id:d.id,status:h(d)?"asleep":"awake",statusBlurb:d.statusBlurb})),peers:g.map(d=>({id:d.id,address:d.address,agents:d.agents?.length??0,lastSeen:d.lastSeen})),activeThreads:i.length,unreadMessages:t.length,pendingFileRequests:l.length},null,2));return}console.log(e.cyan(`
30
+ Symphony Status
31
+ `)),console.log(r?` ${e.white("Identity:")} ${r.id}`:` ${e.yellow("Not joined.")} Run "paradigm symphony join" to join.`);let y=n.filter(d=>!h(d)).length;console.log(` ${e.white("Agents:")} ${n.length} joined (${y} awake)`);for(let d of n){let h$1=h(d)?e.yellow("asleep"):e.green("awake"),u=d.statusBlurb?e.gray(` \u2014 ${d.statusBlurb}`):"";console.log(` ${e.white(d.id)} [${h$1}]${u}`);}if(g.length>0){let d=g.reduce((h,u)=>h+(u.agents?.length??0),0);console.log(` ${e.white("Peers:")} ${g.length} connected (${d} remote agents)`);for(let h of g){let u=h.agents?.length??0;console.log(` ${e.white(h.id)} at ${h.address} (${u} agent${u!==1?"s":""})`);}}else console.log(` ${e.white("Peers:")} ${e.gray('none (run "paradigm symphony serve" to accept connections)')}`);console.log(` ${e.white("Threads:")} ${i.length} active`),console.log(` ${e.white("Unread:")} ${t.length} note${t.length!==1?"s":""}`),console.log(` ${e.white("File Requests:")} ${l.length} pending`),console.log();}async function pe(s){let o=parseInt(s.port||"3939",10),r=process.cwd(),{SymphonyRelay:n}=await import('./symphony-relay-5GY5JIPT.js'),i=f(r);i||(i=b$1(r)),console.log(e.cyan(`
32
+ Starting Symphony relay server...
33
+ `));let l=new n({mode:"server",peerId:i.id,port:o,events:{onPeerConnected:(t,a)=>{console.log(e.green(` \u2713 Peer connected: ${e.bold(a)} (${t})`));let c=l.getRemoteAgents();c.length>0&&console.log(e.gray(` Remote agents: ${c.map(g=>g.id).join(", ")}`));},onPeerDisconnected:t=>{console.log(e.yellow(` Peer disconnected: ${t}`));},onPeerAuthFailed:(t,a)=>{console.log(e.red(` Auth failed from ${t}: ${a}`));},onMessageRelayed:(t,a,c)=>{console.log(e.gray(` \u2194 Relayed ${t.slice(0,8)} from ${a} to ${c}`));},onError:t=>{console.log(e.red(` Error: ${t.message}`));}}});try{let t=await l.startServer(),a=Q();if(console.log(e.green(` \u2713 Symphony relay listening on port ${o}`)),console.log(),console.log(e.white(" Pairing Code:")),console.log(),console.log(e.bold.cyan(` ${t.code.slice(0,3)} ${t.code.slice(3)}`)),console.log(),console.log(e.gray(" Share this code with the person connecting.")),console.log(e.gray(` Code rotates every 5 minutes.
34
+ `)),console.log(e.white(" LAN connect:")),console.log(e.gray(` paradigm symphony join --remote ${a}:${o}`)),s.public){let g=`${a}:${o}#${t.code}`;console.log(),console.log(e.white(" Internet connect (connection string):")),console.log(e.cyan(` paradigm symphony join --remote ${g}`)),console.log(e.gray(" (Requires port 3939 reachable: port forward, VPN, or SSH tunnel)"));}console.log(e.gray(`
35
+ Press Ctrl+C to stop.
36
+ `));let c=setInterval(()=>{let g=l.rotatePairingCode();console.log(e.cyan(` Code rotated: ${g.code.slice(0,3)} ${g.code.slice(3)}`));},300*1e3);process.on("SIGINT",()=>{console.log(e.yellow(`
37
+ Shutting down relay...`)),clearInterval(c),l.stop(),process.exit(0);}),await new Promise(()=>{});}catch(t){console.log(e.red(` Failed to start server: ${t.message}`)),l.stop();}}function Q(){let s=q.networkInterfaces();for(let o of Object.keys(s))for(let r of s[o]||[])if(r.family==="IPv4"&&!r.internal)return r.address;return "127.0.0.1"}async function he(s,o){let r=process.cwd(),n=f(r);n||(n=b$1(r));let i=o.from,l=o.reason||"Needed for current task";if(!i){console.log(e.red("--from is required. Specify which agent to request from."));let g=d().filter(y=>y.id!==n.id);if(g.length>0){console.log(e.gray(`
38
+ Available agents:`));for(let y of g)console.log(e.gray(` ${y.id}`));}return}let t$1=v();if(A(s,t$1)){console.log(e.red(`\u2717 "${s}" is on the hard-deny list and cannot be requested.`));return}let a=w({filePath:s,requester:{id:n.id,name:n.name,type:"agent",project:n.project,role:n.role},reason:l}),c=t({sender:{id:n.id,name:n.name,type:"agent",project:n.project,role:n.role},recipients:[{id:i,name:i,type:"agent"}],intent:"fileRequest",text:`File request: ${s}
39
+ Reason: ${l}`,symbols:[]});u(c),console.log(e.green(`\u2713 File request created: ${a.request.requestId}`)),console.log(e.gray(` File: ${s}`)),console.log(e.gray(` From: ${i}`)),console.log(e.gray(` Reason: ${l}`)),console.log(e.gray(`
40
+ The owning agent's human must approve with:`)),console.log(e.white(` paradigm symphony approve ${a.request.requestId}`));}async function ue(){let s=x("pending");if(s.length===0){console.log(e.gray(`
41
+ No pending file requests.
42
+ `));return}console.log(e.cyan(`
43
+ Pending File Requests (${s.length})
44
+ `));for(let o of s){let r=Date.now()-new Date(o.createdAt).getTime(),n=Math.round(r/6e4);console.log(` ${e.white(o.request.requestId)}`),console.log(` File: ${o.request.filePath}`),console.log(` From: ${o.request.requester.name} (${o.request.requester.id})`),console.log(` Reason: ${o.request.reason}`),console.log(e.gray(` ${n}m ago`)),console.log(e.gray(` \u2192 paradigm symphony approve ${o.request.requestId}`)),console.log(e.gray(` \u2192 paradigm symphony deny ${o.request.requestId}`)),console.log();}}async function me(s,o){let r=process.cwd(),n=y(s,r,o.redact);if(!n.success){console.log(e.red(`\u2717 ${n.error}`));return}let i=o.redact?"approved (redacted)":"approved";console.log(e.green(`\u2713 File request ${i}`)),console.log(e.gray(` File: ${n.delivery?.filePath}`)),console.log(e.gray(` Size: ${n.delivery?.size} bytes`)),console.log(e.gray(` SHA-256: ${n.delivery?.hash?.slice(0,16)}...`));}async function fe(s,o){z(s,o.reason)?(console.log(e.green(`\u2713 File request denied: ${s}`)),o.reason&&console.log(e.gray(` Reason: ${o.reason}`))):console.log(e.red(`\u2717 File request not found or already resolved: ${s}`));}var X={question:e.blue,context:e.gray,clarification:e.blue,proposal:e.cyan,verification:e.blue,action:e.cyan,decision:e.yellow,alert:e.red,approval:e.green,rejection:e.red,reference:e.gray,handoff:e.magenta,fileRequest:e.green,fileApproved:e.green,fileDenied:e.red,fileDelivery:e.green};function Z(s){let o=new Date(s.timestamp).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"}),n=(X[s.intent]||e.white)(`[${s.intent}]`),i=e.cyan(s.sender.name),l=s.threadRoot?e.gray(` (${s.threadRoot})`):"",t=[];t.push(` ${e.gray(o)} ${i} ${n}${l}`);let a=s.content.text.split(`
45
+ `);for(let c of a)t.push(` ${c}`);return s.symbols.length>0&&t.push(` ${e.gray(`Symbols: ${s.symbols.join(", ")}`)}`),s.content.decision&&t.push(` ${e.yellow(`Decision: ${s.content.decision}`)}`),s.content.diff&&t.push(` ${e.gray("[diff attached]")}`),t.join(`
46
+ `)}async function $e(s){let o=process.cwd(),r=f(o);r||(r=b$1(o),console.log(e.gray(`Auto-joined as ${r.id}`)));let n=parseInt(s.interval||"2000",10),i=s.thread,l=s.quiet,t=b.join(q.homedir(),".paradigm","score"),a=b.join(t,"agents",...r.id.split("/"),"inbox.jsonl"),c=0,g$1=0;p.existsSync(a)&&(c=p.readFileSync(a,"utf-8").split(`
47
+ `).filter($=>$.trim().length>0).length,g$1=p.statSync(a).size),l||(console.log(e.cyan(`
48
+ Symphony Watch`)),console.log(e.gray(` Agent: ${r.id}`)),console.log(e.gray(` Inbox: ${a}`)),console.log(e.gray(` Poll: ${n}ms`)),i&&console.log(e.gray(` Filter: thread ${i}`)),console.log(e.gray(` Press Ctrl+C to stop
49
+ `)),console.log(e.gray(` ${"\u2500".repeat(60)}
50
+ `)));let y=b.join(t,"threads"),d=new Set;if(p.existsSync(y))for(let m of p.readdirSync(y))d.add(m);let h=()=>{try{if(p.existsSync(a)){let m=p.statSync(a);if(m.size>g$1){let w=p.readFileSync(a,"utf-8").split(`
51
+ `).filter(T=>T.trim().length>0);if(w.length>c){let T=w.slice(c);for(let V of T)try{let F=JSON.parse(V);if(i&&F.threadRoot!==i)continue;console.log(Z(F)),console.log();}catch{}c=w.length;}g$1=m.size;}}if(p.existsSync(y)){let m=p.readdirSync(y);for(let $ of m)if(!d.has($)){d.add($);try{let w=JSON.parse(p.readFileSync(b.join(y,$),"utf-8"));l||(console.log(` ${e.green("+")} ${e.white("New thread:")} ${w.topic||w.id}`),console.log(` ${e.gray(`by ${w.initiator?.name||"unknown"} \u2014 ${w.id}`)}`),console.log());}catch{}}}g(r.id);}catch{}};h();let u=setInterval(h,n);process.on("SIGINT",()=>{clearInterval(u),l||console.log(e.gray(`
52
+ Watch stopped.
53
+ `)),process.exit(0);}),await new Promise(()=>{});}export{me as symphonyApproveCommand,fe as symphonyDenyCommand,te as symphonyJoinCommand,se as symphonyLeaveCommand,ie as symphonyListCommand,ce as symphonyReadCommand,he as symphonyRequestCommand,ue as symphonyRequestsCommand,de as symphonyResolveCommand,le as symphonySendCommand,pe as symphonyServeCommand,ye as symphonyStatusCommand,ge as symphonyThreadCommand,ae as symphonyThreadsCommand,$e as symphonyWatchCommand,re as symphonyWhoamiCommand};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{a as SCORE_DIR,w as acknowledgeMessages,f as appendJsonlLine,s as appendToInbox,u as appendToOutbox,L as approveFileRequest,F as buildMessage,k as cleanStaleAgents,I as createFileRequest,z as createThread,M as denyFileRequest,p as discoverClaudeCodeSessions,c as ensureMailDirs,b as ensureScoreDirs,P as expireOldRequests,y as garbageCollect,d as getAgentDir,l as getMyIdentity,E as getThreadMessages,o as isAgentAsleep,O as isPathAutoApproved,N as isPathDenied,j as listAgents,K as listFileRequests,B as listThreads,J as loadFileRequest,A as loadThread,H as loadTrustConfig,m as markAgentPollTime,q as peekInbox,x as readAck,t as readInbox,e as readJsonlFile,v as readOutbox,r as recordAckSize,h as registerAgent,g as resolveAgentIdentity,D as resolveThread,G as routeMessage,i as unregisterAgent,n as updateAgentStatus,C as updateThread}from'./chunk-6EX37L4Q.js';import'./chunk-5TAVYPOV.js';
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import'./chunk-5TAVYPOV.js';import*as n from'fs';import*as f from'path';import*as p from'os';import*as s from'crypto';var d=f.join(p.homedir(),".paradigm","score"),a=f.join(d,"peers.json"),g=300*1e3;function i(){try{if(!n.existsSync(a))return [];let r=n.readFileSync(a,"utf-8"),e=JSON.parse(r);return Array.isArray(e)?e:[]}catch{return []}}function c(r){n.existsSync(d)||n.mkdirSync(d,{recursive:true}),n.writeFileSync(a,JSON.stringify(r,null,2),{mode:384});}function S(r){return i().find(t=>t.id===r)??null}function l(r){let e=i(),t=e.findIndex(o=>o.id===r.id);t>=0?e[t]=r:e.push(r),c(e);}function m(r){let e=i(),t=e.find(o=>o.id===r);return t?(t.revoked=true,c(e),true):false}function x(){let e=i().length;return n.existsSync(a)&&n.unlinkSync(a),e}function y(r){let e=i(),t=e.find(o=>o.id===r);t&&(t.lastSeen=new Date().toISOString(),c(e));}function P(r,e){let t=i(),o=t.find(u=>u.id===r);o&&(o.agents=e,c(t));}function A(){let r=s.randomBytes(32).toString("hex"),e=(parseInt(s.randomBytes(3).toString("hex"),16)%1e6).toString().padStart(6,"0"),t=s.createHash("sha256").update(e).digest("hex");return {code:e,codeHash:t,sharedSecret:r,createdAt:Date.now()}}function v(r,e){return Date.now()-r.createdAt>g?false:s.createHash("sha256").update(e).digest("hex")===r.codeHash}function h(r,e){return s.createHmac("sha256",e).update(r).digest("hex")}function R(r,e,t){let o=h(r,e);if(o.length!==t.length)return false;try{return s.timingSafeEqual(Buffer.from(o,"hex"),Buffer.from(t,"hex"))}catch{return false}}export{g as PAIRING_TTL_MS,a as PEERS_FILE,l as addPeer,h as computeHmacProof,S as findPeer,x as forgetAllPeers,A as generatePairing,i as loadPeers,m as revokePeer,c as savePeers,P as updatePeerAgents,y as updatePeerLastSeen,R as verifyHmacProof,v as verifyPairingCode};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{b as PAIRING_TTL_MS,a as PEERS_FILE,f as addPeer,m as computeHmacProof,e as findPeer,h as forgetAllPeers,k as generatePairing,c as loadPeers,g as revokePeer,d as savePeers,j as updatePeerAgents,i as updatePeerLastSeen,n as verifyHmacProof,l as verifyPairingCode}from'./chunk-J32OPJEX.js';import'./chunk-5TAVYPOV.js';
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import {k as k$1,l,n,f as f$1,m as m$1,c as c$1,j,i}from'./chunk-J32OPJEX.js';import {d,j as j$1,l as l$1,h}from'./chunk-Z34K6GY2.js';import'./chunk-5TAVYPOV.js';import*as v from'fs';import*as m from'path';import*as k from'os';import*as f from'crypto';import {WebSocketServer,WebSocket}from'ws';var X=m.join(k.homedir(),".paradigm","score"),O=2e3,x=3e4,D=1e4,N=3,L=6e4,E=1e3,H=3e4;function c(l,e){l.readyState===WebSocket.OPEN&&l.send(JSON.stringify(e));}function M(l){try{let e=typeof l=="string"?l:String(l);return JSON.parse(e)}catch{return null}}var C=class l$2{wss=null;wsClient=null;mode;pairingState=null;connectedPeers=new Map;seenMessageIds=new Set;outboxWatchInterval=null;keepaliveInterval=null;reconnectTimer=null;reconnectDelay=E;outboxPositions=new Map;events;myPeerId;port;stopped=false;failedAuthAttempts=new Map;pongTimers=new Map;serverAddress=null;serverCode=null;static MAX_SEEN_IDS=1e4;constructor(e){this.mode=e.mode,this.myPeerId=e.peerId,this.port=e.port??3939,this.events=e.events??{};}async startServer(){if(this.mode!=="server")throw new Error('startServer() requires mode "server"');return this.pairingState=k$1(),this.wss=new WebSocketServer({port:this.port}),this.wss.on("connection",(e,t)=>{let n=t.socket.remoteAddress??"unknown";if(this.isRateLimited(n)){c(e,{type:"auth_fail",reason:"Too many failed attempts \u2014 try again later"}),e.close();return}let i=f.randomBytes(32).toString("hex");c(e,{type:"hello",version:"1.0",peerId:this.myPeerId,challenge:i});let s=false;e.on("message",r=>{let o=M(r);if(o){if(!s){this.handleServerAuth(e,o,i,n).then(a=>{a&&(s=true,this.registerPeerConnection(a,e));}).catch(a=>{this.events.onError?.(a instanceof Error?a:new Error(String(a)));});return}this.handleAuthenticatedFrame(e,o);}}),e.on("close",()=>{s&&this.handlePeerDisconnect(e);}),e.on("error",r=>{this.events.onError?.(r);});}),this.wss.on("error",e=>{this.events.onError?.(e);}),await new Promise((e,t)=>{this.wss.on("listening",e),this.wss.on("error",t);}),this.startOutboxWatcher(),this.startKeepalive(),this.pairingState}async handleServerAuth(e,t,n$1,i){if(t.type!=="auth")return c(e,{type:"auth_fail",reason:"Expected auth frame"}),e.close(),null;if(!this.pairingState||!l(this.pairingState,t.code)){this.recordFailedAuth(i);let a="Invalid or expired pairing code";return c(e,{type:"auth_fail",reason:a}),this.events.onPeerAuthFailed?.(i,a),e.close(),null}let s=this.pairingState.codeHash;if(!n(n$1,s,t.proof)){this.recordFailedAuth(i);let a="HMAC proof verification failed";return c(e,{type:"auth_fail",reason:a}),this.events.onPeerAuthFailed?.(i,a),e.close(),null}let r=this.getLocalAgentSummaries(),o=this.myPeerId;return c(e,{type:"auth_ok",peerId:this.myPeerId,displayName:o,agents:r}),f$1({id:t.peerId,displayName:t.peerId,address:i,sharedSecret:this.pairingState.sharedSecret,connectedAt:new Date().toISOString(),lastSeen:new Date().toISOString(),revoked:false,agents:[]}),t.peerId}async connectToServer(e,t){if(this.mode!=="client")throw new Error('connectToServer() requires mode "client"');this.serverAddress=e,this.serverCode=t,await this.attemptConnection(e,t);}attemptConnection(e,t){return new Promise((n,i)=>{if(this.stopped){i(new Error("Relay has been stopped"));return}let s=e.includes("://")?e:`ws://${e}`,r=new WebSocket(s),o=false;r.on("open",()=>{this.wsClient=r;}),r.on("message",a=>{let d=M(a);if(d)switch(d.type){case "hello":{let R=f.createHash("sha256").update(t).digest("hex"),F=m$1(d.challenge,R);c(r,{type:"auth",peerId:this.myPeerId,code:t,proof:F});break}case "auth_ok":{f$1({id:d.peerId,displayName:d.displayName,address:e,sharedSecret:t,connectedAt:new Date().toISOString(),lastSeen:new Date().toISOString(),revoked:false,agents:d.agents}),c(r,{type:"agents_sync",agents:this.getLocalAgentSummaries()}),this.registerPeerConnection(d.peerId,r),this.startOutboxWatcher(),this.startKeepalive(),this.reconnectDelay=E,o||(o=true,n());break}case "auth_fail":{o||(o=true,i(new Error(`Auth failed: ${d.reason}`))),r.close();break}default:this.handleAuthenticatedFrame(r,d);break}}),r.on("close",()=>{this.handlePeerDisconnect(r),o?this.stopped||this.scheduleReconnect():(o=true,i(new Error("Connection closed before auth completed")));}),r.on("error",a=>{this.events.onError?.(a),o||(o=true,i(a));});})}handleAuthenticatedFrame(e,t){switch(t.type){case "message":this.handleIncomingMessage(e,t.message,t.origin);break;case "message_ack":break;case "nomination_forward":this.handleNominationForward(e,t.nomination,t.origin);break;case "agents_sync":this.handleAgentsSync(e,t.agents);break;case "agent_joined":{let n=this.peerIdForSocket(e);if(n){let s=c$1().find(r=>r.id===n);if(s){let r=[...s.agents||[],t.agent];j(n,r);}}break}case "agent_left":{let n=this.peerIdForSocket(e);if(n){let s=c$1().find(r=>r.id===n);if(s){let r=(s.agents||[]).filter(o=>o.id!==t.agentId);j(n,r);}}break}case "peer_leaving":this.handlePeerDisconnect(e),e.close();break;case "ping":c(e,{type:"pong"});break;case "pong":this.handlePong(e);break;}}handleIncomingMessage(e,t,n){if(this.seenMessageIds.has(t.id)){c(e,{type:"message_ack",messageId:t.id});return}this.addToSeenIds(t.id);let i=d();if(t.recipients&&t.recipients.length>0)for(let s of t.recipients){let r=i.find(o=>o.id===s.id);r&&(j$1(r.id,t),this.events.onMessageRelayed?.(t.id,n,r.id));}else for(let s of i)j$1(s.id,t),this.events.onMessageRelayed?.(t.id,n,s.id);if(this.mode==="server"){let s=this.peerIdForSocket(e);for(let[r,o]of this.connectedPeers)r!==s&&r!==n&&c(o,{type:"message",message:t,origin:n});}c(e,{type:"message_ack",messageId:t.id});}handleNominationForward(e,t,n){if(!t?.id)return;let i={...t,remote_origin:n,forwarded_at:new Date().toISOString()};try{let s=m.join(k.homedir(),".paradigm","events");v.mkdirSync(s,{recursive:!0});let r=m.join(s,"nominations.jsonl");v.appendFileSync(r,JSON.stringify(i)+`
3
+ `,"utf8");}catch{}if(this.mode==="server")for(let[s,r]of this.connectedPeers)r!==e&&r.readyState===WebSocket.OPEN&&c(r,{type:"nomination_forward",nomination:i,origin:n});c(e,{type:"nomination_ack",nominationId:t.id});}handleAgentsSync(e,t){let n=this.peerIdForSocket(e);n&&(j(n,t),i(n));}startOutboxWatcher(){this.outboxWatchInterval||(this.outboxWatchInterval=setInterval(()=>{if(this.connectedPeers.size!==0)try{let e=d();for(let t of e){let n=l$1(t.id),i=this.outboxPositions.get(t.id)??0;if(n.length<=i)continue;let s=n.slice(i);for(let r of s){if(this.seenMessageIds.has(r.id))continue;this.addToSeenIds(r.id);let o={type:"message",message:r,origin:this.myPeerId};for(let[a,d]of this.connectedPeers)c(d,o);}this.outboxPositions.set(t.id,n.length);}}catch(e){this.events.onError?.(e instanceof Error?e:new Error(String(e)));}},O));}stopOutboxWatcher(){this.outboxWatchInterval&&(clearInterval(this.outboxWatchInterval),this.outboxWatchInterval=null);}startKeepalive(){this.keepaliveInterval||(this.keepaliveInterval=setInterval(()=>{for(let[e,t]of this.connectedPeers){c(t,{type:"ping"});let n=setTimeout(()=>{this.handlePeerDisconnect(t),t.terminate();},D);this.pongTimers.set(e,n);}},x));}stopKeepalive(){this.keepaliveInterval&&(clearInterval(this.keepaliveInterval),this.keepaliveInterval=null);for(let e of this.pongTimers.values())clearTimeout(e);this.pongTimers.clear();}handlePong(e){let t=this.peerIdForSocket(e);if(t){let n=this.pongTimers.get(t);n&&(clearTimeout(n),this.pongTimers.delete(t)),i(t);}}registerPeerConnection(e,t){let n=this.connectedPeers.get(e);n&&n!==t&&n.close(),this.connectedPeers.set(e,t),i(e),this.events.onPeerConnected?.(e,e);}handlePeerDisconnect(e){let t=this.peerIdForSocket(e);if(!t)return;this.connectedPeers.delete(t);let n=this.pongTimers.get(t);n&&(clearTimeout(n),this.pongTimers.delete(t)),this.events.onPeerDisconnected?.(t);}peerIdForSocket(e){for(let[t,n]of this.connectedPeers)if(n===e)return t;return null}scheduleReconnect(){if(this.stopped||this.mode!=="client"||!this.serverAddress||!this.serverCode)return;this.stopOutboxWatcher(),this.stopKeepalive(),this.wsClient=null;let e=this.reconnectDelay;this.reconnectDelay=Math.min(this.reconnectDelay*2,H),this.reconnectTimer=setTimeout(()=>{this.stopped||this.attemptConnection(this.serverAddress,this.serverCode).catch(t=>{this.events.onError?.(t instanceof Error?t:new Error(String(t)));});},e);}isRateLimited(e){let t=this.failedAuthAttempts.get(e);return t?Date.now()<t.cooldownUntil?true:t.count>=N?(t.cooldownUntil=Date.now()+L,true):false:false}recordFailedAuth(e){let t=this.failedAuthAttempts.get(e);t?t.count++:this.failedAuthAttempts.set(e,{count:1,cooldownUntil:0});}addToSeenIds(e){if(this.seenMessageIds.add(e),this.seenMessageIds.size>l$2.MAX_SEEN_IDS){let t=Array.from(this.seenMessageIds),n=Math.floor(t.length/2);this.seenMessageIds=new Set(t.slice(n));}}getLocalAgentSummaries(){return d().map(e=>({id:e.id,project:e.project,role:e.role,status:h(e)?"asleep":"awake"}))}stop(){this.stopped=true;for(let[e,t]of this.connectedPeers)c(t,{type:"peer_leaving"}),t.close();this.connectedPeers.clear(),this.wsClient&&(this.wsClient.close(),this.wsClient=null),this.stopOutboxWatcher(),this.stopKeepalive(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.wss&&(this.wss.close(),this.wss=null);}getConnectedPeers(){return Array.from(this.connectedPeers.keys())}getRemoteAgents(){let e=[],t=c$1();for(let n of this.connectedPeers.keys()){let i=t.find(s=>s.id===n);if(i?.agents)for(let s of i.agents)e.push({...s,peerId:n});}return e}rotatePairingCode(){if(this.mode!=="server")throw new Error('rotatePairingCode() requires mode "server"');return this.pairingState=k$1(),this.pairingState}};export{X as SCORE_DIR,C as SymphonyRelay};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{a as syncCommand}from'./chunk-QNZEG7IT.js';import'./chunk-HMQ5BHP2.js';import'./chunk-JQKKVAAN.js';import'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import {d}from'./chunk-HMQ5BHP2.js';import'./chunk-JQKKVAAN.js';import {a as a$1}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as a from'fs';import*as c from'path';import*as j from'js-yaml';import p from'chalk';import $ from'ora';async function x(y){let r=process.cwd(),e=$();console.log(p.blue(`
3
+ Paradigm Sync LLMs
4
+ `)),e.start("Loading .paradigm/ configuration...");let i=d(r);i||(e.fail("No .paradigm/ directory found"),console.log(p.gray("\nRun `paradigm init` to initialize Paradigm in this project.\n")),a$1.command("sync-llms").error("Missing .paradigm/ directory"),process.exit(1)),e.succeed(`Loaded configuration for ${p.cyan(i.projectName)}`),a$1.command("sync-llms").debug("Configuration loaded",{projectName:i.projectName}),e.start("Reading navigator.yaml...");let g=null,h=c.join(r,".paradigm","navigator.yaml");if(a.existsSync(h))try{let n=a.readFileSync(h,"utf8");g=j.load(n),e.succeed("Loaded navigator.yaml");}catch{e.warn("Could not parse navigator.yaml, skipping key files section"),a$1.command("sync-llms").warn("Failed to parse navigator.yaml");}else e.info("No navigator.yaml found, skipping key files section");let o=null,f=c.join(r,".paradigm","flows.yaml");if(a.existsSync(f))try{let n=a.readFileSync(f,"utf8");o=j.load(n);}catch{a$1.command("sync-llms").warn("Failed to parse flows.yaml");}let d$1=null,m=c.join(r,"portal.yaml");if(a.existsSync(m))try{let n=a.readFileSync(m,"utf8");d$1=j.load(n);}catch{a$1.command("sync-llms").warn("Failed to parse portal.yaml");}e.start("Generating llms.txt...");let w=b(i,g,o,d$1),t=y.output?c.resolve(r,y.output):c.join(r,"llms.txt");try{a.writeFileSync(t,w,"utf8"),e.succeed(p.green("Generated llms.txt")),console.log(p.gray(`
5
+ Path: ${c.relative(r,t)}`)),console.log(""),a$1.command("sync-llms").success("llms.txt generated",{path:t});}catch(n){e.fail(p.red("Failed to write llms.txt")),a$1.command("sync-llms").error("Write failed",{error:n.message}),process.exit(1);}}function b(y,r,e,i){let{config:g,projectName:h}=y,o=[];o.push(`# ${g.project||h}`);let f=g["agent-guidelines"]?.overview?.trim();f&&o.push(`> ${f.replace(/\n/g,`
6
+ > `)}`);let d=g["symbol-system"];if(d){let t=["## Symbols",""];t.push("| Prefix | Name | Description |"),t.push("|--------|------|-------------|");for(let[n,s]of Object.entries(d))["#","$","^","!","~"].includes(n)&&t.push(`| \`${n}\` | ${s.name} | ${s.description} |`);o.push(t.join(`
7
+ `));}if(r?.key_files){let t=["## Key Files",""];for(let[n,s]of Object.entries(r.key_files))if(s&&s.length>0){t.push(`### ${n.charAt(0).toUpperCase()+n.slice(1)}`),t.push("");for(let u of s)t.push(`- \`${u}\``);t.push("");}t.length>2&&o.push(t.join(`
8
+ `).trimEnd());}if(e?.flows&&Object.keys(e.flows).length>0){let t=["## Flows",""];for(let[n,s]of Object.entries(e.flows)){let u=s.name||s.description||n,F=s.trigger?` (trigger: \`${s.trigger}\`)`:"";t.push(`- **$${n}**: ${u}${F}`);}o.push(t.join(`
9
+ `));}if(i?.gates&&Object.keys(i.gates).length>0){let t=["## Gates",""];t.push("| Gate | Description |"),t.push("|------|-------------|");for(let[n,s]of Object.entries(i.gates)){let u=s.description||"";t.push(`| \`^${n}\` | ${u} |`);}if(i.routes&&Object.keys(i.routes).length>0){t.push(""),t.push("### Protected Routes"),t.push("");for(let[n,s]of Object.entries(i.routes))t.push(`- \`${n}\`: ${s.join(", ")}`);}o.push(t.join(`
10
+ `));}let m=g.conventions;if(m&&m.length>0){let t=["## Conventions",""];for(let n of m)t.push(`- ${n}`);o.push(t.join(`
11
+ `));}let w=["## Further Reading","","- `.paradigm/specs/` - Detailed specifications","- `.paradigm/docs/` - Commands, patterns, troubleshooting","- `CLAUDE.md` - AI agent instructions (Claude Code)","- `AGENTS.md` - Universal agent instructions"];return o.push(w.join(`
12
+ `)),o.join(`
13
+
14
+ `)+`
15
+ `}export{x as syncLlmsCommand};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{e as completeTask,c as createTask,b as loadTask,a as loadTasks,g as rebuildTaskIndex,f as shelveTask,d as updateTask}from'./chunk-DVZWCXB6.js';import'./chunk-5TAVYPOV.js';
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{e as teamAcceptCommand,f as teamCheckCommand,d as teamHandoffCommand,g as teamHistoryCommand,b as teamInitCommand,a as teamModelsCommand,h as teamResetCommand,c as teamStatusCommand}from'./chunk-NXRVR37G.js';import'./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-Y4XFVDZC.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';
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+ import {a}from'./chunk-QT2LKB3P.js';import'./chunk-5TAVYPOV.js';import*as y from'path';import*as h from'fs';import p from'chalk';var R=null;function G(e){R=e;}function k(){return R}async function O(e,s,t){let n=t||k();if(!n)return {passed:false,results:[],errors:["No gate client configured"]};let o=[],r=[];for(let i of s)try{let c=await n.check(e,i.entity),u=c.passed===i.expected;if(i.expectedPrizes&&c.passed){let a=c.triggeredPrizes.map(l=>l.id),f=i.expectedPrizes.filter(l=>!a.includes(l));f.length>0&&r.push(`Test "${i.name}": Expected prizes not triggered: ${f.join(", ")}`);}o.push({testCase:i,result:c,passed:u}),u||r.push(`Test "${i.name}": Expected ${i.expected?"pass":"fail"}, got ${c.passed?"pass":"fail"}`);}catch(c){r.push(`Test "${i.name}": ${c.message}`),o.push({testCase:i,result:{gate:{id:e,locks:[],prizes:[]},passed:false,lockResults:[],triggeredPrizes:[],timestamp:Date.now()},passed:false});}return {passed:r.length===0,results:o,errors:r}}async function T(e,s={}){let{outputDir:t="tests/gates",framework:n="jest",includeFlows:o=true}=s,r=await a(e),i=[],c=y.resolve(t);h.existsSync(c)||h.mkdirSync(c,{recursive:true});for(let u of r.gates){let a=N(u,n),f=`${u.id.replace(/[^a-z0-9]/gi,"-")}.test.ts`,l=y.join(c,f);h.writeFileSync(l,a,"utf8"),i.push(l);}if(o&&r.flows.length>0){let u=y.join(c,"..","flows");h.existsSync(u)||h.mkdirSync(u,{recursive:true});for(let a of r.flows){let f=z(a,r.gates,n),l=`${a.id.replace(/[^a-z0-9]/gi,"-")}.test.ts`,d=y.join(u,l);h.writeFileSync(d,f,"utf8"),i.push(d);}}return i}function N(e,s){let t=s==="mocha"||s==="vitest"?"it":"test",n=e.id,o=e.description||n,r=e.locks.map(i=>{let c=i.keys.map((u,a)=>` ${t}('should check key: ${u.description||`Key ${a+1}`}', async () => {
3
+ const entity = {
4
+ // TODO: Add entity properties needed for this key
5
+ // Key expression: ${u.expression}
6
+ };
7
+
8
+ const result = await checkGateway('${n}', entity);
9
+ // TODO: Assert expected result
10
+ expect(result.passed).toBeDefined();
11
+ });`);return ` describe('Lock: ${i.description||i.id}', () => {
12
+ ${c.join(`
13
+
14
+ `)}
15
+ });`});return `/**
16
+ * Generated test file for gate: ${o}
17
+ * Gate ID: ${n}
18
+ *
19
+ * TODO: Fill in entity mock data and expected results
20
+ */
21
+
22
+ import { checkGateway, validateGateway } from '@a-company/portal-manager';
23
+ import { createGate, setGateClient } from '@a-company/portal-sdk';
24
+ import { parseGateConfig } from '@a-company/portal-core';
25
+
26
+ ${s==="vitest"?"import { describe, it, expect, beforeAll } from 'vitest';":s==="mocha"?"import { describe, it } from 'mocha';":"import { describe, test as it, expect, beforeAll } from '@jest/globals';"}
27
+
28
+ describe('Gate: ${o}', () => {
29
+ beforeAll(async () => {
30
+ // Load gate configuration
31
+ const config = await parseGateConfig('./portal.yaml');
32
+ const client = createGate(config);
33
+ setGateClient(client);
34
+ });
35
+
36
+ ${r.join(`
37
+
38
+ `)}
39
+
40
+ ${t}('should trigger prizes when gate passes', async () => {
41
+ const entity = {
42
+ // TODO: Add entity that passes all locks
43
+ };
44
+
45
+ const result = await checkGateway('${n}', entity);
46
+
47
+ if (result.passed) {
48
+ expect(result.triggeredPrizes.length).toBeGreaterThan(0);
49
+ // TODO: Assert specific prizes
50
+ ${e.prizes.map(i=>`// expect(result.triggeredPrizes).toContainEqual(expect.objectContaining({ id: '${i.id}' }));`).join(`
51
+ `)}
52
+ }
53
+ });
54
+ });
55
+ `}function z(e,s,t){let n=t==="mocha"||t==="vitest"?"it":"test",o=e.description||e.id,r=e.gates.map((i,c)=>` ${n}('should pass gate ${c+1}: ${i}', async () => {
56
+ const entity = {
57
+ // TODO: Add entity properties
58
+ };
59
+
60
+ const result = await checkGateway('${i}', entity);
61
+ expect(result.passed).toBe(true);
62
+ });`);return `/**
63
+ * Generated test file for flow: ${o}
64
+ * Flow ID: ${e.id}
65
+ *
66
+ * TODO: Fill in entity mock data for each gate in the flow
67
+ */
68
+
69
+ import { checkGateway } from '@a-company/portal-manager';
70
+ import { createGate, setGateClient } from '@a-company/portal-sdk';
71
+ import { parseGateConfig } from '@a-company/portal-core';
72
+
73
+ ${t==="vitest"?"import { describe, it, expect, beforeAll } from 'vitest';":t==="mocha"?"import { describe, it } from 'mocha';":"import { describe, test as it, expect, beforeAll } from '@jest/globals';"}
74
+
75
+ describe('Flow: ${o}', () => {
76
+ beforeAll(async () => {
77
+ const config = await parseGateConfig('./portal.yaml');
78
+ const client = createGate(config);
79
+ setGateClient(client);
80
+ });
81
+
82
+ ${n}('should complete entire flow', async () => {
83
+ const entity = {
84
+ // TODO: Add entity that passes all gates in flow
85
+ };
86
+
87
+ ${r.join(`
88
+
89
+ `)}
90
+ });
91
+ });
92
+ `}async function x(e){let{rootDir:s,patterns:t=["**/*.tsx","**/*.jsx"]}=e,n=[],o=new Set;function r(i){try{let c=h.readdirSync(i,{withFileTypes:!0});for(let u of c){let a=y.join(i,u.name);if(!(u.name==="node_modules"||u.name===".git"||u.name==="dist"||u.name==="build")){if(u.isDirectory())r(a);else if(u.isFile()&&t.some(l=>{if(l.includes("**")){let d=l.split(".").pop();return a.endsWith(`.${d}`)}return a.endsWith(l)})&&!o.has(a)){o.add(a);let l=j(a);l&&n.push(l);}}}}catch{}}return r(s),n}function j(e){try{let s=h.readFileSync(e,"utf8"),t=y.basename(e,y.extname(e)),n=[/@Gate\(['"]([^'"]+)['"]\)/g,/@Gateway\(['"]([^'"]+)['"]\)/g,/GateGuard\(['"]([^'"]+)['"]\)/g,/checkGateway\(['"]([^'"]+)['"]/g,/gate:\s*['"]([^'"]+)['"]/g],o=new Set,r=[];for(let c of n){let u;for(;(u=c.exec(s))!==null;){let a=u[1];a&&a.startsWith("^")&&o.add(a);}}let i=s.includes("checkGateway")||s.includes("GateGuard")||s.includes("Gateway")||s.includes("useGate");return o.size>0&&!i&&r.push(...Array.from(o)),{filePath:e,componentName:t,requiredGates:Array.from(o),missingChecks:r}}catch{return null}}function P(e){let s=[];s.push(`# Component Access Report
93
+ `),s.push(`Generated: ${new Date().toISOString()}
94
+ `),s.push(`Total Components: ${e.length}
95
+ `);let t=e.filter(n=>n.missingChecks.length>0);if(t.length>0){s.push(`
96
+ ## Components Missing Gate Checks (${t.length})
97
+ `);for(let n of t)s.push(`### ${n.componentName}`),s.push(`File: ${n.filePath}`),s.push(`Missing checks for gates: ${n.missingChecks.join(", ")}
98
+ `);}else s.push(`
99
+ \u2705 All components have proper gate checks!
100
+ `);return s.join(`
101
+ `)}function L(e){let s=[],t=0;for(;t<e.length;){let n=e[t];if(/\s/.test(n)){t++;continue}if(n==='"'||n==="'"){let o=n,r="";for(t++;t<e.length&&e[t]!==o;)e[t]==="\\"&&t+1<e.length&&t++,r+=e[t],t++;t++,s.push({type:"STRING",value:r});continue}if(/\d/.test(n)){let o="";for(;t<e.length&&/[\d.]/.test(e[t]);)o+=e[t],t++;s.push({type:"NUMBER",value:o});continue}if(/[a-zA-Z_]/.test(n)){let o="";for(;t<e.length&&/[a-zA-Z0-9_]/.test(e[t]);)o+=e[t],t++;o==="true"||o==="false"?s.push({type:"BOOLEAN",value:o}):o==="null"||o==="undefined"?s.push({type:"NULL",value:o}):["and","or","not","includes","in"].includes(o)?s.push({type:"OPERATOR",value:o}):s.push({type:"IDENTIFIER",value:o});continue}if(e.slice(t,t+3)==="==="||e.slice(t,t+3)==="!=="){s.push({type:"OPERATOR",value:e.slice(t,t+3)}),t+=3;continue}if(e.slice(t,t+2)==="=="||e.slice(t,t+2)==="!="||e.slice(t,t+2)==="<="||e.slice(t,t+2)===">="||e.slice(t,t+2)==="&&"||e.slice(t,t+2)==="||"){s.push({type:"OPERATOR",value:e.slice(t,t+2)}),t+=2;continue}if("<>=!".includes(n)){s.push({type:"OPERATOR",value:n}),t++;continue}if(n==="("){s.push({type:"LPAREN",value:n}),t++;continue}if(n===")"){s.push({type:"RPAREN",value:n}),t++;continue}if(n==="."){s.push({type:"DOT",value:n}),t++;continue}if(n===","){s.push({type:"COMMA",value:n}),t++;continue}t++;}return s.push({type:"EOF",value:""}),s}var M=class{tokens;pos;context;constructor(e,s){this.tokens=e,this.pos=0,this.context=s;}current(){return this.tokens[this.pos]||{type:"EOF",value:""}}advance(){let e=this.current();return this.pos++,e}evaluate(){return this.parseOr()}parseOr(){let e=this.parseAnd();for(;this.current().value==="||"||this.current().value==="or";){this.advance();let s=this.parseAnd();e=!!e||!!s;}return e}parseAnd(){let e=this.parseNot();for(;this.current().value==="&&"||this.current().value==="and";){this.advance();let s=this.parseNot();e=!!e&&!!s;}return e}parseNot(){return this.current().value==="!"||this.current().value==="not"?(this.advance(),!this.parseNot()):this.parseComparison()}parseComparison(){let e=this.parsePrimary(),s=this.current();if(s.type==="OPERATOR")switch(s.value){case "==":case "===":return this.advance(),e===this.parsePrimary();case "!=":case "!==":return this.advance(),e!==this.parsePrimary();case "<":return this.advance(),e<this.parsePrimary();case ">":return this.advance(),e>this.parsePrimary();case "<=":return this.advance(),e<=this.parsePrimary();case ">=":return this.advance(),e>=this.parsePrimary();case "includes":this.advance();let t=this.parsePrimary();return Array.isArray(e)?e.includes(t):typeof e=="string"?e.includes(String(t)):false;case "in":this.advance();let n=this.parsePrimary();return Array.isArray(n)?n.includes(e):false}return e}parsePrimary(){let e=this.current();if(e.type==="LPAREN"){this.advance();let s=this.parseOr();return this.current().type==="RPAREN"&&this.advance(),s}return e.type==="STRING"?(this.advance(),e.value):e.type==="NUMBER"?(this.advance(),parseFloat(e.value)):e.type==="BOOLEAN"?(this.advance(),e.value==="true"):e.type==="NULL"?(this.advance(),null):e.type==="IDENTIFIER"?this.parseIdentifier():null}parseIdentifier(){let e=this.context;for(;this.current().type==="IDENTIFIER"||this.current().type==="DOT";){if(this.current().type==="DOT"){this.advance();continue}let s=this.advance().value;if(e!==null&&typeof e=="object"&&!Array.isArray(e)?e=e[s]:e=void 0,this.current().type==="LPAREN"){this.advance();let t=[];for(;this.current().type!=="RPAREN"&&this.current().type!=="EOF";)t.push(this.parseOr()),this.current().type==="COMMA"&&this.advance();return this.current().type==="RPAREN"&&this.advance(),this.callMethod(s,e,t)}if(this.current().type!=="DOT")break}return e}callMethod(e,s,t){switch(e){case "includes":return Array.isArray(s)?s.includes(t[0]):typeof s=="string"?s.includes(String(t[0])):false;case "startsWith":return typeof s=="string"?s.startsWith(String(t[0])):false;case "endsWith":return typeof s=="string"?s.endsWith(String(t[0])):false;case "length":return Array.isArray(s)||typeof s=="string"?s.length:0;default:return null}}};function S(e,s){try{let t=L(e);return {passed:!!new M(t,s).evaluate()}}catch(t){return {passed:false,error:t.message}}}var B=class{config;prizeHandlers=new Map;firedPrizes=[];ws=null;options;entityIdResolver;constructor(e,s={}){this.config=e,this.options=s,this.entityIdResolver=s.entityIdResolver||this.defaultEntityIdResolver,s.devMode&&this.connectWatcher();}defaultEntityIdResolver(e){return e.id||e._id||e.userId||e.entityId||"anonymous"}connectWatcher(){let e=this.options.watcherUrl||`ws://localhost:${this.config.settings.dev.watcherPort}`;try{typeof WebSocket<"u"&&(this.ws=new WebSocket(e),this.ws.onopen=()=>{console.log("[Gate SDK] Connected to watcher");},this.ws.onerror=()=>{console.warn("[Gate SDK] Failed to connect to watcher");},this.ws.onclose=()=>{setTimeout(()=>this.connectWatcher(),5e3);});}catch{console.warn("[Gate SDK] WebSocket not available for watcher connection");}}sendWatcherEvent(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e));}onPrize(e,s){return this.prizeHandlers.has(e)||this.prizeHandlers.set(e,[]),this.prizeHandlers.get(e).push(s),()=>{let t=this.prizeHandlers.get(e);if(t){let n=t.indexOf(s);n>=0&&t.splice(n,1);}}}async check(e,s){let t=this.config.gates.find(a=>a.id===e);if(!t)throw new Error(`Gate not found: ${e}`);let n=this.entityIdResolver(s),o=Date.now();this.sendWatcherEvent({type:"gate:check",timestamp:o,entityId:n,data:{gate:t,entitySnapshot:s}});let r=[],i=true;for(let a of t.locks){let f=[],l;if(a.mode==="any"){l=false;for(let d of a.keys){let{passed:v,error:C}=S(d.expression,s);f.push({key:d,passed:v,error:C}),v&&(l=true);}}else {l=true;for(let d of a.keys){let{passed:v,error:C}=S(d.expression,s);f.push({key:d,passed:v,error:C}),v||(l=false);}}r.push({lock:a,passed:l,keyResults:f}),l||(i=false);}let c=[];if(i)for(let a of t.prizes){if(a.oneTime&&this.firedPrizes.some(d=>d.entityId===n&&d.prizeId===a.id))continue;c.push(a),a.oneTime&&this.firedPrizes.push({entityId:n,prizeId:a.id,timestamp:o});let f=this.prizeHandlers.get(a.id)||[];for(let l of f)try{await l(s,{gate:t,prize:a,timestamp:o});}catch(d){console.error(`[Gate SDK] Prize handler error for ${a.id}:`,d);}this.sendWatcherEvent({type:"prize:fire",timestamp:Date.now(),entityId:n,data:{prizeId:a.id,metadata:a.metadata}});}let u={gate:t,passed:i,lockResults:r,triggeredPrizes:c,timestamp:o,entitySnapshot:s};return this.sendWatcherEvent({type:i?"gate:pass":"gate:fail",timestamp:Date.now(),entityId:n,data:u}),u}getGate(e){return this.config.gates.find(s=>s.id===e)}getGates(){return this.config.gates}getFlows(){return this.config.flows}resetPrizes(e){e?this.firedPrizes=this.firedPrizes.filter(s=>s.entityId!==e):this.firedPrizes=[];}disconnect(){this.ws&&(this.ws.close(),this.ws=null);}};async function F(e,s={}){let t=await a(e),n=s.devMode??process.env.NODE_ENV!=="production";return new B(t,{...s,devMode:n})}typeof process<"u"?process.env.NODE_ENV==="production":typeof import.meta<"u"&&import.meta.env?.PROD;typeof process<"u"?process.env.PORTAL_VALIDATION==="true":typeof import.meta<"u"&&import.meta.env?.VITE_ENABLE_PORTAL_VALIDATION==="true";typeof process<"u"?process.env.PORTAL_TEST_MODE==="true":typeof import.meta<"u"&&import.meta.env?.VITE_TEST_MODE==="true";function $(e){let s=/\b([a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)+)/g,t=new Set,n;for(;(n=s.exec(e))!==null;)t.add(n[1]);return [...t]}function b(e){let s=e.split("."),t={},n=t;for(let o=0;o<s.length;o++){let r=s[o];if(o===s.length-1)n[r]="test-value";else {let i={};n[r]=i,n=i;}}return t}function E(e,s){let t={...e};for(let[n,o]of Object.entries(s))o&&typeof o=="object"&&!Array.isArray(o)&&t[n]&&typeof t[n]=="object"&&!Array.isArray(t[n])?t[n]=E(t[n],o):t[n]=o;return t}function W(e){let s=[];if(!e.locks||e.locks.length===0)return s.push({name:`${e.id}: no locks (should pass)`,entity:{user:{id:"test-user"}},expected:true}),s;let t={};for(let n of e.locks)for(let o of n.keys){let r=$(o.expression);for(let i of r){let c=b(i);t=E(t,c);}}s.push({name:`${e.id}: entity satisfying all locks (should pass)`,entity:t,expected:true});for(let n of e.locks){let o=[];for(let r of n.keys)o.push(...$(r.expression));if(o.length>0){let r={};for(let i of e.locks)if(i.id!==n.id)for(let c of i.keys){let u=$(c.expression);for(let a of u){let f=b(a);Object.assign(r,E(r,f));}}s.push({name:`${e.id}: missing lock "${n.id}" properties (should fail)`,entity:e.locks.length===1?{}:r,expected:false});}}return s}async function le(e,s){let t=e?y.resolve(e):process.cwd(),n=y.join(t,"portal.yaml");if(h.existsSync(n)||(console.error(p.red(`\u274C portal.yaml not found at ${n}`)),console.error(p.gray(" Run `paradigm init` or create portal.yaml manually")),process.exit(1)),s.generate){console.log(p.blue(`
102
+ \u{1F527} Generating test files...
103
+ `));try{let o=await T(n,{outputDir:s.output||"tests/gates",framework:s.framework||"jest",includeFlows:!0});console.log(p.green(`\u2705 Generated ${o.length} test files:`));for(let r of o)console.log(p.gray(` ${y.relative(t,r)}`));console.log("");}catch(o){console.error(p.red(`\u274C Error generating tests: ${o.message}`)),process.exit(1);}return}if(s.component){console.log(p.blue(`
104
+ \u{1F50D} Scanning components for gate checks...
105
+ `));try{let o=await x({rootDir:t,gateConfigPath:n}),r=P(o);console.log(r),o.filter(c=>c.missingChecks.length>0).length>0&&process.exit(1);}catch(o){console.error(p.red(`\u274C Error scanning components: ${o.message}`)),process.exit(1);}return}if(s.gate){console.log(p.blue(`
106
+ \u{1F9EA} Testing gate: ${s.gate}
107
+ `));try{let o=await a(n),r=await F(n);G(r);let i=o.gates.find(a=>a.id===s.gate);i||(console.error(p.red(`\u274C Gate "${s.gate}" not found`)),process.exit(1));let c=[{name:"Empty entity (should fail)",entity:{},expected:!1},...W(i)],u=await O(s.gate,c,r);if(u.passed)console.log(p.green(`\u2705 All tests passed
108
+ `));else {console.log(p.red(`\u274C Some tests failed
109
+ `));for(let a of u.errors)console.log(p.red(` ${a}`));console.log(""),process.exit(1);}}catch(o){console.error(p.red(`\u274C Error testing gate: ${o.message}`)),process.exit(1);}return}console.log(p.blue(`
110
+ \u{1F9EA} Portal Testing
111
+ `)),console.log("Usage:"),console.log(" paradigm portal test --generate Generate test files"),console.log(" paradigm portal test --portal ^auth-required Test specific portal"),console.log(" paradigm portal test --component Validate component access"),console.log("");}export{le as gateTestCommand};
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ import'./chunk-5TAVYPOV.js';import*as o from'fs';import*as f from'path';import c from'chalk';import*as p from'js-yaml';var b=`# Thread - Session Continuity
3
+
4
+ > Pass context between AI agent sessions. Updated by \`paradigm thread save\`.
5
+
6
+ ## Last Session: {timestamp}
7
+
8
+ ### Trail (What was done)
9
+ {trail}
10
+
11
+ ### Loose Ends (Unfinished)
12
+ {looseEnds}
13
+
14
+ ### Breadcrumbs (Notes for next agent)
15
+ {breadcrumbs}
16
+
17
+ ---
18
+ *Run \`paradigm thread save "message"\` to update*
19
+ *Run \`paradigm thread clear\` to reset*
20
+ `;function u(){try{let t=f.join(process.cwd(),".paradigm","config.yaml");if(o.existsSync(t)){let n=o.readFileSync(t,"utf8"),r=p.load(n)?.limits;if(r?.threadTrailMax&&typeof r.threadTrailMax=="number")return r.threadTrailMax}}catch{}return 10}function m(t){let n={trail:[],looseEnds:[],breadcrumbs:[]},l=t.match(/## Last Session: (.+)/);l&&(n.lastSession=l[1].trim());let r=t.match(/### Trail \(What was done\)\n([\s\S]*?)(?=\n### |$)/);if(r){let e=r[1].split(`
21
+ `).filter(s=>s.startsWith("- "));for(let s of e){let i=s.replace(/^- /,"").trim();if(i&&i!=="_No activity recorded yet_"){let h=i.match(/[@#^!$%~?][\w-]+/g)||[];n.trail.push({timestamp:n.lastSession||new Date().toISOString(),message:i,symbols:h.length>0?h:void 0});}}}let d=t.match(/### Loose Ends \(Unfinished\)\n([\s\S]*?)(?=\n### |$)/);if(d){let e=d[1].split(`
22
+ `).filter(s=>s.startsWith("- "));for(let s of e){let i=s.replace(/^- \[[ x]\] /,"").replace(/^- /,"").trim();i&&i!=="_No pending tasks_"&&n.looseEnds.push(i);}}let a=t.match(/### Breadcrumbs \(Notes for next agent\)\n([\s\S]*?)(?=\n---|$)/);if(a){let e=a[1].split(`
23
+ `).filter(s=>s.startsWith("- "));for(let s of e){let i=s.replace(/^- /,"").trim();i&&i!=="_No notes yet_"&&n.breadcrumbs.push(i);}}return n}function g(t){let n=new Date().toISOString().replace("T"," ").split(".")[0],l="_No activity recorded yet_";t.trail.length>0&&(l=t.trail.slice(-u()).map(a=>`- ${a.message}`).join(`
24
+ `));let r="_No pending tasks_";t.looseEnds.length>0&&(r=t.looseEnds.map(a=>`- [ ] ${a}`).join(`
25
+ `));let d="_No notes yet_";return t.breadcrumbs.length>0&&(d=t.breadcrumbs.slice(-u()).map(a=>`- ${a}`).join(`
26
+ `)),b.replace("{timestamp}",n).replace("{trail}",l).replace("{looseEnds}",r).replace("{breadcrumbs}",d)}async function w(t,n={}){let l=process.cwd(),r=t?f.resolve(l,t):l,d=f.join(r,".paradigm","thread.md");if(!o.existsSync(d)){if(n.json){console.log(JSON.stringify({exists:false,trail:[],looseEnds:[],breadcrumbs:[]},null,2));return}console.log(c.yellow(`
27
+ \u{1F4DC} No thread found.
28
+ `)),console.log(c.gray(' Run `paradigm thread save "message"` to start a thread.\n'));return}let a=o.readFileSync(d,"utf8"),e=m(a);if(n.json){console.log(JSON.stringify({exists:true,lastSession:e.lastSession,trail:e.trail,looseEnds:e.looseEnds,breadcrumbs:e.breadcrumbs},null,2));return}if(console.log(c.blue(`
29
+ \u{1F4DC} Current Thread
30
+ `)),console.log(c.gray("\u2500".repeat(50))),e.lastSession&&(console.log(c.white(`Last Session: ${c.cyan(e.lastSession)}`)),console.log("")),e.trail.length>0){console.log(c.white("Trail (What was done):"));for(let s of e.trail.slice(-5))console.log(c.gray(` - ${s.message}`));e.trail.length>5&&console.log(c.gray(` ... and ${e.trail.length-5} more`)),console.log("");}if(e.looseEnds.length>0){console.log(c.white("Loose Ends (Unfinished):"));for(let s of e.looseEnds)console.log(c.yellow(` \u25A1 ${s}`));console.log("");}if(e.breadcrumbs.length>0){console.log(c.white("Breadcrumbs (Notes):"));for(let s of e.breadcrumbs.slice(-5))console.log(c.gray(` - ${s}`));console.log("");}console.log(c.gray(`Path: ${d}
31
+ `));}async function T(t,n,l={}){let r=process.cwd(),d=n?f.resolve(r,n):r,a=f.join(d,".paradigm"),e=f.join(a,"thread.md");o.existsSync(a)||o.mkdirSync(a,{recursive:true});let s={trail:[],looseEnds:[],breadcrumbs:[]};if(o.existsSync(e)){let y=o.readFileSync(e,"utf8");s=m(y);}let i=t.match(/[@#^!$%~?][\w-]+/g)||[];s.trail.push({timestamp:new Date().toISOString(),message:t,symbols:i.length>0?i:void 0});let h=g(s);o.writeFileSync(e,h,"utf8"),l.quiet||console.log(c.green(`
32
+ \u2713 Thread updated: ${t}
33
+ `));}async function x(t,n,l={}){let r=process.cwd(),d=n?f.resolve(r,n):r,a=f.join(d,".paradigm"),e=f.join(a,"thread.md");o.existsSync(a)||o.mkdirSync(a,{recursive:true});let s={trail:[],looseEnds:[],breadcrumbs:[]};if(o.existsSync(e)){let h=o.readFileSync(e,"utf8");s=m(h);}s.looseEnds.push(t);let i=g(s);o.writeFileSync(e,i,"utf8"),l.quiet||console.log(c.yellow(`
34
+ \u25A1 Loose end added: ${t}
35
+ `));}async function E(t,n,l={}){let r=process.cwd(),d=n?f.resolve(r,n):r,a=f.join(d,".paradigm"),e=f.join(a,"thread.md");o.existsSync(a)||o.mkdirSync(a,{recursive:true});let s={trail:[],looseEnds:[],breadcrumbs:[]};if(o.existsSync(e)){let h=o.readFileSync(e,"utf8");s=m(h);}s.breadcrumbs.push(t);let i=g(s);o.writeFileSync(e,i,"utf8"),l.quiet||console.log(c.cyan(`
36
+ \u{1F4CC} Breadcrumb added: ${t}
37
+ `));}async function $(t,n={}){let l=process.cwd(),r=t?f.resolve(l,t):l,d=f.join(r,".paradigm","thread.md");if(o.existsSync(d)){let e=g({trail:[],looseEnds:[],breadcrumbs:[]});o.writeFileSync(d,e,"utf8"),n.quiet||console.log(c.green(`
38
+ \u2713 Thread cleared.
39
+ `));}else n.quiet||console.log(c.gray(`
40
+ No thread to clear.
41
+ `));}export{$ as threadClearCommand,E as threadNoteCommand,T as threadSaveCommand,w as threadShowCommand,x as threadTodoCommand};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import {d}from'./chunk-WS2N27RX.js';import'./chunk-5TAVYPOV.js';import n from'chalk';async function w(c){let y=process.cwd(),h=parseInt(c.limit||"20",10),i=await d(y,{limit:h});if(i.length===0){c.json?console.log(JSON.stringify({entries:[],byDate:{},hotSymbols:[],authors:[]},null,2)):console.log(n.gray(`
3
+ No lore entries found.
4
+ `));return}let r=new Map;for(let o of i){let t=o.timestamp.slice(0,10);r.has(t)||r.set(t,[]),r.get(t).push(o);}let a=new Map;for(let o of i)for(let t of o.symbols_touched||[])a.set(t,(a.get(t)||0)+1);let g=Array.from(a.entries()).sort(([,o],[,t])=>t-o).slice(0,10).map(([o,t])=>({symbol:o,count:t})),l=new Map;for(let o of i){let t=o.author,e=l.get(t);e?(e.count++,o.agent&&(e.hasAgent=true),o.timestamp>e.lastActive&&(e.lastActive=o.timestamp)):l.set(t,{count:1,hasAgent:o.agent!=null,lastActive:o.timestamp});}if(c.json){let o={};for(let[t,e]of r)o[t]=e.map(s=>({id:s.id,type:s.type||"note",title:s.title,author:s.author,symbols:s.symbols_touched||[]}));console.log(JSON.stringify({total:i.length,byDate:o,hotSymbols:g,authors:Array.from(l.entries()).map(([t,e])=>({id:t,hasAgent:e.hasAgent,entries:e.count,lastActive:e.lastActive}))},null,2));return}let f={"agent-session":n.hex("#818cf8"),"human-note":n.hex("#34d399"),decision:n.hex("#fbbf24"),review:n.hex("#c084fc"),incident:n.hex("#f87171"),milestone:n.hex("#60a5fa")};console.log(n.magenta(`
5
+ Lore Timeline (${i.length} entries)
6
+ `));for(let[o,t]of r){console.log(n.white.bold(` ${o}`)+n.gray(` (${t.length} entries)`));for(let e of t){let s=e.type||"note",u=f[s]||n.white,d=e.timestamp.slice(11,16),p=e.agent?"\u{1F916}":"\u{1F464}";console.log(` ${n.gray(d)} ${u(s.padEnd(14))} ${n.white(e.title)}`),console.log(` ${p} ${n.gray(e.author)} ${(e.symbols_touched||[]).slice(0,4).map(b=>n.cyan(b)).join(" ")}`);}console.log();}if(g.length>0){console.log(n.white(" Hot Symbols:"));for(let{symbol:o,count:t}of g.slice(0,5)){let e="\u2588".repeat(Math.min(t,20));console.log(` ${n.cyan(o.padEnd(25))} ${n.gray(e)} ${t}`);}console.log();}if(l.size>0){console.log(n.white(" Active Authors:"));for(let[o,t]of l){let e=t.hasAgent?"\u{1F916}":"\u{1F464}";console.log(` ${e} ${n.white(o)} - ${t.count} entries`);}console.log();}}export{w as loreTimelineCommand};
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import {f,p,o,r,i,s}from'./chunk-4QADCWPU.js';import {a}from'./chunk-NKYNHSA5.js';import'./chunk-5TAVYPOV.js';import t from'chalk';import S from'ora';import*as h from'fs';function I(){return `
3
+ ${t.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")}
4
+ ${t.cyan("\u2551")} ${t.bold.white("PARADIGM SENTINEL TRIAGE")} ${t.cyan("\u2551")}
5
+ ${t.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")}
6
+ `}function R(e){return `${t.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")}
7
+ ${t.cyan("\u2551")} Open: ${t.yellow(String(e.open).padEnd(4))} \u2502 Investigating: ${t.blue(String(e.investigating).padEnd(3))} \u2502 Resolved: ${t.green(String(e.resolved).padEnd(4))} \u2502 Today: ${t.magenta(`+${e.today}`)} ${t.cyan("\u2551")}
8
+ ${t.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")}
9
+ `}function v(e,n){let o=[],r=E(e.status);o.push(t.gray("\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")),o.push(t.gray("\u2502 ")+t.bold(`[${e.id}] `)+r(e.status.toUpperCase().padEnd(12))+t.gray(e.timestamp.substring(0,19).replace("T"," ").padStart(19))+t.gray(" \u2502")),o.push(t.gray("\u251C\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")),o.push(t.gray("\u2502 ")+t.red("Error: ")+u(e.error.message,55)+t.gray(" \u2502")),o.push(t.gray("\u2502")+" ".repeat(65)+t.gray("\u2502")),o.push(t.gray("\u2502 ")+t.cyan("Symbolic Context:")+" ".repeat(47)+t.gray("\u2502"));let s=N(e.symbols);for(let a of s)o.push(t.gray("\u2502 ")+a.padEnd(61)+t.gray(" \u2502"));o.push(t.gray("\u2502")+" ".repeat(65)+t.gray("\u2502"));let c=`Environment: ${t.yellow(e.environment)} \u2502 Service: ${t.yellow(e.service||"N/A")} \u2502 v${e.version||"N/A"}`;if(o.push(t.gray("\u2502 ")+c.substring(0,63).padEnd(63)+t.gray(" \u2502")),n&&n.length>0){o.push(t.gray("\u2502")+" ".repeat(65)+t.gray("\u2502")),o.push(t.gray("\u2502 \u250C\u2500 ")+t.cyan("Matched Patterns")+t.gray(" \u2500".repeat(22)+"\u2510 \u2502"));for(let a=0;a<Math.min(n.length,3);a++){let l=n[a],m=a===0?t.yellow("\u2605"):t.gray("\u25CB"),d=`${l.confidence}% confidence`;o.push(t.gray("\u2502 \u2502 ")+m+" "+t.bold(u(l.pattern.id,30).padEnd(30))+t.gray(d.padStart(15))+t.gray(" \u2502 \u2502")),o.push(t.gray("\u2502 \u2502 ")+t.italic(u(l.pattern.description,45).padEnd(45))+t.gray(" \u2502 \u2502")),o.push(t.gray("\u2502 \u2502 Strategy: ")+t.cyan(l.pattern.resolution.strategy.padEnd(40))+t.gray(" \u2502 \u2502")),a<Math.min(n.length,3)-1&&o.push(t.gray("\u2502 \u2502")+" ".repeat(59)+t.gray("\u2502 \u2502"));}o.push(t.gray("\u2502 \u2514")+"\u2500".repeat(59)+t.gray("\u2518 \u2502"));}return o.push(t.gray("\u2502")+" ".repeat(65)+t.gray("\u2502")),o.push(t.gray("\u2502 ")+t.dim("Actions:")+" ".repeat(56)+t.gray("\u2502")),o.push(t.gray("\u2502 ")+t.dim(`paradigm triage resolve ${e.id}`)+" ".repeat(35-e.id.length)+t.gray("\u2502")),o.push(t.gray("\u2502 ")+t.dim(`paradigm triage show ${e.id} --timeline`)+" ".repeat(28-e.id.length)+t.gray("\u2502")),o.push(t.gray("\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")),o.join(`
10
+ `)}function j(e){let o=E(e.status)(e.status.substring(0,4).toUpperCase().padEnd(4)),r=e.timestamp.substring(5,16).replace("T"," "),s=u(e.error.message,40),c=Object.values(e.symbols).filter(Boolean).join(" ");return `${t.bold(e.id)} ${o} ${t.gray(r)} ${s}
11
+ ${t.cyan(u(c,60))}`}function O(e){let n=[];if(n.push(t.bold.cyan(`Pattern: ${e.id}`)),n.push(t.white(` Name: ${e.name}`)),n.push(t.gray(` Description: ${e.description}`)),n.push(""),n.push(t.yellow(" Matching Criteria:")),e.pattern.symbols){for(let[o,r]of Object.entries(e.pattern.symbols))if(r){let s=Array.isArray(r)?r.join(", "):r;n.push(` ${t.cyan(o)}: ${s}`);}}return e.pattern.errorContains&&n.push(` ${t.cyan("errorContains")}: ${e.pattern.errorContains.join(", ")}`),e.pattern.missingSignals&&n.push(` ${t.cyan("missingSignals")}: ${e.pattern.missingSignals.join(", ")}`),n.push(""),n.push(t.green(" Resolution:")),n.push(` ${t.white(e.resolution.description)}`),n.push(` Strategy: ${t.cyan(e.resolution.strategy)} Priority: ${A(e.resolution.priority)(e.resolution.priority)}`),e.resolution.codeHint&&n.push(` ${t.dim("Hint: "+e.resolution.codeHint)}`),n.push(""),n.push(t.blue(" Confidence:")),n.push(` Score: ${T(e.confidence.score)(e.confidence.score+"%")} Matched: ${e.confidence.timesMatched} Resolved: ${e.confidence.timesResolved} Recurred: ${e.confidence.timesRecurred}`),n.push(""),n.push(t.gray(` Source: ${e.source} Tags: ${e.tags.join(", ")||"none"}`)),n.join(`
12
+ `)}function k(e){let n=T(e.confidence.score)(`${e.confidence.score}%`),o=e.tags.slice(0,3).join(", ");return `${t.bold(e.id.padEnd(30))} ${n.padStart(8)} ${t.gray(e.source.padEnd(10))} ${t.dim(o)}
13
+ ${t.white(u(e.name,60))}`}function N(e){let n=[];for(let[o,r]of Object.entries(e))if(r){let s=M(o);n.push(`${s(r.padEnd(20))} ${t.dim(o)}`);}return n}function E(e){switch(e){case "open":return t.red;case "investigating":return t.yellow;case "resolved":return t.green;case "wont-fix":return t.gray;default:return t.white}}function M(e){switch(e){case "feature":return t.magenta;case "component":return t.blue;case "flow":return t.cyan;case "gate":return t.yellow;case "signal":return t.green;case "state":return t.red;case "integration":return t.white;default:return t.gray}}function A(e){switch(e){case "critical":return t.red.bold;case "high":return t.red;case "medium":return t.yellow;case "low":return t.gray;default:return t.white}}function T(e){return e>=80?t.green:e>=60?t.yellow:e>=40?t.red:t.gray}function u(e,n){return e.length<=n?e:e.substring(0,n-3)+"..."}var b=null;function g(){return b||(b=new a),b}async function U(e){let n=g(),o=new f(n),r=parseInt(e.limit||"10",10),s=e.status,c=n.getRecentIncidents({limit:r,status:s||"all",symbol:e.symbol,environment:e.env,search:e.search,dateFrom:e.from,dateTo:e.to});if(e.json){let d=c.map(p=>({incident:p,matches:o.match(p,{maxResults:3})}));console.log(JSON.stringify(d,null,2));return}let a=new p(n).getStats(7),l=new Date;l.setHours(0,0,0,0);let m=n.getIncidentCount({dateFrom:l.toISOString()});if(console.log(I()),console.log(R({open:a.incidents.open,investigating:a.incidents.total-a.incidents.open-a.incidents.resolved,resolved:a.incidents.resolved,today:m})),console.log(""),c.length===0){console.log(t.gray("No incidents found."));return}for(let d of c){let p=o.match(d,{maxResults:3});console.log(v(d,p)),console.log("");}}async function G(e,n){let o$1=g(),r=new f(o$1),s=o$1.getIncident(e);if(!s){console.log(t.red(`Incident ${e} not found.`));return}let c=r.match(s,{maxResults:5});if(n.json){let a={incident:s,matches:c};if(n.timeline&&s.flowPosition){let l=new o().build(s);a.timeline=l?new o().renderStructured(l):null;}console.log(JSON.stringify(a,null,2));return}if(console.log(v(s,c)),n.timeline&&s.flowPosition){let a=new o().build(s);a&&(console.log(""),console.log(t.cyan.bold("Flow Timeline")),console.log(t.gray("\u2500".repeat(50))),console.log(new o().renderAscii(a)));}if(s.notes.length>0){console.log(""),console.log(t.cyan.bold("Notes")),console.log(t.gray("\u2500".repeat(50)));for(let a of s.notes)console.log(t.gray(a.timestamp.substring(0,16))+" "+(a.author?t.yellow(a.author+": "):"")+a.content);}s.relatedIncidents.length>0&&(console.log(""),console.log(t.cyan.bold("Related Incidents")),console.log(t.gray("\u2500".repeat(50))),console.log(" "+s.relatedIncidents.join(", ")));}async function W(e,n){let o=g(),r=o.getIncident(e);if(!r){console.log(t.red(`Incident ${e} not found.`));return}if(r.status==="resolved"||r.status==="wont-fix"){console.log(t.yellow(`Incident ${e} is already ${r.status}.`));return}if(n.wontFix){o.updateIncident(e,{status:"wont-fix",resolvedAt:new Date().toISOString(),resolvedBy:"manual",resolution:{notes:n.notes}}),console.log(t.gray(`Incident ${e} marked as won't fix.`));return}o.recordResolution({incidentId:e,patternId:n.pattern,commitHash:n.commit,prUrl:n.pr,notes:n.notes}),console.log(t.green(`Incident ${e} resolved.`)),n.pattern&&console.log(t.gray(` Pattern: ${n.pattern}`)),n.commit&&console.log(t.gray(` Commit: ${n.commit}`)),n.pr&&console.log(t.gray(` PR: ${n.pr}`));}async function q(e,n){let o=g();if(!o.getIncident(e)){console.log(t.red(`Incident ${e} not found.`));return}o.addIncidentNote(e,{timestamp:new Date().toISOString(),content:n}),console.log(t.green(`Note added to ${e}.`));}async function z(e,n){let o=g(),r=o.getIncident(e),s=o.getIncident(n);if(!r){console.log(t.red(`Incident ${e} not found.`));return}if(!s){console.log(t.red(`Incident ${n} not found.`));return}o.linkIncidents(e,n),console.log(t.green(`Linked ${e} and ${n}.`));}async function K(e){let o=g().getAllPatterns({source:e.source,minConfidence:e.minConfidence?parseInt(e.minConfidence,10):void 0,includePrivate:true});if(e.json){console.log(JSON.stringify(o,null,2));return}if(console.log(t.cyan.bold(`
14
+ Failure Patterns`)),console.log(t.gray("\u2500".repeat(70))),o.length===0){console.log(t.gray("No patterns found. Run `paradigm triage patterns seed` to load defaults."));return}for(let r of o)console.log(k(r)),console.log("");}async function Q(e,n){let r=g().getPattern(e);if(!r){console.log(t.red(`Pattern ${e} not found.`));return}if(n.json){console.log(JSON.stringify(r,null,2));return}console.log(O(r));}async function V(e){let n=g();if(e.fromIncident){let s=n.getIncident(e.fromIncident);if(!s){console.log(t.red(`Incident ${e.fromIncident} not found.`));return}let a=new r(n).suggestFromIncident(s);console.log(t.cyan(`
15
+ Suggested Pattern:`)),console.log(JSON.stringify(a,null,2)),console.log(t.gray(`
16
+ Edit and add with: paradigm triage patterns add --id <id> --name "..." ...`));return}let o={};if(e.symbols){let s=e.symbols.split(",");for(let c of s){let[a,l]=c.split(":").map(m=>m.trim());a&&l&&(o[a]=l);}}let r$1={id:e.id,name:e.name,description:e.description||"",pattern:{symbols:o,errorContains:e.errorContains?.split(",").map(s=>s.trim()),missingSignals:e.missingSignals?.split(",").map(s=>s.trim())},resolution:{description:"Resolution TBD",strategy:e.strategy||"fix-code",priority:e.priority||"medium",codeHint:e.codeHint},source:"manual",private:false,tags:e.tags?.split(",").map(s=>s.trim())||[]};n.addPattern(r$1),console.log(t.green(`Pattern ${e.id} created.`));}async function X(e){let n=g();if(!n.getPattern(e)){console.log(t.red(`Pattern ${e} not found.`));return}n.deletePattern(e),console.log(t.green(`Pattern ${e} deleted.`));}async function Y(e,n){let o=g(),r=new f(o),s=o.getPattern(e);if(!s){console.log(t.red(`Pattern ${e} not found.`));return}let c=parseInt(n.limit||"100",10),a=r.testPattern(s,c);if(n.json){console.log(JSON.stringify(a,null,2));return}if(console.log(t.cyan.bold(`
17
+ Pattern Test: ${e}`)),console.log(t.gray("\u2500".repeat(50))),console.log(`Would match: ${t.yellow(a.matchCount)} incidents`),console.log(`Average score: ${t.yellow(a.avgScore+"%")}`),a.wouldMatch.length>0){console.log(""),console.log(t.cyan("Sample matches:"));for(let l of a.wouldMatch.slice(0,5))console.log(j(l));}}async function Z(){let e=g(),n=S("Loading seed patterns...").start();try{let o=i(),r=e.importPatterns(o,{overwrite:!1});n.succeed(`Loaded ${r.imported} patterns (${r.skipped} skipped).`);}catch(o){n.fail(`Failed to load seed patterns: ${o}`);}}async function _(e,n){let o=g(),r,s;e==="patterns"?(r=o.exportPatterns({includePrivate:n.includePrivate}),s="sentinel-patterns.json"):(r=o.exportBackup(),s="sentinel-backup.json");let c=n.output||s;h.writeFileSync(c,JSON.stringify(r,null,2)),console.log(t.green(`Exported to ${c}`));}async function ee(e,n){let o=g(),r=new s,s$1=S(`Importing from ${e}...`).start();try{let c=r.loadFromFile(e),a=o.importPatterns(c,{overwrite:n.overwrite});s$1.succeed(`Imported ${a.imported} patterns (${a.skipped} skipped).`);}catch(c){s$1.fail(`Import failed: ${c}`);}}async function te(e){let n=g(),o=S(`Restoring from ${e}...`).start();try{let r=h.readFileSync(e,"utf-8"),s=JSON.parse(r);n.importBackup(s),o.succeed("Backup restored.");}catch(r){o.fail(`Restore failed: ${r}`);}}async function ne(e){let n=g(),o=new p(n),r=7;if(e.period){let c=e.period.match(/^(\d+)d$/);c&&(r=parseInt(c[1],10));}if(e.symbol){let c=o.getSymbolHealth(e.symbol);if(e.json)console.log(JSON.stringify(c,null,2));else {console.log(t.cyan.bold(`
18
+ Symbol Health: ${e.symbol}`)),console.log(t.gray("\u2500".repeat(50))),console.log(` Incidents: ${c.incidentCount}`),console.log(` Avg Time to Resolve: ${c.avgTimeToResolve}m`),console.log(""),console.log(t.cyan(" Top Patterns:"));for(let{patternId:a,count:l}of c.topPatterns)console.log(` ${a}: ${l} times`);}return}let s=o.getStats(r);if(e.json){console.log(JSON.stringify(s,null,2));return}console.log(o.generateDashboard(r));}async function oe(e){let n=g(),o=new f(n),r=n.recordIncident({error:{message:e.error,stack:e.stack},symbols:{feature:e.feature,component:e.component,flow:e.flow,gate:e.gate,signal:e.signal,state:e.state,integration:e.integration},environment:e.env,service:e.service,version:e.version}),s=n.getIncident(r),c=s?o.match(s,{maxResults:3}):[];if(e.json){console.log(JSON.stringify({incidentId:r,matches:c},null,2));return}if(console.log(t.green(`Recorded incident ${r}`)),c.length>0){console.log(""),console.log(t.cyan("Matched patterns:"));for(let a of c)console.log(` ${t.yellow("\u2605")} ${a.pattern.id} (${a.confidence}% confidence)`),console.log(t.gray(` ${a.pattern.resolution.description}`));}}export{_ as triageExportCommand,ee as triageImportCommand,z as triageLinkCommand,U as triageListCommand,q as triageNoteCommand,V as triagePatternsAddCommand,X as triagePatternsDeleteCommand,K as triagePatternsListCommand,Z as triagePatternsSeedCommand,Q as triagePatternsShowCommand,Y as triagePatternsTestCommand,oe as triageRecordCommand,W as triageResolveCommand,te as triageRestoreCommand,G as triageShowCommand,ne as triageStatsCommand};