@prisma/orm-toolchain 8.0.0-rc.1-dev.45 → 8.0.0-rc.1-dev.46

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 (303) hide show
  1. package/README.md +3 -3
  2. package/dist/{aggregate-BBsCbXgJ.mjs → aggregate-CPZB020V.mjs} +9 -9
  3. package/dist/{aggregate-BBsCbXgJ.mjs.map → aggregate-CPZB020V.mjs.map} +1 -1
  4. package/dist/{aggregate-CA6bJ8UO.d.mts → aggregate-DLUJLq5Y.d.mts} +3 -3
  5. package/dist/{aggregate-CA6bJ8UO.d.mts.map → aggregate-DLUJLq5Y.d.mts.map} +1 -1
  6. package/dist/cli-telemetry.d.mts +19 -5
  7. package/dist/cli-telemetry.d.mts.map +1 -1
  8. package/dist/cli-telemetry.mjs +287 -8
  9. package/dist/cli-telemetry.mjs.map +1 -1
  10. package/dist/cli.d.mts +11 -13
  11. package/dist/cli.d.mts.map +1 -1
  12. package/dist/cli.mjs +5382 -1095
  13. package/dist/cli.mjs.map +1 -1
  14. package/dist/cli__control-api.d.mts +298 -27
  15. package/dist/cli__control-api.d.mts.map +1 -1
  16. package/dist/cli__control-api.mjs +2 -19
  17. package/dist/cli__control-api__testing.d.mts +1 -1
  18. package/dist/cli__control-api__testing.mjs.map +1 -1
  19. package/dist/cli__init-output.d.mts +0 -1
  20. package/dist/cli__init-output.d.mts.map +1 -1
  21. package/dist/cli__init-output.mjs +1 -1
  22. package/dist/cli__migration-cli.mjs +9 -9
  23. package/dist/cli__migration-cli.mjs.map +1 -1
  24. package/dist/config-loader.d.mts +1 -1
  25. package/dist/config-loader.mjs +1 -1
  26. package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs} +4 -4
  27. package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs.map → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs.map} +1 -1
  28. package/dist/{cli-errors-iquUoY6O-BFboxglv.d.mts → db-verify-BwgNK50T-DGvKgFCK.d.mts} +81 -81
  29. package/dist/db-verify-BwgNK50T-DGvKgFCK.d.mts.map +1 -0
  30. package/dist/emitter.d.mts +1 -1
  31. package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs → errors-CXbGUWGu-CstQHPh6.mjs} +2 -2
  32. package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs.map → errors-CXbGUWGu-CstQHPh6.mjs.map} +1 -1
  33. package/dist/{errors-KWM8yBAL.d.mts → errors-D59OCpoI.d.mts} +2 -2
  34. package/dist/{errors-KWM8yBAL.d.mts.map → errors-D59OCpoI.d.mts.map} +1 -1
  35. package/dist/{exports-B3xY_FHp.mjs → exports-8ZUN43ve.mjs} +6 -6
  36. package/dist/exports-8ZUN43ve.mjs.map +1 -0
  37. package/dist/{exports-BZLNbtkY.mjs → exports-BZaG8_w_.mjs} +64 -36
  38. package/dist/exports-BZaG8_w_.mjs.map +1 -0
  39. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs → graph-membership-BViWUMpP-C4lYYJdU.mjs} +2 -2
  40. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs.map → graph-membership-BViWUMpP-C4lYYJdU.mjs.map} +1 -1
  41. package/dist/{import-roots-NDOIEDVj.mjs → import-roots-CNFBPAT1.mjs} +10 -3
  42. package/dist/{import-roots-NDOIEDVj.mjs.map → import-roots-CNFBPAT1.mjs.map} +1 -1
  43. package/dist/{import-roots-B6CtsWXb.d.mts → import-roots-CfoYgejL.d.mts} +2 -2
  44. package/dist/{import-roots-B6CtsWXb.d.mts.map → import-roots-CfoYgejL.d.mts.map} +1 -1
  45. package/dist/{index-mCsi_ND5.d.mts → index-DRs7L6N0.d.mts} +11 -3
  46. package/dist/index-DRs7L6N0.d.mts.map +1 -0
  47. package/dist/{index-CnOyYxmv.d.mts → index-Dgwl8Tzs.d.mts} +2 -2
  48. package/dist/{index-CnOyYxmv.d.mts.map → index-Dgwl8Tzs.d.mts.map} +1 -1
  49. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs → invariants-CTHy88OP-CYI2a8IO.mjs} +2 -2
  50. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs.map → invariants-CTHy88OP-CYI2a8IO.mjs.map} +1 -1
  51. package/dist/{io-635GlNx1-D94PxRc-.mjs → io-635GlNx1-D3zrw2qu.mjs} +4 -4
  52. package/dist/{io-635GlNx1-D94PxRc-.mjs.map → io-635GlNx1-D3zrw2qu.mjs.map} +1 -1
  53. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs → migration-graph-_SJImD5V-BURyY1KM.mjs} +2 -2
  54. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs.map → migration-graph-_SJImD5V-BURyY1KM.mjs.map} +1 -1
  55. package/dist/{migration-gubSSeMk.mjs → migration-hspPIEeV.mjs} +4 -4
  56. package/dist/{migration-gubSSeMk.mjs.map → migration-hspPIEeV.mjs.map} +1 -1
  57. package/dist/migration-tools.d.mts +4 -4
  58. package/dist/migration-tools.mjs +13 -13
  59. package/dist/migration-tools__aggregate.d.mts +1 -1
  60. package/dist/migration-tools__aggregate.mjs +1 -1
  61. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  62. package/dist/migration-tools__errors.d.mts +1 -1
  63. package/dist/migration-tools__errors.mjs +1 -1
  64. package/dist/migration-tools__invariants.mjs +1 -1
  65. package/dist/migration-tools__io.mjs +1 -1
  66. package/dist/migration-tools__migration-graph.mjs +2 -2
  67. package/dist/migration-tools__migration-ts.mjs +1 -1
  68. package/dist/migration-tools__migration.mjs +1 -1
  69. package/dist/migration-tools__ref-resolution.mjs +1 -1
  70. package/dist/migration-tools__refs.mjs +1 -1
  71. package/dist/migration-tools__spaces.d.mts +2 -2
  72. package/dist/migration-tools__spaces.mjs +2 -2
  73. package/dist/{migration-ts-BoHxxGvi.mjs → migration-ts-DdVm0rws.mjs} +2 -2
  74. package/dist/{migration-ts-BoHxxGvi.mjs.map → migration-ts-DdVm0rws.mjs.map} +1 -1
  75. package/dist/{output-DP3woAjV-BxCr9nHA.mjs → output-CovTDY14-CUoAqLML.mjs} +3 -45
  76. package/dist/output-CovTDY14-CUoAqLML.mjs.map +1 -0
  77. package/dist/publish-surface.d.mts +2 -2
  78. package/dist/publish-surface.mjs +2 -2
  79. package/dist/publish-surface__import-roots.d.mts +1 -1
  80. package/dist/publish-surface__import-roots.mjs +1 -1
  81. package/dist/publish-surface__shells.d.mts +1 -1
  82. package/dist/publish-surface__shells.mjs +1 -1
  83. package/dist/quick-reference-mongo.md +12 -9
  84. package/dist/quick-reference-postgres.md +12 -9
  85. package/dist/readme-mongo.md +2 -2
  86. package/dist/readme-postgres.md +2 -2
  87. package/dist/ref-h6InR6dO-rGfl18Jv.mjs +4686 -0
  88. package/dist/ref-h6InR6dO-rGfl18Jv.mjs.map +1 -0
  89. package/dist/{ref-resolution-sGcINe7o.mjs → ref-resolution-HeNBXW53.mjs} +2 -2
  90. package/dist/{ref-resolution-sGcINe7o.mjs.map → ref-resolution-HeNBXW53.mjs.map} +1 -1
  91. package/dist/{refs-WK86uYYp-B6EZkmmT.mjs → refs-WK86uYYp-gM8tvWQP.mjs} +2 -2
  92. package/dist/{refs-WK86uYYp-B6EZkmmT.mjs.map → refs-WK86uYYp-gM8tvWQP.mjs.map} +1 -1
  93. package/dist/{shells-BenrJHp2.mjs → shells-C4HbRAr5.mjs} +13 -14
  94. package/dist/shells-C4HbRAr5.mjs.map +1 -0
  95. package/dist/{shells-COHV_Ozf.d.mts → shells-CIUmT4u4.d.mts} +14 -20
  96. package/dist/shells-CIUmT4u4.d.mts.map +1 -0
  97. package/dist/{spaces-BG2w0P8d.mjs → spaces-4qMOAYE9.mjs} +7 -7
  98. package/dist/{spaces-BG2w0P8d.mjs.map → spaces-4qMOAYE9.mjs.map} +1 -1
  99. package/dist/{spaces-tWQi7CUv.d.mts → spaces-Dj65JrwZ.d.mts} +2 -2
  100. package/dist/{spaces-tWQi7CUv.d.mts.map → spaces-Dj65JrwZ.d.mts.map} +1 -1
  101. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts} +3 -3
  102. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts.map} +1 -1
  103. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs} +4 -4
  104. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map} +1 -1
  105. package/dist/vite-plugin-contract-emit.d.mts +2 -2
  106. package/dist/vite-plugin-contract-emit.mjs +5 -5
  107. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  108. package/package.json +14 -38
  109. package/dist/bin__prisma-next.mjs +0 -512
  110. package/dist/bin__prisma-next.mjs.map +0 -1
  111. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs +0 -14
  112. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs.map +0 -1
  113. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs +0 -347
  114. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs.map +0 -1
  115. package/dist/cli-errors-iquUoY6O-BFboxglv.d.mts.map +0 -1
  116. package/dist/cli__commands__contract-emit.d.mts +0 -2
  117. package/dist/cli__commands__contract-emit.mjs +0 -2
  118. package/dist/cli__commands__contract-infer.d.mts +0 -7
  119. package/dist/cli__commands__contract-infer.d.mts.map +0 -1
  120. package/dist/cli__commands__contract-infer.mjs +0 -2
  121. package/dist/cli__commands__db-init.d.mts +0 -7
  122. package/dist/cli__commands__db-init.d.mts.map +0 -1
  123. package/dist/cli__commands__db-init.mjs +0 -2
  124. package/dist/cli__commands__db-schema.d.mts +0 -7
  125. package/dist/cli__commands__db-schema.d.mts.map +0 -1
  126. package/dist/cli__commands__db-schema.mjs +0 -2
  127. package/dist/cli__commands__db-sign.d.mts +0 -7
  128. package/dist/cli__commands__db-sign.d.mts.map +0 -1
  129. package/dist/cli__commands__db-sign.mjs +0 -2
  130. package/dist/cli__commands__db-update.d.mts +0 -7
  131. package/dist/cli__commands__db-update.d.mts.map +0 -1
  132. package/dist/cli__commands__db-update.mjs +0 -2
  133. package/dist/cli__commands__db-verify.d.mts +0 -7
  134. package/dist/cli__commands__db-verify.d.mts.map +0 -1
  135. package/dist/cli__commands__db-verify.mjs +0 -2
  136. package/dist/cli__commands__migrate.d.mts +0 -57
  137. package/dist/cli__commands__migrate.d.mts.map +0 -1
  138. package/dist/cli__commands__migrate.mjs +0 -2
  139. package/dist/cli__commands__migration-check.d.mts +0 -8
  140. package/dist/cli__commands__migration-check.d.mts.map +0 -1
  141. package/dist/cli__commands__migration-check.mjs +0 -3
  142. package/dist/cli__commands__migration-graph.d.mts +0 -38
  143. package/dist/cli__commands__migration-graph.d.mts.map +0 -1
  144. package/dist/cli__commands__migration-graph.mjs +0 -2
  145. package/dist/cli__commands__migration-list.d.mts +0 -39
  146. package/dist/cli__commands__migration-list.d.mts.map +0 -1
  147. package/dist/cli__commands__migration-list.mjs +0 -2
  148. package/dist/cli__commands__migration-log.d.mts +0 -20
  149. package/dist/cli__commands__migration-log.d.mts.map +0 -1
  150. package/dist/cli__commands__migration-log.mjs +0 -2
  151. package/dist/cli__commands__migration-new.d.mts +0 -7
  152. package/dist/cli__commands__migration-new.d.mts.map +0 -1
  153. package/dist/cli__commands__migration-new.mjs +0 -2
  154. package/dist/cli__commands__migration-plan.d.mts +0 -34
  155. package/dist/cli__commands__migration-plan.d.mts.map +0 -1
  156. package/dist/cli__commands__migration-plan.mjs +0 -2
  157. package/dist/cli__commands__migration-show.d.mts +0 -27
  158. package/dist/cli__commands__migration-show.d.mts.map +0 -1
  159. package/dist/cli__commands__migration-show.mjs +0 -2
  160. package/dist/cli__commands__migration-status.d.mts +0 -55
  161. package/dist/cli__commands__migration-status.d.mts.map +0 -1
  162. package/dist/cli__commands__migration-status.mjs +0 -3
  163. package/dist/cli__commands__ref.d.mts +0 -7
  164. package/dist/cli__commands__ref.d.mts.map +0 -1
  165. package/dist/cli__commands__ref.mjs +0 -2
  166. package/dist/cli__commands__telemetry.d.mts +0 -7
  167. package/dist/cli__commands__telemetry.d.mts.map +0 -1
  168. package/dist/cli__commands__telemetry.mjs +0 -2
  169. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs +0 -1653
  170. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs.map +0 -1
  171. package/dist/code-templates-C-jirr19-DDQB0WGo.mjs +0 -295
  172. package/dist/code-templates-C-jirr19-DDQB0WGo.mjs.map +0 -1
  173. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs +0 -65
  174. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs.map +0 -1
  175. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs +0 -776
  176. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs.map +0 -1
  177. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs +0 -44
  178. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs.map +0 -1
  179. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs +0 -331
  180. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs.map +0 -1
  181. package/dist/contract-emit-BkEj3siG-C8M-IyvS.mjs +0 -2
  182. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts +0 -7
  183. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +0 -1
  184. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs +0 -154
  185. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs.map +0 -1
  186. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +0 -56
  187. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +0 -1
  188. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs +0 -74
  189. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs.map +0 -1
  190. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs +0 -82
  191. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs.map +0 -1
  192. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs +0 -303
  193. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs.map +0 -1
  194. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs +0 -109
  195. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs.map +0 -1
  196. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs +0 -44
  197. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs.map +0 -1
  198. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs +0 -48
  199. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs.map +0 -1
  200. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs +0 -172
  201. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs.map +0 -1
  202. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs +0 -171
  203. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs.map +0 -1
  204. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs +0 -358
  205. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs.map +0 -1
  206. package/dist/exports-B3xY_FHp.mjs.map +0 -1
  207. package/dist/exports-BZLNbtkY.mjs.map +0 -1
  208. package/dist/exports-CqNUihkI.mjs +0 -276
  209. package/dist/exports-CqNUihkI.mjs.map +0 -1
  210. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs +0 -110
  211. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs.map +0 -1
  212. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs +0 -60
  213. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs.map +0 -1
  214. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +0 -35
  215. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +0 -1
  216. package/dist/index-mCsi_ND5.d.mts.map +0 -1
  217. package/dist/init-DC7zPKka-BSiUrPw3.mjs +0 -800
  218. package/dist/init-DC7zPKka-BSiUrPw3.mjs.map +0 -1
  219. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs +0 -95
  220. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs.map +0 -1
  221. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs +0 -115
  222. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs.map +0 -1
  223. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs +0 -53
  224. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs.map +0 -1
  225. package/dist/legend-DGv9e2_0-BtetgRz4.mjs +0 -22
  226. package/dist/legend-DGv9e2_0-BtetgRz4.mjs.map +0 -1
  227. package/dist/migrate-BXATUjYE-Do79Imf-.mjs +0 -343
  228. package/dist/migrate-BXATUjYE-Do79Imf-.mjs.map +0 -1
  229. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs +0 -96
  230. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs.map +0 -1
  231. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts +0 -63
  232. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts.map +0 -1
  233. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs +0 -199
  234. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs.map +0 -1
  235. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs +0 -358
  236. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs.map +0 -1
  237. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs +0 -163
  238. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs.map +0 -1
  239. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs +0 -121
  240. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs.map +0 -1
  241. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs +0 -35
  242. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs.map +0 -1
  243. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs +0 -144
  244. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs.map +0 -1
  245. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs +0 -2127
  246. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs.map +0 -1
  247. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs +0 -69
  248. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs.map +0 -1
  249. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs +0 -130
  250. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs.map +0 -1
  251. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs +0 -102
  252. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs.map +0 -1
  253. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs +0 -123
  254. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs.map +0 -1
  255. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs +0 -116
  256. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs.map +0 -1
  257. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs +0 -70
  258. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs.map +0 -1
  259. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs +0 -130
  260. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs.map +0 -1
  261. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs +0 -38
  262. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs.map +0 -1
  263. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts +0 -164
  264. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts.map +0 -1
  265. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs +0 -192
  266. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs.map +0 -1
  267. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs +0 -621
  268. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs.map +0 -1
  269. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs +0 -178
  270. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs.map +0 -1
  271. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs +0 -427
  272. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs.map +0 -1
  273. package/dist/output-DP3woAjV-BxCr9nHA.mjs.map +0 -1
  274. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +0 -43
  275. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +0 -1
  276. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs +0 -101
  277. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs.map +0 -1
  278. package/dist/redact-secrets-DuKoiMax-Cfe2XVhc.mjs +0 -1476
  279. package/dist/redact-secrets-DuKoiMax-Cfe2XVhc.mjs.map +0 -1
  280. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs +0 -95
  281. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs.map +0 -1
  282. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs +0 -104
  283. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs.map +0 -1
  284. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs +0 -96
  285. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs.map +0 -1
  286. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs +0 -16
  287. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs.map +0 -1
  288. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs +0 -47
  289. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs.map +0 -1
  290. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts +0 -206
  291. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts.map +0 -1
  292. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs +0 -119
  293. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs.map +0 -1
  294. package/dist/shells-BenrJHp2.mjs.map +0 -1
  295. package/dist/shells-COHV_Ozf.d.mts.map +0 -1
  296. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs +0 -121
  297. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs.map +0 -1
  298. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +0 -133
  299. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +0 -1
  300. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs +0 -676
  301. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs.map +0 -1
  302. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs +0 -283
  303. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { l as validateRefName } from "./refs-WK86uYYp-B6EZkmmT.mjs";
