@powerhousedao/shared 6.2.3-dev.9 → 6.2.3-dev.91

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 (357) hide show
  1. package/dist/action-id-DON1WCeY.d.ts +19 -0
  2. package/dist/action-id-DON1WCeY.d.ts.map +1 -0
  3. package/dist/analytics/index.d.ts +4 -4
  4. package/dist/analytics/index.d.ts.map +1 -1
  5. package/dist/analytics/index.js +25 -24
  6. package/dist/analytics/index.js.map +1 -1
  7. package/dist/clis/args/access-token.d.mts +15 -2
  8. package/dist/clis/args/access-token.d.mts.map +1 -0
  9. package/dist/clis/args/access-token.mjs +21 -1
  10. package/dist/clis/args/access-token.mjs.map +1 -0
  11. package/dist/clis/args/common-BpLj4peE.d.mts +186 -0
  12. package/dist/clis/args/common-BpLj4peE.d.mts.map +1 -0
  13. package/dist/clis/args/{common-CcYbXrBx.mjs → common-CBLen_yt.mjs} +58 -12
  14. package/dist/clis/args/common-CBLen_yt.mjs.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.d.mts +449 -2
  18. package/dist/clis/args/connect.d.mts.map +1 -0
  19. package/dist/clis/args/connect.mjs +202 -1
  20. package/dist/clis/args/connect.mjs.map +1 -0
  21. package/dist/clis/args/{generate-CA916Fvj.mjs → generate-a36SaAn4.mjs} +40 -2
  22. package/dist/clis/args/generate-a36SaAn4.mjs.map +1 -0
  23. package/dist/clis/args/generate.d.mts +102 -2
  24. package/dist/clis/args/generate.d.mts.map +1 -0
  25. package/dist/clis/args/generate.mjs +1 -1
  26. package/dist/clis/args/help-Cgh3krcq.d.mts +239 -0
  27. package/dist/clis/args/help-Cgh3krcq.d.mts.map +1 -0
  28. package/dist/clis/args/{help-Bqbgbalu.mjs → help-DnOa5Gr-.mjs} +67 -16
  29. package/dist/clis/args/help-DnOa5Gr-.mjs.map +1 -0
  30. package/dist/clis/args/help.d.mts +3 -2
  31. package/dist/clis/args/help.mjs +15 -1
  32. package/dist/clis/args/host.d.mts +23 -0
  33. package/dist/clis/args/host.d.mts.map +1 -0
  34. package/dist/clis/args/host.mjs +35 -0
  35. package/dist/clis/args/host.mjs.map +1 -0
  36. package/dist/clis/args/index.d.mts +23 -19
  37. package/dist/clis/args/index.mjs +22 -19
  38. package/dist/clis/args/init.d.mts +54 -2
  39. package/dist/clis/args/init.d.mts.map +1 -0
  40. package/dist/clis/args/init.mjs +71 -1
  41. package/dist/clis/args/init.mjs.map +1 -0
  42. package/dist/clis/args/inspect.d.mts +12 -2
  43. package/dist/clis/args/inspect.d.mts.map +1 -0
  44. package/dist/clis/args/inspect.mjs +14 -1
  45. package/dist/clis/args/inspect.mjs.map +1 -0
  46. package/dist/clis/args/install.d.mts +36 -2
  47. package/dist/clis/args/install.d.mts.map +1 -0
  48. package/dist/clis/args/install.mjs +31 -1
  49. package/dist/clis/args/install.mjs.map +1 -0
  50. package/dist/clis/args/keyframes.d.mts +25 -0
  51. package/dist/clis/args/keyframes.d.mts.map +1 -0
  52. package/dist/clis/args/keyframes.mjs +42 -0
  53. package/dist/clis/args/keyframes.mjs.map +1 -0
  54. package/dist/clis/args/list.d.mts +9 -2
  55. package/dist/clis/args/list.d.mts.map +1 -0
  56. package/dist/clis/args/list.mjs +6 -1
  57. package/dist/clis/args/list.mjs.map +1 -0
  58. package/dist/clis/args/login.d.mts +24 -2
  59. package/dist/clis/args/login.d.mts.map +1 -0
  60. package/dist/clis/args/login.mjs +39 -1
  61. package/dist/clis/args/login.mjs.map +1 -0
  62. package/dist/clis/args/mcp.d.mts +15 -0
  63. package/dist/clis/args/mcp.d.mts.map +1 -0
  64. package/dist/clis/args/mcp.mjs +22 -0
  65. package/dist/clis/args/mcp.mjs.map +1 -0
  66. package/dist/clis/args/migrate.d.mts +18 -2
  67. package/dist/clis/args/migrate.d.mts.map +1 -0
  68. package/dist/clis/args/migrate.mjs +27 -1
  69. package/dist/clis/args/migrate.mjs.map +1 -0
  70. package/dist/clis/args/publish.d.mts +15 -2
  71. package/dist/clis/args/publish.d.mts.map +1 -0
  72. package/dist/clis/args/publish.mjs +18 -1
  73. package/dist/clis/args/publish.mjs.map +1 -0
  74. package/dist/clis/args/registry.d.mts +16 -2
  75. package/dist/clis/args/registry.d.mts.map +1 -0
  76. package/dist/clis/args/registry.mjs +22 -1
  77. package/dist/clis/args/registry.mjs.map +1 -0
  78. package/dist/clis/args/run.d.mts +18 -0
  79. package/dist/clis/args/run.d.mts.map +1 -0
  80. package/dist/clis/args/run.mjs +28 -0
  81. package/dist/clis/args/run.mjs.map +1 -0
  82. package/dist/clis/args/service-IZ0Aq58z.d.mts +27 -0
  83. package/dist/clis/args/service-IZ0Aq58z.d.mts.map +1 -0
  84. package/dist/clis/args/service.d.mts +3 -2
  85. package/dist/clis/args/service.mjs +10 -1
  86. package/dist/clis/args/service.mjs.map +1 -0
  87. package/dist/clis/args/switchboard.d.mts +69 -2
  88. package/dist/clis/args/switchboard.d.mts.map +1 -0
  89. package/dist/clis/args/switchboard.mjs +84 -1
  90. package/dist/clis/args/switchboard.mjs.map +1 -0
  91. package/dist/clis/args/uninstall.d.mts +27 -2
  92. package/dist/clis/args/uninstall.d.mts.map +1 -0
  93. package/dist/clis/args/uninstall.mjs +15 -1
  94. package/dist/clis/args/uninstall.mjs.map +1 -0
  95. package/dist/clis/args/unpublish.d.mts +21 -2
  96. package/dist/clis/args/unpublish.d.mts.map +1 -0
  97. package/dist/clis/args/unpublish.mjs +29 -1
  98. package/dist/clis/args/unpublish.mjs.map +1 -0
  99. package/dist/clis/args/{vetra-b4KUu1Ax.mjs → vetra-DlAEC_Mv.mjs} +18 -2
  100. package/dist/clis/args/vetra-DlAEC_Mv.mjs.map +1 -0
  101. package/dist/clis/args/vetra.d.mts +113 -2
  102. package/dist/clis/args/vetra.d.mts.map +1 -0
  103. package/dist/clis/args/vetra.mjs +1 -1
  104. package/dist/clis/build-config-BM1RL4u_.mjs +309 -0
  105. package/dist/clis/build-config-BM1RL4u_.mjs.map +1 -0
  106. package/dist/clis/build-config.d.mts +71 -10616
  107. package/dist/clis/build-config.d.mts.map +1 -1
  108. package/dist/clis/build-config.mjs +2 -93
  109. package/dist/clis/build-pieces.d.mts +160 -0
  110. package/dist/clis/build-pieces.d.mts.map +1 -0
  111. package/dist/clis/build-pieces.mjs +549 -0
  112. package/dist/clis/build-pieces.mjs.map +1 -0
  113. package/dist/clis/command-names.d.mts +6 -2
  114. package/dist/clis/command-names.d.mts.map +1 -1
  115. package/dist/clis/command-names.mjs +9 -1
  116. package/dist/clis/command-names.mjs.map +1 -1
  117. package/dist/clis/constants.d.mts +3 -475
  118. package/dist/clis/constants.mjs +79 -21
  119. package/dist/clis/constants.mjs.map +1 -1
  120. package/dist/clis/definition-sources.d.mts +48 -0
  121. package/dist/clis/definition-sources.d.mts.map +1 -0
  122. package/dist/clis/definition-sources.mjs +89 -0
  123. package/dist/clis/definition-sources.mjs.map +1 -0
  124. package/dist/clis/definition-types-CiUH8dqg.d.mts +18 -0
  125. package/dist/clis/definition-types-CiUH8dqg.d.mts.map +1 -0
  126. package/dist/clis/feature-flags.d.mts +17 -0
  127. package/dist/clis/feature-flags.d.mts.map +1 -0
  128. package/dist/clis/feature-flags.mjs +21 -0
  129. package/dist/clis/feature-flags.mjs.map +1 -0
  130. package/dist/clis/index-DnZYG-8g.d.mts +11154 -0
  131. package/dist/clis/index-DnZYG-8g.d.mts.map +1 -0
  132. package/dist/clis/index.d.mts +3744 -1952
  133. package/dist/clis/index.d.mts.map +1 -1
  134. package/dist/clis/index.mjs +1362 -856
  135. package/dist/clis/index.mjs.map +1 -1
  136. package/dist/clis/package-style.d.mts +32 -0
  137. package/dist/clis/package-style.d.mts.map +1 -0
  138. package/dist/clis/package-style.mjs +102 -0
  139. package/dist/clis/package-style.mjs.map +1 -0
  140. package/dist/clis/ph-dir.d.mts +26 -0
  141. package/dist/clis/ph-dir.d.mts.map +1 -0
  142. package/dist/clis/ph-dir.mjs +37 -0
  143. package/dist/clis/ph-dir.mjs.map +1 -0
  144. package/dist/clis/project-env.d.mts +10 -4
  145. package/dist/clis/project-env.d.mts.map +1 -1
  146. package/dist/clis/project-env.mjs +16 -1
  147. package/dist/clis/project-env.mjs.map +1 -1
  148. package/dist/clis/project-ports.d.mts +5 -5
  149. package/dist/clis/project-ports.d.mts.map +1 -1
  150. package/dist/clis/project-ports.mjs +1 -1
  151. package/dist/clis/project-ports.mjs.map +1 -1
  152. package/dist/clis/rolldown-runtime-B4iAMlE-.mjs +35 -0
  153. package/dist/clis/services/telemetry.d.mts +7 -7
  154. package/dist/clis/services/telemetry.d.mts.map +1 -1
  155. package/dist/clis/services/telemetry.mjs.map +1 -1
  156. package/dist/clis/types-DNeGTpnB.d.mts +2493 -0
  157. package/dist/clis/types-DNeGTpnB.d.mts.map +1 -0
  158. package/dist/clis/utils.d.mts +4 -4
  159. package/dist/clis/utils.d.mts.map +1 -1
  160. package/dist/clis/utils.mjs.map +1 -1
  161. package/dist/{config-loader-B845Hidf.js → config-loader-B7SqNz8z.js} +50 -12
  162. package/dist/config-loader-B7SqNz8z.js.map +1 -0
  163. package/dist/connect/app-shell.d.ts +48 -0
  164. package/dist/connect/app-shell.d.ts.map +1 -0
  165. package/dist/connect/app-shell.js +90 -0
  166. package/dist/connect/app-shell.js.map +1 -0
  167. package/dist/connect/config-loader.d.ts +21 -8
  168. package/dist/connect/config-loader.d.ts.map +1 -1
  169. package/dist/connect/config-loader.js +2 -2
  170. package/dist/connect/connect-config-schema.d.ts +3 -0
  171. package/dist/connect/connect-config-schema.js +485 -0
  172. package/dist/connect/connect-config-schema.js.map +1 -0
  173. package/dist/connect/image-ref.d.ts +32 -0
  174. package/dist/connect/image-ref.d.ts.map +1 -0
  175. package/dist/connect/image-ref.js +80 -0
  176. package/dist/connect/image-ref.js.map +1 -0
  177. package/dist/connect/index.d.ts +226 -643
  178. package/dist/connect/index.d.ts.map +1 -1
  179. package/dist/connect/index.js +443 -507
  180. package/dist/connect/index.js.map +1 -1
  181. package/dist/connect/json-adapter.d.ts +3 -4
  182. package/dist/connect/json-adapter.d.ts.map +1 -1
  183. package/dist/connect/json-adapter.js.map +1 -1
  184. package/dist/connect/origin-placeholder.d.ts +52 -0
  185. package/dist/connect/origin-placeholder.d.ts.map +1 -0
  186. package/dist/connect/origin-placeholder.js +101 -0
  187. package/dist/connect/origin-placeholder.js.map +1 -0
  188. package/dist/connect-config-schema-UFEAoO5W.d.ts +1864 -0
  189. package/dist/connect-config-schema-UFEAoO5W.d.ts.map +1 -0
  190. package/dist/constants-5UFY_rXh.d.ts +9 -0
  191. package/dist/constants-5UFY_rXh.d.ts.map +1 -0
  192. package/dist/constants.d.ts +3 -2
  193. package/dist/constants.js +22 -6
  194. package/dist/constants.js.map +1 -1
  195. package/dist/document-drive/index.d.ts +103 -101
  196. package/dist/document-drive/index.d.ts.map +1 -1
  197. package/dist/document-drive/index.js +41 -32
  198. package/dist/document-drive/index.js.map +1 -1
  199. package/dist/document-model/action-id.d.ts +3 -0
  200. package/dist/document-model/action-id.js +59 -0
  201. package/dist/document-model/action-id.js.map +1 -0
  202. package/dist/document-model/dispatch.d.ts +25 -0
  203. package/dist/document-model/dispatch.d.ts.map +1 -0
  204. package/dist/document-model/dispatch.js +0 -0
  205. package/dist/document-model/errors.d.ts +3 -0
  206. package/dist/document-model/errors.js +214 -0
  207. package/dist/document-model/errors.js.map +1 -0
  208. package/dist/document-model/index.d.ts +6 -4
  209. package/dist/document-model/index.js +7 -5144
  210. package/dist/document-model/mock.d.ts +2 -3
  211. package/dist/document-model/mock.d.ts.map +1 -1
  212. package/dist/document-model/mock.js +2 -1
  213. package/dist/document-model/mock.js.map +1 -1
  214. package/dist/document-model/utils.d.ts +4 -2
  215. package/dist/document-model/utils.js +3 -2
  216. package/dist/document-model/version.d.ts +3 -0
  217. package/dist/document-model/version.js +8 -0
  218. package/dist/document-model/version.js.map +1 -0
  219. package/dist/document-model-TCCW8aMC.js +5795 -0
  220. package/dist/document-model-TCCW8aMC.js.map +1 -0
  221. package/dist/host-tokens/index.d.ts +3 -0
  222. package/dist/host-tokens/index.js +2 -0
  223. package/dist/host-tokens-DOeyxqLi.js +322 -0
  224. package/dist/host-tokens-DOeyxqLi.js.map +1 -0
  225. package/dist/index-D58WVj_E.d.ts +246 -0
  226. package/dist/index-D58WVj_E.d.ts.map +1 -0
  227. package/dist/index-DD0XMv4t.d.ts +36 -0
  228. package/dist/index-DD0XMv4t.d.ts.map +1 -0
  229. package/dist/index.d.ts +7 -6
  230. package/dist/index.js.map +1 -1
  231. package/dist/processors/index.d.ts +3 -2
  232. package/dist/processors/index.js +180 -67
  233. package/dist/processors/index.js.map +1 -1
  234. package/dist/processors/testing.d.ts +22 -0
  235. package/dist/processors/testing.d.ts.map +1 -0
  236. package/dist/processors/testing.js +77 -0
  237. package/dist/processors/testing.js.map +1 -0
  238. package/dist/purge-CbAV5DVh.js +631 -0
  239. package/dist/purge-CbAV5DVh.js.map +1 -0
  240. package/dist/registry/index.d.ts +15 -15
  241. package/dist/registry/index.d.ts.map +1 -1
  242. package/dist/registry/index.js +64 -12
  243. package/dist/registry/index.js.map +1 -1
  244. package/dist/registry/manifest-slim.d.ts +4 -3
  245. package/dist/registry/manifest-slim.d.ts.map +1 -1
  246. package/dist/registry/manifest-slim.js +22 -2
  247. package/dist/registry/manifest-slim.js.map +1 -1
  248. package/dist/registry/updates.d.ts +3 -3
  249. package/dist/registry/updates.d.ts.map +1 -1
  250. package/dist/registry/updates.js.map +1 -1
  251. package/dist/registry/urls.d.ts +2 -2
  252. package/dist/registry/urls.d.ts.map +1 -1
  253. package/dist/registry/urls.js.map +1 -1
  254. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  255. package/dist/{types-C1in4fl3.d.ts → types-Bsp8VL2y.d.ts} +2 -2
  256. package/dist/types-Bsp8VL2y.d.ts.map +1 -0
  257. package/dist/{types-DDpRvBK_.d.ts → types-Btd9TO_L.d.ts} +39 -43
  258. package/dist/types-Btd9TO_L.d.ts.map +1 -0
  259. package/dist/types-Dp2OWq1-.d.ts +5710 -0
  260. package/dist/types-Dp2OWq1-.d.ts.map +1 -0
  261. package/dist/{utils-aaTmfxFW.js → utils-DiV32YIj.js} +53 -3
  262. package/dist/utils-DiV32YIj.js.map +1 -0
  263. package/dist/utils-MrLmLEVr.js +78 -0
  264. package/dist/utils-MrLmLEVr.js.map +1 -0
  265. package/dist/version-BxLITo9P.d.ts +6 -0
  266. package/dist/version-BxLITo9P.d.ts.map +1 -0
  267. package/package.json +38 -7
  268. package/dist/clis/args/access-token--9H57y8J.d.mts +0 -18
  269. package/dist/clis/args/access-token--9H57y8J.d.mts.map +0 -1
  270. package/dist/clis/args/access-token-To5LaIfL.mjs +0 -22
  271. package/dist/clis/args/access-token-To5LaIfL.mjs.map +0 -1
  272. package/dist/clis/args/common-CcYbXrBx.mjs.map +0 -1
  273. package/dist/clis/args/common-Dsf1vpHV.d.mts +0 -183
  274. package/dist/clis/args/common-Dsf1vpHV.d.mts.map +0 -1
  275. package/dist/clis/args/connect-BVVvCmL9.mjs +0 -198
  276. package/dist/clis/args/connect-BVVvCmL9.mjs.map +0 -1
  277. package/dist/clis/args/connect-DetTnI8g.d.mts +0 -443
  278. package/dist/clis/args/connect-DetTnI8g.d.mts.map +0 -1
  279. package/dist/clis/args/generate-CA916Fvj.mjs.map +0 -1
  280. package/dist/clis/args/generate-DnV-bfXt.d.mts +0 -87
  281. package/dist/clis/args/generate-DnV-bfXt.d.mts.map +0 -1
  282. package/dist/clis/args/help-Bqbgbalu.mjs.map +0 -1
  283. package/dist/clis/args/help-CjAsudUn.d.mts +0 -193
  284. package/dist/clis/args/help-CjAsudUn.d.mts.map +0 -1
  285. package/dist/clis/args/init-CUXyfquF.d.mts +0 -55
  286. package/dist/clis/args/init-CUXyfquF.d.mts.map +0 -1
  287. package/dist/clis/args/init-rz9Ei7nq.mjs +0 -67
  288. package/dist/clis/args/init-rz9Ei7nq.mjs.map +0 -1
  289. package/dist/clis/args/inspect-DtZeoA5c.d.mts +0 -15
  290. package/dist/clis/args/inspect-DtZeoA5c.d.mts.map +0 -1
  291. package/dist/clis/args/inspect-tckH8mSw.mjs +0 -15
  292. package/dist/clis/args/inspect-tckH8mSw.mjs.map +0 -1
  293. package/dist/clis/args/install-CkP8zcHb.d.mts +0 -40
  294. package/dist/clis/args/install-CkP8zcHb.d.mts.map +0 -1
  295. package/dist/clis/args/install-Sz2DlCHh.mjs +0 -32
  296. package/dist/clis/args/install-Sz2DlCHh.mjs.map +0 -1
  297. package/dist/clis/args/list-BGf8s_gj.d.mts +0 -12
  298. package/dist/clis/args/list-BGf8s_gj.d.mts.map +0 -1
  299. package/dist/clis/args/list-DM2d6f1m.mjs +0 -7
  300. package/dist/clis/args/list-DM2d6f1m.mjs.map +0 -1
  301. package/dist/clis/args/login-DNsHwvqk.d.mts +0 -27
  302. package/dist/clis/args/login-DNsHwvqk.d.mts.map +0 -1
  303. package/dist/clis/args/login-DiKT5Jfu.mjs +0 -40
  304. package/dist/clis/args/login-DiKT5Jfu.mjs.map +0 -1
  305. package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs +0 -1013
  306. package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs.map +0 -1
  307. package/dist/clis/args/migrate-CG_gWc4k.mjs +0 -29
  308. package/dist/clis/args/migrate-CG_gWc4k.mjs.map +0 -1
  309. package/dist/clis/args/migrate-sixkWhxm.d.mts +0 -21
  310. package/dist/clis/args/migrate-sixkWhxm.d.mts.map +0 -1
  311. package/dist/clis/args/publish-DDZYsUfV.mjs +0 -19
  312. package/dist/clis/args/publish-DDZYsUfV.mjs.map +0 -1
  313. package/dist/clis/args/publish-Dqe5DUst.d.mts +0 -18
  314. package/dist/clis/args/publish-Dqe5DUst.d.mts.map +0 -1
  315. package/dist/clis/args/registry-C_OVFQmI.mjs +0 -23
  316. package/dist/clis/args/registry-C_OVFQmI.mjs.map +0 -1
  317. package/dist/clis/args/registry-C_RfTsKB.d.mts +0 -19
  318. package/dist/clis/args/registry-C_RfTsKB.d.mts.map +0 -1
  319. package/dist/clis/args/service-CHOOr0Gg.mjs +0 -11
  320. package/dist/clis/args/service-CHOOr0Gg.mjs.map +0 -1
  321. package/dist/clis/args/service-DhIkf8-O.d.mts +0 -22
  322. package/dist/clis/args/service-DhIkf8-O.d.mts.map +0 -1
  323. package/dist/clis/args/switchboard-BlPaq2at.d.mts +0 -72
  324. package/dist/clis/args/switchboard-BlPaq2at.d.mts.map +0 -1
  325. package/dist/clis/args/switchboard-Dsp7nosi.mjs +0 -85
  326. package/dist/clis/args/switchboard-Dsp7nosi.mjs.map +0 -1
  327. package/dist/clis/args/uninstall-BpA3YYbw.d.mts +0 -31
  328. package/dist/clis/args/uninstall-BpA3YYbw.d.mts.map +0 -1
  329. package/dist/clis/args/uninstall-CTwTX0u_.mjs +0 -16
  330. package/dist/clis/args/uninstall-CTwTX0u_.mjs.map +0 -1
  331. package/dist/clis/args/unpublish-BPMkGEg5.mjs +0 -30
  332. package/dist/clis/args/unpublish-BPMkGEg5.mjs.map +0 -1
  333. package/dist/clis/args/unpublish-CvwaIimG.d.mts +0 -24
  334. package/dist/clis/args/unpublish-CvwaIimG.d.mts.map +0 -1
  335. package/dist/clis/args/vetra-DLQ6lhLl.d.mts +0 -113
  336. package/dist/clis/args/vetra-DLQ6lhLl.d.mts.map +0 -1
  337. package/dist/clis/args/vetra-b4KUu1Ax.mjs.map +0 -1
  338. package/dist/clis/args/vetra-ports.test.d.mts +0 -1
  339. package/dist/clis/args/vetra-ports.test.mjs +0 -13249
  340. package/dist/clis/args/vetra-ports.test.mjs.map +0 -1
  341. package/dist/clis/build-config.mjs.map +0 -1
  342. package/dist/clis/constants.d.mts.map +0 -1
  343. package/dist/config-loader-B845Hidf.js.map +0 -1
  344. package/dist/constants-BP_gjn8g.d.ts +0 -8
  345. package/dist/constants-BP_gjn8g.d.ts.map +0 -1
  346. package/dist/document-model/index.js.map +0 -1
  347. package/dist/index-C_iVZe7f.d.ts +0 -7
  348. package/dist/index-C_iVZe7f.d.ts.map +0 -1
  349. package/dist/index-DP3QgHTq.d.ts +0 -836
  350. package/dist/index-DP3QgHTq.d.ts.map +0 -1
  351. package/dist/types-BIoOWpOT.d.ts +0 -3172
  352. package/dist/types-BIoOWpOT.d.ts.map +0 -1
  353. package/dist/types-C1in4fl3.d.ts.map +0 -1
  354. package/dist/types-DDpRvBK_.d.ts.map +0 -1
  355. package/dist/utils-DP122OSS.d.ts +0 -18
  356. package/dist/utils-DP122OSS.d.ts.map +0 -1
  357. package/dist/utils-aaTmfxFW.js.map +0 -1
