@powerhousedao/shared 6.2.3-dev.9 → 6.2.3

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 (270) hide show
  1. package/dist/analytics/index.d.ts +4 -4
  2. package/dist/analytics/index.d.ts.map +1 -1
  3. package/dist/analytics/index.js +25 -24
  4. package/dist/analytics/index.js.map +1 -1
  5. package/dist/clis/args/{access-token-To5LaIfL.mjs → access-token-3Hqv_U8I.mjs} +2 -2
  6. package/dist/clis/args/{access-token-To5LaIfL.mjs.map → access-token-3Hqv_U8I.mjs.map} +1 -1
  7. package/dist/clis/args/access-token-C5sKsH2O.d.mts +16 -0
  8. package/dist/clis/args/access-token-C5sKsH2O.d.mts.map +1 -0
  9. package/dist/clis/args/access-token.d.mts +3 -2
  10. package/dist/clis/args/access-token.mjs +1 -1
  11. package/dist/clis/args/{common-CcYbXrBx.mjs → common-BXabdhiO.mjs} +30 -7
  12. package/dist/clis/args/common-BXabdhiO.mjs.map +1 -0
  13. package/dist/clis/args/common-Bnm859xU.d.mts +186 -0
  14. package/dist/clis/args/common-Bnm859xU.d.mts.map +1 -0
  15. package/dist/clis/args/common.d.mts +3 -2
  16. package/dist/clis/args/common.mjs +1 -1
  17. package/dist/clis/args/{connect-BVVvCmL9.mjs → connect-BG3HkYBk.mjs} +8 -3
  18. package/dist/clis/args/connect-BG3HkYBk.mjs.map +1 -0
  19. package/dist/clis/args/connect-DjeiqXus.d.mts +450 -0
  20. package/dist/clis/args/connect-DjeiqXus.d.mts.map +1 -0
  21. package/dist/clis/args/connect.d.mts +3 -2
  22. package/dist/clis/args/connect.mjs +1 -1
  23. package/dist/clis/args/{generate-CA916Fvj.mjs → generate-BOItUNvP.mjs} +40 -2
  24. package/dist/clis/args/generate-BOItUNvP.mjs.map +1 -0
  25. package/dist/clis/args/generate-BPBBLeUD.d.mts +103 -0
  26. package/dist/clis/args/generate-BPBBLeUD.d.mts.map +1 -0
  27. package/dist/clis/args/generate.d.mts +3 -2
  28. package/dist/clis/args/generate.mjs +1 -1
  29. package/dist/clis/args/{help-Bqbgbalu.mjs → help-DS1NlcJQ.mjs} +15 -15
  30. package/dist/clis/args/{help-Bqbgbalu.mjs.map → help-DS1NlcJQ.mjs.map} +1 -1
  31. package/dist/clis/args/help-DVPTARGn.d.mts +190 -0
  32. package/dist/clis/args/help-DVPTARGn.d.mts.map +1 -0
  33. package/dist/clis/args/help.d.mts +3 -2
  34. package/dist/clis/args/help.mjs +1 -1
  35. package/dist/clis/args/index.d.mts +20 -19
  36. package/dist/clis/args/index.mjs +18 -18
  37. package/dist/clis/args/init-CFeTq4Cq.d.mts +52 -0
  38. package/dist/clis/args/init-CFeTq4Cq.d.mts.map +1 -0
  39. package/dist/clis/args/{init-rz9Ei7nq.mjs → init-Dvb42Y87.mjs} +2 -2
  40. package/dist/clis/args/{init-rz9Ei7nq.mjs.map → init-Dvb42Y87.mjs.map} +1 -1
  41. package/dist/clis/args/init.d.mts +3 -2
  42. package/dist/clis/args/init.mjs +1 -1
  43. package/dist/clis/args/inspect-BjRmtB86.d.mts +13 -0
  44. package/dist/clis/args/inspect-BjRmtB86.d.mts.map +1 -0
  45. package/dist/clis/args/{inspect-tckH8mSw.mjs → inspect-UNQgtuR0.mjs} +2 -2
  46. package/dist/clis/args/{inspect-tckH8mSw.mjs.map → inspect-UNQgtuR0.mjs.map} +1 -1
  47. package/dist/clis/args/inspect.d.mts +3 -2
  48. package/dist/clis/args/inspect.mjs +1 -1
  49. package/dist/clis/args/install-B0tMyUMw.d.mts +37 -0
  50. package/dist/clis/args/install-B0tMyUMw.d.mts.map +1 -0
  51. package/dist/clis/args/{install-Sz2DlCHh.mjs → install-F-27kF6m.mjs} +2 -2
  52. package/dist/clis/args/{install-Sz2DlCHh.mjs.map → install-F-27kF6m.mjs.map} +1 -1
  53. package/dist/clis/args/install.d.mts +3 -2
  54. package/dist/clis/args/install.mjs +1 -1
  55. package/dist/clis/args/{list-DM2d6f1m.mjs → list-Bkfn8Yuo.mjs} +2 -2
  56. package/dist/clis/args/{list-DM2d6f1m.mjs.map → list-Bkfn8Yuo.mjs.map} +1 -1
  57. package/dist/clis/args/list-DrbxA7JJ.d.mts +10 -0
  58. package/dist/clis/args/list-DrbxA7JJ.d.mts.map +1 -0
  59. package/dist/clis/args/list.d.mts +3 -2
  60. package/dist/clis/args/list.mjs +1 -1
  61. package/dist/clis/args/{login-DiKT5Jfu.mjs → login-CIFkQExi.mjs} +2 -2
  62. package/dist/clis/args/{login-DiKT5Jfu.mjs.map → login-CIFkQExi.mjs.map} +1 -1
  63. package/dist/clis/args/login-CXRJXg71.d.mts +25 -0
  64. package/dist/clis/args/login-CXRJXg71.d.mts.map +1 -0
  65. package/dist/clis/args/login.d.mts +3 -2
  66. package/dist/clis/args/login.mjs +1 -1
  67. package/dist/clis/args/{magic-string.es-h_0HDQBQ.mjs → magic-string.es-BWtG0AyA.mjs} +33 -27
  68. package/dist/clis/args/magic-string.es-BWtG0AyA.mjs.map +1 -0
  69. package/dist/clis/args/migrate-DkCQRL2D.d.mts +19 -0
  70. package/dist/clis/args/migrate-DkCQRL2D.d.mts.map +1 -0
  71. package/dist/clis/args/{migrate-CG_gWc4k.mjs → migrate-DwJGhc2d.mjs} +2 -2
  72. package/dist/clis/args/{migrate-CG_gWc4k.mjs.map → migrate-DwJGhc2d.mjs.map} +1 -1
  73. package/dist/clis/args/migrate.d.mts +3 -2
  74. package/dist/clis/args/migrate.mjs +1 -1
  75. package/dist/clis/args/publish-CeW4bOrl.d.mts +16 -0
  76. package/dist/clis/args/publish-CeW4bOrl.d.mts.map +1 -0
  77. package/dist/clis/args/{publish-DDZYsUfV.mjs → publish-DHqlGWmL.mjs} +2 -2
  78. package/dist/clis/args/{publish-DDZYsUfV.mjs.map → publish-DHqlGWmL.mjs.map} +1 -1
  79. package/dist/clis/args/publish.d.mts +3 -2
  80. package/dist/clis/args/publish.mjs +1 -1
  81. package/dist/clis/args/{registry-C_OVFQmI.mjs → registry-DIwES3l2.mjs} +2 -2
  82. package/dist/clis/args/{registry-C_OVFQmI.mjs.map → registry-DIwES3l2.mjs.map} +1 -1
  83. package/dist/clis/args/registry-DNH8xuaE.d.mts +17 -0
  84. package/dist/clis/args/registry-DNH8xuaE.d.mts.map +1 -0
  85. package/dist/clis/args/registry.d.mts +3 -2
  86. package/dist/clis/args/registry.mjs +1 -1
  87. package/dist/clis/args/service-BBx5GDTc.d.mts +27 -0
  88. package/dist/clis/args/service-BBx5GDTc.d.mts.map +1 -0
  89. package/dist/clis/args/{service-CHOOr0Gg.mjs → service-Cpjlyeu5.mjs} +2 -2
  90. package/dist/clis/args/{service-CHOOr0Gg.mjs.map → service-Cpjlyeu5.mjs.map} +1 -1
  91. package/dist/clis/args/service.d.mts +3 -2
  92. package/dist/clis/args/service.mjs +1 -1
  93. package/dist/clis/args/{switchboard-Dsp7nosi.mjs → switchboard-CCaAtU56.mjs} +2 -2
  94. package/dist/clis/args/{switchboard-Dsp7nosi.mjs.map → switchboard-CCaAtU56.mjs.map} +1 -1
  95. package/dist/clis/args/switchboard-RrNb1fUH.d.mts +70 -0
  96. package/dist/clis/args/switchboard-RrNb1fUH.d.mts.map +1 -0
  97. package/dist/clis/args/switchboard.d.mts +3 -2
  98. package/dist/clis/args/switchboard.mjs +1 -1
  99. package/dist/clis/args/{uninstall-CTwTX0u_.mjs → uninstall-3U0B8g5c.mjs} +2 -2
  100. package/dist/clis/args/{uninstall-CTwTX0u_.mjs.map → uninstall-3U0B8g5c.mjs.map} +1 -1
  101. package/dist/clis/args/uninstall-CDx7lwxn.d.mts +28 -0
  102. package/dist/clis/args/uninstall-CDx7lwxn.d.mts.map +1 -0
  103. package/dist/clis/args/uninstall.d.mts +3 -2
  104. package/dist/clis/args/uninstall.mjs +1 -1
  105. package/dist/clis/args/unpublish-CEDsk6uv.d.mts +22 -0
  106. package/dist/clis/args/unpublish-CEDsk6uv.d.mts.map +1 -0
  107. package/dist/clis/args/{unpublish-BPMkGEg5.mjs → unpublish-s9zUh6Gw.mjs} +2 -2
  108. package/dist/clis/args/{unpublish-BPMkGEg5.mjs.map → unpublish-s9zUh6Gw.mjs.map} +1 -1
  109. package/dist/clis/args/unpublish.d.mts +3 -2
  110. package/dist/clis/args/unpublish.mjs +1 -1
  111. package/dist/clis/args/{vetra-b4KUu1Ax.mjs → vetra-BUNlAAPp.mjs} +2 -2
  112. package/dist/clis/args/{vetra-b4KUu1Ax.mjs.map → vetra-BUNlAAPp.mjs.map} +1 -1
  113. package/dist/clis/args/vetra-DkDaWFPi.d.mts +111 -0
  114. package/dist/clis/args/vetra-DkDaWFPi.d.mts.map +1 -0
  115. package/dist/clis/args/vetra-ports.test.d.mts +2 -1
  116. package/dist/clis/args/vetra-ports.test.mjs +285 -180
  117. package/dist/clis/args/vetra-ports.test.mjs.map +1 -1
  118. package/dist/clis/args/vetra.d.mts +3 -2
  119. package/dist/clis/args/vetra.mjs +1 -1
  120. package/dist/clis/build-config-CmdMi_wu.mjs +230 -0
  121. package/dist/clis/build-config-CmdMi_wu.mjs.map +1 -0
  122. package/dist/clis/build-config.d.mts +44 -10614
  123. package/dist/clis/build-config.d.mts.map +1 -1
  124. package/dist/clis/build-config.mjs +2 -93
  125. package/dist/clis/build-pieces.d.mts +100 -0
  126. package/dist/clis/build-pieces.d.mts.map +1 -0
  127. package/dist/clis/build-pieces.mjs +371 -0
  128. package/dist/clis/build-pieces.mjs.map +1 -0
  129. package/dist/clis/command-names.d.mts +2 -2
  130. package/dist/clis/command-names.d.mts.map +1 -1
  131. package/dist/clis/command-names.mjs.map +1 -1
  132. package/dist/clis/constants.d.mts +3 -475
  133. package/dist/clis/constants.mjs +17 -8
  134. package/dist/clis/constants.mjs.map +1 -1
  135. package/dist/clis/index-6CZwrmQi.d.mts +11154 -0
  136. package/dist/clis/index-6CZwrmQi.d.mts.map +1 -0
  137. package/dist/clis/index.d.mts +1368 -1221
  138. package/dist/clis/index.d.mts.map +1 -1
  139. package/dist/clis/index.mjs +209 -65
  140. package/dist/clis/index.mjs.map +1 -1
  141. package/dist/clis/project-env.d.mts +4 -4
  142. package/dist/clis/project-env.d.mts.map +1 -1
  143. package/dist/clis/project-env.mjs.map +1 -1
  144. package/dist/clis/project-ports.d.mts +5 -5
  145. package/dist/clis/project-ports.d.mts.map +1 -1
  146. package/dist/clis/project-ports.mjs +1 -1
  147. package/dist/clis/project-ports.mjs.map +1 -1
  148. package/dist/clis/services/telemetry.d.mts +7 -7
  149. package/dist/clis/services/telemetry.d.mts.map +1 -1
  150. package/dist/clis/services/telemetry.mjs.map +1 -1
  151. package/dist/clis/types-nzer4WIr.d.mts +541 -0
  152. package/dist/clis/types-nzer4WIr.d.mts.map +1 -0
  153. package/dist/clis/utils.d.mts +4 -4
  154. package/dist/clis/utils.d.mts.map +1 -1
  155. package/dist/clis/utils.mjs.map +1 -1
  156. package/dist/{config-loader-B845Hidf.js → config-loader-C6dZB_iX.js} +28 -8
  157. package/dist/config-loader-C6dZB_iX.js.map +1 -0
  158. package/dist/connect/config-loader.d.ts +14 -8
  159. package/dist/connect/config-loader.d.ts.map +1 -1
  160. package/dist/connect/config-loader.js +2 -2
  161. package/dist/connect/index.d.ts +190 -56
  162. package/dist/connect/index.d.ts.map +1 -1
  163. package/dist/connect/index.js +303 -30
  164. package/dist/connect/index.js.map +1 -1
  165. package/dist/connect/json-adapter.d.ts +3 -4
  166. package/dist/connect/json-adapter.d.ts.map +1 -1
  167. package/dist/connect/json-adapter.js.map +1 -1
  168. package/dist/{constants-BP_gjn8g.d.ts → constants-DO4IYxuR.d.ts} +2 -1
  169. package/dist/constants-DO4IYxuR.d.ts.map +1 -0
  170. package/dist/constants.d.ts +3 -2
  171. package/dist/constants.js.map +1 -1
  172. package/dist/document-drive/index.d.ts +104 -101
  173. package/dist/document-drive/index.d.ts.map +1 -1
  174. package/dist/document-drive/index.js +39 -19
  175. package/dist/document-drive/index.js.map +1 -1
  176. package/dist/document-model/index.d.ts +5 -4
  177. package/dist/document-model/index.js +605 -228
  178. package/dist/document-model/index.js.map +1 -1
  179. package/dist/document-model/mock.d.ts +2 -3
  180. package/dist/document-model/mock.d.ts.map +1 -1
  181. package/dist/document-model/mock.js +2 -1
  182. package/dist/document-model/mock.js.map +1 -1
  183. package/dist/document-model/utils.d.ts +3 -2
  184. package/dist/document-model/utils.js +1 -1
  185. package/dist/index-5gwOhPG5.d.ts +36 -0
  186. package/dist/index-5gwOhPG5.d.ts.map +1 -0
  187. package/dist/{index-DP3QgHTq.d.ts → index-D6833Siv.d.ts} +131 -28
  188. package/dist/index-D6833Siv.d.ts.map +1 -0
  189. package/dist/index.d.ts +7 -6
  190. package/dist/index.js.map +1 -1
  191. package/dist/processors/index.d.ts +3 -2
  192. package/dist/processors/index.js +5 -1
  193. package/dist/processors/index.js.map +1 -1
  194. package/dist/registry/index.d.ts +15 -15
  195. package/dist/registry/index.d.ts.map +1 -1
  196. package/dist/registry/index.js +14 -5
  197. package/dist/registry/index.js.map +1 -1
  198. package/dist/registry/manifest-slim.d.ts +4 -3
  199. package/dist/registry/manifest-slim.d.ts.map +1 -1
  200. package/dist/registry/manifest-slim.js +22 -2
  201. package/dist/registry/manifest-slim.js.map +1 -1
  202. package/dist/registry/updates.d.ts +3 -3
  203. package/dist/registry/updates.d.ts.map +1 -1
  204. package/dist/registry/updates.js.map +1 -1
  205. package/dist/registry/urls.d.ts +2 -2
  206. package/dist/registry/urls.d.ts.map +1 -1
  207. package/dist/registry/urls.js.map +1 -1
  208. package/dist/{types-C1in4fl3.d.ts → types-Bsp8VL2y.d.ts} +2 -2
  209. package/dist/types-Bsp8VL2y.d.ts.map +1 -0
  210. package/dist/{types-DDpRvBK_.d.ts → types-CI3ren9F.d.ts} +23 -35
  211. package/dist/types-CI3ren9F.d.ts.map +1 -0
  212. package/dist/{types-BIoOWpOT.d.ts → types-CmeoQg_J.d.ts} +602 -437
  213. package/dist/types-CmeoQg_J.d.ts.map +1 -0
  214. package/dist/{utils-DP122OSS.d.ts → utils-BrKxCmKx.d.ts} +2 -2
  215. package/dist/utils-BrKxCmKx.d.ts.map +1 -0
  216. package/dist/{utils-aaTmfxFW.js → utils-CSF716ux.js} +10 -3
  217. package/dist/utils-CSF716ux.js.map +1 -0
  218. package/package.json +10 -5
  219. package/dist/clis/args/access-token--9H57y8J.d.mts +0 -18
  220. package/dist/clis/args/access-token--9H57y8J.d.mts.map +0 -1
  221. package/dist/clis/args/common-CcYbXrBx.mjs.map +0 -1
  222. package/dist/clis/args/common-Dsf1vpHV.d.mts +0 -183
  223. package/dist/clis/args/common-Dsf1vpHV.d.mts.map +0 -1
  224. package/dist/clis/args/connect-BVVvCmL9.mjs.map +0 -1
  225. package/dist/clis/args/connect-DetTnI8g.d.mts +0 -443
  226. package/dist/clis/args/connect-DetTnI8g.d.mts.map +0 -1
  227. package/dist/clis/args/generate-CA916Fvj.mjs.map +0 -1
  228. package/dist/clis/args/generate-DnV-bfXt.d.mts +0 -87
  229. package/dist/clis/args/generate-DnV-bfXt.d.mts.map +0 -1
  230. package/dist/clis/args/help-CjAsudUn.d.mts +0 -193
  231. package/dist/clis/args/help-CjAsudUn.d.mts.map +0 -1
  232. package/dist/clis/args/init-CUXyfquF.d.mts +0 -55
  233. package/dist/clis/args/init-CUXyfquF.d.mts.map +0 -1
  234. package/dist/clis/args/inspect-DtZeoA5c.d.mts +0 -15
  235. package/dist/clis/args/inspect-DtZeoA5c.d.mts.map +0 -1
  236. package/dist/clis/args/install-CkP8zcHb.d.mts +0 -40
  237. package/dist/clis/args/install-CkP8zcHb.d.mts.map +0 -1
  238. package/dist/clis/args/list-BGf8s_gj.d.mts +0 -12
  239. package/dist/clis/args/list-BGf8s_gj.d.mts.map +0 -1
  240. package/dist/clis/args/login-DNsHwvqk.d.mts +0 -27
  241. package/dist/clis/args/login-DNsHwvqk.d.mts.map +0 -1
  242. package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs.map +0 -1
  243. package/dist/clis/args/migrate-sixkWhxm.d.mts +0 -21
  244. package/dist/clis/args/migrate-sixkWhxm.d.mts.map +0 -1
  245. package/dist/clis/args/publish-Dqe5DUst.d.mts +0 -18
  246. package/dist/clis/args/publish-Dqe5DUst.d.mts.map +0 -1
  247. package/dist/clis/args/registry-C_RfTsKB.d.mts +0 -19
  248. package/dist/clis/args/registry-C_RfTsKB.d.mts.map +0 -1
  249. package/dist/clis/args/service-DhIkf8-O.d.mts +0 -22
  250. package/dist/clis/args/service-DhIkf8-O.d.mts.map +0 -1
  251. package/dist/clis/args/switchboard-BlPaq2at.d.mts +0 -72
  252. package/dist/clis/args/switchboard-BlPaq2at.d.mts.map +0 -1
  253. package/dist/clis/args/uninstall-BpA3YYbw.d.mts +0 -31
  254. package/dist/clis/args/uninstall-BpA3YYbw.d.mts.map +0 -1
  255. package/dist/clis/args/unpublish-CvwaIimG.d.mts +0 -24
  256. package/dist/clis/args/unpublish-CvwaIimG.d.mts.map +0 -1
  257. package/dist/clis/args/vetra-DLQ6lhLl.d.mts +0 -113
  258. package/dist/clis/args/vetra-DLQ6lhLl.d.mts.map +0 -1
  259. package/dist/clis/build-config.mjs.map +0 -1
  260. package/dist/clis/constants.d.mts.map +0 -1
  261. package/dist/config-loader-B845Hidf.js.map +0 -1
  262. package/dist/constants-BP_gjn8g.d.ts.map +0 -1
  263. package/dist/index-C_iVZe7f.d.ts +0 -7
  264. package/dist/index-C_iVZe7f.d.ts.map +0 -1
  265. package/dist/index-DP3QgHTq.d.ts.map +0 -1
  266. package/dist/types-BIoOWpOT.d.ts.map +0 -1
  267. package/dist/types-C1in4fl3.d.ts.map +0 -1
  268. package/dist/types-DDpRvBK_.d.ts.map +0 -1
  269. package/dist/utils-DP122OSS.d.ts.map +0 -1
  270. package/dist/utils-aaTmfxFW.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../processors/constants.ts","../../processors/relational/utils.ts","../../processors/relational/types.ts"],"sourcesContent":["export const PROCESSOR_APPS = [\"connect\", \"switchboard\"] as const;\nexport const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = \"relational-db\";\nexport const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = \"analytics-db\";\n","import type { Options } from \"@sindresorhus/fnv1a\";\nimport fnv1a from \"@sindresorhus/fnv1a\";\nimport type {\n IBaseRelationalDb,\n IRelationalDb,\n IRelationalQueryBuilder,\n} from \"./types.js\";\n\nconst SUPPORTED_SIZES: Options[\"size\"][] = [32, 64, 128, 256, 512, 1024];\nconst LOG2_26 = Math.log2(26); //\n/**\n * Hashes a string to a lowercase base-26 string.\n * @param str The string to hash.\n * @param length The length of the hash. Defaults to 10.\n * @param algorithm The hashing algorithm to use. Defaults to \"fnv1a\".\n * @returns The hashed string.\n */\nexport function hashNamespace(str: string, length = 10) {\n const requiredBits = Math.ceil(length * LOG2_26);\n const bitSize =\n SUPPORTED_SIZES.find((size) => size && size >= requiredBits) ?? 1024;\n const hash = fnv1a(str, { size: bitSize });\n return toBase26(hash, length);\n}\n\n// converts hash to lowercase letters\nfunction toBase26(num: bigint, length = 10): string {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n let out = \"\";\n while (num > 0n && out.length < length) {\n out = alphabet[Number(num % 26n)] + out;\n num /= 26n;\n }\n return out.padStart(length, \"a\"); // optional padding\n}\n\n/**\n * Creates a RelationalDb instance with namespace support.\n * @param baseDb The base RelationalDb instance to enhance.\n * @param baseOptions The default options for namespace creation. Hashes namespace by default.\n * @returns The enhanced RelationalDb instance.\n */\nexport function createRelationalDb<Schema>(\n baseDb: IBaseRelationalDb<Schema>,\n baseOptions?: NamespaceOptions,\n): IRelationalDb<Schema> {\n const relationalDb = baseDb as IRelationalDb<Schema>;\n\n relationalDb.createNamespace = <NamespaceSchema>(\n namespace: string,\n options?: NamespaceOptions,\n ) =>\n createNamespacedDb<NamespaceSchema>(\n baseDb,\n namespace,\n options ?? baseOptions,\n );\n\n relationalDb.queryNamespace = <NamespaceSchema>(\n namespace: string,\n options?: NamespaceOptions,\n ) =>\n createNamespacedQueryBuilder<NamespaceSchema>(\n baseDb,\n namespace,\n options ?? baseOptions,\n );\n\n return relationalDb;\n}\n\ntype NamespaceOptions = {\n hashNamespace?: boolean;\n};\n\nexport async function createNamespacedDb<Schema>(\n db: IBaseRelationalDb<any>,\n namespace: string,\n options?: NamespaceOptions,\n): Promise<IRelationalDb<Schema>> {\n // hash the namespace to avoid too long namespaces\n const shouldHash = options?.hashNamespace ?? true;\n const hashValue = shouldHash ? hashNamespace(namespace) : namespace;\n await db.schema.createSchema(hashValue).ifNotExists().execute();\n const schemaRelationalDb = db.withSchema(hashValue);\n return schemaRelationalDb as IRelationalDb<Schema>;\n}\n\nexport function createNamespacedQueryBuilder<Schema>(\n db: IBaseRelationalDb<any>,\n namespace: string,\n options?: NamespaceOptions,\n): IRelationalQueryBuilder<Schema> {\n const shouldHash = options?.hashNamespace ?? true;\n const hashValue = shouldHash ? hashNamespace(namespace) : namespace;\n const namespacedDb = db.withSchema(hashValue) as IRelationalDb<Schema>;\n return relationalDbToQueryBuilder(namespacedDb);\n}\n\n/**\n * Returns a query builder for a RelationalDb instance.\n * @param query The RelationalDb instance to convert.\n * @returns The IRelationalQueryBuilder instance.\n */\nexport function relationalDbToQueryBuilder<TSchema>(\n query: IBaseRelationalDb<TSchema>,\n): IRelationalQueryBuilder<TSchema> {\n return {\n selectFrom: query.selectFrom.bind(query),\n selectNoFrom: query.selectNoFrom.bind(query),\n with: query.with.bind(query),\n withRecursive: query.withRecursive.bind(query),\n withSchema: (schema: string) =>\n relationalDbToQueryBuilder<TSchema>(query.withSchema(schema)),\n };\n}\n","import type { OperationWithContext } from \"@powerhousedao/shared/document-model\";\nimport type { Kysely, QueryCreator } from \"kysely\";\nimport type { IProcessor, ProcessorFilter } from \"../types.js\";\nimport { relationalDbToQueryBuilder } from \"./utils.js\";\n\nexport type IRelationalQueryMethods =\n | \"selectFrom\"\n | \"selectNoFrom\"\n | \"with\"\n | \"withRecursive\";\n\nexport type IRelationalQueryBuilder<Schema = unknown> = Pick<\n QueryCreator<Schema>,\n IRelationalQueryMethods\n> & {\n withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;\n};\n\nexport type HashAlgorithms = \"fnv1a\";\nexport type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;\n\n/**\n * The standardized relational database interface for relational db processors.\n * This abstraction provides type-safe database operations while hiding the underlying\n * database framework implementation details.\n **/\nexport type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {\n createNamespace<NamespaceSchema>(\n namespace: string,\n ): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;\n queryNamespace<NamespaceSchema>(\n namespace: string,\n ): IRelationalQueryBuilder<NamespaceSchema>;\n};\n\nexport type ExtractProcessorSchemaOrSelf<TProcessor> =\n TProcessor extends RelationalDbProcessor<infer TSchema>\n ? TSchema\n : TProcessor;\n\nexport type RelationalDbProcessorClass<TSchema> =\n typeof RelationalDbProcessor<TSchema>;\n\nexport interface IRelationalDbProcessor<\n TDatabaseSchema = unknown,\n> extends IProcessor {\n namespace: string;\n query: IRelationalQueryBuilder<TDatabaseSchema>;\n filter: ProcessorFilter;\n initAndUpgrade(): Promise<void>;\n}\n\nconst IS_RELATIONAL_DB_PROCESSOR = Symbol.for(\"ph.IS_RELATIONAL_DB_PROCESSOR\");\n\n/**\n * Base class for relational db processors that require a relational database storage.\n * This class abstracts database initialization, migration management, and resource cleanup,\n * allowing derived classes to focus on business logic.\n */\nexport abstract class RelationalDbProcessor<\n TDatabaseSchema = unknown,\n> implements IRelationalDbProcessor<TDatabaseSchema> {\n constructor(\n protected _namespace: string,\n protected _filter: ProcessorFilter,\n protected relationalDb: IRelationalDb<TDatabaseSchema>,\n ) {}\n\n static [IS_RELATIONAL_DB_PROCESSOR] = true;\n\n /**\n * Returns the namespace for a given drive id.\n * This method can be overridden by derived classes to provide a custom namespace.\n */\n static getNamespace(driveId: string): string {\n return `${this.name}_${driveId.replaceAll(\"-\", \"_\")}`;\n }\n\n static query<Schema>(\n this: RelationalDbProcessorClass<Schema>,\n driveId: string,\n db: IRelationalDb<any>,\n ): IRelationalQueryBuilder<Schema> {\n return db.queryNamespace(this.getNamespace(driveId));\n }\n\n /**\n * Processes a list of operations with context.\n * Called when operations match this processor's filter.\n */\n abstract onOperations(operations: OperationWithContext[]): Promise<void>;\n\n /**\n * Returns the filter for the processor.\n * This method can be overridden by derived classes to provide a custom filter.\n */\n get filter(): ProcessorFilter {\n return this._filter;\n }\n\n /**\n * Returns the namespace used by the processor.\n */\n get namespace(): string {\n return this._namespace;\n }\n\n get query(): IRelationalQueryBuilder<TDatabaseSchema> {\n return relationalDbToQueryBuilder(this.relationalDb);\n }\n\n /**\n * Abstract method that derived classes must implement.\n * This method is meant to be called on subclasses to initialize and upgrade the database.\n */\n abstract initAndUpgrade(): Promise<void>;\n\n /**\n * Called when the processor is disconnected.\n * This method is meant to be overridden by subclasses to clean up resources.\n */\n abstract onDisconnect(): Promise<void>;\n}\n"],"mappings":";;AAAA,MAAa,iBAAiB,CAAC,WAAW,cAAc;AACxD,MAAa,uCAAuC;AACpD,MAAa,sCAAsC;;;ACMnD,MAAM,kBAAqC;CAAC;CAAI;CAAI;CAAK;CAAK;CAAK;CAAK;AACxE,MAAM,UAAU,KAAK,KAAK,GAAG;;;;;;;;AAQ7B,SAAgB,cAAc,KAAa,SAAS,IAAI;CACtD,MAAM,eAAe,KAAK,KAAK,SAAS,QAAQ;AAIhD,QAAO,SADM,MAAM,KAAK,EAAE,MADxB,gBAAgB,MAAM,SAAS,QAAQ,QAAQ,aAAa,IAAI,MACzB,CAAC,EACpB,OAAO;;AAI/B,SAAS,SAAS,KAAa,SAAS,IAAY;CAClD,MAAM,WAAW;CACjB,IAAI,MAAM;AACV,QAAO,MAAM,MAAM,IAAI,SAAS,QAAQ;AACtC,QAAM,SAAS,OAAO,MAAM,IAAI,IAAI;AACpC,SAAO;;AAET,QAAO,IAAI,SAAS,QAAQ,IAAI;;;;;;;;AASlC,SAAgB,mBACd,QACA,aACuB;CACvB,MAAM,eAAe;AAErB,cAAa,mBACX,WACA,YAEA,mBACE,QACA,WACA,WAAW,YACZ;AAEH,cAAa,kBACX,WACA,YAEA,6BACE,QACA,WACA,WAAW,YACZ;AAEH,QAAO;;AAOT,eAAsB,mBACpB,IACA,WACA,SACgC;CAGhC,MAAM,YADa,SAAS,iBAAiB,OACd,cAAc,UAAU,GAAG;AAC1D,OAAM,GAAG,OAAO,aAAa,UAAU,CAAC,aAAa,CAAC,SAAS;AAE/D,QAD2B,GAAG,WAAW,UAAU;;AAIrD,SAAgB,6BACd,IACA,WACA,SACiC;CAEjC,MAAM,YADa,SAAS,iBAAiB,OACd,cAAc,UAAU,GAAG;AAE1D,QAAO,2BADc,GAAG,WAAW,UAAU,CACE;;;;;;;AAQjD,SAAgB,2BACd,OACkC;AAClC,QAAO;EACL,YAAY,MAAM,WAAW,KAAK,MAAM;EACxC,cAAc,MAAM,aAAa,KAAK,MAAM;EAC5C,MAAM,MAAM,KAAK,KAAK,MAAM;EAC5B,eAAe,MAAM,cAAc,KAAK,MAAM;EAC9C,aAAa,WACX,2BAAoC,MAAM,WAAW,OAAO,CAAC;EAChE;;;;AC9DH,MAAM,6BAA6B,OAAO,IAAI,gCAAgC;;;;;;AAO9E,IAAsB,wBAAtB,MAEqD;CACnD,YACE,YACA,SACA,cACA;AAHU,OAAA,aAAA;AACA,OAAA,UAAA;AACA,OAAA,eAAA;;CAGZ,QAAQ,8BAA8B;;;;;CAMtC,OAAO,aAAa,SAAyB;AAC3C,SAAO,GAAG,KAAK,KAAK,GAAG,QAAQ,WAAW,KAAK,IAAI;;CAGrD,OAAO,MAEL,SACA,IACiC;AACjC,SAAO,GAAG,eAAe,KAAK,aAAa,QAAQ,CAAC;;;;;;CAatD,IAAI,SAA0B;AAC5B,SAAO,KAAK;;;;;CAMd,IAAI,YAAoB;AACtB,SAAO,KAAK;;CAGd,IAAI,QAAkD;AACpD,SAAO,2BAA2B,KAAK,aAAa"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../processors/constants.ts","../../processors/relational/utils.ts","../../processors/relational/types.ts"],"sourcesContent":["export const PROCESSOR_APPS = [\"connect\", \"switchboard\"] as const;\nexport const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = \"relational-db\";\nexport const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = \"analytics-db\";\n","import type { Options } from \"@sindresorhus/fnv1a\";\nimport fnv1a from \"@sindresorhus/fnv1a\";\nimport type {\n IBaseRelationalDb,\n IRelationalDb,\n IRelationalQueryBuilder,\n} from \"./types.js\";\n\nconst SUPPORTED_SIZES: Options[\"size\"][] = [32, 64, 128, 256, 512, 1024];\nconst LOG2_26 = Math.log2(26); //\n/**\n * Hashes a string to a lowercase base-26 string.\n * @param str The string to hash.\n * @param length The length of the hash. Defaults to 10.\n * @param algorithm The hashing algorithm to use. Defaults to \"fnv1a\".\n * @returns The hashed string.\n */\nexport function hashNamespace(str: string, length = 10) {\n const requiredBits = Math.ceil(length * LOG2_26);\n const bitSize =\n SUPPORTED_SIZES.find((size) => size && size >= requiredBits) ?? 1024;\n const hash = fnv1a(str, { size: bitSize });\n return toBase26(hash, length);\n}\n\n// converts hash to lowercase letters\nfunction toBase26(num: bigint, length = 10): string {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n let out = \"\";\n while (num > 0n && out.length < length) {\n out = alphabet[Number(num % 26n)] + out;\n num /= 26n;\n }\n return out.padStart(length, \"a\"); // optional padding\n}\n\n/**\n * Creates a RelationalDb instance with namespace support.\n * @param baseDb The base RelationalDb instance to enhance.\n * @param baseOptions The default options for namespace creation. Hashes namespace by default.\n * @returns The enhanced RelationalDb instance.\n */\nexport function createRelationalDb<Schema>(\n baseDb: IBaseRelationalDb<Schema>,\n baseOptions?: NamespaceOptions,\n): IRelationalDb<Schema> {\n const relationalDb = baseDb as IRelationalDb<Schema>;\n\n relationalDb.createNamespace = <NamespaceSchema>(\n namespace: string,\n options?: NamespaceOptions,\n ) =>\n createNamespacedDb<NamespaceSchema>(\n baseDb,\n namespace,\n options ?? baseOptions,\n );\n\n relationalDb.queryNamespace = <NamespaceSchema>(\n namespace: string,\n options?: NamespaceOptions,\n ) =>\n createNamespacedQueryBuilder<NamespaceSchema>(\n baseDb,\n namespace,\n options ?? baseOptions,\n );\n\n return relationalDb;\n}\n\ntype NamespaceOptions = {\n hashNamespace?: boolean;\n};\n\nexport async function createNamespacedDb<Schema>(\n db: IBaseRelationalDb<any>,\n namespace: string,\n options?: NamespaceOptions,\n): Promise<IRelationalDb<Schema>> {\n // hash the namespace to avoid too long namespaces\n const shouldHash = options?.hashNamespace ?? true;\n const hashValue = shouldHash ? hashNamespace(namespace) : namespace;\n await db.schema.createSchema(hashValue).ifNotExists().execute();\n const schemaRelationalDb = db.withSchema(hashValue);\n return schemaRelationalDb as IRelationalDb<Schema>;\n}\n\nexport function createNamespacedQueryBuilder<Schema>(\n db: IBaseRelationalDb<any>,\n namespace: string,\n options?: NamespaceOptions,\n): IRelationalQueryBuilder<Schema> {\n const shouldHash = options?.hashNamespace ?? true;\n const hashValue = shouldHash ? hashNamespace(namespace) : namespace;\n const namespacedDb = db.withSchema(hashValue) as IRelationalDb<Schema>;\n return relationalDbToQueryBuilder(namespacedDb);\n}\n\n/**\n * Returns a query builder for a RelationalDb instance.\n * @param query The RelationalDb instance to convert.\n * @returns The IRelationalQueryBuilder instance.\n */\nexport function relationalDbToQueryBuilder<TSchema>(\n query: IBaseRelationalDb<TSchema>,\n): IRelationalQueryBuilder<TSchema> {\n return {\n selectFrom: query.selectFrom.bind(query),\n selectNoFrom: query.selectNoFrom.bind(query),\n with: query.with.bind(query),\n withRecursive: query.withRecursive.bind(query),\n withSchema: (schema: string) =>\n relationalDbToQueryBuilder<TSchema>(query.withSchema(schema)),\n };\n}\n","import type { OperationWithContext } from \"@powerhousedao/shared/document-model\";\nimport type { Kysely, QueryCreator } from \"kysely\";\nimport type { IProcessor, ProcessorFilter } from \"../types.js\";\nimport { relationalDbToQueryBuilder } from \"./utils.js\";\n\nexport type IRelationalQueryMethods =\n | \"selectFrom\"\n | \"selectNoFrom\"\n | \"with\"\n | \"withRecursive\";\n\nexport type IRelationalQueryBuilder<Schema = unknown> = Pick<\n QueryCreator<Schema>,\n IRelationalQueryMethods\n> & {\n withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;\n};\n\nexport type HashAlgorithms = \"fnv1a\";\nexport type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;\n\n/**\n * The standardized relational database interface for relational db processors.\n * This abstraction provides type-safe database operations while hiding the underlying\n * database framework implementation details.\n **/\nexport type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {\n createNamespace<NamespaceSchema>(\n namespace: string,\n ): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;\n queryNamespace<NamespaceSchema>(\n namespace: string,\n ): IRelationalQueryBuilder<NamespaceSchema>;\n};\n\nexport type ExtractProcessorSchemaOrSelf<TProcessor> =\n TProcessor extends RelationalDbProcessor<infer TSchema>\n ? TSchema\n : TProcessor;\n\nexport type RelationalDbProcessorClass<TSchema> =\n typeof RelationalDbProcessor<TSchema>;\n\nexport interface IRelationalDbProcessor<\n TDatabaseSchema = unknown,\n> extends IProcessor {\n namespace: string;\n query: IRelationalQueryBuilder<TDatabaseSchema>;\n filter: ProcessorFilter;\n initAndUpgrade(): Promise<void>;\n}\n\nconst IS_RELATIONAL_DB_PROCESSOR = Symbol.for(\"ph.IS_RELATIONAL_DB_PROCESSOR\");\n\n/**\n * Base class for relational db processors that require a relational database storage.\n * This class abstracts database initialization, migration management, and resource cleanup,\n * allowing derived classes to focus on business logic.\n */\nexport abstract class RelationalDbProcessor<\n TDatabaseSchema = unknown,\n> implements IRelationalDbProcessor<TDatabaseSchema> {\n constructor(\n protected _namespace: string,\n protected _filter: ProcessorFilter,\n protected relationalDb: IRelationalDb<TDatabaseSchema>,\n ) {}\n\n static [IS_RELATIONAL_DB_PROCESSOR] = true;\n\n /**\n * Returns the namespace for a given drive id.\n * This method can be overridden by derived classes to provide a custom namespace.\n */\n static getNamespace(driveId: string): string {\n return `${this.name}_${driveId.replaceAll(\"-\", \"_\")}`;\n }\n\n static query<Schema>(\n this: RelationalDbProcessorClass<Schema>,\n driveId: string,\n db: IRelationalDb<any>,\n ): IRelationalQueryBuilder<Schema> {\n return db.queryNamespace(this.getNamespace(driveId));\n }\n\n /**\n * Processes a list of operations with context.\n * Called when operations match this processor's filter.\n */\n abstract onOperations(operations: OperationWithContext[]): Promise<void>;\n\n /**\n * Returns the filter for the processor.\n * This method can be overridden by derived classes to provide a custom filter.\n */\n get filter(): ProcessorFilter {\n return this._filter;\n }\n\n /**\n * Returns the namespace used by the processor.\n */\n get namespace(): string {\n return this._namespace;\n }\n\n get query(): IRelationalQueryBuilder<TDatabaseSchema> {\n return relationalDbToQueryBuilder(this.relationalDb);\n }\n\n /**\n * Abstract method that derived classes must implement.\n * This method is meant to be called on subclasses to initialize and upgrade the database.\n */\n abstract initAndUpgrade(): Promise<void>;\n\n /**\n * Called when the processor is disconnected.\n * This method is meant to be overridden by subclasses to clean up resources.\n */\n abstract onDisconnect(): Promise<void>;\n}\n"],"mappings":";;AAAA,MAAa,iBAAiB,CAAC,WAAW,aAAa;AACvD,MAAa,uCAAuC;AACpD,MAAa,sCAAsC;;;ACMnD,MAAM,kBAAqC;CAAC;CAAI;CAAI;CAAK;CAAK;CAAK;AAAI;AACvE,MAAM,UAAU,KAAK,KAAK,EAAE;;;;;;;;AAQ5B,SAAgB,cAAc,KAAa,SAAS,IAAI;CACtD,MAAM,eAAe,KAAK,KAAK,SAAS,OAAO;CAC/C,MAAM,UACJ,gBAAgB,MAAM,SAAS,QAAQ,QAAQ,YAAY,KAAK;CAElE,OAAO,SADM,MAAM,KAAK,EAAE,MAAM,QAAQ,CACrB,GAAG,MAAM;AAC9B;AAGA,SAAS,SAAS,KAAa,SAAS,IAAY;CAClD,MAAM,WAAW;CACjB,IAAI,MAAM;CACV,OAAO,MAAM,MAAM,IAAI,SAAS,QAAQ;EACtC,MAAM,SAAS,OAAO,MAAM,GAAG,KAAK;EACpC,OAAO;CACT;CACA,OAAO,IAAI,SAAS,QAAQ,GAAG;AACjC;;;;;;;AAQA,SAAgB,mBACd,QACA,aACuB;CACvB,MAAM,eAAe;CAErB,aAAa,mBACX,WACA,YAEA,mBACE,QACA,WACA,WAAW,WACb;CAEF,aAAa,kBACX,WACA,YAEA,6BACE,QACA,WACA,WAAW,WACb;CAEF,OAAO;AACT;AAMA,eAAsB,mBACpB,IACA,WACA,SACgC;CAGhC,MAAM,YADa,SAAS,iBAAiB,OACd,cAAc,SAAS,IAAI;CAC1D,MAAM,GAAG,OAAO,aAAa,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ;CAE9D,OAD2B,GAAG,WAAW,SACjB;AAC1B;AAEA,SAAgB,6BACd,IACA,WACA,SACiC;CAEjC,MAAM,YADa,SAAS,iBAAiB,OACd,cAAc,SAAS,IAAI;CAE1D,OAAO,2BADc,GAAG,WAAW,SACU,CAAC;AAChD;;;;;;AAOA,SAAgB,2BACd,OACkC;CAClC,OAAO;EACL,YAAY,MAAM,WAAW,KAAK,KAAK;EACvC,cAAc,MAAM,aAAa,KAAK,KAAK;EAC3C,MAAM,MAAM,KAAK,KAAK,KAAK;EAC3B,eAAe,MAAM,cAAc,KAAK,KAAK;EAC7C,aAAa,WACX,2BAAoC,MAAM,WAAW,MAAM,CAAC;CAChE;AACF;;;AC/DA,MAAM,6BAA6B,OAAO,IAAI,+BAA+B;;;;;;AAO7E,IAAsB,wBAAtB,MAEqD;CAEvC;CACA;CACA;CAHZ,YACE,YACA,SACA,cACA;EAHU,KAAA,aAAA;EACA,KAAA,UAAA;EACA,KAAA,eAAA;CACT;CAEH,QAAQ,8BAA8B;;;;;CAMtC,OAAO,aAAa,SAAyB;EAC3C,OAAO,GAAG,KAAK,KAAK,GAAG,QAAQ,WAAW,KAAK,GAAG;CACpD;CAEA,OAAO,MAEL,SACA,IACiC;EACjC,OAAO,GAAG,eAAe,KAAK,aAAa,OAAO,CAAC;CACrD;;;;;CAYA,IAAI,SAA0B;EAC5B,OAAO,KAAK;CACd;;;;CAKA,IAAI,YAAoB;EACtB,OAAO,KAAK;CACd;CAEA,IAAI,QAAkD;EACpD,OAAO,2BAA2B,KAAK,YAAY;CACrD;AAaF"}