1
+ import { l as validateRefName } from "./refs-WK86uYYp-gM8tvWQP.mjs";
2
2
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
3
3
  //#region ../../../1-framework/3-tooling/migration/dist/exports/ref-resolution.mjs
4
4
  const FULL_HASH_PATTERN = /^([0-9a-f]{64}|empty)$/;
@@ -247,4 +247,4 @@ function parseMigrationRef(input, ctx) {
247
247
  //#endregion
248
248
  export { parseContractRef as n, parseMigrationRef as r, findEdgeByDirName as t };
249
249
 
250
- //# sourceMappingURL=ref-resolution-sGcINe7o.mjs.map
250
+ //# sourceMappingURL=ref-resolution-HeNBXW53.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ref-resolution-sGcINe7o.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/ref-resolution.mjs"],"sourcesContent":["import { l as validateRefName } from \"../refs-WK86uYYp.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/refs/types.ts\nconst FULL_HASH_PATTERN = /^([0-9a-f]{64}|empty)$/;\nconst HEX_PREFIX_PATTERN = /^[0-9a-f]{6,}$/;\nfunction isFullHash(input) {\n\treturn FULL_HASH_PATTERN.test(input);\n}\nfunction isHexPrefix(input) {\n\treturn HEX_PREFIX_PATTERN.test(input);\n}\nfunction findEdgeByDirName(graph, dirName) {\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) if (edge.dirName === dirName) return edge;\n}\n//#endregion\n//#region src/refs/contract-ref.ts\n/**\n* Resolve a user-supplied string to a contract hash using the unified\n* contract-reference grammar.\n*\n* Accepted forms:\n* - `@contract` — the on-disk working contract hash (offline; requires\n* `ctx.contractHash` to be set)\n* - `@db` — the live database marker (connection-required); callers MUST\n* check `result.value.provenance.kind === 'reserved-db'` and resolve the\n* actual hash via `readAllMarkers()` before using `result.value.hash`\n* - Full storage hash (64 hex chars or `empty`)\n* - Hex prefix (6+ hex chars, must uniquely identify one contract)\n* - Ref name (looked up in the refs index)\n* - Migration directory name (resolves to the migration's `to`-contract)\n* - `<dir>^` (resolves to the migration's `from`-contract)\n*/\nfunction parseContractRef(input, ctx) {\n\tif (!input) return notOk({\n\t\tkind: \"invalid-format\",\n\t\tinput,\n\t\treason: \"Reference cannot be empty\"\n\t});\n\tif (input === \"@contract\") {\n\t\tif (ctx.contractHash === void 0) return notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t\treturn ok({\n\t\t\thash: ctx.contractHash,\n\t\t\tprovenance: { kind: \"reserved-contract\" }\n\t\t});\n\t}\n\tif (input === \"@db\") return ok({\n\t\thash: \"\",\n\t\tprovenance: { kind: \"reserved-db\" }\n\t});\n\tif (isFullHash(input)) {\n\t\tif (ctx.graph.nodes.has(input)) return ok({\n\t\t\thash: input,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"hash\",\n\t\t\t\tinput\n\t\t\t}\n\t\t});\n\t\treturn notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t}\n\tif (input.endsWith(\"^\")) {\n\t\tconst dirName = input.slice(0, -1);\n\t\tif (!dirName) return notOk({\n\t\t\tkind: \"invalid-format\",\n\t\t\tinput,\n\t\t\treason: \"Missing directory name before ^\"\n\t\t});\n\t\tconst edge = findEdgeByDirName(ctx.graph, dirName);\n\t\tif (edge) return ok({\n\t\t\thash: edge.from,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"migration-from\",\n\t\t\t\tdirName\n\t\t\t}\n\t\t});\n\t\treturn notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t}\n\tconst candidates = [];\n\tif (validateRefName(input) && Object.hasOwn(ctx.refs, input)) {\n\t\tconst ref = ctx.refs[input];\n\t\tif (ref) candidates.push({\n\t\t\thash: ref.hash,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"ref\",\n\t\t\t\trefName: input\n\t\t\t},\n\t\t\tlabel: `ref \"${input}\"`\n\t\t});\n\t}\n\tconst edge = findEdgeByDirName(ctx.graph, input);\n\tif (edge) candidates.push({\n\t\thash: edge.to,\n\t\tprovenance: {\n\t\t\tkind: \"migration-to\",\n\t\t\tdirName: input\n\t\t},\n\t\tlabel: `migration directory \"${input}\"`\n\t});\n\tif (isHexPrefix(input)) {\n\t\tconst matches = [...ctx.graph.nodes].filter((n) => n.startsWith(input));\n\t\tconst [firstMatch] = matches;\n\t\tif (matches.length === 1 && firstMatch !== void 0) candidates.push({\n\t\t\thash: firstMatch,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"hash\",\n\t\t\t\tinput\n\t\t\t},\n\t\t\tlabel: `hash prefix \"${input}\"`\n\t\t});\n\t\telse if (matches.length > 1) return notOk({\n\t\t\tkind: \"ambiguous\",\n\t\t\tinput,\n\t\t\tcandidates: matches,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t}\n\tconst [firstCandidate] = candidates;\n\tif (candidates.length === 1 && firstCandidate !== void 0) return ok({\n\t\thash: firstCandidate.hash,\n\t\tprovenance: firstCandidate.provenance\n\t});\n\tif (candidates.length > 1) return notOk({\n\t\tkind: \"ambiguous\",\n\t\tinput,\n\t\tcandidates: candidates.map((c) => c.label),\n\t\tgrammar: \"contract\"\n\t});\n\treturn notOk({\n\t\tkind: \"not-found\",\n\t\tinput,\n\t\tgrammar: \"contract\"\n\t});\n}\n//#endregion\n//#region src/refs/migration-ref.ts\n/**\n* Resolve a user-supplied string to a migration using the migration-reference\n* grammar.\n*\n* Accepted forms:\n* - Migration directory name (e.g. `20260101-add-users`)\n* - Migration hash (full or 6+ hex prefix)\n*\n* Wrong-grammar diagnostics are produced when the input matches a\n* contract-grammar form (ref name, `<dir>^`, contract-only hash) so the\n* user gets a targeted hint rather than a generic \"not found\".\n*/\nfunction parseMigrationRef(input, ctx) {\n\tif (!input) return notOk({\n\t\tkind: \"invalid-format\",\n\t\tinput,\n\t\treason: \"Reference cannot be empty\"\n\t});\n\tif (input.endsWith(\"^\")) return notOk({\n\t\tkind: \"wrong-grammar\",\n\t\tinput,\n\t\texpectedGrammar: \"migration\",\n\t\tmessage: \"`^` syntax addresses contracts, not migrations\",\n\t\tfix: \"Pass the migration directory name without `^`, or use a contract-accepting flag like `--to` or `--from`.\"\n\t});\n\tif (validateRefName(input) && Object.hasOwn(ctx.refs, input)) return notOk({\n\t\tkind: \"wrong-grammar\",\n\t\tinput,\n\t\texpectedGrammar: \"migration\",\n\t\tmessage: `\"${input}\" is a ref name, not a migration`,\n\t\tfix: \"Refs point at contracts, not migrations. Use a migration directory name or migration hash.\"\n\t});\n\tconst edge = findEdgeByDirName(ctx.graph, input);\n\tif (edge) return ok({\n\t\tdirName: edge.dirName,\n\t\tmigrationHash: edge.migrationHash,\n\t\tfrom: edge.from,\n\t\tto: edge.to,\n\t\tprovenance: {\n\t\t\tkind: \"dir-name\",\n\t\t\tdirName: input\n\t\t}\n\t});\n\tif (isFullHash(input)) {\n\t\tconst migEdge = ctx.graph.migrationByHash.get(input);\n\t\tif (migEdge) return ok({\n\t\t\tdirName: migEdge.dirName,\n\t\t\tmigrationHash: migEdge.migrationHash,\n\t\t\tfrom: migEdge.from,\n\t\t\tto: migEdge.to,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"hash\",\n\t\t\t\tinput\n\t\t\t}\n\t\t});\n\t\tif (ctx.graph.nodes.has(input)) return notOk({\n\t\t\tkind: \"wrong-grammar\",\n\t\t\tinput,\n\t\t\texpectedGrammar: \"migration\",\n\t\t\tmessage: \"Hash matched a contract but not a migration\",\n\t\t\tfix: \"Use a contract-accepting flag like `--to` or `--from` to reference contracts by hash. Pass `migration show <dir>` for a specific migration.\"\n\t\t});\n\t\treturn notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"migration\"\n\t\t});\n\t}\n\tif (isHexPrefix(input)) {\n\t\tconst migMatches = [...ctx.graph.migrationByHash.entries()].filter(([hash]) => hash.startsWith(input));\n\t\tconst [firstMigMatch] = migMatches;\n\t\tif (migMatches.length === 1 && firstMigMatch !== void 0) {\n\t\t\tconst [, matchedEdge] = firstMigMatch;\n\t\t\treturn ok({\n\t\t\t\tdirName: matchedEdge.dirName,\n\t\t\t\tmigrationHash: matchedEdge.migrationHash,\n\t\t\t\tfrom: matchedEdge.from,\n\t\t\t\tto: matchedEdge.to,\n\t\t\t\tprovenance: {\n\t\t\t\t\tkind: \"hash\",\n\t\t\t\t\tinput\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (migMatches.length > 1) return notOk({\n\t\t\tkind: \"ambiguous\",\n\t\t\tinput,\n\t\t\tcandidates: migMatches.map(([hash]) => hash),\n\t\t\tgrammar: \"migration\"\n\t\t});\n\t\tif ([...ctx.graph.nodes].filter((n) => n.startsWith(input)).length > 0) return notOk({\n\t\t\tkind: \"wrong-grammar\",\n\t\t\tinput,\n\t\t\texpectedGrammar: \"migration\",\n\t\t\tmessage: \"Hash matched a contract but not a migration\",\n\t\t\tfix: \"Use a contract-accepting flag like `--to` or `--from` to reference contracts by hash. Pass `migration show <dir>` for a specific migration.\"\n\t\t});\n\t}\n\treturn notOk({\n\t\tkind: \"not-found\",\n\t\tinput,\n\t\tgrammar: \"migration\"\n\t});\n}\n//#endregion\nexport { findEdgeByDirName, parseContractRef, parseMigrationRef };\n\n//# sourceMappingURL=ref-resolution.mjs.map"],"mappings":";;;AAGA,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAC3B,SAAS,WAAW,OAAO;CAC1B,OAAO,kBAAkB,KAAK,KAAK;AACpC;AACA,SAAS,YAAY,OAAO;CAC3B,OAAO,mBAAmB,KAAK,KAAK;AACrC;AACA,SAAS,kBAAkB,OAAO,SAAS;CAC1C,KAAK,MAAM,SAAS,MAAM,aAAa,OAAO,GAAG,KAAK,MAAM,QAAQ,OAAO,IAAI,KAAK,YAAY,SAAS,OAAO;AACjH;;;;;;;;;;;;;;;;;AAmBA,SAAS,iBAAiB,OAAO,KAAK;CACrC,IAAI,CAAC,OAAO,OAAO,MAAM;EACxB,MAAM;EACN;EACA,QAAQ;CACT,CAAC;CACD,IAAI,UAAU,aAAa;EAC1B,IAAI,IAAI,iBAAiB,KAAK,GAAG,OAAO,MAAM;GAC7C,MAAM;GACN;GACA,SAAS;EACV,CAAC;EACD,OAAO,GAAG;GACT,MAAM,IAAI;GACV,YAAY,EAAE,MAAM,oBAAoB;EACzC,CAAC;CACF;CACA,IAAI,UAAU,OAAO,OAAO,GAAG;EAC9B,MAAM;EACN,YAAY,EAAE,MAAM,c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ACZ,YAAY;IACX,MAAM;IACN;GACD;EACD,CAAC;EACD,IAAI,IAAI,MAAM,MAAM,IAAI,KAAK,GAAG,OAAO,MAAM;GAC5C,MAAM;GACN;GACA,iBAAiB;GACjB,SAAS;GACT,KAAK;EACN,CAAC;EACD,OAAO,MAAM;GACZ,MAAM;GACN;GACA,SAAS;EACV,CAAC;CACF;CACA,IAAI,YAAY,KAAK,GAAG;EACvB,MAAM,aAAa,CAAC,GAAG,IAAI,MAAM,gBAAgB,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,KAAK,WAAW,KAAK,CAAC;EACrG,MAAM,CAAC,iBAAiB;EACxB,IAAI,WAAW,WAAW,KAAK,kBAAkB,KAAK,GAAG;GACxD,MAAM,GAAG,eAAe;GACxB,OAAO,GAAG;IACT,SAAS,YAAY;IACrB,eAAe,YAAY;IAC3B,MAAM,YAAY;IAClB,IAAI,YAAY;IAChB,YAAY;KACX,MAAM;KACN;IACD;GACD,CAAC;EACF;EACA,IAAI,WAAW,SAAS,GAAG,OAAO,MAAM;GACvC,MAAM;GACN;GACA,YAAY,WAAW,KAAK,CAAC,UAAU,IAAI;GAC3C,SAAS;EACV,CAAC;EACD,IAAI,CAAC,GAAG,IAAI,MAAM,KAAK,CAAC,CAAC,QAAQ,MAAM,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,OAAO,MAAM;GACpF,MAAM;GACN;GACA,iBAAiB;GACjB,SAAS;GACT,KAAK;EACN,CAAC;CACF;CACA,OAAO,MAAM;EACZ,MAAM;EACN;EACA,SAAS;CACV,CAAC;AACF"}
1
+ {"version":3,"file":"ref-resolution-HeNBXW53.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/ref-resolution.mjs"],"sourcesContent":["import { l as validateRefName } from \"../refs-WK86uYYp.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/refs/types.ts\nconst FULL_HASH_PATTERN = /^([0-9a-f]{64}|empty)$/;\nconst HEX_PREFIX_PATTERN = /^[0-9a-f]{6,}$/;\nfunction isFullHash(input) {\n\treturn FULL_HASH_PATTERN.test(input);\n}\nfunction isHexPrefix(input) {\n\treturn HEX_PREFIX_PATTERN.test(input);\n}\nfunction findEdgeByDirName(graph, dirName) {\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) if (edge.dirName === dirName) return edge;\n}\n//#endregion\n//#region src/refs/contract-ref.ts\n/**\n* Resolve a user-supplied string to a contract hash using the unified\n* contract-reference grammar.\n*\n* Accepted forms:\n* - `@contract` — the on-disk working contract hash (offline; requires\n* `ctx.contractHash` to be set)\n* - `@db` — the live database marker (connection-required); callers MUST\n* check `result.value.provenance.kind === 'reserved-db'` and resolve the\n* actual hash via `readAllMarkers()` before using `result.value.hash`\n* - Full storage hash (64 hex chars or `empty`)\n* - Hex prefix (6+ hex chars, must uniquely identify one contract)\n* - Ref name (looked up in the refs index)\n* - Migration directory name (resolves to the migration's `to`-contract)\n* - `<dir>^` (resolves to the migration's `from`-contract)\n*/\nfunction parseContractRef(input, ctx) {\n\tif (!input) return notOk({\n\t\tkind: \"invalid-format\",\n\t\tinput,\n\t\treason: \"Reference cannot be empty\"\n\t});\n\tif (input === \"@contract\") {\n\t\tif (ctx.contractHash === void 0) return notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t\treturn ok({\n\t\t\thash: ctx.contractHash,\n\t\t\tprovenance: { kind: \"reserved-contract\" }\n\t\t});\n\t}\n\tif (input === \"@db\") return ok({\n\t\thash: \"\",\n\t\tprovenance: { kind: \"reserved-db\" }\n\t});\n\tif (isFullHash(input)) {\n\t\tif (ctx.graph.nodes.has(input)) return ok({\n\t\t\thash: input,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"hash\",\n\t\t\t\tinput\n\t\t\t}\n\t\t});\n\t\treturn notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t}\n\tif (input.endsWith(\"^\")) {\n\t\tconst dirName = input.slice(0, -1);\n\t\tif (!dirName) return notOk({\n\t\t\tkind: \"invalid-format\",\n\t\t\tinput,\n\t\t\treason: \"Missing directory name before ^\"\n\t\t});\n\t\tconst edge = findEdgeByDirName(ctx.graph, dirName);\n\t\tif (edge) return ok({\n\t\t\thash: edge.from,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"migration-from\",\n\t\t\t\tdirName\n\t\t\t}\n\t\t});\n\t\treturn notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t}\n\tconst candidates = [];\n\tif (validateRefName(input) && Object.hasOwn(ctx.refs, input)) {\n\t\tconst ref = ctx.refs[input];\n\t\tif (ref) candidates.push({\n\t\t\thash: ref.hash,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"ref\",\n\t\t\t\trefName: input\n\t\t\t},\n\t\t\tlabel: `ref \"${input}\"`\n\t\t});\n\t}\n\tconst edge = findEdgeByDirName(ctx.graph, input);\n\tif (edge) candidates.push({\n\t\thash: edge.to,\n\t\tprovenance: {\n\t\t\tkind: \"migration-to\",\n\t\t\tdirName: input\n\t\t},\n\t\tlabel: `migration directory \"${input}\"`\n\t});\n\tif (isHexPrefix(input)) {\n\t\tconst matches = [...ctx.graph.nodes].filter((n) => n.startsWith(input));\n\t\tconst [firstMatch] = matches;\n\t\tif (matches.length === 1 && firstMatch !== void 0) candidates.push({\n\t\t\thash: firstMatch,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"hash\",\n\t\t\t\tinput\n\t\t\t},\n\t\t\tlabel: `hash prefix \"${input}\"`\n\t\t});\n\t\telse if (matches.length > 1) return notOk({\n\t\t\tkind: \"ambiguous\",\n\t\t\tinput,\n\t\t\tcandidates: matches,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t}\n\tconst [firstCandidate] = candidates;\n\tif (candidates.length === 1 && firstCandidate !== void 0) return ok({\n\t\thash: firstCandidate.hash,\n\t\tprovenance: firstCandidate.provenance\n\t});\n\tif (candidates.length > 1) return notOk({\n\t\tkind: \"ambiguous\",\n\t\tinput,\n\t\tcandidates: candidates.map((c) => c.label),\n\t\tgrammar: \"contract\"\n\t});\n\treturn notOk({\n\t\tkind: \"not-found\",\n\t\tinput,\n\t\tgrammar: \"contract\"\n\t});\n}\n//#endregion\n//#region src/refs/migration-ref.ts\n/**\n* Resolve a user-supplied string to a migration using the migration-reference\n* grammar.\n*\n* Accepted forms:\n* - Migration directory name (e.g. `20260101-add-users`)\n* - Migration hash (full or 6+ hex prefix)\n*\n* Wrong-grammar diagnostics are produced when the input matches a\n* contract-grammar form (ref name, `<dir>^`, contract-only hash) so the\n* user gets a targeted hint rather than a generic \"not found\".\n*/\nfunction parseMigrationRef(input, ctx) {\n\tif (!input) return notOk({\n\t\tkind: \"invalid-format\",\n\t\tinput,\n\t\treason: \"Reference cannot be empty\"\n\t});\n\tif (input.endsWith(\"^\")) return notOk({\n\t\tkind: \"wrong-grammar\",\n\t\tinput,\n\t\texpectedGrammar: \"migration\",\n\t\tmessage: \"`^` syntax addresses contracts, not migrations\",\n\t\tfix: \"Pass the migration directory name without `^`, or use a contract-accepting flag like `--to` or `--from`.\"\n\t});\n\tif (validateRefName(input) && Object.hasOwn(ctx.refs, input)) return notOk({\n\t\tkind: \"wrong-grammar\",\n\t\tinput,\n\t\texpectedGrammar: \"migration\",\n\t\tmessage: `\"${input}\" is a ref name, not a migration`,\n\t\tfix: \"Refs point at contracts, not migrations. Use a migration directory name or migration hash.\"\n\t});\n\tconst edge = findEdgeByDirName(ctx.graph, input);\n\tif (edge) return ok({\n\t\tdirName: edge.dirName,\n\t\tmigrationHash: edge.migrationHash,\n\t\tfrom: edge.from,\n\t\tto: edge.to,\n\t\tprovenance: {\n\t\t\tkind: \"dir-name\",\n\t\t\tdirName: input\n\t\t}\n\t});\n\tif (isFullHash(input)) {\n\t\tconst migEdge = ctx.graph.migrationByHash.get(input);\n\t\tif (migEdge) return ok({\n\t\t\tdirName: migEdge.dirName,\n\t\t\tmigrationHash: migEdge.migrationHash,\n\t\t\tfrom: migEdge.from,\n\t\t\tto: migEdge.to,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"hash\",\n\t\t\t\tinput\n\t\t\t}\n\t\t});\n\t\tif (ctx.graph.nodes.has(input)) return notOk({\n\t\t\tkind: \"wrong-grammar\",\n\t\t\tinput,\n\t\t\texpectedGrammar: \"migration\",\n\t\t\tmessage: \"Hash matched a contract but not a migration\",\n\t\t\tfix: \"Use a contract-accepting flag like `--to` or `--from` to reference contracts by hash. Pass `migration show <dir>` for a specific migration.\"\n\t\t});\n\t\treturn notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"migration\"\n\t\t});\n\t}\n\tif (isHexPrefix(input)) {\n\t\tconst migMatches = [...ctx.graph.migrationByHash.entries()].filter(([hash]) => hash.startsWith(input));\n\t\tconst [firstMigMatch] = migMatches;\n\t\tif (migMatches.length === 1 && firstMigMatch !== void 0) {\n\t\t\tconst [, matchedEdge] = firstMigMatch;\n\t\t\treturn ok({\n\t\t\t\tdirName: matchedEdge.dirName,\n\t\t\t\tmigrationHash: matchedEdge.migrationHash,\n\t\t\t\tfrom: matchedEdge.from,\n\t\t\t\tto: matchedEdge.to,\n\t\t\t\tprovenance: {\n\t\t\t\t\tkind: \"hash\",\n\t\t\t\t\tinput\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (migMatches.length > 1) return notOk({\n\t\t\tkind: \"ambiguous\",\n\t\t\tinput,\n\t\t\tcandidates: migMatches.map(([hash]) => hash),\n\t\t\tgrammar: \"migration\"\n\t\t});\n\t\tif ([...ctx.graph.nodes].filter((n) => n.startsWith(input)).length > 0) return notOk({\n\t\t\tkind: \"wrong-grammar\",\n\t\t\tinput,\n\t\t\texpectedGrammar: \"migration\",\n\t\t\tmessage: \"Hash matched a contract but not a migration\",\n\t\t\tfix: \"Use a contract-accepting flag like `--to` or `--from` to reference contracts by hash. Pass `migration show <dir>` for a specific migration.\"\n\t\t});\n\t}\n\treturn notOk({\n\t\tkind: \"not-found\",\n\t\tinput,\n\t\tgrammar: \"migration\"\n\t});\n}\n//#endregion\nexport { findEdgeByDirName, parseContractRef, parseMigrationRef };\n\n//# sourceMappingURL=ref-resolution.mjs.map"],"mappings":";;;AAGA,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAC3B,SAAS,WAAW,OAAO;CAC1B,OAAO,kBAAkB,KAAK,KAAK;AACpC;AACA,SAAS,YAAY,OAAO;CAC3B,OAAO,mBAAmB,KAAK,KAAK;AACrC;AACA,SAAS,kBAAkB,OAAO,SAAS;CAC1C,KAAK,MAAM,SAAS,MAAM,aAAa,OAAO,GAAG,KAAK,MAAM,QAAQ,OAAO,IAAI,KAAK,YAAY,SAAS,OAAO;AACjH;;;;;;;;;;;;;;;;;AAmBA,SAAS,iBAAiB,OAAO,KAAK;CACrC,IAAI,CAAC,OAAO,OAAO,MAAM;EACxB,MAAM;EACN;EACA,QAAQ;CACT,CAAC;CACD,IAAI,UAAU,aAAa;EAC1B,IAAI,IAAI,iBAAiB,KAAK,GAAG,OAAO,MAAM;GAC7C,MAAM;GACN;GACA,SAAS;EACV,CAAC;EACD,OAAO,GAAG;GACT,MAAM,IAAI;GACV,YAAY,EAAE,MAAM,oBAAoB;EACzC,CAAC;CACF;CACA,IAAI,UAAU,OAAO,OAAO,GAAG;EAC9B,MAAM;EACN,YAAY,EAAE,MAAM,cAAc;CACnC,CAAC;CACD,IAAI,WAAW,KAAK,GAAG;EACtB,IAAI,IAAI,MAAM,MAAM,IAAI,KAAK,GAAG,OAAO,GAAG;GACzC,MAAM;GACN,YAAY;IACX,MAAM;IACN;GACD;EACD,CAAC;EACD,OAAO,MAAM;GACZ,MAAM;GACN;GACA,SAAS;EACV,CAAC;CACF;CACA,IAAI,MAAM,SAAS,GAAG,GAAG;EACxB,MAAM,UAAU,MAAM,MAAM,GAAG,EAAE;EACjC,I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,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,KAAK,WAAW,KAAK,CAAC;EACrG,MAAM,CAAC,iBAAiB;EACxB,IAAI,WAAW,WAAW,KAAK,kBAAkB,KAAK,GAAG;GACxD,MAAM,GAAG,eAAe;GACxB,OAAO,GAAG;IACT,SAAS,YAAY;IACrB,eAAe,YAAY;IAC3B,MAAM,YAAY;IAClB,IAAI,YAAY;IAChB,YAAY;KACX,MAAM;KACN;IACD;GACD,CAAC;EACF;EACA,IAAI,WAAW,SAAS,GAAG,OAAO,MAAM;GACvC,MAAM;GACN;GACA,YAAY,WAAW,KAAK,CAAC,UAAU,IAAI;GAC3C,SAAS;EACV,CAAC;EACD,IAAI,CAAC,GAAG,IAAI,MAAM,KAAK,CAAC,CAAC,QAAQ,MAAM,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,OAAO,MAAM;GACpF,MAAM;GACN;GACA,iBAAiB;GACjB,SAAS;GACT,KAAK;EACN,CAAC;CACF;CACA,OAAO,MAAM;EACZ,MAAM;EACN;EACA,SAAS;CACV,CAAC;AACF"}
@@ -1,4 +1,4 @@
1
- import { b as errorInvalidRefName, t as MigrationToolsError, x as errorInvalidRefValue, y as errorInvalidRefFile } from "./errors-CXbGUWGu-BQi6YS-H.mjs";
1
+ import { b as errorInvalidRefName, t as MigrationToolsError, x as errorInvalidRefValue, y as errorInvalidRefFile } from "./errors-CXbGUWGu-CstQHPh6.mjs";
2
2
  import { dirname, join, relative } from "pathe";