@@ -1,48 +1,25 @@
1
- import { createRequire } from "node:module";
1
+ import { i as __toESM, r as __require, t as __commonJSMin } from "./rolldown-runtime-B4iAMlE-.mjs";
2
2
  import { array, boolean, command, flag, multioption, number, oneOf, option, optional, positional, rest, restPositionals, string } from "cmd-ts";
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, satisfies, 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
+ import { toJSONSchema, z } from "zod";
21
22
  import lt from "semver/functions/lt.js";
22
- //#region \0rolldown/runtime.js
23
- var __create = Object.create;
24
- var __defProp = Object.defineProperty;
25
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
26
- var __getOwnPropNames = Object.getOwnPropertyNames;
27
- var __getProtoOf = Object.getPrototypeOf;
28
- var __hasOwnProp = Object.prototype.hasOwnProperty;
29
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
30
- var __copyProps = (to, from, except, desc) => {
31
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
32
- key = keys[i];
33
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
34
- get: ((k) => from[k]).bind(null, key),
35
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
36
- });
37
- }
38
- return to;
39
- };
40
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
41
- value: mod,
42
- enumerable: true
43
- }) : target, mod));
44
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
45
- //#endregion
46
23
  //#region clis/constants.ts
47
24
  const SERVICE_ACTIONS = [
48
25
  "start",
@@ -51,7 +28,7 @@ const SERVICE_ACTIONS = [
51
28
  "setup",
52
29
  "restart"
53
30
  ];
54
- const SECONDS_IN_DAY = 1440 * 60;
31
+ const SECONDS_IN_DAY = 86400;
55
32
  const DEFAULT_EXPIRY_DAYS = 7;
56
33
  const DEFAULT_EXPIRY_SECONDS = 7 * SECONDS_IN_DAY;
57
34
  const DRIVES_PRESERVE_STRATEGIES = ["preserve-all", "preserve-by-url-and-detach"];
@@ -74,6 +51,18 @@ const PROJECT_PORT_BAND_SIZE = 1e3;
74
51
  const PROJECT_PORT_BAND_SWITCHBOARD = 7e3;
75
52
  const PROJECT_PORT_BAND_STUDIO = 6e3;
76
53
  const PROJECT_PORT_BAND_VETRA_CONNECT = 2e3;
54
+ /**
55
+ * Icon for the drives switchboard creates by default, inlined as a data URI.
56
+ *
57
+ * A remote URL is the wrong shape for this: the value is baked into the drive
58
+ * document and rendered by every Connect that opens it, so the icon only
59
+ * appears when that client can reach that host. A desktop or air-gapped install
60
+ * cannot, and the ipfs.io gateway this previously pointed at now answers 403
61
+ * regardless.
62
+ *
63
+ * The mark is drawn dark-on-light so it stays legible against either theme.
64
+ */
65
+ 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
66
  const DEFAULT_VETRA_DRIVE_ID = "vetra";
78
67
  const MINIMUM_NODE_VERSION = "24.0.0";
79
68
  const PH_BIN = "ph-cli-legacy";
@@ -82,11 +71,18 @@ const PH_GLOBAL_DIR_NAME = ".ph";
82
71
  const PH_GLOBAL_PROJECT_NAME = ".ph";
83
72
  const HOME_DIR = homedir();
84
73
  const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, ".ph");
85
- const VERSIONED_PEER_DEPENDENCIES = ["document-model", "@powerhousedao/reactor-browser"];
74
+ const VERSIONED_PEER_DEPENDENCIES = [
75
+ "document-model",
76
+ "@powerhousedao/reactor-browser",
77
+ "@powerhousedao/connect-core"
78
+ ];
86
79
  const REACTOR_API_PACKAGE = "@powerhousedao/reactor-api";
87
80
  const ANALYTICS_ENGINE_CORE_PACKAGE = "@powerhousedao/analytics-engine-core";
88
81
  const GRAPHQL_PACKAGE = "graphql";
89
82
  const GRAPHQL_TAG_PACKAGE = "graphql-tag";
