@powerhousedao/shared 6.2.3-dev.7 → 6.2.3-dev.70

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 (301) hide show
  1. package/dist/analytics/index.d.ts +4 -4
  2. package/dist/analytics/index.d.ts.map +1 -1
  3. package/dist/analytics/index.js +25 -24
  4. package/dist/analytics/index.js.map +1 -1
  5. package/dist/clis/args/{access-token-To5LaIfL.mjs → access-token-3Hqv_U8I.mjs} +2 -2
  6. package/dist/clis/args/{access-token-To5LaIfL.mjs.map → access-token-3Hqv_U8I.mjs.map} +1 -1
  7. package/dist/clis/args/access-token-C5sKsH2O.d.mts +16 -0
  8. package/dist/clis/args/access-token-C5sKsH2O.d.mts.map +1 -0
  9. package/dist/clis/args/access-token.d.mts +3 -2
  10. package/dist/clis/args/access-token.mjs +1 -1
  11. package/dist/clis/args/{common-CcYbXrBx.mjs → common-BXabdhiO.mjs} +30 -7
  12. package/dist/clis/args/common-BXabdhiO.mjs.map +1 -0
  13. package/dist/clis/args/common-Bnm859xU.d.mts +186 -0
  14. package/dist/clis/args/common-Bnm859xU.d.mts.map +1 -0
  15. package/dist/clis/args/common.d.mts +3 -2
  16. package/dist/clis/args/common.mjs +1 -1
  17. package/dist/clis/args/{connect-BVVvCmL9.mjs → connect-BG3HkYBk.mjs} +8 -3
  18. package/dist/clis/args/connect-BG3HkYBk.mjs.map +1 -0
  19. package/dist/clis/args/connect-DjeiqXus.d.mts +450 -0
  20. package/dist/clis/args/connect-DjeiqXus.d.mts.map +1 -0
  21. package/dist/clis/args/connect.d.mts +3 -2
  22. package/dist/clis/args/connect.mjs +1 -1
  23. package/dist/clis/args/dist-CorQTQL-.mjs +1533 -0
  24. package/dist/clis/args/dist-CorQTQL-.mjs.map +1 -0
  25. package/dist/clis/args/{generate-CA916Fvj.mjs → generate-BOItUNvP.mjs} +40 -2
  26. package/dist/clis/args/generate-BOItUNvP.mjs.map +1 -0
  27. package/dist/clis/args/generate-BPBBLeUD.d.mts +103 -0
  28. package/dist/clis/args/generate-BPBBLeUD.d.mts.map +1 -0
  29. package/dist/clis/args/generate.d.mts +3 -2
  30. package/dist/clis/args/generate.mjs +1 -1
  31. package/dist/clis/args/{help-Bqbgbalu.mjs → help-BfAqpYvC.mjs} +43 -16
  32. package/dist/clis/args/help-BfAqpYvC.mjs.map +1 -0
  33. package/dist/clis/args/help-KuqI-EEG.d.mts +203 -0
  34. package/dist/clis/args/help-KuqI-EEG.d.mts.map +1 -0
  35. package/dist/clis/args/help.d.mts +3 -2
  36. package/dist/clis/args/help.mjs +1 -1
  37. package/dist/clis/args/index.d.mts +20 -19
  38. package/dist/clis/args/index.mjs +18 -18
  39. package/dist/clis/args/init-CTaK80wE.d.mts +55 -0
  40. package/dist/clis/args/init-CTaK80wE.d.mts.map +1 -0
  41. package/dist/clis/args/{init-rz9Ei7nq.mjs → init-xlCNZ8Oe.mjs} +7 -2
  42. package/dist/clis/args/{init-rz9Ei7nq.mjs.map → init-xlCNZ8Oe.mjs.map} +1 -1
  43. package/dist/clis/args/init.d.mts +3 -2
  44. package/dist/clis/args/init.mjs +1 -1
  45. package/dist/clis/args/inspect-BjRmtB86.d.mts +13 -0
  46. package/dist/clis/args/inspect-BjRmtB86.d.mts.map +1 -0
  47. package/dist/clis/args/{inspect-tckH8mSw.mjs → inspect-UNQgtuR0.mjs} +2 -2
  48. package/dist/clis/args/{inspect-tckH8mSw.mjs.map → inspect-UNQgtuR0.mjs.map} +1 -1
  49. package/dist/clis/args/inspect.d.mts +3 -2
  50. package/dist/clis/args/inspect.mjs +1 -1
  51. package/dist/clis/args/install-B0tMyUMw.d.mts +37 -0
  52. package/dist/clis/args/install-B0tMyUMw.d.mts.map +1 -0
  53. package/dist/clis/args/{install-Sz2DlCHh.mjs → install-F-27kF6m.mjs} +2 -2
  54. package/dist/clis/args/{install-Sz2DlCHh.mjs.map → install-F-27kF6m.mjs.map} +1 -1
  55. package/dist/clis/args/install.d.mts +3 -2
  56. package/dist/clis/args/install.mjs +1 -1
  57. package/dist/clis/args/{list-DM2d6f1m.mjs → list-Bkfn8Yuo.mjs} +2 -2
  58. package/dist/clis/args/{list-DM2d6f1m.mjs.map → list-Bkfn8Yuo.mjs.map} +1 -1
  59. package/dist/clis/args/list-DrbxA7JJ.d.mts +10 -0
  60. package/dist/clis/args/list-DrbxA7JJ.d.mts.map +1 -0
  61. package/dist/clis/args/list.d.mts +3 -2
  62. package/dist/clis/args/list.mjs +1 -1
  63. package/dist/clis/args/{login-DiKT5Jfu.mjs → login-CIFkQExi.mjs} +2 -2
  64. package/dist/clis/args/{login-DiKT5Jfu.mjs.map → login-CIFkQExi.mjs.map} +1 -1
  65. package/dist/clis/args/login-CXRJXg71.d.mts +25 -0
  66. package/dist/clis/args/login-CXRJXg71.d.mts.map +1 -0
  67. package/dist/clis/args/login.d.mts +3 -2
  68. package/dist/clis/args/login.mjs +1 -1
  69. package/dist/clis/args/migrate-DkCQRL2D.d.mts +19 -0
  70. package/dist/clis/args/migrate-DkCQRL2D.d.mts.map +1 -0
  71. package/dist/clis/args/{migrate-CG_gWc4k.mjs → migrate-DwJGhc2d.mjs} +2 -2
  72. package/dist/clis/args/{migrate-CG_gWc4k.mjs.map → migrate-DwJGhc2d.mjs.map} +1 -1
  73. package/dist/clis/args/migrate.d.mts +3 -2
  74. package/dist/clis/args/migrate.mjs +1 -1
  75. package/dist/clis/args/publish-CeW4bOrl.d.mts +16 -0
  76. package/dist/clis/args/publish-CeW4bOrl.d.mts.map +1 -0
  77. package/dist/clis/args/{publish-DDZYsUfV.mjs → publish-DHqlGWmL.mjs} +2 -2
  78. package/dist/clis/args/{publish-DDZYsUfV.mjs.map → publish-DHqlGWmL.mjs.map} +1 -1
  79. package/dist/clis/args/publish.d.mts +3 -2
  80. package/dist/clis/args/publish.mjs +1 -1
  81. package/dist/clis/args/{registry-C_OVFQmI.mjs → registry-DIwES3l2.mjs} +2 -2
  82. package/dist/clis/args/{registry-C_OVFQmI.mjs.map → registry-DIwES3l2.mjs.map} +1 -1
  83. package/dist/clis/args/registry-DNH8xuaE.d.mts +17 -0
  84. package/dist/clis/args/registry-DNH8xuaE.d.mts.map +1 -0
  85. package/dist/clis/args/registry.d.mts +3 -2
  86. package/dist/clis/args/registry.mjs +1 -1
  87. package/dist/clis/args/run-CYp5t1xU.mjs +28 -0
  88. package/dist/clis/args/run-CYp5t1xU.mjs.map +1 -0
  89. package/dist/clis/args/run.d.mts +18 -0
  90. package/dist/clis/args/run.d.mts.map +1 -0
  91. package/dist/clis/args/run.mjs +2 -0
  92. package/dist/clis/args/service-CHjY5epu.d.mts +27 -0
  93. package/dist/clis/args/service-CHjY5epu.d.mts.map +1 -0
  94. package/dist/clis/args/{service-CHOOr0Gg.mjs → service-Cpjlyeu5.mjs} +2 -2
  95. package/dist/clis/args/{service-CHOOr0Gg.mjs.map → service-Cpjlyeu5.mjs.map} +1 -1
  96. package/dist/clis/args/service.d.mts +3 -2
  97. package/dist/clis/args/service.mjs +1 -1
  98. package/dist/clis/args/{switchboard-Dsp7nosi.mjs → switchboard-CCaAtU56.mjs} +2 -2
  99. package/dist/clis/args/{switchboard-Dsp7nosi.mjs.map → switchboard-CCaAtU56.mjs.map} +1 -1
  100. package/dist/clis/args/switchboard-RrNb1fUH.d.mts +70 -0
  101. package/dist/clis/args/switchboard-RrNb1fUH.d.mts.map +1 -0
  102. package/dist/clis/args/switchboard.d.mts +3 -2
  103. package/dist/clis/args/switchboard.mjs +1 -1
  104. package/dist/clis/args/{uninstall-CTwTX0u_.mjs → uninstall-3U0B8g5c.mjs} +2 -2
  105. package/dist/clis/args/{uninstall-CTwTX0u_.mjs.map → uninstall-3U0B8g5c.mjs.map} +1 -1
  106. package/dist/clis/args/uninstall-CDx7lwxn.d.mts +28 -0
  107. package/dist/clis/args/uninstall-CDx7lwxn.d.mts.map +1 -0
  108. package/dist/clis/args/uninstall.d.mts +3 -2
  109. package/dist/clis/args/uninstall.mjs +1 -1
  110. package/dist/clis/args/unpublish-CEDsk6uv.d.mts +22 -0
  111. package/dist/clis/args/unpublish-CEDsk6uv.d.mts.map +1 -0
  112. package/dist/clis/args/{unpublish-BPMkGEg5.mjs → unpublish-s9zUh6Gw.mjs} +2 -2
  113. package/dist/clis/args/{unpublish-BPMkGEg5.mjs.map → unpublish-s9zUh6Gw.mjs.map} +1 -1
  114. package/dist/clis/args/unpublish.d.mts +3 -2
  115. package/dist/clis/args/unpublish.mjs +1 -1
  116. package/dist/clis/args/{vetra-b4KUu1Ax.mjs → vetra-BUNlAAPp.mjs} +2 -2
  117. package/dist/clis/args/{vetra-b4KUu1Ax.mjs.map → vetra-BUNlAAPp.mjs.map} +1 -1
  118. package/dist/clis/args/vetra-DkDaWFPi.d.mts +111 -0
  119. package/dist/clis/args/vetra-DkDaWFPi.d.mts.map +1 -0
  120. package/dist/clis/args/vetra-ports.test.d.mts +2 -1
  121. package/dist/clis/args/vetra-ports.test.mjs +7366 -5728
  122. package/dist/clis/args/vetra-ports.test.mjs.map +1 -1
  123. package/dist/clis/args/vetra.d.mts +3 -2
  124. package/dist/clis/args/vetra.mjs +1 -1
  125. package/dist/clis/build-config-DwRi23zQ.mjs +262 -0
  126. package/dist/clis/build-config-DwRi23zQ.mjs.map +1 -0
  127. package/dist/clis/build-config.d.mts +55 -10616
  128. package/dist/clis/build-config.d.mts.map +1 -1
  129. package/dist/clis/build-config.mjs +2 -88
  130. package/dist/clis/build-pieces.d.mts +160 -0
  131. package/dist/clis/build-pieces.d.mts.map +1 -0
  132. package/dist/clis/build-pieces.mjs +549 -0
  133. package/dist/clis/build-pieces.mjs.map +1 -0
  134. package/dist/clis/command-names.d.mts +2 -2
  135. package/dist/clis/command-names.d.mts.map +1 -1
  136. package/dist/clis/command-names.mjs +1 -0
  137. package/dist/clis/command-names.mjs.map +1 -1
  138. package/dist/clis/constants.d.mts +3 -462
  139. package/dist/clis/constants.mjs +45 -13
  140. package/dist/clis/constants.mjs.map +1 -1
  141. package/dist/clis/feature-flags.d.mts +17 -0
  142. package/dist/clis/feature-flags.d.mts.map +1 -0
  143. package/dist/clis/feature-flags.mjs +21 -0
  144. package/dist/clis/feature-flags.mjs.map +1 -0
  145. package/dist/clis/index-DnZYG-8g.d.mts +11154 -0
  146. package/dist/clis/index-DnZYG-8g.d.mts.map +1 -0
  147. package/dist/clis/index.d.mts +1483 -1226
  148. package/dist/clis/index.d.mts.map +1 -1
  149. package/dist/clis/index.mjs +705 -353
  150. package/dist/clis/index.mjs.map +1 -1
  151. package/dist/clis/package-style.d.mts +32 -0
  152. package/dist/clis/package-style.d.mts.map +1 -0
  153. package/dist/clis/package-style.mjs +102 -0
  154. package/dist/clis/package-style.mjs.map +1 -0
  155. package/dist/clis/ph-dir.d.mts +26 -0
  156. package/dist/clis/ph-dir.d.mts.map +1 -0
  157. package/dist/clis/ph-dir.mjs +37 -0
  158. package/dist/clis/ph-dir.mjs.map +1 -0
  159. package/dist/clis/project-env.d.mts +4 -4
  160. package/dist/clis/project-env.d.mts.map +1 -1
  161. package/dist/clis/project-env.mjs.map +1 -1
  162. package/dist/clis/project-ports.d.mts +5 -5
  163. package/dist/clis/project-ports.d.mts.map +1 -1
  164. package/dist/clis/project-ports.mjs +1 -1
  165. package/dist/clis/project-ports.mjs.map +1 -1
  166. package/dist/clis/services/telemetry.d.mts +7 -7
  167. package/dist/clis/services/telemetry.d.mts.map +1 -1
  168. package/dist/clis/services/telemetry.mjs.map +1 -1
  169. package/dist/clis/types-BxOUzRvH.d.mts +588 -0
  170. package/dist/clis/types-BxOUzRvH.d.mts.map +1 -0
  171. package/dist/clis/utils.d.mts +4 -4
  172. package/dist/clis/utils.d.mts.map +1 -1
  173. package/dist/clis/utils.mjs.map +1 -1
  174. package/dist/{config-loader-B845Hidf.js → config-loader-DBJolZd0.js} +43 -9
  175. package/dist/config-loader-DBJolZd0.js.map +1 -0
  176. package/dist/connect/config-loader.d.ts +21 -8
  177. package/dist/connect/config-loader.d.ts.map +1 -1
  178. package/dist/connect/config-loader.js +2 -2
  179. package/dist/connect/index.d.ts +215 -57
  180. package/dist/connect/index.d.ts.map +1 -1
  181. package/dist/connect/index.js +341 -31
  182. package/dist/connect/index.js.map +1 -1
  183. package/dist/connect/json-adapter.d.ts +3 -4
  184. package/dist/connect/json-adapter.d.ts.map +1 -1
  185. package/dist/connect/json-adapter.js.map +1 -1
  186. package/dist/constants-CcaK3k1D.d.ts +9 -0
  187. package/dist/constants-CcaK3k1D.d.ts.map +1 -0
  188. package/dist/constants.d.ts +3 -2
  189. package/dist/constants.js +15 -5
  190. package/dist/constants.js.map +1 -1
  191. package/dist/document-drive/index.d.ts +103 -101
  192. package/dist/document-drive/index.d.ts.map +1 -1
  193. package/dist/document-drive/index.js +39 -19
  194. package/dist/document-drive/index.js.map +1 -1
  195. package/dist/document-model/errors.d.ts +3 -0
  196. package/dist/document-model/errors.js +152 -0
  197. package/dist/document-model/errors.js.map +1 -0
  198. package/dist/document-model/index.d.ts +5 -4
  199. package/dist/document-model/index.js +298 -391
  200. package/dist/document-model/index.js.map +1 -1
  201. package/dist/document-model/mock.d.ts +2 -3
  202. package/dist/document-model/mock.d.ts.map +1 -1
  203. package/dist/document-model/mock.js +2 -1
  204. package/dist/document-model/mock.js.map +1 -1
  205. package/dist/document-model/utils.d.ts +3 -2
  206. package/dist/document-model/utils.js +1 -1
  207. package/dist/document-model/version.d.ts +3 -0
  208. package/dist/document-model/version.js +8 -0
  209. package/dist/document-model/version.js.map +1 -0
  210. package/dist/index-DeEVCeve.d.ts +36 -0
  211. package/dist/index-DeEVCeve.d.ts.map +1 -0
  212. package/dist/index.d.ts +7 -6
  213. package/dist/index.js.map +1 -1
  214. package/dist/processors/index.d.ts +3 -2
  215. package/dist/processors/index.js +63 -4
  216. package/dist/processors/index.js.map +1 -1
  217. package/dist/purge-v06m_oGz.js +381 -0
  218. package/dist/purge-v06m_oGz.js.map +1 -0
  219. package/dist/registry/index.d.ts +15 -15
  220. package/dist/registry/index.d.ts.map +1 -1
  221. package/dist/registry/index.js +24 -6
  222. package/dist/registry/index.js.map +1 -1
  223. package/dist/registry/manifest-slim.d.ts +4 -3
  224. package/dist/registry/manifest-slim.d.ts.map +1 -1
  225. package/dist/registry/manifest-slim.js +21 -0
  226. package/dist/registry/manifest-slim.js.map +1 -1
  227. package/dist/registry/updates.d.ts +3 -3
  228. package/dist/registry/updates.d.ts.map +1 -1
  229. package/dist/registry/updates.js.map +1 -1
  230. package/dist/registry/urls.d.ts +2 -2
  231. package/dist/registry/urls.d.ts.map +1 -1
  232. package/dist/registry/urls.js.map +1 -1
  233. package/dist/{types-C1in4fl3.d.ts → types-Bsp8VL2y.d.ts} +2 -2
  234. package/dist/types-Bsp8VL2y.d.ts.map +1 -0
  235. package/dist/{types-CpnWmiFY.d.ts → types-PM0i4vns.d.ts} +2063 -824
  236. package/dist/types-PM0i4vns.d.ts.map +1 -0
  237. package/dist/{types-YqLqb0Zb.d.ts → types-f_wMStgZ.d.ts} +39 -43
  238. package/dist/types-f_wMStgZ.d.ts.map +1 -0
  239. package/dist/{utils-DP122OSS.d.ts → utils-BrKxCmKx.d.ts} +2 -2
  240. package/dist/utils-BrKxCmKx.d.ts.map +1 -0
  241. package/dist/{utils-aaTmfxFW.js → utils-CSF716ux.js} +10 -3
  242. package/dist/utils-CSF716ux.js.map +1 -0
  243. package/dist/version-BxLITo9P.d.ts +6 -0
  244. package/dist/version-BxLITo9P.d.ts.map +1 -0
  245. package/package.json +24 -7
  246. package/dist/clis/args/access-token--9H57y8J.d.mts +0 -18
  247. package/dist/clis/args/access-token--9H57y8J.d.mts.map +0 -1
  248. package/dist/clis/args/common-CcYbXrBx.mjs.map +0 -1
  249. package/dist/clis/args/common-zPBoTNJF.d.mts +0 -183
  250. package/dist/clis/args/common-zPBoTNJF.d.mts.map +0 -1
  251. package/dist/clis/args/connect-BVVvCmL9.mjs.map +0 -1
  252. package/dist/clis/args/connect-BtU0MTTc.d.mts +0 -443
  253. package/dist/clis/args/connect-BtU0MTTc.d.mts.map +0 -1
  254. package/dist/clis/args/generate-CA916Fvj.mjs.map +0 -1
  255. package/dist/clis/args/generate-DnV-bfXt.d.mts +0 -87
  256. package/dist/clis/args/generate-DnV-bfXt.d.mts.map +0 -1
  257. package/dist/clis/args/help-Bqbgbalu.mjs.map +0 -1
  258. package/dist/clis/args/help-CjAsudUn.d.mts +0 -193
  259. package/dist/clis/args/help-CjAsudUn.d.mts.map +0 -1
  260. package/dist/clis/args/init-CUXyfquF.d.mts +0 -55
  261. package/dist/clis/args/init-CUXyfquF.d.mts.map +0 -1
  262. package/dist/clis/args/inspect-DtZeoA5c.d.mts +0 -15
  263. package/dist/clis/args/inspect-DtZeoA5c.d.mts.map +0 -1
  264. package/dist/clis/args/install-CkP8zcHb.d.mts +0 -40
  265. package/dist/clis/args/install-CkP8zcHb.d.mts.map +0 -1
  266. package/dist/clis/args/list-BGf8s_gj.d.mts +0 -12
  267. package/dist/clis/args/list-BGf8s_gj.d.mts.map +0 -1
  268. package/dist/clis/args/login-DNsHwvqk.d.mts +0 -27
  269. package/dist/clis/args/login-DNsHwvqk.d.mts.map +0 -1
  270. package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs +0 -1013
  271. package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs.map +0 -1
  272. package/dist/clis/args/migrate-sixkWhxm.d.mts +0 -21
  273. package/dist/clis/args/migrate-sixkWhxm.d.mts.map +0 -1
  274. package/dist/clis/args/publish-Dqe5DUst.d.mts +0 -18
  275. package/dist/clis/args/publish-Dqe5DUst.d.mts.map +0 -1
  276. package/dist/clis/args/registry-C_RfTsKB.d.mts +0 -19
  277. package/dist/clis/args/registry-C_RfTsKB.d.mts.map +0 -1
  278. package/dist/clis/args/service-DhIkf8-O.d.mts +0 -22
  279. package/dist/clis/args/service-DhIkf8-O.d.mts.map +0 -1
  280. package/dist/clis/args/switchboard-BlPaq2at.d.mts +0 -72
  281. package/dist/clis/args/switchboard-BlPaq2at.d.mts.map +0 -1
  282. package/dist/clis/args/uninstall-BpA3YYbw.d.mts +0 -31
  283. package/dist/clis/args/uninstall-BpA3YYbw.d.mts.map +0 -1
  284. package/dist/clis/args/unpublish-CvwaIimG.d.mts +0 -24
  285. package/dist/clis/args/unpublish-CvwaIimG.d.mts.map +0 -1
  286. package/dist/clis/args/vetra-CoMvTJK7.d.mts +0 -113
  287. package/dist/clis/args/vetra-CoMvTJK7.d.mts.map +0 -1
  288. package/dist/clis/build-config.mjs.map +0 -1
  289. package/dist/clis/constants.d.mts.map +0 -1
  290. package/dist/config-loader-B845Hidf.js.map +0 -1
  291. package/dist/constants-BP_gjn8g.d.ts +0 -8
  292. package/dist/constants-BP_gjn8g.d.ts.map +0 -1
  293. package/dist/index-C_iVZe7f.d.ts +0 -7
  294. package/dist/index-C_iVZe7f.d.ts.map +0 -1
  295. package/dist/index-DyYIJtVy.d.ts +0 -836
  296. package/dist/index-DyYIJtVy.d.ts.map +0 -1
  297. package/dist/types-C1in4fl3.d.ts.map +0 -1
  298. package/dist/types-CpnWmiFY.d.ts.map +0 -1
  299. package/dist/types-YqLqb0Zb.d.ts.map +0 -1
  300. package/dist/utils-DP122OSS.d.ts.map +0 -1
  301. package/dist/utils-aaTmfxFW.js.map +0 -1