3
3
  import { mkdir, readFile, readdir, rename, rmdir, unlink, writeFile } from "node:fs/promises";
4
4
  import { type } from "arktype";
@@ -254,4 +254,4 @@ function resolveRef(refs, name) {
254
254
  //#endregion
255
255
  export { readRefsTolerant as a, resolveRefsByContractHash as c, writeRef as d, readRefs as i, validateRefName as l, deleteRef as n, refsByContractHash as o, readRef as r, resolveRef as s, HEAD_REF_NAME as t, validateRefValue as u };
256
256
 
257
- //# sourceMappingURL=refs-WK86uYYp-B6EZkmmT.mjs.map
257
+ //# sourceMappingURL=refs-WK86uYYp-gM8tvWQP.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"refs-WK86uYYp-B6EZkmmT.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/refs-WK86uYYp.mjs"],"sourcesContent":["import { b as errorInvalidRefName, t as MigrationToolsError, x as errorInvalidRefValue, y as errorInvalidRefFile } from \"./errors-CXbGUWGu.mjs\";\nimport { dirname, join, relative } from \"pathe\";\nimport { mkdir, readFile, readdir, rename, rmdir, unlink, writeFile } from \"node:fs/promises\";\nimport { type } from \"arktype\";\n//#region src/refs.ts\n/**\n* The system head ref lives at `refs/head.json`. It is read (and its\n* corruption judged) through `readContractSpaceHeadRef`, not as a\n* user-authored ref, so {@link readRefsTolerant} excludes it.\n*/\nconst HEAD_REF_NAME = \"head\";\nconst REF_NAME_PATTERN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\/[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/;\nconst REF_VALUE_PATTERN = /^(empty|[0-9a-f]{64})$/;\nfunction validateRefName(name) {\n\tif (name.length === 0) return false;\n\tif (name.includes(\"..\")) return false;\n\tif (name.includes(\"//\")) return false;\n\tif (name.startsWith(\".\")) return false;\n\treturn REF_NAME_PATTERN.test(name);\n}\nfunction validateRefValue(value) {\n\treturn REF_VALUE_PATTERN.test(value);\n}\nconst RefEntrySchema = type({\n\thash: \"string\",\n\tinvariants: \"string[]\"\n}).narrow((entry, ctx) => {\n\tif (!validateRefValue(entry.hash)) return ctx.mustBe(`a valid contract hash (got \"${entry.hash}\")`);\n\treturn true;\n});\nfunction refFilePath(refsDir, name) {\n\treturn join(refsDir, `${name}.json`);\n}\nfunction refNameFromPath(refsDir, filePath) {\n\treturn relative(refsDir, filePath).replace(/\\.json$/, \"\");\n}\nasync function readRef(refsDir, name) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tconst filePath = refFilePath(refsDir, name);\n\tlet raw;\n\ttry {\n\t\traw = await readFile(filePath, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") throw new MigrationToolsError(\"MIGRATION.UNKNOWN_REF\", `Unknown ref \"${name}\"`, {\n\t\t\twhy: `No ref file found at \"${filePath}\".`,\n\t\t\tfix: `Create the ref with: prisma-next ref set ${name} <hash>`,\n\t\t\tnextActions: [{\n\t\t\t\tkind: \"run-command\",\n\t\t\t\tlabel: `Create the ref \"${name}\"`,\n\t\t\t\tcommand: `{bin} ref set ${name} <hash>`\n\t\t\t}],\n\t\t\tmeta: {\n\t\t\t\trefName: name,\n\t\t\t\tfilePath\n\t\t\t}\n\t\t});\n\t\tthrow error;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\tthrow errorInvalidRefFile(filePath, \"Failed to parse as JSON\");\n\t}\n\tconst result = RefEntrySchema(parsed);\n\tif (result instanceof type.errors) throw errorInvalidRefFile(filePath, result.summary);\n\treturn result;\n}\nasync function readRefs(refsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(refsDir, {\n\t\t\trecursive: true,\n\t\t\tencoding: \"utf-8\"\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return {};\n\t\tthrow error;\n\t}\n\tconst jsonFiles = entries.filter((entry) => entry.endsWith(\".json\") && !entry.endsWith(\".contract.json\"));\n\tconst refs = {};\n\tfor (const jsonFile of jsonFiles) {\n\t\tconst filePath = join(refsDir, jsonFile);\n\t\tconst name = refNameFromPath(refsDir, filePath);\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = await readFile(filePath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tconst code = error instanceof Error ? error.code : void 0;\n\t\t\tif (code === \"ENOENT\" || code === \"EISDIR\") continue;\n\t\t\tthrow error;\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = JSON.parse(raw);\n\t\t} catch {\n\t\t\tthrow errorInvalidRefFile(filePath, \"Failed to parse as JSON\");\n\t\t}\n\t\tconst result = RefEntrySchema(parsed);\n\t\tif (result instanceof type.errors) throw errorInvalidRefFile(filePath, result.summary);\n\t\trefs[name] = result;\n\t}\n\treturn refs;\n}\n/**\n* Read a space's user-authored refs without ever throwing on disk\n* content. A ref whose JSON is unparseable or whose shape fails\n* {@link RefEntrySchema} is omitted from `refs` and reported as a\n* {@link RefLoadProblem}; the remaining well-formed refs are still\n* returned. A missing `refs/` directory yields no refs and no problems.\n*\n* `refs/head.json` is deliberately skipped here: the system head ref is\n* read through `readContractSpaceHeadRef` (which validates head-ref\n* shape, distinct from the strict user-ref hash grammar), so it is judged\n* there and never doubles as a user ref. Genuine I/O faults (EACCES, EIO,\n* …) still propagate — only parse / schema problems are made tolerant.\n*/\nasync function readRefsTolerant(refsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(refsDir, {\n\t\t\trecursive: true,\n\t\t\tencoding: \"utf-8\"\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return {\n\t\t\trefs: {},\n\t\t\tproblems: []\n\t\t};\n\t\tthrow error;\n\t}\n\tconst jsonFiles = entries.filter((entry) => entry.endsWith(\".json\") && !entry.endsWith(\".contract.json\") && entry !== `head.json`);\n\tconst refs = {};\n\tconst problems = [];\n\tfor (const jsonFile of jsonFiles) {\n\t\tconst filePath = join(refsDir, jsonFile);\n\t\tconst name = refNameFromPath(refsDir, filePath);\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = await readFile(filePath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tconst code = error instanceof Error ? error.code : void 0;\n\t\t\tif (code === \"ENOENT\" || code === \"EISDIR\") continue;\n\t\t\tthrow error;\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = JSON.parse(raw);\n\t\t} catch (e) {\n\t\t\tproblems.push({\n\t\t\t\trefName: name,\n\t\t\t\tdetail: e instanceof Error ? e.message : String(e)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst result = RefEntrySchema(parsed);\n\t\tif (result instanceof type.errors) {\n\t\t\tproblems.push({\n\t\t\t\trefName: name,\n\t\t\t\tdetail: result.summary\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\trefs[name] = result;\n\t}\n\treturn {\n\t\trefs,\n\t\tproblems\n\t};\n}\nasync function writeRef(refsDir, name, entry) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tif (!validateRefValue(entry.hash)) throw errorInvalidRefValue(entry.hash);\n\tconst filePath = refFilePath(refsDir, name);\n\tconst dir = dirname(filePath);\n\tawait mkdir(dir, { recursive: true });\n\tconst tmpPath = join(dir, `.${name.split(\"/\").pop()}.json.${Date.now()}.tmp`);\n\tawait writeFile(tmpPath, `${JSON.stringify({\n\t\thash: entry.hash,\n\t\tinvariants: [...entry.invariants]\n\t}, null, 2)}\\n`);\n\tawait rename(tmpPath, filePath);\n}\nasync function deleteRef(refsDir, name) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tconst filePath = refFilePath(refsDir, name);\n\ttry {\n\t\tawait unlink(filePath);\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") throw new MigrationToolsError(\"MIGRATION.UNKNOWN_REF\", `Unknown ref \"${name}\"`, {\n\t\t\twhy: `No ref file found at \"${filePath}\".`,\n\t\t\tfix: \"Run `prisma-next ref list` to see available refs.\",\n\t\t\tnextActions: [{\n\t\t\t\tkind: \"run-command\",\n\t\t\t\tlabel: \"List the available refs\",\n\t\t\t\tcommand: \"{bin} ref list\"\n\t\t\t}],\n\t\t\tmeta: {\n\t\t\t\trefName: name,\n\t\t\t\tfilePath\n\t\t\t}\n\t\t});\n\t\tthrow error;\n\t}\n\tlet dir = dirname(filePath);\n\twhile (dir !== refsDir && dir.startsWith(refsDir)) try {\n\t\tawait rmdir(dir);\n\t\tdir = dirname(dir);\n\t} catch (error) {\n\t\tconst code = error instanceof Error ? error.code : void 0;\n\t\tif (code === \"ENOTEMPTY\" || code === \"EEXIST\" || code === \"ENOENT\") break;\n\t\tthrow error;\n\t}\n}\n/**\n* Index user-authored refs by the contract hash each ref points at.\n* Each bucket is sorted lex-asc for deterministic output.\n*/\nfunction refsByContractHash(refs) {\n\tconst byHash = /* @__PURE__ */ new Map();\n\tfor (const [name, entry] of Object.entries(refs)) {\n\t\tconst bucket = byHash.get(entry.hash);\n\t\tif (bucket) bucket.push(name);\n\t\telse byHash.set(entry.hash, [name]);\n\t}\n\tfor (const bucket of byHash.values()) bucket.sort();\n\treturn byHash;\n}\n/**\n* Read `migrations/<space>/refs/*.json` and index by destination hash.\n* Returns an empty map when the refs directory does not exist.\n*/\nasync function resolveRefsByContractHash(refsDir) {\n\treturn refsByContractHash(await readRefs(refsDir));\n}\nfunction resolveRef(refs, name) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tif (!Object.hasOwn(refs, name)) throw new MigrationToolsError(\"MIGRATION.UNKNOWN_REF\", `Unknown ref \"${name}\"`, {\n\t\twhy: `No ref named \"${name}\" exists.`,\n\t\tfix: `Available refs: ${Object.keys(refs).join(\", \") || \"(none)\"}. Create a ref with: prisma-next ref set ${name} <hash>`,\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: `Create the ref \"${name}\"`,\n\t\t\tcommand: `{bin} ref set ${name} <hash>`,\n\t\t\treason: `Available refs: ${Object.keys(refs).join(\", \") || \"(none)\"}.`\n\t\t}],\n\t\tmeta: {\n\t\t\trefName: name,\n\t\t\tavailableRefs: Object.keys(refs)\n\t\t}\n\t});\n\treturn refs[name];\n}\n//#endregion\nexport { readRefsTolerant as a, resolveRefsByContractHash as c, writeRef as d, readRefs as i, validateRefName as l, deleteRef as n, refsByContractHash as o, readRef as r, resolveRef as s, HEAD_REF_NAME as t, validateRefValue as u };\n\n//# sourceMappingURL=refs-WK86uYYp.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,gBAAgB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AO;AACR;;;;;AAKA,eAAe,0BAA0B,SAAS;CACjD,OAAO,mBAAmB,MAAM,SAAS,OAAO,CAAC;AAClD;AACA,SAAS,WAAW,MAAM,MAAM;CAC/B,IAAI,CAAC,gBAAgB,IAAI,GAAG,MAAM,oBAAoB,IAAI;CAC1D,IAAI,CAAC,OAAO,OAAO,MAAM,IAAI,GAAG,MAAM,IAAI,oBAAoB,yBAAyB,gBAAgB,KAAK,IAAI;EAC/G,KAAK,iBAAiB,KAAK;EAC3B,KAAK,mBAAmB,OAAO,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,SAAS,2CAA2C,KAAK;EACjH,aAAa,CAAC;GACb,MAAM;GACN,OAAO,mBAAmB,KAAK;GAC/B,SAAS,iBAAiB,KAAK;GAC/B,QAAQ,mBAAmB,OAAO,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,SAAS;EACrE,CAAC;EACD,MAAM;GACL,SAAS;GACT,eAAe,OAAO,KAAK,IAAI;EAChC;CACD,CAAC;CACD,OAAO,KAAK;AACb"}
1
+ {"version":3,"file":"refs-WK86uYYp-gM8tvWQP.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/refs-WK86uYYp.mjs"],"sourcesContent":["import { b as errorInvalidRefName, t as MigrationToolsError, x as errorInvalidRefValue, y as errorInvalidRefFile } from \"./errors-CXbGUWGu.mjs\";\nimport { dirname, join, relative } from \"pathe\";\nimport { mkdir, readFile, readdir, rename, rmdir, unlink, writeFile } from \"node:fs/promises\";\nimport { type } from \"arktype\";\n//#region src/refs.ts\n/**\n* The system head ref lives at `refs/head.json`. It is read (and its\n* corruption judged) through `readContractSpaceHeadRef`, not as a\n* user-authored ref, so {@link readRefsTolerant} excludes it.\n*/\nconst HEAD_REF_NAME = \"head\";\nconst REF_NAME_PATTERN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\/[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/;\nconst REF_VALUE_PATTERN = /^(empty|[0-9a-f]{64})$/;\nfunction validateRefName(name) {\n\tif (name.length === 0) return false;\n\tif (name.includes(\"..\")) return false;\n\tif (name.includes(\"//\")) return false;\n\tif (name.startsWith(\".\")) return false;\n\treturn REF_NAME_PATTERN.test(name);\n}\nfunction validateRefValue(value) {\n\treturn REF_VALUE_PATTERN.test(value);\n}\nconst RefEntrySchema = type({\n\thash: \"string\",\n\tinvariants: \"string[]\"\n}).narrow((entry, ctx) => {\n\tif (!validateRefValue(entry.hash)) return ctx.mustBe(`a valid contract hash (got \"${entry.hash}\")`);\n\treturn true;\n});\nfunction refFilePath(refsDir, name) {\n\treturn join(refsDir, `${name}.json`);\n}\nfunction refNameFromPath(refsDir, filePath) {\n\treturn relative(refsDir, filePath).replace(/\\.json$/, \"\");\n}\nasync function readRef(refsDir, name) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tconst filePath = refFilePath(refsDir, name);\n\tlet raw;\n\ttry {\n\t\traw = await readFile(filePath, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") throw new MigrationToolsError(\"MIGRATION.UNKNOWN_REF\", `Unknown ref \"${name}\"`, {\n\t\t\twhy: `No ref file found at \"${filePath}\".`,\n\t\t\tfix: `Create the ref with: prisma-next ref set ${name} <hash>`,\n\t\t\tnextActions: [{\n\t\t\t\tkind: \"run-command\",\n\t\t\t\tlabel: `Create the ref \"${name}\"`,\n\t\t\t\tcommand: `{bin} ref set ${name} <hash>`\n\t\t\t}],\n\t\t\tmeta: {\n\t\t\t\trefName: name,\n\t\t\t\tfilePath\n\t\t\t}\n\t\t});\n\t\tthrow error;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\tthrow errorInvalidRefFile(filePath, \"Failed to parse as JSON\");\n\t}\n\tconst result = RefEntrySchema(parsed);\n\tif (result instanceof type.errors) throw errorInvalidRefFile(filePath, result.summary);\n\treturn result;\n}\nasync function readRefs(refsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(refsDir, {\n\t\t\trecursive: true,\n\t\t\tencoding: \"utf-8\"\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return {};\n\t\tthrow error;\n\t}\n\tconst jsonFiles = entries.filter((entry) => entry.endsWith(\".json\") && !entry.endsWith(\".contract.json\"));\n\tconst refs = {};\n\tfor (const jsonFile of jsonFiles) {\n\t\tconst filePath = join(refsDir, jsonFile);\n\t\tconst name = refNameFromPath(refsDir, filePath);\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = await readFile(filePath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tconst code = error instanceof Error ? error.code : void 0;\n\t\t\tif (code === \"ENOENT\" || code === \"EISDIR\") continue;\n\t\t\tthrow error;\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = JSON.parse(raw);\n\t\t} catch {\n\t\t\tthrow errorInvalidRefFile(filePath, \"Failed to parse as JSON\");\n\t\t}\n\t\tconst result = RefEntrySchema(parsed);\n\t\tif (result instanceof type.errors) throw errorInvalidRefFile(filePath, result.summary);\n\t\trefs[name] = result;\n\t}\n\treturn refs;\n}\n/**\n* Read a space's user-authored refs without ever throwing on disk\n* content. A ref whose JSON is unparseable or whose shape fails\n* {@link RefEntrySchema} is omitted from `refs` and reported as a\n* {@link RefLoadProblem}; the remaining well-formed refs are still\n* returned. A missing `refs/` directory yields no refs and no problems.\n*\n* `refs/head.json` is deliberately skipped here: the system head ref is\n* read through `readContractSpaceHeadRef` (which validates head-ref\n* shape, distinct from the strict user-ref hash grammar), so it is judged\n* there and never doubles as a user ref. Genuine I/O faults (EACCES, EIO,\n* …) still propagate — only parse / schema problems are made tolerant.\n*/\nasync function readRefsTolerant(refsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(refsDir, {\n\t\t\trecursive: true,\n\t\t\tencoding: \"utf-8\"\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return {\n\t\t\trefs: {},\n\t\t\tproblems: []\n\t\t};\n\t\tthrow error;\n\t}\n\tconst jsonFiles = entries.filter((entry) => entry.endsWith(\".json\") && !entry.endsWith(\".contract.json\") && entry !== `head.json`);\n\tconst refs = {};\n\tconst problems = [];\n\tfor (const jsonFile of jsonFiles) {\n\t\tconst filePath = join(refsDir, jsonFile);\n\t\tconst name = refNameFromPath(refsDir, filePath);\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = await readFile(filePath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tconst code = error instanceof Error ? error.code : void 0;\n\t\t\tif (code === \"ENOENT\" || code === \"EISDIR\") continue;\n\t\t\tthrow error;\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = JSON.parse(raw);\n\t\t} catch (e) {\n\t\t\tproblems.push({\n\t\t\t\trefName: name,\n\t\t\t\tdetail: e instanceof Error ? e.message : String(e)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst result = RefEntrySchema(parsed);\n\t\tif (result instanceof type.errors) {\n\t\t\tproblems.push({\n\t\t\t\trefName: name,\n\t\t\t\tdetail: result.summary\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\trefs[name] = result;\n\t}\n\treturn {\n\t\trefs,\n\t\tproblems\n\t};\n}\nasync function writeRef(refsDir, name, entry) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tif (!validateRefValue(entry.hash)) throw errorInvalidRefValue(entry.hash);\n\tconst filePath = refFilePath(refsDir, name);\n\tconst dir = dirname(filePath);\n\tawait mkdir(dir, { recursive: true });\n\tconst tmpPath = join(dir, `.${name.split(\"/\").pop()}.json.${Date.now()}.tmp`);\n\tawait writeFile(tmpPath, `${JSON.stringify({\n\t\thash: entry.hash,\n\t\tinvariants: [...entry.invariants]\n\t}, null, 2)}\\n`);\n\tawait rename(tmpPath, filePath);\n}\nasync function deleteRef(refsDir, name) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tconst filePath = refFilePath(refsDir, name);\n\ttry {\n\t\tawait unlink(filePath);\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") throw new MigrationToolsError(\"MIGRATION.UNKNOWN_REF\", `Unknown ref \"${name}\"`, {\n\t\t\twhy: `No ref file found at \"${filePath}\".`,\n\t\t\tfix: \"Run `prisma-next ref list` to see available refs.\",\n\t\t\tnextActions: [{\n\t\t\t\tkind: \"run-command\",\n\t\t\t\tlabel: \"List the available refs\",\n\t\t\t\tcommand: \"{bin} ref list\"\n\t\t\t}],\n\t\t\tmeta: {\n\t\t\t\trefName: name,\n\t\t\t\tfilePath\n\t\t\t}\n\t\t});\n\t\tthrow error;\n\t}\n\tlet dir = dirname(filePath);\n\twhile (dir !== refsDir && dir.startsWith(refsDir)) try {\n\t\tawait rmdir(dir);\n\t\tdir = dirname(dir);\n\t} catch (error) {\n\t\tconst code = error instanceof Error ? error.code : void 0;\n\t\tif (code === \"ENOTEMPTY\" || code === \"EEXIST\" || code === \"ENOENT\") break;\n\t\tthrow error;\n\t}\n}\n/**\n* Index user-authored refs by the contract hash each ref points at.\n* Each bucket is sorted lex-asc for deterministic output.\n*/\nfunction refsByContractHash(refs) {\n\tconst byHash = /* @__PURE__ */ new Map();\n\tfor (const [name, entry] of Object.entries(refs)) {\n\t\tconst bucket = byHash.get(entry.hash);\n\t\tif (bucket) bucket.push(name);\n\t\telse byHash.set(entry.hash, [name]);\n\t}\n\tfor (const bucket of byHash.values()) bucket.sort();\n\treturn byHash;\n}\n/**\n* Read `migrations/<space>/refs/*.json` and index by destination hash.\n* Returns an empty map when the refs directory does not exist.\n*/\nasync function resolveRefsByContractHash(refsDir) {\n\treturn refsByContractHash(await readRefs(refsDir));\n}\nfunction resolveRef(refs, name) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tif (!Object.hasOwn(refs, name)) throw new MigrationToolsError(\"MIGRATION.UNKNOWN_REF\", `Unknown ref \"${name}\"`, {\n\t\twhy: `No ref named \"${name}\" exists.`,\n\t\tfix: `Available refs: ${Object.keys(refs).join(\", \") || \"(none)\"}. Create a ref with: prisma-next ref set ${name} <hash>`,\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: `Create the ref \"${name}\"`,\n\t\t\tcommand: `{bin} ref set ${name} <hash>`,\n\t\t\treason: `Available refs: ${Object.keys(refs).join(\", \") || \"(none)\"}.`\n\t\t}],\n\t\tmeta: {\n\t\t\trefName: name,\n\t\t\tavailableRefs: Object.keys(refs)\n\t\t}\n\t});\n\treturn refs[name];\n}\n//#endregion\nexport { readRefsTolerant as a, resolveRefsByContractHash as c, writeRef as d, readRefs as i, validateRefName as l, deleteRef as n, refsByContractHash as o, readRef as r, resolveRef as s, HEAD_REF_NAME as t, validateRefValue as u };\n\n//# sourceMappingURL=refs-WK86uYYp.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,gBAAgB;AACtB,MAAM,mBAAmB;AACzB,MAAM,oBAAoB;AAC1B,SAAS,gBAAgB,MAAM;CAC9B,IAAI,KAAK,WAAW,GAAG,OAAO;CAC9B,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,IAAI,KAAK,WAAW,GAAG,GAAG,OAAO;CACjC,OAAO,iBAAiB,KAAK,IAAI;AAClC;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO,kBAAkB,KAAK,KAAK;AACpC;AACA,MAAM,iBAAiB,KAAK;CAC3B,MAAM;CACN,YAAY;AACb,CAAC,CAAC,CAAC,QAAQ,OAAO,QAAQ;CACzB,IAAI,CAAC,iBAAiB,MAAM,IAAI,GAAG,OAAO,IAAI,OAAO,+BAA+B,MAAM,KAAK,GAAG;CAClG,OAAO;AACR,CAAC;AACD,SAAS,YAAY,SAAS,MAAM;CACnC,OAAO,KAAK,SAAS,GAAG,KAAK,MAAM;AACpC;AACA,SAAS,gBAAgB,SAAS,UAAU;CAC3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"}
@@ -1,10 +1,5 @@
1
1
  //#region ../../../0-shared/publish-surface/dist/shells.mjs
2
2
  /**
3
- * The CLI command every facade puts on an application's `PATH`. It runs the
4
- * toolchain's single published copy; the facade only carries the launcher.
5
- */
6
- const FACADE_BINS = { "prisma-next": "@prisma/orm-toolchain/bin/prisma-next" };
7
- /**
8
3
  * Surfaces every facade republishes regardless of family.
9
4
  *
10
5
  * An application depends on one facade and nothing else (ADR 242), so
@@ -208,7 +203,15 @@ const publicShells = /* @__PURE__ */ new Map([
208
203
  {
209
204
  dir: "packages/1-framework/3-tooling/cli",
210
205
  name: "@internal/cli",
211
- entry: "cli"
206
+ entry: "cli",
207
+ subpaths: [
208
+ ".",
209
+ "migration-cli",
210
+ "control-api",
211
+ "control-api/testing",
212
+ "config-types",
213
+ "init-output"
214
+ ]
212
215
  },
213
216
  {
214
217
  dir: "packages/1-framework/3-tooling/cli-telemetry",
@@ -247,7 +250,6 @@ const publicShells = /* @__PURE__ */ new Map([
247
250
  entry: "publish-surface"
248
251
  }
249
252
  ],
250
- bins: { "prisma-next": "packages/1-framework/3-tooling/cli/dist/cli.mjs" },
251
253
  copy: ["packages/1-framework/3-tooling/cli/dist/*.md"]
252
254
  }],
253
255
  ["@prisma/orm-family-sql", {
@@ -476,8 +478,7 @@ const publicShells = /* @__PURE__ */ new Map([
476
478
  adapter: "@internal/adapter-postgres",
477
479
  driver: "@internal/driver-postgres",
478
480
  queryBuilders: SQL_QUERY_REEXPORTS
479
- }),
480
- forwardedBins: FACADE_BINS
481
+ })
481
482
  }],