83
+ const PIECES_FRAMEWORK_PACKAGE = "@powerhousedao/pieces-framework";
84
+ const KYSELY_PACKAGE = "kysely";
85
+ const RELATIONAL_DB_PROCESSOR_CLASS = "RelationalDbProcessor";
90
86
  const PEER_EXTERNAL_DEPENDENCIES = {
91
87
  [GRAPHQL_PACKAGE]: {
92
88
  peer: "^16",
@@ -106,14 +102,43 @@ const PEER_EXTERNAL_DEPENDENCIES = {
106
102
  },
107
103
  zod: {
108
104
  peer: "^4",
109
- dev: "4.3.6"
105
+ dev: "4.6.5"
106
+ },
107
+ "@tanstack/react-router": {
108
+ peer: "^1.170.41",
109
+ dev: "1.170.41"
110
110
  }
111
111
  };
112
- const FEATURE_DEPENDENCIES = { analyticsProcessor: {
113
- peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],
114
- peerExternal: {}
115
- } };
116
- const VERSIONED_DEPENDENCIES = [...VERSIONED_PEER_DEPENDENCIES, ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned];
112
+ const FEATURE_DEPENDENCIES = {
113
+ analyticsProcessor: {
114
+ peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],
115
+ peerExternal: {},
116
+ devVersioned: []
117
+ },
118
+ relationalDbProcessor: {
119
+ peerVersioned: [],
120
+ peerExternal: { [KYSELY_PACKAGE]: {
121
+ peer: "^0.28",
122
+ dev: "0.28.16"
123
+ } },
124
+ devVersioned: []
125
+ },
126
+ subgraph: {
127
+ peerVersioned: [REACTOR_API_PACKAGE],
128
+ peerExternal: {},
129
+ devVersioned: []
130
+ },
131
+ piece: {
132
+ peerVersioned: [],
133
+ peerExternal: {},
134
+ devVersioned: [PIECES_FRAMEWORK_PACKAGE]
135
+ }
136
+ };
137
+ const VERSIONED_DEPENDENCIES = [
138
+ ...VERSIONED_PEER_DEPENDENCIES,
139
+ ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,
140
+ ...FEATURE_DEPENDENCIES.subgraph.peerVersioned
141
+ ];
117
142
  const BOILERPLATE_ALLOWED_BUILDS = [
118
143
  "@apollo/protobufjs",
119
144
  "@datadog/pprof",
@@ -135,7 +160,12 @@ const VERSIONED_DEV_DEPENDENCIES = [
135
160
  "@powerhousedao/reactor",
136
161
  "@powerhousedao/shared",
137
162
  "@powerhousedao/connect",
138
- "@powerhousedao/design-system"
163
+ "@powerhousedao/design-system",
164
+ "@powerhousedao/host-core",
165
+ "@powerhousedao/clint",
166
+ "@powerhousedao/desktop",
167
+ "@powerhousedao/vetra-studio",
168
+ "@powerhousedao/switchboard"
139
169
  ];
140
170
  const packageJsonExports = {
141
171
  ".": {
@@ -169,9 +199,14 @@ const packageJsonExports = {
169
199
  },
170
200
  "./subgraphs": {
171
201
  types: "./dist/types/subgraphs/index.d.ts",
172
- browser: "./dist/browser/subgraphs/index.js",
173
202
  node: "./dist/node/subgraphs/index.mjs"
174
203
  },
204
+ "./scalars": {
205
+ types: "./dist/types/scalars/index.d.ts",
206
+ browser: "./dist/browser/scalars/index.js",
207
+ node: "./dist/node/scalars/index.mjs"
208
+ },
209
+ "./connect-routes": { browser: "./dist/browser/connect-routes.js" },
175
210
  "./processors": {
176
211
  types: "./dist/types/processors/index.d.ts",
177
212
  browser: "./dist/browser/processors/index.js",
@@ -190,11 +225,11 @@ const packageJsonExports = {
190
225
  };
191
226
  const packageScripts = {
192
227
  "test:watch": "vitest",
193
- lint: "oxlint --type-aware --type-check",
194
- "lint:fix": "oxlint --type-aware --type-check --fix",
228
+ lint: "ph-cli generate connect-routes && oxlint --type-aware --type-check",
229
+ "lint:fix": "ph-cli generate connect-routes && oxlint --type-aware --type-check --fix",
195
230
  format: "oxfmt",
196
231
  "format:check": "oxfmt --check",
197
- tsc: "tsc",
232
+ tsc: "ph-cli generate connect-routes && tsc",
198
233
  "tsc:watch": "tsc --watch",
199
234
  generate: "ph-cli generate",
200
235
  connect: "ph-cli connect",
@@ -202,6 +237,7 @@ const packageScripts = {
202
237
  reactor: "ph-cli reactor",
203
238
  service: "ph-cli service",
204
239
  vetra: "ph-cli vetra",
240
+ mcp: "ph-cli mcp",
205
241
  "service-startup": "bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh",
206
242
  "service-unstartup": "bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh"
207
243
  };
@@ -250,15 +286,14 @@ const externalDevDependencies = {
250
286
  "@types/react": "^19.2.3",
251
287
  "@types/react-dom": "^19.2.3",
252
288
  "@vitejs/plugin-react": "^6.0.1",
253
- "@vitest/coverage-v8": "4.1.1",
254
- oxfmt: "0.55.0",
255
- oxlint: "1.70.0",
256
- "oxlint-tsgolint": "0.23.0",
289
+ "@vitest/coverage-v8": "5.0.3",
290
+ oxfmt: "0.68.0",
291
+ oxlint: "1.83.0",
292
+ "oxlint-tsgolint": "7.0.2001",
257
293
  tailwindcss: "^4.1.16",
258
- typescript: "^5.9.3",
294
+ typescript: "~7.0.2",
259
295
  vite: "^8.0.10",
260
- "vite-tsconfig-paths": "6.1.1",
261
- vitest: "4.1.1"
296
+ vitest: "5.0.3"
262
297
  };
263
298
  const defaultManifest = {
264
299
  name: "",
@@ -317,6 +352,20 @@ const buildArgs = {
317
352
  defaultValue: () => "dist",
318
353
  defaultValueIsSerializable: true
319
354
  }),
355
+ noSharedDeps: flag({
356
+ type: boolean,
357
+ long: "no-shared-deps",
358
+ description: "Bundle the shared dependency set instead of externalizing it (default: externalize)",
359
+ defaultValue: () => false,
360
+ defaultValueIsSerializable: true
361
+ }),
362
+ ignoreTypeErrors: flag({
363
+ type: boolean,
364
+ long: "ignore-type-errors",
365
+ description: "Unsafe: build even when tsc reports type errors, without asking. The package can load and still fail at runtime",
366
+ defaultValue: () => false,
367
+ defaultValueIsSerializable: true
368
+ }),
320
369
  ...debugArgs
321
370
  };
322
371
  const packageManagerArgs = {
@@ -365,10 +414,9 @@ const localPackage = option({
365
414
  env: "PH_LOCAL_PACKAGE"
366
415
  });
367
416
  const disableLocalPackages = flag({
368
- type: boolean,
417
+ type: optional(boolean),
369
418
  long: "ignore-local",
370
- description: "Do not load local packages from this project",
371
- defaultValue: () => false
419
+ description: "Do not load local packages from this project"
372
420
  });
373
421
  const httpsKeyFile = option({
374
422
  type: optional(string),
@@ -422,7 +470,7 @@ const vetraSwitchboardArgs = {
422
470
  const defaultDrivesUrl = option({
423
471
  type: optional(string),
424
472
  long: "default-drives-url",
425
- description: "The default drives url to use in connect",
473
+ description: "Comma-separated drive URLs to use as Connect's default drives.",
426
474
  defaultValue: () => ""
427
475
  });
428
476
  const logLevel = option({
@@ -559,7 +607,7 @@ const connectRuntimeOverrideArgs = {
559
607
  json: option({
560
608
  type: optional(string),
561
609
  long: "json",
562
- 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."
610
+ 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."
563
611
  }),
564
612
  renownUrl: option({
565
613
  type: optional(string),
@@ -588,6 +636,11 @@ const connectRuntimeOverrideArgs = {
588
636
  long: "external-packages",
589
637
  description: "Override connect.packages.externalEnabled."
590
638
  }),
639
+ workflows: option({
640
+ type: optional(cliBoolean),
641
+ long: "workflows",
642
+ description: "Override connect.app.workflowsEnabled (load the @powerhousedao/workflow package: workflow + connection documents, their editors and Workflow Studio)."
643
+ }),
591
644
  remoteDrivesEnabled: option({
592
645
  type: optional(cliBoolean),
593
646
  long: "remote-drives-enabled",
@@ -631,7 +684,7 @@ const connectRuntimeOverrideArgs = {
631
684
  homeBackground: option({
632
685
  type: optional(string),
633
686
  long: "home-background",
634
- description: "Override connect.branding.homeBackground. URL or path to an image; pass an empty string (\"\") to reset to the bundled default."
687
+ description: "Override connect.home.background (the generic plugin's home screen). URL or path to an image, pinned bottom-right; pass an empty string (\"\") to reset to the bundled gradient."
635
688
  }),
636
689
  sentryDsn: option({
637
690
  type: optional(string),
@@ -679,7 +732,7 @@ const connectBuildArgs = {
679
732
  favicon: option({
680
733
  type: optional(string),
681
734
  long: "favicon",
682
- description: "Path to a favicon file (e.g. .ico) to bundle in place of the default Connect icon. Emitted as icon.ico; resolved relative to the build cwd."
735
+ description: "Path to a favicon file (e.g. .ico) to bundle in place of the default Connect icon. Emitted as icon.ico, or icon.svg/icon.png for those types; resolved relative to the build cwd."
683
736
  }),
684
737
  ...commonArgs
685
738
  };
@@ -809,6 +862,44 @@ const generateArgs = {
809
862
  long: "subgraph",
810
863
  description: "Subgraph name."
811
864
  }),
865
+ pieceName: option({
866
+ type: optional(string),
867
+ long: "piece",
868
+ description: "Piece name."
869
+ }),
870
+ pieceId: option({
871
+ type: optional(string),
872
+ long: "piece-id",
873
+ description: "Piece id, the pieceName a workflow step holds, e.g. @acme/piece-crm. Defaults to one derived from the package name."
874
+ }),
875
+ pieceAuth: option({
876
+ type: oneOf([
877
+ "none",
878
+ "secret",
879
+ "custom"
880
+ ]),
881
+ long: "piece-auth",
882
+ description: "The kind of connection the generated piece asks for. Default is custom.",
883
+ defaultValue: () => "custom",
884
+ defaultValueIsSerializable: true
885
+ }),
886
+ pieceActionName: option({
887
+ type: optional(string),
888
+ long: "piece-action",
889
+ description: "Name of an action to generate inside a piece."
890
+ }),
891
+ pieceTriggerName: option({
892
+ type: optional(string),
893
+ long: "piece-trigger",
894
+ description: "Name of a trigger to generate inside a piece."
895
+ }),
896
+ pieceTriggerStrategy: option({
897
+ type: oneOf(["polling", "webhook"]),
898
+ long: "piece-trigger-strategy",
899
+ description: "How a generated trigger fires. Default is polling.",
900
+ defaultValue: () => "polling",
901
+ defaultValueIsSerializable: true
902
+ }),
812
903
  importScriptName: option({
813
904
  type: optional(string),
814
905
  long: "import-script",
@@ -874,6 +965,52 @@ const generateArgs = {
874
965
  ...debugArgs
875
966
  };
876
967
  //#endregion
968
+ //#region clis/feature-flags.ts
969
+ /**
970
+ * Feature toggles shared by the CLIs (ph-cli and ph-cmd's dispatch/help).
971
+ * Hand-rolled env predicates by the CLI convention — deliberately no
972
+ * OpenFeature dependency here; that stack belongs to the runtime apps.
973
+ */
974
+ /**
975
+ * Gates the uniform-runners surface: the `ph run` command (registration,
976
+ * help listing, and ph-cmd forwarding), host-name sugar, and the `ph init`
977
+ * hosts/ scaffold. Off by default; set to `1` or `true` to enable. Rollout
978
+ * plan: docs/plans/2026-10-13-uniform-runners.md.
979
+ */
980
+ const UNIFORM_RUNNERS_FLAG = "FEATURE_UNIFORM_RUNNERS_ENABLED";
981
+ function isUniformRunnersEnabled(env = process.env) {
982
+ const value = env[UNIFORM_RUNNERS_FLAG]?.trim().toLowerCase();
983
+ return value === "1" || value === "true";
984
+ }
985
+ //#endregion
986
+ //#region clis/args/host.ts
987
+ const hostCheckArgs = {
988
+ host: positional({
989
+ type: string,
990
+ displayName: "host",
991
+ description: "the host to check (a directory under hosts/)"
992
+ }),
993
+ envFile: option({
994
+ type: optional(string),
995
+ long: "env",
996
+ description: "check against this env file alone instead of the project .env and the process env"
997
+ }),
998
+ verb: option({
999
+ type: optional(string),
1000
+ long: "verb",
1001
+ description: "the verb to check at (default: run)"
1002
+ })
1003
+ };
1004
+ positional({
1005
+ type: string,
1006
+ displayName: "host",
1007
+ description: "the host to export (a directory under hosts/)"
1008
+ }), option({
1009
+ type: optional(string),
1010
+ long: "out",
1011
+ description: "write the JSON to this file instead of stdout"
1012
+ });
1013
+ //#endregion
877
1014
  //#region clis/args/inspect.ts
878
1015
  const inspectArgs = {
879
1016
  packageName: positional({
@@ -911,6 +1048,43 @@ const installArgs = {
911
1048
  ...debugArgs
912
1049
  };
913
1050
  //#endregion
1051
+ //#region clis/args/keyframes.ts
1052
+ const KEYFRAMES_ACTIONS = [
1053
+ "preview",
1054
+ "clean",
1055
+ "status",
1056
+ "cancel",
1057
+ "reclaim"
1058
+ ];
1059
+ const keyframesArgs = {
1060
+ action: positional({
1061
+ type: oneOf(KEYFRAMES_ACTIONS),
1062
+ displayName: "action",
1063
+ description: "preview: report what a clean-up would remove, without writing. clean: apply the configured keep and remove the keyframes of deleted documents (needs --yes). status: show the latest run and reclaim. cancel: stop a running clean-up. reclaim: rewrite the Keyframe table to give the space back to the disk."
1064
+ }),
1065
+ url: option({
1066
+ type: optional(string),
1067
+ long: "url",
1068
+ description: "The switchboard's GraphQL endpoint, e.g. http://localhost:4001/graphql. Defaults to reactor.port in powerhouse.config.json."
1069
+ }),
1070
+ token: option({
1071
+ type: optional(string),
1072
+ long: "token",
1073
+ description: "Admin bearer token. Defaults to PH_ACCESS_TOKEN, then a token from your `ph login` identity. Its address must be in the host's auth admins."
1074
+ }),
1075
+ yes: flag({
1076
+ type: optional(boolean),
1077
+ long: "yes",
1078
+ description: "Confirms a clean or a reclaim; both refuse to run without it."
1079
+ }),
1080
+ json: flag({
1081
+ type: optional(boolean),
1082
+ long: "json",
1083
+ description: "Print the result as JSON."
1084
+ }),
1085
+ ...debugArgs
1086
+ };
1087
+ //#endregion
914
1088
  //#region clis/args/list.ts
915
1089
  const listArgs = { ...debugArgs };
916
1090
  //#endregion
@@ -949,20 +1123,36 @@ const loginArgs = {
949
1123
  ...debugArgs
950
1124
  };
951
1125
  //#endregion
1126
+ //#region clis/args/mcp.ts
1127
+ const mcpArgs = {
1128
+ projectDir: option({
1129
+ type: optional(string),
1130
+ long: "project-dir",
1131
+ description: "Powerhouse project to serve. Defaults to the nearest directory above the working directory that holds powerhouse.config.json."
1132
+ }),
1133
+ startTimeout: option({
1134
+ type: number,
1135
+ long: "start-timeout",
1136
+ description: "Seconds to wait for Vetra to answer /ready after starting it on the first tool call",
1137
+ defaultValue: () => 120,
1138
+ defaultValueIsSerializable: true
1139
+ }),
1140
+ ...debugArgs
1141
+ };
1142
+ //#endregion
952
1143
  //#region clis/args/migrate.ts
1144
+ const versionDescription = "The version to migrate to. Accepts a valid semver version or `staging`, `dev`, `latest`. Defaults to the release channel of the project's installed Powerhouse packages.";
953
1145
  const migrateArgs = {
954
1146
  versionPositional: positional({
955
1147
  type: optional(string),
956
1148
  displayName: "version",
957
- description: "The version to migrate to. Accepts a valid semver version or `staging`, `dev`, `latest`."
1149
+ description: versionDescription
958
1150
  }),
959
1151
  version: option({
960
1152
  long: "version",
961
1153
  short: "v",
962
- type: string,
963
- description: "The version to migrate to. Accepts a valid semver version or `staging`, `dev`, `latest`.",
964
- defaultValue: () => "latest",
965
- defaultValueIsSerializable: true
1154
+ type: optional(string),
1155
+ description: versionDescription
966
1156
  }),
967
1157
  force: flag({
968
1158
  type: optional(boolean),
@@ -1005,6 +1195,30 @@ const registryLoginArgs = {
1005
1195
  ...debugArgs
1006
1196
  };
1007
1197
  //#endregion
1198
+ //#region clis/args/run.ts
1199
+ const runArgs = {
1200
+ host: positional({
1201
+ type: string,
1202
+ displayName: "host",
1203
+ description: "the host to run (a directory under hosts/)"
1204
+ }),
1205
+ verb: positional({
1206
+ type: optional(string),
1207
+ displayName: "verb",
1208
+ description: "optional verb the runner forwards (dev, build, serve, …)"
1209
+ }),
1210
+ debug: flag({
1211
+ type: optional(boolean),
1212
+ long: "debug",
1213
+ description: "verbose runner diagnostics"
1214
+ }),
1215
+ explain: option({
1216
+ type: optional(string),
1217
+ long: "explain",
1218
+ description: "explain a resolved aspect instead of running (drives, outputs)"
1219
+ })
1220
+ };
1221
+ //#endregion
1008
1222
  //#region clis/args/switchboard.ts
1009
1223
  const switchboardArgs = {
1010
1224
  ...vetraSwitchboardArgs,
@@ -1019,7 +1233,7 @@ const switchboardArgs = {
1019
1233
  basePath: option({
1020
1234
  type: optional(string),
1021
1235
  long: "base-path",
1022
- description: "base path for the API endpoints (sets the BASE_PATH environment variable)"
1236
+ description: "base path for the API endpoints (overrides BASE_PATH)"
1023
1237
  }),
1024
1238
  keypairPath: option({
1025
1239
  type: optional(string),
@@ -1098,6 +1312,13 @@ const uninstallArgs = {
1098
1312
  //#endregion
1099
1313
  //#region clis/project-env.ts
1100
1314
  let loadedFor;
1315
+ let namesBeforeLoad;
1316
+ /** `PH_NO_DOTENV=1` (or `true`): no `.env` file is read, so a launcher's
1317
+ * explicit environment is the whole environment. */
1318
+ function isDotenvDisabled(env = process.env) {
1319
+ const value = env.PH_NO_DOTENV?.trim().toLowerCase();
1320
+ return value === "1" || value === "true";
1321
+ }
1101
1322
  /**
1102
1323
  * Load the project's `.env.local` and `.env` into `process.env`.
1103
1324
  *
@@ -1111,8 +1332,10 @@ let loadedFor;
1111
1332
  * call it more than once per process.
1112
1333
  */
1113
1334
  function loadProjectEnv(cwd = process.cwd()) {
1335
+ if (isDotenvDisabled()) return;
1114
1336
  if (loadedFor === cwd) return;
1115
1337
  loadedFor = cwd;
1338
+ namesBeforeLoad ??= new Set(Object.keys(process.env));
1116
1339
  dotenv.config({ path: join(cwd, ".env.local") });
1117
1340
  dotenv.config({ path: join(cwd, ".env") });
1118
1341
  }
@@ -1185,6 +1408,13 @@ const vetraArgs = {
1185
1408
  defaultValue: () => false,
1186
1409
  defaultValueIsSerializable: true
1187
1410
  }),
1411
+ restart: flag({
1412
+ type: boolean,
1413
+ long: "restart",
1414
+ description: "Stop this project's running Vetra first (the pid in .ph/vetra-runtime.json), then start",
1415
+ defaultValue: () => false,
1416
+ defaultValueIsSerializable: true
1417
+ }),
1188
1418
  disableConnect: flag({
1189
1419
  type: boolean,
1190
1420
  long: "disable-connect",
@@ -1217,6 +1447,8 @@ const vetraArgs = {
1217
1447
  //#endregion
1218
1448
  //#region clis/command-names.ts
1219
1449
  const phCliCommandNames = [
1450
+ "run",
1451
+ "host",
1220
1452
  "generate",
1221
1453
  "vetra",
1222
1454
  "connect",
@@ -1228,6 +1460,8 @@ const phCliCommandNames = [
1228
1460
  "registry-login",
1229
1461
  "inspect",
1230
1462
  "is",
1463
+ "keyframes",
1464
+ "mcp",
1231
1465
  "migrate",
1232
1466
  "switchboard",
1233
1467
  "reactor",
@@ -1251,7 +1485,19 @@ function helpCommand(config) {
1251
1485
  aliases
1252
1486
  });
1253
1487
  }
1254
- const phCliHelpCommands = {
1488
+ const allPhCliHelpCommands = {
1489
+ run: helpCommand({
1490
+ name: "run",
1491
+ args: runArgs,
1492
+ description: "Run a host from hosts/ with its runner",
1493
+ handler: () => {}
1494
+ }),
1495
+ host: helpCommand({
1496
+ name: "host",
1497
+ args: hostCheckArgs,
1498
+ description: "Check or export a host from hosts/: `ph host check|export <host>`",
1499
+ handler: () => {}
1500
+ }),
1255
1501
  generate: helpCommand({
1256
1502
  name: "generate",
1257
1503
  args: generateArgs,
@@ -1308,6 +1554,18 @@ const phCliHelpCommands = {
1308
1554
  description: "Inspect a package",
1309
1555
  handler: () => {}
1310
1556
  }),
1557
+ mcp: helpCommand({
1558
+ name: "mcp",
1559
+ args: mcpArgs,
1560
+ description: "Serve the project's reactor-mcp tools over stdio, starting Vetra on the first tool call",
1561
+ handler: () => {}
1562
+ }),
1563
+ keyframes: helpCommand({
1564
+ name: "keyframes",
1565
+ args: keyframesArgs,
1566
+ description: "Report on and clean up the keyframes of a running switchboard",
1567
+ handler: () => {}
1568
+ }),
1311
1569
  migrate: helpCommand({
1312
1570
  name: "migrate",
1313
1571
  args: migrateArgs,
@@ -1348,6 +1606,7 @@ const phCliHelpCommands = {
1348
1606
  handler: () => {}
1349
1607
  })
1350
1608
  };
1609
+ const phCliHelpCommands = isUniformRunnersEnabled() ? allPhCliHelpCommands : (({ run: _run, host: _host, ...rest }) => rest)(allPhCliHelpCommands);
1351
1610
  //#endregion
1352
1611
  //#region clis/args/init.ts
1353
1612
  const initArgs = {
@@ -1403,6 +1662,11 @@ const initArgs = {
1403
1662
  short: "r",
1404
1663
  description: "Remote drive identifier."
1405
1664
  }),
1665
+ uniformRunners: flag({
1666
+ type: optional(boolean),
1667
+ long: "uniform-runners",
1668
+ description: "Scaffold the hosts/ folder (uniform-runners architecture). Also enabled project-wide by FEATURE_UNIFORM_RUNNERS_ENABLED."
1669
+ }),
1406
1670
  clone: option({
1407
1671
  type: optional(string),
1408
1672
  long: "clone",
@@ -1442,9 +1706,44 @@ const unpublishArgs = {
1442
1706
  })
1443
1707
  };
1444
1708
  //#endregion
1709
+ //#region clis/ph-dir.ts
1710
+ /**
1711
+ * The project's `.ph` tree — stores, identity, run records, registry cache.
1712
+ *
1713
+ * Classically `<cwd>/.ph` (every classic command resolves it exactly so). A
1714
+ * desktop shell relocates the WHOLE tree under the user's profile by setting
1715
+ * `PH_USER_DATA_DIR`: the tree is then `${userData}/.ph`, the same names
1716
+ * under a different root, and nothing of the user's lands in the install
1717
+ * dir. One resolver replaces the former `.ph/...` literals; it adds no path
1718
+ * names and no layout of its own.
1719
+ */
1720
+ function resolvePhDir(base = process.cwd(), env = process.env) {
1721
+ return path.join(env.PH_USER_DATA_DIR ?? base, ".ph");
1722
+ }
1723
+ /**
1724
+ * The two PGlite store dirs the switchboard defaults to, for the server and
1725
+ * for `ph switchboard --reset` (which must touch the same paths). Without a
1726
+ * user-data root these are the classic literals, verbatim — byte-identical
1727
+ * to every classic boot log and reset prompt. Under PH_USER_DATA_DIR they
1728
+ * are the same names inside `${userData}/.ph`.
1729
+ */
1730
+ function defaultStoreDirs(env = process.env, phDir) {
1731
+ const root = phDir ?? (env.PH_USER_DATA_DIR ? resolvePhDir(void 0, env) : void 0);
1732
+ if (root === void 0) return {
1733
+ reactor: "./.ph/reactor-storage",
1734
+ readModel: ".ph/read-storage"
1735
+ };
1736
+ return {
1737
+ reactor: path.join(root, "reactor-storage"),
1738
+ readModel: path.join(root, "read-storage")
1739
+ };
1740
+ }
1741
+ //#endregion
1445
1742
  //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
1446
1743
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1447
- let p = process || {}, argv = p.argv || [], env = p.env || {};
1744
+ let p = process || {};
1745
+ let argv = p.argv || [];
1746
+ let env = p.env || {};
1448
1747
  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);
1449
1748
  let formatter = (open, close, replace = open) => (input) => {
1450
1749
  let string = "" + input, index = string.indexOf(close, open.length);
@@ -1532,7 +1831,7 @@ var require_js_tokens = /* @__PURE__ */ __commonJSMin(((exports) => {
1532
1831
  };
1533
1832
  }));
1534
1833
  //#endregion
1535
- //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.28.5/node_modules/@babel/helper-validator-identifier/lib/identifier.js
1834
+ //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.29.7/node_modules/@babel/helper-validator-identifier/lib/identifier.js
1536
1835
  var require_identifier = /* @__PURE__ */ __commonJSMin(((exports) => {
1537
1836
  Object.defineProperty(exports, "__esModule", { value: true });
1538
1837
  exports.isIdentifierChar = isIdentifierChar;
@@ -2540,7 +2839,7 @@ var require_identifier = /* @__PURE__ */ __commonJSMin(((exports) => {
2540
2839
  }
2541
2840
  }));
2542
2841
  //#endregion
2543
- //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.28.5/node_modules/@babel/helper-validator-identifier/lib/keyword.js
2842
+ //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.29.7/node_modules/@babel/helper-validator-identifier/lib/keyword.js
2544
2843
  var require_keyword = /* @__PURE__ */ __commonJSMin(((exports) => {
2545
2844
  Object.defineProperty(exports, "__esModule", { value: true });
2546
2845
  exports.isKeyword = isKeyword;
@@ -2619,7 +2918,7 @@ var require_keyword = /* @__PURE__ */ __commonJSMin(((exports) => {
2619
2918
  }
2620
2919
  }));
2621
2920
  //#endregion
2622
- //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.28.5/node_modules/@babel/helper-validator-identifier/lib/index.js
2921
+ //#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.29.7/node_modules/@babel/helper-validator-identifier/lib/index.js
2623
2922
  var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
2624
2923
  Object.defineProperty(exports, "__esModule", { value: true });
2625
2924
  Object.defineProperty(exports, "isIdentifierChar", {
@@ -2706,7 +3005,7 @@ var import_lib = (/* @__PURE__ */ __commonJSMin(((exports) => {
2706
3005
  function getDefs(enabled) {
2707
3006
  return enabled ? defsOn : defsOff;
2708
3007
  }
2709
- const sometimesKeywords = new Set([
3008
+ const sometimesKeywords = /* @__PURE__ */ new Set([
2710
3009
  "as",
2711
3010
  "async",
2712
3011
  "from",
@@ -2773,9 +3072,10 @@ var import_lib = (/* @__PURE__ */ __commonJSMin(((exports) => {
2773
3072
  else if (i === lineDiff) markerLines[lineNumber] = [0, endColumn];
2774
3073
  else markerLines[lineNumber] = [0, source[lineNumber - i].length];
2775
3074
  }
2776
- else if (startColumn === endColumn) if (startColumn) markerLines[startLine] = [startColumn, 0];
2777
- else markerLines[startLine] = true;
2778
- else markerLines[startLine] = [startColumn, endColumn - startColumn];
3075
+ else if (startColumn === endColumn) {
3076
+ if (startColumn) markerLines[startLine] = [startColumn, 0];
3077
+ else markerLines[startLine] = true;
3078
+ } else markerLines[startLine] = [startColumn, endColumn - startColumn];
2779
3079
  return {
2780
3080
  start,
2781
3081
  end,
@@ -4235,49 +4535,47 @@ var require_validate_npm_package_license = /* @__PURE__ */ __commonJSMin(((expor
4235
4535
  };
4236
4536
  }));
4237
4537
  //#endregion
4238
- //#region ../../node_modules/.pnpm/lru-cache@11.2.7/node_modules/lru-cache/dist/commonjs/index.min.js
4538
+ //#region ../../node_modules/.pnpm/lru-cache@11.5.0/node_modules/lru-cache/dist/commonjs/node/index.min.js
4239
4539
  var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4540
+ var j = (c, t) => () => (t || c((t = { exports: {} }).exports, t), t.exports);
4541
+ var I = j((O) => {
4542
+ "use strict";
4543
+ Object.defineProperty(O, "__esModule", { value: !0 });
4544
+ O.tracing = O.metrics = void 0;
4545
+ var U = __require("node:diagnostics_channel");
4546
+ O.metrics = (0, U.channel)("lru-cache:metrics");
4547
+ O.tracing = (0, U.tracingChannel)("lru-cache");
4548
+ });
4549
+ var P = j((D) => {
4550
+ "use strict";
4551
+ Object.defineProperty(D, "__esModule", { value: !0 });
4552
+ D.defaultPerf = void 0;
4553
+ D.defaultPerf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
4554
+ });
4240
4555
  Object.defineProperty(exports, "__esModule", { value: !0 });
4241
4556
  exports.LRUCache = void 0;
4242
- 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) => {
4243
- typeof R.emitWarning == "function" ? R.emitWarning(c, t, e, i) : console.error(`[${e}] ${t}: ${c}`);
4244
- }, C = globalThis.AbortController, L = globalThis.AbortSignal;
4245
- if (typeof C > "u") {
4246
- L = class {
4247
- onabort;
4248
- _onabort = [];
4249
- reason;
4250
- aborted = !1;
4251
- addEventListener(i, s) {
4252
- this._onabort.push(s);
4253
- }
4254
- }, C = class {
4255
- constructor() {
4256
- t();
4257
- }
4258
- signal = new L();
4259
- abort(i) {
4260
- if (!this.signal.aborted) {
4261
- this.signal.reason = i, this.signal.aborted = !0;
4262
- for (let s of this.signal._onabort) s(i);
4263
- this.signal.onabort?.(i);
4264
- }
4265
- }
4266
- };
4267
- let c = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
4268
- 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));
4269
- };
4270
- }
4271
- 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 {
4557
+ var g = I();
4558
+ var N = P();
4559
+ var C = () => g.metrics.hasSubscribers || g.tracing.hasSubscribers;
4560
+ var k = /* @__PURE__ */ new Set();
4561
+ var G = typeof process == "object" && process ? process : {};
4562
+ var V = (c, t, e, i) => {
4563
+ typeof G.emitWarning == "function" ? G.emitWarning(c, t, e, i) : console.error(`[${e}] ${t}: ${c}`);
4564
+ };
4565
+ var q = (c) => !k.has(c);
4566
+ var T = (c) => !!c && c === Math.floor(c) && c > 0 && isFinite(c);
4567
+ 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;
4568
+ var W = class extends Array {
4272
4569
  constructor(t) {
4273
4570
  super(t), this.fill(0);
4274
4571
  }
4275
- }, W = class c {
4572
+ };
4573
+ var x = class c {
4276
4574
  heap;
4277
4575
  length;
4278
4576
  static #o = !1;
4279
4577
  static create(t) {
4280
- let e = M(t);
4578
+ let e = H(t);
4281
4579
  if (!e) return [];
4282
4580
  c.#o = !0;
4283
4581
  let i = new c(t, e);
@@ -4297,14 +4595,14 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4297
4595
  exports.LRUCache = class c {
4298
4596
  #o;
4299
4597
  #c;
4300
- #w;
4301
- #C;
4302
- #S;
4303
- #L;
4304
- #U;
4305
4598
  #m;
4599
+ #W;
4600
+ #S;
4601
+ #M;
4602
+ #j;
4603
+ #w;
4306
4604
  get perf() {
4307
- return this.#m;
4605
+ return this.#w;
4308
4606
  }
4309
4607
  ttl;
4310
4608
  ttlResolution;
@@ -4321,48 +4619,49 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4321
4619
  allowStaleOnFetchAbort;
4322
4620
  allowStaleOnFetchRejection;
4323
4621
  ignoreFetchAbort;
4622
+ backgroundFetchSize;
4324
4623
  #n;
4325
- #_;
4624
+ #b;
4326
4625
  #s;
4327
4626
  #i;
4328
4627
  #t;
4329
- #a;
4330
- #u;
4331
4628
  #l;
4629
+ #u;
4630
+ #a;
4332
4631
  #h;
4333
- #b;
4632
+ #_;
4334
4633
  #r;
4335
4634
  #y;
4336
- #A;
4635
+ #F;
4337
4636
  #d;
4338
4637
  #g;
4339
4638
  #T;
4340
- #v;
4639
+ #U;
4341
4640
  #f;
4342
- #I;
4641
+ #D;
4343
4642
  static unsafeExposeInternals(t) {
4344
4643
  return {
4345
- starts: t.#A,
4644
+ starts: t.#F,
4346
4645
  ttls: t.#d,
4347
4646
  autopurgeTimers: t.#g,
4348
4647
  sizes: t.#y,
4349
4648
  keyMap: t.#s,
4350
4649
  keyList: t.#i,
4351
4650
  valList: t.#t,
4352
- next: t.#a,
4651
+ next: t.#l,
4353
4652
  prev: t.#u,
4354
4653
  get head() {
4355
- return t.#l;
4654
+ return t.#a;
4356
4655
  },
4357
4656
  get tail() {
4358
4657
  return t.#h;
4359
4658
  },
4360
- free: t.#b,
4659
+ free: t.#_,
4361
4660
  isBackgroundFetch: (e) => t.#e(e),
4362
- backgroundFetch: (e, i, s, n) => t.#x(e, i, s, n),
4363
- moveToTail: (e) => t.#D(e),
4364
- indexes: (e) => t.#F(e),
4365
- rindexes: (e) => t.#O(e),
4661
+ backgroundFetch: (e, i, s, n) => t.#G(e, i, s, n),
4662
+ moveToTail: (e) => t.#L(e),
4663
+ indexes: (e) => t.#A(e),
4664
+ rindexes: (e) => t.#z(e),
4366
4665
  isStale: (e) => t.#p(e)
4367
4666
  };
4368
4667
  }
@@ -4373,188 +4672,190 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4373
4672
  return this.#c;
4374
4673
  }
4375
4674
  get calculatedSize() {
4376
- return this.#_;
4675
+ return this.#b;
4377
4676
  }
4378
4677
  get size() {
4379
4678
  return this.#n;
4380
4679
  }
4381
4680
  get fetchMethod() {
4382
- return this.#L;
4681
+ return this.#M;
4383
4682
  }
4384
4683
  get memoMethod() {
4385
- return this.#U;
4684
+ return this.#j;
4386
4685
  }
4387
4686
  get dispose() {
4388
- return this.#w;
4687
+ return this.#m;
4389
4688
  }
4390
4689
  get onInsert() {
4391
- return this.#C;
4690
+ return this.#W;
4392
4691
  }
4393
4692
  get disposeAfter() {
4394
4693
  return this.#S;
4395
4694
  }
4396
4695
  constructor(t) {
4397
- 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;
4398
- if (v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
4399
- if (this.#m = v ?? G, e !== 0 && !y(e)) throw new TypeError("max option must be a nonnegative integer");
4400
- let O = e ? M(e) : Array;
4401
- if (!O) throw new Error("invalid max value: " + e);
4402
- if (this.#o = e, this.#c = A, this.maxEntrySize = p || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
4696
+ 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;
4697
+ if (this.backgroundFetchSize = M, v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
4698
+ if (this.#w = v ?? N.defaultPerf, e !== 0 && !T(e)) throw new TypeError("max option must be a nonnegative integer");
4699
+ let E = e ? H(e) : Array;
4700
+ if (!E) throw new Error("invalid max value: " + e);
4701
+ if (this.#o = e, this.#c = p, this.maxEntrySize = f || this.#c, this.sizeCalculation = b, this.sizeCalculation) {
4403
4702
  if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
4404
4703
  if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
4405
4704
  }
4406
4705
  if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
4407
- if (this.#U = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
4408
- 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) {
4409
- if (this.#c !== 0 && !y(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
4410
- if (!y(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
4411
- this.#B();
4706
+ if (this.#j = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
4707
+ 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) {
4708
+ if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
4709
+ if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
4710
+ this.#X();
4412
4711
  }
4413
- 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) {
4414
- if (!y(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
4415
- this.#j();
4712
+ 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) {
4713
+ if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
4714
+ this.#k();
4416
4715
  }
4417
4716
  if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
4418
4717
  if (!this.ttlAutopurge && !this.#o && !this.#c) {
4419
- let E = "LRU_CACHE_UNBOUNDED";
4420
- x(E) && (U.add(E), I("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, c));
4718
+ let R = "LRU_CACHE_UNBOUNDED";
4719
+ q(R) && (k.add(R), V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", R, c));
4421
4720
  }
4422
4721
  }
4423
4722
  getRemainingTTL(t) {
4424
- return this.#s.has(t) ? Infinity : 0;
4425
- }
4426
- #j() {
4427
- let t = new z(this.#o), e = new z(this.#o);
4428
- this.#d = t, this.#A = e;
4429
- let i = this.ttlAutopurge ? new Array(this.#o) : void 0;
4430
- this.#g = i, this.#N = (h, r, a = this.#m.now()) => {
4431
- e[h] = r !== 0 ? a : 0, t[h] = r, s(h, r);
4723
+ return this.#s.has(t) ? 1 / 0 : 0;
4724
+ }
4725
+ #k() {
4726
+ let t = new W(this.#o), e = new W(this.#o);
4727
+ this.#d = t, this.#F = e;
4728
+ let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
4729
+ this.#g = i, this.#H = (h, a, o = this.#w.now()) => {
4730
+ e[h] = a !== 0 ? o : 0, t[h] = a, s(h, a);
4432
4731
  }, this.#R = (h) => {
4433
- e[h] = t[h] !== 0 ? this.#m.now() : 0, s(h, t[h]);
4732
+ e[h] = t[h] !== 0 ? this.#w.now() : 0, s(h, t[h]);
4434
4733
  };
4435
- let s = this.ttlAutopurge ? (h, r) => {
4436
- if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), r && r !== 0 && i) {
4437
- let a = setTimeout(() => {
4438
- this.#p(h) && this.#E(this.#i[h], "expire");
4439
- }, r + 1);
4440
- a.unref && a.unref(), i[h] = a;
4734
+ let s = this.ttlAutopurge ? (h, a) => {
4735
+ if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), a && a !== 0 && i) {
4736
+ let o = setTimeout(() => {
4737
+ this.#p(h) && this.#v(this.#i[h], "expire");
4738
+ }, a + 1);
4739
+ o.unref && o.unref(), i[h] = o;
4441
4740
  }
4442
4741
  } : () => {};
4443
- this.#z = (h, r) => {
4444
- if (t[r]) {
4445
- let a = t[r], w = e[r];
4446
- if (!a || !w) return;
4447
- h.ttl = a, h.start = w, h.now = n || o();
4448
- h.remainingTTL = a - (h.now - w);
4742
+ this.#E = (h, a) => {
4743
+ if (t[a]) {
4744
+ let o = t[a], d = e[a];
4745
+ if (!o || !d) return;
4746
+ h.ttl = o, h.start = d, h.now = n || r();
4747
+ h.remainingTTL = o - (h.now - d);
4449
4748
  }
4450
4749
  };
4451
- let n = 0, o = () => {
4452
- let h = this.#m.now();
4750
+ let n = 0, r = () => {
4751
+ let h = this.#w.now();
4453
4752
  if (this.ttlResolution > 0) {
4454
4753
  n = h;
4455
- let r = setTimeout(() => n = 0, this.ttlResolution);
4456
- r.unref && r.unref();
4754
+ let a = setTimeout(() => n = 0, this.ttlResolution);
4755
+ a.unref && a.unref();
4457
4756
  }
4458
4757
  return h;
4459
4758
  };
4460
4759
  this.getRemainingTTL = (h) => {
4461
- let r = this.#s.get(h);
4462
- if (r === void 0) return 0;
4463
- let a = t[r], w = e[r];
4464
- if (!a || !w) return Infinity;
4465
- return a - ((n || o()) - w);
4760
+ let a = this.#s.get(h);
4761
+ if (a === void 0) return 0;
4762
+ let o = t[a], d = e[a];
4763
+ if (!o || !d) return 1 / 0;
4764
+ return o - ((n || r()) - d);
4466
4765
  }, this.#p = (h) => {
4467
- let r = e[h], a = t[h];
4468
- return !!a && !!r && (n || o()) - r > a;
4766
+ let a = e[h], o = t[h];
4767
+ return !!o && !!a && (n || r()) - a > o;
4469
4768
  };
4470
4769
  }
4471
4770
  #R = () => {};
4472
- #z = () => {};
4473
- #N = () => {};
4771
+ #E = () => {};
4772
+ #H = () => {};
4474
4773
  #p = () => !1;
4475
- #B() {
4476
- let t = new z(this.#o);
4477
- this.#_ = 0, this.#y = t, this.#W = (e) => {
4478
- this.#_ -= t[e], t[e] = 0;
4479
- }, this.#P = (e, i, s, n) => {
4480
- if (this.#e(i)) return 0;
4481
- if (!y(s)) if (n) {
4482
- if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
4483
- if (s = n(i, e), !y(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
4484
- } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
4774
+ #X() {
4775
+ let t = new W(this.#o);
4776
+ this.#b = 0, this.#y = t, this.#C = (e) => {
4777
+ this.#b -= t[e], t[e] = 0;
4778
+ }, this.#N = (e, i, s, n) => {
4779
+ if (!T(s)) {
4780
+ if (this.#e(i)) return this.backgroundFetchSize;
4781
+ if (n) {
4782
+ if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
4783
+ if (s = n(i, e), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
4784
+ } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
4785
+ }
4485
4786
  return s;
4486
- }, this.#M = (e, i, s) => {
4787
+ }, this.#I = (e, i, s) => {
4487
4788
  if (t[e] = i, this.#c) {
4488
4789
  let n = this.#c - t[e];
4489
- for (; this.#_ > n;) this.#G(!0);
4790
+ for (; this.#b > n;) this.#P(!0);
4490
4791
  }
4491
- this.#_ += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#_);
4792
+ this.#b += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
4492
4793
  };
4493
4794
  }
4494
- #W = (t) => {};
4495
- #M = (t, e, i) => {};
4496
- #P = (t, e, i, s) => {
4795
+ #C = (t) => {};
4796
+ #I = (t, e, i) => {};
4797
+ #N = (t, e, i, s) => {
4497
4798
  if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
4498
4799
  return 0;
4499
4800
  };
4500
- *#F({ allowStale: t = this.allowStale } = {}) {
4501
- if (this.#n) for (let e = this.#h; !(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#l));) e = this.#u[e];
4801
+ *#A({ allowStale: t = this.allowStale } = {}) {
4802
+ if (this.#n) for (let e = this.#h; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#a);) e = this.#u[e];
4502
4803
  }
4503
- *#O({ allowStale: t = this.allowStale } = {}) {
4504
- if (this.#n) for (let e = this.#l; !(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#h));) e = this.#a[e];
4804
+ *#z({ allowStale: t = this.allowStale } = {}) {
4805
+ if (this.#n) for (let e = this.#a; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#h);) e = this.#l[e];
4505
4806
  }
4506
- #H(t) {
4807
+ #V(t) {
4507
4808
  return t !== void 0 && this.#s.get(this.#i[t]) === t;
4508
4809
  }
4509
4810
  *entries() {
4510
- 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]]);
4811
+ 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]]);
4511
4812
  }
4512
4813
  *rentries() {
4513
- 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]]);
4814
+ 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]]);
4514
4815
  }
4515
4816
  *keys() {
4516
- for (let t of this.#F()) {
4817
+ for (let t of this.#A()) {
4517
4818
  let e = this.#i[t];
4518
4819
  e !== void 0 && !this.#e(this.#t[t]) && (yield e);
4519
4820
  }
4520
4821
  }
4521
4822
  *rkeys() {
4522
- for (let t of this.#O()) {
4823
+ for (let t of this.#z()) {
4523
4824
  let e = this.#i[t];
4524
4825
  e !== void 0 && !this.#e(this.#t[t]) && (yield e);
4525
4826
  }
4526
4827
  }
4527
4828
  *values() {
4528
- for (let t of this.#F()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4829
+ for (let t of this.#A()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4529
4830
  }
4530
4831
  *rvalues() {
4531
- for (let t of this.#O()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4832
+ for (let t of this.#z()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4532
4833
  }
4533
4834
  [Symbol.iterator]() {
4534
4835
  return this.entries();
4535
4836
  }
4536
4837
  [Symbol.toStringTag] = "LRUCache";
4537
4838
  find(t, e = {}) {
4538
- for (let i of this.#F()) {
4839
+ for (let i of this.#A()) {
4539
4840
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
4540
- if (n !== void 0 && t(n, this.#i[i], this)) return this.get(this.#i[i], e);
4841
+ if (n !== void 0 && t(n, this.#i[i], this)) return this.#x(this.#i[i], e);
4541
4842
  }
4542
4843
  }
4543
4844
  forEach(t, e = this) {
4544
- for (let i of this.#F()) {
4845
+ for (let i of this.#A()) {
4545
4846
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
4546
4847
  n !== void 0 && t.call(e, n, this.#i[i], this);
4547
4848
  }
4548
4849
  }
4549
4850
  rforEach(t, e = this) {
4550
- for (let i of this.#O()) {
4851
+ for (let i of this.#z()) {
4551
4852
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
4552
4853
  n !== void 0 && t.call(e, n, this.#i[i], this);
4553
4854
  }
4554
4855
  }
4555
4856
  purgeStale() {
4556
4857
  let t = !1;
4557
- for (let e of this.#O({ allowStale: !0 })) this.#p(e) && (this.#E(this.#i[e], "expire"), t = !0);
4858
+ for (let e of this.#z({ allowStale: !0 })) this.#p(e) && (this.#v(this.#i[e], "expire"), t = !0);
4558
4859
  return t;
4559
4860
  }
4560
4861
  info(t) {
@@ -4563,24 +4864,24 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4563
4864
  let i = this.#t[e], s = this.#e(i) ? i.__staleWhileFetching : i;
4564
4865
  if (s === void 0) return;
4565
4866
  let n = { value: s };
4566
- if (this.#d && this.#A) {
4567
- let o = this.#d[e], h = this.#A[e];
4568
- if (o && h) n.ttl = o - (this.#m.now() - h), n.start = Date.now();
4867
+ if (this.#d && this.#F) {
4868
+ let r = this.#d[e], h = this.#F[e];
4869
+ if (r && h) n.ttl = r - (this.#w.now() - h), n.start = Date.now();
4569
4870
  }
4570
4871
  return this.#y && (n.size = this.#y[e]), n;
4571
4872
  }
4572
4873
  dump() {
4573
4874
  let t = [];
4574
- for (let e of this.#F({ allowStale: !0 })) {
4875
+ for (let e of this.#A({ allowStale: !0 })) {
4575
4876
  let i = this.#i[e], s = this.#t[e], n = this.#e(s) ? s.__staleWhileFetching : s;
4576
4877
  if (n === void 0 || i === void 0) continue;
4577
- let o = { value: n };
4578
- if (this.#d && this.#A) {
4579
- o.ttl = this.#d[e];
4580
- let h = this.#m.now() - this.#A[e];
4581
- o.start = Math.floor(Date.now() - h);
4878
+ let r = { value: n };
4879
+ if (this.#d && this.#F) {
4880
+ r.ttl = this.#d[e];
4881
+ let h = this.#w.now() - this.#F[e];
4882
+ r.start = Math.floor(Date.now() - h);
4582
4883
  }
4583
- this.#y && (o.size = this.#y[e]), t.unshift([i, o]);
4884
+ this.#y && (r.size = this.#y[e]), t.unshift([i, r]);
4584
4885
  }
4585
4886
  return t;
4586
4887
  }
@@ -4589,53 +4890,60 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4589
4890
  for (let [e, i] of t) {
4590
4891
  if (i.start) {
4591
4892
  let s = Date.now() - i.start;
4592
- i.start = this.#m.now() - s;
4893
+ i.start = this.#w.now() - s;
4593
4894
  }
4594
- this.set(e, i.value, i);
4895
+ this.#O(e, i.value, i);
4595
4896
  }
4596
4897
  }
4597
4898
  set(t, e, i = {}) {
4598
- if (e === void 0) return this.delete(t), this;
4599
- 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);
4600
- if (this.maxEntrySize && w > this.maxEntrySize) return r && (r.set = "miss", r.maxEntrySizeExceeded = !0), this.#E(t, "set"), this;
4601
- let f = this.#n === 0 ? void 0 : this.#s.get(t);
4602
- 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");
4899
+ let { status: s = g.metrics.hasSubscribers ? {} : void 0 } = i;
4900
+ i.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e), s.cache = this);
4901
+ let n = this.#O(t, e, i);
4902
+ return s && g.metrics.hasSubscribers && g.metrics.publish(s), n;
4903
+ }
4904
+ #O(t, e, i, s) {
4905
+ let { ttl: n = this.ttl, start: r, noDisposeOnSet: h = this.noDisposeOnSet, sizeCalculation: a = this.sizeCalculation, status: o } = i, d = this.#e(e);
4906
+ if (e === void 0) return o && (o.set = "deleted"), this.delete(t), this;
4907
+ let { noUpdateTTL: _ = this.noUpdateTTL } = i;
4908
+ o && !d && (o.value = e);
4909
+ let y = this.#N(t, e, i.size || 0, a, o);
4910
+ if (this.maxEntrySize && y > this.maxEntrySize) return this.#v(t, "set"), o && (o.set = "miss", o.maxEntrySizeExceeded = !0), this;
4911
+ let u = this.#n === 0 ? void 0 : this.#s.get(t);
4912
+ 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");
4603
4913
  else {
4604
- this.#D(f);
4605
- let d = this.#t[f];
4606
- if (e !== d) {
4607
- if (this.#v && this.#e(d)) {
4608
- d.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
4609
- let { __staleWhileFetching: g } = d;
4610
- g !== void 0 && !o && (this.#T && this.#w?.(g, t, "set"), this.#f && this.#r?.push([
4611
- g,
4914
+ this.#L(u);
4915
+ let p = this.#t[u];
4916
+ if (e !== p) {
4917
+ if (!h) if (this.#e(p)) {
4918
+ p !== s && p.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
4919
+ let { __staleWhileFetching: f } = p;
4920
+ f !== void 0 && f !== e && (this.#T && this.#m?.(f, t, "set"), this.#f && this.#r?.push([
4921
+ f,
4612
4922
  t,
4613
4923
  "set"
4614
4924
  ]));
4615
- } else o || (this.#T && this.#w?.(d, t, "set"), this.#f && this.#r?.push([
4616
- d,
4925
+ } else this.#T && this.#m?.(p, t, "set"), this.#f && this.#r?.push([
4926
+ p,
4617
4927
  t,
4618
4928
  "set"
4619
- ]));
4620
- if (this.#W(f), this.#M(f, w, r), this.#t[f] = e, r) {
4621
- r.set = "replace";
4622
- let g = d && this.#e(d) ? d.__staleWhileFetching : d;
4623
- g !== void 0 && (r.oldValue = g);
4929
+ ]);
4930
+ if (this.#C(u), this.#I(u, y, o), this.#t[u] = e, !d) {
4931
+ let f = p && this.#e(p) ? p.__staleWhileFetching : p, b = f === void 0 ? "add" : e !== f ? "replace" : "update";
4932
+ o && (o.set = b, f !== void 0 && (o.oldValue = f)), this.#D && this.onInsert?.(e, t, b);
4624
4933
  }
4625
- } else r && (r.set = "update");
4626
- this.#I && this.onInsert?.(e, t, e === d ? "update" : "replace");
4934
+ } else d || (o && (o.set = "update"), this.#D && this.onInsert?.(e, t, "update"));
4627
4935
  }
4628
- 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) {
4629
- let d = this.#r, g;
4630
- for (; g = d?.shift();) this.#S?.(...g);
4936
+ if (n !== 0 && !this.#d && this.#k(), this.#d && (_ || this.#H(u, n, r), o && this.#E(o, u)), !h && this.#f && this.#r) {
4937
+ let p = this.#r, f;
4938
+ for (; f = p?.shift();) this.#S?.(...f);
4631
4939
  }
4632
4940
  return this;
4633
4941
  }
4634
4942
  pop() {
4635
4943
  try {
4636
4944
  for (; this.#n;) {
4637
- let t = this.#t[this.#l];
4638
- if (this.#G(!0), this.#e(t)) {
4945
+ let t = this.#t[this.#a];
4946
+ if (this.#P(!0), this.#e(t)) {
4639
4947
  if (t.__staleWhileFetching) return t.__staleWhileFetching;
4640
4948
  } else if (t !== void 0) return t;
4641
4949
  }
@@ -4646,163 +4954,214 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4646
4954
  }
4647
4955
  }
4648
4956
  }
4649
- #G(t) {
4650
- let e = this.#l, i = this.#i[e], s = this.#t[e];
4651
- 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([
4652
- s,
4957
+ #P(t) {
4958
+ let e = this.#a, i = this.#i[e], s = this.#t[e], n = this.#e(s);
4959
+ n && s.__abortController.abort(/* @__PURE__ */ new Error("evicted"));
4960
+ let r = n ? s.__staleWhileFetching : s;
4961
+ return (this.#T || this.#f) && r !== void 0 && (this.#T && this.#m?.(r, i, "evict"), this.#f && this.#r?.push([
4962
+ r,
4653
4963
  i,
4654
4964
  "evict"
4655
- ])), 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;
4965
+ ])), 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;
4656
4966
  }
4657
4967
  has(t, e = {}) {
4968
+ let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
4969
+ e.status = i, i && (i.op = "has", i.key = t, i.cache = this);
4970
+ let s = this.#Y(t, e);
4971
+ return g.metrics.hasSubscribers && g.metrics.publish(i), s;
4972
+ }
4973
+ #Y(t, e = {}) {
4658
4974
  let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, n = this.#s.get(t);
4659
4975
  if (n !== void 0) {
4660
- let o = this.#t[n];
4661
- if (this.#e(o) && o.__staleWhileFetching === void 0) return !1;
4662
- if (this.#p(n)) s && (s.has = "stale", this.#z(s, n));
4663
- else return i && this.#R(n), s && (s.has = "hit", this.#z(s, n)), !0;
4976
+ let r = this.#t[n];
4977
+ if (this.#e(r) && r.__staleWhileFetching === void 0) return !1;
4978
+ if (this.#p(n)) s && (s.has = "stale", this.#E(s, n));
4979
+ else return i && this.#R(n), s && (s.has = "hit", this.#E(s, n)), !0;
4664
4980
  } else s && (s.has = "miss");
4665
4981
  return !1;
4666
4982
  }
4667
4983
  peek(t, e = {}) {
4668
- let { allowStale: i = this.allowStale } = e, s = this.#s.get(t);
4669
- if (s === void 0 || !i && this.#p(s)) return;
4670
- let n = this.#t[s];
4671
- return this.#e(n) ? n.__staleWhileFetching : n;
4984
+ let { status: i = C() ? {} : void 0 } = e;
4985
+ i && (i.op = "peek", i.key = t, i.cache = this), e.status = i;
4986
+ let s = this.#J(t, e);
4987
+ return g.metrics.hasSubscribers && g.metrics.publish(i), s;
4988
+ }
4989
+ #J(t, e) {
4990
+ let { status: i, allowStale: s = this.allowStale } = e, n = this.#s.get(t);
4991
+ if (n === void 0 || !s && this.#p(n)) {
4992
+ i && (i.peek = n === void 0 ? "miss" : "stale");
4993
+ return;
4994
+ }
4995
+ let r = this.#t[n], h = this.#e(r) ? r.__staleWhileFetching : r;
4996
+ return i && (h !== void 0 ? (i.peek = "hit", i.value = h) : i.peek = "miss"), h;
4672
4997
  }
4673
- #x(t, e, i, s) {
4998
+ #G(t, e, i, s) {
4674
4999
  let n = e === void 0 ? void 0 : this.#t[e];
4675
5000
  if (this.#e(n)) return n;
4676
- let o = new C(), { signal: h } = i;
4677
- h?.addEventListener("abort", () => o.abort(h.reason), { signal: o.signal });
4678
- let r = {
4679
- signal: o.signal,
5001
+ let r = new AbortController(), { signal: h } = i;
5002
+ h?.addEventListener("abort", () => r.abort(h.reason), { signal: r.signal });
5003
+ let a = {
5004
+ signal: r.signal,
4680
5005
  options: i,
4681
5006
  context: s
4682
- }, a = (p, _ = !1) => {
4683
- let { aborted: l } = o.signal, S = i.ignoreFetchAbort && p !== void 0, b = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && p !== void 0);
4684
- 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);
4685
- let m = g, u = this.#t[e];
4686
- 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;
4687
- }, w = (p) => (i.status && (i.status.fetchRejected = !0, i.status.fetchError = p), f(p, !1)), f = (p, _) => {
4688
- let { aborted: l } = o.signal, S = l && i.allowStaleOnFetchAbort, b = S || i.allowStaleOnFetchRejection, m = b || i.noDeleteOnFetchRejection, u = g;
4689
- 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;
4690
- if (u.__returned === u) throw p;
4691
- }, d = (p, _) => {
4692
- let l = this.#L?.(t, n, r);
4693
- l && l instanceof Promise && l.then((S) => p(S === void 0 ? void 0 : S), _), o.signal.addEventListener("abort", () => {
4694
- (!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (p(void 0), i.allowStaleOnFetchAbort && (p = (S) => a(S, !0)));
4695
- });
5007
+ }, o = (f, b = !1) => {
5008
+ let { aborted: l } = r.signal, S = i.ignoreFetchAbort && f !== void 0, F = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && f !== void 0);
5009
+ 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);
5010
+ let w = u, m = this.#t[e];
5011
+ 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;
5012
+ }, d = (f) => (i.status && (i.status.fetchRejected = !0, i.status.fetchError = f), _(f, !1)), _ = (f, b) => {
5013
+ let { aborted: l } = r.signal, S = l && i.allowStaleOnFetchAbort, F = S || i.allowStaleOnFetchRejection, w = F || i.noDeleteOnFetchRejection, m = u;
5014
+ 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;
5015
+ if (m.__returned === m) throw f;
5016
+ }, y = (f, b) => {
5017
+ let l = this.#M?.(t, n, a);
5018
+ r.signal.addEventListener("abort", () => {
5019
+ (!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (f(void 0), i.allowStaleOnFetchAbort && (f = (S) => o(S, !0)));
5020
+ }), l && l instanceof Promise ? l.then((S) => f(S === void 0 ? void 0 : S), b) : l !== void 0 && f(l);
4696
5021
  };
4697
5022
  i.status && (i.status.fetchDispatched = !0);
4698
- let g = new Promise(d).then(a, w), A = Object.assign(g, {
4699
- __abortController: o,
5023
+ let u = new Promise(y).then(o, d), p = Object.assign(u, {
5024
+ __abortController: r,
4700
5025
  __staleWhileFetching: n,
4701
5026
  __returned: void 0
4702
5027
  });
4703
- return e === void 0 ? (this.set(t, A, {
4704
- ...r.options,
5028
+ return e === void 0 ? (this.#O(t, p, {
5029
+ ...a.options,
4705
5030
  status: void 0
4706
- }), e = this.#s.get(t)) : this.#t[e] = A, A;
5031
+ }), e = this.#s.get(t)) : this.#t[e] = p, p;
4707
5032
  }
4708
5033
  #e(t) {
4709
- if (!this.#v) return !1;
5034
+ if (!this.#U) return !1;
4710
5035
  let e = t;
4711
- return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof C;
5036
+ return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
5037
+ }
5038
+ fetch(t, e = {}) {
5039
+ let i = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
5040
+ e.status = s, s && e.context && (s.context = e.context);
5041
+ let n = this.#q(t, e);
5042
+ return s && i && (s.trace = !0, g.tracing.tracePromise(() => n, s).catch(() => {})), n;
4712
5043
  }
4713
- async fetch(t, e = {}) {
4714
- 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;
4715
- if (!this.#v) return l && (l.fetch = "get"), this.get(t, {
5044
+ async #q(t, e = {}) {
5045
+ 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;
5046
+ 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, {
4716
5047
  allowStale: i,
4717
5048
  updateAgeOnGet: s,
4718
5049
  noDeleteOnStaleGet: n,
4719
5050
  status: l
4720
5051
  });
4721
- let b = {
5052
+ let F = {
4722
5053
  allowStale: i,
4723
5054
  updateAgeOnGet: s,
4724
5055
  noDeleteOnStaleGet: n,
4725
- ttl: o,
5056
+ ttl: r,
4726
5057
  noDisposeOnSet: h,
4727
- size: r,
4728
- sizeCalculation: a,
4729
- noUpdateTTL: w,
4730
- noDeleteOnFetchRejection: f,
4731
- allowStaleOnFetchRejection: d,
4732
- allowStaleOnFetchAbort: A,
4733
- ignoreFetchAbort: g,
5058
+ size: a,
5059
+ sizeCalculation: o,
5060
+ noUpdateTTL: d,
5061
+ noDeleteOnFetchRejection: _,
5062
+ allowStaleOnFetchRejection: y,
5063
+ allowStaleOnFetchAbort: p,
5064
+ ignoreFetchAbort: u,
4734
5065
  status: l,
4735
5066
  signal: S
4736
- }, m = this.#s.get(t);
4737
- if (m === void 0) {
5067
+ }, w = this.#s.get(t);
5068
+ if (w === void 0) {
4738
5069
  l && (l.fetch = "miss");
4739
- let u = this.#x(t, m, b, p);
4740
- return u.__returned = u;
5070
+ let m = this.#G(t, w, F, f);
5071
+ return m.__returned = m;
4741
5072
  } else {
4742
- let u = this.#t[m];
4743
- if (this.#e(u)) {
4744
- let E = i && u.__staleWhileFetching !== void 0;
4745
- return l && (l.fetch = "inflight", E && (l.returnedStale = !0)), E ? u.__staleWhileFetching : u.__returned = u;
5073
+ let m = this.#t[w];
5074
+ if (this.#e(m)) {
5075
+ let E = i && m.__staleWhileFetching !== void 0;
5076
+ return l && (l.fetch = "inflight", E && (l.returnedStale = !0)), E ? m.__staleWhileFetching : m.__returned = m;
4746
5077
  }
4747
- let T = this.#p(m);
4748
- if (!_ && !T) return l && (l.fetch = "hit"), this.#D(m), s && this.#R(m), l && this.#z(l, m), u;
4749
- let F = this.#x(t, m, b, p), O = F.__staleWhileFetching !== void 0 && i;
4750
- return l && (l.fetch = T ? "stale" : "refresh", O && T && (l.returnedStale = !0)), O ? F.__staleWhileFetching : F.__returned = F;
5078
+ let A = this.#p(w);
5079
+ if (!b && !A) return l && (l.fetch = "hit"), this.#L(w), s && this.#R(w), l && this.#E(l, w), m;
5080
+ let z = this.#G(t, w, F, f), v = z.__staleWhileFetching !== void 0 && i;
5081
+ return l && (l.fetch = A ? "stale" : "refresh", v && A && (l.returnedStale = !0)), v ? z.__staleWhileFetching : z.__returned = z;
4751
5082
  }
4752
5083
  }
4753
- async forceFetch(t, e = {}) {
4754
- let i = await this.fetch(t, e);
5084
+ forceFetch(t, e = {}) {
5085
+ let i = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
5086
+ e.status = s, s && e.context && (s.context = e.context);
5087
+ let n = this.#K(t, e);
5088
+ return s && i && (s.trace = !0, g.tracing.tracePromise(() => n, s).catch(() => {})), n;
5089
+ }
5090
+ async #K(t, e = {}) {
5091
+ let i = await this.#q(t, e);
4755
5092
  if (i === void 0) throw new Error("fetch() returned undefined");
4756
5093
  return i;
4757
5094
  }
4758
5095
  memo(t, e = {}) {
4759
- let i = this.#U;
5096
+ let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
5097
+ e.status = i, i && (i.op = "memo", i.key = t, e.context && (i.context = e.context), i.cache = this);
5098
+ let s = this.#Q(t, e);
5099
+ return i && (i.value = s), g.metrics.hasSubscribers && g.metrics.publish(i), s;
5100
+ }
5101
+ #Q(t, e = {}) {
5102
+ let i = this.#j;
4760
5103
  if (!i) throw new Error("no memoMethod provided to constructor");
4761
- let { context: s, forceRefresh: n, ...o } = e, h = this.get(t, o);
4762
- if (!n && h !== void 0) return h;
4763
- let r = i(t, h, {
4764
- options: o,
5104
+ let { context: s, status: n, forceRefresh: r, ...h } = e;
5105
+ n && r && (n.forceRefresh = !0);
5106
+ let a = this.#x(t, h), o = r || a === void 0;
5107
+ if (n && (n.memo = o ? "miss" : "hit", o || (n.value = a)), !o) return a;
5108
+ let d = i(t, a, {
5109
+ options: h,
4765
5110
  context: s
4766
5111
  });
4767
- return this.set(t, r, o), r;
5112
+ return n && (n.value = d), this.#O(t, d, h), d;
4768
5113
  }
4769
5114
  get(t, e = {}) {
4770
- let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e, h = this.#s.get(t);
4771
- if (h !== void 0) {
4772
- let r = this.#t[h], a = this.#e(r);
4773
- 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));
4774
- } else o && (o.get = "miss");
5115
+ let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
5116
+ e.status = i, i && (i.op = "get", i.key = t, i.cache = this);
5117
+ let s = this.#x(t, e);
5118
+ return i && (s !== void 0 && (i.value = s), g.metrics.hasSubscribers && g.metrics.publish(i)), s;
5119
+ }
5120
+ #x(t, e = {}) {
5121
+ let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: r } = e, h = this.#s.get(t);
5122
+ if (h === void 0) {
5123
+ r && (r.get = "miss");
5124
+ return;
5125
+ }
5126
+ let a = this.#t[h], o = this.#e(a);
5127
+ 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);
4775
5128
  }
4776
- #k(t, e) {
4777
- this.#u[e] = t, this.#a[t] = e;
5129
+ #B(t, e) {
5130
+ this.#u[e] = t, this.#l[t] = e;
4778
5131
  }
4779
- #D(t) {
4780
- 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);
5132
+ #L(t) {
5133
+ 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);
4781
5134
  }
4782
5135
  delete(t) {
4783
- return this.#E(t, "delete");
4784
- }
4785
- #E(t, e) {
5136
+ return this.#v(t, "delete");
5137
+ }
5138
+ #v(t, e) {
5139
+ g.metrics.hasSubscribers && g.metrics.publish({
5140
+ op: "delete",
5141
+ delete: e,
5142
+ key: t,
5143
+ cache: this
5144
+ });
4786
5145
  let i = !1;
4787
5146
  if (this.#n !== 0) {
4788
5147
  let s = this.#s.get(t);
4789
- 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);
5148
+ if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = !0, this.#n === 1) this.#$(e);
4790
5149
  else {
4791
- this.#W(s);
5150
+ this.#C(s);
4792
5151
  let n = this.#t[s];
4793
- 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([
5152
+ 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([
4794
5153
  n,
4795
5154
  t,
4796
5155
  e
4797
5156
  ])), this.#s.delete(t), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
4798
- else if (s === this.#l) this.#l = this.#a[s];
5157
+ else if (s === this.#a) this.#a = this.#l[s];
4799
5158
  else {
4800
- let o = this.#u[s];
4801
- this.#a[o] = this.#a[s];
4802
- let h = this.#a[s];
5159
+ let r = this.#u[s];
5160
+ this.#l[r] = this.#l[s];
5161
+ let h = this.#l[s];
4803
5162
  this.#u[h] = this.#u[s];
4804
5163
  }
4805
- this.#n--, this.#b.push(s);
5164
+ this.#n--, this.#_.push(s);
4806
5165
  }
4807
5166
  }
4808
5167
  if (this.#f && this.#r?.length) {
@@ -4812,27 +5171,27 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
4812
5171
  return i;
4813
5172
  }
4814
5173
  clear() {
4815
- return this.#V("delete");
5174
+ return this.#$("delete");
4816
5175
  }
4817
- #V(t) {
4818
- for (let e of this.#O({ allowStale: !0 })) {
5176
+ #$(t) {
5177
+ for (let e of this.#z({ allowStale: !0 })) {
4819
5178
  let i = this.#t[e];
4820
5179
  if (this.#e(i)) i.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
4821
5180
  else {
4822
5181
  let s = this.#i[e];
4823
- this.#T && this.#w?.(i, s, t), this.#f && this.#r?.push([
5182
+ this.#T && this.#m?.(i, s, t), this.#f && this.#r?.push([
4824
5183
  i,
4825
5184
  s,
4826
5185
  t
4827
5186
  ]);
4828
5187
  }
4829
5188
  }
4830
- if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#A) {
4831
- this.#d.fill(0), this.#A.fill(0);
5189
+ if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
5190
+ this.#d.fill(0), this.#F.fill(0);
4832
5191
  for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
4833
5192
  this.#g?.fill(void 0);
4834
5193
  }
4835
- 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) {
5194
+ 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) {
4836
5195
  let e = this.#r, i;
4837
5196
  for (; i = e?.shift();) this.#S?.(...i);
4838
5197
  }
@@ -5028,8 +5387,10 @@ var require_parse_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5028
5387
  if (Object.prototype.hasOwnProperty.call(protocols, proto)) return arg;
5029
5388
  if (arg.substr(firstColon, 3) === "://") return arg;
5030
5389
  const firstAt = arg.indexOf("@");
5031
- if (firstAt > -1) if (firstAt > firstColon) return `git+ssh://${arg}`;
5032
- else return arg;
5390
+ if (firstAt > -1) {
5391
+ if (firstAt > firstColon) return `git+ssh://${arg}`;
5392
+ else return arg;
5393
+ }
5033
5394
  return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`;
5034
5395
  };
5035
5396
  const correctUrl = (giturl) => {
@@ -5066,7 +5427,8 @@ var require_from_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5066
5427
  };
5067
5428
  module.exports = (giturl, opts, { gitHosts, protocols }) => {
5068
5429
  if (!giturl) return;
5069
- const parsed = parseUrl(isGitHubShorthand(giturl) ? `github:${giturl}` : giturl, protocols);
5430
+ const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl;
5431
+ const parsed = parseUrl(correctedUrl, protocols);
5070
5432
  if (!parsed) return;
5071
5433
  const gitHostShortcut = gitHosts.byShortcut[parsed.protocol];
5072
5434
  const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith("www.") ? parsed.hostname.slice(4) : parsed.hostname];
@@ -5529,17 +5891,22 @@ var require_fixer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5529
5891
  var hosted = hostedGitInfo.fromUrl(data.repository.url);
5530
5892
  if (hosted && hosted.bugs()) data.bugs = { url: hosted.bugs() };
5531
5893
  } else if (data.bugs) {
5532
- if (typeof data.bugs === "string") if (isEmail(data.bugs)) data.bugs = { email: data.bugs };
5533
- else if (URL$1.canParse(data.bugs)) data.bugs = { url: data.bugs };
5534
- else this.warn("nonEmailUrlBugsString");
5535
- else {
5894
+ if (typeof data.bugs === "string") {
5895
+ if (isEmail(data.bugs)) data.bugs = { email: data.bugs };
5896
+ else if (URL$1.canParse(data.bugs)) data.bugs = { url: data.bugs };
5897
+ else this.warn("nonEmailUrlBugsString");
5898
+ } else {
5536
5899
  bugsTypos(data.bugs, this.warn);
5537
5900
  var oldBugs = data.bugs;
5538
5901
  data.bugs = {};
5539
- if (oldBugs.url) if (URL$1.canParse(oldBugs.url)) data.bugs.url = oldBugs.url;
5540
- else this.warn("nonUrlBugsUrlField");
5541
- if (oldBugs.email) if (typeof oldBugs.email === "string" && isEmail(oldBugs.email)) data.bugs.email = oldBugs.email;
5542
- else this.warn("nonEmailBugsEmailField");
5902
+ if (oldBugs.url) {
5903
+ if (URL$1.canParse(oldBugs.url)) data.bugs.url = oldBugs.url;
5904
+ else this.warn("nonUrlBugsUrlField");
5905
+ }
5906
+ if (oldBugs.email) {
5907
+ if (typeof oldBugs.email === "string" && isEmail(oldBugs.email)) data.bugs.email = oldBugs.email;
5908
+ else this.warn("nonEmailBugsEmailField");
5909
+ }
5543
5910
  }
5544
5911
  if (!data.bugs.email && !data.bugs.url) {
5545
5912
  delete data.bugs;
@@ -5771,10 +6138,19 @@ const _readPackage = (file, normalize) => {
5771
6138
  return json;
5772
6139
  };
5773
6140
  async function readPackage({ cwd, normalize = true } = {}) {
5774
- return _readPackage(await fsPromises.readFile(getPackagePath(cwd), "utf8"), normalize);
6141
+ const packageFile = await fsPromises.readFile(getPackagePath(cwd), "utf8");
6142
+ return _readPackage(packageFile, normalize);
5775
6143
  }
5776
6144
  //#endregion
5777
6145
  //#region clis/file-system/spawn-async.ts
6146
+ var SpawnError = class extends Error {
6147
+ stdout;
6148
+ constructor(message, stdout) {
6149
+ super(message);
6150
+ this.stdout = stdout;
6151
+ this.name = "SpawnError";
6152
+ }
6153
+ };
5778
6154
  function spawnAsync(command, args, options = {}) {
5779
6155
  return new Promise((resolve, reject) => {
5780
6156
  const child = spawn(command, args, {
@@ -5788,26 +6164,36 @@ function spawnAsync(command, args, options = {}) {
5788
6164
  });
5789
6165
  let stdout = "";
5790
6166
  let stderr = "";
6167
+ child.stdout?.setEncoding("utf8");
6168
+ child.stderr?.setEncoding("utf8");
5791
6169
  child.stdout?.on("data", (d) => {
5792
- stdout += d.toString();
6170
+ stdout += d;
5793
6171
  });
5794
6172
  child.stderr?.on("data", (d) => {
5795
- stderr += d.toString();
6173
+ stderr += d;
5796
6174
  });
5797
6175
  child.on("error", reject);
5798
6176
  child.on("close", (code) => {
5799
6177
  if (code === 0) resolve(stdout.trim());
5800
- else reject(new Error(stderr.trim() || `${command} exited with code ${code}`));
6178
+ else reject(new SpawnError(stderr.trim() || stdout.trim() || `${command} exited with code ${code}`, stdout.trim()));
5801
6179
  });
5802
6180
  });
5803
6181
  }
5804
6182
  //#endregion
5805
6183
  //#region clis/file-system/dependencies.ts
5806
6184
  async function fetchNpmVersionFromRegistryForTag(packageName, tag) {
5807
- const cleanedVersion = clean(await fetchPackageVersionFromNpmRegistry(`${packageName}@${tag}`));
6185
+ const version = await fetchPackageVersionFromNpmRegistry(`${packageName}@${tag}`);
6186
+ const cleanedVersion = clean(version);
5808
6187
  if (!cleanedVersion) throw new Error(`Failed to fetch version for package "${packageName}" at tag "${tag}".`);
5809
6188
  return cleanedVersion;
5810
6189
  }
6190
+ /** Whether `version` is in the semver `range`; false when it is not a range. */
6191
+ function versionSatisfies(version, range) {
6192
+ return satisfies(version, range);
6193
+ }
6194
+ function lowestVersion(versions) {
6195
+ return [...versions].sort(compare)[0];
6196
+ }
5811
6197
  async function fetchPackageVersionFromNpmRegistry(packageSpecifier, registryUrl) {
5812
6198
  const failedFetchErrorMessage = `Failed to fetch version from npm registry for ${packageSpecifier}.`;
5813
6199
  try {
@@ -6054,7 +6440,7 @@ PH CLI package manager: ${packageManager}
6054
6440
  //#endregion
6055
6441
  //#region clis/file-system/write-file-ensuring-dir.ts
6056
6442
  async function writeFileEnsuringDir(filePath, contents) {
6057
- await mkdir(dirname(filePath), { recursive: true });
6443
+ await mkdir(dirname(resolve(filePath)), { recursive: true });
6058
6444
  await writeFile(filePath, contents, { encoding: "utf-8" });
6059
6445
  }
6060
6446
  //#endregion
@@ -6276,18 +6662,35 @@ function getTelemetryStatus() {
6276
6662
  //#region constants.ts
6277
6663
  const PACKAGES_DEPENDENCIES = [
6278
6664
  "@powerhousedao/builder-tools",
6665
+ "@powerhousedao/clint",
6279
6666
  "@powerhousedao/codegen",
6280
6667
  "@powerhousedao/common",
6281
6668
  "@powerhousedao/config",
6669
+ "@powerhousedao/connect-core",
6282
6670
  "@powerhousedao/design-system",
6671
+ "@powerhousedao/desktop",
6672
+ "@powerhousedao/host-core",
6283
6673
  "document-drive",
6284
6674
  "document-model",
6675
+ "@powerhousedao/opentelemetry-instrumentation-reactor",
6676
+ "@powerhousedao/pieces-framework",
6677
+ "@powerhousedao/portle",
6285
6678
  "@powerhousedao/reactor",
6286
6679
  "@powerhousedao/reactor-api",
6680
+ "@powerhousedao/reactor-attachments",
6287
6681
  "@powerhousedao/reactor-browser",
6682
+ "@powerhousedao/reactor-drive",
6683
+ "@powerhousedao/reactor-group",
6684
+ "@powerhousedao/reactor-hypercore",
6288
6685
  "@powerhousedao/reactor-mcp",
6686
+ "@powerhousedao/reactor-privacy",
6687
+ "@powerhousedao/reactor-router",
6688
+ "@powerhousedao/reactor-workflow",
6689
+ "@powerhousedao/registry",
6289
6690
  "@powerhousedao/switchboard-gui",
6290
6691
  "@powerhousedao/vetra",
6692
+ "@powerhousedao/vetra-studio",
6693
+ "@powerhousedao/workflow",
6291
6694
  "@powerhousedao/analytics-engine-core",
6292
6695
  "@powerhousedao/analytics-engine-knex",
6293
6696
  "@powerhousedao/analytics-engine-pg",
@@ -6295,14 +6698,13 @@ const PACKAGES_DEPENDENCIES = [
6295
6698
  "@powerhousedao/analytics-engine-graphql",
6296
6699
  "@powerhousedao/shared",
6297
6700
  "@powerhousedao/powerhouse-vetra-packages",
6298
- "@powerhousedao/analytics-engine-core",
6299
- "@powerhousedao/analytics-engine-graphql",
6300
- "@powerhousedao/analytics-engine-knex",
6301
- "@powerhousedao/analytics-engine-pg",
6302
- "@powerhousedao/analytics-engine-browser",
6303
6701
  "@renown/sdk"
6304
6702
  ];
6305
- const CLIS_DEPENDENCIES = ["ph-cmd", "@powerhousedao/ph-cli"];
6703
+ const CLIS_DEPENDENCIES = [
6704
+ "ph-cmd",
6705
+ "@powerhousedao/ph-cli",
6706
+ "@powerhousedao/ph-run"
6707
+ ];
6306
6708
  const APPS_DEPENDENCIES = ["@powerhousedao/connect", "@powerhousedao/switchboard"];
6307
6709
  const ALL_POWERHOUSE_DEPENDENCIES = [
6308
6710
  ...PACKAGES_DEPENDENCIES,
@@ -6365,7 +6767,35 @@ async function runUseLocal(monorepoPath, skipInstall) {
6365
6767
  runCmd(`pnpm install`);
6366
6768
  }
6367
6769
  }
6770
+ const WORKSPACE_DIRS = [
6771
+ "packages",
6772
+ "packages/analytics-engine",
6773
+ "clis",
6774
+ "apps"
6775
+ ];
6776
+ const workspaces = /* @__PURE__ */ new Map();
6777
+ function workspacePackages(monorepoPath) {
6778
+ let dirs = workspaces.get(monorepoPath);
6779
+ if (dirs) return dirs;
6780
+ dirs = /* @__PURE__ */ new Map();
6781
+ for (const parent of WORKSPACE_DIRS) {
6782
+ const root = path.join(monorepoPath, parent);
6783
+ if (!existsSync(root)) continue;
6784
+ for (const entry of readdirSync(root, { withFileTypes: true })) {
6785
+ const manifest = path.join(root, entry.name, "package.json");
6786
+ if (!entry.isDirectory() || !existsSync(manifest)) continue;
6787
+ try {
6788
+ const { name } = JSON.parse(readFileSync(manifest, "utf8"));
6789
+ if (name) dirs.set(name, path.join(root, entry.name));
6790
+ } catch {}
6791
+ }
6792
+ }
6793
+ workspaces.set(monorepoPath, dirs);
6794
+ return dirs;
6795
+ }
6368
6796
  function buildPnpmLink(packageName, monorepoPath) {
6797
+ const dir = workspacePackages(monorepoPath).get(packageName);
6798
+ if (dir) return `link:${dir}`;
6369
6799
  const isCli = CLIS_DEPENDENCIES.includes(packageName);
6370
6800
  const isApp = APPS_DEPENDENCIES.includes(packageName);
6371
6801
  const packageDir = isCli ? "clis" : isApp ? "apps" : "packages";
@@ -6373,6 +6803,457 @@ function buildPnpmLink(packageName, monorepoPath) {
6373
6803
  return `link:${path.join(monorepoPath, packageDir, packageNameWithoutNamespace).replace("analytics-engine-", "analytics-engine/")}`;
6374
6804
  }
6375
6805
  //#endregion
6806
+ //#region connect/connect-config-schema.ts
6807
+ const IMAGE_REF = "Image reference: a project-relative file path, a URL, or a data URI.";
6808
+ const IMAGE_REF_OR_DEFAULT = "Image reference: a project-relative file path (resolved by the Connect build), a URL, or a data URI. null keeps the default.";
6809
+ /** An image reference: a project-relative file path (the Connect build turns
6810
+ * it into a data URI or an emitted file), a URL, or a data URI. */
6811
+ const connectImageRefSchema = z.string().describe(IMAGE_REF);
6812
+ /** An image reference where `null` (or omitting it) keeps the default. */
6813
+ const optionalImageRef = (description = IMAGE_REF_OR_DEFAULT) => connectImageRefSchema.nullable().optional().describe(description);
6814
+ /** An image per colour scheme: one reference for both, or `{ light, dark }`
6815
+ * (`dark` falls back to `light`). */
6816
+ const connectSchemedImageSchema = z.union([connectImageRefSchema, z.strictObject({
6817
+ light: connectImageRefSchema,
6818
+ dark: connectImageRefSchema.nullable().optional()
6819
+ })]).describe("One image for both colour schemes, or { light, dark } (dark falls back to light).");
6820
+ /** A CSS colour per colour scheme (`dark` falls back to `light`). */
6821
+ const connectSchemedColorSchema = z.union([z.string(), z.strictObject({
6822
+ light: z.string(),
6823
+ dark: z.string().nullable().optional()
6824
+ })]);
6825
+ /** A CSS length: a number is px, a string is passed through as written. */
6826
+ const connectLengthSchema = z.union([z.number(), z.string()]);
6827
+ const optionalLength = () => connectLengthSchema.nullable().optional().describe("A CSS length: a number is px; a string is used as written (\"40%\", \"min(55%, 880px)\", \"calc(50% - 120px)\").");
6828
+ /** Distances to the four edges; each is optional. */
6829
+ const connectEdgesSchema = z.strictObject({
6830
+ top: optionalLength(),
6831
+ right: optionalLength(),
6832
+ bottom: optionalLength(),
6833
+ left: optionalLength()
6834
+ });
6835
+ /** One image of a decorated pane, absolutely positioned inside it. */
6836
+ const connectBackgroundLayerSchema = z.strictObject({
6837
+ src: connectSchemedImageSchema,
6838
+ position: connectEdgesSchema.nullable().optional().describe("Distances to the pane's edges; at most one per axis. Omitted: centred both ways."),
6839
+ width: optionalLength(),
6840
+ height: optionalLength(),
6841
+ minWidth: optionalLength(),
6842
+ minHeight: optionalLength(),
6843
+ maxWidth: optionalLength(),
6844
+ maxHeight: optionalLength(),
6845
+ opacity: z.number().min(0).max(1).nullable().optional().describe("0 to 1 (default 1)."),
6846
+ fade: connectEdgesSchema.nullable().optional().describe("Feather depth per edge, fading the layer into the page colour.")
6847
+ }).describe("An image laid over the page, absolutely positioned: the edges set in `position` pin it, an axis with neither edge set is centred.");
6848
+ /** A decorated pane: the page colour and the images laid over it. */
6849
+ const connectBackgroundLayersSchema = z.strictObject({
6850
+ color: connectSchemedColorSchema.nullable().optional().describe("The page colour, or { light, dark }. Omitted or null: the theme's page background."),
6851
+ layers: z.array(connectBackgroundLayerSchema).describe("Painted in order; the first is at the back.")
6852
+ });
6853
+ /** A pane's background: layers over a page colour, or one image as
6854
+ * shorthand for a single layer pinned bottom-right. */
6855
+ const connectBackgroundSchema = z.union([connectImageRefSchema, connectBackgroundLayersSchema]).describe("Layered images over a page colour, or a single image pinned to the bottom-right corner. null keeps the default.");
6856
+ /** The loading image and the motion applied to it. */
6857
+ const connectLoaderSchema = z.strictObject({
6858
+ src: connectImageRefSchema,
6859
+ animation: z.enum([
6860
+ "pulse",
6861
+ "spin",
6862
+ "none"
6863
+ ]).nullable().optional().describe("Motion applied to the image (default pulse)."),
6864
+ size: z.number().min(16).max(512).nullable().optional().describe("Rendered width in CSS pixels (default 96); the height follows the image.")
6865
+ });
6866
+ /** `connect.branding`: Connect's identity and look. */
6867
+ const connectBrandingSchema = z.strictObject({
6868
+ appName: z.string().nullable().optional().describe("Browser tab title, installed-app name and in-app brand text. null or omitted: 'Powerhouse Connect'."),
6869
+ icon: optionalImageRef("App icon master (1024x1024 PNG recommended, or an SVG). The favicons and installed-app icons are found next to it as <name>_16x16.png, _32x32, _64x64, _192x192 and _512x512; the 64 px one is the in-app logo. null or omitted: Connect's icon."),
6870
+ favicon: z.string().nullable().optional().describe("The browser tab icon: a file (.ico, .svg or .png) relative to the project, served and built as icon.ico, or as icon.svg or icon.png for those types. A build input; the built runtime config leaves it out. `ph connect build --favicon` wins over it."),
6871
+ loader: z.union([connectImageRefSchema, connectLoaderSchema]).nullable().optional().describe("The loading image (first paint, app start, drive and editor loading). A path gets a gentle pulse; { src, animation, size } says otherwise, with animation \"none\" for an image that animates itself (animated SVG, GIF or WebP). null or omitted: Connect's animated logo.")
6872
+ }).describe("App identity and visual branding. Every field is optional; null means the default.");
6873
+ /** `connect.home`: the home screen (the generic chrome's landing page). */
6874
+ const connectHomeSchema = z.strictObject({ background: connectBackgroundSchema.nullable().optional().describe("The home screen's background: { color, layers } with each image positioned and sized, or one image pinned bottom-right. null or omitted: the bundled gradient.") }).describe("The home screen (the generic chrome's landing page).");
6875
+ const connectAppSchema = z.strictObject({
6876
+ logLevel: z.enum([
6877
+ "debug",
6878
+ "info",
6879
+ "warn",
6880
+ "error"
6881
+ ]).optional().meta({
6882
+ description: "Log level applied by Connect's logger at boot. Affects browser-side output only.",
6883
+ default: "info"
6884
+ }),
6885
+ basePath: z.string().optional().meta({
6886
+ description: "Base path Connect is mounted under (e.g. '/connect' for subpath deploys). Normalised at runtime to start and end with '/'. Defaults to the build-time BASE_URL.",
6887
+ default: "/"
6888
+ }),
6889
+ offline: z.boolean().optional().meta({
6890
+ description: "When true (default), the build emits a precaching service worker so Connect's app shell works offline, and the SPA registers it at boot. Set false to opt this deployment out: no service worker is built, the SPA skips registration, and any previously-installed worker is unregistered.",
6891
+ default: true
6892
+ }),
6893
+ studioMode: z.boolean().optional().meta({
6894
+ 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.",
6895
+ default: false
6896
+ }),
6897
+ cookieBanner: z.boolean().optional().meta({
6898
+ description: "Show the analytics cookie consent banner on a first visit, when a plugin that needs consent (Sentry, OpenPanel) is active. When false, no banner is shown and analytics consent stays rejected. `ph vetra` turns it off for its local Studio; true by default.",
6899
+ default: true
6900
+ }),
6901
+ workflowsEnabled: z.boolean().optional().describe("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.")
6902
+ }).describe("Top-level Connect application behaviour.");
6903
+ const connectAiSchema = z.strictObject({ assistantEnabled: z.boolean().optional().meta({
6904
+ description: "When true, Connect mounts the in-browser AI assistant (bottom-right chat FAB that talks to a user-configured OpenAI-compatible endpoint and acts on the reactor). Disabled by default.",
6905
+ default: false
6906
+ }) }).describe("AI assistant (chat) behaviour.");
6907
+ const connectPackagesSchema = z.strictObject({
6908
+ externalEnabled: z.boolean().optional().meta({
6909
+ description: "When false, Connect refuses to load any package that wasn't bundled at build time. Affirmative replacement for the legacy PH_CONNECT_EXTERNAL_PACKAGES_DISABLED env var.",
6910
+ default: true
6911
+ }),
6912
+ liveReload: z.boolean().optional().meta({
6913
+ description: "When true, Connect subscribes to the static-mode `/__packages` SSE channel so live publishes flow into the running tab without a page reload. Only works under hosting that serves this channel (e.g. ph-clint static mode).",
6914
+ default: false
6915
+ })
6916
+ }).describe("Runtime behaviour for the Connect package manager (separate from top-level `packages[]`, which lists which packages to load).");
6917
+ const EXPLORER_ICONS_DESCRIPTION = "The drive explorer's icons (the generic plugin's); each null keeps the built-in icon.";
6918
+ /** The drive explorer's icons: the generic chrome's, owned by the generic
6919
+ * plugin. Each `null` keeps the built-in icon. */
6920
+ const connectExplorerIconsSchema = z.strictObject({
6921
+ localDrive: optionalImageRef("Local drives without an icon of their own."),
6922
+ remoteDrive: optionalImageRef("Remote drives without an icon of their own."),
6923
+ folder: optionalImageRef("Folders."),
6924
+ document: optionalImageRef("Documents whose type has no icon in `documents`."),
6925
+ documents: z.record(z.string(), connectImageRefSchema).nullable().optional().describe("Per document type, e.g. \"acme/invoice\".")
6926
+ }).describe(EXPLORER_ICONS_DESCRIPTION);
6927
+ const connectDefaultDriveRemoteSchema = z.strictObject({
6928
+ url: z.string(),
6929
+ name: z.string().nullable().optional(),
6930
+ icon: z.string().nullable().optional()
6931
+ });
6932
+ const connectDefaultDriveLocalSchema = z.strictObject({
6933
+ local: z.literal(true).describe("Discriminator: this entry is a local drive created on first boot."),
6934
+ id: z.string().describe("Stable drive id. The drive is created with this id on first boot and is not re-created on later boots."),
6935
+ name: z.string().nullable().optional(),
6936
+ icon: z.string().nullable().optional(),
6937
+ app: z.string().optional().describe("Drive app (preferred editor) to open on the drive.")
6938
+ });
6939
+ const connectDefaultDriveSchema = z.union([connectDefaultDriveRemoteSchema, connectDefaultDriveLocalSchema]);
6940
+ /** `connect.drives.sections.{remote,local}`: three affirmative toggles. */
6941
+ const connectDriveSectionSchema = z.strictObject({
6942
+ enabled: z.boolean().optional().meta({
6943
+ description: "When false, the section is hidden in the sidebar.",
6944
+ default: true
6945
+ }),
6946
+ allowAdd: z.boolean().optional().meta({
6947
+ description: "When false, the section's 'add drive' affordance is hidden.",
6948
+ default: true
6949
+ }),
6950
+ allowDelete: z.boolean().optional().meta({
6951
+ description: "When false, drives in this section cannot be deleted from the UI.",
6952
+ default: true
6953
+ })
6954
+ }).describe("Visibility and add/delete affordances for a drive section in the sidebar.");
6955
+ const connectDriveSectionsSchema = z.strictObject({
6956
+ remote: connectDriveSectionSchema.optional(),
6957
+ local: connectDriveSectionSchema.optional()
6958
+ }).describe("Per-section visibility and affordance toggles. `remote` covers what was historically split into 'public' + 'cloud'; `local` is browser-local drives.");
6959
+ /** Mirrors DRIVES_PRESERVE_STRATEGIES (../clis/constants.ts, which imports
6960
+ * node: modules, so it is not imported here); a test pins the two. */
6961
+ const connectDrivePreserveStrategySchema = z.enum(["preserve-all", "preserve-by-url-and-detach"]);
6962
+ const connectDrivesSchema = z.strictObject({
6963
+ allowAddDrive: z.boolean().optional().meta({
6964
+ description: "When false, the SPA hides the 'add drive' affordance entirely (top-level). Per-section overrides live in `sections.{remote,local}.allowAdd`.",
6965
+ default: true
6966
+ }),
6967
+ defaultDrives: z.array(connectDefaultDriveSchema).optional().meta({
6968
+ description: "Drives the SPA auto-connects to on first load. Each entry is either a remote drive (a URL, with optional name/icon overrides) or a local drive (created locally on first boot, with a stable id and optional name/icon/app).",
6969
+ default: []
6970
+ }),
6971
+ preserveStrategy: connectDrivePreserveStrategySchema.optional().describe("Strategy applied when defaultDrives change between deploys. 'preserve-all' keeps user-added drives untouched; 'preserve-by-url-and-detach' detaches removed default drives. No schema default — opt-in only."),
6972
+ sections: connectDriveSectionsSchema.optional(),
6973
+ icons: connectExplorerIconsSchema.nullable().optional().describe(EXPLORER_ICONS_DESCRIPTION)
6974
+ }).describe("Default-drive and add-drive UI behaviour.");
6975
+ const connectRenownRainbowAdapterSchema = z.strictObject({
6976
+ walletConnectProjectId: z.string().optional().describe("WalletConnect project id; required for this adapter to function."),
6977
+ infuraProjectId: z.string().optional().describe("Optional Infura project id used to build RPC transports.")
6978
+ }).describe("wagmi + RainbowKit external-wallet adapter config.");
6979
+ const connectRenownPrivyAdapterSchema = z.strictObject({
6980
+ appId: z.string().optional().describe("Privy application id; required for this adapter to function."),
6981
+ clientId: z.string().optional().describe("Optional Privy client id."),
6982
+ methods: z.array(z.string()).optional().describe("Login methods this adapter offers; default per adapter when omitted.")
6983
+ }).describe("Privy embedded/social adapter config.");
6984
+ const connectRenownAdaptersSchema = z.strictObject({
6985
+ rainbow: connectRenownRainbowAdapterSchema.optional(),
6986
+ privy: connectRenownPrivyAdapterSchema.optional()
6987
+ }).describe("Per-adapter wallet config for in-page auth. Presence of an adapter key enables it; omit or leave empty for redirect-only behaviour.");
6988
+ const connectRenownSchema = z.strictObject({
6989
+ url: z.string().optional().meta({
6990
+ description: "Renown auth service URL.",
6991
+ default: "https://www.renown.id"
6992
+ }),
6993
+ networkId: z.string().optional().meta({
6994
+ description: "CAIP-2 network namespace (e.g. 'eip155').",
6995
+ default: "eip155"
6996
+ }),
6997
+ chainId: z.number().optional().meta({
6998
+ description: "CAIP-2 chain reference within the network namespace.",
6999
+ default: 1
7000
+ }),
7001
+ namespace: z.string().optional().describe("Renown localStorage namespace; share it across Connects to share login."),
7002
+ switchboardUrl: z.string().optional().describe("Switchboard GraphQL URL. When set, Connect enables in-page (no-redirect) Renown sign-in; otherwise it falls back to the redirect flow via `url`."),
7003
+ adapters: connectRenownAdaptersSchema.optional()
7004
+ }).describe("Renown identity / authentication coordinates.");
7005
+ const connectSentrySchema = z.strictObject({
7006
+ dsn: z.string().nullable().optional().meta({
7007
+ description: "Sentry DSN URL. `null` disables Sentry entirely; the SPA never loads the Sentry SDK chunk.",
7008
+ default: null
7009
+ }),
7010
+ env: z.string().optional().meta({
7011
+ description: "Sentry environment label, surfaced as the `environment` tag on every event.",
7012
+ default: "dev"
7013
+ }),
7014
+ tracing: z.boolean().optional().meta({
7015
+ description: "Enable Sentry performance tracing.",
7016
+ default: false
7017
+ })
7018
+ }).describe("Sentry error-tracking coordinates. Set `dsn` to enable Sentry; leave `dsn` null to disable. The Sentry release tag stays build-time (stamped via Vite's `define` from WORKSPACE_VERSION) so it always matches the sourcemaps uploaded by CI.");
7019
+ const connectOpenPanelSchema = z.strictObject({
7020
+ clientId: z.string().optional().meta({
7021
+ description: "OpenPanel client id. Empty string disables OpenPanel entirely.",
7022
+ default: ""
7023
+ }),
7024
+ apiUrl: z.string().optional().describe("OpenPanel API URL for self-hosted instances (e.g. 'https://openpanel.example/api'). Omit to use OpenPanel's hosted API."),
7025
+ trackUiEvents: z.boolean().optional().meta({
7026
+ description: "Track UI events.",
7027
+ default: true
7028
+ }),
7029
+ trackOperations: z.boolean().optional().meta({
7030
+ description: "Track document operations.",
7031
+ default: true
7032
+ })
7033
+ }).describe("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.");
7034
+ /** Which reactor client Connect runs (see PHReactorClientMode). */
7035
+ const connectReactorClientModeSchema = z.enum([
7036
+ "in-process",
7037
+ "worker",
7038
+ "remote",
7039
+ "router"
7040
+ ]);
7041
+ const connectInstanceSchema = z.strictObject({
7042
+ namespace: z.string().nullable().meta({
7043
+ description: "Explicit storage/SharedWorker namespace for this instance. `null` derives it from the base path (and, later, the configured endpoint), so root deployments stay byte-identical.",
7044
+ default: null
7045
+ }),
7046
+ reactorWorker: z.boolean().meta({
7047
+ 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.",
7048
+ default: false
7049
+ }),
7050
+ multiReactor: z.boolean().optional().meta({
7051
+ 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.",
7052
+ default: false
7053
+ })
7054
+ }).describe("Per-instance identity. Lets one origin host multiple isolated Connect instances, each with its own storage + SharedWorker namespace.");
7055
+ const connectReactorFeatureFlagsSchema = z.strictObject({
7056
+ documentDecisions: z.boolean().optional().meta({
7057
+ description: "Decide writes from the document stream rather than the document meta cache, so a backdated deletion denies the operations that sort after it.",
7058
+ default: false
7059
+ }),
7060
+ authEnforcement: z.boolean().optional().meta({
7061
+ description: "Enforce the auth scope's policy at admission, replay, and read. Requires documentDecisions.",
7062
+ default: false
7063
+ }),
7064
+ authGroups: z.boolean().optional().meta({
7065
+ description: "Let `{ group }` principals match against the rosters of the group documents a policy names. Requires authEnforcement.",
7066
+ default: false
7067
+ }),
7068
+ authConditions: z.boolean().optional().meta({
7069
+ description: "Evaluate `where` and `match` conditions on grants. Requires authGroups. Do not enable on a fleet `preflight:auth` reports as crossing a reducer version.",
7070
+ default: false
7071
+ }),
7072
+ undoV3: z.boolean().optional().meta({ description: "Support base-reducer 3 (id-targeted undo), which new documents then take. A peer without it is held from base-reducer 3 documents until it upgrades. Unset leaves the reactor's default." })
7073
+ }).describe("Reactor feature flags. The four enforcement flags each imply their predecessors, and the reactor refuses to boot on a set that names a later one without an earlier one. They are consensus settings: a Connect syncing with a fleet must carry the same enforcement flags the fleet does, or the two reach different replay outcomes for the same history and diverge. undoV3 has no prerequisites; peers negotiate it.");
7074
+ const connectReactorSchema = z.strictObject({
7075
+ featureFlags: connectReactorFeatureFlagsSchema.optional(),
7076
+ createSignaturePolicy: z.enum(["legacy", "v2-required"]).optional().meta({
7077
+ 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.",
7078
+ default: "v2-required"
7079
+ }),
7080
+ unsupportedStoredDocuments: z.enum(["refuse", "read-only"]).optional().meta({
7081
+ 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.",
7082
+ default: "refuse"
7083
+ })
7084
+ }).describe("Settings for the reactor Connect runs in the browser, on the main thread or in the shared worker alike.");
7085
+ /** A runtime-caching / denylist URL match. A string is handed to Workbox
7086
+ * verbatim; `{ source, flags }` is rebuilt into a RegExp at build time. */
7087
+ const connectPwaUrlPatternSchema = z.union([z.string(), z.strictObject({
7088
+ source: z.string().describe("RegExp source."),
7089
+ flags: z.string().optional().describe("RegExp flags (e.g. 'i').")
7090
+ }).refine((p) => {
7091
+ try {
7092
+ new RegExp(p.source, p.flags);
7093
+ return true;
7094
+ } catch {
7095
+ return false;
7096
+ }
7097
+ }, { message: "source/flags do not compile to a valid RegExp" })]).describe("URL match. A string is matched verbatim by Workbox; { source, flags } is rebuilt into a RegExp at build time.");
7098
+ const connectPwaCacheStrategySchema = z.enum([
7099
+ "CacheFirst",
7100
+ "CacheOnly",
7101
+ "NetworkFirst",
7102
+ "NetworkOnly",
7103
+ "StaleWhileRevalidate"
7104
+ ]);
7105
+ /** Serialisable subset of a Workbox `RuntimeCaching` rule. */
7106
+ const connectPwaRuntimeCachingSchema = z.strictObject({
7107
+ urlPattern: connectPwaUrlPatternSchema,
7108
+ handler: connectPwaCacheStrategySchema,
7109
+ method: z.enum([
7110
+ "GET",
7111
+ "POST",
7112
+ "PUT",
7113
+ "DELETE",
7114
+ "HEAD",
7115
+ "PATCH"
7116
+ ]).optional(),
7117
+ options: z.strictObject({
7118
+ cacheName: z.string().optional(),
7119
+ networkTimeoutSeconds: z.number().optional().describe("Seconds a NetworkFirst rule waits for the network before falling back to the cache."),
7120
+ expiration: z.strictObject({
7121
+ maxEntries: z.number().optional(),
7122
+ maxAgeSeconds: z.number().optional()
7123
+ }).optional(),
7124
+ cacheableResponse: z.strictObject({
7125
+ statuses: z.array(z.number()).optional(),
7126
+ headers: z.record(z.string(), z.string()).optional()
7127
+ }).optional()
7128
+ }).optional()
7129
+ });
7130
+ const connectPwaIconSchema = z.strictObject({
7131
+ src: z.string(),
7132
+ sizes: z.string().optional(),
7133
+ type: z.string().optional(),
7134
+ purpose: z.string().optional()
7135
+ });
7136
+ /** A File Handling API entry. No `action`: every handler opens at Connect's
7137
+ * app root, because consuming launched files needs Connect's own code. */
7138
+ const connectPwaFileHandlerSchema = z.strictObject({
7139
+ accept: z.record(z.string(), z.array(z.string().regex(/^\./, "file extensions must start with '.'"))).describe("MIME type → file extensions. Each extension must start with '.'; browsers ignore entries without it."),
7140
+ icons: z.array(connectPwaIconSchema).optional().describe("OS-level file-type icons."),
7141
+ launch_type: z.enum(["single-client", "multiple-clients"]).optional()
7142
+ });
7143
+ /** Web-app-manifest fields a package or project may override. */
7144
+ const connectPwaManifestSchema = z.strictObject({
7145
+ name: z.string().optional(),
7146
+ short_name: z.string().optional(),
7147
+ description: z.string().optional(),
7148
+ theme_color: z.string().optional(),
7149
+ background_color: z.string().optional(),
7150
+ display: z.enum([
7151
+ "fullscreen",
7152
+ "standalone",
7153
+ "minimal-ui",
7154
+ "browser"
7155
+ ]).optional(),
7156
+ start_url: z.string().optional(),
7157
+ scope: z.string().optional(),
7158
+ icons: z.array(connectPwaIconSchema).optional().describe("Icons appended to the built-in set and de-duplicated by (src, sizes, purpose)."),
7159
+ file_handlers: z.array(connectPwaFileHandlerSchema).optional().describe("File associations appended after Connect's built-in .phd/.phdm handler and de-duplicated on the whole entry. Entries only declare accepted types; there is no action field, because opening the files requires Connect's own runtime handling, so every handler opens at the app root."),
7160
+ launch_handler: z.strictObject({ client_mode: z.enum([
7161
+ "auto",
7162
+ "focus-existing",
7163
+ "navigate-existing",
7164
+ "navigate-new"
7165
+ ]) }).optional().describe("How the OS launches the app for handled files/links. Connect defaults to focus-existing.")
7166
+ }).describe("Web-app-manifest field overrides.");
7167
+ const pwaShape = {
7168
+ globPatterns: z.array(z.string()).optional().describe("Extra Workbox precache globs, unioned with the built-ins."),
7169
+ globIgnores: z.array(z.string()).optional().describe("Extra precache ignore globs, unioned with the built-ins."),
7170
+ maximumFileSizeToCacheInBytes: z.number().optional().describe("Raise the precache file-size ceiling. The max across all contributors wins, so no contributor can shrink another's limit."),
7171
+ runtimeCaching: z.array(connectPwaRuntimeCachingSchema).optional().describe("Runtime-caching rules appended after the built-in rules. Workbox is first-match-wins, so these cannot override a built-in rule matching the same URL."),
7172
+ navigateFallbackDenylist: z.array(connectPwaUrlPatternSchema).optional().describe("Extra SPA navigate-fallback denylist patterns, unioned with the built-ins.")
7173
+ };
7174
+ const PWA_DESCRIPTION = "Progressive-web-app / service-worker overrides, layered on Connect's built-in PWA defaults at build time. Scalar fields deep-merge (this layer wins); the array members (icons, file_handlers, globs, runtimeCaching and denylist patterns) are additive; maximumFileSizeToCacheInBytes takes the max across contributors. (categories is not set here — it is derived from the manifest's category field.) Only applied when connect.app.offline is true.";
7175
+ /** `connect.pwa` as authored. */
7176
+ const connectPwaSchema = z.strictObject({
7177
+ manifest: connectPwaManifestSchema.optional(),
7178
+ ...pwaShape
7179
+ }).describe(PWA_DESCRIPTION);
7180
+ /**
7181
+ * The `connect` block as authored: powerhouse.config.json's `connect`, the
7182
+ * connect host's `config`, and `ph connect config` writes. Every field is
7183
+ * optional; omit the section entirely for default behaviour.
7184
+ */
7185
+ const connectConfigSchema = z.strictObject({
7186
+ branding: connectBrandingSchema.optional(),
7187
+ home: connectHomeSchema.optional(),
7188
+ app: connectAppSchema.optional(),
7189
+ ai: connectAiSchema.optional(),
7190
+ packages: connectPackagesSchema.optional(),
7191
+ drives: connectDrivesSchema.optional(),
7192
+ renown: connectRenownSchema.optional(),
7193
+ sentry: connectSentrySchema.optional(),
7194
+ openPanel: connectOpenPanelSchema.optional(),
7195
+ instance: connectInstanceSchema.optional(),
7196
+ reactor: connectReactorSchema.optional(),
7197
+ pwa: connectPwaSchema.optional()
7198
+ }).describe("Connect-specific UI customisations. All fields optional; omit the section entirely for default behaviour.");
7199
+ /** `schema` carrying `source`'s description and meta (zod keeps them per
7200
+ * instance, so `.extend()` and a rebuilt field drop them). */
7201
+ function withMetaOf(schema, source) {
7202
+ const meta = source.meta();
7203
+ return meta ? schema.meta(meta) : schema;
7204
+ }
7205
+ /** One entry of the host.js composition, projected into the served config as
7206
+ * data (module specifier + validated config). */
7207
+ const connectCompositionEntrySchema = z.strictObject({
7208
+ module: z.string(),
7209
+ config: z.record(z.string(), z.unknown()).optional()
7210
+ });
7211
+ /** A switchboard Connect routes to, from one of the host's remote backends. */
7212
+ const connectRemoteBackendSchema = z.strictObject({
7213
+ name: z.string().min(1).describe("The backend's key in the host config."),
7214
+ url: z.string().describe("A drive address on the switchboard: <switchboard>/d/<slug>."),
7215
+ requestTimeoutMs: z.number().int().positive().optional().describe("Give up on one request after this long. Default 30000."),
7216
+ breaker: z.union([z.literal(false), z.strictObject({
7217
+ failures: z.number().int().min(1).optional(),
7218
+ openMs: z.number().int().nonnegative().optional()
7219
+ })]).optional().describe("After `failures` failed requests in a row, send nothing for `openMs`. false: never stop trying."),
7220
+ realtime: z.boolean().optional().describe("Live updates over a socket. Default true.")
7221
+ });
7222
+ /** The router settings a host sets for Connect. */
7223
+ const connectRouterSettingsSchema = z.strictObject({
7224
+ newDrives: z.string().min(1).optional().describe("The remoteBackends[].name new drives are created on, with no copy in this browser. Absent: the browser reactor, else the only switchboard."),
7225
+ probeTimeoutMs: z.number().int().nonnegative().optional(),
7226
+ provisionalRouteMs: z.number().int().nonnegative().optional()
7227
+ });
7228
+ /** `sync: false` keeps no copy in this browser; unset means true. */
7229
+ const connectCollectionSchema = z.strictObject({
7230
+ backend: z.string().min(1),
7231
+ sync: z.boolean().optional()
7232
+ });
7233
+ /** `collections` holds placed drives that are not default drives, keyed by declared slug. */
7234
+ const connectRuntimeInstanceSchema = connectInstanceSchema.extend({
7235
+ reactorClient: connectReactorClientModeSchema.optional(),
7236
+ remoteBackends: z.array(connectRemoteBackendSchema).optional(),
7237
+ collections: z.record(z.string(), connectCollectionSchema).optional(),
7238
+ router: connectRouterSettingsSchema.optional()
7239
+ });
7240
+ /** A remote default drive plus the backend serving it. */
7241
+ const connectRuntimeDefaultDriveRemoteSchema = connectDefaultDriveRemoteSchema.extend({
7242
+ backend: z.string().min(1).optional(),
7243
+ sync: z.boolean().optional()
7244
+ });
7245
+ const connectRuntimeDefaultDriveSchema = z.union([connectRuntimeDefaultDriveRemoteSchema, connectDefaultDriveLocalSchema]);
7246
+ const connectRuntimeDrivesSchema = withMetaOf(connectDrivesSchema.extend({ defaultDrives: withMetaOf(z.array(connectRuntimeDefaultDriveSchema).optional(), connectDrivesSchema.shape.defaultDrives) }), connectDrivesSchema);
7247
+ /** The manifest plus `categories`, derived from contributors' `category`. */
7248
+ const connectRuntimePwaManifestSchema = connectPwaManifestSchema.extend({ categories: z.array(z.string()).optional() });
7249
+ const connectRuntimePwaSchema = connectPwaSchema.extend({ manifest: connectRuntimePwaManifestSchema.optional() });
7250
+ connectConfigSchema.extend({
7251
+ composition: z.array(connectCompositionEntrySchema).optional(),
7252
+ drives: connectRuntimeDrivesSchema.optional(),
7253
+ instance: connectRuntimeInstanceSchema.optional(),
7254
+ pwa: connectRuntimePwaSchema.optional()
7255
+ });
7256
+ //#endregion
6376
7257
  //#region connect/schema-fragments.ts
6377
7258
  const powerhousePackageSchema = {
6378
7259
  type: "object",
@@ -6403,512 +7284,93 @@ const powerhousePackageSchema = {
6403
7284
  }
6404
7285
  }
6405
7286
  };
6406
- const driveSectionSchema = {
7287
+ /** Emits a zod schema as a draft-07 fragment: input shape, no `$schema`. */
7288
+ function emitJsonSchemaFragment(schema) {
7289
+ const { $schema: _, ...fragment } = toJSONSchema(schema, {
7290
+ target: "draft-7",
7291
+ io: "input",
7292
+ unrepresentable: "throw"
7293
+ });
7294
+ return fragment;
7295
+ }
7296
+ /** The authored `connect` block, as validated by Ajv. */
7297
+ const phConnectRuntimeConfigSchema = /* @__PURE__ */ emitJsonSchemaFragment(connectConfigSchema);
7298
+ //#endregion
7299
+ //#region clis/source-config-schema.ts
7300
+ const keyframeRuleSchema = {
6407
7301
  type: "object",
6408
7302
  additionalProperties: false,
6409
- description: "Visibility and add/delete affordances for a drive section in the sidebar.",
6410
7303
  properties: {
6411
- enabled: {
6412
- type: "boolean",
6413
- description: "When false, the section is hidden in the sidebar.",
6414
- default: true
7304
+ interval: {
7305
+ type: "integer",
7306
+ minimum: 1,
7307
+ description: "Write a keyframe every N revisions."
6415
7308
  },
6416
- allowAdd: {
6417
- type: "boolean",
6418
- description: "When false, the section's 'add drive' affordance is hidden.",
6419
- default: true
6420
- },
6421
- allowDelete: {
6422
- type: "boolean",
6423
- description: "When false, drives in this section cannot be deleted from the UI.",
6424
- default: true
7309
+ keep: {
7310
+ type: ["integer", "null"],
7311
+ minimum: 1,
7312
+ description: "Keyframes kept per document stream, newest first; null keeps them all."
6425
7313
  }
6426
7314
  }
6427
7315
  };
6428
- const pwaUrlPatternSchema = {
6429
- description: "URL match. A string is matched verbatim by Workbox; { source, flags } is rebuilt into a RegExp at build time.",
6430
- oneOf: [{ type: "string" }, {
7316
+ const definitionSourceFormatVersionSchema = {
7317
+ const: 1,
7318
+ description: "Definition-source format version. Only 1 is supported."
7319
+ };
7320
+ const definitionSourcesSchema = {
7321
+ type: "object",
7322
+ description: "Experimental. How this package authors its document models. Without it, `ph generate` uses the default authoring mode.",
7323
+ oneOf: [{
6431
7324
  type: "object",
6432
7325
  additionalProperties: false,
6433
- required: ["source"],
7326
+ required: [
7327
+ "formatVersion",
7328
+ "mode",
7329
+ "entries"
7330
+ ],
7331
+ description: "Code-first: the listed TypeScript modules declare the package's document models.",
6434
7332
  properties: {
6435
- source: {
6436
- type: "string",
6437
- description: "RegExp source."
7333
+ formatVersion: definitionSourceFormatVersionSchema,
7334
+ mode: {
7335
+ const: "code-first",
7336
+ description: "This package declares its models in TypeScript."
6438
7337
  },
6439
- flags: {
6440
- type: "string",
6441
- description: "RegExp flags (e.g. 'i')."
6442
- }
6443
- }
6444
- }]
6445
- };
6446
- const pwaIconSchema = {
6447
- type: "object",
6448
- additionalProperties: false,
6449
- required: ["src"],
6450
- properties: {
6451
- src: { type: "string" },
6452
- sizes: { type: "string" },
6453
- type: { type: "string" },
6454
- purpose: { type: "string" }
6455
- }
6456
- };
6457
- const phConnectRuntimeConfigSchema = {
6458
- type: "object",
6459
- additionalProperties: false,
6460
- description: "Connect-specific UI customisations. All fields optional; omit the section entirely for default behaviour.",
6461
- properties: {
6462
- branding: {
6463
- type: "object",
6464
- additionalProperties: false,
6465
- description: "App identity and visual branding.",
6466
- properties: {
6467
- appName: {
6468
- type: "string",
6469
- description: "Browser tab title and any in-app brand text. Defaults to 'Powerhouse Connect'."
6470
- },
6471
- homeBackground: {
6472
- type: ["string", "null"],
6473
- description: "Hero image on the empty home screen. URL or path to override; null or omitted uses the bundled default image."
6474
- }
6475
- }
6476
- },
6477
- app: {
6478
- type: "object",
6479
- additionalProperties: false,
6480
- description: "Top-level Connect application behaviour.",
6481
- properties: {
6482
- logLevel: {
6483
- type: "string",
6484
- enum: [
6485
- "debug",
6486
- "info",
6487
- "warn",
6488
- "error"
6489
- ],
6490
- description: "Log level applied by Connect's logger at boot. Affects browser-side output only.",
6491
- default: "info"
6492
- },
6493
- basePath: {
6494
- type: "string",
6495
- description: "Base path Connect is mounted under (e.g. '/connect' for subpath deploys). Normalised at runtime to start and end with '/'. Defaults to the build-time BASE_URL.",
6496
- default: "/"
6497
- },
6498
- offline: {
6499
- type: "boolean",
6500
- description: "When true (default), the build emits a precaching service worker so Connect's app shell works offline, and the SPA registers it at boot. Set false to opt this deployment out: no service worker is built, the SPA skips registration, and any previously-installed worker is unregistered.",
6501
- default: true
6502
- },
6503
- studioMode: {
6504
- type: "boolean",
6505
- 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.",
6506
- default: false
6507
- }
6508
- }
6509
- },
6510
- ai: {
6511
- type: "object",
6512
- additionalProperties: false,
6513
- description: "AI assistant (chat) behaviour.",
6514
- properties: { assistantEnabled: {
6515
- type: "boolean",
6516
- description: "When true, Connect mounts the in-browser AI assistant (bottom-right chat FAB that talks to a user-configured OpenAI-compatible endpoint and acts on the reactor). Disabled by default.",
6517
- default: false
6518
- } }
6519
- },
6520
- packages: {
6521
- type: "object",
6522
- additionalProperties: false,
6523
- description: "Runtime behaviour for the Connect package manager (separate from top-level `packages[]`, which lists which packages to load).",
6524
- properties: {
6525
- externalEnabled: {
6526
- type: "boolean",
6527
- description: "When false, Connect refuses to load any package that wasn't bundled at build time. Affirmative replacement for the legacy PH_CONNECT_EXTERNAL_PACKAGES_DISABLED env var.",
6528
- default: true
6529
- },
6530
- liveReload: {
6531
- type: "boolean",
6532
- description: "When true, Connect subscribes to the static-mode `/__packages` SSE channel so live publishes flow into the running tab without a page reload. Only works under hosting that serves this channel (e.g. ph-clint static mode).",
6533
- default: false
6534
- }
6535
- }
6536
- },
6537
- drives: {
6538
- type: "object",
6539
- additionalProperties: false,
6540
- description: "Default-drive and add-drive UI behaviour.",
6541
- properties: {
6542
- allowAddDrive: {
6543
- type: "boolean",
6544
- description: "When false, the SPA hides the 'add drive' affordance entirely (top-level). Per-section overrides live in `sections.{remote,local}.allowAdd`.",
6545
- default: true
6546
- },
6547
- defaultDrives: {
6548
- type: "array",
6549
- description: "Drives the SPA auto-connects to on first load. Each entry is either a remote drive (a URL, with optional name/icon overrides) or a local drive (created locally on first boot, with a stable id and optional name/icon/app).",
6550
- default: [],
6551
- items: { oneOf: [{
6552
- type: "object",
6553
- additionalProperties: false,
6554
- required: ["url"],
6555
- properties: {
6556
- url: { type: "string" },
6557
- name: { type: ["string", "null"] },
6558
- icon: { type: ["string", "null"] }
6559
- }
6560
- }, {
6561
- type: "object",
6562
- additionalProperties: false,
6563
- required: ["local", "id"],
6564
- properties: {
6565
- local: {
6566
- const: true,
6567
- description: "Discriminator: this entry is a local drive created on first boot."
6568
- },
6569
- id: {
6570
- type: "string",
6571
- description: "Stable drive id. The drive is created with this id on first boot and is not re-created on later boots."
6572
- },
6573
- name: { type: ["string", "null"] },
6574
- icon: { type: ["string", "null"] },
6575
- app: {
6576
- type: "string",
6577
- description: "Drive app (preferred editor) to open on the drive."
6578
- }
6579
- }
6580
- }] }
6581
- },
6582
- preserveStrategy: {
6583
- type: "string",
6584
- enum: ["preserve-all", "preserve-by-url-and-detach"],
6585
- description: "Strategy applied when defaultDrives change between deploys. 'preserve-all' keeps user-added drives untouched; 'preserve-by-url-and-detach' detaches removed default drives. No schema default — opt-in only."
6586
- },
6587
- sections: {
6588
- type: "object",
6589
- additionalProperties: false,
6590
- description: "Per-section visibility and affordance toggles. `remote` covers what was historically split into 'public' + 'cloud'; `local` is browser-local drives.",
6591
- properties: {
6592
- remote: driveSectionSchema,
6593
- local: driveSectionSchema
6594
- }
6595
- }
6596
- }
6597
- },
6598
- renown: {
6599
- type: "object",
6600
- additionalProperties: false,
6601
- description: "Renown identity / authentication coordinates.",
6602
- properties: {
6603
- url: {
6604
- type: "string",
6605
- description: "Renown auth service URL.",
6606
- default: "https://www.renown.id"
6607
- },
6608
- networkId: {
6609
- type: "string",
6610
- description: "CAIP-2 network namespace (e.g. 'eip155').",
6611
- default: "eip155"
6612
- },
6613
- chainId: {
6614
- type: "number",
6615
- description: "CAIP-2 chain reference within the network namespace.",
6616
- default: 1
6617
- },
6618
- namespace: {
6619
- type: "string",
6620
- description: "Renown localStorage namespace; share it across Connects to share login."
6621
- },
6622
- switchboardUrl: {
6623
- type: "string",
6624
- description: "Switchboard GraphQL URL. When set, Connect enables in-page (no-redirect) Renown sign-in; otherwise it falls back to the redirect flow via `url`."
6625
- },
6626
- adapters: {
7338
+ entries: {
7339
+ type: "array",
7340
+ description: "The modules that declare code-first definitions. `ph generate` adds the entry of each model it scaffolds.",
7341
+ items: {
6627
7342
  type: "object",
6628
7343
  additionalProperties: false,
6629
- description: "Per-adapter wallet config for in-page auth. Presence of an adapter key enables it; omit or leave empty for redirect-only behaviour.",
7344
+ required: ["specifier"],
6630
7345
  properties: {
6631
- rainbow: {
6632
- type: "object",
6633
- additionalProperties: false,
6634
- description: "wagmi + RainbowKit external-wallet adapter config.",
6635
- properties: {
6636
- walletConnectProjectId: {
6637
- type: "string",
6638
- description: "WalletConnect project id; required for this adapter to function."
6639
- },
6640
- infuraProjectId: {
6641
- type: "string",
6642
- description: "Optional Infura project id used to build RPC transports."
6643
- }
6644
- }
6645
- },
6646
- privy: {
6647
- type: "object",
6648
- additionalProperties: false,
6649
- description: "Privy embedded/social adapter config.",
6650
- properties: {
6651
- appId: {
6652
- type: "string",
6653
- description: "Privy application id; required for this adapter to function."
6654
- },
6655
- clientId: {
6656
- type: "string",
6657
- description: "Optional Privy client id."
6658
- },
6659
- methods: {
6660
- type: "array",
6661
- description: "Login methods this adapter offers; default per adapter when omitted.",
6662
- items: { type: "string" }
6663
- }
6664
- }
6665
- }
6666
- }
6667
- }
6668
- }
6669
- },
6670
- sentry: {
6671
- type: "object",
6672
- additionalProperties: false,
6673
- description: "Sentry error-tracking coordinates. Set `dsn` to enable Sentry; leave `dsn` null to disable. The Sentry release tag stays build-time (stamped via Vite's `define` from WORKSPACE_VERSION) so it always matches the sourcemaps uploaded by CI.",
6674
- properties: {
6675
- dsn: {
6676
- type: ["string", "null"],
6677
- description: "Sentry DSN URL. `null` disables Sentry entirely; the SPA never loads the Sentry SDK chunk.",
6678
- default: null
6679
- },
6680
- env: {
6681
- type: "string",
6682
- description: "Sentry environment label, surfaced as the `environment` tag on every event.",
6683
- default: "dev"
6684
- },
6685
- tracing: {
6686
- type: "boolean",
6687
- description: "Enable Sentry performance tracing.",
6688
- default: false
6689
- }
6690
- }
6691
- },
6692
- instance: {
6693
- type: "object",
6694
- additionalProperties: false,
6695
- required: ["namespace", "reactorWorker"],
6696
- description: "Per-instance identity. Lets one origin host multiple isolated Connect instances, each with its own storage + SharedWorker namespace.",
6697
- properties: {
6698
- namespace: {
6699
- type: ["string", "null"],
6700
- description: "Explicit storage/SharedWorker namespace for this instance. `null` derives it from the base path (and, later, the configured endpoint), so root deployments stay byte-identical.",
6701
- default: null
6702
- },
6703
- reactorWorker: {
6704
- type: "boolean",
6705
- 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.",
6706
- default: false
6707
- }
6708
- }
6709
- },
6710
- reactor: {
6711
- type: "object",
6712
- additionalProperties: false,
6713
- description: "Settings for the reactor Connect runs in the browser, on the main thread or in the shared worker alike.",
6714
- properties: { featureFlags: {
6715
- type: "object",
6716
- additionalProperties: false,
6717
- 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.",
6718
- properties: {
6719
- documentDecisions: {
6720
- type: "boolean",
6721
- description: "Decide writes from the document stream rather than the document meta cache, so a backdated deletion denies the operations that sort after it.",
6722
- default: false
6723
- },
6724
- authEnforcement: {
6725
- type: "boolean",
6726
- description: "Enforce the auth scope's policy at admission, replay, and read. Requires documentDecisions.",
6727
- default: false
6728
- },
6729
- authGroups: {
6730
- type: "boolean",
6731
- description: "Let `{ group }` principals match against the rosters of the group documents a policy names. Requires authEnforcement.",
6732
- default: false
6733
- },
6734
- authConditions: {
6735
- type: "boolean",
6736
- description: "Evaluate `where` and `match` conditions on grants. Requires authGroups. Do not enable on a fleet `preflight:auth` reports as crossing a reducer version.",
6737
- default: false
6738
- }
6739
- }
6740
- } }
6741
- },
6742
- pwa: {
6743
- type: "object",
6744
- additionalProperties: false,
6745
- description: "Progressive-web-app / service-worker overrides, layered on Connect's built-in PWA defaults at build time. Scalar fields deep-merge (this layer wins); the array members (icons, file_handlers, globs, runtimeCaching and denylist patterns) are additive; maximumFileSizeToCacheInBytes takes the max across contributors. (categories is not set here — it is derived from the manifest's category field.) Only applied when connect.app.offline is true.",
6746
- properties: {
6747
- manifest: {
6748
- type: "object",
6749
- additionalProperties: false,
6750
- description: "Web-app-manifest field overrides.",
6751
- properties: {
6752
- name: { type: "string" },
6753
- short_name: { type: "string" },
6754
- description: { type: "string" },
6755
- theme_color: { type: "string" },
6756
- background_color: { type: "string" },
6757
- display: {
7346
+ specifier: {
6758
7347
  type: "string",
6759
- enum: [
6760
- "fullscreen",
6761
- "standalone",
6762
- "minimal-ui",
6763
- "browser"
6764
- ]
6765
- },
6766
- start_url: { type: "string" },
6767
- scope: { type: "string" },
6768
- icons: {
6769
- type: "array",
6770
- description: "Icons appended to the built-in set and de-duplicated by (src, sizes, purpose).",
6771
- items: pwaIconSchema
7348
+ pattern: "^\\./.*\\.(?:[cm]?[jt]s|[jt]sx)$",
7349
+ description: "POSIX package-relative module path beginning with './'. It may not leave the package root."
6772
7350
  },
6773
- file_handlers: {
7351
+ exportPath: {
6774
7352
  type: "array",
6775
- description: "File associations appended after Connect's built-in .phd/.phdm handler and de-duplicated on the whole entry. Entries only declare accepted types; there is no action field, because opening the files requires Connect's own runtime handling, so every handler opens at the app root.",
6776
- items: {
6777
- type: "object",
6778
- additionalProperties: false,
6779
- required: ["accept"],
6780
- properties: {
6781
- accept: {
6782
- type: "object",
6783
- description: "MIME type → file extensions. Each extension must start with '.'; browsers ignore entries without it.",
6784
- additionalProperties: {
6785
- type: "array",
6786
- items: {
6787
- type: "string",
6788
- pattern: "^\\."
6789
- }
6790
- }
6791
- },
6792
- icons: {
6793
- type: "array",
6794
- description: "OS-level file-type icons.",
6795
- items: pwaIconSchema
6796
- },
6797
- launch_type: {
6798
- type: "string",
6799
- enum: ["single-client", "multiple-clients"]
6800
- }
6801
- }
6802
- }
6803
- },
6804
- launch_handler: {
6805
- type: "object",
6806
- additionalProperties: false,
6807
- required: ["client_mode"],
6808
- description: "How the OS launches the app for handled files/links. Connect defaults to focus-existing.",
6809
- properties: { client_mode: {
6810
- type: "string",
6811
- enum: [
6812
- "auto",
6813
- "focus-existing",
6814
- "navigate-existing",
6815
- "navigate-new"
6816
- ]
6817
- } }
6818
- }
6819
- }
6820
- },
6821
- globPatterns: {
6822
- type: "array",
6823
- items: { type: "string" },
6824
- description: "Extra Workbox precache globs, unioned with the built-ins."
6825
- },
6826
- globIgnores: {
6827
- type: "array",
6828
- items: { type: "string" },
6829
- description: "Extra precache ignore globs, unioned with the built-ins."
6830
- },
6831
- maximumFileSizeToCacheInBytes: {
6832
- type: "number",
6833
- description: "Raise the precache file-size ceiling. The max across all contributors wins, so no contributor can shrink another's limit."
6834
- },
6835
- runtimeCaching: {
6836
- type: "array",
6837
- description: "Runtime-caching rules appended after the built-in rules. Workbox is first-match-wins, so these cannot override a built-in rule matching the same URL.",
6838
- items: {
6839
- type: "object",
6840
- additionalProperties: false,
6841
- required: ["urlPattern", "handler"],
6842
- properties: {
6843
- urlPattern: pwaUrlPatternSchema,
6844
- handler: {
6845
- type: "string",
6846
- enum: [
6847
- "CacheFirst",
6848
- "CacheOnly",
6849
- "NetworkFirst",
6850
- "NetworkOnly",
6851
- "StaleWhileRevalidate"
6852
- ]
6853
- },
6854
- method: {
6855
- type: "string",
6856
- enum: [
6857
- "GET",
6858
- "POST",
6859
- "PUT",
6860
- "DELETE",
6861
- "HEAD",
6862
- "PATCH"
6863
- ]
6864
- },
6865
- options: {
6866
- type: "object",
6867
- additionalProperties: false,
6868
- properties: {
6869
- cacheName: { type: "string" },
6870
- networkTimeoutSeconds: {
6871
- type: "number",
6872
- description: "Seconds a NetworkFirst rule waits for the network before falling back to the cache."
6873
- },
6874
- expiration: {
6875
- type: "object",
6876
- additionalProperties: false,
6877
- properties: {
6878
- maxEntries: { type: "number" },
6879
- maxAgeSeconds: { type: "number" }
6880
- }
6881
- },
6882
- cacheableResponse: {
6883
- type: "object",
6884
- additionalProperties: false,
6885
- properties: {
6886
- statuses: {
6887
- type: "array",
6888
- items: { type: "number" }
6889
- },
6890
- headers: {
6891
- type: "object",
6892
- additionalProperties: { type: "string" }
6893
- }
6894
- }
6895
- }
6896
- }
6897
- }
7353
+ items: { type: "string" },
7354
+ description: "Exact property keys into the imported namespace, outermost first. Omit it to select the namespace root."
6898
7355
  }
6899
7356
  }
6900
- },
6901
- navigateFallbackDenylist: {
6902
- type: "array",
6903
- description: "Extra SPA navigate-fallback denylist patterns, unioned with the built-ins.",
6904
- items: pwaUrlPatternSchema
6905
7357
  }
6906
7358
  }
6907
7359
  }
6908
- }
7360
+ }, {
7361
+ type: "object",
7362
+ additionalProperties: false,
7363
+ required: ["formatVersion", "mode"],
7364
+ description: "Schema-first: this package authors its models as SDL plus model.json.",
7365
+ properties: {
7366
+ formatVersion: definitionSourceFormatVersionSchema,
7367
+ mode: {
7368
+ const: "schema-first",
7369
+ description: "This package declares no code-first module. `entries` is forbidden here."
7370
+ }
7371
+ }
7372
+ }]
6909
7373
  };
6910
- //#endregion
6911
- //#region clis/source-config-schema.ts
6912
7374
  const SOURCE_CONFIG_SCHEMA_ID = "https://powerhouse.inc/schemas/powerhouse.source.json";
6913
7375
  const sourceConfigSchema = {
6914
7376
  $schema: "http://json-schema.org/draft-07/schema#",
@@ -7010,6 +7472,22 @@ const sourceConfigSchema = {
7010
7472
  description: "Required when `type: postgres`."
7011
7473
  }
7012
7474
  }
7475
+ },
7476
+ keyframes: {
7477
+ type: "object",
7478
+ additionalProperties: false,
7479
+ description: "How many keyframes a document stream keeps and how often one is written. Without this block: a keyframe every 10 revisions, all kept. `PH_KEYFRAMES` overrides it.",
7480
+ properties: {
7481
+ default: {
7482
+ ...keyframeRuleSchema,
7483
+ description: "The rule for every type `types` does not name."
7484
+ },
7485
+ types: {
7486
+ type: "object",
7487
+ description: "Rules by exact document type, over `default`.",
7488
+ additionalProperties: keyframeRuleSchema
7489
+ }
7490
+ }
7013
7491
  }
7014
7492
  }
7015
7493
  },
@@ -7108,9 +7586,36 @@ const sourceConfigSchema = {
7108
7586
  connectPort: {
7109
7587
  type: "integer",
7110
7588
  description: "Port `ph vetra`'s Connect dev server listens on. Assigned per project by `ph init`. Overridden by PH_VETRA_CONNECT_PORT or --connect-port."
7589
+ },
7590
+ previewDrive: {
7591
+ type: "object",
7592
+ additionalProperties: false,
7593
+ description: "The Vetra Preview drive `ph vetra` creates in watch mode.",
7594
+ properties: { app: {
7595
+ type: "string",
7596
+ description: "Id of the drive app the preview drive opens in, e.g. a drive editor's `config.id`. `ph vetra` sets it on the drive each time it starts; leaving it out keeps the drive's current app."
7597
+ } }
7111
7598
  }
7112
7599
  }
7113
7600
  },
7601
+ assistant: {
7602
+ type: "object",
7603
+ additionalProperties: false,
7604
+ description: "The project's agent host (hosts/assistant): a headless Mastra agent API on the project switchboard.",
7605
+ properties: { port: {
7606
+ type: "integer",
7607
+ description: "Port the assistant host's chat-completions API listens on. Read by hosts/assistant/host.js (default 4910)."
7608
+ } }
7609
+ },
7610
+ workflows: {
7611
+ type: "object",
7612
+ additionalProperties: false,
7613
+ description: "Powerhouse workflows on this reactor.",
7614
+ properties: { enabled: {
7615
+ type: "boolean",
7616
+ 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."
7617
+ } }
7618
+ },
7114
7619
  packageRegistryUrl: {
7115
7620
  type: "string",
7116
7621
  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."
@@ -7118,7 +7623,8 @@ const sourceConfigSchema = {
7118
7623
  connect: {
7119
7624
  ...phConnectRuntimeConfigSchema,
7120
7625
  description: "Connect-specific UI customisations. Copied verbatim into the runtime config at build time."
7121
- }
7626
+ },
7627
+ definitionSources: definitionSourcesSchema
7122
7628
  }
7123
7629
  };
7124
7630
  //#endregion
@@ -7152,6 +7658,6 @@ function assertNodeVersion(nodeVersion = process.versions.node) {
7152
7658
  if (lt(nodeVersion, "24.0.0")) throw new NodeVersionError(nodeVersion, MINIMUM_NODE_VERSION);
7153
7659
  }
7154
7660
  //#endregion
7155
- 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 };
7661
+ 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, KEYFRAMES_ACTIONS, KYSELY_PACKAGE, 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, RELATIONAL_DB_PROCESSOR_CLASS, SECONDS_IN_DAY, SERVICE_ACTIONS, SOURCE_CONFIG_SCHEMA_ID, SpawnError, 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, keyframesArgs, 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, versionSatisfies, vetraArgs, vetraSwitchboardArgs, writeFileEnsuringDir };
7156
7662
 
7157
7663
  //# sourceMappingURL=index.mjs.map