@@ -3,20 +3,20 @@ import { array, boolean, command, flag, multioption, number, oneOf, option, opti
3
3
  import { AGENTS as AGENTS$1 } from "package-manager-detector/constants";
4
4
  import { homedir } from "node:os";
5
5
  import path, { join } from "node:path";
6
- import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
6
+ import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
7
7
  import dotenv from "dotenv";
8
8
  import chalk from "chalk";
9
9
  import fsPromises, { mkdir, stat, writeFile } from "node:fs/promises";
10
10
  import { fileURLToPath } from "node:url";
11
11
  import { promisify } from "node:util";
12
12
  import { execFile } from "node:child_process";
13
- import { clean, valid } from "semver";
13
+ import { clean, compare, valid } from "semver";
14
14
  import spawn from "cross-spawn";
15
15
  import { isTruthy } from "remeda";
16
16
  import npa from "npm-package-arg";
17
17
  import { packageDirectory } from "package-directory";
18
18
  import { execSync } from "child_process";
19
- import { dirname } from "path";
19
+ import { dirname, resolve } from "path";
20
20
  import { writePackage } from "write-package";
21
21
  import lt from "semver/functions/lt.js";
22
22
  //#region \0rolldown/runtime.js
@@ -26,7 +26,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
26
26
  var __getOwnPropNames = Object.getOwnPropertyNames;
27
27
  var __getProtoOf = Object.getPrototypeOf;
28
28
  var __hasOwnProp = Object.prototype.hasOwnProperty;
29
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
29
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
30
30
  var __copyProps = (to, from, except, desc) => {
31
31
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
32
32
  key = keys[i];
@@ -37,11 +37,11 @@ var __copyProps = (to, from, except, desc) => {
37
37
  }
38
38
  return to;
39
39
  };
40
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
40
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
41
41
  value: mod,
42
42
  enumerable: true
43
43
  }) : target, mod));
44
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
44
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
45
45
  //#endregion
46
46
  //#region clis/constants.ts
47
47
  const SERVICE_ACTIONS = [
@@ -51,7 +51,7 @@ const SERVICE_ACTIONS = [
51
51
  "setup",
52
52
  "restart"
53
53
  ];
54
- const SECONDS_IN_DAY = 1440 * 60;
54
+ const SECONDS_IN_DAY = 86400;
55
55
  const DEFAULT_EXPIRY_DAYS = 7;
56
56
  const DEFAULT_EXPIRY_SECONDS = 7 * SECONDS_IN_DAY;
57
57
  const DRIVES_PRESERVE_STRATEGIES = ["preserve-all", "preserve-by-url-and-detach"];
@@ -74,6 +74,18 @@ const PROJECT_PORT_BAND_SIZE = 1e3;
74
74
  const PROJECT_PORT_BAND_SWITCHBOARD = 7e3;
75
75
  const PROJECT_PORT_BAND_STUDIO = 6e3;
76
76
  const PROJECT_PORT_BAND_VETRA_CONNECT = 2e3;
77
+ /**
78
+ * Icon for the drives switchboard creates by default, inlined as a data URI.
79
+ *
80
+ * A remote URL is the wrong shape for this: the value is baked into the drive
81
+ * document and rendered by every Connect that opens it, so the icon only
82
+ * appears when that client can reach that host. A desktop or air-gapped install
83
+ * cannot, and the ipfs.io gateway this previously pointed at now answers 403
84
+ * regardless.
85
+ *
86
+ * The mark is drawn dark-on-light so it stays legible against either theme.
87
+ */
88
+ const DEFAULT_DRIVE_ICON = "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23F3F5F7'/%3E%3Cpath%20fill='%23343839'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.0059%200L3.41636%205.45646C2.44979%206.25682%202.3795%207.71452%203.26456%208.60418L5.54425%2010.8957C6.21311%2011.568%206.35783%2012.6012%205.89944%2013.4314L4.48126%2016H2.13333C0.955126%2016%200%2015.0449%200%2013.8667V2.13333C0%200.955126%200.955126%200%202.13333%200H10.0059ZM11.2436%200L10.0128%202.24221C9.55899%203.06891%209.70183%204.09549%2010.3641%204.7669L12.7825%207.21868C13.6656%208.11402%2013.5866%209.57512%2012.612%2010.37L5.70922%2016H13.8667C15.0449%2016%2016%2015.0449%2016%2013.8667V2.13333C16%200.955126%2015.0449%200%2013.8667%200H11.2436Z'/%3E%3C/svg%3E";
77
89
  const DEFAULT_VETRA_DRIVE_ID = "vetra";
78
90
  const MINIMUM_NODE_VERSION = "24.0.0";
79
91
  const PH_BIN = "ph-cli-legacy";
@@ -87,6 +99,7 @@ const REACTOR_API_PACKAGE = "@powerhousedao/reactor-api";
87
99
  const ANALYTICS_ENGINE_CORE_PACKAGE = "@powerhousedao/analytics-engine-core";
88
100
  const GRAPHQL_PACKAGE = "graphql";
89
101
  const GRAPHQL_TAG_PACKAGE = "graphql-tag";
102
+ const PIECES_FRAMEWORK_PACKAGE = "@powerhousedao/pieces-framework";
90
103
  const PEER_EXTERNAL_DEPENDENCIES = {
91
104
  [GRAPHQL_PACKAGE]: {
92
105
  peer: "^16",
@@ -106,13 +119,21 @@ const PEER_EXTERNAL_DEPENDENCIES = {
106
119
  },
107
120
  zod: {
108
121
  peer: "^4",
109
- dev: "4.3.6"
122
+ dev: "4.6.5"
123
+ }
124
+ };
125
+ const FEATURE_DEPENDENCIES = {
126
+ analyticsProcessor: {
127
+ peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],
128
+ peerExternal: {},
129
+ devVersioned: []
130
+ },
131
+ piece: {
132
+ peerVersioned: [],
133
+ peerExternal: {},
134
+ devVersioned: [PIECES_FRAMEWORK_PACKAGE]
110
135
  }
111
136
  };
112
- const FEATURE_DEPENDENCIES = { analyticsProcessor: {
113
- peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],
114
- peerExternal: {}
115
- } };
116
137
  const VERSIONED_DEPENDENCIES = [...VERSIONED_PEER_DEPENDENCIES, ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned];