@@ -1,16 +1,15 @@
1
- import { B as DEFAULT_REGISTRY_URL } from "../types-BIoOWpOT.js";
2
- import { B as RegistryPackageMap, F as PackageInfo, H as RegistryPackageStatus, I as PackageListItem, L as PackagePage, R as RegistryPackage, V as RegistryPackageSource, z as RegistryPackageList } from "../types-DDpRvBK_.js";
1
+ import { V as DEFAULT_REGISTRY_URL } from "../types-CmeoQg_J.js";
2
+ import { B as RegistryPackageMap, F as PackageInfo, H as RegistryPackageStatus, I as PackageListItem, L as PackagePage, R as RegistryPackage, V as RegistryPackageSource, z as RegistryPackageList } from "../types-CI3ren9F.js";
3
3
  import { slimManifest } from "./manifest-slim.js";
4
4
  import { toCdnUrl } from "./urls.js";
5
5
  import { getUpdateTarget, parseInstallSpec } from "./updates.js";
6
-
7
6
  //#region registry/registry.d.ts
8
7
  /**
9
8
  * Extract the host portion of a registry URL — what npm uses as the key in
10
9
  * `~/.npmrc` for per-registry tokens (e.g. `//registry.vetra.io/`).
11
10
  */
12
- declare function registryAuthKey(registryUrl: string): string;
13
- interface ResolveRegistryUrlOptions {
11
+ export declare function registryAuthKey(registryUrl: string): string;
12
+ export interface ResolveRegistryUrlOptions {
14
13
  /** Explicit registry URL (e.g. from --registry flag). Highest priority. */
15
14
  registry?: string;
16
15
  /** Project path to read powerhouse.config.json from. */
@@ -21,13 +20,13 @@ interface ResolveRegistryUrlOptions {
21
20
  /**
22
21
  * Resolve the registry URL with priority: flag > env > config > default.
23
22
  */
24
- declare function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string;
23
+ export declare function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string;
25
24
  /**
26
25
  * Check if the user is authenticated with the given npm registry.
27
26
  * Returns the username on success, throws on failure.
28
27
  */
29
- declare function checkNpmAuth(registryUrl: string): Promise<string>;
30
- interface NpmPublishOptions {
28
+ export declare function checkNpmAuth(registryUrl: string): Promise<string>;
29
+ export interface NpmPublishOptions {
31
30
  /** Registry URL to publish to. */
32
31
  registryUrl: string;
33
32
  /** Working directory (project root). */
@@ -38,7 +37,7 @@ interface NpmPublishOptions {
38
37
  * `_authToken` config flag rather than read from the user's `.npmrc`. */
39
38
  authToken?: string;
40
39
  }
41
- interface NpmPublishResult {
40
+ export interface NpmPublishResult {
42
41
  /** stdout from npm publish. */
43
42
  stdout: string;
44
43
  }
@@ -50,14 +49,14 @@ interface NpmPublishResult {
50
49
  * `--//host/:_authToken=<token>` flag (npm's standard form for per-registry
51
50
  * tokens) so we never have to write to `~/.npmrc`.
52
51
  */
53
- declare function npmPublish(options: NpmPublishOptions): Promise<NpmPublishResult>;
52
+ export declare function npmPublish(options: NpmPublishOptions): Promise<NpmPublishResult>;
54
53
  /**
55
54
  * Write `_authToken=<token>` for the given registry host into `~/.npmrc`,
56
55
  * preserving any other lines. Replaces the existing entry for the same key
57
56
  * if present. Returns the absolute path to the npmrc that was written.
58
57
  */
59
- declare function writeRegistryAuthToken(registryUrl: string, token: string): Promise<string>;
60
- interface NpmUnpublishOptions {
58
+ export declare function writeRegistryAuthToken(registryUrl: string, token: string): Promise<string>;
59
+ export interface NpmUnpublishOptions {
61
60
  /** Registry URL to unpublish from. */
62
61
  registryUrl: string;
63
62
  /** Working directory (project root). */
@@ -69,7 +68,7 @@ interface NpmUnpublishOptions {
69
68
  /** Bearer token for the registry (same semantics as `NpmPublishOptions.authToken`). */
70
69
  authToken?: string;
71
70
  }
72
- interface NpmUnpublishResult {
71
+ export interface NpmUnpublishResult {
73
72
  /** stdout from npm unpublish. */
74
73
  stdout: string;
75
74
  }
@@ -78,7 +77,8 @@ interface NpmUnpublishResult {
78
77
  * Always passes `--force` because npm otherwise refuses to unpublish packages
79
78
  * older than 72h (a public-npmjs safeguard that doesn't apply to private registries).
80
79
  */
81
- declare function npmUnpublish(options: NpmUnpublishOptions): Promise<NpmUnpublishResult>;
80
+ export declare function npmUnpublish(options: NpmUnpublishOptions): Promise<NpmUnpublishResult>;
82
81
  //#endregion
83
- export { DEFAULT_REGISTRY_URL, NpmPublishOptions, NpmPublishResult, NpmUnpublishOptions, NpmUnpublishResult, PackageInfo, PackageListItem, PackagePage, RegistryPackage, RegistryPackageList, RegistryPackageMap, RegistryPackageSource, RegistryPackageStatus, ResolveRegistryUrlOptions, checkNpmAuth, getUpdateTarget, npmPublish, npmUnpublish, parseInstallSpec, registryAuthKey, resolveRegistryUrl, slimManifest, toCdnUrl, writeRegistryAuthToken };
82
+ export { DEFAULT_REGISTRY_URL, type PackageInfo, type PackageListItem, type PackagePage, type RegistryPackage, type RegistryPackageList, type RegistryPackageMap, type RegistryPackageSource, type RegistryPackageStatus, getUpdateTarget, parseInstallSpec, slimManifest, toCdnUrl };
83
+ export {};
84
84
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../registry/registry.ts"],"mappings":";;;;;;;;;;;iBAgBgB,eAAA,CAAgB,WAAA;AAAA,UAQf,yBAAA;;EAEf,QAAA;EAVc;EAYd,WAAA;;EAEA,GAAA,GAAM,MAAA;AAAA;AANR;;;AAAA,iBAYgB,kBAAA,CAAmB,OAAA,EAAS,yBAAA;;;;;iBAiBtB,YAAA,CAAa,WAAA,WAAsB,OAAA;AAAA,UAIxC,iBAAA;EArBD;EAuBd,WAAA;;EAEA,GAAA;EAzBmE;EA2BnE,IAAA;EAVgC;;EAahC,SAAA;AAAA;AAAA,UAGe,gBAAA;EAZiB;EAchC,MAAA;AAAA;;;;;;;AAFF;;iBAasB,UAAA,CACpB,OAAA,EAAS,iBAAA,GACR,OAAA,CAAQ,gBAAA;;;AAFX;;;iBAiBsB,sBAAA,CACpB,WAAA,UACA,KAAA,WACC,OAAA;AAAA,UAmBc,mBAAA;EArCd;EAuCD,WAAA;EAvCQ;EAyCR,GAAA;EA1CA;EA4CA,IAAA;EA3CS;EA6CT,IAAA;EA7CyB;EA+CzB,SAAA;AAAA;AAAA,UAGe,kBAAA;EAhCP;EAkCR,MAAA;AAAA;;;;AAfF;;iBAuBsB,YAAA,CACpB,OAAA,EAAS,mBAAA,GACR,OAAA,CAAQ,kBAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../registry/registry.ts"],"mappings":";;;;;;;;;;wBAgBgB,gBAAgB;iBAQf;;EAEf;;EAEA;;EAEA,MAAM;;;;;wBAMQ,mBAAmB,SAAS;;;;;wBAiBtB,aAAa,sBAAsB;iBAIxC;;EAEf;;EAEA;;EAEA;;;EAGA;;iBAGe;;EAEf;;;;;;;;;;wBAWoB,WACpB,SAAS,oBACR,QAAQ;;;;;;wBAeW,uBACpB,qBACA,gBACC;iBAmBc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;iBAGe;;EAEf;;;;;;;wBAQoB,aACpB,SAAS,sBACR,QAAQ"}
@@ -7,12 +7,21 @@ import { join } from "node:path";
7
7
  import spawn from "cross-spawn";
8
8
  const DEFAULT_REGISTRY_URL = "https://registry.vetra.io";
9
9
  const POWERHOUSE_CONFIG_FILE = "powerhouse.config.json";
10
- join(homedir(), ".ph");
10
+ const HOME_DIR = homedir();
11
+ join(HOME_DIR, ".ph");
11
12
  const VERSIONED_PEER_DEPENDENCIES = ["document-model", "@powerhousedao/reactor-browser"];
12
- const FEATURE_DEPENDENCIES = { analyticsProcessor: {
13
- peerVersioned: ["@powerhousedao/analytics-engine-core"],
14
- peerExternal: {}
15
- } };
13
+ const FEATURE_DEPENDENCIES = {
14
+ analyticsProcessor: {
15
+ peerVersioned: ["@powerhousedao/analytics-engine-core"],
16
+ peerExternal: {},
17
+ devVersioned: []
18
+ },
19
+ piece: {
20
+ peerVersioned: [],
21
+ peerExternal: {},
22
+ devVersioned: ["@powerhousedao/pieces-framework"]
23
+ }
24
+ };
16
25
  [...VERSIONED_PEER_DEPENDENCIES, ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned];
17
26
  const DEFAULT_CONFIG = {
18
27
  documentModelsDir: "./document-models",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["fs"],"sources":["../../clis/constants.ts","../../clis/file-system/get-config.ts","../../clis/file-system/spawn-async.ts","../../registry/registry.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\n// Per-project dev-server port bands. `ph init` assigns each project a port\n// triple derived from its name, so two projects never collide and an agent's\n// MCP URL can be baked into .mcp.json before a session starts.\n//\n// Two hard constraints picked these bands, both below 10000:\n//\n// 1. Below the OS ephemeral range. Linux allocates outbound source ports\n// from 32768-60999 (`/proc/sys/net/ipv4/ip_local_port_range`); macOS and\n// Windows start at 49152. A listener parked in that window can lose a\n// race to a transient outbound socket, which would surface as a\n// `--strictPort` failure blaming a project conflict that does not exist.\n// 2. Below 10000, which is where ph-clint starts. ph-clint derives its own\n// per-CLI ports by hashing into 10000-59900, so staying under 10000\n// keeps the two schemes from ever contending.\n//\n// Within those limits the blocks were chosen by measuring which ports the\n// Powerhouse repos actually reference: 2000-2999 has none, 7000-7999 has one,\n// 6000-6999 has five. See PROJECT_PORT_DENYLIST in project-ports.ts for the\n// individual ports skipped inside them.\nexport const PROJECT_PORT_BAND_SIZE = 1000 as const;\nexport const PROJECT_PORT_BAND_SWITCHBOARD = 7000 as const;\nexport const PROJECT_PORT_BAND_STUDIO = 6000 as const;\nexport const PROJECT_PORT_BAND_VETRA_CONNECT = 2000 as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.3.6\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n },\n} as const satisfies Record<\n string,\n { peerVersioned: readonly string[]; peerExternal: Record<string, PeerSpec> }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// Single-version pins the boilerplate enforces on generated projects,\n// avoiding duplicates from coexisting version ranges. Rendered as pnpm\n// `overrides` (pnpm-workspace.yaml) and as yarn v1 `resolutions`\n// (package.json). Generated-project only — never change the monorepo\n// catalog for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_DEPENDENCY_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n browser: \"./dist/browser/subgraphs/index.js\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n // Node only, as the build is: a piece is loaded by a host process, never by\n // the browser. Without these a package can build a piece and still fail the\n // `packageName/pieces` import a host resolves it through.\n \"./pieces\": {\n types: \"./dist/types/pieces/index.d.ts\",\n node: \"./dist/node/pieces/index.mjs\",\n },\n \"./pieces/*\": {\n types: \"./dist/types/pieces/*/index.d.ts\",\n node: \"./dist/node/pieces/*/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"4.1.1\",\n oxfmt: \"0.55.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"^5.9.3\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"4.1.1\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n","import { readFileSync } from \"node:fs\";\nimport { DEFAULT_CONFIG } from \"../constants.js\";\nimport type { PowerhouseConfig } from \"../types.js\";\n\nexport function getConfig(path = \"./powerhouse.config.json\") {\n let config: PowerhouseConfig = { ...DEFAULT_CONFIG };\n try {\n const configStr = readFileSync(path, \"utf-8\");\n const userConfig = JSON.parse(configStr) as PowerhouseConfig;\n config = { ...config, ...userConfig };\n } catch {\n // console.warn(\"No powerhouse.config.json found, using defaults\");\n }\n\n return config;\n}\n","import spawn from \"cross-spawn\";\n\nexport function spawnAsync(\n command: string,\n args: string[],\n options: {\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n } = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n // cross-spawn rather than node:child_process.spawn. On Windows npm, pnpm\n // and yarn are all `.cmd` shims, and since the fix for CVE-2024-27980\n // (Node 18.20.2 / 20.12.2 / 21.7.3 and later) `spawn` refuses to execute\n // `.bat`/`.cmd` unless `shell: true` -- it throws `spawn EINVAL`, and\n // synchronously, so an `error` listener never sees it. Passing\n // `shell: true` instead would hand the arguments to cmd.exe, which strips\n // quotes and splits on shell metacharacters. cross-spawn resolves the shim\n // and escapes the arguments itself, so the call keeps shell-less argument\n // semantics on every platform.\n const child = spawn(command, args, {\n cwd: options.cwd,\n env: options.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout?.on(\"data\", (d: Buffer) => {\n stdout += d.toString();\n });\n\n child.stderr?.on(\"data\", (d: Buffer) => {\n stderr += d.toString();\n });\n\n child.on(\"error\", reject);\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(stdout.trim());\n } else {\n reject(\n new Error(stderr.trim() || `${command} exited with code ${code}`),\n );\n }\n });\n });\n}\n","import { promises as fs } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n DEFAULT_REGISTRY_URL,\n POWERHOUSE_CONFIG_FILE,\n} from \"../clis/constants.js\";\nimport { getConfig } from \"../clis/file-system/get-config.js\";\nimport { spawnAsync } from \"../clis/file-system/spawn-async.js\";\n\nexport { DEFAULT_REGISTRY_URL } from \"../clis/constants.js\";\n\n/**\n * Extract the host portion of a registry URL — what npm uses as the key in\n * `~/.npmrc` for per-registry tokens (e.g. `//registry.vetra.io/`).\n */\nexport function registryAuthKey(registryUrl: string): string {\n const url = new URL(registryUrl);\n // Always trailing slash; npm's lookup is exact-match against the leading\n // path of the registry URL, with `//` prefix and trailing `/`.\n const path = url.pathname.endsWith(\"/\") ? url.pathname : `${url.pathname}/`;\n return `//${url.host}${path}:_authToken`;\n}\n\nexport interface ResolveRegistryUrlOptions {\n /** Explicit registry URL (e.g. from --registry flag). Highest priority. */\n registry?: string;\n /** Project path to read powerhouse.config.json from. */\n projectPath: string;\n /** Environment variables. Defaults to process.env. */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Resolve the registry URL with priority: flag > env > config > default.\n */\nexport function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string {\n const { registry, projectPath, env = process.env } = options;\n const configPath = join(projectPath, POWERHOUSE_CONFIG_FILE);\n const config = getConfig(configPath);\n\n return (\n registry ??\n env.PH_REGISTRY_URL ??\n config.packageRegistryUrl ??\n DEFAULT_REGISTRY_URL\n );\n}\n\n/**\n * Check if the user is authenticated with the given npm registry.\n * Returns the username on success, throws on failure.\n */\nexport async function checkNpmAuth(registryUrl: string): Promise<string> {\n return spawnAsync(\"npm\", [\"whoami\", \"--registry\", registryUrl]);\n}\n\nexport interface NpmPublishOptions {\n /** Registry URL to publish to. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Additional arguments forwarded to npm publish. */\n args?: string[];\n /** Bearer token for the registry. When set, passed via a registry-scoped\n * `_authToken` config flag rather than read from the user's `.npmrc`. */\n authToken?: string;\n}\n\nexport interface NpmPublishResult {\n /** stdout from npm publish. */\n stdout: string;\n}\n\n/**\n * Run `npm publish` against the given registry.\n * Uses spawn with args array to avoid shell injection.\n *\n * When `authToken` is provided, the token is passed via a registry-scoped\n * `--//host/:_authToken=<token>` flag (npm's standard form for per-registry\n * tokens) so we never have to write to `~/.npmrc`.\n */\nexport async function npmPublish(\n options: NpmPublishOptions,\n): Promise<NpmPublishResult> {\n const { registryUrl, cwd, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\"publish\", \"--registry\", registryUrl, ...tokenArg, ...args];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n\n/**\n * Write `_authToken=<token>` for the given registry host into `~/.npmrc`,\n * preserving any other lines. Replaces the existing entry for the same key\n * if present. Returns the absolute path to the npmrc that was written.\n */\nexport async function writeRegistryAuthToken(\n registryUrl: string,\n token: string,\n): Promise<string> {\n const npmrcPath = join(homedir(), \".npmrc\");\n const key = registryAuthKey(registryUrl);\n let existing = \"\";\n try {\n existing = await fs.readFile(npmrcPath, \"utf8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n const lines = existing.split(\"\\n\");\n const filtered = lines.filter((line) => !line.startsWith(`${key}=`));\n // Also drop any trailing empties to avoid stacking blank lines on rewrite.\n while (filtered.length && filtered[filtered.length - 1] === \"\")\n filtered.pop();\n filtered.push(`${key}=${token}`);\n await fs.writeFile(npmrcPath, `${filtered.join(\"\\n\")}\\n`, \"utf8\");\n return npmrcPath;\n}\n\nexport interface NpmUnpublishOptions {\n /** Registry URL to unpublish from. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Package spec: `<name>` (whole package) or `<name>@<version>` (single version). */\n spec: string;\n /** Additional arguments forwarded to npm unpublish. */\n args?: string[];\n /** Bearer token for the registry (same semantics as `NpmPublishOptions.authToken`). */\n authToken?: string;\n}\n\nexport interface NpmUnpublishResult {\n /** stdout from npm unpublish. */\n stdout: string;\n}\n\n/**\n * Run `npm unpublish` against the given registry.\n * Always passes `--force` because npm otherwise refuses to unpublish packages\n * older than 72h (a public-npmjs safeguard that doesn't apply to private registries).\n */\nexport async function npmUnpublish(\n options: NpmUnpublishOptions,\n): Promise<NpmUnpublishResult> {\n const { registryUrl, cwd, spec, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\n \"unpublish\",\n spec,\n \"--registry\",\n registryUrl,\n \"--force\",\n ...tokenArg,\n ...args,\n ];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":["fs"],"sources":["../../clis/constants.ts","../../clis/file-system/get-config.ts","../../clis/file-system/spawn-async.ts","../../registry/registry.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\n// Per-project dev-server port bands. `ph init` assigns each project a port\n// triple derived from its name, so two projects never collide and an agent's\n// MCP URL can be baked into .mcp.json before a session starts.\n//\n// Two hard constraints picked these bands, both below 10000:\n//\n// 1. Below the OS ephemeral range. Linux allocates outbound source ports\n// from 32768-60999 (`/proc/sys/net/ipv4/ip_local_port_range`); macOS and\n// Windows start at 49152. A listener parked in that window can lose a\n// race to a transient outbound socket, which would surface as a\n// `--strictPort` failure blaming a project conflict that does not exist.\n// 2. Below 10000, which is where ph-clint starts. ph-clint derives its own\n// per-CLI ports by hashing into 10000-59900, so staying under 10000\n// keeps the two schemes from ever contending.\n//\n// Within those limits the blocks were chosen by measuring which ports the\n// Powerhouse repos actually reference: 2000-2999 has none, 7000-7999 has one,\n// 6000-6999 has five. See PROJECT_PORT_DENYLIST in project-ports.ts for the\n// individual ports skipped inside them.\nexport const PROJECT_PORT_BAND_SIZE = 1000 as const;\nexport const PROJECT_PORT_BAND_SWITCHBOARD = 7000 as const;\nexport const PROJECT_PORT_BAND_STUDIO = 6000 as const;\nexport const PROJECT_PORT_BAND_VETRA_CONNECT = 2000 as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\nexport const PIECES_FRAMEWORK_PACKAGE = \"@powerhousedao/pieces-framework\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.3.6\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required. `devVersioned`\n// is for a workspace package the build inlines, which no consumer provides.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n devVersioned: [],\n },\n // Each piece is bundled whole (build-pieces.mts), framework included, so the\n // framework is only ever needed to compile the piece's own source.\n piece: {\n peerVersioned: [],\n peerExternal: {},\n devVersioned: [PIECES_FRAMEWORK_PACKAGE],\n },\n} as const satisfies Record<\n string,\n {\n peerVersioned: readonly string[];\n peerExternal: Record<string, PeerSpec>;\n devVersioned: readonly string[];\n }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// Single-version pins the boilerplate enforces on generated projects,\n// avoiding duplicates from coexisting version ranges. Rendered as pnpm\n// `overrides` (pnpm-workspace.yaml) and as yarn v1 `resolutions`\n// (package.json). Generated-project only — never change the monorepo\n// catalog for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_DEPENDENCY_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n browser: \"./dist/browser/subgraphs/index.js\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n // Node only, as the build is: a piece is loaded by a host process, never by\n // the browser. Without these a package can build a piece and still fail the\n // `packageName/pieces` import a host resolves it through.\n \"./pieces\": {\n types: \"./dist/types/pieces/index.d.ts\",\n node: \"./dist/node/pieces/index.mjs\",\n },\n \"./pieces/*\": {\n types: \"./dist/types/pieces/*/index.d.ts\",\n node: \"./dist/node/pieces/*/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"4.1.1\",\n oxfmt: \"0.68.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"~7.0.2\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"4.1.1\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n","import { readFileSync } from \"node:fs\";\nimport { DEFAULT_CONFIG } from \"../constants.js\";\nimport type { PowerhouseConfig } from \"../types.js\";\n\nexport function getConfig(path = \"./powerhouse.config.json\") {\n let config: PowerhouseConfig = { ...DEFAULT_CONFIG };\n try {\n const configStr = readFileSync(path, \"utf-8\");\n const userConfig = JSON.parse(configStr) as PowerhouseConfig;\n config = { ...config, ...userConfig };\n } catch {\n // console.warn(\"No powerhouse.config.json found, using defaults\");\n }\n\n return config;\n}\n","import spawn from \"cross-spawn\";\n\nexport function spawnAsync(\n command: string,\n args: string[],\n options: {\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n } = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n // cross-spawn rather than node:child_process.spawn. On Windows npm, pnpm\n // and yarn are all `.cmd` shims, and since the fix for CVE-2024-27980\n // (Node 18.20.2 / 20.12.2 / 21.7.3 and later) `spawn` refuses to execute\n // `.bat`/`.cmd` unless `shell: true` -- it throws `spawn EINVAL`, and\n // synchronously, so an `error` listener never sees it. Passing\n // `shell: true` instead would hand the arguments to cmd.exe, which strips\n // quotes and splits on shell metacharacters. cross-spawn resolves the shim\n // and escapes the arguments itself, so the call keeps shell-less argument\n // semantics on every platform.\n const child = spawn(command, args, {\n cwd: options.cwd,\n env: options.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout?.on(\"data\", (d: Buffer) => {\n stdout += d.toString();\n });\n\n child.stderr?.on(\"data\", (d: Buffer) => {\n stderr += d.toString();\n });\n\n child.on(\"error\", reject);\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(stdout.trim());\n } else {\n reject(\n new Error(stderr.trim() || `${command} exited with code ${code}`),\n );\n }\n });\n });\n}\n","import { promises as fs } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n DEFAULT_REGISTRY_URL,\n POWERHOUSE_CONFIG_FILE,\n} from \"../clis/constants.js\";\nimport { getConfig } from \"../clis/file-system/get-config.js\";\nimport { spawnAsync } from \"../clis/file-system/spawn-async.js\";\n\nexport { DEFAULT_REGISTRY_URL } from \"../clis/constants.js\";\n\n/**\n * Extract the host portion of a registry URL — what npm uses as the key in\n * `~/.npmrc` for per-registry tokens (e.g. `//registry.vetra.io/`).\n */\nexport function registryAuthKey(registryUrl: string): string {\n const url = new URL(registryUrl);\n // Always trailing slash; npm's lookup is exact-match against the leading\n // path of the registry URL, with `//` prefix and trailing `/`.\n const path = url.pathname.endsWith(\"/\") ? url.pathname : `${url.pathname}/`;\n return `//${url.host}${path}:_authToken`;\n}\n\nexport interface ResolveRegistryUrlOptions {\n /** Explicit registry URL (e.g. from --registry flag). Highest priority. */\n registry?: string;\n /** Project path to read powerhouse.config.json from. */\n projectPath: string;\n /** Environment variables. Defaults to process.env. */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Resolve the registry URL with priority: flag > env > config > default.\n */\nexport function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string {\n const { registry, projectPath, env = process.env } = options;\n const configPath = join(projectPath, POWERHOUSE_CONFIG_FILE);\n const config = getConfig(configPath);\n\n return (\n registry ??\n env.PH_REGISTRY_URL ??\n config.packageRegistryUrl ??\n DEFAULT_REGISTRY_URL\n );\n}\n\n/**\n * Check if the user is authenticated with the given npm registry.\n * Returns the username on success, throws on failure.\n */\nexport async function checkNpmAuth(registryUrl: string): Promise<string> {\n return spawnAsync(\"npm\", [\"whoami\", \"--registry\", registryUrl]);\n}\n\nexport interface NpmPublishOptions {\n /** Registry URL to publish to. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Additional arguments forwarded to npm publish. */\n args?: string[];\n /** Bearer token for the registry. When set, passed via a registry-scoped\n * `_authToken` config flag rather than read from the user's `.npmrc`. */\n authToken?: string;\n}\n\nexport interface NpmPublishResult {\n /** stdout from npm publish. */\n stdout: string;\n}\n\n/**\n * Run `npm publish` against the given registry.\n * Uses spawn with args array to avoid shell injection.\n *\n * When `authToken` is provided, the token is passed via a registry-scoped\n * `--//host/:_authToken=<token>` flag (npm's standard form for per-registry\n * tokens) so we never have to write to `~/.npmrc`.\n */\nexport async function npmPublish(\n options: NpmPublishOptions,\n): Promise<NpmPublishResult> {\n const { registryUrl, cwd, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\"publish\", \"--registry\", registryUrl, ...tokenArg, ...args];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n\n/**\n * Write `_authToken=<token>` for the given registry host into `~/.npmrc`,\n * preserving any other lines. Replaces the existing entry for the same key\n * if present. Returns the absolute path to the npmrc that was written.\n */\nexport async function writeRegistryAuthToken(\n registryUrl: string,\n token: string,\n): Promise<string> {\n const npmrcPath = join(homedir(), \".npmrc\");\n const key = registryAuthKey(registryUrl);\n let existing = \"\";\n try {\n existing = await fs.readFile(npmrcPath, \"utf8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n const lines = existing.split(\"\\n\");\n const filtered = lines.filter((line) => !line.startsWith(`${key}=`));\n // Also drop any trailing empties to avoid stacking blank lines on rewrite.\n while (filtered.length && filtered[filtered.length - 1] === \"\")\n filtered.pop();\n filtered.push(`${key}=${token}`);\n await fs.writeFile(npmrcPath, `${filtered.join(\"\\n\")}\\n`, \"utf8\");\n return npmrcPath;\n}\n\nexport interface NpmUnpublishOptions {\n /** Registry URL to unpublish from. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Package spec: `<name>` (whole package) or `<name>@<version>` (single version). */\n spec: string;\n /** Additional arguments forwarded to npm unpublish. */\n args?: string[];\n /** Bearer token for the registry (same semantics as `NpmPublishOptions.authToken`). */\n authToken?: string;\n}\n\nexport interface NpmUnpublishResult {\n /** stdout from npm unpublish. */\n stdout: string;\n}\n\n/**\n * Run `npm unpublish` against the given registry.\n * Always passes `--force` because npm otherwise refuses to unpublish packages\n * older than 72h (a public-npmjs safeguard that doesn't apply to private registries).\n */\nexport async function npmUnpublish(\n options: NpmUnpublishOptions,\n): Promise<NpmUnpublishResult> {\n const { registryUrl, cwd, spec, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\n \"unpublish\",\n spec,\n \"--registry\",\n registryUrl,\n \"--force\",\n ...tokenArg,\n ...args,\n ];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n"],"mappings":"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"}
@@ -1,4 +1,5 @@
1
- import { In as Manifest } from "../types-BIoOWpOT.js";
1
+ import { Nn as Manifest } from "../types-CmeoQg_J.js";
2
+ import "../types-CI3ren9F.js";
2
3
  //#region registry/manifest-slim.d.ts
3
4
  /**
4
5
  * Reduce a manifest to the summary fields the package-listing surfaces
@@ -11,7 +12,7 @@ import { In as Manifest } from "../types-BIoOWpOT.js";
11
12
  * blew the localStorage quota in Connect's package manager. Whitelisting
12
13
  * the known fields keeps listings small and drops any such junk.
13
14
  */
14
- declare function slimManifest(manifest: Manifest | null | undefined): Manifest | null;
15
+ export declare function slimManifest(manifest: Manifest | null | undefined): Manifest | null;
15
16
  //#endregion
16
- export { slimManifest };
17
+ export {};
17
18
  //# sourceMappingURL=manifest-slim.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-slim.d.ts","names":[],"sources":["../../registry/manifest-slim.ts"],"mappings":";;;;;;;AAkDA;;;;;;iBAAgB,YAAA,CACd,QAAA,EAAU,QAAA,sBACT,QAAA"}
1
+ {"version":3,"file":"manifest-slim.d.ts","names":[],"sources":["../../registry/manifest-slim.ts"],"mappings":";;;;;;;;;;;;;;wBAsDgB,aACd,UAAU,8BACT"}
@@ -4,8 +4,13 @@ const MODULE_KEYS = [
4
4
  "apps",
5
5
  "editors",
6
6
  "processors",
7
- "subgraphs",
8
- "pieces"
7
+ "subgraphs"
8
+ ];
9
+ const PIECE_KEYS = [
10
+ "version",
11
+ "description",
12
+ "bundle",
13
+ "descriptor"
9
14
  ];
10
15
  function slimModules(modules) {
11
16
  if (!Array.isArray(modules)) return void 0;
@@ -50,8 +55,23 @@ function slimManifest(manifest) {
50
55
  const slimmed = slimModules(raw[key]);
51
56
  if (slimmed) out[key] = slimmed;
52
57
  }
58
+ const pieces = slimPieces(raw.pieces);
59
+ if (pieces) out.pieces = pieces;
53
60
  return out;
54
61
  }
62
+ function slimPieces(modules) {
63
+ const slimmed = slimModules(modules);
64
+ if (!slimmed || !Array.isArray(modules)) return slimmed;
65
+ const entries = modules.filter((entry) => entry !== null && typeof entry === "object");
66
+ return slimmed.map((module, index) => {
67
+ const piece = { ...module };
68
+ for (const key of PIECE_KEYS) {
69
+ const value = entries[index]?.[key];
70
+ if (typeof value === "string") piece[key] = value;
71
+ }
72
+ return piece;
73
+ });
74
+ }
55
75
  //#endregion
56
76
  export { slimManifest };
57
77
 
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-slim.js","names":[],"sources":["../../registry/manifest-slim.ts"],"sourcesContent":["// Browser-safe (no node imports): Connect's package-manager hook deep-imports\n// this module, so it must not pull in the node:fs helpers that live behind\n// the registry barrel.\nimport type { Manifest } from \"types\";\n\ntype ModuleLike = { id?: unknown; name?: unknown; documentTypes?: unknown };\n\nconst MODULE_KEYS = [\n \"documentModels\",\n \"apps\",\n \"editors\",\n \"processors\",\n \"subgraphs\",\n \"pieces\",\n] as const;\n\nfunction slimModules(\n modules: unknown,\n): { id: string; name: string; documentTypes?: string[] }[] | undefined {\n if (!Array.isArray(modules)) return undefined;\n const out: { id: string; name: string; documentTypes?: string[] }[] = [];\n for (const entry of modules) {\n if (entry === null || typeof entry !== \"object\") continue;\n const { id, name, documentTypes } = entry as ModuleLike;\n out.push({\n id: typeof id === \"string\" ? id : \"\",\n name: typeof name === \"string\" ? name : \"\",\n ...(Array.isArray(documentTypes)\n ? {\n documentTypes: documentTypes.filter(\n (d): d is string => typeof d === \"string\",\n ),\n }\n : {}),\n });\n }\n return out;\n}\n\n/**\n * Reduce a manifest to the summary fields the package-listing surfaces\n * actually consume: name, description, category, publisher, and the\n * id/name/documentTypes of each module.\n *\n * Manifests arrive from the registry as unvalidated JSON, and real-world\n * publishes have carried multi-megabyte unknown fields (e.g. an agent\n * manifest's `features` blob) that made `/packages` an 8 MB response and\n * blew the localStorage quota in Connect's package manager. Whitelisting\n * the known fields keeps listings small and drops any such junk.\n */\nexport function slimManifest(\n manifest: Manifest | null | undefined,\n): Manifest | null {\n if (manifest === null || manifest === undefined) return null;\n if (typeof manifest !== \"object\") return null;\n const raw = manifest as Record<string, unknown>;\n\n const out: Manifest = {\n name: typeof raw.name === \"string\" ? raw.name : \"\",\n };\n if (typeof raw.description === \"string\") out.description = raw.description;\n if (typeof raw.category === \"string\") out.category = raw.category;\n if (raw.publisher !== null && typeof raw.publisher === \"object\") {\n const publisher = raw.publisher as { name?: unknown; url?: unknown };\n out.publisher = {\n ...(typeof publisher.name === \"string\" ? { name: publisher.name } : {}),\n ...(typeof publisher.url === \"string\" ? { url: publisher.url } : {}),\n };\n }\n for (const key of MODULE_KEYS) {\n const slimmed = slimModules(raw[key]);\n if (slimmed) out[key] = slimmed;\n }\n return out;\n}\n"],"mappings":";AAOA,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAS,YACP,SACsE;AACtE,KAAI,CAAC,MAAM,QAAQ,QAAQ,CAAE,QAAO,KAAA;CACpC,MAAM,MAAgE,EAAE;AACxE,MAAK,MAAM,SAAS,SAAS;AAC3B,MAAI,UAAU,QAAQ,OAAO,UAAU,SAAU;EACjD,MAAM,EAAE,IAAI,MAAM,kBAAkB;AACpC,MAAI,KAAK;GACP,IAAI,OAAO,OAAO,WAAW,KAAK;GAClC,MAAM,OAAO,SAAS,WAAW,OAAO;GACxC,GAAI,MAAM,QAAQ,cAAc,GAC5B,EACE,eAAe,cAAc,QAC1B,MAAmB,OAAO,MAAM,SAClC,EACF,GACD,EAAE;GACP,CAAC;;AAEJ,QAAO;;;;;;;;;;;;;AAcT,SAAgB,aACd,UACiB;AACjB,KAAI,aAAa,QAAQ,aAAa,KAAA,EAAW,QAAO;AACxD,KAAI,OAAO,aAAa,SAAU,QAAO;CACzC,MAAM,MAAM;CAEZ,MAAM,MAAgB,EACpB,MAAM,OAAO,IAAI,SAAS,WAAW,IAAI,OAAO,IACjD;AACD,KAAI,OAAO,IAAI,gBAAgB,SAAU,KAAI,cAAc,IAAI;AAC/D,KAAI,OAAO,IAAI,aAAa,SAAU,KAAI,WAAW,IAAI;AACzD,KAAI,IAAI,cAAc,QAAQ,OAAO,IAAI,cAAc,UAAU;EAC/D,MAAM,YAAY,IAAI;AACtB,MAAI,YAAY;GACd,GAAI,OAAO,UAAU,SAAS,WAAW,EAAE,MAAM,UAAU,MAAM,GAAG,EAAE;GACtE,GAAI,OAAO,UAAU,QAAQ,WAAW,EAAE,KAAK,UAAU,KAAK,GAAG,EAAE;GACpE;;AAEH,MAAK,MAAM,OAAO,aAAa;EAC7B,MAAM,UAAU,YAAY,IAAI,KAAK;AACrC,MAAI,QAAS,KAAI,OAAO;;AAE1B,QAAO"}
1
+ {"version":3,"file":"manifest-slim.js","names":[],"sources":["../../registry/manifest-slim.ts"],"sourcesContent":["// Browser-safe (no node imports): Connect's package-manager hook deep-imports\n// this module, so it must not pull in the node:fs helpers that live behind\n// the registry barrel.\nimport type { Manifest, PieceModule } from \"types\";\n\ntype ModuleLike = { id?: unknown; name?: unknown; documentTypes?: unknown };\n\nconst MODULE_KEYS = [\n \"documentModels\",\n \"apps\",\n \"editors\",\n \"processors\",\n \"subgraphs\",\n] as const;\n\n// What `ph build` adds to a piece entry, kept because a listing is how a piece\n// is found before anyone installs its package. The logo and the property\n// schemas live in the descriptor the entry points at, not here.\nconst PIECE_KEYS = [\"version\", \"description\", \"bundle\", \"descriptor\"] as const;\n\nfunction slimModules(\n modules: unknown,\n): { id: string; name: string; documentTypes?: string[] }[] | undefined {\n if (!Array.isArray(modules)) return undefined;\n const out: { id: string; name: string; documentTypes?: string[] }[] = [];\n for (const entry of modules) {\n if (entry === null || typeof entry !== \"object\") continue;\n const { id, name, documentTypes } = entry as ModuleLike;\n out.push({\n id: typeof id === \"string\" ? id : \"\",\n name: typeof name === \"string\" ? name : \"\",\n ...(Array.isArray(documentTypes)\n ? {\n documentTypes: documentTypes.filter(\n (d): d is string => typeof d === \"string\",\n ),\n }\n : {}),\n });\n }\n return out;\n}\n\n/**\n * Reduce a manifest to the summary fields the package-listing surfaces\n * actually consume: name, description, category, publisher, and the\n * id/name/documentTypes of each module.\n *\n * Manifests arrive from the registry as unvalidated JSON, and real-world\n * publishes have carried multi-megabyte unknown fields (e.g. an agent\n * manifest's `features` blob) that made `/packages` an 8 MB response and\n * blew the localStorage quota in Connect's package manager. Whitelisting\n * the known fields keeps listings small and drops any such junk.\n */\nexport function slimManifest(\n manifest: Manifest | null | undefined,\n): Manifest | null {\n if (manifest === null || manifest === undefined) return null;\n if (typeof manifest !== \"object\") return null;\n const raw = manifest as Record<string, unknown>;\n\n const out: Manifest = {\n name: typeof raw.name === \"string\" ? raw.name : \"\",\n };\n if (typeof raw.description === \"string\") out.description = raw.description;\n if (typeof raw.category === \"string\") out.category = raw.category;\n if (raw.publisher !== null && typeof raw.publisher === \"object\") {\n const publisher = raw.publisher as { name?: unknown; url?: unknown };\n out.publisher = {\n ...(typeof publisher.name === \"string\" ? { name: publisher.name } : {}),\n ...(typeof publisher.url === \"string\" ? { url: publisher.url } : {}),\n };\n }\n for (const key of MODULE_KEYS) {\n const slimmed = slimModules(raw[key]);\n if (slimmed) out[key] = slimmed;\n }\n const pieces = slimPieces(raw.pieces);\n if (pieces) out.pieces = pieces;\n return out;\n}\n\nfunction slimPieces(modules: unknown): PieceModule[] | undefined {\n const slimmed = slimModules(modules);\n if (!slimmed || !Array.isArray(modules)) return slimmed;\n const entries = modules.filter(\n (entry): entry is Record<string, unknown> =>\n entry !== null && typeof entry === \"object\",\n );\n return slimmed.map((module, index) => {\n const piece: PieceModule = { ...module };\n for (const key of PIECE_KEYS) {\n const value = entries[index]?.[key];\n if (typeof value === \"string\") piece[key] = value;\n }\n return piece;\n });\n}\n"],"mappings":";AAOA,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;AACF;AAKA,MAAM,aAAa;CAAC;CAAW;CAAe;CAAU;AAAY;AAEpE,SAAS,YACP,SACsE;CACtE,IAAI,CAAC,MAAM,QAAQ,OAAO,GAAG,OAAO,KAAA;CACpC,MAAM,MAAgE,CAAC;CACvE,KAAK,MAAM,SAAS,SAAS;EAC3B,IAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;EACjD,MAAM,EAAE,IAAI,MAAM,kBAAkB;EACpC,IAAI,KAAK;GACP,IAAI,OAAO,OAAO,WAAW,KAAK;GAClC,MAAM,OAAO,SAAS,WAAW,OAAO;GACxC,GAAI,MAAM,QAAQ,aAAa,IAC3B,EACE,eAAe,cAAc,QAC1B,MAAmB,OAAO,MAAM,QACnC,EACF,IACA,CAAC;EACP,CAAC;CACH;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,aACd,UACiB;CACjB,IAAI,aAAa,QAAQ,aAAa,KAAA,GAAW,OAAO;CACxD,IAAI,OAAO,aAAa,UAAU,OAAO;CACzC,MAAM,MAAM;CAEZ,MAAM,MAAgB,EACpB,MAAM,OAAO,IAAI,SAAS,WAAW,IAAI,OAAO,GAClD;CACA,IAAI,OAAO,IAAI,gBAAgB,UAAU,IAAI,cAAc,IAAI;CAC/D,IAAI,OAAO,IAAI,aAAa,UAAU,IAAI,WAAW,IAAI;CACzD,IAAI,IAAI,cAAc,QAAQ,OAAO,IAAI,cAAc,UAAU;EAC/D,MAAM,YAAY,IAAI;EACtB,IAAI,YAAY;GACd,GAAI,OAAO,UAAU,SAAS,WAAW,EAAE,MAAM,UAAU,KAAK,IAAI,CAAC;GACrE,GAAI,OAAO,UAAU,QAAQ,WAAW,EAAE,KAAK,UAAU,IAAI,IAAI,CAAC;EACpE;CACF;CACA,KAAK,MAAM,OAAO,aAAa;EAC7B,MAAM,UAAU,YAAY,IAAI,IAAI;EACpC,IAAI,SAAS,IAAI,OAAO;CAC1B;CACA,MAAM,SAAS,WAAW,IAAI,MAAM;CACpC,IAAI,QAAQ,IAAI,SAAS;CACzB,OAAO;AACT;AAEA,SAAS,WAAW,SAA6C;CAC/D,MAAM,UAAU,YAAY,OAAO;CACnC,IAAI,CAAC,WAAW,CAAC,MAAM,QAAQ,OAAO,GAAG,OAAO;CAChD,MAAM,UAAU,QAAQ,QACrB,UACC,UAAU,QAAQ,OAAO,UAAU,QACvC;CACA,OAAO,QAAQ,KAAK,QAAQ,UAAU;EACpC,MAAM,QAAqB,EAAE,GAAG,OAAO;EACvC,KAAK,MAAM,OAAO,YAAY;GAC5B,MAAM,QAAQ,QAAQ,MAAM,GAAG;GAC/B,IAAI,OAAO,UAAU,UAAU,MAAM,OAAO;EAC9C;EACA,OAAO;CACT,CAAC;AACH"}
@@ -5,7 +5,7 @@
5
5
  * of a scoped name (`@scope/pkg`) — means `latest`. Otherwise the suffix is
6
6
  * a version when it is valid semver, a dist tag otherwise.
7
7
  */
8
- declare function parseInstallSpec(spec?: string): {
8
+ export declare function parseInstallSpec(spec?: string): {
9
9
  kind: "tag";
10
10
  value: string;
11
11
  } | {
@@ -24,7 +24,7 @@ declare function parseInstallSpec(spec?: string): {
24
24
  * semver and the target is strictly newer — equal, older, invalid, or
25
25
  * missing data all yield `undefined` (no downgrade, no guess).
26
26
  */
27
- declare function getUpdateTarget(installed: {
27
+ export declare function getUpdateTarget(installed: {
28
28
  version?: string | null;
29
29
  spec?: string | null;
30
30
  }, info: {
@@ -32,5 +32,5 @@ declare function getUpdateTarget(installed: {
32
32
  latestVersion?: string | null;
33
33
  }): string | undefined;
34
34
  //#endregion
35
- export { getUpdateTarget, parseInstallSpec };
35
+ export {};
36
36
  //# sourceMappingURL=updates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"updates.d.ts","names":[],"sources":["../../registry/updates.ts"],"mappings":";;AAQA;;;;;iBAAgB,gBAAA,CACd,IAAA;EACG,IAAA;EAAa,KAAA;AAAA;EAAoB,IAAA;EAAiB,KAAA;AAAA;;;;;;;;;;;;;iBAoBvC,eAAA,CACd,SAAA;EAAa,OAAA;EAAyB,IAAA;AAAA,GACtC,IAAA;EACE,QAAA,GAAW,MAAA;EACX,aAAA;AAAA"}
1
+ {"version":3,"file":"updates.d.ts","names":[],"sources":["../../registry/updates.ts"],"mappings":";;;;;;;wBAQgB,iBACd;EACG;EAAa;;EAAoB;EAAiB;;;;;;;;;;;;;;wBAoBvC,gBACd;EAAa;EAAyB;GACtC;EACE,WAAW;EACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"updates.js","names":[],"sources":["../../registry/updates.ts"],"sourcesContent":["import { gt, valid } from \"semver\";\n\n/**\n * Split an install spec (`name`, `name@tag`, or `name@version`) into the\n * stream it points at. A missing `@` — or one that is only the scope marker\n * of a scoped name (`@scope/pkg`) — means `latest`. Otherwise the suffix is\n * a version when it is valid semver, a dist tag otherwise.\n */\nexport function parseInstallSpec(\n spec?: string,\n): { kind: \"tag\"; value: string } | { kind: \"version\"; value: string } {\n if (!spec) return { kind: \"tag\", value: \"latest\" };\n const at = spec.lastIndexOf(\"@\");\n if (at <= 0) return { kind: \"tag\", value: \"latest\" };\n const value = spec.slice(at + 1);\n return valid(value) ? { kind: \"version\", value } : { kind: \"tag\", value };\n}\n\n/**\n * Resolve the update target for an installed package: the current value of\n * the user's stream (the dist tag named by the install spec, or `latest`\n * for pinned/bare installs). The `latest` stream is reported by every\n * registry as the package's newest version (`latestVersion`), so it falls\n * back to that when the full dist-tag map is absent; any other stream is\n * only known from the dist-tag map and is never guessed.\n *\n * Returns the target only when it and the installed version are valid\n * semver and the target is strictly newer — equal, older, invalid, or\n * missing data all yield `undefined` (no downgrade, no guess).\n */\nexport function getUpdateTarget(\n installed: { version?: string | null; spec?: string | null },\n info: {\n distTags?: Record<string, string> | null;\n latestVersion?: string | null;\n },\n): string | undefined {\n const parsed = parseInstallSpec(installed.spec ?? undefined);\n const stream = parsed.kind === \"tag\" ? parsed.value : \"latest\";\n const target =\n stream === \"latest\"\n ? (info.distTags?.latest ?? info.latestVersion ?? undefined)\n : info.distTags?.[stream];\n if (!target || !valid(target)) return undefined;\n const installedVersion = installed.version;\n if (!installedVersion || !valid(installedVersion)) return undefined;\n return gt(target, installedVersion) ? target : undefined;\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,iBACd,MACqE;AACrE,KAAI,CAAC,KAAM,QAAO;EAAE,MAAM;EAAO,OAAO;EAAU;CAClD,MAAM,KAAK,KAAK,YAAY,IAAI;AAChC,KAAI,MAAM,EAAG,QAAO;EAAE,MAAM;EAAO,OAAO;EAAU;CACpD,MAAM,QAAQ,KAAK,MAAM,KAAK,EAAE;AAChC,QAAO,MAAM,MAAM,GAAG;EAAE,MAAM;EAAW;EAAO,GAAG;EAAE,MAAM;EAAO;EAAO;;;;;;;;;;;;;;AAe3E,SAAgB,gBACd,WACA,MAIoB;CACpB,MAAM,SAAS,iBAAiB,UAAU,QAAQ,KAAA,EAAU;CAC5D,MAAM,SAAS,OAAO,SAAS,QAAQ,OAAO,QAAQ;CACtD,MAAM,SACJ,WAAW,WACN,KAAK,UAAU,UAAU,KAAK,iBAAiB,KAAA,IAChD,KAAK,WAAW;AACtB,KAAI,CAAC,UAAU,CAAC,MAAM,OAAO,CAAE,QAAO,KAAA;CACtC,MAAM,mBAAmB,UAAU;AACnC,KAAI,CAAC,oBAAoB,CAAC,MAAM,iBAAiB,CAAE,QAAO,KAAA;AAC1D,QAAO,GAAG,QAAQ,iBAAiB,GAAG,SAAS,KAAA"}
1
+ {"version":3,"file":"updates.js","names":[],"sources":["../../registry/updates.ts"],"sourcesContent":["import { gt, valid } from \"semver\";\n\n/**\n * Split an install spec (`name`, `name@tag`, or `name@version`) into the\n * stream it points at. A missing `@` — or one that is only the scope marker\n * of a scoped name (`@scope/pkg`) — means `latest`. Otherwise the suffix is\n * a version when it is valid semver, a dist tag otherwise.\n */\nexport function parseInstallSpec(\n spec?: string,\n): { kind: \"tag\"; value: string } | { kind: \"version\"; value: string } {\n if (!spec) return { kind: \"tag\", value: \"latest\" };\n const at = spec.lastIndexOf(\"@\");\n if (at <= 0) return { kind: \"tag\", value: \"latest\" };\n const value = spec.slice(at + 1);\n return valid(value) ? { kind: \"version\", value } : { kind: \"tag\", value };\n}\n\n/**\n * Resolve the update target for an installed package: the current value of\n * the user's stream (the dist tag named by the install spec, or `latest`\n * for pinned/bare installs). The `latest` stream is reported by every\n * registry as the package's newest version (`latestVersion`), so it falls\n * back to that when the full dist-tag map is absent; any other stream is\n * only known from the dist-tag map and is never guessed.\n *\n * Returns the target only when it and the installed version are valid\n * semver and the target is strictly newer — equal, older, invalid, or\n * missing data all yield `undefined` (no downgrade, no guess).\n */\nexport function getUpdateTarget(\n installed: { version?: string | null; spec?: string | null },\n info: {\n distTags?: Record<string, string> | null;\n latestVersion?: string | null;\n },\n): string | undefined {\n const parsed = parseInstallSpec(installed.spec ?? undefined);\n const stream = parsed.kind === \"tag\" ? parsed.value : \"latest\";\n const target =\n stream === \"latest\"\n ? (info.distTags?.latest ?? info.latestVersion ?? undefined)\n : info.distTags?.[stream];\n if (!target || !valid(target)) return undefined;\n const installedVersion = installed.version;\n if (!installedVersion || !valid(installedVersion)) return undefined;\n return gt(target, installedVersion) ? target : undefined;\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,iBACd,MACqE;CACrE,IAAI,CAAC,MAAM,OAAO;EAAE,MAAM;EAAO,OAAO;CAAS;CACjD,MAAM,KAAK,KAAK,YAAY,GAAG;CAC/B,IAAI,MAAM,GAAG,OAAO;EAAE,MAAM;EAAO,OAAO;CAAS;CACnD,MAAM,QAAQ,KAAK,MAAM,KAAK,CAAC;CAC/B,OAAO,MAAM,KAAK,IAAI;EAAE,MAAM;EAAW;CAAM,IAAI;EAAE,MAAM;EAAO;CAAM;AAC1E;;;;;;;;;;;;;AAcA,SAAgB,gBACd,WACA,MAIoB;CACpB,MAAM,SAAS,iBAAiB,UAAU,QAAQ,KAAA,CAAS;CAC3D,MAAM,SAAS,OAAO,SAAS,QAAQ,OAAO,QAAQ;CACtD,MAAM,SACJ,WAAW,WACN,KAAK,UAAU,UAAU,KAAK,iBAAiB,KAAA,IAChD,KAAK,WAAW;CACtB,IAAI,CAAC,UAAU,CAAC,MAAM,MAAM,GAAG,OAAO,KAAA;CACtC,MAAM,mBAAmB,UAAU;CACnC,IAAI,CAAC,oBAAoB,CAAC,MAAM,gBAAgB,GAAG,OAAO,KAAA;CAC1D,OAAO,GAAG,QAAQ,gBAAgB,IAAI,SAAS,KAAA;AACjD"}
@@ -5,7 +5,7 @@
5
5
  * `<cdn>/<name[@version]>/...` — both Connect's runtime package manager and
6
6
  * the Connect build's PWA-fragment collection resolve packages this way.
7
7
  */
8
- declare function toCdnUrl(registryUrl: string): string;
8
+ export declare function toCdnUrl(registryUrl: string): string;
9
9
  //#endregion
10
- export { toCdnUrl };
10
+ export {};
11
11
  //# sourceMappingURL=urls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"urls.d.ts","names":[],"sources":["../../registry/urls.ts"],"mappings":";;AASA;;;;;iBAAgB,QAAA,CAAS,WAAA"}
1
+ {"version":3,"file":"urls.d.ts","names":[],"sources":["../../registry/urls.ts"],"mappings":";;;;;;;wBASgB,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"urls.js","names":[],"sources":["../../registry/urls.ts"],"sourcesContent":["// Pure URL helpers, kept free of Node imports so the browser SPA can import\n// them directly (like ./manifest-slim.js) without pulling in ./registry.js.\n\n/**\n * Derive the package-CDN base from a registry URL: `/-/cdn` is appended\n * unless the URL already points at the CDN. Packages are then served at\n * `<cdn>/<name[@version]>/...` — both Connect's runtime package manager and\n * the Connect build's PWA-fragment collection resolve packages this way.\n */\nexport function toCdnUrl(registryUrl: string): string {\n if (registryUrl.includes(\"/-/cdn\")) return registryUrl;\n const base = registryUrl.endsWith(\"/\")\n ? registryUrl.slice(0, -1)\n : registryUrl;\n return `${base}/-/cdn`;\n}\n"],"mappings":";;;;;;;AASA,SAAgB,SAAS,aAA6B;AACpD,KAAI,YAAY,SAAS,SAAS,CAAE,QAAO;AAI3C,QAAO,GAHM,YAAY,SAAS,IAAI,GAClC,YAAY,MAAM,GAAG,GAAG,GACxB,YACW"}
1
+ {"version":3,"file":"urls.js","names":[],"sources":["../../registry/urls.ts"],"sourcesContent":["// Pure URL helpers, kept free of Node imports so the browser SPA can import\n// them directly (like ./manifest-slim.js) without pulling in ./registry.js.\n\n/**\n * Derive the package-CDN base from a registry URL: `/-/cdn` is appended\n * unless the URL already points at the CDN. Packages are then served at\n * `<cdn>/<name[@version]>/...` — both Connect's runtime package manager and\n * the Connect build's PWA-fragment collection resolve packages this way.\n */\nexport function toCdnUrl(registryUrl: string): string {\n if (registryUrl.includes(\"/-/cdn\")) return registryUrl;\n const base = registryUrl.endsWith(\"/\")\n ? registryUrl.slice(0, -1)\n : registryUrl;\n return `${base}/-/cdn`;\n}\n"],"mappings":";;;;;;;AASA,SAAgB,SAAS,aAA6B;CACpD,IAAI,YAAY,SAAS,QAAQ,GAAG,OAAO;CAI3C,OAAO,GAHM,YAAY,SAAS,GAAG,IACjC,YAAY,MAAM,GAAG,EAAE,IACvB,YACW;AACjB"}
@@ -1,5 +1,4 @@
1
1
  import { DateTime } from "luxon";
2
-
3
2
  //#region analytics/constants.d.ts
4
3
  declare enum AnalyticsSerializerTypes {
5
4
  AnalyticsPath = 0,
@@ -155,4 +154,5 @@ interface IAnalyticsStore {
155
154
  }
156
155
  //#endregion
157
156
  export { AnalyticsMetric as _, AnalyticsSeriesInput as a, CompoundOperator as b, CompoundAnalyticsExpression as c, ConversionMetric as d, IAnalyticsStore as f, AnalyticsGranularity as g, AnalyticsPathSegment as h, AnalyticsSeries as i, CompoundAnalyticsInputs as l, AnalyticsPath as m, AnalyticsOperand as n, AnalyticsSeriesQuery as o, MultiCurrencyConversion as p, AnalyticsQuery as r, AnalyticsUpdateCallback as s, AnalyticsDimension as t, CompoundAnalyticsQuery as u, AnalyticsPeriodType as v, AnalyticsSerializerTypes as y };
158
- //# sourceMappingURL=types-C1in4fl3.d.ts.map
157
+ export {};
158
+ //# sourceMappingURL=types-Bsp8VL2y.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-Bsp8VL2y.d.ts","names":[],"sources":["../analytics/constants.ts","../analytics/analytics-path.ts","../analytics/types.ts"],"mappings":";;aAAY;EACV;EACA;EACA;;aAGU;EACV;EACA;EACA;;aAGU;EACV;EACA;EACA;EACA;EACA;EACA;;aAEU;EACV;EACA;EACA;EACA;;aAEU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;cC5BW;MACP,YAAY;UAIR;SAEM,WAAW,eAAe;SAQ1B,gBAAgB,qBAAqB;SAMrC,UAAU,UAAU,yBAAyB;SAI7C,SAAS,YAAY;EAOnC,YAAY,UAAU;EAIf;;;;EAOA,SAAS;EAIT,gBAAgB;EAMhB,UAAU;EAUV,SAAS,wBAAwB;;cAW7B;MACP,WAAW;MAGX,UAAU;UAIN;UACA;SAEM,WAAW,kBAAkB;SA0B7B,OAAO;SAKP,SAAS;EAKvB,YAAY,UAAS,iBAAwB,SAAQ;EAK9C;;;;EAOA;;KAsBJ;;;KC7JO;EACV,OAAO;EACP,KAAK;EACL;EACA,WAAW;EACX,QAAQ,eAAe;;KAEb,iBAAiB;EAC3B,aAAa;EACb,KAAK;;KAEK,gBAAgB,aAAa;EACvC,QAAQ;EACR,OAAO;EACP,KAAK;EACL;EACA;EACA;EACA;EACA,QAAQ;EACR,YAAY,eAAe;;KAEjB;EACV,MAAM;EACN;EACA;EACA;;KAEU;EACV,OAAO;EACP,KAAK;EACL,aAAa;EACb,KAAK;EACL,QAAQ,eAAe;EACvB,YAAY;;KAEF;EACV,QAAQ;EACR,UAAU;EACV,SAAS;EACT,iBAAiB;;KAEP;EACV;EACA,WAAW;;KAED;EACV;EACA,WAAW;EACX;;KAEU;EACV,iBAAiB;EACjB,aAAa;;KAEH;EACV;EACA,WAAW;;KAGD;EACV,OAAO;EACP,MAAM;EACN,QAAQ;EACR;EACA;EACA;EACA;EACA,SAAS;EACT,YAAY,eAAe;EAC3B,oBAAoB;;KAGV,2BAA2B,QAAQ;UAE9B;EACf,sBACE,QAAQ,eACR,gCACG;EACL,qCAAqC;EACrC,oBACE,OAAO,yBACJ,QAAQ;EACb,iBAAiB,OAAO,yBAAyB;EACjD,kBAAkB,QAAQ,2BAA2B;EACrD,qBAAqB;EAErB,oBACE,QAAQ,eACR,UAAU"}
@@ -1,6 +1,6 @@
1
- import { In as Manifest, Kt as DocumentModelModule, Nc as Action, Qu as PHBaseState, Rn as Maybe, Ta as SignalDispatch, ql as PHDocument, wn as InputMaybe, xi as Scalars } from "./types-BIoOWpOT.js";
2
- import { DocumentDriveLocalState, Node } from "@powerhousedao/shared/document-drive";
3
-
1
+ import "./types-Bsp8VL2y.js";
2
+ import { Bu as PHBaseState, Fn as Maybe, Kl as PHDocument, Nn as Manifest, Pc as Action, Tn as InputMaybe, ga as SignalDispatch, mi as Scalars, qt as DocumentModelModule } from "./types-CmeoQg_J.js";
3
+ import "./index-D6833Siv.js";
4
4
  //#region document-drive/gen/drive/actions.d.ts
5
5
  type SetDriveNameAction = Action & {
6
6
  type: "SET_DRIVE_NAME";
@@ -38,12 +38,12 @@ type DocumentDriveDriveAction = SetDriveNameAction | SetDriveIconAction | SetSha
38
38
  interface DocumentDriveDriveOperations {
39
39
  setDriveNameOperation: (state: DocumentDriveGlobalState, action: SetDriveNameAction, dispatch?: SignalDispatch) => void;
40
40
  setDriveIconOperation: (state: DocumentDriveGlobalState, action: SetDriveIconAction, dispatch?: SignalDispatch) => void;
41
- setSharingTypeOperation: (state: DocumentDriveLocalState$1, action: SetSharingTypeAction, dispatch?: SignalDispatch) => void;
42
- setAvailableOfflineOperation: (state: DocumentDriveLocalState$1, action: SetAvailableOfflineAction, dispatch?: SignalDispatch) => void;
43
- addListenerOperation: (state: DocumentDriveLocalState$1, action: AddListenerAction, dispatch?: SignalDispatch) => void;
44
- removeListenerOperation: (state: DocumentDriveLocalState$1, action: RemoveListenerAction, dispatch?: SignalDispatch) => void;
45
- addTriggerOperation: (state: DocumentDriveLocalState$1, action: AddTriggerAction, dispatch?: SignalDispatch) => void;
46
- removeTriggerOperation: (state: DocumentDriveLocalState$1, action: RemoveTriggerAction, dispatch?: SignalDispatch) => void;
41
+ setSharingTypeOperation: (state: DocumentDriveLocalState, action: SetSharingTypeAction, dispatch?: SignalDispatch) => void;
42
+ setAvailableOfflineOperation: (state: DocumentDriveLocalState, action: SetAvailableOfflineAction, dispatch?: SignalDispatch) => void;
43
+ addListenerOperation: (state: DocumentDriveLocalState, action: AddListenerAction, dispatch?: SignalDispatch) => void;
44
+ removeListenerOperation: (state: DocumentDriveLocalState, action: RemoveListenerAction, dispatch?: SignalDispatch) => void;
45
+ addTriggerOperation: (state: DocumentDriveLocalState, action: AddTriggerAction, dispatch?: SignalDispatch) => void;
46
+ removeTriggerOperation: (state: DocumentDriveLocalState, action: RemoveTriggerAction, dispatch?: SignalDispatch) => void;
47
47
  }
48
48
  //#endregion
49
49
  //#region document-drive/gen/node/actions.d.ts
@@ -103,29 +103,10 @@ type LegacyAddFileAction = Action & {
103
103
  input: LegacyAddFileInput;
104
104
  };
105
105
  //#endregion
106
- //#region document-drive/src/types.d.ts
107
- type GenerateNodesCopySrc = {
108
- srcId: Node["id"];
109
- targetName?: Node["name"];
110
- targetParentFolder?: Node["parentFolder"];
111
- };
112
- type GenerateNodesCopyIdGenerator = (nodeToCopy: Node) => Node["id"];
113
- type DriveInput = {
114
- global: {
115
- name: string;
116
- icon?: string | null;
117
- };
118
- id?: string;
119
- slug?: string;
120
- preferredEditor?: string;
121
- local?: Partial<DocumentDriveLocalState>;
122
- };
123
- type SharingType = "LOCAL" | "CLOUD" | "PUBLIC";
124
- //#endregion
125
106
  //#region document-drive/types.d.ts
126
107
  type DocumentDrivePHState$1 = PHBaseState & {
127
108
  global: DocumentDriveGlobalState;
128
- local: DocumentDriveLocalState$1;
109
+ local: DocumentDriveLocalState;
129
110
  };
130
111
  type DriveDocumentModelModule = DocumentModelModule<DocumentDrivePHState$1>;
131
112
  //#endregion
@@ -186,6 +167,12 @@ type RegistryPackageStatus = "available" | "local-install" | "registry-install"
186
167
  type RegistryPackageSource = "available" | "local-install" | "registry-install" | "common" | "project";
187
168
  type RegistryPackage = PackageInfo & {
188
169
  status: RegistryPackageStatus;
170
+ /**
171
+ * Shared-dependency version mismatches against the Connect build's version
172
+ * table, pre-formatted (see `formatSharedDepWarnings`). Absent when the
173
+ * host has no shared-deps table (vendor-off / dev) or none were found.
174
+ */
175
+ sharedDepWarnings?: string[];
189
176
  };
190
177
  type RegistryPackageMap = Record<string, RegistryPackage | undefined>;
191
178
  type RegistryPackageList = RegistryPackage[];
@@ -217,7 +204,7 @@ type CopyNodeInput = {
217
204
  type DeleteNodeInput = {
218
205
  id: Scalars["ID"]["input"];
219
206
  };
220
- type DocumentDriveLocalState$1 = {
207
+ type DocumentDriveLocalState = {
221
208
  availableOffline: Scalars["Boolean"]["output"];
222
209
  listeners: Array<Listener>;
223
210
  sharingType: Maybe<Scalars["String"]["output"]>;
@@ -226,11 +213,11 @@ type DocumentDriveLocalState$1 = {
226
213
  type DocumentDriveGlobalState = {
227
214
  icon: Maybe<Scalars["String"]["output"]>;
228
215
  name: Scalars["String"]["output"];
229
- nodes: Array<Node$1>;
216
+ nodes: Array<Node>;
230
217
  };
231
218
  type DocumentDrivePHState = PHBaseState & {
232
219
  global: DocumentDriveGlobalState;
233
- local: DocumentDriveLocalState$1;
220
+ local: DocumentDriveLocalState;
234
221
  };
235
222
  type FileNode = {
236
223
  documentType: Scalars["String"]["output"];
@@ -287,7 +274,7 @@ type MoveNodeInput = {
287
274
  srcFolder: Scalars["ID"]["input"];
288
275
  targetParentFolder?: InputMaybe<Scalars["ID"]["input"]>;
289
276
  };
290
- type Node$1 = FileNode | FolderNode;
277
+ type Node = FileNode | FolderNode;
291
278
  type PullResponderTriggerData = {
292
279
  interval: Scalars["String"]["output"];
293
280
  listenerId: Scalars["ID"]["output"];
@@ -341,5 +328,6 @@ type UpdateNodeInput = {
341
328
  parentFolder?: InputMaybe<Scalars["ID"]["input"]>;
342
329
  };
343
330
  //#endregion
344
- export { LegacySynchronizationUnit as $, TriggerData as A, RegistryPackageMap as B, RemoveTriggerInput as C, SetSharingTypeInput as D, SetDriveNameInput as E, PackageInfo as F, DriveInput as G, RegistryPackageStatus as H, PackageListItem as I, SharingType as J, GenerateNodesCopyIdGenerator as K, PackagePage as L, TriggerType as M, UpdateFileInput as N, TransmitterType as O, UpdateNodeInput as P, LegacyAddFileInput as Q, RegistryPackage as R, RemoveListenerInput as S, SetDriveIconInput as T, DocumentDrivePHState$1 as U, RegistryPackageSource as V, DriveDocumentModelModule as W, DocumentDriveDocument as X, DocumentDriveAction as Y, LegacyAddFileAction as Z, ListenerInput as _, SetDriveNameAction as _t, CopyNodeInput as a, DocumentDriveNodeOperations as at, PullResponderTriggerData as b, DocumentDriveLocalState$1 as c, UpdateNodeAction as ct, FolderNode as d, DocumentDriveDriveAction as dt, AddFileAction as et, Listener as f, DocumentDriveDriveOperations as ft, ListenerFilterInput as g, SetDriveIconAction as gt, ListenerFilter as h, SetAvailableOfflineAction as ht, AddTriggerInput as i, DocumentDriveNodeAction as it, TriggerInput as j, Trigger as k, DocumentDrivePHState as l, AddListenerAction as lt, ListenerCallInfoInput as m, RemoveTriggerAction as mt, AddFolderInput as n, CopyNodeAction as nt, DeleteNodeInput as o, MoveNodeAction as ot, ListenerCallInfo as p, RemoveListenerAction as pt, GenerateNodesCopySrc as q, AddListenerInput as r, DeleteNodeAction as rt, DocumentDriveGlobalState as s, UpdateFileAction as st, AddFileInput as t, AddFolderAction as tt, FileNode as u, AddTriggerAction as ut, MoveNodeInput as v, SetSharingTypeAction as vt, SetAvailableOfflineInput as w, PullResponderTriggerDataInput as x, Node$1 as y, RegistryPackageList as z };
345
- //# sourceMappingURL=types-DDpRvBK_.d.ts.map
331
+ export { DeleteNodeAction as $, TriggerData as A, RegistryPackageMap as B, RemoveTriggerInput as C, SetSharingTypeInput as D, SetDriveNameInput as E, PackageInfo as F, DocumentDriveAction as G, RegistryPackageStatus as H, PackageListItem as I, LegacyAddFileInput as J, DocumentDriveDocument as K, PackagePage as L, TriggerType as M, UpdateFileInput as N, TransmitterType as O, UpdateNodeInput as P, CopyNodeAction as Q, RegistryPackage as R, RemoveListenerInput as S, SetDriveIconInput as T, DocumentDrivePHState$1 as U, RegistryPackageSource as V, DriveDocumentModelModule as W, AddFileAction as X, LegacySynchronizationUnit as Y, AddFolderAction as Z, ListenerInput as _, CopyNodeInput as a, AddListenerAction as at, PullResponderTriggerData as b, DocumentDriveLocalState as c, DocumentDriveDriveOperations as ct, FolderNode as d, SetAvailableOfflineAction as dt, DocumentDriveNodeAction as et, Listener as f, SetDriveIconAction as ft, ListenerFilterInput as g, ListenerFilter as h, AddTriggerInput as i, UpdateNodeAction as it, TriggerInput as j, Trigger as k, DocumentDrivePHState as l, RemoveListenerAction as lt, ListenerCallInfoInput as m, SetSharingTypeAction as mt, AddFolderInput as n, MoveNodeAction as nt, DeleteNodeInput as o, AddTriggerAction as ot, ListenerCallInfo as p, SetDriveNameAction as pt, LegacyAddFileAction as q, AddListenerInput as r, UpdateFileAction as rt, DocumentDriveGlobalState as s, DocumentDriveDriveAction as st, AddFileInput as t, DocumentDriveNodeOperations as tt, FileNode as u, RemoveTriggerAction as ut, MoveNodeInput as v, SetAvailableOfflineInput as w, PullResponderTriggerDataInput as x, Node as y, RegistryPackageList as z };
332
+ export {};
333
+ //# sourceMappingURL=types-CI3ren9F.d.ts.map