@a-company/paradigm 5.10.0 → 5.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. package/dist/accept-orchestration-IUAWQZUN.js +18 -0
  2. package/dist/add-P76GEMGF.js +8 -0
  3. package/dist/agent-UUTYOFTH.js +33 -0
  4. package/dist/agent-loader-EPXURMO7.js +2 -0
  5. package/dist/agent-loader-PYGPX6D2.js +2 -0
  6. package/dist/agent-state-KSQ3S7OB.js +2 -0
  7. package/dist/agents-suggest-HYTFMQD3.js +10 -0
  8. package/dist/aggregate-W66DM3GA.js +10 -0
  9. package/dist/ambient-HYZR42NX.js +35 -0
  10. package/dist/assess-UFPYEJKP.js +9 -0
  11. package/dist/auto-RHJXOZFL.js +14 -0
  12. package/dist/beacon-5QVYV5DF.js +13 -0
  13. package/dist/calibration-OLJYB5HN.js +7 -0
  14. package/dist/check-THVGY4R5.js +14 -0
  15. package/dist/chunk-22ISTMKI.js +31 -0
  16. package/dist/chunk-2QO33NYK.js +3 -0
  17. package/dist/chunk-33LKBMVK.js +134 -0
  18. package/dist/chunk-4QADCWPU.js +7 -0
  19. package/dist/chunk-4TXOVRWD.js +3 -0
  20. package/dist/chunk-4UJ4NIEQ.js +4 -0
  21. package/dist/chunk-4ZGGWZ32.js +3 -0
  22. package/dist/chunk-5TAVYPOV.js +2 -0
  23. package/dist/chunk-6EX37L4Q.js +8 -0
  24. package/dist/chunk-AD5TAD2A.js +5 -0
  25. package/dist/chunk-AGVAHVUA.js +2 -0
  26. package/dist/chunk-AO7ZSRME.js +13 -0
  27. package/dist/chunk-BFD3GFRK.js +2 -0
  28. package/dist/chunk-D34YFK4M.js +6 -0
  29. package/dist/chunk-DVZWCXB6.js +2 -0
  30. package/dist/chunk-EKZDFEJW.js +2 -0
  31. package/dist/chunk-ET5XJTSX.js +2 -0
  32. package/dist/chunk-FYDRENK7.js +3 -0
  33. package/dist/chunk-HMQ5BHP2.js +743 -0
  34. package/dist/chunk-HXKWL3VK.js +29 -0
  35. package/dist/chunk-IZSBGW6E.js +2 -0
  36. package/dist/chunk-J32OPJEX.js +2 -0
  37. package/dist/chunk-JBDMCRPP.js +7 -0
  38. package/dist/chunk-JIXHEBGK.js +7 -0
  39. package/dist/chunk-JNSJVCTU.js +2 -0
  40. package/dist/chunk-JQKKVAAN.js +2 -0
  41. package/dist/chunk-KLBH26PA.js +429 -0
  42. package/dist/chunk-L6K5HNDL.js +24 -0
  43. package/dist/chunk-LKAT7IAK.js +2 -0
  44. package/dist/chunk-M4UMM6DC.js +5 -0
  45. package/dist/chunk-NKYNHSA5.js +424 -0
  46. package/dist/chunk-NW6OKHE6.js +5 -0
  47. package/dist/chunk-NXRVR37G.js +60 -0
  48. package/dist/chunk-ODVKPZZ4.js +2 -0
  49. package/dist/chunk-PUBB7LIT.js +5 -0
  50. package/dist/chunk-Q2J542ST.js +2 -0
  51. package/dist/chunk-QGZRM6ZB.js +2 -0
  52. package/dist/chunk-QNZEG7IT.js +13 -0
  53. package/dist/chunk-QT2LKB3P.js +7 -0
  54. package/dist/chunk-RVRARWSY.js +9 -0
  55. package/dist/chunk-T6IDXUUA.js +2 -0
  56. package/dist/chunk-TYWB5IQJ.js +3 -0
  57. package/dist/chunk-UIKLE3WD.js +2 -0
  58. package/dist/chunk-V7K6CQVX.js +111 -0
  59. package/dist/chunk-VCKKJDLP.js +8 -0
  60. package/dist/chunk-VG7FN2TU.js +4 -0
  61. package/dist/chunk-W5IWDW4Y.js +16 -0
  62. package/dist/chunk-W7C6FFMO.js +8 -0
  63. package/dist/chunk-WESTEMIM.js +10 -0
  64. package/dist/chunk-WR6D3SC6.js +5 -0
  65. package/dist/chunk-WS2N27RX.js +3 -0
  66. package/dist/chunk-XMAV5AG6.js +2 -0
  67. package/dist/chunk-XROULIQN.js +2 -0
  68. package/dist/chunk-XUFYOXOU.js +3 -0
  69. package/dist/chunk-Y4XFVDZC.js +3 -0
  70. package/dist/chunk-Y6KXTQBG.js +2 -0
  71. package/dist/{chunk-GTR2TBIJ.js → chunk-Z2UZUCY6.js} +237 -1047
  72. package/dist/chunk-Z34K6GY2.js +8 -0
  73. package/dist/claude-4LR3LJQZ.js +13 -0
  74. package/dist/claude-cli-UP6HGH7C.js +6 -0
  75. package/dist/claude-code-RLJ4GX77.js +11 -0
  76. package/dist/claude-code-teams-R37HJY3Y.js +29 -0
  77. package/dist/commands-LMUD5L6R.js +455 -0
  78. package/dist/compliance-GZ7UAOG3.js +6 -0
  79. package/dist/conductor-Y5IXELTL.js +4 -0
  80. package/dist/config-schema-HR7LDEQ6.js +2 -0
  81. package/dist/constellation-CG7C4WFE.js +13 -0
  82. package/dist/context-audit-RSSRX6XC.js +6 -0
  83. package/dist/cost-IDNVMAEV.js +10 -0
  84. package/dist/cost-PK4KIF7R.js +2 -0
  85. package/dist/cursor-cli-QKF7Z6M2.js +4 -0
  86. package/dist/cursorrules-U5O4G5T4.js +14 -0
  87. package/dist/decision-loader-2XPZE4EZ.js +2 -0
  88. package/dist/delete-P5VULXR4.js +14 -0
  89. package/dist/diff-RTFUKJHF.js +9 -0
  90. package/dist/discipline-H7LDI6NT.js +2 -0
  91. package/dist/dist-3ZCH25SG.js +2 -0
  92. package/dist/dist-KGRCLBJP-2QAPFYNF.js +39 -0
  93. package/dist/dist-R3RWD35F.js +2 -0
  94. package/dist/dist-VGFSP3XM.js +2 -0
  95. package/dist/dist-VXCZWVVJ.js +2 -0
  96. package/dist/dist-W3XCATBJ.js +2 -0
  97. package/dist/docs-EDQ2STFK.js +2 -0
  98. package/dist/docs-RXPN6CK7.js +12 -0
  99. package/dist/doctor-2T2QL6VM.js +2 -0
  100. package/dist/drift-ILZE5BFJ.js +13 -0
  101. package/dist/echo-UPTQUEDU.js +46 -0
  102. package/dist/edit-GUU3HBVW.js +9 -0
  103. package/dist/event-Y3VXC2RV.js +3 -0
  104. package/dist/explain-files-3GPZUETV.js +4 -0
  105. package/dist/export-CV5KCTPS.js +2 -0
  106. package/dist/flow-S3RQ4YPY.js +11 -0
  107. package/dist/global-C44FW4G2.js +13 -0
  108. package/dist/graduate-3BBSC27A.js +5 -0
  109. package/dist/graph-CNDE5TAT.js +2 -0
  110. package/dist/graph-server-COZR5C3Z.js +14 -0
  111. package/dist/habits-4J2KRYUL.js +42 -0
  112. package/dist/history-UW454SDP.js +12 -0
  113. package/dist/hooks-XH52VGOU.js +2 -0
  114. package/dist/index.js +15 -1039
  115. package/dist/init-24MAQJFM.js +2 -0
  116. package/dist/integrity-UYDOOJDP.js +7 -0
  117. package/dist/integrity-checker-DHGMZQDG.js +2 -0
  118. package/dist/journal-loader-GLH7XFTK.js +2 -0
  119. package/dist/lint-IGKE6UPS.js +26 -0
  120. package/dist/list-5IUGP3ZB.js +7 -0
  121. package/dist/list-YKIQNKGB.js +6 -0
  122. package/dist/lore-loader-RVQI5GXL.js +2 -0
  123. package/dist/lore-loader-XY5MZRR2.js +2 -0
  124. package/dist/lore-server-FC2GMDLT.js +14 -0
  125. package/dist/manual-RXSPSFLL.js +20 -0
  126. package/dist/mcp.js +93 -20484
  127. package/dist/migrate-X5OMAFAQ.js +59 -0
  128. package/dist/migrate-assessments-GEI5WMI2.js +4 -0
  129. package/dist/model-discovery-HMB3YI4L.js +2 -0
  130. package/dist/nomination-engine-XF7TWPAP.js +2 -0
  131. package/dist/notebook-PE3JSYZI.js +11 -0
  132. package/dist/notebook-loader-CENTDDUJ.js +2 -0
  133. package/dist/orchestrate-35HBQ3O3.js +8 -0
  134. package/dist/peers-P2KXU7ZK.js +5 -0
  135. package/dist/persona-STQWZH5P.js +29 -0
  136. package/dist/pipeline-MZUITRVN.js +4 -0
  137. package/dist/platform-server-2KXHGHFV.js +25 -0
  138. package/dist/plugin-update-checker-M7PW434O.js +2 -0
  139. package/dist/portal-check-3JVNLOEP.js +8 -0
  140. package/dist/portal-compliance-2UG4VKWH.js +2 -0
  141. package/dist/probe-5L5BQDGE.js +6 -0
  142. package/dist/project-type-SURTOIG7.js +2 -0
  143. package/dist/promote-NJQDZBZA.js +8 -0
  144. package/dist/providers-4PXMWA7V.js +8 -0
  145. package/dist/quiz-FE5UGAY2.js +10 -0
  146. package/dist/record-YXPB34MY.js +6 -0
  147. package/dist/reindex-PGDQSM42.js +2 -0
  148. package/dist/remember-MJRNTXYS.js +14 -0
  149. package/dist/retag-N5XF3KXP.js +6 -0
  150. package/dist/review-6UAH6V3R.js +11 -0
  151. package/dist/review-77QI6VOC.js +6 -0
  152. package/dist/ripple-ZGDITCGB.js +10 -0
  153. package/dist/roster-FLRZ5J42.js +2 -0
  154. package/dist/sentinel-HYAZ3CO5.js +19 -0
  155. package/dist/sentinel-bridge-VR357PKL.js +2 -0
  156. package/dist/sentinel-mcp.js +38 -3808
  157. package/dist/sentinel.js +1 -34
  158. package/dist/serve-JE6UF5P2.js +8 -0
  159. package/dist/serve-L52ZUTU6.js +10 -0
  160. package/dist/serve-OY6XYL7F.js +12 -0
  161. package/dist/server-2MNROHF6.js +7 -0
  162. package/dist/server-4YNUIK4W.js +8 -0
  163. package/dist/session-tracker-SKOMBDOW.js +2 -0
  164. package/dist/session-work-log-3MNUDEZ6.js +2 -0
  165. package/dist/session-work-log-J2H5OZBR.js +2 -0
  166. package/dist/setup-3F5IK7MO.js +31 -0
  167. package/dist/setup-KPIMRZ4Q.js +2 -0
  168. package/dist/shift-6GCNH666.js +11 -0
  169. package/dist/show-BOAVWZPZ.js +7 -0
  170. package/dist/show-PJ5LFLIL.js +5 -0
  171. package/dist/snapshot-L2G56RPL.js +8 -0
  172. package/dist/spawn-UH5RENSE.js +12 -0
  173. package/dist/status-77M3SDIF.js +8 -0
  174. package/dist/status-A37ECYNJ.js +6 -0
  175. package/dist/summary-ZJLQ6KHB.js +7 -0
  176. package/dist/sweep-HU74OPVW.js +17 -0
  177. package/dist/switch-CTW4PDGI.js +17 -0
  178. package/dist/symphony-3QMBGCZY.js +2 -0
  179. package/dist/symphony-QI63XL62.js +53 -0
  180. package/dist/symphony-loader-XACVV2E3.js +2 -0
  181. package/dist/symphony-peers-U4KHMKGI.js +2 -0
  182. package/dist/symphony-peers-X5NGWXFP.js +2 -0
  183. package/dist/symphony-relay-5GY5JIPT.js +3 -0
  184. package/dist/sync-QRDSFETO.js +2 -0
  185. package/dist/sync-llms-HL5PPW3M.js +15 -0
  186. package/dist/task-loader-NZFDTUQ5.js +2 -0
  187. package/dist/team-WGERKGNP.js +2 -0
  188. package/dist/test-BQJMS4Y2.js +111 -0
  189. package/dist/thread-HFXK65D4.js +41 -0
  190. package/dist/timeline-K3ZFKJ3R.js +6 -0
  191. package/dist/triage-FCWOZASE.js +18 -0
  192. package/dist/tutorial-UC6YQMNN.js +305 -0
  193. package/dist/university-content/courses/.purpose +74 -5
  194. package/dist/university-content/courses/para-701.json +807 -0
  195. package/dist/university-content/plsat/.purpose +3 -2
  196. package/dist/university-ui/assets/{index-BjewBB6s.js → index-CGFJczb1.js} +2 -2
  197. package/dist/university-ui/assets/{index-BjewBB6s.js.map → index-CGFJczb1.js.map} +1 -1
  198. package/dist/university-ui/index.html +1 -1
  199. package/dist/upgrade-B4IOLZYK.js +53 -0
  200. package/dist/validate-C6SMKGYD.js +9 -0
  201. package/dist/validate-LSCDOLBO.js +13 -0
  202. package/dist/validate-VZXTJHGO.js +6 -0
  203. package/dist/watch-LRM5XD46.js +8 -0
  204. package/dist/watch-PZCCUP6K.js +9 -0
  205. package/dist/wisdom-XZ3QKPNP.js +7 -0
  206. package/dist/work-log-loader-DL5GZ2BQ.js +2 -0
  207. package/dist/workspace-2ODL5WLY.js +2 -0
  208. package/package.json +1 -1
  209. package/platform-ui/dist/assets/AmbientSection-DqQ2mfCO.js +1 -0
  210. package/platform-ui/dist/assets/{CanvasSection-DwPTRdIN.js → CanvasSection-DLW0s-Bu.js} +1 -1
  211. package/platform-ui/dist/assets/{DocsSection-BJc_ws4I.js → DocsSection-BQ9Hi51g.js} +1 -1
  212. package/platform-ui/dist/assets/{GitSection-DhqBo1xc.js → GitSection-QQeUX6o3.js} +1 -1
  213. package/platform-ui/dist/assets/{GraphSection-D9fhVnZ0.js → GraphSection-0c9C-w7K.js} +2 -2
  214. package/platform-ui/dist/assets/{GraphSection-BlgXTl53.css → GraphSection-Bbs2a8sC.css} +1 -1
  215. package/platform-ui/dist/assets/LoreSection--t56kCj2.js +1 -0
  216. package/platform-ui/dist/assets/LoreSection-qnmm3o4y.css +1 -0
  217. package/platform-ui/dist/assets/SentinelSection-C4OoME9U.js +1 -0
  218. package/platform-ui/dist/assets/{SymphonySection-BRoBaUSS.js → SymphonySection-B-rvsLxq.js} +1 -1
  219. package/platform-ui/dist/assets/TeamSection-CBFmNEEo.js +1 -0
  220. package/platform-ui/dist/assets/index-Bxp0TVaf.css +1 -0
  221. package/platform-ui/dist/assets/index-DPpOdAtC.js +57 -0
  222. package/platform-ui/dist/index.html +2 -2
  223. package/dist/accept-orchestration-UQLM7PTQ.js +0 -189
  224. package/dist/add-FZRKEGH4.js +0 -81
  225. package/dist/agent-WERIO2XV.js +0 -523
  226. package/dist/agent-loader-TFIANSF4.js +0 -44
  227. package/dist/agent-state-S5DAWPTF.js +0 -24
  228. package/dist/agents-suggest-DNSYJ6IA.js +0 -83
  229. package/dist/aggregate-H57K7PNV.js +0 -88
  230. package/dist/assess-4WVXZLZQ.js +0 -68
  231. package/dist/auto-QFS5NHQU.js +0 -504
  232. package/dist/beacon-KXZXYQHX.js +0 -251
  233. package/dist/calibration-V46G7JTY.js +0 -135
  234. package/dist/check-OWAIWV23.js +0 -175
  235. package/dist/chunk-2IO7JAG2.js +0 -148
  236. package/dist/chunk-2T6BTYBN.js +0 -712
  237. package/dist/chunk-36TKPM5Z.js +0 -400
  238. package/dist/chunk-45MUDW6E.js +0 -804
  239. package/dist/chunk-4BLYIB7J.js +0 -5701
  240. package/dist/chunk-4L3UTYQX.js +0 -677
  241. package/dist/chunk-4NCFWYGG.js +0 -110
  242. package/dist/chunk-54LTTQBH.js +0 -138
  243. package/dist/chunk-5EWAQHFY.js +0 -269
  244. package/dist/chunk-5JGJACDU.js +0 -37
  245. package/dist/chunk-5OUOLN6M.js +0 -659
  246. package/dist/chunk-5VKJBNJL.js +0 -444
  247. package/dist/chunk-6N3JTACN.js +0 -2260
  248. package/dist/chunk-6QC3YGB6.js +0 -114
  249. package/dist/chunk-7N7GSU6K.js +0 -34
  250. package/dist/chunk-ABVQGRF7.js +0 -268
  251. package/dist/chunk-CL7JSK52.js +0 -129
  252. package/dist/chunk-CSD7IHSN.js +0 -152
  253. package/dist/chunk-EDOAWN7J.js +0 -717
  254. package/dist/chunk-EKGMAM62.js +0 -525
  255. package/dist/chunk-EZ3GOCYC.js +0 -132
  256. package/dist/chunk-F3BCHPYT.js +0 -143
  257. package/dist/chunk-FKJUBQU3.js +0 -3081
  258. package/dist/chunk-GT5QGC2H.js +0 -253
  259. package/dist/chunk-GZDFVP2N.js +0 -540
  260. package/dist/chunk-IRKUEJVW.js +0 -405
  261. package/dist/chunk-J2JEQRT3.js +0 -164
  262. package/dist/chunk-JASGXLK3.js +0 -679
  263. package/dist/chunk-KVDYJLTC.js +0 -121
  264. package/dist/chunk-L27I3CPZ.js +0 -357
  265. package/dist/chunk-LHLIAYQ3.js +0 -185
  266. package/dist/chunk-MCMOGQMU.js +0 -145
  267. package/dist/chunk-NQKQG45G.js +0 -688
  268. package/dist/chunk-PBHIFAL4.js +0 -259
  269. package/dist/chunk-PDX44BCA.js +0 -11
  270. package/dist/chunk-PMXRGPRQ.js +0 -305
  271. package/dist/chunk-RAB5IKPR.js +0 -487
  272. package/dist/chunk-RJE5G7WO.js +0 -590
  273. package/dist/chunk-RTHA3XRE.js +0 -880
  274. package/dist/chunk-S2HO5MLR.js +0 -621
  275. package/dist/chunk-S3ORKP3V.js +0 -716
  276. package/dist/chunk-TAIJOFOE.js +0 -124
  277. package/dist/chunk-TXESEO7Y.js +0 -245
  278. package/dist/chunk-UPLDI7CN.js +0 -1334
  279. package/dist/chunk-VL67H5IC.js +0 -506
  280. package/dist/chunk-VPPK3SY4.js +0 -1136
  281. package/dist/chunk-YMDLDELF.js +0 -314
  282. package/dist/chunk-YO6DVTL7.js +0 -99
  283. package/dist/chunk-YRZ5RPEB.js +0 -1561
  284. package/dist/chunk-ZDHLG5VP.js +0 -5676
  285. package/dist/chunk-ZGUAAVMA.js +0 -756
  286. package/dist/chunk-ZSYVKSY6.js +0 -2602
  287. package/dist/claude-FRRWJSTJ.js +0 -362
  288. package/dist/claude-cli-XJLK2X4L.js +0 -276
  289. package/dist/claude-code-HTBA4XRB.js +0 -126
  290. package/dist/claude-code-teams-T4SP24MD.js +0 -199
  291. package/dist/commands-5N4ILTPH.js +0 -5859
  292. package/dist/conductor-CQVGTEQN.js +0 -161
  293. package/dist/config-schema-EA4XALGG.js +0 -154
  294. package/dist/constellation-A26CCGQS.js +0 -225
  295. package/dist/context-audit-RLO3ETRP.js +0 -682
  296. package/dist/cost-BGM32XJU.js +0 -93
  297. package/dist/cost-VI46A4XL.js +0 -174
  298. package/dist/cursor-cli-JVEZGHWQ.js +0 -269
  299. package/dist/cursorrules-HLIKJJZT.js +0 -84
  300. package/dist/decision-loader-WWCLIQPJ.js +0 -20
  301. package/dist/delete-KBRPQLPC.js +0 -56
  302. package/dist/diff-D4X53HAC.js +0 -126
  303. package/dist/discipline-FA4OZXIS.js +0 -24
  304. package/dist/dist-34NA5RS5.js +0 -74
  305. package/dist/dist-5QE2BB2B-5S3T6Y3T.js +0 -6919
  306. package/dist/dist-77JDTVAY.js +0 -62
  307. package/dist/dist-OGTSAZ55.js +0 -1358
  308. package/dist/dist-QK4SQAK7.js +0 -64
  309. package/dist/dist-TA6LSC2Q.js +0 -20
  310. package/dist/docs-PBZB7LYP.js +0 -89
  311. package/dist/docs-QIYKO3BR.js +0 -155
  312. package/dist/doctor-ULBOHEIC.js +0 -11
  313. package/dist/drift-R5NRKFHI.js +0 -251
  314. package/dist/echo-O2LY7CC2.js +0 -248
  315. package/dist/edit-R2HNLMOG.js +0 -63
  316. package/dist/event-25OJKDCE.js +0 -31
  317. package/dist/export-IWVL7XLF.js +0 -38
  318. package/dist/flow-CRRVV3O3.js +0 -185
  319. package/dist/global-3NG5JXUB.js +0 -136
  320. package/dist/graduate-USAWGBJM.js +0 -160
  321. package/dist/graph-VHUMAAS6.js +0 -12
  322. package/dist/graph-server-YL22VBBN.js +0 -116
  323. package/dist/habits-OL5NGPXO.js +0 -1405
  324. package/dist/history-WOWC573W.js +0 -277
  325. package/dist/hooks-HFWSCGPV.js +0 -12
  326. package/dist/integrity-IHO4FZTS.js +0 -194
  327. package/dist/integrity-checker-PSKJA5SB.js +0 -12
  328. package/dist/journal-loader-5EYSBFFY.js +0 -18
  329. package/dist/lint-K6CJGGPH.js +0 -456
  330. package/dist/list-4YK7QKFF.js +0 -57
  331. package/dist/list-ENR7Q4CR.js +0 -56
  332. package/dist/lore-loader-7NO6N6FT.js +0 -26
  333. package/dist/lore-server-UNJY5KC3.js +0 -118
  334. package/dist/manual-G6FISID5.js +0 -204
  335. package/dist/migrate-LS45DNEV.js +0 -889
  336. package/dist/migrate-assessments-RGH4O6IX.js +0 -97
  337. package/dist/model-discovery-D2H3VBGC.js +0 -8
  338. package/dist/nomination-engine-RV5CNO5B.js +0 -42
  339. package/dist/notebook-YWIYGEHV.js +0 -155
  340. package/dist/orchestrate-JLILBBJE.js +0 -324
  341. package/dist/peers-DEOUIZM6.js +0 -82
  342. package/dist/persona-UHAHIVST.js +0 -390
  343. package/dist/pipeline-L4HCSBGN.js +0 -263
  344. package/dist/platform-server-H5YO3DQD.js +0 -1475
  345. package/dist/plugin-update-checker-KRRSGXMV.js +0 -12
  346. package/dist/portal-check-NPYGII2D.js +0 -42
  347. package/dist/portal-compliance-J7DGAPFX.js +0 -18
  348. package/dist/probe-MHL5HQZ2.js +0 -167
  349. package/dist/promote-F6ZYZZAL.js +0 -182
  350. package/dist/providers-GK7PB2OL.js +0 -104
  351. package/dist/quiz-M66SC7F7.js +0 -99
  352. package/dist/record-RA4WR2BO.js +0 -49
  353. package/dist/reindex-5LTD53ZC.js +0 -16
  354. package/dist/remember-HBWJ655S.js +0 -77
  355. package/dist/retag-3OLCVDEQ.js +0 -62
  356. package/dist/review-27ATYTD2.js +0 -33
  357. package/dist/review-57QMURZV.js +0 -334
  358. package/dist/ripple-JPBXP5I3.js +0 -215
  359. package/dist/sentinel-4XIG4STA.js +0 -63
  360. package/dist/sentinel-bridge-MDUXTQRL.js +0 -109
  361. package/dist/serve-CAH3PHE7.js +0 -33
  362. package/dist/serve-INL7SNBK.js +0 -36
  363. package/dist/serve-KBSE36PL.js +0 -49
  364. package/dist/server-54SKYFFY.js +0 -1647
  365. package/dist/server-XUOIO7E6.js +0 -338
  366. package/dist/session-tracker-C4BMD5WG.js +0 -13
  367. package/dist/session-work-log-MZ47OAPB.js +0 -20
  368. package/dist/setup-EDS27WUR.js +0 -25
  369. package/dist/setup-KO5AFC4K.js +0 -296
  370. package/dist/shift-D2JOHHBF.js +0 -668
  371. package/dist/show-5PV5KFJE.js +0 -176
  372. package/dist/show-NQKYX6WQ.js +0 -82
  373. package/dist/snapshot-BK4RBPCG.js +0 -62
  374. package/dist/spawn-RCHNXDHE.js +0 -196
  375. package/dist/status-WGIAQODY.js +0 -71
  376. package/dist/summary-NIRABMF5.js +0 -140
  377. package/dist/sweep-QMHNSIY5.js +0 -934
  378. package/dist/switch-6EJPZDIA.js +0 -232
  379. package/dist/symphony-4OCY36AI.js +0 -791
  380. package/dist/symphony-B75X2MME.js +0 -326
  381. package/dist/symphony-loader-UZGON56V.js +0 -90
  382. package/dist/symphony-peers-2ZQYLRNI.js +0 -34
  383. package/dist/symphony-peers-OL7F6M5S.js +0 -121
  384. package/dist/symphony-relay-UJYUXN65.js +0 -710
  385. package/dist/sync-VEHUH4OA.js +0 -11
  386. package/dist/sync-llms-YHCFIE6X.js +0 -166
  387. package/dist/task-loader-LDYWQSLM.js +0 -20
  388. package/dist/team-O5MIIFMA.js +0 -34
  389. package/dist/test-566CP5KC.js +0 -1017
  390. package/dist/thread-N754I4D5.js +0 -274
  391. package/dist/timeline-M3CICQFE.js +0 -112
  392. package/dist/triage-HHYGT3HY.js +0 -671
  393. package/dist/tutorial-KD22SUNO.js +0 -666
  394. package/dist/upgrade-H5PF32BW.js +0 -551
  395. package/dist/validate-CNKEKO6A.js +0 -134
  396. package/dist/validate-MB5ULIHS.js +0 -39
  397. package/dist/validate-QH3LADM6.js +0 -64
  398. package/dist/watch-2TKP5PVL.js +0 -199
  399. package/dist/watch-ZF4ML6CD.js +0 -111
  400. package/dist/wisdom-AATMGNFA.js +0 -319
  401. package/dist/work-log-loader-5L45XNYZ.js +0 -14
  402. package/dist/workspace-6E6OSRNU.js +0 -21
  403. package/platform-ui/dist/assets/AmbientSection-WtHfNedO.js +0 -1
  404. package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +0 -1
  405. package/platform-ui/dist/assets/LoreSection-CwDDHrz9.js +0 -1
  406. package/platform-ui/dist/assets/SentinelSection-Cl7e5oZ6.js +0 -1
  407. package/platform-ui/dist/assets/TeamSection-CqSIMrKz.js +0 -1
  408. package/platform-ui/dist/assets/index-CfpZFjea.css +0 -1
  409. package/platform-ui/dist/assets/index-F0KL9xrN.js +0 -57