117
138
  const BOILERPLATE_ALLOWED_BUILDS = [
118
139
  "@apollo/protobufjs",
@@ -135,7 +156,10 @@ const VERSIONED_DEV_DEPENDENCIES = [
135
156
  "@powerhousedao/reactor",
136
157
  "@powerhousedao/shared",
137
158
  "@powerhousedao/connect",
138
- "@powerhousedao/design-system"
159
+ "@powerhousedao/design-system",
160
+ "@powerhousedao/host-core",
161
+ "@powerhousedao/clint",
162
+ "@powerhousedao/desktop"
139
163
  ];
140
164
  const packageJsonExports = {
141
165
  ".": {
@@ -169,14 +193,22 @@ const packageJsonExports = {
169
193
  },
170
194
  "./subgraphs": {
171
195
  types: "./dist/types/subgraphs/index.d.ts",
172
- browser: "./dist/browser/subgraphs/index.js",
173
196
  node: "./dist/node/subgraphs/index.mjs"
174
197
  },
198
+ "./connect-routes": { browser: "./dist/browser/connect-routes.js" },
175
199
  "./processors": {
176
200
  types: "./dist/types/processors/index.d.ts",
177
201
  browser: "./dist/browser/processors/index.js",
178
202
  node: "./dist/node/processors/index.mjs"
179
203
  },
204
+ "./pieces": {
205
+ types: "./dist/types/pieces/index.d.ts",
206
+ node: "./dist/node/pieces/index.mjs"
207
+ },
208
+ "./pieces/*": {
209
+ types: "./dist/types/pieces/*/index.d.ts",
210
+ node: "./dist/node/pieces/*/index.mjs"
211
+ },
180
212
  "./manifest": "./dist/powerhouse.manifest.json",
181
213
  "./style.css": "./dist/style.css"
182
214
  };
@@ -242,15 +274,15 @@ const externalDevDependencies = {
242
274
  "@types/react": "^19.2.3",
243
275
  "@types/react-dom": "^19.2.3",
244
276
  "@vitejs/plugin-react": "^6.0.1",
245
- "@vitest/coverage-v8": "4.1.1",
246
- oxfmt: "0.55.0",
277
+ "@vitest/coverage-v8": "5.0.3",
278
+ oxfmt: "0.68.0",
247
279
  oxlint: "1.70.0",
248
280
  "oxlint-tsgolint": "0.23.0",
249
281
  tailwindcss: "^4.1.16",
250
- typescript: "^5.9.3",
282
+ typescript: "~7.0.2",
251
283
  vite: "^8.0.10",
252
284
  "vite-tsconfig-paths": "6.1.1",
253
- vitest: "4.1.1"
285
+ vitest: "5.0.3"
254
286
  };
255
287
  const defaultManifest = {
256
288
  name: "",
@@ -309,6 +341,20 @@ const buildArgs = {
309
341
  defaultValue: () => "dist",
310
342
  defaultValueIsSerializable: true
311
343
  }),
344
+ noSharedDeps: flag({
345
+ type: boolean,
346
+ long: "no-shared-deps",
347
+ description: "Bundle the shared dependency set instead of externalizing it (default: externalize)",
348
+ defaultValue: () => false,
349
+ defaultValueIsSerializable: true
350
+ }),
351
+ ignoreTypeErrors: flag({
352
+ type: boolean,
353
+ long: "ignore-type-errors",
354
+ description: "Unsafe: build even when tsc reports type errors, without asking. The package can load and still fail at runtime",
355
+ defaultValue: () => false,
356
+ defaultValueIsSerializable: true
357
+ }),
312
358
  ...debugArgs
313
359
  };
314
360
  const packageManagerArgs = {
@@ -414,7 +460,7 @@ const vetraSwitchboardArgs = {
414
460
  const defaultDrivesUrl = option({
415
461
  type: optional(string),
416
462
  long: "default-drives-url",
417
- description: "The default drives url to use in connect",
463
+ description: "Comma-separated drive URLs to use as Connect's default drives.",
418
464
  defaultValue: () => ""
419
465
  });
420
466
  const logLevel = option({
@@ -551,7 +597,7 @@ const connectRuntimeOverrideArgs = {
551
597
  json: option({
552
598
  type: optional(string),
553
599
  long: "json",
554
- description: "Inline JSON override for the runtime connect.* block, e.g. '{\"renown\":{\"url\":\"...\"}}'. Validated against the runtime schema; deep-merged on top of env seeds and source powerhouse.config.json. Individual --flag values beat --json on collision."
600
+ description: "Inline JSON override for the runtime connect.* block, without the \"connect\" wrapper, e.g. '{\"app\":{\"workflowsEnabled\":true},\"renown\":{\"url\":\"...\"}}'. A top-level packageRegistryUrl is also accepted. Validated against the runtime schema (unknown keys fail); deep-merged on top of source powerhouse.config.json. Individual --flag values beat --json on collision."
555
601
  }),
556
602
  renownUrl: option({
557
603
  type: optional(string),
@@ -580,6 +626,11 @@ const connectRuntimeOverrideArgs = {
580
626
  long: "external-packages",
581
627
  description: "Override connect.packages.externalEnabled."
582
628
  }),
629
+ workflows: option({
630
+ type: optional(cliBoolean),
631
+ long: "workflows",
632
+ description: "Override connect.app.workflowsEnabled (load the @powerhousedao/workflow package: workflow + connection documents, their editors and Workflow Studio)."
633
+ }),
583
634
  remoteDrivesEnabled: option({
584
635
  type: optional(cliBoolean),
585
636
  long: "remote-drives-enabled",
@@ -801,6 +852,44 @@ const generateArgs = {
801
852
  long: "subgraph",
802
853
  description: "Subgraph name."
803
854
  }),
855
+ pieceName: option({
856
+ type: optional(string),
857
+ long: "piece",
858
+ description: "Piece name."
859
+ }),
860
+ pieceId: option({
861
+ type: optional(string),
862
+ long: "piece-id",
863
+ description: "Piece id, the pieceName a workflow step holds, e.g. @acme/piece-crm. Defaults to one derived from the package name."
864
+ }),
865
+ pieceAuth: option({
866
+ type: oneOf([
867
+ "none",
868
+ "secret",
869
+ "custom"
870
+ ]),
871
+ long: "piece-auth",
872
+ description: "The kind of connection the generated piece asks for. Default is custom.",
873
+ defaultValue: () => "custom",
874
+ defaultValueIsSerializable: true
875
+ }),
876
+ pieceActionName: option({
877
+ type: optional(string),
878
+ long: "piece-action",
879
+ description: "Name of an action to generate inside a piece."
880
+ }),
881
+ pieceTriggerName: option({
882
+ type: optional(string),
883
+ long: "piece-trigger",
884
+ description: "Name of a trigger to generate inside a piece."
885
+ }),
886
+ pieceTriggerStrategy: option({
887
+ type: oneOf(["polling", "webhook"]),
888
+ long: "piece-trigger-strategy",
889
+ description: "How a generated trigger fires. Default is polling.",
890
+ defaultValue: () => "polling",
891
+ defaultValueIsSerializable: true
892
+ }),
804
893
  importScriptName: option({
805
894
  type: optional(string),
806
895
  long: "import-script",
@@ -866,6 +955,24 @@ const generateArgs = {
866
955
  ...debugArgs
867
956
  };
868
957
  //#endregion
958
+ //#region clis/feature-flags.ts
959
+ /**
960
+ * Feature toggles shared by the CLIs (ph-cli and ph-cmd's dispatch/help).
961
+ * Hand-rolled env predicates by the CLI convention — deliberately no
962
+ * OpenFeature dependency here; that stack belongs to the runtime apps.
963
+ */
964
+ /**
965
+ * Gates the uniform-runners surface: the `ph run` command (registration,
966
+ * help listing, and ph-cmd forwarding), host-name sugar, and the `ph init`
967
+ * hosts/ scaffold. Off by default; set to `1` or `true` to enable. Rollout
968
+ * plan: docs/plans/2026-10-13-uniform-runners.md.
969
+ */
970
+ const UNIFORM_RUNNERS_FLAG = "FEATURE_UNIFORM_RUNNERS_ENABLED";
971
+ function isUniformRunnersEnabled(env = process.env) {
972
+ const value = env[UNIFORM_RUNNERS_FLAG]?.trim().toLowerCase();
973
+ return value === "1" || value === "true";
974
+ }
975
+ //#endregion
869
976
  //#region clis/args/inspect.ts
870
977
  const inspectArgs = {
871
978
  packageName: positional({
@@ -997,6 +1104,30 @@ const registryLoginArgs = {
997
1104
  ...debugArgs
998
1105
  };
999
1106
  //#endregion
1107
+ //#region clis/args/run.ts
1108
+ const runArgs = {
1109
+ host: positional({
1110
+ type: string,
1111
+ displayName: "host",
1112
+ description: "the host to run (a directory under hosts/)"
1113
+ }),
1114
+ verb: positional({
1115
+ type: optional(string),
1116
+ displayName: "verb",
1117
+ description: "optional verb the runner forwards (dev, build, serve, …)"
1118
+ }),
1119
+ debug: flag({
1120
+ type: optional(boolean),
1121
+ long: "debug",
1122
+ description: "verbose runner diagnostics"
1123
+ }),
1124
+ explain: option({
1125
+ type: optional(string),
1126
+ long: "explain",
1127
+ description: "explain a resolved aspect instead of running (drives)"
1128
+ })
1129
+ };
1130
+ //#endregion
1000
1131
  //#region clis/args/switchboard.ts
1001
1132
  const switchboardArgs = {
1002
1133
  ...vetraSwitchboardArgs,
@@ -1209,6 +1340,7 @@ const vetraArgs = {
1209
1340
  //#endregion
1210
1341
  //#region clis/command-names.ts
1211
1342
  const phCliCommandNames = [
1343
+ "run",
1212
1344
  "generate",
1213
1345
  "vetra",
1214
1346
  "connect",
@@ -1243,7 +1375,13 @@ function helpCommand(config) {
1243
1375
  aliases
1244
1376
  });
1245
1377
  }
1246
- const phCliHelpCommands = {
1378
+ const allPhCliHelpCommands = {
1379
+ run: helpCommand({
1380
+ name: "run",
1381
+ args: runArgs,
1382
+ description: "Run a host from hosts/ with its runner",
1383
+ handler: () => {}
1384
+ }),
1247
1385
  generate: helpCommand({
1248
1386
  name: "generate",
1249
1387
  args: generateArgs,
@@ -1340,6 +1478,7 @@ const phCliHelpCommands = {
1340
1478
  handler: () => {}
1341
1479
  })
1342
1480
  };
1481
+ const phCliHelpCommands = isUniformRunnersEnabled() ? allPhCliHelpCommands : (({ run: _run, ...rest }) => rest)(allPhCliHelpCommands);
1343
1482
  //#endregion
1344
1483
  //#region clis/args/init.ts
1345
1484
  const initArgs = {
@@ -1395,6 +1534,11 @@ const initArgs = {
1395
1534
  short: "r",
1396
1535
  description: "Remote drive identifier."
1397
1536
  }),
1537
+ uniformRunners: flag({
1538
+ type: optional(boolean),
1539
+ long: "uniform-runners",
1540
+ description: "Scaffold the hosts/ folder (uniform-runners architecture). Also enabled project-wide by FEATURE_UNIFORM_RUNNERS_ENABLED."
1541
+ }),
1398
1542
  clone: option({
1399
1543
  type: optional(string),
1400
1544
  long: "clone",
@@ -1434,9 +1578,44 @@ const unpublishArgs = {
1434
1578
  })
1435
1579
  };
1436
1580
  //#endregion
1581
+ //#region clis/ph-dir.ts
1582
+ /**
1583
+ * The project's `.ph` tree — stores, identity, run records, registry cache.
1584
+ *
1585
+ * Classically `<cwd>/.ph` (every classic command resolves it exactly so). A
1586
+ * desktop shell relocates the WHOLE tree under the user's profile by setting
1587
+ * `PH_USER_DATA_DIR`: the tree is then `${userData}/.ph`, the same names
1588
+ * under a different root, and nothing of the user's lands in the install
1589
+ * dir. One resolver replaces the former `.ph/...` literals; it adds no path
1590
+ * names and no layout of its own.
1591
+ */
1592
+ function resolvePhDir(base = process.cwd(), env = process.env) {
1593
+ return path.join(env.PH_USER_DATA_DIR ?? base, ".ph");
1594
+ }
1595
+ /**
1596
+ * The two PGlite store dirs the switchboard defaults to, for the server and
1597
+ * for `ph switchboard --reset` (which must touch the same paths). Without a
1598
+ * user-data root these are the classic literals, verbatim — byte-identical
1599
+ * to every classic boot log and reset prompt. Under PH_USER_DATA_DIR they
1600
+ * are the same names inside `${userData}/.ph`.
1601
+ */
1602
+ function defaultStoreDirs(env = process.env, phDir) {
1603
+ const root = phDir ?? (env.PH_USER_DATA_DIR ? resolvePhDir(void 0, env) : void 0);
1604
+ if (root === void 0) return {
1605
+ reactor: "./.ph/reactor-storage",
1606
+ readModel: ".ph/read-storage"
1607
+ };
1608
+ return {
1609
+ reactor: path.join(root, "reactor-storage"),
1610
+ readModel: path.join(root, "read-storage")
1611
+ };
1612
+ }
1613
+ //#endregion
1437
1614
  //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
1438
1615
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1439
- let p = process || {}, argv = p.argv || [], env = p.env || {};
1616
+ let p = process || {};
1617
+ let argv = p.argv || [];
1618
+ let env = p.env || {};
1440
1619
  let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
1441
1620
  let formatter = (open, close, replace = open) => (input) => {
1442
1621
  let string = "" + input, index = string.indexOf(close, open.length);
@@ -1524,7 +1703,7 @@ var require_js_tokens = /* @__PURE__ */ __commonJSMin(((exports) => {
1524
1703
  };
1525
1704
  }));
1526
1705
  //#endregion
1527
- //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.28.5/node_modules/@babel/helper-validator-identifier/lib/identifier.js
1706
+ //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.29.7/node_modules/@babel/helper-validator-identifier/lib/identifier.js
1528
1707
  var require_identifier = /* @__PURE__ */ __commonJSMin(((exports) => {
1529
1708
  Object.defineProperty(exports, "__esModule", { value: true });
1530
1709
  exports.isIdentifierChar = isIdentifierChar;
@@ -2532,7 +2711,7 @@ var require_identifier = /* @__PURE__ */ __commonJSMin(((exports) => {
2532
2711
  }
2533
2712
  }));
2534
2713
  //#endregion
2535
- //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.28.5/node_modules/@babel/helper-validator-identifier/lib/keyword.js
2714
+ //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.29.7/node_modules/@babel/helper-validator-identifier/lib/keyword.js
2536
2715
  var require_keyword = /* @__PURE__ */ __commonJSMin(((exports) => {
2537
2716
  Object.defineProperty(exports, "__esModule", { value: true });
2538
2717
  exports.isKeyword = isKeyword;
@@ -2611,7 +2790,7 @@ var require_keyword = /* @__PURE__ */ __commonJSMin(((exports) => {
2611
2790
  }
2612
2791
  }));
2613
2792
  //#endregion
2614
- //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.28.5/node_modules/@babel/helper-validator-identifier/lib/index.js
2793
+ //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.29.7/node_modules/@babel/helper-validator-identifier/lib/index.js
2615
2794
  var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
2616
2795
  Object.defineProperty(exports, "__esModule", { value: true });
2617
2796
  Object.defineProperty(exports, "isIdentifierChar", {
@@ -2698,7 +2877,7 @@ var import_lib = (/* @__PURE__ */ __commonJSMin(((exports) => {
2698
2877
  function getDefs(enabled) {
2699
2878
  return enabled ? defsOn : defsOff;
2700
2879
  }
2701
- const sometimesKeywords = new Set([
2880
+ const sometimesKeywords = /* @__PURE__ */ new Set([
2702
2881
  "as",
2703
2882
  "async",
2704
2883
  "from",
@@ -2765,9 +2944,10 @@ var import_lib = (/* @__PURE__ */ __commonJSMin(((exports) => {
2765
2944
  else if (i === lineDiff) markerLines[lineNumber] = [0, endColumn];
2766
2945
  else markerLines[lineNumber] = [0, source[lineNumber - i].length];
2767
2946
  }
2768
- else if (startColumn === endColumn) if (startColumn) markerLines[startLine] = [startColumn, 0];
2769
- else markerLines[startLine] = true;
2770
- else markerLines[startLine] = [startColumn, endColumn - startColumn];
2947
+ else if (startColumn === endColumn) {
2948
+ if (startColumn) markerLines[startLine] = [startColumn, 0];
2949
+ else markerLines[startLine] = true;
2950
+ } else markerLines[startLine] = [startColumn, endColumn - startColumn];
2771
2951
  return {
2772
2952
  start,
2773
2953
  end,
@@ -4227,49 +4407,47 @@ var require_validate_npm_package_license = /* @__PURE__ */ __commonJSMin(((expor
4227
4407
  };
4228
4408
  }));
4229
4409
  //#endregion
4230
- //#region ../../node_modules/.pnpm/lru-cache@11.2.7/node_modules/lru-cache/dist/commonjs/index.min.js
4410
+ //#region ../../node_modules/.pnpm/lru-cache@11.5.0/node_modules/lru-cache/dist/commonjs/node/index.min.js
4231
4411
  var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4412
+ var j = (c, t) => () => (t || c((t = { exports: {} }).exports, t), t.exports);
4413
+ var I = j((O) => {
4414
+ "use strict";
4415
+ Object.defineProperty(O, "__esModule", { value: !0 });
4416
+ O.tracing = O.metrics = void 0;
4417
+ var U = __require("node:diagnostics_channel");
4418
+ O.metrics = (0, U.channel)("lru-cache:metrics");
4419
+ O.tracing = (0, U.tracingChannel)("lru-cache");
4420
+ });
4421
+ var P = j((D) => {
4422
+ "use strict";
4423
+ Object.defineProperty(D, "__esModule", { value: !0 });
4424
+ D.defaultPerf = void 0;
4425
+ D.defaultPerf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
4426
+ });
4232
4427
  Object.defineProperty(exports, "__esModule", { value: !0 });
4233
4428
  exports.LRUCache = void 0;
4234
- var G = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, U = /* @__PURE__ */ new Set(), R = typeof process == "object" && process ? process : {}, I = (c, t, e, i) => {
4235
- typeof R.emitWarning == "function" ? R.emitWarning(c, t, e, i) : console.error(`[${e}] ${t}: ${c}`);
4236
- }, C = globalThis.AbortController, L = globalThis.AbortSignal;
4237
- if (typeof C > "u") {
4238
- L = class {
4239
- onabort;
4240
- _onabort = [];
4241
- reason;
4242
- aborted = !1;
4243
- addEventListener(i, s) {
4244
- this._onabort.push(s);
4245
- }
4246
- }, C = class {
4247
- constructor() {
4248
- t();
4249
- }
4250
- signal = new L();
4251
- abort(i) {
4252
- if (!this.signal.aborted) {
4253
- this.signal.reason = i, this.signal.aborted = !0;
4254
- for (let s of this.signal._onabort) s(i);
4255
- this.signal.onabort?.(i);
4256
- }
4257
- }
4258
- };
4259
- let c = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
4260
- c && (c = !1, I("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
4261
- };
4262
- }
4263
- var x = (c) => !U.has(c), y = (c) => c && c === Math.floor(c) && c > 0 && isFinite(c), M = (c) => y(c) ? c <= Math.pow(2, 8) ? Uint8Array : c <= Math.pow(2, 16) ? Uint16Array : c <= Math.pow(2, 32) ? Uint32Array : c <= Number.MAX_SAFE_INTEGER ? z : null : null, z = class extends Array {
4429
+ var g = I();
4430
+ var N = P();
4431
+ var C = () => g.metrics.hasSubscribers || g.tracing.hasSubscribers;
4432
+ var k = /* @__PURE__ */ new Set();
4433
+ var G = typeof process == "object" && process ? process : {};
4434
+ var V = (c, t, e, i) => {
4435
+ typeof G.emitWarning == "function" ? G.emitWarning(c, t, e, i) : console.error(`[${e}] ${t}: ${c}`);
4436
+ };
4437
+ var q = (c) => !k.has(c);
4438
+ var T = (c) => !!c && c === Math.floor(c) && c > 0 && isFinite(c);
4439
+ var H = (c) => T(c) ? c <= Math.pow(2, 8) ? Uint8Array : c <= Math.pow(2, 16) ? Uint16Array : c <= Math.pow(2, 32) ? Uint32Array : c <= Number.MAX_SAFE_INTEGER ? W : null : null;
4440
+ var W = class extends Array {
4264
4441
  constructor(t) {
4265
4442
  super(t), this.fill(0);
4266
4443
  }
4267
- }, W = class c {
4444
+ };
4445
+ var x = class c {
4268
4446
  heap;
4269
4447
  length;
4270
4448
  static #o = !1;
4271
4449
  static create(t) {
4272
- let e = M(t);
4450
+ let e = H(t);
4273
4451
  if (!e) return [];
4274
4452
  c.#o = !0;
4275
4453
  let i = new c(t, e);
@@ -4289,14 +4467,14 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4289
4467
  exports.LRUCache = class c {
4290
4468
  #o;
4291
4469
  #c;
4292
- #w;
4293
- #C;
4294
- #S;
4295
- #L;
4296
- #U;
4297
4470
  #m;
4471
+ #W;
4472
+ #S;
4473
+ #M;
4474
+ #j;
4475
+ #w;
4298
4476
  get perf() {
4299
- return this.#m;
4477
+ return this.#w;
4300
4478
  }
4301
4479
  ttl;
4302
4480
  ttlResolution;
@@ -4313,48 +4491,49 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4313
4491
  allowStaleOnFetchAbort;
4314
4492
  allowStaleOnFetchRejection;
4315
4493
  ignoreFetchAbort;
4494
+ backgroundFetchSize;
4316
4495
  #n;
4317
- #_;
4496
+ #b;
4318
4497
  #s;
4319
4498
  #i;
4320
4499
  #t;
4321
- #a;
4322
- #u;
4323
4500
  #l;
4501
+ #u;
4502
+ #a;
4324
4503
  #h;
4325
- #b;
4504
+ #_;
4326
4505
  #r;
4327
4506
  #y;
4328
- #A;
4507
+ #F;
4329
4508
  #d;
4330
4509
  #g;
4331
4510
  #T;
4332
- #v;
4511
+ #U;
4333
4512
  #f;
4334
- #I;
4513
+ #D;
4335
4514
  static unsafeExposeInternals(t) {
4336
4515
  return {
4337
- starts: t.#A,
4516
+ starts: t.#F,
4338
4517
  ttls: t.#d,
4339
4518
  autopurgeTimers: t.#g,
4340
4519
  sizes: t.#y,
4341
4520
  keyMap: t.#s,
4342
4521
  keyList: t.#i,
4343
4522
  valList: t.#t,
4344
- next: t.#a,
4523
+ next: t.#l,
4345
4524
  prev: t.#u,
4346
4525
  get head() {
4347
- return t.#l;
4526
+ return t.#a;
4348
4527
  },
4349
4528
  get tail() {
4350
4529
  return t.#h;
4351
4530
  },
4352
- free: t.#b,
4531
+ free: t.#_,
4353
4532
  isBackgroundFetch: (e) => t.#e(e),
4354
- backgroundFetch: (e, i, s, n) => t.#x(e, i, s, n),
4355
- moveToTail: (e) => t.#D(e),
4356
- indexes: (e) => t.#F(e),
4357
- rindexes: (e) => t.#O(e),
4533
+ backgroundFetch: (e, i, s, n) => t.#G(e, i, s, n),
4534
+ moveToTail: (e) => t.#L(e),
4535
+ indexes: (e) => t.#A(e),
4536
+ rindexes: (e) => t.#z(e),
4358
4537
  isStale: (e) => t.#p(e)
4359
4538
  };
4360
4539
  }
@@ -4365,188 +4544,190 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4365
4544
  return this.#c;
4366
4545
  }
4367
4546
  get calculatedSize() {
4368
- return this.#_;
4547
+ return this.#b;
4369
4548
  }
4370
4549
  get size() {
4371
4550
  return this.#n;
4372
4551
  }
4373
4552
  get fetchMethod() {
4374
- return this.#L;
4553
+ return this.#M;
4375
4554
  }
4376
4555
  get memoMethod() {
4377
- return this.#U;
4556
+ return this.#j;
4378
4557
  }
4379
4558
  get dispose() {
4380
- return this.#w;
4559
+ return this.#m;
4381
4560
  }
4382
4561
  get onInsert() {
4383
- return this.#C;
4562
+ return this.#W;
4384
4563
  }
4385
4564
  get disposeAfter() {
4386
4565
  return this.#S;
4387
4566
  }
4388
4567
  constructor(t) {
4389
- let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: r, dispose: a, onInsert: w, disposeAfter: f, noDisposeOnSet: d, noUpdateTTL: g, maxSize: A = 0, maxEntrySize: p = 0, sizeCalculation: _, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: b, noDeleteOnStaleGet: m, allowStaleOnFetchRejection: u, allowStaleOnFetchAbort: T, ignoreFetchAbort: F, perf: v } = t;
4390
- if (v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
4391
- if (this.#m = v ?? G, e !== 0 && !y(e)) throw new TypeError("max option must be a nonnegative integer");
4392
- let O = e ? M(e) : Array;
4393
- if (!O) throw new Error("invalid max value: " + e);
4394
- if (this.#o = e, this.#c = A, this.maxEntrySize = p || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
4568
+ let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: r, updateAgeOnHas: h, allowStale: a, dispose: o, onInsert: d, disposeAfter: _, noDisposeOnSet: y, noUpdateTTL: u, maxSize: p = 0, maxEntrySize: f = 0, sizeCalculation: b, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: F, noDeleteOnStaleGet: w, allowStaleOnFetchRejection: m, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, backgroundFetchSize: M = 1, perf: v } = t;
4569
+ if (this.backgroundFetchSize = M, v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
4570
+ if (this.#w = v ?? N.defaultPerf, e !== 0 && !T(e)) throw new TypeError("max option must be a nonnegative integer");
4571
+ let E = e ? H(e) : Array;
4572
+ if (!E) throw new Error("invalid max value: " + e);
4573
+ if (this.#o = e, this.#c = p, this.maxEntrySize = f || this.#c, this.sizeCalculation = b, this.sizeCalculation) {
4395
4574
  if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
4396
4575
  if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
4397
4576
  }
4398
4577
  if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
4399
- if (this.#U = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
4400
- if (this.#L = l, this.#v = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = new Array(e).fill(void 0), this.#t = new Array(e).fill(void 0), this.#a = new O(e), this.#u = new O(e), this.#l = 0, this.#h = 0, this.#b = W.create(e), this.#n = 0, this.#_ = 0, typeof a == "function" && (this.#w = a), typeof w == "function" && (this.#C = w), typeof f == "function" ? (this.#S = f, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#w, this.#I = !!this.#C, this.#f = !!this.#S, this.noDisposeOnSet = !!d, this.noUpdateTTL = !!g, this.noDeleteOnFetchRejection = !!b, this.allowStaleOnFetchRejection = !!u, this.allowStaleOnFetchAbort = !!T, this.ignoreFetchAbort = !!F, this.maxEntrySize !== 0) {
4401
- if (this.#c !== 0 && !y(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
4402
- if (!y(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
4403
- this.#B();
4578
+ if (this.#j = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
4579
+ if (this.#M = l, this.#U = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: e }).fill(void 0), this.#t = Array.from({ length: e }).fill(void 0), this.#l = new E(e), this.#u = new E(e), this.#a = 0, this.#h = 0, this.#_ = x.create(e), this.#n = 0, this.#b = 0, typeof o == "function" && (this.#m = o), typeof d == "function" && (this.#W = d), typeof _ == "function" ? (this.#S = _, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#m, this.#D = !!this.#W, this.#f = !!this.#S, this.noDisposeOnSet = !!y, this.noUpdateTTL = !!u, this.noDeleteOnFetchRejection = !!F, this.allowStaleOnFetchRejection = !!m, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
4580
+ if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
4581
+ if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
4582
+ this.#X();
4404
4583
  }
4405
- if (this.allowStale = !!r, this.noDeleteOnStaleGet = !!m, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!h, this.ttlResolution = y(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
4406
- if (!y(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
4407
- this.#j();
4584
+ if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!w, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!h, this.ttlResolution = T(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
4585
+ if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
4586
+ this.#k();
4408
4587
  }
4409
4588
  if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
4410
4589
  if (!this.ttlAutopurge && !this.#o && !this.#c) {
4411
- let E = "LRU_CACHE_UNBOUNDED";
4412
- x(E) && (U.add(E), I("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, c));
4590
+ let R = "LRU_CACHE_UNBOUNDED";
4591
+ q(R) && (k.add(R), V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", R, c));
4413
4592
  }
4414
4593
  }
4415
4594
  getRemainingTTL(t) {
4416
- return this.#s.has(t) ? Infinity : 0;
4417
- }
4418
- #j() {
4419
- let t = new z(this.#o), e = new z(this.#o);
4420
- this.#d = t, this.#A = e;
4421
- let i = this.ttlAutopurge ? new Array(this.#o) : void 0;
4422
- this.#g = i, this.#N = (h, r, a = this.#m.now()) => {
4423
- e[h] = r !== 0 ? a : 0, t[h] = r, s(h, r);
4595
+ return this.#s.has(t) ? 1 / 0 : 0;
4596
+ }
4597
+ #k() {
4598
+ let t = new W(this.#o), e = new W(this.#o);
4599
+ this.#d = t, this.#F = e;
4600
+ let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
4601
+ this.#g = i, this.#H = (h, a, o = this.#w.now()) => {
4602
+ e[h] = a !== 0 ? o : 0, t[h] = a, s(h, a);
4424
4603
  }, this.#R = (h) => {
4425
- e[h] = t[h] !== 0 ? this.#m.now() : 0, s(h, t[h]);
4604
+ e[h] = t[h] !== 0 ? this.#w.now() : 0, s(h, t[h]);
4426
4605
  };
4427
- let s = this.ttlAutopurge ? (h, r) => {
4428
- if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), r && r !== 0 && i) {
4429
- let a = setTimeout(() => {
4430
- this.#p(h) && this.#E(this.#i[h], "expire");
4431
- }, r + 1);
4432
- a.unref && a.unref(), i[h] = a;
4606
+ let s = this.ttlAutopurge ? (h, a) => {
4607
+ if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), a && a !== 0 && i) {
4608
+ let o = setTimeout(() => {
4609
+ this.#p(h) && this.#v(this.#i[h], "expire");
4610
+ }, a + 1);
4611
+ o.unref && o.unref(), i[h] = o;
4433
4612
  }
4434
4613
  } : () => {};
4435
- this.#z = (h, r) => {
4436
- if (t[r]) {
4437
- let a = t[r], w = e[r];
4438
- if (!a || !w) return;
4439
- h.ttl = a, h.start = w, h.now = n || o();
4440
- h.remainingTTL = a - (h.now - w);
4614
+ this.#E = (h, a) => {
4615
+ if (t[a]) {
4616
+ let o = t[a], d = e[a];
4617
+ if (!o || !d) return;
4618
+ h.ttl = o, h.start = d, h.now = n || r();
4619
+ h.remainingTTL = o - (h.now - d);
4441
4620
  }
4442
4621
  };
4443
- let n = 0, o = () => {
4444
- let h = this.#m.now();
4622
+ let n = 0, r = () => {
4623
+ let h = this.#w.now();
4445
4624
  if (this.ttlResolution > 0) {
4446
4625
  n = h;
4447
- let r = setTimeout(() => n = 0, this.ttlResolution);
4448
- r.unref && r.unref();
4626
+ let a = setTimeout(() => n = 0, this.ttlResolution);
4627
+ a.unref && a.unref();
4449
4628
  }
4450
4629
  return h;
4451
4630
  };
4452
4631
  this.getRemainingTTL = (h) => {
4453
- let r = this.#s.get(h);
4454
- if (r === void 0) return 0;
4455
- let a = t[r], w = e[r];
4456
- if (!a || !w) return Infinity;
4457
- return a - ((n || o()) - w);
4632
+ let a = this.#s.get(h);
4633
+ if (a === void 0) return 0;
4634
+ let o = t[a], d = e[a];
4635
+ if (!o || !d) return 1 / 0;
4636
+ return o - ((n || r()) - d);
4458
4637
  }, this.#p = (h) => {
4459
- let r = e[h], a = t[h];
4460
- return !!a && !!r && (n || o()) - r > a;
4638
+ let a = e[h], o = t[h];
4639
+ return !!o && !!a && (n || r()) - a > o;
4461
4640
  };
4462
4641
  }
4463
4642
  #R = () => {};
4464
- #z = () => {};
4465
- #N = () => {};
4643
+ #E = () => {};
4644
+ #H = () => {};
4466
4645
  #p = () => !1;
4467
- #B() {
4468
- let t = new z(this.#o);
4469
- this.#_ = 0, this.#y = t, this.#W = (e) => {
4470
- this.#_ -= t[e], t[e] = 0;
4471
- }, this.#P = (e, i, s, n) => {
4472
- if (this.#e(i)) return 0;
4473
- if (!y(s)) if (n) {
4474
- if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
4475
- if (s = n(i, e), !y(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
4476
- } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
4646
+ #X() {
4647
+ let t = new W(this.#o);
4648
+ this.#b = 0, this.#y = t, this.#C = (e) => {
4649
+ this.#b -= t[e], t[e] = 0;
4650
+ }, this.#N = (e, i, s, n) => {
4651
+ if (!T(s)) {
4652
+ if (this.#e(i)) return this.backgroundFetchSize;
4653
+ if (n) {
4654
+ if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
4655
+ if (s = n(i, e), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
4656
+ } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
4657
+ }
4477
4658
  return s;
4478
- }, this.#M = (e, i, s) => {
4659
+ }, this.#I = (e, i, s) => {
4479
4660
  if (t[e] = i, this.#c) {
4480
4661
  let n = this.#c - t[e];
4481
- for (; this.#_ > n;) this.#G(!0);
4662
+ for (; this.#b > n;) this.#P(!0);
4482
4663
  }
4483
- this.#_ += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#_);
4664
+ this.#b += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
4484
4665
  };
4485
4666
  }
4486
- #W = (t) => {};
4487
- #M = (t, e, i) => {};
4488
- #P = (t, e, i, s) => {
4667
+ #C = (t) => {};
4668
+ #I = (t, e, i) => {};
4669
+ #N = (t, e, i, s) => {
4489
4670
  if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
4490
4671
  return 0;
4491
4672
  };
4492
- *#F({ allowStale: t = this.allowStale } = {}) {
4493
- if (this.#n) for (let e = this.#h; !(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#l));) e = this.#u[e];
4673
+ *#A({ allowStale: t = this.allowStale } = {}) {
4674
+ if (this.#n) for (let e = this.#h; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#a);) e = this.#u[e];
4494
4675
  }
4495
- *#O({ allowStale: t = this.allowStale } = {}) {
4496
- if (this.#n) for (let e = this.#l; !(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#h));) e = this.#a[e];
4676
+ *#z({ allowStale: t = this.allowStale } = {}) {
4677
+ if (this.#n) for (let e = this.#a; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#h);) e = this.#l[e];
4497
4678
  }
4498
- #H(t) {
4679
+ #V(t) {
4499
4680
  return t !== void 0 && this.#s.get(this.#i[t]) === t;
4500
4681
  }
4501
4682
  *entries() {
4502
- for (let t of this.#F()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
4683
+ for (let t of this.#A()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
4503
4684
  }
4504
4685
  *rentries() {
4505
- for (let t of this.#O()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
4686
+ for (let t of this.#z()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
4506
4687
  }
4507
4688
  *keys() {
4508
- for (let t of this.#F()) {
4689
+ for (let t of this.#A()) {
4509
4690
  let e = this.#i[t];
4510
4691
  e !== void 0 && !this.#e(this.#t[t]) && (yield e);
4511
4692
  }
4512
4693
  }
4513
4694
  *rkeys() {
4514
- for (let t of this.#O()) {
4695
+ for (let t of this.#z()) {
4515
4696
  let e = this.#i[t];
4516
4697
  e !== void 0 && !this.#e(this.#t[t]) && (yield e);
4517
4698
  }
4518
4699
  }
4519
4700
  *values() {
4520
- for (let t of this.#F()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4701
+ for (let t of this.#A()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4521
4702
  }
4522
4703
  *rvalues() {
4523
- for (let t of this.#O()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4704
+ for (let t of this.#z()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4524
4705
  }
4525
4706
  [Symbol.iterator]() {
4526
4707
  return this.entries();
4527
4708
  }
4528
4709
  [Symbol.toStringTag] = "LRUCache";
4529
4710
  find(t, e = {}) {
4530
- for (let i of this.#F()) {
4711
+ for (let i of this.#A()) {
4531
4712
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
4532
- if (n !== void 0 && t(n, this.#i[i], this)) return this.get(this.#i[i], e);
4713
+ if (n !== void 0 && t(n, this.#i[i], this)) return this.#x(this.#i[i], e);
4533
4714
  }
4534
4715
  }
4535
4716
  forEach(t, e = this) {
4536
- for (let i of this.#F()) {
4717
+ for (let i of this.#A()) {
4537
4718
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
4538
4719
  n !== void 0 && t.call(e, n, this.#i[i], this);
4539
4720
  }
4540
4721
  }
4541
4722
  rforEach(t, e = this) {
4542
- for (let i of this.#O()) {
4723
+ for (let i of this.#z()) {
4543
4724
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
4544
4725
  n !== void 0 && t.call(e, n, this.#i[i], this);
4545
4726
  }
4546
4727
  }
4547
4728
  purgeStale() {
4548
4729
  let t = !1;
4549
- for (let e of this.#O({ allowStale: !0 })) this.#p(e) && (this.#E(this.#i[e], "expire"), t = !0);
4730
+ for (let e of this.#z({ allowStale: !0 })) this.#p(e) && (this.#v(this.#i[e], "expire"), t = !0);
4550
4731
  return t;
4551
4732
  }
4552
4733
  info(t) {
@@ -4555,24 +4736,24 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4555
4736
  let i = this.#t[e], s = this.#e(i) ? i.__staleWhileFetching : i;
4556
4737
  if (s === void 0) return;
4557
4738
  let n = { value: s };
4558
- if (this.#d && this.#A) {
4559
- let o = this.#d[e], h = this.#A[e];
4560
- if (o && h) n.ttl = o - (this.#m.now() - h), n.start = Date.now();
4739
+ if (this.#d && this.#F) {
4740
+ let r = this.#d[e], h = this.#F[e];
4741
+ if (r && h) n.ttl = r - (this.#w.now() - h), n.start = Date.now();
4561
4742
  }
4562
4743
  return this.#y && (n.size = this.#y[e]), n;
4563
4744
  }
4564
4745
  dump() {
4565
4746
  let t = [];
4566
- for (let e of this.#F({ allowStale: !0 })) {
4747
+ for (let e of this.#A({ allowStale: !0 })) {
4567
4748
  let i = this.#i[e], s = this.#t[e], n = this.#e(s) ? s.__staleWhileFetching : s;
4568
4749
  if (n === void 0 || i === void 0) continue;
4569
- let o = { value: n };
4570
- if (this.#d && this.#A) {
4571
- o.ttl = this.#d[e];
4572
- let h = this.#m.now() - this.#A[e];
4573
- o.start = Math.floor(Date.now() - h);
4750
+ let r = { value: n };
4751
+ if (this.#d && this.#F) {
4752
+ r.ttl = this.#d[e];
4753
+ let h = this.#w.now() - this.#F[e];
4754
+ r.start = Math.floor(Date.now() - h);
4574
4755
  }
4575
- this.#y && (o.size = this.#y[e]), t.unshift([i, o]);
4756
+ this.#y && (r.size = this.#y[e]), t.unshift([i, r]);
4576
4757
  }
4577
4758
  return t;
4578
4759
  }
@@ -4581,53 +4762,60 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4581
4762
  for (let [e, i] of t) {
4582
4763
  if (i.start) {
4583
4764
  let s = Date.now() - i.start;
4584
- i.start = this.#m.now() - s;
4765
+ i.start = this.#w.now() - s;
4585
4766
  }
4586
- this.set(e, i.value, i);
4767
+ this.#O(e, i.value, i);
4587
4768
  }
4588
4769
  }
4589
4770
  set(t, e, i = {}) {
4590
- if (e === void 0) return this.delete(t), this;
4591
- let { ttl: s = this.ttl, start: n, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i, { noUpdateTTL: a = this.noUpdateTTL } = i, w = this.#P(t, e, i.size || 0, h);
4592
- if (this.maxEntrySize && w > this.maxEntrySize) return r && (r.set = "miss", r.maxEntrySizeExceeded = !0), this.#E(t, "set"), this;
4593
- let f = this.#n === 0 ? void 0 : this.#s.get(t);
4594
- if (f === void 0) f = this.#n === 0 ? this.#h : this.#b.length !== 0 ? this.#b.pop() : this.#n === this.#o ? this.#G(!1) : this.#n, this.#i[f] = t, this.#t[f] = e, this.#s.set(t, f), this.#a[this.#h] = f, this.#u[f] = this.#h, this.#h = f, this.#n++, this.#M(f, w, r), r && (r.set = "add"), a = !1, this.#I && this.#C?.(e, t, "add");
4771
+ let { status: s = g.metrics.hasSubscribers ? {} : void 0 } = i;
4772
+ i.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e), s.cache = this);
4773
+ let n = this.#O(t, e, i);
4774
+ return s && g.metrics.hasSubscribers && g.metrics.publish(s), n;
4775
+ }
4776
+ #O(t, e, i, s) {
4777
+ let { ttl: n = this.ttl, start: r, noDisposeOnSet: h = this.noDisposeOnSet, sizeCalculation: a = this.sizeCalculation, status: o } = i, d = this.#e(e);
4778
+ if (e === void 0) return o && (o.set = "deleted"), this.delete(t), this;
4779
+ let { noUpdateTTL: _ = this.noUpdateTTL } = i;
4780
+ o && !d && (o.value = e);
4781
+ let y = this.#N(t, e, i.size || 0, a, o);
4782
+ if (this.maxEntrySize && y > this.maxEntrySize) return this.#v(t, "set"), o && (o.set = "miss", o.maxEntrySizeExceeded = !0), this;
4783
+ let u = this.#n === 0 ? void 0 : this.#s.get(t);
4784
+ if (u === void 0) u = this.#n === 0 ? this.#h : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#o ? this.#P(!1) : this.#n, this.#i[u] = t, this.#t[u] = e, this.#s.set(t, u), this.#l[this.#h] = u, this.#u[u] = this.#h, this.#h = u, this.#n++, this.#I(u, y, o), o && (o.set = "add"), _ = !1, this.#D && !d && this.#W?.(e, t, "add");
4595
4785
  else {
4596
- this.#D(f);
4597
- let d = this.#t[f];
4598
- if (e !== d) {
4599
- if (this.#v && this.#e(d)) {
4600
- d.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
4601
- let { __staleWhileFetching: g } = d;
4602
- g !== void 0 && !o && (this.#T && this.#w?.(g, t, "set"), this.#f && this.#r?.push([
4603
- g,
4786
+ this.#L(u);
4787
+ let p = this.#t[u];
4788
+ if (e !== p) {
4789
+ if (!h) if (this.#e(p)) {
4790
+ p !== s && p.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
4791
+ let { __staleWhileFetching: f } = p;
4792
+ f !== void 0 && f !== e && (this.#T && this.#m?.(f, t, "set"), this.#f && this.#r?.push([
4793
+ f,
4604
4794
  t,
4605
4795
  "set"
4606
4796
  ]));
4607
- } else o || (this.#T && this.#w?.(d, t, "set"), this.#f && this.#r?.push([
4608
- d,
4797
+ } else this.#T && this.#m?.(p, t, "set"), this.#f && this.#r?.push([
4798
+ p,
4609
4799
  t,
4610
4800
  "set"
4611
- ]));
4612
- if (this.#W(f), this.#M(f, w, r), this.#t[f] = e, r) {
4613
- r.set = "replace";
4614
- let g = d && this.#e(d) ? d.__staleWhileFetching : d;
4615
- g !== void 0 && (r.oldValue = g);
4801
+ ]);
4802
+ if (this.#C(u), this.#I(u, y, o), this.#t[u] = e, !d) {
4803
+ let f = p && this.#e(p) ? p.__staleWhileFetching : p, b = f === void 0 ? "add" : e !== f ? "replace" : "update";
4804
+ o && (o.set = b, f !== void 0 && (o.oldValue = f)), this.#D && this.onInsert?.(e, t, b);
4616
4805
  }
4617
- } else r && (r.set = "update");
4618
- this.#I && this.onInsert?.(e, t, e === d ? "update" : "replace");
4806
+ } else d || (o && (o.set = "update"), this.#D && this.onInsert?.(e, t, "update"));
4619
4807
  }
4620
- if (s !== 0 && !this.#d && this.#j(), this.#d && (a || this.#N(f, s, n), r && this.#z(r, f)), !o && this.#f && this.#r) {
4621
- let d = this.#r, g;
4622
- for (; g = d?.shift();) this.#S?.(...g);
4808
+ if (n !== 0 && !this.#d && this.#k(), this.#d && (_ || this.#H(u, n, r), o && this.#E(o, u)), !h && this.#f && this.#r) {
4809
+ let p = this.#r, f;
4810
+ for (; f = p?.shift();) this.#S?.(...f);
4623
4811
  }
4624
4812
  return this;
4625
4813
  }
4626
4814
  pop() {
4627
4815
  try {
4628
4816
  for (; this.#n;) {
4629
- let t = this.#t[this.#l];
4630
- if (this.#G(!0), this.#e(t)) {
4817
+ let t = this.#t[this.#a];
4818
+ if (this.#P(!0), this.#e(t)) {
4631
4819
  if (t.__staleWhileFetching) return t.__staleWhileFetching;
4632
4820
  } else if (t !== void 0) return t;
4633
4821
  }
@@ -4638,163 +4826,214 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4638
4826
  }
4639
4827
  }
4640
4828
  }
4641
- #G(t) {
4642
- let e = this.#l, i = this.#i[e], s = this.#t[e];
4643
- return this.#v && this.#e(s) ? s.__abortController.abort(/* @__PURE__ */ new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#w?.(s, i, "evict"), this.#f && this.#r?.push([
4644
- s,
4829
+ #P(t) {
4830
+ let e = this.#a, i = this.#i[e], s = this.#t[e], n = this.#e(s);
4831
+ n && s.__abortController.abort(/* @__PURE__ */ new Error("evicted"));
4832
+ let r = n ? s.__staleWhileFetching : s;
4833
+ return (this.#T || this.#f) && r !== void 0 && (this.#T && this.#m?.(r, i, "evict"), this.#f && this.#r?.push([
4834
+ r,
4645
4835
  i,
4646
4836
  "evict"
4647
- ])), this.#W(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#b.push(e)), this.#n === 1 ? (this.#l = this.#h = 0, this.#b.length = 0) : this.#l = this.#a[e], this.#s.delete(i), this.#n--, e;
4837
+ ])), this.#C(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#_.push(e)), this.#n === 1 ? (this.#a = this.#h = 0, this.#_.length = 0) : this.#a = this.#l[e], this.#s.delete(i), this.#n--, e;
4648
4838
  }
4649
4839
  has(t, e = {}) {
4840
+ let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
4841
+ e.status = i, i && (i.op = "has", i.key = t, i.cache = this);
4842
+ let s = this.#Y(t, e);
4843
+ return g.metrics.hasSubscribers && g.metrics.publish(i), s;
4844
+ }
4845
+ #Y(t, e = {}) {
4650
4846
  let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, n = this.#s.get(t);
4651
4847
  if (n !== void 0) {
4652
- let o = this.#t[n];
4653
- if (this.#e(o) && o.__staleWhileFetching === void 0) return !1;
4654
- if (this.#p(n)) s && (s.has = "stale", this.#z(s, n));
4655
- else return i && this.#R(n), s && (s.has = "hit", this.#z(s, n)), !0;
4848
+ let r = this.#t[n];
4849
+ if (this.#e(r) && r.__staleWhileFetching === void 0) return !1;
4850
+ if (this.#p(n)) s && (s.has = "stale", this.#E(s, n));
4851
+ else return i && this.#R(n), s && (s.has = "hit", this.#E(s, n)), !0;
4656
4852
  } else s && (s.has = "miss");
4657
4853
  return !1;
4658
4854
  }
4659
4855
  peek(t, e = {}) {
4660
- let { allowStale: i = this.allowStale } = e, s = this.#s.get(t);
4661
- if (s === void 0 || !i && this.#p(s)) return;
4662
- let n = this.#t[s];
4663
- return this.#e(n) ? n.__staleWhileFetching : n;
4856
+ let { status: i = C() ? {} : void 0 } = e;
4857
+ i && (i.op = "peek", i.key = t, i.cache = this), e.status = i;
4858
+ let s = this.#J(t, e);
4859
+ return g.metrics.hasSubscribers && g.metrics.publish(i), s;
4860
+ }
4861
+ #J(t, e) {
4862
+ let { status: i, allowStale: s = this.allowStale } = e, n = this.#s.get(t);
4863
+ if (n === void 0 || !s && this.#p(n)) {
4864
+ i && (i.peek = n === void 0 ? "miss" : "stale");
4865
+ return;
4866
+ }
4867
+ let r = this.#t[n], h = this.#e(r) ? r.__staleWhileFetching : r;
4868
+ return i && (h !== void 0 ? (i.peek = "hit", i.value = h) : i.peek = "miss"), h;
4664
4869
  }
4665
- #x(t, e, i, s) {
4870
+ #G(t, e, i, s) {
4666
4871
  let n = e === void 0 ? void 0 : this.#t[e];
4667
4872
  if (this.#e(n)) return n;
4668
- let o = new C(), { signal: h } = i;
4669
- h?.addEventListener("abort", () => o.abort(h.reason), { signal: o.signal });
4670
- let r = {
4671
- signal: o.signal,
4873
+ let r = new AbortController(), { signal: h } = i;
4874
+ h?.addEventListener("abort", () => r.abort(h.reason), { signal: r.signal });
4875
+ let a = {
4876
+ signal: r.signal,
4672
4877
  options: i,
4673
4878
  context: s
4674
- }, a = (p, _ = !1) => {
4675
- let { aborted: l } = o.signal, S = i.ignoreFetchAbort && p !== void 0, b = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && p !== void 0);
4676
- if (i.status && (l && !_ ? (i.status.fetchAborted = !0, i.status.fetchError = o.signal.reason, S && (i.status.fetchAbortIgnored = !0)) : i.status.fetchResolved = !0), l && !S && !_) return f(o.signal.reason, b);
4677
- let m = g, u = this.#t[e];
4678
- return (u === g || S && _ && u === void 0) && (p === void 0 ? m.__staleWhileFetching !== void 0 ? this.#t[e] = m.__staleWhileFetching : this.#E(t, "fetch") : (i.status && (i.status.fetchUpdated = !0), this.set(t, p, r.options))), p;
4679
- }, w = (p) => (i.status && (i.status.fetchRejected = !0, i.status.fetchError = p), f(p, !1)), f = (p, _) => {
4680
- let { aborted: l } = o.signal, S = l && i.allowStaleOnFetchAbort, b = S || i.allowStaleOnFetchRejection, m = b || i.noDeleteOnFetchRejection, u = g;
4681
- if (this.#t[e] === g && (!m || !_ && u.__staleWhileFetching === void 0 ? this.#E(t, "fetch") : S || (this.#t[e] = u.__staleWhileFetching)), b) return i.status && u.__staleWhileFetching !== void 0 && (i.status.returnedStale = !0), u.__staleWhileFetching;
4682
- if (u.__returned === u) throw p;
4683
- }, d = (p, _) => {
4684
- let l = this.#L?.(t, n, r);
4685
- l && l instanceof Promise && l.then((S) => p(S === void 0 ? void 0 : S), _), o.signal.addEventListener("abort", () => {
4686
- (!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (p(void 0), i.allowStaleOnFetchAbort && (p = (S) => a(S, !0)));
4687
- });
4879
+ }, o = (f, b = !1) => {
4880
+ let { aborted: l } = r.signal, S = i.ignoreFetchAbort && f !== void 0, F = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && f !== void 0);
4881
+ if (i.status && (l && !b ? (i.status.fetchAborted = !0, i.status.fetchError = r.signal.reason, S && (i.status.fetchAbortIgnored = !0)) : i.status.fetchResolved = !0), l && !S && !b) return _(r.signal.reason, F);
4882
+ let w = u, m = this.#t[e];
4883
+ return (m === u || m === void 0 && S && b) && (f === void 0 ? w.__staleWhileFetching !== void 0 ? this.#t[e] = w.__staleWhileFetching : this.#v(t, "fetch") : (i.status && (i.status.fetchUpdated = !0), this.#O(t, f, a.options, w))), f;
4884
+ }, d = (f) => (i.status && (i.status.fetchRejected = !0, i.status.fetchError = f), _(f, !1)), _ = (f, b) => {
4885
+ let { aborted: l } = r.signal, S = l && i.allowStaleOnFetchAbort, F = S || i.allowStaleOnFetchRejection, w = F || i.noDeleteOnFetchRejection, m = u;
4886
+ if (this.#t[e] === u && (!w || !b && m.__staleWhileFetching === void 0 ? this.#v(t, "fetch") : S || (this.#t[e] = m.__staleWhileFetching)), F) return i.status && m.__staleWhileFetching !== void 0 && (i.status.returnedStale = !0), m.__staleWhileFetching;
4887
+ if (m.__returned === m) throw f;
4888
+ }, y = (f, b) => {
4889
+ let l = this.#M?.(t, n, a);
4890
+ r.signal.addEventListener("abort", () => {
4891
+ (!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (f(void 0), i.allowStaleOnFetchAbort && (f = (S) => o(S, !0)));
4892
+ }), l && l instanceof Promise ? l.then((S) => f(S === void 0 ? void 0 : S), b) : l !== void 0 && f(l);
4688
4893
  };
4689
4894
  i.status && (i.status.fetchDispatched = !0);
4690
- let g = new Promise(d).then(a, w), A = Object.assign(g, {
4691
- __abortController: o,
4895
+ let u = new Promise(y).then(o, d), p = Object.assign(u, {
4896
+ __abortController: r,
4692
4897
  __staleWhileFetching: n,
4693
4898
  __returned: void 0
4694
4899
  });
4695
- return e === void 0 ? (this.set(t, A, {
4696
- ...r.options,
4900
+ return e === void 0 ? (this.#O(t, p, {
4901
+ ...a.options,
4697
4902
  status: void 0
4698
- }), e = this.#s.get(t)) : this.#t[e] = A, A;
4903
+ }), e = this.#s.get(t)) : this.#t[e] = p, p;
4699
4904
  }
4700
4905
  #e(t) {
4701
- if (!this.#v) return !1;
4906
+ if (!this.#U) return !1;
4702
4907
  let e = t;
4703
- return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof C;
4908
+ return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
4909
+ }
4910
+ fetch(t, e = {}) {
4911
+ let i = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
4912
+ e.status = s, s && e.context && (s.context = e.context);
4913
+ let n = this.#q(t, e);
4914
+ return s && i && (s.trace = !0, g.tracing.tracePromise(() => n, s).catch(() => {})), n;
4704
4915
  }
4705
- async fetch(t, e = {}) {
4706
- let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: r = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: w = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: g = this.ignoreFetchAbort, allowStaleOnFetchAbort: A = this.allowStaleOnFetchAbort, context: p, forceRefresh: _ = !1, status: l, signal: S } = e;
4707
- if (!this.#v) return l && (l.fetch = "get"), this.get(t, {
4916
+ async #q(t, e = {}) {
4917
+ let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: r = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a = 0, sizeCalculation: o = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: _ = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: y = this.allowStaleOnFetchRejection, ignoreFetchAbort: u = this.ignoreFetchAbort, allowStaleOnFetchAbort: p = this.allowStaleOnFetchAbort, context: f, forceRefresh: b = !1, status: l, signal: S } = e;
4918
+ if (l && (l.op = "fetch", l.key = t, b && (l.forceRefresh = !0), l.cache = this), !this.#U) return l && (l.fetch = "get"), this.#x(t, {
4708
4919
  allowStale: i,
4709
4920
  updateAgeOnGet: s,
4710
4921
  noDeleteOnStaleGet: n,
4711
4922
  status: l
4712
4923
  });
4713
- let b = {
4924
+ let F = {
4714
4925
  allowStale: i,
4715
4926
  updateAgeOnGet: s,
4716
4927
  noDeleteOnStaleGet: n,
4717
- ttl: o,
4928
+ ttl: r,
4718
4929
  noDisposeOnSet: h,
4719
- size: r,
4720
- sizeCalculation: a,
4721
- noUpdateTTL: w,
4722
- noDeleteOnFetchRejection: f,
4723
- allowStaleOnFetchRejection: d,
4724
- allowStaleOnFetchAbort: A,
4725
- ignoreFetchAbort: g,
4930
+ size: a,
4931
+ sizeCalculation: o,
4932
+ noUpdateTTL: d,
4933
+ noDeleteOnFetchRejection: _,
4934
+ allowStaleOnFetchRejection: y,
4935
+ allowStaleOnFetchAbort: p,
4936
+ ignoreFetchAbort: u,
4726
4937
  status: l,
4727
4938
  signal: S
4728
- }, m = this.#s.get(t);
4729
- if (m === void 0) {
4939
+ }, w = this.#s.get(t);
4940
+ if (w === void 0) {
4730
4941
  l && (l.fetch = "miss");
4731
- let u = this.#x(t, m, b, p);
4732
- return u.__returned = u;
4942
+ let m = this.#G(t, w, F, f);
4943
+ return m.__returned = m;
4733
4944
  } else {
4734
- let u = this.#t[m];
4735
- if (this.#e(u)) {
4736
- let E = i && u.__staleWhileFetching !== void 0;
4737
- return l && (l.fetch = "inflight", E && (l.returnedStale = !0)), E ? u.__staleWhileFetching : u.__returned = u;
4945
+ let m = this.#t[w];
4946
+ if (this.#e(m)) {
4947
+ let E = i && m.__staleWhileFetching !== void 0;
4948
+ return l && (l.fetch = "inflight", E && (l.returnedStale = !0)), E ? m.__staleWhileFetching : m.__returned = m;
4738
4949
  }
4739
- let T = this.#p(m);
4740
- if (!_ && !T) return l && (l.fetch = "hit"), this.#D(m), s && this.#R(m), l && this.#z(l, m), u;
4741
- let F = this.#x(t, m, b, p), O = F.__staleWhileFetching !== void 0 && i;
4742
- return l && (l.fetch = T ? "stale" : "refresh", O && T && (l.returnedStale = !0)), O ? F.__staleWhileFetching : F.__returned = F;
4950
+ let A = this.#p(w);
4951
+ if (!b && !A) return l && (l.fetch = "hit"), this.#L(w), s && this.#R(w), l && this.#E(l, w), m;
4952
+ let z = this.#G(t, w, F, f), v = z.__staleWhileFetching !== void 0 && i;
4953
+ return l && (l.fetch = A ? "stale" : "refresh", v && A && (l.returnedStale = !0)), v ? z.__staleWhileFetching : z.__returned = z;
4743
4954
  }
4744
4955
  }
4745
- async forceFetch(t, e = {}) {
4746
- let i = await this.fetch(t, e);
4956
+ forceFetch(t, e = {}) {
4957
+ let i = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
4958
+ e.status = s, s && e.context && (s.context = e.context);
4959
+ let n = this.#K(t, e);
4960
+ return s && i && (s.trace = !0, g.tracing.tracePromise(() => n, s).catch(() => {})), n;
4961
+ }
4962
+ async #K(t, e = {}) {
4963
+ let i = await this.#q(t, e);
4747
4964
  if (i === void 0) throw new Error("fetch() returned undefined");
4748
4965
  return i;
4749
4966
  }
4750
4967
  memo(t, e = {}) {
4751
- let i = this.#U;
4968
+ let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
4969
+ e.status = i, i && (i.op = "memo", i.key = t, e.context && (i.context = e.context), i.cache = this);
4970
+ let s = this.#Q(t, e);
4971
+ return i && (i.value = s), g.metrics.hasSubscribers && g.metrics.publish(i), s;
4972
+ }
4973
+ #Q(t, e = {}) {
4974
+ let i = this.#j;
4752
4975
  if (!i) throw new Error("no memoMethod provided to constructor");
4753
- let { context: s, forceRefresh: n, ...o } = e, h = this.get(t, o);
4754
- if (!n && h !== void 0) return h;
4755
- let r = i(t, h, {
4756
- options: o,
4976
+ let { context: s, status: n, forceRefresh: r, ...h } = e;
4977
+ n && r && (n.forceRefresh = !0);
4978
+ let a = this.#x(t, h), o = r || a === void 0;
4979
+ if (n && (n.memo = o ? "miss" : "hit", o || (n.value = a)), !o) return a;
4980
+ let d = i(t, a, {
4981
+ options: h,
4757
4982
  context: s
4758
4983
  });
4759
- return this.set(t, r, o), r;
4984
+ return n && (n.value = d), this.#O(t, d, h), d;
4760
4985
  }
4761
4986
  get(t, e = {}) {
4762
- let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e, h = this.#s.get(t);
4763
- if (h !== void 0) {
4764
- let r = this.#t[h], a = this.#e(r);
4765
- return o && this.#z(o, h), this.#p(h) ? (o && (o.get = "stale"), a ? (o && i && r.__staleWhileFetching !== void 0 && (o.returnedStale = !0), i ? r.__staleWhileFetching : void 0) : (n || this.#E(t, "expire"), o && i && (o.returnedStale = !0), i ? r : void 0)) : (o && (o.get = "hit"), a ? r.__staleWhileFetching : (this.#D(h), s && this.#R(h), r));
4766
- } else o && (o.get = "miss");
4987
+ let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
4988
+ e.status = i, i && (i.op = "get", i.key = t, i.cache = this);
4989
+ let s = this.#x(t, e);
4990
+ return i && (s !== void 0 && (i.value = s), g.metrics.hasSubscribers && g.metrics.publish(i)), s;
4991
+ }
4992
+ #x(t, e = {}) {
4993
+ let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: r } = e, h = this.#s.get(t);
4994
+ if (h === void 0) {
4995
+ r && (r.get = "miss");
4996
+ return;
4997
+ }
4998
+ let a = this.#t[h], o = this.#e(a);
4999
+ return r && this.#E(r, h), this.#p(h) ? o ? (r && (r.get = "stale-fetching"), i && a.__staleWhileFetching !== void 0 ? (r && (r.returnedStale = !0), a.__staleWhileFetching) : void 0) : (n || this.#v(t, "expire"), r && (r.get = "stale"), i ? (r && (r.returnedStale = !0), a) : void 0) : (r && (r.get = o ? "fetching" : "hit"), this.#L(h), s && this.#R(h), o ? a.__staleWhileFetching : a);
4767
5000
  }
4768
- #k(t, e) {
4769
- this.#u[e] = t, this.#a[t] = e;
5001
+ #B(t, e) {
5002
+ this.#u[e] = t, this.#l[t] = e;
4770
5003
  }
4771
- #D(t) {
4772
- t !== this.#h && (t === this.#l ? this.#l = this.#a[t] : this.#k(this.#u[t], this.#a[t]), this.#k(this.#h, t), this.#h = t);
5004
+ #L(t) {
5005
+ t !== this.#h && (t === this.#a ? this.#a = this.#l[t] : this.#B(this.#u[t], this.#l[t]), this.#B(this.#h, t), this.#h = t);
4773
5006
  }
4774
5007
  delete(t) {
4775
- return this.#E(t, "delete");
4776
- }
4777
- #E(t, e) {
5008
+ return this.#v(t, "delete");
5009
+ }
5010
+ #v(t, e) {
5011
+ g.metrics.hasSubscribers && g.metrics.publish({
5012
+ op: "delete",
5013
+ delete: e,
5014
+ key: t,
5015
+ cache: this
5016
+ });
4778
5017
  let i = !1;
4779
5018
  if (this.#n !== 0) {
4780
5019
  let s = this.#s.get(t);
4781
- if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = !0, this.#n === 1) this.#V(e);
5020
+ if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = !0, this.#n === 1) this.#$(e);
4782
5021
  else {
4783
- this.#W(s);
5022
+ this.#C(s);
4784
5023
  let n = this.#t[s];
4785
- if (this.#e(n) ? n.__abortController.abort(/* @__PURE__ */ new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#w?.(n, t, e), this.#f && this.#r?.push([
5024
+ if (this.#e(n) ? n.__abortController.abort(/* @__PURE__ */ new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#m?.(n, t, e), this.#f && this.#r?.push([
4786
5025
  n,
4787
5026
  t,
4788
5027
  e
4789
5028
  ])), this.#s.delete(t), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
4790
- else if (s === this.#l) this.#l = this.#a[s];
5029
+ else if (s === this.#a) this.#a = this.#l[s];
4791
5030
  else {
4792
- let o = this.#u[s];
4793
- this.#a[o] = this.#a[s];
4794
- let h = this.#a[s];
5031
+ let r = this.#u[s];
5032
+ this.#l[r] = this.#l[s];
5033
+ let h = this.#l[s];
4795
5034
  this.#u[h] = this.#u[s];
4796
5035
  }
4797
- this.#n--, this.#b.push(s);
5036
+ this.#n--, this.#_.push(s);
4798
5037
  }
4799
5038
  }
4800
5039
  if (this.#f && this.#r?.length) {
@@ -4804,27 +5043,27 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4804
5043
  return i;
4805
5044
  }
4806
5045
  clear() {
4807
- return this.#V("delete");
5046
+ return this.#$("delete");
4808
5047
  }
4809
- #V(t) {
4810
- for (let e of this.#O({ allowStale: !0 })) {
5048
+ #$(t) {
5049
+ for (let e of this.#z({ allowStale: !0 })) {
4811
5050
  let i = this.#t[e];
4812
5051
  if (this.#e(i)) i.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
4813
5052
  else {
4814
5053
  let s = this.#i[e];
4815
- this.#T && this.#w?.(i, s, t), this.#f && this.#r?.push([
5054
+ this.#T && this.#m?.(i, s, t), this.#f && this.#r?.push([
4816
5055
  i,
4817
5056
  s,
4818
5057
  t
4819
5058
  ]);
4820
5059
  }
4821
5060
  }
4822
- if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#A) {
4823
- this.#d.fill(0), this.#A.fill(0);
5061
+ if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
5062
+ this.#d.fill(0), this.#F.fill(0);
4824
5063
  for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
4825
5064
  this.#g?.fill(void 0);
4826
5065
  }
4827
- if (this.#y && this.#y.fill(0), this.#l = 0, this.#h = 0, this.#b.length = 0, this.#_ = 0, this.#n = 0, this.#f && this.#r) {
5066
+ if (this.#y && this.#y.fill(0), this.#a = 0, this.#h = 0, this.#_.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
4828
5067
  let e = this.#r, i;
4829
5068
  for (; i = e?.shift();) this.#S?.(...i);
4830
5069
  }
@@ -5020,8 +5259,10 @@ var require_parse_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5020
5259
  if (Object.prototype.hasOwnProperty.call(protocols, proto)) return arg;
5021
5260
  if (arg.substr(firstColon, 3) === "://") return arg;
5022
5261
  const firstAt = arg.indexOf("@");
5023
- if (firstAt > -1) if (firstAt > firstColon) return `git+ssh://${arg}`;
5024
- else return arg;
5262
+ if (firstAt > -1) {
5263
+ if (firstAt > firstColon) return `git+ssh://${arg}`;
5264
+ else return arg;
5265
+ }
5025
5266
  return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`;
5026
5267
  };
5027
5268
  const correctUrl = (giturl) => {
@@ -5058,7 +5299,8 @@ var require_from_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5058
5299
  };
5059
5300
  module.exports = (giturl, opts, { gitHosts, protocols }) => {
5060
5301
  if (!giturl) return;
5061
- const parsed = parseUrl(isGitHubShorthand(giturl) ? `github:${giturl}` : giturl, protocols);
5302
+ const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl;
5303
+ const parsed = parseUrl(correctedUrl, protocols);
5062
5304
  if (!parsed) return;
5063
5305
  const gitHostShortcut = gitHosts.byShortcut[parsed.protocol];
5064
5306
  const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith("www.") ? parsed.hostname.slice(4) : parsed.hostname];
@@ -5521,17 +5763,22 @@ var require_fixer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5521
5763
  var hosted = hostedGitInfo.fromUrl(data.repository.url);
5522
5764
  if (hosted && hosted.bugs()) data.bugs = { url: hosted.bugs() };
5523
5765
  } else if (data.bugs) {
5524
- if (typeof data.bugs === "string") if (isEmail(data.bugs)) data.bugs = { email: data.bugs };
5525
- else if (URL$1.canParse(data.bugs)) data.bugs = { url: data.bugs };
5526
- else this.warn("nonEmailUrlBugsString");
5527
- else {
5766
+ if (typeof data.bugs === "string") {
5767
+ if (isEmail(data.bugs)) data.bugs = { email: data.bugs };
5768
+ else if (URL$1.canParse(data.bugs)) data.bugs = { url: data.bugs };
5769
+ else this.warn("nonEmailUrlBugsString");
5770
+ } else {
5528
5771
  bugsTypos(data.bugs, this.warn);
5529
5772
  var oldBugs = data.bugs;
5530
5773
  data.bugs = {};
5531
- if (oldBugs.url) if (URL$1.canParse(oldBugs.url)) data.bugs.url = oldBugs.url;
5532
- else this.warn("nonUrlBugsUrlField");
5533
- if (oldBugs.email) if (typeof oldBugs.email === "string" && isEmail(oldBugs.email)) data.bugs.email = oldBugs.email;
5534
- else this.warn("nonEmailBugsEmailField");
5774
+ if (oldBugs.url) {
5775
+ if (URL$1.canParse(oldBugs.url)) data.bugs.url = oldBugs.url;
5776
+ else this.warn("nonUrlBugsUrlField");
5777
+ }
5778
+ if (oldBugs.email) {
5779
+ if (typeof oldBugs.email === "string" && isEmail(oldBugs.email)) data.bugs.email = oldBugs.email;
5780
+ else this.warn("nonEmailBugsEmailField");
5781
+ }
5535
5782
  }
5536
5783
  if (!data.bugs.email && !data.bugs.url) {
5537
5784
  delete data.bugs;
@@ -5763,7 +6010,8 @@ const _readPackage = (file, normalize) => {
5763
6010
  return json;
5764
6011
  };
5765
6012
  async function readPackage({ cwd, normalize = true } = {}) {
5766
- return _readPackage(await fsPromises.readFile(getPackagePath(cwd), "utf8"), normalize);
6013
+ const packageFile = await fsPromises.readFile(getPackagePath(cwd), "utf8");
6014
+ return _readPackage(packageFile, normalize);
5767
6015
  }
5768
6016
  //#endregion
5769
6017
  //#region clis/file-system/spawn-async.ts
@@ -5796,10 +6044,14 @@ function spawnAsync(command, args, options = {}) {
5796
6044
  //#endregion
5797
6045
  //#region clis/file-system/dependencies.ts
5798
6046
  async function fetchNpmVersionFromRegistryForTag(packageName, tag) {
5799
- const cleanedVersion = clean(await fetchPackageVersionFromNpmRegistry(`${packageName}@${tag}`));
6047
+ const version = await fetchPackageVersionFromNpmRegistry(`${packageName}@${tag}`);
6048
+ const cleanedVersion = clean(version);
5800
6049
  if (!cleanedVersion) throw new Error(`Failed to fetch version for package "${packageName}" at tag "${tag}".`);
5801
6050
  return cleanedVersion;
5802
6051
  }
6052
+ function lowestVersion(versions) {
6053
+ return [...versions].sort(compare)[0];
6054
+ }
5803
6055
  async function fetchPackageVersionFromNpmRegistry(packageSpecifier, registryUrl) {
5804
6056
  const failedFetchErrorMessage = `Failed to fetch version from npm registry for ${packageSpecifier}.`;
5805
6057
  try {
@@ -6046,7 +6298,7 @@ PH CLI package manager: ${packageManager}
6046
6298
  //#endregion
6047
6299
  //#region clis/file-system/write-file-ensuring-dir.ts
6048
6300
  async function writeFileEnsuringDir(filePath, contents) {
6049
- await mkdir(dirname(filePath), { recursive: true });
6301
+ await mkdir(dirname(resolve(filePath)), { recursive: true });
6050
6302
  await writeFile(filePath, contents, { encoding: "utf-8" });
6051
6303
  }
6052
6304
  //#endregion
@@ -6268,18 +6520,33 @@ function getTelemetryStatus() {
6268
6520
  //#region constants.ts
6269
6521
  const PACKAGES_DEPENDENCIES = [
6270
6522
  "@powerhousedao/builder-tools",
6523
+ "@powerhousedao/clint",
6271
6524
  "@powerhousedao/codegen",
6272
6525
  "@powerhousedao/common",
6273
6526
  "@powerhousedao/config",
6527
+ "@powerhousedao/connect-core",
6274
6528
  "@powerhousedao/design-system",
6529
+ "@powerhousedao/desktop",
6530
+ "@powerhousedao/host-core",
6275
6531
  "document-drive",
6276
6532
  "document-model",
6533
+ "@powerhousedao/opentelemetry-instrumentation-reactor",
6534
+ "@powerhousedao/pieces-framework",
6277
6535
  "@powerhousedao/reactor",
6278
6536
  "@powerhousedao/reactor-api",
6537
+ "@powerhousedao/reactor-attachments",
6279
6538
  "@powerhousedao/reactor-browser",
6539
+ "@powerhousedao/reactor-drive",
6540
+ "@powerhousedao/reactor-group",
6541
+ "@powerhousedao/reactor-hypercore",
6280
6542
  "@powerhousedao/reactor-mcp",
6543
+ "@powerhousedao/reactor-privacy",
6544
+ "@powerhousedao/reactor-router",
6545
+ "@powerhousedao/reactor-workflow",
6546
+ "@powerhousedao/registry",
6281
6547
  "@powerhousedao/switchboard-gui",
6282
6548
  "@powerhousedao/vetra",
6549
+ "@powerhousedao/workflow",
6283
6550
  "@powerhousedao/analytics-engine-core",
6284
6551
  "@powerhousedao/analytics-engine-knex",
6285
6552
  "@powerhousedao/analytics-engine-pg",
@@ -6287,11 +6554,6 @@ const PACKAGES_DEPENDENCIES = [
6287
6554
  "@powerhousedao/analytics-engine-graphql",
6288
6555
  "@powerhousedao/shared",
6289
6556
  "@powerhousedao/powerhouse-vetra-packages",
6290
- "@powerhousedao/analytics-engine-core",
6291
- "@powerhousedao/analytics-engine-graphql",
6292
- "@powerhousedao/analytics-engine-knex",
6293
- "@powerhousedao/analytics-engine-pg",
6294
- "@powerhousedao/analytics-engine-browser",
6295
6557
  "@renown/sdk"
6296
6558
  ];
6297
6559
  const CLIS_DEPENDENCIES = ["ph-cmd", "@powerhousedao/ph-cli"];
@@ -6357,7 +6619,35 @@ async function runUseLocal(monorepoPath, skipInstall) {
6357
6619
  runCmd(`pnpm install`);
6358
6620
  }
6359
6621
  }
6622
+ const WORKSPACE_DIRS = [
6623
+ "packages",
6624
+ "packages/analytics-engine",
6625
+ "clis",
6626
+ "apps"
6627
+ ];
6628
+ const workspaces = /* @__PURE__ */ new Map();
6629
+ function workspacePackages(monorepoPath) {
6630
+ let dirs = workspaces.get(monorepoPath);
6631
+ if (dirs) return dirs;
6632
+ dirs = /* @__PURE__ */ new Map();
6633
+ for (const parent of WORKSPACE_DIRS) {
6634
+ const root = path.join(monorepoPath, parent);
6635
+ if (!existsSync(root)) continue;
6636
+ for (const entry of readdirSync(root, { withFileTypes: true })) {
6637
+ const manifest = path.join(root, entry.name, "package.json");
6638
+ if (!entry.isDirectory() || !existsSync(manifest)) continue;
6639
+ try {
6640
+ const { name } = JSON.parse(readFileSync(manifest, "utf8"));
6641
+ if (name) dirs.set(name, path.join(root, entry.name));
6642
+ } catch {}
6643
+ }
6644
+ }
6645
+ workspaces.set(monorepoPath, dirs);
6646
+ return dirs;
6647
+ }
6360
6648
  function buildPnpmLink(packageName, monorepoPath) {
6649
+ const dir = workspacePackages(monorepoPath).get(packageName);
6650
+ if (dir) return `link:${dir}`;
6361
6651
  const isCli = CLIS_DEPENDENCIES.includes(packageName);
6362
6652
  const isApp = APPS_DEPENDENCIES.includes(packageName);
6363
6653
  const packageDir = isCli ? "clis" : isApp ? "apps" : "packages";
@@ -6463,6 +6753,10 @@ const phConnectRuntimeConfigSchema = {
6463
6753
  homeBackground: {
6464
6754
  type: ["string", "null"],
6465
6755
  description: "Hero image on the empty home screen. URL or path to override; null or omitted uses the bundled default image."
6756
+ },
6757
+ favicon: {
6758
+ type: ["string", "null"],
6759
+ description: "The browser tab icon: a file (.ico, .svg or .png) relative to the project, served and built as icon.ico. A build input; the built runtime config leaves it out. `ph connect build --favicon` wins over it."
6466
6760
  }
6467
6761
  }
6468
6762
  },
@@ -6496,6 +6790,10 @@ const phConnectRuntimeConfigSchema = {
6496
6790
  type: "boolean",
6497
6791
  description: "Studio mode. Enables builder-only capabilities: Connect loads the vetra package and exposes DocumentModel (and vetra spec types) as creatable documents. Forced on by `ph vetra` / `ph connect studio`; false by default.",
6498
6792
  default: false
6793
+ },
6794
+ workflowsEnabled: {
6795
+ type: "boolean",
6796
+ description: "Powerhouse workflows in Connect. When true the tab loads the @powerhousedao/workflow package (workflow + connection documents, their editors and Workflow Studio) and the reactor worker registers its document models. Falls back to the top-level `workflows.enabled`; set it to override that for Connect. Independent of studioMode. False when neither is set."
6499
6797
  }
6500
6798
  }
6501
6799
  },
@@ -6681,6 +6979,32 @@ const phConnectRuntimeConfigSchema = {
6681
6979
  }
6682
6980
  }
6683
6981
  },
6982
+ openPanel: {
6983
+ type: "object",
6984
+ additionalProperties: false,
6985
+ description: "OpenPanel product analytics. Set `clientId` to enable; an empty `clientId` disables it. Events are only sent after the user accepts analytics cookies. Takes precedence over the build-time PH_CONNECT_OPENPANEL_* env vars.",
6986
+ properties: {
6987
+ clientId: {
6988
+ type: "string",
6989
+ description: "OpenPanel client id. Empty string disables OpenPanel entirely.",
6990
+ default: ""
6991
+ },
6992
+ apiUrl: {
6993
+ type: "string",
6994
+ description: "OpenPanel API URL for self-hosted instances (e.g. 'https://openpanel.example/api'). Omit to use OpenPanel's hosted API."
6995
+ },
6996
+ trackUiEvents: {
6997
+ type: "boolean",
6998
+ description: "Track UI events.",
6999
+ default: true
7000
+ },
7001
+ trackOperations: {
7002
+ type: "boolean",
7003
+ description: "Track document operations.",
7004
+ default: true
7005
+ }
7006
+ }
7007
+ },
6684
7008
  instance: {
6685
7009
  type: "object",
6686
7010
  additionalProperties: false,
@@ -6694,7 +7018,12 @@ const phConnectRuntimeConfigSchema = {
6694
7018
  },
6695
7019
  reactorWorker: {
6696
7020
  type: "boolean",
6697
- description: "Host the reactor in a shared worker instead of on the main thread. Off by default; the main-thread reactor stays the proven path until cutover is verified.",
7021
+ description: "Host the reactor in a shared worker instead of on the main thread. Off by default; the main-thread reactor stays the proven path until cutover is verified. Packaged deployments load the worker from the prebuilt bundle `ph connect build` emits under __reactor_worker__/ (the dev server builds it lazily at the same path); when that bundle is absent the feature reports itself unavailable instead of starting a worker that cannot load.",
7022
+ default: false
7023
+ },
7024
+ multiReactor: {
7025
+ type: "boolean",
7026
+ description: "Opt-in multi-reactor routing. When on, Connect routes through the in-browser reactor plus remote backends instead of the single in-browser reactor. Off by default; the single-reactor path is unchanged.",
6698
7027
  default: false
6699
7028
  }
6700
7029
  }
@@ -6703,33 +7032,47 @@ const phConnectRuntimeConfigSchema = {
6703
7032
  type: "object",
6704
7033
  additionalProperties: false,
6705
7034
  description: "Settings for the reactor Connect runs in the browser, on the main thread or in the shared worker alike.",
6706
- properties: { featureFlags: {
6707
- type: "object",
6708
- additionalProperties: false,
6709
- description: "Enforcement flags. Each implies its predecessors, and the reactor refuses to boot on a set that names a later flag without an earlier one. These are consensus settings: a Connect syncing with a fleet must carry the same flags the fleet does, or the two reach different replay outcomes for the same history and diverge.",
6710
- properties: {
6711
- documentDecisions: {
6712
- type: "boolean",
6713
- description: "Decide writes from the document stream rather than the document meta cache, so a backdated deletion denies the operations that sort after it.",
6714
- default: false
6715
- },
6716
- authEnforcement: {
6717
- type: "boolean",
6718
- description: "Enforce the auth scope's policy at admission, replay, and read. Requires documentDecisions.",
6719
- default: false
6720
- },
6721
- authGroups: {
6722
- type: "boolean",
6723
- description: "Let `{ group }` principals match against the rosters of the group documents a policy names. Requires authEnforcement.",
6724
- default: false
6725
- },
6726
- authConditions: {
6727
- type: "boolean",
6728
- description: "Evaluate `where` and `match` conditions on grants. Requires authGroups. Do not enable on a fleet `preflight:auth` reports as crossing a reducer version.",
6729
- default: false
7035
+ properties: {
7036
+ featureFlags: {
7037
+ type: "object",
7038
+ additionalProperties: false,
7039
+ description: "Enforcement flags. Each implies its predecessors, and the reactor refuses to boot on a set that names a later flag without an earlier one. These are consensus settings: a Connect syncing with a fleet must carry the same flags the fleet does, or the two reach different replay outcomes for the same history and diverge.",
7040
+ properties: {
7041
+ documentDecisions: {
7042
+ type: "boolean",
7043
+ description: "Decide writes from the document stream rather than the document meta cache, so a backdated deletion denies the operations that sort after it.",
7044
+ default: false
7045
+ },
7046
+ authEnforcement: {
7047
+ type: "boolean",
7048
+ description: "Enforce the auth scope's policy at admission, replay, and read. Requires documentDecisions.",
7049
+ default: false
7050
+ },
7051
+ authGroups: {
7052
+ type: "boolean",
7053
+ description: "Let `{ group }` principals match against the rosters of the group documents a policy names. Requires authEnforcement.",
7054
+ default: false
7055
+ },
7056
+ authConditions: {
7057
+ type: "boolean",
7058
+ description: "Evaluate `where` and `match` conditions on grants. Requires authGroups. Do not enable on a fleet `preflight:auth` reports as crossing a reducer version.",
7059
+ default: false
7060
+ }
6730
7061
  }
7062
+ },
7063
+ createSignaturePolicy: {
7064
+ type: "string",
7065
+ enum: ["legacy", "v2-required"],
7066
+ description: "What new documents are created as. `v2-required` documents accept only v2 action signatures and take content-addressed ids; set `legacy` while any peer Connect syncs with predates them. Existing documents keep their policy.",
7067
+ default: "v2-required"
7068
+ },
7069
+ unsupportedStoredDocuments: {
7070
+ type: "string",
7071
+ enum: ["refuse", "read-only"],
7072
+ description: "What the reactor does when this browser's store holds documents at protocol versions this build does not run. `refuse` fails the boot and names the versions; `read-only` boots and keeps those documents read-only.",
7073
+ default: "refuse"
6731
7074
  }
6732
- } }
7075
+ }
6733
7076
  },
6734
7077
  pwa: {
6735
7078
  type: "object",
@@ -7103,6 +7446,15 @@ const sourceConfigSchema = {
7103
7446
  }
7104
7447
  }
7105
7448
  },
7449
+ workflows: {
7450
+ type: "object",
7451
+ additionalProperties: false,
7452
+ description: "Powerhouse workflows on this reactor.",
7453
+ properties: { enabled: {
7454
+ type: "boolean",
7455
+ description: "Register the workflow document models and run workflows, on the reactor and in Connect. PH_WORKFLOWS_ENABLED overrides it for the reactor, and connect.app.workflowsEnabled for Connect."
7456
+ } }
7457
+ },
7106
7458
  packageRegistryUrl: {
7107
7459
  type: "string",
7108
7460
  description: "Project-wide package registry endpoint. Used by `ph install` / `ph publish` / `ph registry-login` and Switchboard, and copied verbatim into the runtime config so the Connect SPA's Package Manager UI reads the same registry."
@@ -7144,6 +7496,6 @@ function assertNodeVersion(nodeVersion = process.versions.node) {
7144
7496
  if (lt(nodeVersion, "24.0.0")) throw new NodeVersionError(nodeVersion, MINIMUM_NODE_VERSION);
7145
7497
  }
7146
7498
  //#endregion
7147
- export { AGENTS, ANALYTICS_ENGINE_CORE_PACKAGE, BOILERPLATE_ALLOWED_BUILDS, BOILERPLATE_DEPENDENCY_OVERRIDES, DEFAULT_CONFIG, DEFAULT_CONNECT_OUTDIR, DEFAULT_CONNECT_PREVIEW_PORT, DEFAULT_CONNECT_STUDIO_PORT, DEFAULT_EXPIRY_DAYS, DEFAULT_EXPIRY_SECONDS, DEFAULT_REGISTRY_LOGIN_EXPIRY, DEFAULT_REGISTRY_URL, DEFAULT_RENOWN_URL, DEFAULT_SWITCHBOARD_PORT, DEFAULT_TIMEOUT, DEFAULT_VETRA_CONNECT_PORT, DEFAULT_VETRA_DRIVE_ID, DRIVES_PRESERVE_STRATEGIES, FEATURE_DEPENDENCIES, GRAPHQL_PACKAGE, GRAPHQL_TAG_PACKAGE, HOME_DIR, LEGACY_LINT_FORMAT_DEPENDENCIES, LEGACY_LINT_FORMAT_FILES, LOG_LEVELS, MINIMUM_NODE_VERSION, NodeVersionError, PEER_EXTERNAL_DEPENDENCIES, PH_BIN, PH_GLOBAL_DIR_NAME, PH_GLOBAL_PROJECT_NAME, POWERHOUSE_CONFIG_FILE, POWERHOUSE_GLOBAL_DIR, PROJECT_PORT_BAND_SIZE, PROJECT_PORT_BAND_STUDIO, PROJECT_PORT_BAND_SWITCHBOARD, PROJECT_PORT_BAND_VETRA_CONNECT, REACTOR_API_PACKAGE, SECONDS_IN_DAY, SERVICE_ACTIONS, SOURCE_CONFIG_SCHEMA_ID, VERSIONED_DEPENDENCIES, VERSIONED_DEV_DEPENDENCIES, VERSIONED_PEER_DEPENDENCIES, accessTokenArgs, assertNodeVersion, buildArgs, commonArgs, commonServerArgs, connectArgs, connectBasePath, connectBuildArgs, connectConfigArgs, connectPreviewArgs, connectStudioArgs, debugArgs, defaultDrivesUrl, defaultManifest, directoryExists, directoryExistsSync, disableLocalPackages, drivesPreserveStrategy, externalDependencies, externalDevDependencies, fetchNpmVersionFromRegistryForTag, fetchPackageVersionFromNpmRegistry, fileExists, fileExistsSync, force, generateArgs, getConfig, getGlobalPowerhouseProjectDirPath, getLocalPowerhouseProjectDirPath, getPackageManagerAtPowerhouseProjectDirPath, getPackageManagerCommand, getPackageNameFromPackageJson, getPackageVersionFromPackageJson, getPhCliVersionInfo, getPhCmdVersionInfo, getPowerhouseProjectInfo, getPowerhouseProjectInstallCommand, getPowerhouseProjectUninstallCommand, getTagFromVersion, getTelemetryStatus, handleMutuallyExclusiveOptions, https, httpsCertFile, httpsKeyFile, initArgs, initCliTelemetry, injectPnpmAllowBuilds, inspectArgs, installArgs, isDirectory, isFile, isPowerhouseProject, listArgs, localPackage, logLevel, logVersionUpdate, loginArgs, makeDependenciesWithVersions, makeVersionedDependencies, makeVersionedDependenciesMap, migrateArgs, packageJsonExports, packageManagerArgs, packageScripts, packages, parsePackageManager, parsePackageVersion, parseTag, phCliCommandNames, phCliHelpCommands, publishArgs, registryLoginArgs, renownNamespace, renownSwitchboardUrl, resolveConnectPortDefault, resolveSwitchboardPortDefault, resolveTelemetryConsent, runCmd, runUseLocal, serviceArgs, setTelemetryConsent, sourceConfigSchema, spawnAsync, switchboardArgs, uninstallArgs, unpublishArgs, vetraArgs, vetraSwitchboardArgs, writeFileEnsuringDir };
7499
+ export { AGENTS, ANALYTICS_ENGINE_CORE_PACKAGE, BOILERPLATE_ALLOWED_BUILDS, BOILERPLATE_DEPENDENCY_OVERRIDES, DEFAULT_CONFIG, DEFAULT_CONNECT_OUTDIR, DEFAULT_CONNECT_PREVIEW_PORT, DEFAULT_CONNECT_STUDIO_PORT, DEFAULT_DRIVE_ICON, DEFAULT_EXPIRY_DAYS, DEFAULT_EXPIRY_SECONDS, DEFAULT_REGISTRY_LOGIN_EXPIRY, DEFAULT_REGISTRY_URL, DEFAULT_RENOWN_URL, DEFAULT_SWITCHBOARD_PORT, DEFAULT_TIMEOUT, DEFAULT_VETRA_CONNECT_PORT, DEFAULT_VETRA_DRIVE_ID, DRIVES_PRESERVE_STRATEGIES, FEATURE_DEPENDENCIES, GRAPHQL_PACKAGE, GRAPHQL_TAG_PACKAGE, HOME_DIR, LEGACY_LINT_FORMAT_DEPENDENCIES, LEGACY_LINT_FORMAT_FILES, LOG_LEVELS, MINIMUM_NODE_VERSION, NodeVersionError, PEER_EXTERNAL_DEPENDENCIES, PH_BIN, PH_GLOBAL_DIR_NAME, PH_GLOBAL_PROJECT_NAME, PIECES_FRAMEWORK_PACKAGE, POWERHOUSE_CONFIG_FILE, POWERHOUSE_GLOBAL_DIR, PROJECT_PORT_BAND_SIZE, PROJECT_PORT_BAND_STUDIO, PROJECT_PORT_BAND_SWITCHBOARD, PROJECT_PORT_BAND_VETRA_CONNECT, REACTOR_API_PACKAGE, SECONDS_IN_DAY, SERVICE_ACTIONS, SOURCE_CONFIG_SCHEMA_ID, VERSIONED_DEPENDENCIES, VERSIONED_DEV_DEPENDENCIES, VERSIONED_PEER_DEPENDENCIES, accessTokenArgs, assertNodeVersion, buildArgs, buildPnpmLink, commonArgs, commonServerArgs, connectArgs, connectBasePath, connectBuildArgs, connectConfigArgs, connectPreviewArgs, connectStudioArgs, debugArgs, defaultDrivesUrl, defaultManifest, defaultStoreDirs, directoryExists, directoryExistsSync, disableLocalPackages, drivesPreserveStrategy, externalDependencies, externalDevDependencies, fetchNpmVersionFromRegistryForTag, fetchPackageVersionFromNpmRegistry, fileExists, fileExistsSync, force, generateArgs, getConfig, getGlobalPowerhouseProjectDirPath, getLocalPowerhouseProjectDirPath, getPackageManagerAtPowerhouseProjectDirPath, getPackageManagerCommand, getPackageNameFromPackageJson, getPackageVersionFromPackageJson, getPhCliVersionInfo, getPhCmdVersionInfo, getPowerhouseProjectInfo, getPowerhouseProjectInstallCommand, getPowerhouseProjectUninstallCommand, getTagFromVersion, getTelemetryStatus, handleMutuallyExclusiveOptions, https, httpsCertFile, httpsKeyFile, initArgs, initCliTelemetry, injectPnpmAllowBuilds, inspectArgs, installArgs, isDirectory, isFile, isPowerhouseProject, listArgs, localPackage, logLevel, logVersionUpdate, loginArgs, lowestVersion, makeDependenciesWithVersions, makeVersionedDependencies, makeVersionedDependenciesMap, migrateArgs, packageJsonExports, packageManagerArgs, packageScripts, packages, parsePackageManager, parsePackageVersion, parseTag, phCliCommandNames, phCliHelpCommands, publishArgs, registryLoginArgs, renownNamespace, renownSwitchboardUrl, resolveConnectPortDefault, resolvePhDir, resolveSwitchboardPortDefault, resolveTelemetryConsent, runCmd, runUseLocal, serviceArgs, setTelemetryConsent, sourceConfigSchema, spawnAsync, switchboardArgs, uninstallArgs, unpublishArgs, vetraArgs, vetraSwitchboardArgs, writeFileEnsuringDir };
7148
7500
 
7149
7501
  //# sourceMappingURL=index.mjs.map