482
483
  ["@prisma/orm-sqlite", {
483
484
  dir: "packages/9-public/@prisma/orm-sqlite",
@@ -495,8 +496,7 @@ const publicShells = /* @__PURE__ */ new Map([
495
496
  adapter: "@internal/adapter-sqlite",
496
497
  driver: "@internal/driver-sqlite",
497
498
  queryBuilders: SQL_QUERY_REEXPORTS
498
- }),
499
- forwardedBins: FACADE_BINS
499
+ })
500
500
  }],
501
501
  ["@prisma/orm-mongo", {
502
502
  dir: "packages/9-public/@prisma/orm-mongo",
@@ -531,8 +531,7 @@ const publicShells = /* @__PURE__ */ new Map([
531
531
  entry: "value"
532
532
  }
533
533
  ]
534
- }),
535
- forwardedBins: FACADE_BINS
534
+ })
536
535
  }],
537
536
  ["@prisma/orm-extension-postgis", {
538
537
  dir: "packages/9-public/@prisma/orm-extension-postgis",
@@ -599,4 +598,4 @@ const excludedSubpaths = [/^\.\/test(\/|$)/];
599
598
  //#endregion
600
599
  export { publicShells as n, excludedSubpaths as t };
601
600
 
602
- //# sourceMappingURL=shells-BenrJHp2.mjs.map
601
+ //# sourceMappingURL=shells-C4HbRAr5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shells-C4HbRAr5.mjs","names":[],"sources":["../../../../0-shared/publish-surface/dist/shells.mjs"],"sourcesContent":["//#region src/shells.ts\n/**\n* Surfaces every facade republishes regardless of family.\n*\n* An application depends on one facade and nothing else (ADR 242), so\n* everything it reaches — hand-written and generated alike — has to have a\n* name under the facade. These are the target-agnostic ones: the contract and\n* component surfaces emitted files import, the shared helpers, and the Vite\n* plugin.\n*\n* Entry names follow the name the platform shell gives the same package, so\n* one internal package reads the same way wherever it is reached from.\n*\n* A republished package brings its whole subpath surface with it unless the\n* entry lists `subpaths`, so the cost of an entry is its export count, not\n* one. Nothing goes in here that no application reaches.\n*\n* `migration-tools` is listed by subpath rather than whole. An application\n* does reach it — a project that checks its own migrations are intact, or\n* that stages an extension's pinned contract-space artifacts before `db\n* init`, reads and writes the on-disk migration format, and under a\n* facade-only install there is no other published name for it. But it is a\n* 17-subpath tooling package whose remaining surface (the graph, the\n* pathfinder, ref resolution, the ledger) is the CLI's own working material,\n* and publishing that would freeze it. The five listed here are what the\n* repository's own consumers reach.\n*/\nconst COMMON_FACADE_REEXPORTS = [\n\t{\n\t\tpackage: \"@internal/contract\",\n\t\tentry: \"contract\"\n\t},\n\t{\n\t\tpackage: \"@internal/framework-components\",\n\t\tentry: \"components\"\n\t},\n\t{\n\t\tpackage: \"@internal/utils\",\n\t\tentry: \"utils\"\n\t},\n\t{\n\t\tpackage: \"@internal/vite-plugin-contract-emit\",\n\t\tentry: \"vite-plugin-contract-emit\"\n\t},\n\t{\n\t\tpackage: \"@internal/migration-tools\",\n\t\tentry: \"migration-tools\",\n\t\tsubpaths: [\n\t\t\t\"aggregate\",\n\t\t\t\"contract-snapshot-store\",\n\t\t\t\"hash\",\n\t\t\t\"io\",\n\t\t\t\"spaces\"\n\t\t]\n\t}\n];\n/**\n* The per-database part of a facade's republished surface.\n*\n* `family` is the family's contract package (`@internal/sql-contract` or\n* `@internal/mongo-contract`) and `familyPack` its control-plane and IR\n* pack; `target` and `adapter` carry the codec and operation types emitted\n* contracts reference; `runtime` is the family runtime an application drives\n* queries through.\n*\n* `family-contract` and `family-runtime` take a qualified name because the\n* facade's own `contract` and `runtime` are different modules. `target` and\n* `familyPack` forward subpaths only, so that a facade which publishes its own\n* `./target` or `./family` pack keeps that name for its own module; where a\n* facade publishes neither, the plain name simply stays free.\n*\n* `driver` is carried by every facade. A facade wires its own driver, so the\n* only code that names one is code driving the migration planner or runner\n* itself — which the SQL facades were assumed not to have, until the SQL\n* migration-planner harnesses turned out to need the driver's control\n* descriptor to build a control stack by hand. Two subpaths per facade.\n*/\nfunction facadeReexports(options) {\n\treturn [\n\t\t...COMMON_FACADE_REEXPORTS,\n\t\t{\n\t\t\tpackage: options.family,\n\t\t\tentry: \"family-contract\"\n\t\t},\n\t\t{\n\t\t\tpackage: options.familyPack,\n\t\t\tentry: \"family\",\n\t\t\troot: false\n\t\t},\n\t\t{\n\t\t\tpackage: options.runtime,\n\t\t\tentry: \"family-runtime\"\n\t\t},\n\t\t{\n\t\t\tpackage: options.target,\n\t\t\tentry: \"target\",\n\t\t\troot: false\n\t\t},\n\t\t{\n\t\t\tpackage: options.adapter,\n\t\t\tentry: \"adapter\"\n\t\t},\n\t\t{\n\t\t\tpackage: options.driver,\n\t\t\tentry: \"driver\"\n\t\t},\n\t\t...options.queryBuilders\n\t];\n}\n/**\n* The SQL family's query surfaces, republished by both SQL facades.\n*\n* `schema-ir` carries one subpath. Code that authors a migration by hand, or\n* drives the planner itself, names `SqlSchemaIR` — it is the schema shape the\n* planner takes and returns. The package's other two subpaths are the IR's\n* construction and naming internals, which publishing would freeze.\n*/\nconst SQL_QUERY_REEXPORTS = [\n\t{\n\t\tpackage: \"@internal/sql-orm-client\",\n\t\tentry: \"orm-client\"\n\t},\n\t{\n\t\tpackage: \"@internal/sql-builder\",\n\t\tentry: \"builder\"\n\t},\n\t{\n\t\tpackage: \"@internal/sql-relational-core\",\n\t\tentry: \"relational-core\"\n\t},\n\t{\n\t\tpackage: \"@internal/sql-schema-ir\",\n\t\tentry: \"schema-ir\",\n\t\tsubpaths: [\"types\"]\n\t}\n];\nconst publicShells = /* @__PURE__ */ new Map([\n\t[\"@prisma/orm-framework\", {\n\t\tdir: \"packages/9-public/@prisma/orm-framework\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/0-foundation/contract\",\n\t\t\t\tname: \"@internal/contract\",\n\t\t\t\tentry: \"contract\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/0-foundation/utils\",\n\t\t\t\tname: \"@internal/utils\",\n\t\t\t\tentry: \"utils\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/config\",\n\t\t\t\tname: \"@internal/config\",\n\t\t\t\tentry: \"config\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/errors\",\n\t\t\t\tname: \"@internal/errors\",\n\t\t\t\tentry: \"errors\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/framework-components\",\n\t\t\t\tname: \"@internal/framework-components\",\n\t\t\t\tentry: \"components\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/operations\",\n\t\t\t\tname: \"@internal/operations\",\n\t\t\t\tentry: \"operations\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/ts-render\",\n\t\t\t\tname: \"@internal/ts-render\",\n\t\t\t\tentry: \"ts-render\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/2-authoring/contract\",\n\t\t\t\tname: \"@internal/contract-authoring\",\n\t\t\t\tentry: \"contract-authoring\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/2-authoring/ids\",\n\t\t\t\tname: \"@internal/ids\",\n\t\t\t\tentry: \"ids\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/2-authoring/psl-parser\",\n\t\t\t\tname: \"@internal/psl-parser\",\n\t\t\t\tentry: \"psl-parser\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/2-authoring/psl-printer\",\n\t\t\t\tname: \"@internal/psl-printer\",\n\t\t\t\tentry: \"psl-printer\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-toolchain\", {\n\t\tdir: \"packages/9-public/@prisma/orm-toolchain\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/cli\",\n\t\t\t\tname: \"@internal/cli\",\n\t\t\t\tentry: \"cli\",\n\t\t\t\tsubpaths: [\n\t\t\t\t\t\".\",\n\t\t\t\t\t\"migration-cli\",\n\t\t\t\t\t\"control-api\",\n\t\t\t\t\t\"control-api/testing\",\n\t\t\t\t\t\"config-types\",\n\t\t\t\t\t\"init-output\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/cli-telemetry\",\n\t\t\t\tname: \"@internal/cli-telemetry\",\n\t\t\t\tentry: \"cli-telemetry\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/config-loader\",\n\t\t\t\tname: \"@internal/config-loader\",\n\t\t\t\tentry: \"config-loader\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/emitter\",\n\t\t\t\tname: \"@internal/emitter\",\n\t\t\t\tentry: \"emitter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/language-server\",\n\t\t\t\tname: \"@internal/language-server\",\n\t\t\t\tentry: \"language-server\",\n\t\t\t\tpublished: false\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/migration\",\n\t\t\t\tname: \"@internal/migration-tools\",\n\t\t\t\tentry: \"migration-tools\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/vite-plugin-contract-emit\",\n\t\t\t\tname: \"@internal/vite-plugin-contract-emit\",\n\t\t\t\tentry: \"vite-plugin-contract-emit\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/0-shared/publish-surface\",\n\t\t\t\tname: \"@internal/publish-surface\",\n\t\t\t\tentry: \"publish-surface\"\n\t\t\t}\n\t\t],\n\t\tcopy: [\"packages/1-framework/3-tooling/cli/dist/*.md\"]\n\t}],\n\t[\"@prisma/orm-family-sql\", {\n\t\tdir: \"packages/9-public/@prisma/orm-family-sql\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/1-core/contract\",\n\t\t\t\tname: \"@internal/sql-contract\",\n\t\t\t\tentry: \"contract\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/1-core/errors\",\n\t\t\t\tname: \"@internal/sql-errors\",\n\t\t\t\tentry: \"errors\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/1-core/operations\",\n\t\t\t\tname: \"@internal/sql-operations\",\n\t\t\t\tentry: \"operations\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/1-core/schema-ir\",\n\t\t\t\tname: \"@internal/sql-schema-ir\",\n\t\t\t\tentry: \"schema-ir\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/2-authoring/contract-psl\",\n\t\t\t\tname: \"@internal/sql-contract-psl\",\n\t\t\t\tentry: \"contract-psl\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/2-authoring/contract-ts\",\n\t\t\t\tname: \"@internal/sql-contract-ts\",\n\t\t\t\tentry: \"contract-ts\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/3-tooling/emitter\",\n\t\t\t\tname: \"@internal/sql-contract-emitter\",\n\t\t\t\tentry: \"contract-emitter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/4-lanes/query-builder\",\n\t\t\t\tname: \"@internal/sql-lane-query-builder\",\n\t\t\t\tentry: \"lane-query-builder\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/4-lanes/relational-core\",\n\t\t\t\tname: \"@internal/sql-relational-core\",\n\t\t\t\tentry: \"relational-core\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/4-lanes/sql-builder\",\n\t\t\t\tname: \"@internal/sql-builder\",\n\t\t\t\tentry: \"builder\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/5-runtime\",\n\t\t\t\tname: \"@internal/sql-runtime\",\n\t\t\t\tentry: \"runtime\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/9-family\",\n\t\t\t\tname: \"@internal/family-sql\",\n\t\t\t\tentry: \"family\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-extensions/sql-orm-client\",\n\t\t\t\tname: \"@internal/sql-orm-client\",\n\t\t\t\tentry: \"orm-client\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-family-mongo\", {\n\t\tdir: \"packages/9-public/@prisma/orm-family-mongo\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/1-foundation/mongo-codec\",\n\t\t\t\tname: \"@internal/mongo-codec\",\n\t\t\t\tentry: \"codec\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/1-foundation/mongo-contract\",\n\t\t\t\tname: \"@internal/mongo-contract\",\n\t\t\t\tentry: \"contract\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/1-foundation/mongo-value\",\n\t\t\t\tname: \"@internal/mongo-value\",\n\t\t\t\tentry: \"value\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/2-authoring/contract-psl\",\n\t\t\t\tname: \"@internal/mongo-contract-psl\",\n\t\t\t\tentry: \"contract-psl\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/2-authoring/contract-ts\",\n\t\t\t\tname: \"@internal/mongo-contract-ts\",\n\t\t\t\tentry: \"contract-ts\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/3-tooling/emitter\",\n\t\t\t\tname: \"@internal/mongo-emitter\",\n\t\t\t\tentry: \"emitter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/3-tooling/mongo-schema-ir\",\n\t\t\t\tname: \"@internal/mongo-schema-ir\",\n\t\t\t\tentry: \"schema-ir\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/4-query/query-ast\",\n\t\t\t\tname: \"@internal/mongo-query-ast\",\n\t\t\t\tentry: \"query-ast\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/5-query-builders/orm\",\n\t\t\t\tname: \"@internal/mongo-orm\",\n\t\t\t\tentry: \"orm\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/5-query-builders/query-builder\",\n\t\t\t\tname: \"@internal/mongo-query-builder\",\n\t\t\t\tentry: \"query-builder\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/6-transport/mongo-lowering\",\n\t\t\t\tname: \"@internal/mongo-lowering\",\n\t\t\t\tentry: \"lowering\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/6-transport/mongo-wire\",\n\t\t\t\tname: \"@internal/mongo-wire\",\n\t\t\t\tentry: \"wire\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/7-runtime\",\n\t\t\t\tname: \"@internal/mongo-runtime\",\n\t\t\t\tentry: \"runtime\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/9-family\",\n\t\t\t\tname: \"@internal/family-mongo\",\n\t\t\t\tentry: \"family\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-target-postgres\", {\n\t\tdir: \"packages/9-public/@prisma/orm-target-postgres\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/3-targets/postgres\",\n\t\t\t\tname: \"@internal/target-postgres\",\n\t\t\t\tentry: \"target\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/6-adapters/postgres\",\n\t\t\t\tname: \"@internal/adapter-postgres\",\n\t\t\t\tentry: \"adapter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/7-drivers/postgres\",\n\t\t\t\tname: \"@internal/driver-postgres\",\n\t\t\t\tentry: \"driver\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-target-sqlite\", {\n\t\tdir: \"packages/9-public/@prisma/orm-target-sqlite\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/3-targets/sqlite\",\n\t\t\t\tname: \"@internal/target-sqlite\",\n\t\t\t\tentry: \"target\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/6-adapters/sqlite\",\n\t\t\t\tname: \"@internal/adapter-sqlite\",\n\t\t\t\tentry: \"adapter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/7-drivers/sqlite\",\n\t\t\t\tname: \"@internal/driver-sqlite\",\n\t\t\t\tentry: \"driver\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-target-mongo\", {\n\t\tdir: \"packages/9-public/@prisma/orm-target-mongo\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/3-mongo-target/1-mongo-target\",\n\t\t\t\tname: \"@internal/target-mongo\",\n\t\t\t\tentry: \"target\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-mongo-target/2-mongo-adapter\",\n\t\t\t\tname: \"@internal/adapter-mongo\",\n\t\t\t\tentry: \"adapter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-mongo-target/3-mongo-driver\",\n\t\t\t\tname: \"@internal/driver-mongo\",\n\t\t\t\tentry: \"driver\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-postgres\", {\n\t\tdir: \"packages/9-public/@prisma/orm-postgres\",\n\t\tkind: \"facade\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/postgres\",\n\t\t\tname: \"@internal/postgres\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\treexports: facadeReexports({\n\t\t\tfamily: \"@internal/sql-contract\",\n\t\t\tfamilyPack: \"@internal/family-sql\",\n\t\t\truntime: \"@internal/sql-runtime\",\n\t\t\ttarget: \"@internal/target-postgres\",\n\t\t\tadapter: \"@internal/adapter-postgres\",\n\t\t\tdriver: \"@internal/driver-postgres\",\n\t\t\tqueryBuilders: SQL_QUERY_REEXPORTS\n\t\t})\n\t}],\n\t[\"@prisma/orm-sqlite\", {\n\t\tdir: \"packages/9-public/@prisma/orm-sqlite\",\n\t\tkind: \"facade\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/sqlite\",\n\t\t\tname: \"@internal/sqlite\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\treexports: facadeReexports({\n\t\t\tfamily: \"@internal/sql-contract\",\n\t\t\tfamilyPack: \"@internal/family-sql\",\n\t\t\truntime: \"@internal/sql-runtime\",\n\t\t\ttarget: \"@internal/target-sqlite\",\n\t\t\tadapter: \"@internal/adapter-sqlite\",\n\t\t\tdriver: \"@internal/driver-sqlite\",\n\t\t\tqueryBuilders: SQL_QUERY_REEXPORTS\n\t\t})\n\t}],\n\t[\"@prisma/orm-mongo\", {\n\t\tdir: \"packages/9-public/@prisma/orm-mongo\",\n\t\tkind: \"facade\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/mongo\",\n\t\t\tname: \"@internal/mongo\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\treexports: facadeReexports({\n\t\t\tfamily: \"@internal/mongo-contract\",\n\t\t\tfamilyPack: \"@internal/family-mongo\",\n\t\t\truntime: \"@internal/mongo-runtime\",\n\t\t\ttarget: \"@internal/target-mongo\",\n\t\t\tadapter: \"@internal/adapter-mongo\",\n\t\t\tdriver: \"@internal/driver-mongo\",\n\t\t\tqueryBuilders: [\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/mongo-orm\",\n\t\t\t\t\tentry: \"orm\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/mongo-query-builder\",\n\t\t\t\t\tentry: \"query-builder\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/mongo-query-ast\",\n\t\t\t\t\tentry: \"query-ast\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/mongo-value\",\n\t\t\t\t\tentry: \"value\"\n\t\t\t\t}\n\t\t\t]\n\t\t})\n\t}],\n\t[\"@prisma/orm-extension-postgis\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-postgis\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/postgis\",\n\t\t\tname: \"@internal/extension-postgis\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-pgvector\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-pgvector\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/pgvector\",\n\t\t\tname: \"@internal/extension-pgvector\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-paradedb\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-paradedb\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/paradedb\",\n\t\t\tname: \"@internal/extension-paradedb\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-supabase\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-supabase\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/supabase\",\n\t\t\tname: \"@internal/extension-supabase\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-arktype-json\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-arktype-json\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/arktype-json\",\n\t\t\tname: \"@internal/extension-arktype-json\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-middleware-cache\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-middleware-cache\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/middleware-cache\",\n\t\t\tname: \"@internal/middleware-cache\",\n\t\t\tentry: \"\"\n\t\t}]\n\t}]\n]);\n/** Export subpaths that never ship in a shell (test-only surfaces). */\nconst excludedSubpaths = [/^\\.\\/test(\\/|$)/];\n//#endregion\nexport { excludedSubpaths, publicShells };\n\n//# sourceMappingURL=shells.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,0BAA0B;CAC/B;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;EACP,UAAU;GACT;GACA;GACA;GACA;GACA;EACD;CACD;AACD;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,SAAS;CACjC,OAAO;EACN,GAAG;EACH;GACC,SAAS,QAAQ;GACjB,OAAO;EACR;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;GACP,MAAM;EACP;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;EACR;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;GACP,MAAM;EACP;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;EACR;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;EACR;EACA,GAAG,QAAQ;CACZ;AACD;;;;;;;;;AASA,MAAM,sBAAsB;CAC3B;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;EACP,UAAU,CAAC,OAAO;CACnB;AACD;AACA,MAAM,+BAA+B,IAAI,IAAI;CAC5C,CAAC,yBAAyB;EACzB,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;EACD;CACD,CAAC;CACD,CAAC,yBAAyB;EACzB,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;IACP,UAAU;KACT;KACA;KACA;KACA;KACA;KACA;IACD;GACD;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;IACP,WAAW;GACZ;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;EACD;EACA,MAAM,CAAC,8CAA8C;CACtD,CAAC;CACD,CAAC,0BAA0B;EAC1B,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;EACD;CACD,CAAC;CACD,CAAC,4BAA4B;EAC5B,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;EACD;CACD,CAAC;CACD,CAAC,+BAA+B;EAC/B,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;EACD;CACD,CAAC;CACD,CAAC,6BAA6B;EAC7B,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,M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AAC,kCAAkC;EAClC,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;EACD,YAAY,CAAC,6BAA6B;CAC3C,CAAC;CACD,CAAC,kCAAkC;EAClC,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;EACD,YAAY,CAAC,6BAA6B;CAC3C,CAAC;CACD,CAAC,kCAAkC;EAClC,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;EACD,YAAY,CAAC,6BAA6B;CAC3C,CAAC;CACD,CAAC,sCAAsC;EACtC,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;EACD,YAAY,CAAC,6BAA6B;CAC3C,CAAC;CACD,CAAC,0CAA0C;EAC1C,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;CACF,CAAC;AACF,CAAC;;AAED,MAAM,mBAAmB,CAAC,iBAAiB"}
@@ -50,6 +50,19 @@ interface ShellPackageMapping {
50
50
  * pulls it in.
51
51
  */
52
52
  readonly published?: boolean;
53
+ /**
54
+ * The subpaths of this package the shell publishes, without the `./`
55
+ * prefix; `'.'` names the package's root export. Omitted publishes every
56
+ * subpath the package exports plus the package-level aggregate name.
57
+ *
58
+ * When listed, exactly these ship and no aggregate is synthesized. The CLI
59
+ * package uses this to pin its published surface explicitly: the root
60
+ * (`@prisma/orm-toolchain/cli`, where the unified `prisma` shell imports
61
+ * the `orm` command family from) plus the handful of stable subpaths —
62
+ * anything the package adds for workspace-internal use stays unpublished
63
+ * unless listed here.
64
+ */
65
+ readonly subpaths?: readonly string[];
53
66
  }
54
67
  interface ShellReexportMapping {
55
68
  /** Internal package name whose surface is forwarded, e.g. `@internal/contract`. */
@@ -88,25 +101,6 @@ interface ShellDefinition {
88
101
  * facade imports nothing but a direct dependency (ADR 242).
89
102
  */
90
103
  readonly reexports?: readonly ShellReexportMapping[];
91
- /**
92
- * Bin scripts carried by the shell: bin name to a dist file of one of the
93
- * internal packages (relative to the repository root). The file is bundled
94
- * as a side-effect entry named `bin/<binName>`, and published both as the
95
- * `bin` field and as the `./bin/<binName>` entrypoint so another shell can
96
- * forward it.
97
- */
98
- readonly bins?: Readonly<Record<string, string>>;
99
- /**
100
- * Bin scripts this shell re-exposes from another shell: bin name to that
101
- * shell's `./bin/<binName>` entrypoint. The generated launcher imports the
102
- * sibling for its side effects, so the command runs the one published copy
103
- * of the program rather than a second one.
104
- *
105
- * Facades carry the CLI this way because an application installs only the
106
- * facade, and package managers put a package manager's own direct
107
- * dependencies on `PATH` — a transitively installed bin is not runnable.
108
- */
109
- readonly forwardedBins?: Readonly<Record<string, string>>;
110
104
  /**
111
105
  * Sibling shells this shell requires the installer to provide, declared as
112
106
  * peer dependencies rather than pulled in as its own copy.
@@ -132,4 +126,4 @@ declare const publicShells: ReadonlyMap<ShellName, ShellDefinition>;
132
126
  declare const excludedSubpaths: readonly RegExp[];
133
127
  //#endregion
134
128
  export { ShellReexportMapping as a, ShellPackageMapping as i, ShellKind as n, excludedSubpaths as o, ShellName as r, publicShells as s, ShellDefinition as t };
135
- //# sourceMappingURL=shells-COHV_Ozf.d.mts.map
129
+ //# sourceMappingURL=shells-CIUmT4u4.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shells-CIUmT4u4.d.mts","names":[],"sources":["../../../../0-shared/publish-surface/dist/shells.d.mts"],"mappings":";;;;;;;;;;;;;;;;;KAgBK;;;;;;;UAOK;;WAEC;;;;;;;WAOA;;;;;;;;WAQA;;;;;;;;;;WAUA;;;;;;;;;;;;;WAaA;;UAED;;WAEC;;WAEA;;;;;;WAMA;;;;;;;;;;;WAWA;;UAED;;WAEC;WACA,MAAM;WACN,mBAAmB;;;;;;;;;WASnB,qBAAqB;;;;;;;;;;;;WAYrB,sBAAsB;;;;;;WAMtB;;KAEN;cACS,cAAc,YAAY,WAAW;;cAErC,2BAA2B"}
@@ -1,12 +1,12 @@
1
- import { f as errorDuplicateSpaceId, l as errorDescriptorHeadHashMismatch } from "./errors-CXbGUWGu-BQi6YS-H.mjs";
2
- import { o as writeContractSnapshot } from "./contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs";
3
- import { s as readMigrationsDir } from "./io-635GlNx1-D94PxRc-.mjs";
4
- import { l as reconstructGraph, o as findPathWithDecision } from "./migration-graph-_SJImD5V-D5RCc651.mjs";
5
- import { c as spaceMigrationDirectory, i as assertValidSpaceId, l as spaceRefsDirectory, o as listContractSpaceDirectories, s as readContractSpaceHeadRef, t as APP_SPACE_ID } from "./verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs";
1
+ import { f as errorDuplicateSpaceId, l as errorDescriptorHeadHashMismatch } from "./errors-CXbGUWGu-CstQHPh6.mjs";
2
+ import { o as writeContractSnapshot } from "./contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs";
3
+ import { s as readMigrationsDir } from "./io-635GlNx1-D3zrw2qu.mjs";
4
+ import { l as reconstructGraph, o as findPathWithDecision } from "./migration-graph-_SJImD5V-BURyY1KM.mjs";
5
+ import { c as spaceMigrationDirectory, i as assertValidSpaceId, l as spaceRefsDirectory, o as listContractSpaceDirectories, s as readContractSpaceHeadRef, t as APP_SPACE_ID } from "./verify-contract-spaces-DhJTb0zM-B62maCfE.mjs";
6
6
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
7
- import { join } from "pathe";
8
7
  import { computeStorageHash } from "@prisma/orm-framework/contract/hashing";
9
8
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
9
+ import { join } from "pathe";
10
10
  import { mkdir, writeFile } from "node:fs/promises";
11
11
  import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
12
12
  //#region ../../../1-framework/3-tooling/migration/dist/exports/spaces.mjs
@@ -264,4 +264,4 @@ function planAllSpaces(inputs, planSpace) {
264
264
  //#endregion
265
265
  export { gatherDiskContractSpaceState as a, emitContractSpaceArtifacts as i, computeExtensionSpaceApplyPath as n, planAllSpaces as o, contractSpaceFromJson as r, assertDescriptorSelfConsistency as t };
266
266
 
267
- //# sourceMappingURL=spaces-BG2w0P8d.mjs.map
267
+ //# sourceMappingURL=spaces-4qMOAYE9.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"spaces-BG2w0P8d.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/spaces.mjs"],"sourcesContent":["import { f as errorDuplicateSpaceId, l as errorDescriptorHeadHashMismatch } from \"../errors-CXbGUWGu.mjs\";\nimport { o as writeContractSnapshot } from \"../contract-snapshot-store-B0G1Fw_F.mjs\";\nimport { s as readMigrationsDir } from \"../io-635GlNx1.mjs\";\nimport \"../constants-CM-w38DQ.mjs\";\nimport { l as reconstructGraph, o as findPathWithDecision } from \"../migration-graph-_SJImD5V.mjs\";\nimport { a as RESERVED_SPACE_SUBDIR_NAMES, c as isValidSpaceId, i as APP_SPACE_ID, l as spaceMigrationDirectory, n as verifyContractSpaces, o as SPACE_REFS_DIRNAME, r as readContractSpaceHeadRef, s as assertValidSpaceId, t as listContractSpaceDirectories, u as spaceRefsDirectory } from \"../verify-contract-spaces-DhJTb0zM.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { join } from \"pathe\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { computeStorageHash } from \"@internal/contract/hashing\";\n//#region src/assert-descriptor-self-consistency.ts\n/**\n* Assert that an extension descriptor is self-consistent: the\n* `headRef.hash` it publishes must match the canonical hash recomputed\n* from its `contractSpace.contractJson`.\n*\n* Recomputes via {@link computeStorageHash} — the same canonical-JSON\n* pipeline the descriptor's own emit pipeline produced the hash with —\n* over `(target, targetFamily, storage)`. Mismatch indicates the\n* extension author bumped `contractJson` without rerunning emit, leaving\n* the descriptor's `headRef.hash` stale; the consumer-side helpers\n* (drift detection, on-disk artefact emission, runner marker writes) all\n* trust `headRef.hash` as the canonical identity, so a stale value would\n* silently corrupt every downstream boundary.\n*\n* Synchronous, pure, no I/O. Throws\n* `MIGRATION.DESCRIPTOR_HEAD_HASH_MISMATCH` on failure with both the\n* recomputed and published hashes in `meta` so callers can surface a\n* clear remediation hint without re-deriving them.\n*/\nfunction assertDescriptorSelfConsistency(inputs) {\n\tconst { storageHash: _stripped, ...storageWithoutHash } = inputs.storage;\n\tconst recomputed = computeStorageHash({\n\t\ttarget: inputs.target,\n\t\ttargetFamily: inputs.targetFamily,\n\t\tstorage: storageWithoutHash,\n\t\t...ifDefined(\"shouldPreserveEmpty\", inputs.shouldPreserveEmpty),\n\t\t...ifDefined(\"sortStorage\", inputs.sortStorage)\n\t});\n\tif (recomputed !== inputs.headRefHash) throw errorDescriptorHeadHashMismatch({\n\t\textensionId: inputs.extensionId,\n\t\trecomputedHash: recomputed,\n\t\theadRefHash: inputs.headRefHash\n\t});\n}\n//#endregion\n//#region src/compute-extension-space-apply-path.ts\n/**\n* Compute the apply path for an extension contract space — the shortest\n* sequence of on-disk migration packages that walks the live marker\n* forward to the on-disk head ref hash, covering every required\n* invariant.\n*\n* Reads only on-disk artifacts (`migrations/<spaceId>/refs/head.json`\n* and the per-space migration packages). **Does not import any\n* extension descriptor module** — `db init` / `db update` must remain\n* runnable without the descriptor source on disk.\n*\n* Behaviour:\n* - Returns `{ kind: 'ok', pathOps: [], … }` when the marker is already\n* at the recorded head and no required invariants are missing.\n* - Returns `{ kind: 'unreachable' }` when the marker hash is not\n* structurally connected to the recorded head in the graph.\n* - Returns `{ kind: 'unsatisfiable', missing, … }` when the marker is\n* reachable but no path covers the required invariants.\n* - Returns `{ kind: 'contractSpaceHeadRefMissing' }` when the per-space\n* `refs/head.json` is absent — the precheck verifier should already\n* have rejected this case, but the helper is defensive so callers can\n* surface a coherent error rather than throw.\n*/\nasync function computeExtensionSpaceApplyPath(inputs) {\n\tconst { projectMigrationsDir, spaceId, currentMarkerHash, currentMarkerInvariants } = inputs;\n\tconst contractSpaceHeadRef = await readContractSpaceHeadRef(projectMigrationsDir, spaceId);\n\tif (contractSpaceHeadRef === null) return { kind: \"contractSpaceHeadRefMissing\" };\n\tconst { packages } = await readMigrationsDir(spaceMigrationDirectory(projectMigrationsDir, spaceId), { migrationsDir: projectMigrationsDir });\n\tconst graph = reconstructGraph(packages);\n\tconst fromHash = currentMarkerHash ?? \"empty\";\n\tconst required = new Set(contractSpaceHeadRef.invariants.filter((id) => !currentMarkerInvariants.includes(id)));\n\tconst outcome = findPathWithDecision(graph, fromHash, contractSpaceHeadRef.hash, { required });\n\tif (outcome.kind === \"unreachable\") return {\n\t\tkind: \"unreachable\",\n\t\tcontractSpaceHeadRef\n\t};\n\tif (outcome.kind === \"unsatisfiable\") return {\n\t\tkind: \"unsatisfiable\",\n\t\tcontractSpaceHeadRef,\n\t\tmissing: outcome.missing,\n\t\tstructuralPath: outcome.structuralPath.map(({ dirName, to }) => ({\n\t\t\tdirName,\n\t\t\tto\n\t\t}))\n\t};\n\tconst packagesByHash = new Map(packages.map((pkg) => [pkg.metadata.migrationHash, pkg]));\n\tconst pathOps = [];\n\tconst walkedMigrationDirs = [];\n\tconst providedInvariantsSet = /* @__PURE__ */ new Set();\n\tfor (const edge of outcome.decision.selectedPath) {\n\t\tconst pkg = packagesByHash.get(edge.migrationHash);\n\t\tif (!pkg) throw new InternalError(`Migration package missing for edge ${edge.migrationHash} in space \"${spaceId}\"`);\n\t\twalkedMigrationDirs.push(pkg.dirName);\n\t\tfor (const op of pkg.ops) pathOps.push(op);\n\t\tfor (const invariant of pkg.metadata.providedInvariants) providedInvariantsSet.add(invariant);\n\t}\n\treturn {\n\t\tkind: \"ok\",\n\t\tcontractSpaceHeadRef,\n\t\tprovidedInvariants: [...providedInvariantsSet].sort(),\n\t\tpathOps,\n\t\twalkedMigrationDirs\n\t};\n}\n//#endregion\n//#region src/contract-space-from-json.ts\n/**\n* Materialise a typed {@link ContractSpace} from the JSON artefacts a\n* contract-space extension package emits to disk.\n*\n* Extension descriptors wire `contract.json`, per-migration\n* `migration.json` / `ops.json`, and `refs/head.json` to the framework's\n* typed surfaces. TypeScript widens JSON imports to a structural record\n* that does not preserve readonly modifiers or branded scalars (e.g.\n* `StorageHashBase<'abc123...'>`), so authoring the descriptor inline\n* forces every wiring site to cast through `unknown`. This helper\n* encapsulates the single narrowing point: descriptor sources stay\n* cast-free, and the (necessary) coercion is colocated with the\n* documentation explaining why it is safe.\n*\n* Safety: the JSON files passed here are produced by the framework's own\n* emit pipeline (`prisma-next contract emit` and `MigrationCLI.run`)\n* and re-validated downstream by the runner / verifier. The descriptor\n* is a pass-through wiring layer — no descriptor consumer treats the\n* narrowed types as a stronger guarantee than \"these came from the\n* canonical emit pipeline\".\n*\n* The helper does not introspect or schema-validate the inputs; runtime\n* validation is the responsibility of `family.deserializeContract`\n* (codec-aware, invoked at control-stack construction) and the\n* per-migration `readMigrationPackage` reader used when loading\n* from disk. JSON-imported packages flow through the descriptor without\n* a disk read, so the equivalent runtime guarantee comes from the emit\n* pipeline that produced the JSON in the first place.\n*/\nfunction contractSpaceFromJson(inputs) {\n\tconst migrations = inputs.migrations.map((m) => ({\n\t\tdirName: m.dirName,\n\t\tmetadata: m.metadata,\n\t\tops: m.ops\n\t}));\n\treturn {\n\t\tcontractJson: inputs.contractJson,\n\t\tmigrations,\n\t\theadRef: inputs.headRef\n\t};\n}\n//#endregion\n//#region src/emit-contract-space-artifacts.ts\n/**\n* Emit the per-space artifacts — the head contract snapshot (written into\n* the migrations-root-wide `snapshots/` store, keyed by `headRef.hash`) and\n* `refs/head.json` — under `<projectMigrationsDir>/<spaceId>/`.\n*\n* The head contract snapshot is write-if-absent (see\n* {@link writeContractSnapshot}): a changed extension contract has a new\n* hash, so it lands as a new store entry; an unchanged hash means identical\n* canonical content already sits there. `refs/head.json` stays\n* always-overwrite: the framework owns it, so running `migrate` twice with\n* the same inputs is a no-op observably (idempotent), but the helper does\n* not check pre-existing contents — re-emit always wins.\n*\n* Path layout matches the convention in\n* [`spaceMigrationDirectory`](./space-layout.ts). The space id is\n* validated against `[a-z][a-z0-9_-]{0,63}` via\n* {@link assertValidSpaceId} for filesystem-safety reasons; the helper\n* accepts every space uniformly (including the app space, default\n* `'app'`).\n*\n* The migrations directory and space subdirectory are created if they\n* do not yet exist (`mkdir { recursive: true }`).\n*/\nasync function emitContractSpaceArtifacts(projectMigrationsDir, spaceId, inputs) {\n\tassertValidSpaceId(spaceId);\n\tconst refsDir = spaceRefsDirectory(join(projectMigrationsDir, spaceId));\n\tawait mkdir(refsDir, { recursive: true });\n\tawait writeContractSnapshot(projectMigrationsDir, inputs.headRef.hash, {\n\t\tcontractJson: inputs.contract,\n\t\tcontractDts: inputs.contractDts\n\t});\n\tconst sortedInvariants = [...inputs.headRef.invariants].sort();\n\tconst headJson = canonicalizeJson({\n\t\thash: inputs.headRef.hash,\n\t\tinvariants: sortedInvariants\n\t});\n\tawait writeFile(join(refsDir, \"head.json\"), `${headJson}\\n`);\n}\n//#endregion\n//#region src/gather-disk-contract-space-state.ts\n/**\n* Read the on-disk state the per-space verifier needs:\n*\n* - The list of contract-space directories under\n* `<projectMigrationsDir>/` (via\n* {@link import('./verify-contract-spaces').listContractSpaceDirectories}).\n* - The on-disk head ref `(hash, invariants)` for each declared extension space\n* (via {@link readContractSpaceHeadRef}; missing on-disk artefacts are simply\n* omitted — the verifier reports them as `declaredButUnmigrated`).\n*\n* Synchronous in spirit but async due to filesystem reads. Reads only\n* the user's repo. **Does not import any extension descriptor module.**\n*\n* Composition convention: pure target-agnostic primitive in\n* `1-framework`; the SQL family (and any future target family) wires\n* it into its `dbInit` / `verify` flows alongside its own marker-row\n* read before invoking `verifyContractSpaces`.\n*/\nasync function gatherDiskContractSpaceState(args) {\n\tconst { projectMigrationsDir, loadedSpaceIds } = args;\n\tconst spaceDirsOnDisk = await listContractSpaceDirectories(projectMigrationsDir);\n\tconst headRefsBySpace = /* @__PURE__ */ new Map();\n\tfor (const spaceId of loadedSpaceIds) {\n\t\tif (spaceId === APP_SPACE_ID) continue;\n\t\tconst head = await readContractSpaceHeadRef(projectMigrationsDir, spaceId);\n\t\tif (head !== null) headRefsBySpace.set(spaceId, head);\n\t}\n\treturn {\n\t\tspaceDirsOnDisk,\n\t\theadRefsBySpace\n\t};\n}\n//#endregion\n//#region src/plan-all-spaces.ts\n/**\n* Iterate the per-space planner across a set of loaded contract spaces\n* and return a deterministic shape regardless of declaration order.\n*\n* Behaviour:\n*\n* - The output is sorted alphabetically by `spaceId`. Two callers\n* passing the same set of inputs in different orders observe\n* byte-identical outputs.\n* - The per-space planner (`planSpace`) is called exactly once per\n* input, in alphabetical-by-spaceId order. Its return value is\n* attached to the corresponding output entry verbatim.\n* - Duplicate `spaceId`s in the input array throw\n* `MIGRATION.DUPLICATE_SPACE_ID` before any `planSpace` call runs,\n* keeping the planner pure when the input is malformed.\n*\n* The signature is generic over `TContract` and `TPackage` because the\n* shape is framework-neutral (SQL family today, Mongo family\n* eventually). Callers wire in whatever contract value and migration\n* package shape their family already speaks.\n*\n* Synchronous: the underlying per-space planner (target's\n* `MigrationPlanner.plan(...)`) is synchronous; callers that need to\n* resolve async I/O (e.g. reading on-disk `contract.json` from disk)\n* resolve it before calling `planAllSpaces` and pass the materialised\n* inputs through.\n*/\nfunction planAllSpaces(inputs, planSpace) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const input of inputs) {\n\t\tif (seen.has(input.spaceId)) throw errorDuplicateSpaceId(input.spaceId);\n\t\tseen.add(input.spaceId);\n\t}\n\treturn [...inputs].sort((a, b) => {\n\t\tif (a.spaceId < b.spaceId) return -1;\n\t\tif (a.spaceId > b.spaceId) return 1;\n\t\treturn 0;\n\t}).map((input) => ({\n\t\tspaceId: input.spaceId,\n\t\tmigrationPackages: planSpace(input)\n\t}));\n}\n//#endregion\nexport { APP_SPACE_ID, RESERVED_SPACE_SUBDIR_NAMES, SPACE_REFS_DIRNAME, assertDescriptorSelfConsistency, assertValidSpaceId, computeExtensionSpaceApplyPath, contractSpaceFromJson, emitContractSpaceArtifacts, gatherDiskContractSpaceState, isValidSpaceId, listContractSpaceDirectories, planAllSpaces, readContractSpaceHeadRef, spaceMigrationDirectory, spaceRefsDirectory, verifyContractSpaces };\n\n//# sourceMappingURL=spaces.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,gCAAgC,QAAQ;CAChD,MAAM,EAAE,aAAa,WAAW,GAAG,uBAAuB,OAAO;CACjE,MAAM,aAAa,mBAAmB;EACrC,QAAQ,OAAO;EACf,cAAc,OAAO;EACrB,SAAS;EACT,GAAG,UAAU,uBAAuB,OAAO,mBAAmB;EAC9D,GAAG,UAAU,eAAe,OAAO,WAAW;CAC/C,CAAC;CACD,IAAI,eAAe,OAAO,aAAa,MAAM,gCAAgC;EAC5E,aAAa,OAAO;EACpB,gBAAgB;EAChB,aAAa,OAAO;CACrB,CAAC;AACF;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,eAAe,+BAA+B,QAAQ;CACrD,MAAM,EAAE,sBAAsB,SAAS,mBAAmB,4BAA4B;CACtF,MAAM,uBAAuB,MAAM,yBAAyB,sBAAsB,OAAO;CACzF,IAAI,yBAAyB,MAAM,OAAO,EAAE,MAAM,8BAA8B;CAChF,MAAM,EAAE,aAAa,MAAM,kBAAkB,wBAAwB,sBAAsB,OAAO,GAAG,EAAE,eAAe,qBAAqB,CAAC;CAC5I,MAAM,QAAQ,iBAAiB,QAAQ;CACvC,MAAM,WAAW,qBAAqB;CACtC,MAAM,WAAW,IAAI,IAAI,qBAAqB,WAAW,QAAQ,OAAO,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;CAC9G,MAAM,UAAU,qBAAqB,OAAO,UAAU,qBAAqB,MAAM,EAAE,SAAS,CAAC;CAC7F,IAAI,QAAQ,SAAS,eAAe,OAAO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B,OAAO,QAAQ,MAAM;EACtE,cAAc,OAAO;EACrB,aAAa,OAAO;CACrB,CAAC;CACD,MAAM,mBAAmB,CAAC,GAAG,OAAO,QAAQ,UAAU,CAAC,CAAC,KAAK;CAC7D,MAAM,WAAW,iBAAiB;EACjC,MAAM,OAAO,QAAQ;EACrB,YAAY;CACb,CAAC;CACD,MAAM,UAAU,KAAK,SAAS,WAAW,GAAG,GAAG,SAAS,GAAG;AAC5D;;;;;;;;;;;;;;;;;;;AAqBA,eAAe,6BAA6B,MAAM;CACjD,MAAM,EAAE,sBAAsB,mBAAmB;CACjD,MAAM,kBAAkB,MAAM,6BAA6B,oBAAoB;CAC/E,MAAM,kCAAkC,IAAI,IAAI;CAChD,KAAK,MAAM,WAAW,gBAAgB;EACrC,IAAI,YAAY,cAAc;EAC9B,MAAM,OAAO,MAAM,yBAAyB,sBAAsB,OAAO;EACzE,IAAI,SAAS,MAAM,gBAAgB,IAAI,SAAS,IAAI;CACrD;CACA,OAAO;EACN;EACA;CACD;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAS,cAAc,QAAQ,WAAW;CACzC,MAAM,uBAAuB,IAAI,IAAI;CACrC,KAAK,MAAM,SAAS,QAAQ;EAC3B,IAAI,KAAK,IAAI,MAAM,OAAO,GAAG,MAAM,sBAAsB,MAAM,OAAO;EACtE,KAAK,IAAI,MAAM,OAAO;CACvB;CACA,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,GAAG,MAAM;EACjC,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,OAAO;CACR,CAAC,CAAC,CAAC,KAAK,WAAW;EAClB,SAAS,MAAM;EACf,mBAAmB,UAAU,KAAK;CACnC,EAAE;AACH"}
1
+ {"version":3,"file":"spaces-4qMOAYE9.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/spaces.mjs"],"sourcesContent":["import { f as errorDuplicateSpaceId, l as errorDescriptorHeadHashMismatch } from \"../errors-CXbGUWGu.mjs\";\nimport { o as writeContractSnapshot } from \"../contract-snapshot-store-B0G1Fw_F.mjs\";\nimport { s as readMigrationsDir } from \"../io-635GlNx1.mjs\";\nimport \"../constants-CM-w38DQ.mjs\";\nimport { l as reconstructGraph, o as findPathWithDecision } from \"../migration-graph-_SJImD5V.mjs\";\nimport { a as RESERVED_SPACE_SUBDIR_NAMES, c as isValidSpaceId, i as APP_SPACE_ID, l as spaceMigrationDirectory, n as verifyContractSpaces, o as SPACE_REFS_DIRNAME, r as readContractSpaceHeadRef, s as assertValidSpaceId, t as listContractSpaceDirectories, u as spaceRefsDirectory } from \"../verify-contract-spaces-DhJTb0zM.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { join } from \"pathe\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { computeStorageHash } from \"@internal/contract/hashing\";\n//#region src/assert-descriptor-self-consistency.ts\n/**\n* Assert that an extension descriptor is self-consistent: the\n* `headRef.hash` it publishes must match the canonical hash recomputed\n* from its `contractSpace.contractJson`.\n*\n* Recomputes via {@link computeStorageHash} — the same canonical-JSON\n* pipeline the descriptor's own emit pipeline produced the hash with —\n* over `(target, targetFamily, storage)`. Mismatch indicates the\n* extension author bumped `contractJson` without rerunning emit, leaving\n* the descriptor's `headRef.hash` stale; the consumer-side helpers\n* (drift detection, on-disk artefact emission, runner marker writes) all\n* trust `headRef.hash` as the canonical identity, so a stale value would\n* silently corrupt every downstream boundary.\n*\n* Synchronous, pure, no I/O. Throws\n* `MIGRATION.DESCRIPTOR_HEAD_HASH_MISMATCH` on failure with both the\n* recomputed and published hashes in `meta` so callers can surface a\n* clear remediation hint without re-deriving them.\n*/\nfunction assertDescriptorSelfConsistency(inputs) {\n\tconst { storageHash: _stripped, ...storageWithoutHash } = inputs.storage;\n\tconst recomputed = computeStorageHash({\n\t\ttarget: inputs.target,\n\t\ttargetFamily: inputs.targetFamily,\n\t\tstorage: storageWithoutHash,\n\t\t...ifDefined(\"shouldPreserveEmpty\", inputs.shouldPreserveEmpty),\n\t\t...ifDefined(\"sortStorage\", inputs.sortStorage)\n\t});\n\tif (recomputed !== inputs.headRefHash) throw errorDescriptorHeadHashMismatch({\n\t\textensionId: inputs.extensionId,\n\t\trecomputedHash: recomputed,\n\t\theadRefHash: inputs.headRefHash\n\t});\n}\n//#endregion\n//#region src/compute-extension-space-apply-path.ts\n/**\n* Compute the apply path for an extension contract space — the shortest\n* sequence of on-disk migration packages that walks the live marker\n* forward to the on-disk head ref hash, covering every required\n* invariant.\n*\n* Reads only on-disk artifacts (`migrations/<spaceId>/refs/head.json`\n* and the per-space migration packages). **Does not import any\n* extension descriptor module** — `db init` / `db update` must remain\n* runnable without the descriptor source on disk.\n*\n* Behaviour:\n* - Returns `{ kind: 'ok', pathOps: [], … }` when the marker is already\n* at the recorded head and no required invariants are missing.\n* - Returns `{ kind: 'unreachable' }` when the marker hash is not\n* structurally connected to the recorded head in the graph.\n* - Returns `{ kind: 'unsatisfiable', missing, … }` when the marker is\n* reachable but no path covers the required invariants.\n* - Returns `{ kind: 'contractSpaceHeadRefMissing' }` when the per-space\n* `refs/head.json` is absent — the precheck verifier should already\n* have rejected this case, but the helper is defensive so callers can\n* surface a coherent error rather than throw.\n*/\nasync function computeExtensionSpaceApplyPath(inputs) {\n\tconst { projectMigrationsDir, spaceId, currentMarkerHash, currentMarkerInvariants } = inputs;\n\tconst contractSpaceHeadRef = await readContractSpaceHeadRef(projectMigrationsDir, spaceId);\n\tif (contractSpaceHeadRef === null) return { kind: \"contractSpaceHeadRefMissing\" };\n\tconst { packages } = await readMigrationsDir(spaceMigrationDirectory(projectMigrationsDir, spaceId), { migrationsDir: projectMigrationsDir });\n\tconst graph = reconstructGraph(packages);\n\tconst fromHash = currentMarkerHash ?? \"empty\";\n\tconst required = new Set(contractSpaceHeadRef.invariants.filter((id) => !currentMarkerInvariants.includes(id)));\n\tconst outcome = findPathWithDecision(graph, fromHash, contractSpaceHeadRef.hash, { required });\n\tif (outcome.kind === \"unreachable\") return {\n\t\tkind: \"unreachable\",\n\t\tcontractSpaceHeadRef\n\t};\n\tif (outcome.kind === \"unsatisfiable\") return {\n\t\tkind: \"unsatisfiable\",\n\t\tcontractSpaceHeadRef,\n\t\tmissing: outcome.missing,\n\t\tstructuralPath: outcome.structuralPath.map(({ dirName, to }) => ({\n\t\t\tdirName,\n\t\t\tto\n\t\t}))\n\t};\n\tconst packagesByHash = new Map(packages.map((pkg) => [pkg.metadata.migrationHash, pkg]));\n\tconst pathOps = [];\n\tconst walkedMigrationDirs = [];\n\tconst providedInvariantsSet = /* @__PURE__ */ new Set();\n\tfor (const edge of outcome.decision.selectedPath) {\n\t\tconst pkg = packagesByHash.get(edge.migrationHash);\n\t\tif (!pkg) throw new InternalError(`Migration package missing for edge ${edge.migrationHash} in space \"${spaceId}\"`);\n\t\twalkedMigrationDirs.push(pkg.dirName);\n\t\tfor (const op of pkg.ops) pathOps.push(op);\n\t\tfor (const invariant of pkg.metadata.providedInvariants) providedInvariantsSet.add(invariant);\n\t}\n\treturn {\n\t\tkind: \"ok\",\n\t\tcontractSpaceHeadRef,\n\t\tprovidedInvariants: [...providedInvariantsSet].sort(),\n\t\tpathOps,\n\t\twalkedMigrationDirs\n\t};\n}\n//#endregion\n//#region src/contract-space-from-json.ts\n/**\n* Materialise a typed {@link ContractSpace} from the JSON artefacts a\n* contract-space extension package emits to disk.\n*\n* Extension descriptors wire `contract.json`, per-migration\n* `migration.json` / `ops.json`, and `refs/head.json` to the framework's\n* typed surfaces. TypeScript widens JSON imports to a structural record\n* that does not preserve readonly modifiers or branded scalars (e.g.\n* `StorageHashBase<'abc123...'>`), so authoring the descriptor inline\n* forces every wiring site to cast through `unknown`. This helper\n* encapsulates the single narrowing point: descriptor sources stay\n* cast-free, and the (necessary) coercion is colocated with the\n* documentation explaining why it is safe.\n*\n* Safety: the JSON files passed here are produced by the framework's own\n* emit pipeline (`prisma-next contract emit` and `MigrationCLI.run`)\n* and re-validated downstream by the runner / verifier. The descriptor\n* is a pass-through wiring layer — no descriptor consumer treats the\n* narrowed types as a stronger guarantee than \"these came from the\n* canonical emit pipeline\".\n*\n* The helper does not introspect or schema-validate the inputs; runtime\n* validation is the responsibility of `family.deserializeContract`\n* (codec-aware, invoked at control-stack construction) and the\n* per-migration `readMigrationPackage` reader used when loading\n* from disk. JSON-imported packages flow through the descriptor without\n* a disk read, so the equivalent runtime guarantee comes from the emit\n* pipeline that produced the JSON in the first place.\n*/\nfunction contractSpaceFromJson(inputs) {\n\tconst migrations = inputs.migrations.map((m) => ({\n\t\tdirName: m.dirName,\n\t\tmetadata: m.metadata,\n\t\tops: m.ops\n\t}));\n\treturn {\n\t\tcontractJson: inputs.contractJson,\n\t\tmigrations,\n\t\theadRef: inputs.headRef\n\t};\n}\n//#endregion\n//#region src/emit-contract-space-artifacts.ts\n/**\n* Emit the per-space artifacts — the head contract snapshot (written into\n* the migrations-root-wide `snapshots/` store, keyed by `headRef.hash`) and\n* `refs/head.json` — under `<projectMigrationsDir>/<spaceId>/`.\n*\n* The head contract snapshot is write-if-absent (see\n* {@link writeContractSnapshot}): a changed extension contract has a new\n* hash, so it lands as a new store entry; an unchanged hash means identical\n* canonical content already sits there. `refs/head.json` stays\n* always-overwrite: the framework owns it, so running `migrate` twice with\n* the same inputs is a no-op observably (idempotent), but the helper does\n* not check pre-existing contents — re-emit always wins.\n*\n* Path layout matches the convention in\n* [`spaceMigrationDirectory`](./space-layout.ts). The space id is\n* validated against `[a-z][a-z0-9_-]{0,63}` via\n* {@link assertValidSpaceId} for filesystem-safety reasons; the helper\n* accepts every space uniformly (including the app space, default\n* `'app'`).\n*\n* The migrations directory and space subdirectory are created if they\n* do not yet exist (`mkdir { recursive: true }`).\n*/\nasync function emitContractSpaceArtifacts(projectMigrationsDir, spaceId, inputs) {\n\tassertValidSpaceId(spaceId);\n\tconst refsDir = spaceRefsDirectory(join(projectMigrationsDir, spaceId));\n\tawait mkdir(refsDir, { recursive: true });\n\tawait writeContractSnapshot(projectMigrationsDir, inputs.headRef.hash, {\n\t\tcontractJson: inputs.contract,\n\t\tcontractDts: inputs.contractDts\n\t});\n\tconst sortedInvariants = [...inputs.headRef.invariants].sort();\n\tconst headJson = canonicalizeJson({\n\t\thash: inputs.headRef.hash,\n\t\tinvariants: sortedInvariants\n\t});\n\tawait writeFile(join(refsDir, \"head.json\"), `${headJson}\\n`);\n}\n//#endregion\n//#region src/gather-disk-contract-space-state.ts\n/**\n* Read the on-disk state the per-space verifier needs:\n*\n* - The list of contract-space directories under\n* `<projectMigrationsDir>/` (via\n* {@link import('./verify-contract-spaces').listContractSpaceDirectories}).\n* - The on-disk head ref `(hash, invariants)` for each declared extension space\n* (via {@link readContractSpaceHeadRef}; missing on-disk artefacts are simply\n* omitted — the verifier reports them as `declaredButUnmigrated`).\n*\n* Synchronous in spirit but async due to filesystem reads. Reads only\n* the user's repo. **Does not import any extension descriptor module.**\n*\n* Composition convention: pure target-agnostic primitive in\n* `1-framework`; the SQL family (and any future target family) wires\n* it into its `dbInit` / `verify` flows alongside its own marker-row\n* read before invoking `verifyContractSpaces`.\n*/\nasync function gatherDiskContractSpaceState(args) {\n\tconst { projectMigrationsDir, loadedSpaceIds } = args;\n\tconst spaceDirsOnDisk = await listContractSpaceDirectories(projectMigrationsDir);\n\tconst headRefsBySpace = /* @__PURE__ */ new Map();\n\tfor (const spaceId of loadedSpaceIds) {\n\t\tif (spaceId === APP_SPACE_ID) continue;\n\t\tconst head = await readContractSpaceHeadRef(projectMigrationsDir, spaceId);\n\t\tif (head !== null) headRefsBySpace.set(spaceId, head);\n\t}\n\treturn {\n\t\tspaceDirsOnDisk,\n\t\theadRefsBySpace\n\t};\n}\n//#endregion\n//#region src/plan-all-spaces.ts\n/**\n* Iterate the per-space planner across a set of loaded contract spaces\n* and return a deterministic shape regardless of declaration order.\n*\n* Behaviour:\n*\n* - The output is sorted alphabetically by `spaceId`. Two callers\n* passing the same set of inputs in different orders observe\n* byte-identical outputs.\n* - The per-space planner (`planSpace`) is called exactly once per\n* input, in alphabetical-by-spaceId order. Its return value is\n* attached to the corresponding output entry verbatim.\n* - Duplicate `spaceId`s in the input array throw\n* `MIGRATION.DUPLICATE_SPACE_ID` before any `planSpace` call runs,\n* keeping the planner pure when the input is malformed.\n*\n* The signature is generic over `TContract` and `TPackage` because the\n* shape is framework-neutral (SQL family today, Mongo family\n* eventually). Callers wire in whatever contract value and migration\n* package shape their family already speaks.\n*\n* Synchronous: the underlying per-space planner (target's\n* `MigrationPlanner.plan(...)`) is synchronous; callers that need to\n* resolve async I/O (e.g. reading on-disk `contract.json` from disk)\n* resolve it before calling `planAllSpaces` and pass the materialised\n* inputs through.\n*/\nfunction planAllSpaces(inputs, planSpace) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const input of inputs) {\n\t\tif (seen.has(input.spaceId)) throw errorDuplicateSpaceId(input.spaceId);\n\t\tseen.add(input.spaceId);\n\t}\n\treturn [...inputs].sort((a, b) => {\n\t\tif (a.spaceId < b.spaceId) return -1;\n\t\tif (a.spaceId > b.spaceId) return 1;\n\t\treturn 0;\n\t}).map((input) => ({\n\t\tspaceId: input.spaceId,\n\t\tmigrationPackages: planSpace(input)\n\t}));\n}\n//#endregion\nexport { APP_SPACE_ID, RESERVED_SPACE_SUBDIR_NAMES, SPACE_REFS_DIRNAME, assertDescriptorSelfConsistency, assertValidSpaceId, computeExtensionSpaceApplyPath, contractSpaceFromJson, emitContractSpaceArtifacts, gatherDiskContractSpaceState, isValidSpaceId, listContractSpaceDirectories, planAllSpaces, readContractSpaceHeadRef, spaceMigrationDirectory, spaceRefsDirectory, verifyContractSpaces };\n\n//# sourceMappingURL=spaces.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,gCAAgC,QAAQ;CAChD,MAAM,EAAE,aAAa,W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AmB;CACjD,MAAM,kBAAkB,MAAM,6BAA6B,oBAAoB;CAC/E,MAAM,kCAAkC,IAAI,IAAI;CAChD,KAAK,MAAM,WAAW,gBAAgB;EACrC,IAAI,YAAY,cAAc;EAC9B,MAAM,OAAO,MAAM,yBAAyB,sBAAsB,OAAO;EACzE,IAAI,SAAS,MAAM,gBAAgB,IAAI,SAAS,IAAI;CACrD;CACA,OAAO;EACN;EACA;CACD;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAS,cAAc,QAAQ,WAAW;CACzC,MAAM,uBAAuB,IAAI,IAAI;CACrC,KAAK,MAAM,SAAS,QAAQ;EAC3B,IAAI,KAAK,IAAI,MAAM,OAAO,GAAG,MAAM,sBAAsB,MAAM,OAAO;EACtE,KAAK,IAAI,MAAM,OAAO;CACvB;CACA,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,GAAG,MAAM;EACjC,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,OAAO;CACR,CAAC,CAAC,CAAC,KAAK,WAAW;EAClB,SAAS,MAAM;EACf,mBAAmB,UAAU,KAAK;CACnC,EAAE;AACH"}
@@ -1,5 +1,5 @@
1
1
  import { t as MigrationOps } from "./package-CfWiDNrr-ZR4HM_Iz.mjs";
2
- import { t as ContractSpaceHeadRecord } from "./verify-contract-spaces-Cc1u_wJo-BilPJS2S.mjs";
2
+ import { t as ContractSpaceHeadRecord } from "./verify-contract-spaces-C3PiFBk3-DfomYyOE.mjs";
3
3
  import { PreserveEmptyPredicate, StorageSort } from "@prisma/orm-framework/contract/hashing";
4
4
  import { APP_SPACE_ID as APP_SPACE_ID$1, ContractSpace, ContractSpaceHeadRef, ContractSpaceHeadRef as ContractSpaceHeadRef$1 } from "@prisma/orm-framework/components/control";
5
5
  import { Contract } from "@prisma/orm-framework/contract/types";
@@ -412,4 +412,4 @@ declare const RESERVED_SPACE_SUBDIR_NAMES: ReadonlySet<string>;
412
412
  declare function spaceRefsDirectory(spaceMigrationsDir: string): string;
413
413
  //#endregion
414
414
  export { spaceMigrationDirectory as C, readContractSpaceHeadRef as S, contractSpaceFromJson as _, DescriptorSelfConsistencyInputs as a, isValidSpaceId as b, RESERVED_SPACE_SUBDIR_NAMES as c, SpacePlanInput as d, SpacePlanOutput as f, computeExtensionSpaceApplyPath as g, assertValidSpaceId as h, ContractSpaceHeadRef$1 as i, SPACE_REFS_DIRNAME as l, assertDescriptorSelfConsistency as m, ComputeExtensionSpaceApplyPathInputs as n, DiskContractSpaceState as o, ValidSpaceId as p, ContractSpaceArtifactInputs as r, ExtensionSpaceApplyPathOutcome as s, APP_SPACE_ID$1 as t, SpaceApplyInput as u, emitContractSpaceArtifacts as v, spaceRefsDirectory as w, planAllSpaces as x, gatherDiskContractSpaceState as y };
415
- //# sourceMappingURL=spaces-tWQi7CUv.d.mts.map
415
+ //# sourceMappingURL=spaces-Dj65JrwZ.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spaces-tWQi7CUv.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/spaces.d.mts"],"mappings":";;;;;;;;;;;;;UAYU;WACC;WACA;WACA;;;;;;;;WAQA;WACA;WACA,sBAAsB;WACtB,cAAc;;;;;;;;;;;;;;;;;;;;;iBAqBR,gCAAgC,QAAQ;;;;;;;;;;;;;;;;iBAgBxC,yBAAyB,8BAA8B,kBAAkB,QAAQ;;;;;;;;;KAS7F;WACM;WACA,sBAAsB;;;;;;WAMtB;;;;;WAKA,SAAS;;;;;;WAMT;;WAEA;WACA,sBAAsB;;WAEtB;WACA,sBAAsB;WACtB;WACA;aACE;aACA;;;WAGF;;;;;;;;;;;;;UAaD;WACC;WACA;WACA;WACA;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBM,+BAA+B,QAAQ,uCAAuC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;UAuB7F,gBAAgB;WACf;WACA;WACA;WACA;WACA,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCT,sBAAsB,kBAAkB,WAAW,UAAU;WACnE;WACA,YAAY;aACV;aACA;aACA;;WAEF,SAAS;IAChB,cAAc;;;;;;;;;;;;;;;;;;;;;;;UAuBR;WACC;WACA;WACA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBH,2BAA2B,8BAA8B,iBAAiB,QAAQ,8BAA8B;;;;;;;;;UASvH;;WAEC;;WAEA,iBAAiB,oBAAoB;;;;;;;;;;;;;;;;;;;;iBAoB/B,6BAA6B;WACnC;;;;;;WAMA,gBAAgB;IACvB,QAAQ;;;;;;;;;;;;;;;;UAgBF,eAAe;WACd;WACA,eAAe;WACf,aAAa;;UAEd,gBAAgB;WACf;WACA,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BtB,cAAc,WAAW,UAAU,iBAAiB,eAAe,cAAc,YAAY,OAAO,eAAe,wBAAwB,sBAAsB,gBAAgB;;;;;;;;;;KAU7L;WACM;;iBAEM,eAAe,kBAAkB,WAAW;iBAC5C,mBAAmB,0BAA0B,WAAW;;;;;;;;;;;;;iBAaxD,wBAAwB,8BAA8B;;;;;;;;;cASzD;;;;;;;;cAQA,6BAA6B;;;;;;;iBAO1B,mBAAmB"}
1
+ {"version":3,"file":"spaces-Dj65JrwZ.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/spaces.d.mts"],"mappings":";;;;;;;;;;;;;UAYU;WACC;WACA;WACA;;;;;;;;WAQA;WACA;WACA,sBAAsB;WACtB,cAAc;;;;;;;;;;;;;;;;;;;;;iBAqBR,gCAAgC,QAAQ;;;;;;;;;;;;;;;;iBAgBxC,yBAAyB,8BAA8B,kBAAkB,QAAQ;;;;;;;;;KAS7F;WACM;WACA,sBAAsB;;;;;;WAMtB;;;;;WAKA,SAAS;;;;;;WAMT;;WAEA;WACA,sBAAsB;;WAEtB;WACA,sBAAsB;WACtB;WACA;aACE;aACA;;;WAGF;;;;;;;;;;;;;UAaD;WACC;WACA;WACA;WACA;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBM,+BAA+B,QAAQ,uCAAuC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;UAuB7F,gBAAgB;WACf;WACA;WACA;WACA;WACA,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCT,sBAAsB,kBAAkB,WAAW,UAAU;WACnE;WACA,YAAY;aACV;aACA;aACA;;WAEF,SAAS;IAChB,cAAc;;;;;;;;;;;;;;;;;;;;;;;UAuBR;WACC;WACA;WACA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBH,2BAA2B,8BAA8B,iBAAiB,QAAQ,8BAA8B;;;;;;;;;UASvH;;WAEC;;WAEA,iBAAiB,oBAAoB;;;;;;;;;;;;;;;;;;;;iBAoB/B,6BAA6B;WACnC;;;;;;WAMA,gBAAgB;IACvB,QAAQ;;;;;;;;;;;;;;;;UAgBF,eAAe;WACd;WACA,eAAe;WACf,aAAa;;UAEd,gBAAgB;WACf;WACA,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BtB,cAAc,WAAW,UAAU,iBAAiB,eAAe,cAAc,YAAY,OAAO,eAAe,wBAAwB,sBAAsB,gBAAgB;;;;;;;;;;KAU7L;WACM;;iBAEM,eAAe,kBAAkB,WAAW;iBAC5C,mBAAmB,0BAA0B,WAAW;;;;;;;;;;;;;iBAaxD,wBAAwB,8BAA8B;;;;;;;;;cASzD;;;;;;;;cAQA,6BAA6B;;;;;;;iBAO1B,mBAAmB"}
@@ -1,4 +1,4 @@
1
- //#region ../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-Cc1u_wJo.d.mts
1
+ //#region ../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-C3PiFBk3.d.mts
2
2
  //#region src/verify-contract-spaces.d.ts
3
3
  /**
4
4
  * List the per-space subdirectories under
@@ -44,7 +44,7 @@ interface VerifyContractSpacesInputs {
44
44
  * Set of contract spaces the project declares: `'app'` plus each
45
45
  * extension space in `extensions`. The caller's discovery path
46
46
  * never reads the extension descriptor module — it walks the
47
- * `extensions` configuration in `prisma-next.config.ts` for the
47
+ * `extensions` configuration in `prisma.config.ts` for the
48
48
  * space ids.
49
49
  */
50
50
  readonly loadedSpaces: ReadonlySet<string>;
@@ -133,4 +133,4 @@ type VerifyContractSpacesResult = {
133
133
  declare function verifyContractSpaces(inputs: VerifyContractSpacesInputs): VerifyContractSpacesResult;
134
134
  //#endregion
135
135
  export { VerifyContractSpacesResult as a, VerifyContractSpacesInputs as i, SpaceMarkerRecord as n, listContractSpaceDirectories as o, SpaceVerifierViolation as r, verifyContractSpaces as s, ContractSpaceHeadRecord as t };
136
- //# sourceMappingURL=verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map
136
+ //# sourceMappingURL=verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-Cc1u_wJo.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAoBiB,6BAA6B,+BAA+B;;;;;;;UAOnE;WACC;WACA;;;;;;;UAOD;WACC;WACA;;UAED;;;;;;;;WAQC,cAAc;;;;;;WAMd;;;;;;;;WAQA,iBAAiB,oBAAoB;;;;;WAKrC,mBAAmB,oBAAoB;;KAE7C;WACM;WACA;WACA;;WAEA;WACA;WACA;;WAEA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;;KAEN;WACM;;WAEA;WACA,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCf,qBAAqB,QAAQ,6BAA6B"}
1
+ {"version":3,"file":"verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-C3PiFBk3.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAoBiB,6BAA6B,+BAA+B;;;;;;;UAOnE;WACC;WACA;;;;;;;UAOD;WACC;WACA;;UAED;;;;;;;;WAQC,cAAc;;;;;;WAMd;;;;;;;;WAQA,iBAAiB,oBAAoB;;;;;WAKrC,mBAAmB,oBAAoB;;KAE7C;WACM;WACA;WACA;;WAEA;WACA;WACA;;WAEA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;;KAEN;WACM;;WAEA;WACA,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCf,qBAAqB,QAAQ,6BAA6B"}
@@ -1,8 +1,8 @@
1
- import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from "./errors-CXbGUWGu-BQi6YS-H.mjs";
2
- import { t as MANIFEST_FILE } from "./io-635GlNx1-D94PxRc-.mjs";
1
+ import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from "./errors-CXbGUWGu-CstQHPh6.mjs";
2
+ import { t as MANIFEST_FILE } from "./io-635GlNx1-D3zrw2qu.mjs";
3
+ import { APP_SPACE_ID as APP_SPACE_ID$1, CONTRACT_SNAPSHOTS_DIRNAME } from "@prisma/orm-framework/components/control";
3
4
  import { join } from "pathe";
4
5
  import { readFile, readdir, stat } from "node:fs/promises";
5
- import { APP_SPACE_ID as APP_SPACE_ID$1, CONTRACT_SNAPSHOTS_DIRNAME } from "@prisma/orm-framework/components/control";
6
6
  //#region ../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-DhJTb0zM.mjs
7
7
  /**
8
8
  * Pattern a contract-space identifier must match. The constraint is
@@ -249,4 +249,4 @@ function verifyContractSpaces(inputs) {
249
249
  //#endregion
250
250
  export { isValidSpaceId as a, spaceMigrationDirectory as c, assertValidSpaceId as i, spaceRefsDirectory as l, RESERVED_SPACE_SUBDIR_NAMES as n, listContractSpaceDirectories as o, SPACE_REFS_DIRNAME as r, readContractSpaceHeadRef as s, APP_SPACE_ID$1 as t, verifyContractSpaces as u };
251
251
 
252
- //# sourceMappingURL=verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map
252
+ //# sourceMappingURL=verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map