@@ -1,1017 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- parseGateConfig
4
- } from "./chunk-IRKUEJVW.js";
5
- import "./chunk-PDX44BCA.js";
6
-
7
- // src/commands/portal/test.ts
8
- import * as path3 from "path";
9
- import * as fs3 from "fs";
10
- import chalk from "chalk";
11
-
12
- // ../portal/sdk/dist/chunk-BRTWJEZU.js
13
- var globalGateClient = null;
14
- function setGateClient(client) {
15
- globalGateClient = client;
16
- }
17
- function getGateClient() {
18
- return globalGateClient;
19
- }
20
-
21
- // ../portal/manager/dist/index.js
22
- import * as fs from "fs";
23
- import * as path from "path";
24
- import * as fs2 from "fs";
25
- import * as path2 from "path";
26
- async function validateGateway(gateId, testCases, client) {
27
- const gateClient = client || getGateClient();
28
- if (!gateClient) {
29
- return {
30
- passed: false,
31
- results: [],
32
- errors: ["No gate client configured"]
33
- };
34
- }
35
- const results = [];
36
- const errors = [];
37
- for (const testCase of testCases) {
38
- try {
39
- const result = await gateClient.check(gateId, testCase.entity);
40
- const passed = result.passed === testCase.expected;
41
- if (testCase.expectedPrizes && result.passed) {
42
- const triggeredPrizeIds = result.triggeredPrizes.map((p) => p.id);
43
- const missingPrizes = testCase.expectedPrizes.filter(
44
- (id) => !triggeredPrizeIds.includes(id)
45
- );
46
- if (missingPrizes.length > 0) {
47
- errors.push(
48
- `Test "${testCase.name}": Expected prizes not triggered: ${missingPrizes.join(", ")}`
49
- );
50
- }
51
- }
52
- results.push({
53
- testCase,
54
- result,
55
- passed
56
- });
57
- if (!passed) {
58
- errors.push(
59
- `Test "${testCase.name}": Expected ${testCase.expected ? "pass" : "fail"}, got ${result.passed ? "pass" : "fail"}`
60
- );
61
- }
62
- } catch (error) {
63
- errors.push(`Test "${testCase.name}": ${error.message}`);
64
- results.push({
65
- testCase,
66
- result: {
67
- gate: { id: gateId, locks: [], prizes: [] },
68
- passed: false,
69
- lockResults: [],
70
- triggeredPrizes: [],
71
- timestamp: Date.now()
72
- },
73
- passed: false
74
- });
75
- }
76
- }
77
- return {
78
- passed: errors.length === 0,
79
- results,
80
- errors
81
- };
82
- }
83
- async function generateTests(gateConfigPath, options = {}) {
84
- const {
85
- outputDir = "tests/gates",
86
- framework = "jest",
87
- includeFlows = true
88
- } = options;
89
- const gateConfig = await parseGateConfig(gateConfigPath);
90
- const generatedFiles = [];
91
- const absOutputDir = path.resolve(outputDir);
92
- if (!fs.existsSync(absOutputDir)) {
93
- fs.mkdirSync(absOutputDir, { recursive: true });
94
- }
95
- for (const gate of gateConfig.gates) {
96
- const testFile = generateGateTest(gate, framework);
97
- const fileName = `${gate.id.replace(/[^a-z0-9]/gi, "-")}.test.ts`;
98
- const filePath = path.join(absOutputDir, fileName);
99
- fs.writeFileSync(filePath, testFile, "utf8");
100
- generatedFiles.push(filePath);
101
- }
102
- if (includeFlows && gateConfig.flows.length > 0) {
103
- const flowsDir = path.join(absOutputDir, "..", "flows");
104
- if (!fs.existsSync(flowsDir)) {
105
- fs.mkdirSync(flowsDir, { recursive: true });
106
- }
107
- for (const flow of gateConfig.flows) {
108
- const testFile = generateFlowTest(flow, gateConfig.gates, framework);
109
- const fileName = `${flow.id.replace(/[^a-z0-9]/gi, "-")}.test.ts`;
110
- const filePath = path.join(flowsDir, fileName);
111
- fs.writeFileSync(filePath, testFile, "utf8");
112
- generatedFiles.push(filePath);
113
- }
114
- }
115
- return generatedFiles;
116
- }
117
- function generateGateTest(gate, framework) {
118
- const testFn = framework === "mocha" ? "it" : framework === "vitest" ? "it" : "test";
119
- const gateId = gate.id;
120
- const gateName = gate.description || gateId;
121
- const lockTests = gate.locks.map((lock) => {
122
- const lockTests2 = lock.keys.map((key, idx) => {
123
- return ` ${testFn}('should check key: ${key.description || `Key ${idx + 1}`}', async () => {
124
- const entity = {
125
- // TODO: Add entity properties needed for this key
126
- // Key expression: ${key.expression}
127
- };
128
-
129
- const result = await checkGateway('${gateId}', entity);
130
- // TODO: Assert expected result
131
- expect(result.passed).toBeDefined();
132
- });`;
133
- });
134
- return ` describe('Lock: ${lock.description || lock.id}', () => {
135
- ${lockTests2.join("\n\n")}
136
- });`;
137
- });
138
- return `/**
139
- * Generated test file for gate: ${gateName}
140
- * Gate ID: ${gateId}
141
- *
142
- * TODO: Fill in entity mock data and expected results
143
- */
144
-
145
- import { checkGateway, validateGateway } from '@a-company/portal-manager';
146
- import { createGate, setGateClient } from '@a-company/portal-sdk';
147
- import { parseGateConfig } from '@a-company/portal-core';
148
-
149
- ${framework === "vitest" ? "import { describe, it, expect, beforeAll } from 'vitest';" : framework === "mocha" ? "import { describe, it } from 'mocha';" : "import { describe, test as it, expect, beforeAll } from '@jest/globals';"}
150
-
151
- describe('Gate: ${gateName}', () => {
152
- beforeAll(async () => {
153
- // Load gate configuration
154
- const config = await parseGateConfig('./portal.yaml');
155
- const client = createGate(config);
156
- setGateClient(client);
157
- });
158
-
159
- ${lockTests.join("\n\n")}
160
-
161
- ${testFn}('should trigger prizes when gate passes', async () => {
162
- const entity = {
163
- // TODO: Add entity that passes all locks
164
- };
165
-
166
- const result = await checkGateway('${gateId}', entity);
167
-
168
- if (result.passed) {
169
- expect(result.triggeredPrizes.length).toBeGreaterThan(0);
170
- // TODO: Assert specific prizes
171
- ${gate.prizes.map((p) => `// expect(result.triggeredPrizes).toContainEqual(expect.objectContaining({ id: '${p.id}' }));`).join("\n ")}
172
- }
173
- });
174
- });
175
- `;
176
- }
177
- function generateFlowTest(flow, _gates, framework) {
178
- const testFn = framework === "mocha" ? "it" : framework === "vitest" ? "it" : "test";
179
- const flowName = flow.description || flow.id;
180
- const gateTests = flow.gates.map((gateId, idx) => {
181
- return ` ${testFn}('should pass gate ${idx + 1}: ${gateId}', async () => {
182
- const entity = {
183
- // TODO: Add entity properties
184
- };
185
-
186
- const result = await checkGateway('${gateId}', entity);
187
- expect(result.passed).toBe(true);
188
- });`;
189
- });
190
- return `/**
191
- * Generated test file for flow: ${flowName}
192
- * Flow ID: ${flow.id}
193
- *
194
- * TODO: Fill in entity mock data for each gate in the flow
195
- */
196
-
197
- import { checkGateway } from '@a-company/portal-manager';
198
- import { createGate, setGateClient } from '@a-company/portal-sdk';
199
- import { parseGateConfig } from '@a-company/portal-core';
200
-
201
- ${framework === "vitest" ? "import { describe, it, expect, beforeAll } from 'vitest';" : framework === "mocha" ? "import { describe, it } from 'mocha';" : "import { describe, test as it, expect, beforeAll } from '@jest/globals';"}
202
-
203
- describe('Flow: ${flowName}', () => {
204
- beforeAll(async () => {
205
- const config = await parseGateConfig('./portal.yaml');
206
- const client = createGate(config);
207
- setGateClient(client);
208
- });
209
-
210
- ${testFn}('should complete entire flow', async () => {
211
- const entity = {
212
- // TODO: Add entity that passes all gates in flow
213
- };
214
-
215
- ${gateTests.join("\n\n")}
216
- });
217
- });
218
- `;
219
- }
220
- async function scanComponents(options) {
221
- const { rootDir, patterns = ["**/*.tsx", "**/*.jsx"] } = options;
222
- const components = [];
223
- const scannedFiles = /* @__PURE__ */ new Set();
224
- function scanDirectory(dir) {
225
- try {
226
- const entries = fs2.readdirSync(dir, { withFileTypes: true });
227
- for (const entry of entries) {
228
- const fullPath = path2.join(dir, entry.name);
229
- if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === "build") {
230
- continue;
231
- }
232
- if (entry.isDirectory()) {
233
- scanDirectory(fullPath);
234
- } else if (entry.isFile()) {
235
- const matchesPattern = patterns.some((pattern) => {
236
- if (pattern.includes("**")) {
237
- const ext = pattern.split(".").pop();
238
- return fullPath.endsWith(`.${ext}`);
239
- }
240
- return fullPath.endsWith(pattern);
241
- });
242
- if (matchesPattern && !scannedFiles.has(fullPath)) {
243
- scannedFiles.add(fullPath);
244
- const info = analyzeComponent(fullPath);
245
- if (info) {
246
- components.push(info);
247
- }
248
- }
249
- }
250
- }
251
- } catch (error) {
252
- }
253
- }
254
- scanDirectory(rootDir);
255
- return components;
256
- }
257
- function analyzeComponent(filePath) {
258
- try {
259
- const content = fs2.readFileSync(filePath, "utf8");
260
- const componentName = path2.basename(filePath, path2.extname(filePath));
261
- const gatePatterns = [
262
- /@Gate\(['"]([^'"]+)['"]\)/g,
263
- /@Gateway\(['"]([^'"]+)['"]\)/g,
264
- /GateGuard\(['"]([^'"]+)['"]\)/g,
265
- /checkGateway\(['"]([^'"]+)['"]/g,
266
- /gate:\s*['"]([^'"]+)['"]/g
267
- ];
268
- const requiredGates = /* @__PURE__ */ new Set();
269
- const missingChecks = [];
270
- for (const pattern of gatePatterns) {
271
- let match;
272
- while ((match = pattern.exec(content)) !== null) {
273
- const gateId = match[1];
274
- if (gateId && gateId.startsWith("^")) {
275
- requiredGates.add(gateId);
276
- }
277
- }
278
- }
279
- const hasGateCheck = content.includes("checkGateway") || content.includes("GateGuard") || content.includes("Gateway") || content.includes("useGate");
280
- if (requiredGates.size > 0 && !hasGateCheck) {
281
- missingChecks.push(...Array.from(requiredGates));
282
- }
283
- return {
284
- filePath,
285
- componentName,
286
- requiredGates: Array.from(requiredGates),
287
- missingChecks
288
- };
289
- } catch (error) {
290
- return null;
291
- }
292
- }
293
- function generateComponentReport(components) {
294
- const lines = [];
295
- lines.push("# Component Access Report\n");
296
- lines.push(`Generated: ${(/* @__PURE__ */ new Date()).toISOString()}
297
- `);
298
- lines.push(`Total Components: ${components.length}
299
- `);
300
- const withMissingChecks = components.filter((c) => c.missingChecks.length > 0);
301
- if (withMissingChecks.length > 0) {
302
- lines.push(`
303
- ## Components Missing Gate Checks (${withMissingChecks.length})
304
- `);
305
- for (const component of withMissingChecks) {
306
- lines.push(`### ${component.componentName}`);
307
- lines.push(`File: ${component.filePath}`);
308
- lines.push(`Missing checks for gates: ${component.missingChecks.join(", ")}
309
- `);
310
- }
311
- } else {
312
- lines.push("\n\u2705 All components have proper gate checks!\n");
313
- }
314
- return lines.join("\n");
315
- }
316
-
317
- // ../portal/sdk/dist/index.js
318
- function tokenize(expr) {
319
- const tokens = [];
320
- let i = 0;
321
- while (i < expr.length) {
322
- const char = expr[i];
323
- if (/\s/.test(char)) {
324
- i++;
325
- continue;
326
- }
327
- if (char === '"' || char === "'") {
328
- const quote = char;
329
- let str = "";
330
- i++;
331
- while (i < expr.length && expr[i] !== quote) {
332
- if (expr[i] === "\\" && i + 1 < expr.length) {
333
- i++;
334
- str += expr[i];
335
- } else {
336
- str += expr[i];
337
- }
338
- i++;
339
- }
340
- i++;
341
- tokens.push({ type: "STRING", value: str });
342
- continue;
343
- }
344
- if (/\d/.test(char)) {
345
- let num = "";
346
- while (i < expr.length && /[\d.]/.test(expr[i])) {
347
- num += expr[i];
348
- i++;
349
- }
350
- tokens.push({ type: "NUMBER", value: num });
351
- continue;
352
- }
353
- if (/[a-zA-Z_]/.test(char)) {
354
- let ident = "";
355
- while (i < expr.length && /[a-zA-Z0-9_]/.test(expr[i])) {
356
- ident += expr[i];
357
- i++;
358
- }
359
- if (ident === "true" || ident === "false") {
360
- tokens.push({ type: "BOOLEAN", value: ident });
361
- } else if (ident === "null" || ident === "undefined") {
362
- tokens.push({ type: "NULL", value: ident });
363
- } else if (["and", "or", "not", "includes", "in"].includes(ident)) {
364
- tokens.push({ type: "OPERATOR", value: ident });
365
- } else {
366
- tokens.push({ type: "IDENTIFIER", value: ident });
367
- }
368
- continue;
369
- }
370
- if (expr.slice(i, i + 3) === "===" || expr.slice(i, i + 3) === "!==") {
371
- tokens.push({ type: "OPERATOR", value: expr.slice(i, i + 3) });
372
- i += 3;
373
- continue;
374
- }
375
- if (expr.slice(i, i + 2) === "==" || expr.slice(i, i + 2) === "!=" || expr.slice(i, i + 2) === "<=" || expr.slice(i, i + 2) === ">=" || expr.slice(i, i + 2) === "&&" || expr.slice(i, i + 2) === "||") {
376
- tokens.push({ type: "OPERATOR", value: expr.slice(i, i + 2) });
377
- i += 2;
378
- continue;
379
- }
380
- if ("<>=!".includes(char)) {
381
- tokens.push({ type: "OPERATOR", value: char });
382
- i++;
383
- continue;
384
- }
385
- if (char === "(") {
386
- tokens.push({ type: "LPAREN", value: char });
387
- i++;
388
- continue;
389
- }
390
- if (char === ")") {
391
- tokens.push({ type: "RPAREN", value: char });
392
- i++;
393
- continue;
394
- }
395
- if (char === ".") {
396
- tokens.push({ type: "DOT", value: char });
397
- i++;
398
- continue;
399
- }
400
- if (char === ",") {
401
- tokens.push({ type: "COMMA", value: char });
402
- i++;
403
- continue;
404
- }
405
- i++;
406
- }
407
- tokens.push({ type: "EOF", value: "" });
408
- return tokens;
409
- }
410
- var ExpressionEvaluator = class {
411
- tokens;
412
- pos;
413
- context;
414
- constructor(tokens, context) {
415
- this.tokens = tokens;
416
- this.pos = 0;
417
- this.context = context;
418
- }
419
- current() {
420
- return this.tokens[this.pos] || { type: "EOF", value: "" };
421
- }
422
- advance() {
423
- const token = this.current();
424
- this.pos++;
425
- return token;
426
- }
427
- evaluate() {
428
- return this.parseOr();
429
- }
430
- parseOr() {
431
- let left = this.parseAnd();
432
- while (this.current().value === "||" || this.current().value === "or") {
433
- this.advance();
434
- const right = this.parseAnd();
435
- left = Boolean(left) || Boolean(right);
436
- }
437
- return left;
438
- }
439
- parseAnd() {
440
- let left = this.parseNot();
441
- while (this.current().value === "&&" || this.current().value === "and") {
442
- this.advance();
443
- const right = this.parseNot();
444
- left = Boolean(left) && Boolean(right);
445
- }
446
- return left;
447
- }
448
- parseNot() {
449
- if (this.current().value === "!" || this.current().value === "not") {
450
- this.advance();
451
- return !Boolean(this.parseNot());
452
- }
453
- return this.parseComparison();
454
- }
455
- parseComparison() {
456
- let left = this.parsePrimary();
457
- const op = this.current();
458
- if (op.type === "OPERATOR") {
459
- switch (op.value) {
460
- case "==":
461
- case "===":
462
- this.advance();
463
- return left === this.parsePrimary();
464
- case "!=":
465
- case "!==":
466
- this.advance();
467
- return left !== this.parsePrimary();
468
- case "<":
469
- this.advance();
470
- return left < this.parsePrimary();
471
- case ">":
472
- this.advance();
473
- return left > this.parsePrimary();
474
- case "<=":
475
- this.advance();
476
- return left <= this.parsePrimary();
477
- case ">=":
478
- this.advance();
479
- return left >= this.parsePrimary();
480
- case "includes":
481
- this.advance();
482
- const includesValue = this.parsePrimary();
483
- if (Array.isArray(left)) {
484
- return left.includes(includesValue);
485
- }
486
- if (typeof left === "string") {
487
- return left.includes(String(includesValue));
488
- }
489
- return false;
490
- case "in":
491
- this.advance();
492
- const inArray = this.parsePrimary();
493
- if (Array.isArray(inArray)) {
494
- return inArray.includes(left);
495
- }
496
- return false;
497
- }
498
- }
499
- return left;
500
- }
501
- parsePrimary() {
502
- const token = this.current();
503
- if (token.type === "LPAREN") {
504
- this.advance();
505
- const value = this.parseOr();
506
- if (this.current().type === "RPAREN") {
507
- this.advance();
508
- }
509
- return value;
510
- }
511
- if (token.type === "STRING") {
512
- this.advance();
513
- return token.value;
514
- }
515
- if (token.type === "NUMBER") {
516
- this.advance();
517
- return parseFloat(token.value);
518
- }
519
- if (token.type === "BOOLEAN") {
520
- this.advance();
521
- return token.value === "true";
522
- }
523
- if (token.type === "NULL") {
524
- this.advance();
525
- return null;
526
- }
527
- if (token.type === "IDENTIFIER") {
528
- return this.parseIdentifier();
529
- }
530
- return null;
531
- }
532
- parseIdentifier() {
533
- let value = this.context;
534
- while (this.current().type === "IDENTIFIER" || this.current().type === "DOT") {
535
- if (this.current().type === "DOT") {
536
- this.advance();
537
- continue;
538
- }
539
- const key = this.advance().value;
540
- if (value !== null && typeof value === "object" && !Array.isArray(value)) {
541
- value = value[key];
542
- } else {
543
- value = void 0;
544
- }
545
- if (this.current().type === "LPAREN") {
546
- this.advance();
547
- const args = [];
548
- while (this.current().type !== "RPAREN" && this.current().type !== "EOF") {
549
- args.push(this.parseOr());
550
- if (this.current().type === "COMMA") {
551
- this.advance();
552
- }
553
- }
554
- if (this.current().type === "RPAREN") {
555
- this.advance();
556
- }
557
- return this.callMethod(key, value, args);
558
- }
559
- if (this.current().type !== "DOT") {
560
- break;
561
- }
562
- }
563
- return value;
564
- }
565
- callMethod(method, target, args) {
566
- switch (method) {
567
- case "includes":
568
- if (Array.isArray(target)) {
569
- return target.includes(args[0]);
570
- }
571
- if (typeof target === "string") {
572
- return target.includes(String(args[0]));
573
- }
574
- return false;
575
- case "startsWith":
576
- if (typeof target === "string") {
577
- return target.startsWith(String(args[0]));
578
- }
579
- return false;
580
- case "endsWith":
581
- if (typeof target === "string") {
582
- return target.endsWith(String(args[0]));
583
- }
584
- return false;
585
- case "length":
586
- if (Array.isArray(target) || typeof target === "string") {
587
- return target.length;
588
- }
589
- return 0;
590
- default:
591
- return null;
592
- }
593
- }
594
- };
595
- function evaluateExpression(expression, context) {
596
- try {
597
- const tokens = tokenize(expression);
598
- const evaluator = new ExpressionEvaluator(tokens, context);
599
- const result = evaluator.evaluate();
600
- return {
601
- passed: Boolean(result)
602
- };
603
- } catch (error) {
604
- return {
605
- passed: false,
606
- error: error.message
607
- };
608
- }
609
- }
610
- var GateClient = class {
611
- config;
612
- prizeHandlers = /* @__PURE__ */ new Map();
613
- firedPrizes = [];
614
- ws = null;
615
- options;
616
- entityIdResolver;
617
- constructor(config, options = {}) {
618
- this.config = config;
619
- this.options = options;
620
- this.entityIdResolver = options.entityIdResolver || this.defaultEntityIdResolver;
621
- if (options.devMode) {
622
- this.connectWatcher();
623
- }
624
- }
625
- /**
626
- * Default entity ID resolver - looks for id, _id, userId, entityId
627
- */
628
- defaultEntityIdResolver(entity) {
629
- return entity.id || entity._id || entity.userId || entity.entityId || "anonymous";
630
- }
631
- /**
632
- * Connect to the Gate watcher server
633
- */
634
- connectWatcher() {
635
- const url = this.options.watcherUrl || `ws://localhost:${this.config.settings.dev.watcherPort}`;
636
- try {
637
- if (typeof WebSocket !== "undefined") {
638
- this.ws = new WebSocket(url);
639
- this.ws.onopen = () => {
640
- console.log("[Gate SDK] Connected to watcher");
641
- };
642
- this.ws.onerror = () => {
643
- console.warn("[Gate SDK] Failed to connect to watcher");
644
- };
645
- this.ws.onclose = () => {
646
- setTimeout(() => this.connectWatcher(), 5e3);
647
- };
648
- }
649
- } catch {
650
- console.warn("[Gate SDK] WebSocket not available for watcher connection");
651
- }
652
- }
653
- /**
654
- * Send event to watcher
655
- */
656
- sendWatcherEvent(event) {
657
- if (this.ws && this.ws.readyState === WebSocket.OPEN) {
658
- this.ws.send(JSON.stringify(event));
659
- }
660
- }
661
- /**
662
- * Register a handler for a prize
663
- */
664
- onPrize(prizeId, handler) {
665
- if (!this.prizeHandlers.has(prizeId)) {
666
- this.prizeHandlers.set(prizeId, []);
667
- }
668
- this.prizeHandlers.get(prizeId).push(handler);
669
- return () => {
670
- const handlers = this.prizeHandlers.get(prizeId);
671
- if (handlers) {
672
- const index = handlers.indexOf(handler);
673
- if (index >= 0) {
674
- handlers.splice(index, 1);
675
- }
676
- }
677
- };
678
- }
679
- /**
680
- * Check if an entity can pass through a gate
681
- */
682
- async check(gateId, entity) {
683
- const gate = this.config.gates.find((g) => g.id === gateId);
684
- if (!gate) {
685
- throw new Error(`Gate not found: ${gateId}`);
686
- }
687
- const entityId = this.entityIdResolver(entity);
688
- const timestamp = Date.now();
689
- this.sendWatcherEvent({
690
- type: "gate:check",
691
- timestamp,
692
- entityId,
693
- data: { gate, entitySnapshot: entity }
694
- });
695
- const lockResults = [];
696
- let allLocksPassed = true;
697
- for (const lock of gate.locks) {
698
- const keyResults = [];
699
- let lockPassed;
700
- if (lock.mode === "any") {
701
- lockPassed = false;
702
- for (const key of lock.keys) {
703
- const { passed, error } = evaluateExpression(key.expression, entity);
704
- keyResults.push({ key, passed, error });
705
- if (passed) {
706
- lockPassed = true;
707
- }
708
- }
709
- } else {
710
- lockPassed = true;
711
- for (const key of lock.keys) {
712
- const { passed, error } = evaluateExpression(key.expression, entity);
713
- keyResults.push({ key, passed, error });
714
- if (!passed) {
715
- lockPassed = false;
716
- }
717
- }
718
- }
719
- lockResults.push({
720
- lock,
721
- passed: lockPassed,
722
- keyResults
723
- });
724
- if (!lockPassed) {
725
- allLocksPassed = false;
726
- }
727
- }
728
- const triggeredPrizes = [];
729
- if (allLocksPassed) {
730
- for (const prize of gate.prizes) {
731
- if (prize.oneTime) {
732
- const alreadyFired = this.firedPrizes.some(
733
- (fp) => fp.entityId === entityId && fp.prizeId === prize.id
734
- );
735
- if (alreadyFired) {
736
- continue;
737
- }
738
- }
739
- triggeredPrizes.push(prize);
740
- if (prize.oneTime) {
741
- this.firedPrizes.push({
742
- entityId,
743
- prizeId: prize.id,
744
- timestamp
745
- });
746
- }
747
- const handlers = this.prizeHandlers.get(prize.id) || [];
748
- for (const handler of handlers) {
749
- try {
750
- await handler(entity, {
751
- gate,
752
- prize,
753
- timestamp
754
- });
755
- } catch (error) {
756
- console.error(`[Gate SDK] Prize handler error for ${prize.id}:`, error);
757
- }
758
- }
759
- this.sendWatcherEvent({
760
- type: "prize:fire",
761
- timestamp: Date.now(),
762
- entityId,
763
- data: { prizeId: prize.id, metadata: prize.metadata }
764
- });
765
- }
766
- }
767
- const result = {
768
- gate,
769
- passed: allLocksPassed,
770
- lockResults,
771
- triggeredPrizes,
772
- timestamp,
773
- entitySnapshot: entity
774
- };
775
- this.sendWatcherEvent({
776
- type: allLocksPassed ? "gate:pass" : "gate:fail",
777
- timestamp: Date.now(),
778
- entityId,
779
- data: result
780
- });
781
- return result;
782
- }
783
- /**
784
- * Get a gate by ID
785
- */
786
- getGate(gateId) {
787
- return this.config.gates.find((g) => g.id === gateId);
788
- }
789
- /**
790
- * Get all gates
791
- */
792
- getGates() {
793
- return this.config.gates;
794
- }
795
- /**
796
- * Get all flows
797
- */
798
- getFlows() {
799
- return this.config.flows;
800
- }
801
- /**
802
- * Reset fired prizes for an entity (useful for testing)
803
- */
804
- resetPrizes(entityId) {
805
- if (entityId) {
806
- this.firedPrizes = this.firedPrizes.filter((fp) => fp.entityId !== entityId);
807
- } else {
808
- this.firedPrizes = [];
809
- }
810
- }
811
- /**
812
- * Disconnect from watcher
813
- */
814
- disconnect() {
815
- if (this.ws) {
816
- this.ws.close();
817
- this.ws = null;
818
- }
819
- }
820
- };
821
- async function createGate(configPath, options = {}) {
822
- const config = await parseGateConfig(configPath);
823
- const devMode = options.devMode ?? process.env.NODE_ENV !== "production";
824
- return new GateClient(config, {
825
- ...options,
826
- devMode
827
- });
828
- }
829
- var isProduction = typeof process !== "undefined" ? process.env.NODE_ENV === "production" : typeof import.meta !== "undefined" && import.meta.env?.PROD;
830
- var enableValidation = typeof process !== "undefined" ? process.env.PORTAL_VALIDATION === "true" : typeof import.meta !== "undefined" && import.meta.env?.VITE_ENABLE_PORTAL_VALIDATION === "true";
831
- var isTestMode = typeof process !== "undefined" ? process.env.PORTAL_TEST_MODE === "true" : typeof import.meta !== "undefined" && import.meta.env?.VITE_TEST_MODE === "true";
832
-
833
- // src/commands/portal/test.ts
834
- function extractPropertiesFromExpression(expr) {
835
- const propPattern = /\b([a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)+)/g;
836
- const matches = /* @__PURE__ */ new Set();
837
- let match;
838
- while ((match = propPattern.exec(expr)) !== null) {
839
- matches.add(match[1]);
840
- }
841
- return [...matches];
842
- }
843
- function buildEntityFromPath(path4) {
844
- const parts = path4.split(".");
845
- const root = {};
846
- let current = root;
847
- for (let i = 0; i < parts.length; i++) {
848
- const part = parts[i];
849
- if (i === parts.length - 1) {
850
- current[part] = "test-value";
851
- } else {
852
- const next = {};
853
- current[part] = next;
854
- current = next;
855
- }
856
- }
857
- return root;
858
- }
859
- function deepMerge(target, source) {
860
- const result = { ...target };
861
- for (const [key, value] of Object.entries(source)) {
862
- if (value && typeof value === "object" && !Array.isArray(value) && result[key] && typeof result[key] === "object" && !Array.isArray(result[key])) {
863
- result[key] = deepMerge(
864
- result[key],
865
- value
866
- );
867
- } else {
868
- result[key] = value;
869
- }
870
- }
871
- return result;
872
- }
873
- function generateTestCasesFromLocks(gate) {
874
- const cases = [];
875
- if (!gate.locks || gate.locks.length === 0) {
876
- cases.push({
877
- name: `${gate.id}: no locks (should pass)`,
878
- entity: { user: { id: "test-user" } },
879
- expected: true
880
- });
881
- return cases;
882
- }
883
- let fullEntity = {};
884
- for (const lock of gate.locks) {
885
- for (const key of lock.keys) {
886
- const paths = extractPropertiesFromExpression(key.expression);
887
- for (const p of paths) {
888
- const partial = buildEntityFromPath(p);
889
- fullEntity = deepMerge(fullEntity, partial);
890
- }
891
- }
892
- }
893
- cases.push({
894
- name: `${gate.id}: entity satisfying all locks (should pass)`,
895
- entity: fullEntity,
896
- expected: true
897
- });
898
- for (const lock of gate.locks) {
899
- const lockPaths = [];
900
- for (const key of lock.keys) {
901
- lockPaths.push(...extractPropertiesFromExpression(key.expression));
902
- }
903
- if (lockPaths.length > 0) {
904
- const missingEntity = {};
905
- for (const otherLock of gate.locks) {
906
- if (otherLock.id === lock.id) continue;
907
- for (const key of otherLock.keys) {
908
- const paths = extractPropertiesFromExpression(key.expression);
909
- for (const p of paths) {
910
- const partial = buildEntityFromPath(p);
911
- Object.assign(missingEntity, deepMerge(missingEntity, partial));
912
- }
913
- }
914
- }
915
- cases.push({
916
- name: `${gate.id}: missing lock "${lock.id}" properties (should fail)`,
917
- entity: gate.locks.length === 1 ? {} : missingEntity,
918
- expected: false
919
- });
920
- }
921
- }
922
- return cases;
923
- }
924
- async function gateTestCommand(targetPath, options) {
925
- const rootDir = targetPath ? path3.resolve(targetPath) : process.cwd();
926
- const gateConfigPath = path3.join(rootDir, "portal.yaml");
927
- if (!fs3.existsSync(gateConfigPath)) {
928
- console.error(chalk.red(`\u274C portal.yaml not found at ${gateConfigPath}`));
929
- console.error(chalk.gray(" Run `paradigm init` or create portal.yaml manually"));
930
- process.exit(1);
931
- }
932
- if (options.generate) {
933
- console.log(chalk.blue("\n\u{1F527} Generating test files...\n"));
934
- try {
935
- const generatedFiles = await generateTests(gateConfigPath, {
936
- outputDir: options.output || "tests/gates",
937
- framework: options.framework || "jest",
938
- includeFlows: true
939
- });
940
- console.log(chalk.green(`\u2705 Generated ${generatedFiles.length} test files:`));
941
- for (const file of generatedFiles) {
942
- console.log(chalk.gray(` ${path3.relative(rootDir, file)}`));
943
- }
944
- console.log("");
945
- } catch (error) {
946
- console.error(chalk.red(`\u274C Error generating tests: ${error.message}`));
947
- process.exit(1);
948
- }
949
- return;
950
- }
951
- if (options.component) {
952
- console.log(chalk.blue("\n\u{1F50D} Scanning components for gate checks...\n"));
953
- try {
954
- const components = await scanComponents({
955
- rootDir,
956
- gateConfigPath
957
- });
958
- const report = generateComponentReport(components);
959
- console.log(report);
960
- const withMissing = components.filter((c) => c.missingChecks.length > 0);
961
- if (withMissing.length > 0) {
962
- process.exit(1);
963
- }
964
- } catch (error) {
965
- console.error(chalk.red(`\u274C Error scanning components: ${error.message}`));
966
- process.exit(1);
967
- }
968
- return;
969
- }
970
- if (options.gate) {
971
- console.log(chalk.blue(`
972
- \u{1F9EA} Testing gate: ${options.gate}
973
- `));
974
- try {
975
- const config = await parseGateConfig(gateConfigPath);
976
- const client = await createGate(gateConfigPath);
977
- setGateClient(client);
978
- const gate = config.gates.find((g) => g.id === options.gate);
979
- if (!gate) {
980
- console.error(chalk.red(`\u274C Gate "${options.gate}" not found`));
981
- process.exit(1);
982
- }
983
- const testCases = [
984
- {
985
- name: "Empty entity (should fail)",
986
- entity: {},
987
- expected: false
988
- },
989
- ...generateTestCasesFromLocks(gate)
990
- ];
991
- const result = await validateGateway(options.gate, testCases, client);
992
- if (result.passed) {
993
- console.log(chalk.green("\u2705 All tests passed\n"));
994
- } else {
995
- console.log(chalk.red("\u274C Some tests failed\n"));
996
- for (const error of result.errors) {
997
- console.log(chalk.red(` ${error}`));
998
- }
999
- console.log("");
1000
- process.exit(1);
1001
- }
1002
- } catch (error) {
1003
- console.error(chalk.red(`\u274C Error testing gate: ${error.message}`));
1004
- process.exit(1);
1005
- }
1006
- return;
1007
- }
1008
- console.log(chalk.blue("\n\u{1F9EA} Portal Testing\n"));
1009
- console.log("Usage:");
1010
- console.log(" paradigm portal test --generate Generate test files");
1011
- console.log(" paradigm portal test --portal ^auth-required Test specific portal");
1012
- console.log(" paradigm portal test --component Validate component access");
1013
- console.log("");
1014
- }
1015
- export {
1016
- gateTestCommand
1017
- };