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

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 (327) hide show
  1. package/README.md +3 -7
  2. package/dist/{aggregate-BBsCbXgJ.mjs → aggregate-B4HKshLQ.mjs} +11 -11
  3. package/dist/aggregate-B4HKshLQ.mjs.map +1 -0
  4. package/dist/{aggregate-CA6bJ8UO.d.mts → aggregate-D_eX4zoo.d.mts} +5 -5
  5. package/dist/{aggregate-CA6bJ8UO.d.mts.map → aggregate-D_eX4zoo.d.mts.map} +1 -1
  6. package/dist/cli-telemetry.d.mts +27 -12
  7. package/dist/cli-telemetry.d.mts.map +1 -1
  8. package/dist/cli-telemetry.mjs +286 -9
  9. package/dist/cli-telemetry.mjs.map +1 -1
  10. package/dist/cli.d.mts +7 -13
  11. package/dist/cli.d.mts.map +1 -1
  12. package/dist/cli.mjs +4871 -567
  13. package/dist/cli.mjs.map +1 -1
  14. package/dist/cli__control-api.d.mts +314 -34
  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 +10 -10
  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-qGrwlGmt-Cf2NFzRL.mjs} +5 -5
  27. package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs.map → contract-snapshot-store-qGrwlGmt-Cf2NFzRL.mjs.map} +1 -1
  28. package/dist/{cli-errors-iquUoY6O-BFboxglv.d.mts → db-verify-Yih5kWtB-B1kv76ec.d.mts} +84 -84
  29. package/dist/db-verify-Yih5kWtB-B1kv76ec.d.mts.map +1 -0
  30. package/dist/{domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs → domain-type-generation-CR9ECUau-DOlKbcaE.mjs} +20 -6
  31. package/dist/domain-type-generation-CR9ECUau-DOlKbcaE.mjs.map +1 -0
  32. package/dist/{domain-type-generation-PkAb39ob-Ct8AGqow.d.mts → domain-type-generation-X6-AaL1U-DHEoRf_y.d.mts} +14 -3
  33. package/dist/domain-type-generation-X6-AaL1U-DHEoRf_y.d.mts.map +1 -0
  34. package/dist/emitter.d.mts +2 -2
  35. package/dist/emitter.mjs +2 -2
  36. package/dist/emitter__domain-type-generation.d.mts +2 -2
  37. package/dist/emitter__domain-type-generation.mjs +2 -2
  38. package/dist/{errors-KWM8yBAL.d.mts → errors-D59OCpoI.d.mts} +2 -2
  39. package/dist/{errors-KWM8yBAL.d.mts.map → errors-D59OCpoI.d.mts.map} +1 -1
  40. package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs → errors-SoLLYLtw-DMxVbVs9.mjs} +10 -10
  41. package/dist/errors-SoLLYLtw-DMxVbVs9.mjs.map +1 -0
  42. package/dist/{exports-BZLNbtkY.mjs → exports-BXXeNWlj.mjs} +42 -36
  43. package/dist/exports-BXXeNWlj.mjs.map +1 -0
  44. package/dist/exports-CE6OD63o-4Qpqr2W7.mjs +398 -0
  45. package/dist/exports-CE6OD63o-4Qpqr2W7.mjs.map +1 -0
  46. package/dist/{exports-B3xY_FHp.mjs → exports-CYa2di3d.mjs} +386 -26
  47. package/dist/exports-CYa2di3d.mjs.map +1 -0
  48. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs → graph-membership-DY1Onbc3-CwBd6wuB.mjs} +3 -3
  49. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs.map → graph-membership-DY1Onbc3-CwBd6wuB.mjs.map} +1 -1
  50. package/dist/{import-roots-B6CtsWXb.d.mts → import-roots-ARK1wjzc.d.mts} +4 -4
  51. package/dist/{import-roots-B6CtsWXb.d.mts.map → import-roots-ARK1wjzc.d.mts.map} +1 -1
  52. package/dist/{import-roots-NDOIEDVj.mjs → import-roots-BHOrDJbI.mjs} +13 -6
  53. package/dist/import-roots-BHOrDJbI.mjs.map +1 -0
  54. package/dist/{index-CnOyYxmv.d.mts → index-D217lbiW.d.mts} +8 -4
  55. package/dist/index-D217lbiW.d.mts.map +1 -0
  56. package/dist/{index-mCsi_ND5.d.mts → index-u5RdrumF.d.mts} +2 -11
  57. package/dist/index-u5RdrumF.d.mts.map +1 -0
  58. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs → invariants-Cww4bv0v-BEiFxmbX.mjs} +3 -3
  59. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs.map → invariants-Cww4bv0v-BEiFxmbX.mjs.map} +1 -1
  60. package/dist/{io-635GlNx1-D94PxRc-.mjs → io-BmWQNxRP-DQqbcPsS.mjs} +5 -5
  61. package/dist/{io-635GlNx1-D94PxRc-.mjs.map → io-BmWQNxRP-DQqbcPsS.mjs.map} +1 -1
  62. package/dist/{migration-gubSSeMk.mjs → migration-B9w-7dKe.mjs} +3 -3
  63. package/dist/{migration-gubSSeMk.mjs.map → migration-B9w-7dKe.mjs.map} +1 -1
  64. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs → migration-graph-CW4bMmTz-B5xFtFVB.mjs} +3 -3
  65. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs.map → migration-graph-CW4bMmTz-B5xFtFVB.mjs.map} +1 -1
  66. package/dist/migration-tools.d.mts +5 -5
  67. package/dist/migration-tools.mjs +13 -13
  68. package/dist/migration-tools__aggregate.d.mts +1 -1
  69. package/dist/migration-tools__aggregate.mjs +1 -1
  70. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  71. package/dist/migration-tools__errors.d.mts +1 -1
  72. package/dist/migration-tools__errors.mjs +1 -1
  73. package/dist/migration-tools__invariants.mjs +1 -1
  74. package/dist/migration-tools__io.mjs +1 -1
  75. package/dist/migration-tools__migration-graph.mjs +2 -2
  76. package/dist/migration-tools__migration-ts.mjs +1 -1
  77. package/dist/migration-tools__migration.mjs +1 -1
  78. package/dist/migration-tools__ref-resolution.d.mts +1 -1
  79. package/dist/migration-tools__ref-resolution.mjs +1 -1
  80. package/dist/migration-tools__refs.mjs +1 -1
  81. package/dist/migration-tools__spaces.d.mts +2 -2
  82. package/dist/migration-tools__spaces.mjs +2 -2
  83. package/dist/{migration-ts-BoHxxGvi.mjs → migration-ts-DdVm0rws.mjs} +2 -2
  84. package/dist/{migration-ts-BoHxxGvi.mjs.map → migration-ts-DdVm0rws.mjs.map} +1 -1
  85. package/dist/{output-DP3woAjV-BxCr9nHA.mjs → output-D83nTTpC-XlvN30yS.mjs} +5 -47
  86. package/dist/output-D83nTTpC-XlvN30yS.mjs.map +1 -0
  87. package/dist/publish-surface.d.mts +2 -2
  88. package/dist/publish-surface.mjs +2 -2
  89. package/dist/publish-surface__import-roots.d.mts +1 -1
  90. package/dist/publish-surface__import-roots.mjs +1 -1
  91. package/dist/publish-surface__shells.d.mts +1 -1
  92. package/dist/publish-surface__shells.mjs +1 -1
  93. package/dist/quick-reference-mongo.md +21 -18
  94. package/dist/quick-reference-postgres.md +20 -17
  95. package/dist/readme-mongo.md +7 -7
  96. package/dist/readme-postgres.md +7 -7
  97. package/dist/ref-DcqFmceq-QaUjgZeM.mjs +4789 -0
  98. package/dist/ref-DcqFmceq-QaUjgZeM.mjs.map +1 -0
  99. package/dist/{ref-resolution-sGcINe7o.mjs → ref-resolution-BWpwb8_b.mjs} +9 -2
  100. package/dist/ref-resolution-BWpwb8_b.mjs.map +1 -0
  101. package/dist/{ref-resolution-COGOSL57.d.mts → ref-resolution-CaHQJXE0.d.mts} +11 -1
  102. package/dist/ref-resolution-CaHQJXE0.d.mts.map +1 -0
  103. package/dist/{refs-WK86uYYp-B6EZkmmT.mjs → refs-BpSpzdYB-BcDelHGt.mjs} +9 -9
  104. package/dist/refs-BpSpzdYB-BcDelHGt.mjs.map +1 -0
  105. package/dist/{shells-BenrJHp2.mjs → shells-BIdFZwUY.mjs} +13 -19
  106. package/dist/shells-BIdFZwUY.mjs.map +1 -0
  107. package/dist/{shells-COHV_Ozf.d.mts → shells-CIUmT4u4.d.mts} +14 -20
  108. package/dist/shells-CIUmT4u4.d.mts.map +1 -0
  109. package/dist/{spaces-tWQi7CUv.d.mts → spaces-B20bgxF9.d.mts} +3 -3
  110. package/dist/{spaces-tWQi7CUv.d.mts.map → spaces-B20bgxF9.d.mts.map} +1 -1
  111. package/dist/{spaces-BG2w0P8d.mjs → spaces-BCZiAZQn.mjs} +8 -8
  112. package/dist/spaces-BCZiAZQn.mjs.map +1 -0
  113. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts} +3 -3
  114. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts.map} +1 -1
  115. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs → verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs} +8 -8
  116. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map → verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs.map} +1 -1
  117. package/dist/vite-plugin-contract-emit.d.mts +3 -3
  118. package/dist/vite-plugin-contract-emit.mjs +10 -10
  119. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  120. package/package.json +16 -40
  121. package/dist/aggregate-BBsCbXgJ.mjs.map +0 -1
  122. package/dist/bin__prisma-next.mjs +0 -512
  123. package/dist/bin__prisma-next.mjs.map +0 -1
  124. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs +0 -14
  125. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs.map +0 -1
  126. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs +0 -347
  127. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs.map +0 -1
  128. package/dist/cli-errors-iquUoY6O-BFboxglv.d.mts.map +0 -1
  129. package/dist/cli__commands__contract-emit.d.mts +0 -2
  130. package/dist/cli__commands__contract-emit.mjs +0 -2
  131. package/dist/cli__commands__contract-infer.d.mts +0 -7
  132. package/dist/cli__commands__contract-infer.d.mts.map +0 -1
  133. package/dist/cli__commands__contract-infer.mjs +0 -2
  134. package/dist/cli__commands__db-init.d.mts +0 -7
  135. package/dist/cli__commands__db-init.d.mts.map +0 -1
  136. package/dist/cli__commands__db-init.mjs +0 -2
  137. package/dist/cli__commands__db-schema.d.mts +0 -7
  138. package/dist/cli__commands__db-schema.d.mts.map +0 -1
  139. package/dist/cli__commands__db-schema.mjs +0 -2
  140. package/dist/cli__commands__db-sign.d.mts +0 -7
  141. package/dist/cli__commands__db-sign.d.mts.map +0 -1
  142. package/dist/cli__commands__db-sign.mjs +0 -2
  143. package/dist/cli__commands__db-update.d.mts +0 -7
  144. package/dist/cli__commands__db-update.d.mts.map +0 -1
  145. package/dist/cli__commands__db-update.mjs +0 -2
  146. package/dist/cli__commands__db-verify.d.mts +0 -7
  147. package/dist/cli__commands__db-verify.d.mts.map +0 -1
  148. package/dist/cli__commands__db-verify.mjs +0 -2
  149. package/dist/cli__commands__migrate.d.mts +0 -57
  150. package/dist/cli__commands__migrate.d.mts.map +0 -1
  151. package/dist/cli__commands__migrate.mjs +0 -2
  152. package/dist/cli__commands__migration-check.d.mts +0 -8
  153. package/dist/cli__commands__migration-check.d.mts.map +0 -1
  154. package/dist/cli__commands__migration-check.mjs +0 -3
  155. package/dist/cli__commands__migration-graph.d.mts +0 -38
  156. package/dist/cli__commands__migration-graph.d.mts.map +0 -1
  157. package/dist/cli__commands__migration-graph.mjs +0 -2
  158. package/dist/cli__commands__migration-list.d.mts +0 -39
  159. package/dist/cli__commands__migration-list.d.mts.map +0 -1
  160. package/dist/cli__commands__migration-list.mjs +0 -2
  161. package/dist/cli__commands__migration-log.d.mts +0 -20
  162. package/dist/cli__commands__migration-log.d.mts.map +0 -1
  163. package/dist/cli__commands__migration-log.mjs +0 -2
  164. package/dist/cli__commands__migration-new.d.mts +0 -7
  165. package/dist/cli__commands__migration-new.d.mts.map +0 -1
  166. package/dist/cli__commands__migration-new.mjs +0 -2
  167. package/dist/cli__commands__migration-plan.d.mts +0 -34
  168. package/dist/cli__commands__migration-plan.d.mts.map +0 -1
  169. package/dist/cli__commands__migration-plan.mjs +0 -2
  170. package/dist/cli__commands__migration-show.d.mts +0 -27
  171. package/dist/cli__commands__migration-show.d.mts.map +0 -1
  172. package/dist/cli__commands__migration-show.mjs +0 -2
  173. package/dist/cli__commands__migration-status.d.mts +0 -55
  174. package/dist/cli__commands__migration-status.d.mts.map +0 -1
  175. package/dist/cli__commands__migration-status.mjs +0 -3
  176. package/dist/cli__commands__ref.d.mts +0 -7
  177. package/dist/cli__commands__ref.d.mts.map +0 -1
  178. package/dist/cli__commands__ref.mjs +0 -2
  179. package/dist/cli__commands__telemetry.d.mts +0 -7
  180. package/dist/cli__commands__telemetry.d.mts.map +0 -1
  181. package/dist/cli__commands__telemetry.mjs +0 -2
  182. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs +0 -1653
  183. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs.map +0 -1
  184. package/dist/code-templates-C-jirr19-DDQB0WGo.mjs +0 -295
  185. package/dist/code-templates-C-jirr19-DDQB0WGo.mjs.map +0 -1
  186. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs +0 -65
  187. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs.map +0 -1
  188. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs +0 -776
  189. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs.map +0 -1
  190. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs +0 -44
  191. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs.map +0 -1
  192. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs +0 -331
  193. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs.map +0 -1
  194. package/dist/contract-emit-BkEj3siG-C8M-IyvS.mjs +0 -2
  195. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts +0 -7
  196. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +0 -1
  197. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs +0 -154
  198. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs.map +0 -1
  199. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +0 -56
  200. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +0 -1
  201. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs +0 -74
  202. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs.map +0 -1
  203. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs +0 -82
  204. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs.map +0 -1
  205. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs +0 -303
  206. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs.map +0 -1
  207. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs +0 -109
  208. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs.map +0 -1
  209. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs +0 -44
  210. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs.map +0 -1
  211. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs +0 -48
  212. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs.map +0 -1
  213. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs +0 -172
  214. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs.map +0 -1
  215. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs +0 -171
  216. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs.map +0 -1
  217. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs +0 -358
  218. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs.map +0 -1
  219. package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts.map +0 -1
  220. package/dist/domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs.map +0 -1
  221. package/dist/errors-CXbGUWGu-BQi6YS-H.mjs.map +0 -1
  222. package/dist/exports-B3xY_FHp.mjs.map +0 -1
  223. package/dist/exports-BCLg4CiV-05kuwcb0.mjs +0 -160
  224. package/dist/exports-BCLg4CiV-05kuwcb0.mjs.map +0 -1
  225. package/dist/exports-BZLNbtkY.mjs.map +0 -1
  226. package/dist/exports-CqNUihkI.mjs +0 -276
  227. package/dist/exports-CqNUihkI.mjs.map +0 -1
  228. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs +0 -110
  229. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs.map +0 -1
  230. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs +0 -60
  231. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs.map +0 -1
  232. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +0 -35
  233. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +0 -1
  234. package/dist/import-roots-NDOIEDVj.mjs.map +0 -1
  235. package/dist/index-CnOyYxmv.d.mts.map +0 -1
  236. package/dist/index-mCsi_ND5.d.mts.map +0 -1
  237. package/dist/init-DC7zPKka-BSiUrPw3.mjs +0 -800
  238. package/dist/init-DC7zPKka-BSiUrPw3.mjs.map +0 -1
  239. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs +0 -95
  240. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs.map +0 -1
  241. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs +0 -115
  242. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs.map +0 -1
  243. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs +0 -53
  244. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs.map +0 -1
  245. package/dist/legend-DGv9e2_0-BtetgRz4.mjs +0 -22
  246. package/dist/legend-DGv9e2_0-BtetgRz4.mjs.map +0 -1
  247. package/dist/migrate-BXATUjYE-Do79Imf-.mjs +0 -343
  248. package/dist/migrate-BXATUjYE-Do79Imf-.mjs.map +0 -1
  249. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs +0 -96
  250. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs.map +0 -1
  251. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts +0 -63
  252. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts.map +0 -1
  253. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs +0 -199
  254. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs.map +0 -1
  255. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs +0 -358
  256. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs.map +0 -1
  257. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs +0 -163
  258. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs.map +0 -1
  259. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs +0 -121
  260. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs.map +0 -1
  261. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs +0 -35
  262. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs.map +0 -1
  263. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs +0 -144
  264. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs.map +0 -1
  265. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs +0 -2127
  266. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs.map +0 -1
  267. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs +0 -69
  268. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs.map +0 -1
  269. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs +0 -130
  270. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs.map +0 -1
  271. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs +0 -102
  272. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs.map +0 -1
  273. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs +0 -123
  274. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs.map +0 -1
  275. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs +0 -116
  276. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs.map +0 -1
  277. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs +0 -70
  278. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs.map +0 -1
  279. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs +0 -130
  280. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs.map +0 -1
  281. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs +0 -38
  282. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs.map +0 -1
  283. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts +0 -164
  284. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts.map +0 -1
  285. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs +0 -192
  286. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs.map +0 -1
  287. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs +0 -621
  288. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs.map +0 -1
  289. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs +0 -178
  290. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs.map +0 -1
  291. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs +0 -427
  292. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs.map +0 -1
  293. package/dist/output-DP3woAjV-BxCr9nHA.mjs.map +0 -1
  294. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +0 -43
  295. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +0 -1
  296. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs +0 -101
  297. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs.map +0 -1
  298. package/dist/redact-secrets-DuKoiMax-Cfe2XVhc.mjs +0 -1476
  299. package/dist/redact-secrets-DuKoiMax-Cfe2XVhc.mjs.map +0 -1
  300. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs +0 -95
  301. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs.map +0 -1
  302. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs +0 -104
  303. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs.map +0 -1
  304. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs +0 -96
  305. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs.map +0 -1
  306. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs +0 -16
  307. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs.map +0 -1
  308. package/dist/ref-resolution-COGOSL57.d.mts.map +0 -1
  309. package/dist/ref-resolution-sGcINe7o.mjs.map +0 -1
  310. package/dist/refs-WK86uYYp-B6EZkmmT.mjs.map +0 -1
  311. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs +0 -47
  312. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs.map +0 -1
  313. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts +0 -206
  314. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts.map +0 -1
  315. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs +0 -119
  316. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs.map +0 -1
  317. package/dist/shells-BenrJHp2.mjs.map +0 -1
  318. package/dist/shells-COHV_Ozf.d.mts.map +0 -1
  319. package/dist/spaces-BG2w0P8d.mjs.map +0 -1
  320. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs +0 -121
  321. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs.map +0 -1
  322. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +0 -133
  323. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +0 -1
  324. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs +0 -676
  325. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs.map +0 -1
  326. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs +0 -283
  327. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import { A as serializeValue, C as renderValueSetType, D as serializeExecutionType, E as serializeCrossReference, O as serializeNamespaceId, S as generateValueObjectsDescriptorType, T as resolveValueObjectType, _ as generateModelRelationsType, a as deduplicateImports, b as generateValueObjectType, c as generateContractFieldDescriptor, d as generateFieldResolvedType, f as generateFieldTypesMapsByNamespace, g as generateModelFieldsType, h as generateModelFieldEntry, i as ResolvedFieldValueSet, k as serializeObjectKey, l as generateFieldInputTypesMap, m as generateImportLines, n as FieldValueSetResolver, o as generateBothFieldTypesMaps, p as generateHashTypeAliases, r as ResolvedFieldType, s as generateCodecTypeIntersection, t as FieldTypeParamsResolver, u as generateFieldOutputTypesMap, v as generateModelsType, w as resolveFieldType, x as generateValueObjectTypeAliases, y as generateRootsType } from "./domain-type-generation-PkAb39ob-Ct8AGqow.mjs";
2
- export { FieldTypeParamsResolver, FieldValueSetResolver, ResolvedFieldType, ResolvedFieldValueSet, deduplicateImports, generateBothFieldTypesMaps, generateCodecTypeIntersection, generateContractFieldDescriptor, generateFieldInputTypesMap, generateFieldOutputTypesMap, generateFieldResolvedType, generateFieldTypesMapsByNamespace, generateHashTypeAliases, generateImportLines, generateModelFieldEntry, generateModelFieldsType, generateModelRelationsType, generateModelsType, generateRootsType, generateValueObjectType, generateValueObjectTypeAliases, generateValueObjectsDescriptorType, renderValueSetType, resolveFieldType, resolveValueObjectType, serializeCrossReference, serializeExecutionType, serializeNamespaceId, serializeObjectKey, serializeValue };
1
+ import { A as serializeNamespaceId, C as generateValueObjectsDescriptorType, D as resolveValueObjectType, E as resolveModelFieldType, M as serializeValue, O as serializeCrossReference, S as generateValueObjectTypeAliases, T as resolveFieldType, _ as generateModelFieldsType, a as ResolvedFieldValueSet, b as generateRootsType, c as generateCodecTypeIntersection, d as generateFieldOutputTypesMap, f as generateFieldResolvedType, g as generateModelFieldEntry, h as generateImportLines, i as ResolvedFieldType, j as serializeObjectKey, k as serializeExecutionType, l as generateContractFieldDescriptor, m as generateHashTypeAliases, n as FieldValueSetResolver, o as deduplicateImports, p as generateFieldTypesMapsByNamespace, r as ModelFieldTypeResolvers, s as generateBothFieldTypesMaps, t as FieldTypeParamsResolver, u as generateFieldInputTypesMap, v as generateModelRelationsType, w as renderValueSetType, x as generateValueObjectType, y as generateModelsType } from "./domain-type-generation-X6-AaL1U-DHEoRf_y.mjs";
2
+ export { FieldTypeParamsResolver, FieldValueSetResolver, ModelFieldTypeResolvers, ResolvedFieldType, ResolvedFieldValueSet, deduplicateImports, generateBothFieldTypesMaps, generateCodecTypeIntersection, generateContractFieldDescriptor, generateFieldInputTypesMap, generateFieldOutputTypesMap, generateFieldResolvedType, generateFieldTypesMapsByNamespace, generateHashTypeAliases, generateImportLines, generateModelFieldEntry, generateModelFieldsType, generateModelRelationsType, generateModelsType, generateRootsType, generateValueObjectType, generateValueObjectTypeAliases, generateValueObjectsDescriptorType, renderValueSetType, resolveFieldType, resolveModelFieldType, resolveValueObjectType, serializeCrossReference, serializeExecutionType, serializeNamespaceId, serializeObjectKey, serializeValue };
@@ -1,2 +1,2 @@
1
- import { C as serializeCrossReference, D as serializeValue, E as serializeObjectKey, S as resolveValueObjectType, T as serializeNamespaceId, _ as generateValueObjectType, a as generateContractFieldDescriptor, b as renderValueSetType, c as generateFieldResolvedType, d as generateImportLines, f as generateModelFieldEntry, g as generateRootsType, h as generateModelsType, i as generateCodecTypeIntersection, l as generateFieldTypesMapsByNamespace, m as generateModelRelationsType, o as generateFieldInputTypesMap, p as generateModelFieldsType, r as generateBothFieldTypesMaps, s as generateFieldOutputTypesMap, t as deduplicateImports, u as generateHashTypeAliases, v as generateValueObjectTypeAliases, w as serializeExecutionType, x as resolveFieldType, y as generateValueObjectsDescriptorType } from "./domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs";
2
- export { deduplicateImports, generateBothFieldTypesMaps, generateCodecTypeIntersection, generateContractFieldDescriptor, generateFieldInputTypesMap, generateFieldOutputTypesMap, generateFieldResolvedType, generateFieldTypesMapsByNamespace, generateHashTypeAliases, generateImportLines, generateModelFieldEntry, generateModelFieldsType, generateModelRelationsType, generateModelsType, generateRootsType, generateValueObjectType, generateValueObjectTypeAliases, generateValueObjectsDescriptorType, renderValueSetType, resolveFieldType, resolveValueObjectType, serializeCrossReference, serializeExecutionType, serializeNamespaceId, serializeObjectKey, serializeValue };
1
+ import { C as resolveValueObjectType, D as serializeObjectKey, E as serializeNamespaceId, O as serializeValue, S as resolveModelFieldType, T as serializeExecutionType, _ as generateValueObjectType, a as generateContractFieldDescriptor, b as renderValueSetType, c as generateFieldResolvedType, d as generateImportLines, f as generateModelFieldEntry, g as generateRootsType, h as generateModelsType, i as generateCodecTypeIntersection, l as generateFieldTypesMapsByNamespace, m as generateModelRelationsType, o as generateFieldInputTypesMap, p as generateModelFieldsType, r as generateBothFieldTypesMaps, s as generateFieldOutputTypesMap, t as deduplicateImports, u as generateHashTypeAliases, v as generateValueObjectTypeAliases, w as serializeCrossReference, x as resolveFieldType, y as generateValueObjectsDescriptorType } from "./domain-type-generation-CR9ECUau-DOlKbcaE.mjs";
2
+ export { deduplicateImports, generateBothFieldTypesMaps, generateCodecTypeIntersection, generateContractFieldDescriptor, generateFieldInputTypesMap, generateFieldOutputTypesMap, generateFieldResolvedType, generateFieldTypesMapsByNamespace, generateHashTypeAliases, generateImportLines, generateModelFieldEntry, generateModelFieldsType, generateModelRelationsType, generateModelsType, generateRootsType, generateValueObjectType, generateValueObjectTypeAliases, generateValueObjectsDescriptorType, renderValueSetType, resolveFieldType, resolveModelFieldType, resolveValueObjectType, serializeCrossReference, serializeExecutionType, serializeNamespaceId, serializeObjectKey, serializeValue };
@@ -1,5 +1,5 @@
1
- import { CliStructuredError } from "@prisma/orm-framework/errors/control";
2
1
  import { NextAction } from "@prisma/orm-framework/utils/structured-error";
2
+ import { CliStructuredError } from "@prisma/orm-framework/errors/control";
3
3
  //#region ../../../1-framework/3-tooling/migration/dist/exports/errors.d.mts
4
4
  //#region src/errors.d.ts
5
5
  /**
@@ -75,4 +75,4 @@ declare function errorContractSnapshotMissing(storageHash: string, expectedPath:
75
75
  declare function errorContractSnapshotHashMismatch(storageHash: string, actualHash: string, dir: string): MigrationToolsError;
76
76
  //#endregion
77
77
  export { errorContractSnapshotMissing as a, errorInvalidRefName as c, errorContractSnapshotHashMismatch as i, errorNoInvariantPath as l, NoInvariantPathStructuralEdge as n, errorDescriptorHeadHashMismatch as o, errorContractDeserializationFailed as r, errorInvalidJson as s, MigrationToolsError as t, errorUnknownInvariant as u };
78
- //# sourceMappingURL=errors-KWM8yBAL.d.mts.map
78
+ //# sourceMappingURL=errors-D59OCpoI.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-KWM8yBAL.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/errors.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAmBc,4BAA4B;WAC/B;WACA;WACA;WACA;EACT,YAAY,6BAA6B,iBAAiB;aAC/C;aACA;aACA,uBAAuB;aACvB,OAAO;aACP;;SAEJ,GAAG,iBAAiB,SAAS;;iBAErB,iBAAiB,kBAAkB,qBAAqB;iBACxD,gCAAgC;WACtC;WACA;WACA;IACP;iBACa,oBAAoB,kBAAkB;;;;;;;;;;;;UAY7C;WACC;WACA;WACA;WACA;WACA;;iBAEM,qBAAqB;WAC3B;WACA;WACA;WACA,yBAAyB;IAChC;iBACa,sBAAsB;WAC5B;WACA;WACA;IACP;iBACa,mCAAmC,kBAAkB,iBAAiB;WAC5E;IACP;iBACa,6BAA6B,qBAAqB,uBAAuB;iBACzE,kCAAkC,qBAAqB,oBAAoB,cAAc"}
1
+ {"version":3,"file":"errors-D59OCpoI.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/errors.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAmBc,4BAA4B;WAC/B;WACA;WACA;WACA;EACT,YAAY,6BAA6B,iBAAiB;aAC/C;aACA;aACA,uBAAuB;aACvB,OAAO;aACP;;SAEJ,GAAG,iBAAiB,SAAS;;iBAErB,iBAAiB,kBAAkB,qBAAqB;iBACxD,gCAAgC;WACtC;WACA;WACA;IACP;iBACa,oBAAoB,kBAAkB;;;;;;;;;;;;UAY7C;WACC;WACA;WACA;WACA;WACA;;iBAEM,qBAAqB;WAC3B;WACA;WACA;WACA,yBAAyB;IAChC;iBACa,sBAAsB;WAC5B;WACA;WACA;IACP;iBACa,mCAAmC,kBAAkB,iBAAiB;WAC5E;IACP;iBACa,6BAA6B,qBAAqB,uBAAuB;iBACzE,kCAAkC,qBAAqB,oBAAoB,cAAc"}
@@ -1,7 +1,7 @@
1
- import { CliStructuredError } from "@prisma/orm-framework/errors/control";
2
1
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
2
+ import { CliStructuredError } from "@prisma/orm-framework/errors/control";
3
3
  import { dirname, relative } from "pathe";
4
- //#region ../../../1-framework/3-tooling/migration/dist/errors-CXbGUWGu.mjs
4
+ //#region ../../../1-framework/3-tooling/migration/dist/errors-SoLLYLtw.mjs
5
5
  /**
6
6
  * Build the canonical "re-emit this package" remediation hint.
7
7
  *
@@ -164,7 +164,7 @@ function errorAmbiguousTarget(branchTips, context) {
164
164
  const divergenceInfo = context ? `\nDivergence point: ${context.divergencePoint}\nBranches:\n${context.branches.map((b) => ` → ${b.tip} (${b.edges.length} edge(s): ${b.edges.map((e) => e.dirName).join(" → ") || "direct"})`).join("\n")}` : "";
165
165
  return new MigrationToolsError("MIGRATION.AMBIGUOUS_TARGET", "Ambiguous migration target", {
166
166
  why: `The migration history has diverged into multiple branches: ${branchTips.join(", ")}. This typically happens when two developers plan migrations from the same starting point.${divergenceInfo}`,
167
- fix: "Use `ref set <name> <hash>` to target a specific branch, delete one of the conflicting migration directories and re-run `migration plan`, or use --from <hash> to explicitly select a starting point.",
167
+ fix: "Use `{bin} migration ref set <name> <hash>` to target a specific branch, delete one of the conflicting migration directories and re-run `{bin} migration plan`, or use --from <hash> to explicitly select a starting point.",
168
168
  meta: {
169
169
  branchTips,
170
170
  ...context ? {
@@ -208,7 +208,7 @@ function errorNoTarget(reachableHashes) {
208
208
  function errorInvalidRefValue(value) {
209
209
  return new MigrationToolsError("MIGRATION.INVALID_REF_VALUE", "Invalid ref value", {
210
210
  why: `Ref value "${value}" is not a valid contract hash. Values must be a 64-character hex digest or "empty".`,
211
- fix: "Use a valid storage hash from `prisma-next contract emit` output or an existing migration.",
211
+ fix: "Use a valid storage hash from `{bin} contract emit` output or an existing migration.",
212
212
  nextActions: [{
213
213
  kind: "run-command",
214
214
  label: "Emit the contract to obtain a valid storage hash",
@@ -301,12 +301,12 @@ function errorMigrationHashMismatch(dir, storedHash, computedHash) {
301
301
  function errorRefNotResolvable(refName) {
302
302
  return new MigrationToolsError("MIGRATION.REF_NOT_RESOLVABLE", `Ref "${refName}" is not resolvable`, {
303
303
  why: `Ref "${refName}" has no pointer file, and the hash being resolved is not a node in the migration graph either — there is nothing to materialize a contract from.`,
304
- fix: `Create the ref with "prisma-next ref set ${refName} <hash>" (or advance it via "prisma-next db update --advance-ref ${refName}"), or pass a hash that is a node in the migration graph.`,
304
+ fix: `Create the ref with "{bin} migration ref set ${refName} <hash>" (or advance it via "{bin} db update --advance-ref ${refName}"), or pass a hash that is a node in the migration graph.`,
305
305
  nextActions: [
306
306
  {
307
307
  kind: "run-command",
308
308
  label: `Create the ref "${refName}"`,
309
- command: `{bin} ref set ${refName} <hash>`
309
+ command: `{bin} migration ref set ${refName} <hash>`
310
310
  },
311
311
  {
312
312
  kind: "run-command",
@@ -327,7 +327,7 @@ function errorRefNotResolvable(refName) {
327
327
  function errorBundleNotFoundForGraphNode(hash, explicitLabel) {
328
328
  return new MigrationToolsError("MIGRATION.BUNDLE_NOT_FOUND_FOR_GRAPH_NODE", explicitLabel ? `No migration bundle found for reference "${explicitLabel}" (resolved hash: ${hash})` : `No migration bundle found for graph node ${hash}`, {
329
329
  why: `The hash ${hash} is a graph node but no on-disk migration package has a destination (\`to\`) hash matching it.`,
330
- fix: "Provide a ref or hash that corresponds to an existing migration package, or run `migration list` to see available migrations.",
330
+ fix: "Provide a ref or hash that corresponds to an existing migration package, or run `{bin} migration list` to see available migrations.",
331
331
  meta: {
332
332
  hash,
333
333
  ...explicitLabel ? { explicitLabel } : {}
@@ -350,7 +350,7 @@ function errorHashNotInGraph(hash, graph) {
350
350
  const reachableList = reachableHashes.length > 0 ? reachableHashes.join(", ") : "(none)";
351
351
  return new MigrationToolsError("MIGRATION.HASH_NOT_IN_GRAPH", `Hash "${hash}" is not a node in the migration graph`, {
352
352
  why: `The migration graph contains nodes ${reachableList}; "${hash}" isn't one of them.`,
353
- fix: `Pass a hash that's the from-or-to of an on-disk migration bundle, use --from with a graph-node hash, or run "prisma-next migration plan" to introduce it.`,
353
+ fix: `Pass a hash that's the from-or-to of an on-disk migration bundle, use --from with a graph-node hash, or run "{bin} migration plan" to introduce it.`,
354
354
  nextActions: [{
355
355
  kind: "user-choice",
356
356
  label: "Pass a hash that is the from-or-to of an on-disk migration bundle, or use --from with a graph-node hash",
@@ -369,7 +369,7 @@ function errorHashNotInGraph(hash, graph) {
369
369
  function errorContractSnapshotMissing(storageHash, expectedPath) {
370
370
  return new MigrationToolsError("MIGRATION.CONTRACT_SNAPSHOT_MISSING", "Contract snapshot is missing", {
371
371
  why: `Expected a contract snapshot for ${storageHash} at "${expectedPath}" but the file does not exist.`,
372
- fix: "Re-emit the contract snapshot by re-running the command that authored the migration referencing this hash (`prisma-next migration plan` for app-space migrations; the extension's contract-space build for extension spaces), or restore migrations/snapshots/ from version control.",
372
+ fix: "Re-emit the contract snapshot by re-running the command that authored the migration referencing this hash (`{bin} migration plan` for app-space migrations; the extension's contract-space build for extension spaces), or restore migrations/snapshots/ from version control.",
373
373
  nextActions: [
374
374
  {
375
375
  kind: "run-command",
@@ -416,4 +416,4 @@ function errorMigrationContractViewMissing(className, accessor, jsonField) {
416
416
  //#endregion
417
417
  export { errorOperationsNotArray as A, errorInvalidSpaceId as C, errorNoInitialMigration as D, errorMissingFile as E, errorRefNotResolvable as M, errorSpaceHeadRefMissing as N, errorNoInvariantPath as O, errorUnknownInvariant as P, errorInvalidSlug as S, errorMigrationHashMismatch as T, errorInvalidManifest as _, errorContractSnapshotHashMismatch as a, errorInvalidRefName as b, errorDescribeMissingEndContract as c, errorDuplicateInvariantInEdge as d, errorDuplicateSpaceId as f, errorInvalidJson as g, errorInvalidInvariantId as h, errorContractDeserializationFailed as i, errorProvidedInvariantsMismatch as j, errorNoTarget as k, errorDescriptorHeadHashMismatch as l, errorInvalidDestName as m, errorAmbiguousTarget as n, errorContractSnapshotMissing as o, errorHashNotInGraph as p, errorBundleNotFoundForGraphNode as r, errorDescribeInvalidMetadata as s, MigrationToolsError as t, errorDirectoryExists as u, errorInvalidOperationEntry as v, errorMigrationContractViewMissing as w, errorInvalidRefValue as x, errorInvalidRefFile as y };
418
418
 
419
- //# sourceMappingURL=errors-CXbGUWGu-BQi6YS-H.mjs.map
419
+ //# sourceMappingURL=errors-SoLLYLtw-DMxVbVs9.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-SoLLYLtw-DMxVbVs9.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/errors-SoLLYLtw.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { dirname, relative } from \"pathe\";\n//#region src/errors.ts\n/**\n* Build the canonical \"re-emit this package\" remediation hint.\n*\n* Every on-disk migration package ships its own `migration.ts` author-time\n* file. Running it regenerates `migration.json` and `ops.json` with the\n* correct hash + metadata, so it is the right primitive whenever a single\n* package's on-disk artifacts are missing, malformed, or otherwise corrupt.\n* Pointing users at `migration plan` would emit a *new* package rather than\n* heal the broken one.\n*/\nfunction reemitHint(dir, fallback) {\n\tconst reemit = `Re-emit the package by running \\`node \"${relative(process.cwd(), dir)}/migration.ts\"\\``;\n\treturn fallback ? `${reemit}, ${fallback}` : `${reemit}.`;\n}\n/**\n* Structured error for migration tooling operations.\n*\n* Follows the NAMESPACE.SUBCODE convention from ADR 027. All codes live under\n* the MIGRATION namespace. These are tooling-time errors (file I/O, hash\n* verification, migration history reconstruction), distinct from the runtime\n* MIGRATION.* codes for apply-time failures (PRECHECK_FAILED, POSTCHECK_FAILED,\n* etc.).\n*\n* Fields:\n* - code: Stable machine-readable code (MIGRATION.SUBCODE)\n* - category: Always 'MIGRATION'\n* - why: Explains the cause in plain language\n* - fix: Actionable remediation step\n* - meta: Machine-readable structured data for agents\n*/\nvar MigrationToolsError = class extends CliStructuredError {\n\tcategory;\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t\tthis.category = \"MIGRATION\";\n\t}\n\tstatic is(error) {\n\t\treturn CliStructuredError.is(error) && \"category\" in error && error.category === \"MIGRATION\" && error.code.startsWith(\"MIGRATION.\");\n\t}\n};\nfunction errorDirectoryExists(dir) {\n\treturn new MigrationToolsError(\"MIGRATION.DIR_EXISTS\", \"Migration directory already exists\", {\n\t\twhy: `The directory \"${dir}\" already exists. Each migration must have a unique directory.`,\n\t\tfix: \"Use --name to pick a different name, or delete the existing directory and re-run.\",\n\t\tmeta: { dir }\n\t});\n}\nfunction errorMissingFile(file, dir) {\n\treturn new MigrationToolsError(\"MIGRATION.FILE_MISSING\", `Missing ${file}`, {\n\t\twhy: `Expected \"${file}\" in \"${dir}\" but the file does not exist.`,\n\t\tfix: reemitHint(dir, \"or delete the directory if the migration is unwanted and the source TypeScript is gone.\"),\n\t\tmeta: {\n\t\t\tfile,\n\t\t\tdir\n\t\t}\n\t});\n}\nfunction errorInvalidJson(filePath, parseError) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_JSON\", \"Invalid JSON in migration file\", {\n\t\twhy: `Failed to parse \"${filePath}\": ${parseError}`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\tparseError\n\t\t}\n\t});\n}\nfunction errorInvalidManifest(filePath, reason) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_MANIFEST\", \"Invalid migration manifest\", {\n\t\twhy: `Migration manifest at \"${filePath}\" is invalid: ${reason}`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\treason\n\t\t}\n\t});\n}\nfunction errorDescribeMissingEndContract() {\n\treturn new MigrationToolsError(\"MIGRATION.DESCRIBE_INVALID\", \"Migration.describe(): provide endContractJson or override describe() — a migration needs a destination contract hash.\", {\n\t\twhy: \"Migration.describe() was called on a migration that carries no endContractJson and does not override describe(), so no destination contract hash can be derived.\",\n\t\tfix: \"Set endContractJson on the migration, or override describe() to return the { from, to } metadata explicitly.\",\n\t\tmeta: { reason: \"missing-end-contract\" }\n\t});\n}\nfunction errorDescribeInvalidMetadata(summary) {\n\treturn new MigrationToolsError(\"MIGRATION.DESCRIBE_INVALID\", `describe() returned invalid metadata: ${summary}`, {\n\t\twhy: `The migration's describe() returned metadata that failed schema validation: ${summary}.`,\n\t\tfix: \"Ensure describe() returns { from: string | null, to: string } with valid contract hashes.\",\n\t\tmeta: {\n\t\t\treason: \"invalid-metadata\",\n\t\t\tsummary\n\t\t}\n\t});\n}\nfunction errorOperationsNotArray() {\n\treturn new MigrationToolsError(\"MIGRATION.PLAN_NOT_ARRAY\", \"operations must be an array\", {\n\t\twhy: \"The migration instance's `operations` getter returned a non-array value.\",\n\t\tfix: \"Ensure the `operations` getter returns an array of migration operations.\",\n\t\tmeta: {}\n\t});\n}\nfunction errorSpaceHeadRefMissing(spaceId) {\n\treturn new MigrationToolsError(\"MIGRATION.CHECK_HEAD_REF_MISSING\", `Contract space \"${spaceId}\" has no head ref; its contract cannot be resolved from the snapshot store without one.`, {\n\t\twhy: `Contract space \"${spaceId}\" declares no refs/head.json, so there is no hash to resolve its contract against the snapshot store.`,\n\t\tfix: \"Re-emit the contract-space migrations and head-ref artifacts (the extension's contract-space build), or restore refs/head.json from version control.\",\n\t\tmeta: { spaceId }\n\t});\n}\nfunction errorInvalidOperationEntry(index, reason) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_OPERATION_ENTRY\", \"Migration operation entry is malformed\", {\n\t\twhy: `Operation at index ${index} returned by the migration class failed schema validation: ${reason}.`,\n\t\tfix: \"Update the migration class so each entry of `operations` carries `id` (string), `label` (string), and `operationClass` (one of 'additive' | 'widening' | 'destructive' | 'data').\",\n\t\tmeta: {\n\t\t\tindex,\n\t\t\treason\n\t\t}\n\t});\n}\nfunction errorInvalidSlug(slug) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_NAME\", \"Invalid migration name\", {\n\t\twhy: `The slug \"${slug}\" contains no valid characters after sanitization (only a-z, 0-9 are kept).`,\n\t\tfix: \"Provide a name with at least one alphanumeric character, e.g. --name add_users.\",\n\t\tmeta: { slug }\n\t});\n}\nfunction errorInvalidDestName(destName) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_DEST_NAME\", \"Invalid copy destination name\", {\n\t\twhy: `The destination name \"${destName}\" must be a single path segment (no \"..\" or directory separators).`,\n\t\tfix: \"Use a simple file name such as \\\"contract.json\\\" for each destination in the copy list.\",\n\t\tmeta: { destName }\n\t});\n}\nfunction errorInvalidSpaceId(spaceId) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_SPACE_ID\", \"Invalid contract space identifier\", {\n\t\twhy: `The space id \"${spaceId}\" does not match the required pattern /^[a-z][a-z0-9_-]{0,63}$/. Space ids are used as filesystem directory names under \\`migrations/\\`, so the pattern is conservative on purpose.`,\n\t\tfix: \"Pick a lowercase identifier that begins with a letter and contains only lowercase letters, digits, hyphens, or underscores; max 64 characters total.\",\n\t\tmeta: { spaceId }\n\t});\n}\nfunction errorDescriptorHeadHashMismatch(args) {\n\tconst { extensionId, recomputedHash, headRefHash } = args;\n\treturn new MigrationToolsError(\"MIGRATION.DESCRIPTOR_HEAD_HASH_MISMATCH\", \"Extension descriptor's headRef.hash does not match its contractJson\", {\n\t\twhy: `Extension \"${extensionId}\" publishes a \\`contractSpace\\` whose \\`headRef.hash\\` (${headRefHash}) does not match the canonical hash recomputed from \\`contractSpace.contractJson\\` (${recomputedHash}). This means the extension descriptor was published with stale \\`headRef.hash\\` — typically because the contract was bumped without rerunning the extension's emit pipeline.`,\n\t\tfix: \"Re-run the extension authoring pipeline so `contractJson.storage.storageHash` and `headRef.hash` agree, then republish the extension. If you are the extension author and you intentionally bumped `contractJson`, recompute and update `headRef.hash` (and refresh any on-disk migration metadata that derives from it).\",\n\t\tmeta: {\n\t\t\textensionId,\n\t\t\trecomputedHash,\n\t\t\theadRefHash\n\t\t}\n\t});\n}\nfunction errorDuplicateSpaceId(spaceId) {\n\treturn new MigrationToolsError(\"MIGRATION.DUPLICATE_SPACE_ID\", \"Duplicate contract space identifier\", {\n\t\twhy: `The space id \"${spaceId}\" appears more than once in the per-space planner input. Each space id must be unique across the inputs (the per-space planner emits one output entry per id).`,\n\t\tfix: \"Deduplicate the inputs before passing them to `planAllSpaces` — typically by checking your `extensions` declaration for repeated entries.\",\n\t\tmeta: { spaceId }\n\t});\n}\nfunction errorAmbiguousTarget(branchTips, context) {\n\tconst divergenceInfo = context ? `\\nDivergence point: ${context.divergencePoint}\\nBranches:\\n${context.branches.map((b) => ` → ${b.tip} (${b.edges.length} edge(s): ${b.edges.map((e) => e.dirName).join(\" → \") || \"direct\"})`).join(\"\\n\")}` : \"\";\n\treturn new MigrationToolsError(\"MIGRATION.AMBIGUOUS_TARGET\", \"Ambiguous migration target\", {\n\t\twhy: `The migration history has diverged into multiple branches: ${branchTips.join(\", \")}. This typically happens when two developers plan migrations from the same starting point.${divergenceInfo}`,\n\t\tfix: \"Use `{bin} migration ref set <name> <hash>` to target a specific branch, delete one of the conflicting migration directories and re-run `{bin} migration plan`, or use --from <hash> to explicitly select a starting point.\",\n\t\tmeta: {\n\t\t\tbranchTips,\n\t\t\t...context ? {\n\t\t\t\tdivergencePoint: context.divergencePoint,\n\t\t\t\tbranches: context.branches\n\t\t\t} : {}\n\t\t}\n\t});\n}\nfunction errorNoInitialMigration(nodes) {\n\treturn new MigrationToolsError(\"MIGRATION.NO_INITIAL_MIGRATION\", \"No initial migration found\", {\n\t\twhy: `No migration starts from the empty contract state (known hashes: ${nodes.join(\", \")}). At least one migration must originate from the empty state.`,\n\t\tfix: \"Inspect the migrations directory for corrupted migration.json files. At least one migration must start from the empty contract hash.\",\n\t\tmeta: { nodes }\n\t});\n}\nfunction errorInvalidRefFile(filePath, reason) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_REF_FILE\", \"Invalid ref file\", {\n\t\twhy: `Ref file at \"${filePath}\" is invalid: ${reason}`,\n\t\tfix: \"Ensure the ref file contains valid JSON with { \\\"hash\\\": \\\"<64 hex chars>\\\", \\\"invariants\\\": [\\\"...\\\"] }.\",\n\t\tmeta: {\n\t\t\tpath: filePath,\n\t\t\treason\n\t\t}\n\t});\n}\nfunction errorInvalidRefName(refName) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_REF_NAME\", \"Invalid ref name\", {\n\t\twhy: `Ref name \"${refName}\" is invalid. Names must be lowercase alphanumeric with hyphens or forward slashes (no \".\" or \"..\" segments).`,\n\t\tfix: `Use a valid ref name (e.g., \"staging\", \"envs/production\").`,\n\t\tmeta: { refName }\n\t});\n}\nfunction errorNoTarget(reachableHashes) {\n\treturn new MigrationToolsError(\"MIGRATION.NO_TARGET\", \"No migration target could be resolved\", {\n\t\twhy: `The migration history contains cycles and no target can be resolved automatically (reachable hashes: ${reachableHashes.join(\", \")}). This typically happens after rollback migrations (e.g., C1→C2→C1).`,\n\t\tfix: \"Use --from <hash> to specify the planning origin explicitly.\",\n\t\tmeta: { reachableHashes }\n\t});\n}\nfunction errorInvalidRefValue(value) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_REF_VALUE\", \"Invalid ref value\", {\n\t\twhy: `Ref value \"${value}\" is not a valid contract hash. Values must be a 64-character hex digest or \"empty\".`,\n\t\tfix: \"Use a valid storage hash from `{bin} contract emit` output or an existing migration.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Emit the contract to obtain a valid storage hash\",\n\t\t\tcommand: \"{bin} contract emit\"\n\t\t}, {\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"List existing migrations to reuse one of their hashes\",\n\t\t\tcommand: \"{bin} migration list\"\n\t\t}],\n\t\tmeta: { value }\n\t});\n}\nfunction errorInvalidInvariantId(invariantId) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_INVARIANT_ID\", \"Invalid invariantId\", {\n\t\twhy: `invariantId ${JSON.stringify(invariantId)} is invalid. Ids must be non-empty and contain no whitespace or control characters (including Unicode whitespace like NBSP); other content (kebab-case, camelCase, namespaced, Unicode letters) is allowed.`,\n\t\tfix: \"Pick an invariantId without spaces, tabs, newlines, or control characters — e.g. \\\"backfill-user-phone\\\", \\\"users/backfill-phone\\\", or \\\"BackfillUserPhone\\\".\",\n\t\tmeta: { invariantId }\n\t});\n}\nfunction errorDuplicateInvariantInEdge(invariantId) {\n\treturn new MigrationToolsError(\"MIGRATION.DUPLICATE_INVARIANT_IN_EDGE\", \"Duplicate invariantId on a single migration\", {\n\t\twhy: `invariantId \"${invariantId}\" is declared by more than one dataTransform on the same migration. The marker stores invariants as a set and the routing layer treats them as edge-level, so two ops cannot share a routing identity.`,\n\t\tfix: \"Rename one of the conflicting dataTransform invariantIds, or drop invariantId on the op that does not need to be routing-visible.\",\n\t\tmeta: { invariantId }\n\t});\n}\nfunction errorProvidedInvariantsMismatch(filePath, stored, derived) {\n\tconst storedSet = new Set(stored);\n\tconst derivedSet = new Set(derived);\n\tconst missing = [...derivedSet].filter((id) => !storedSet.has(id));\n\tconst extra = [...storedSet].filter((id) => !derivedSet.has(id));\n\treturn new MigrationToolsError(\"MIGRATION.PROVIDED_INVARIANTS_MISMATCH\", \"providedInvariants on migration.json disagrees with ops.json\", {\n\t\twhy: missing.length === 0 && extra.length === 0 ? `migration.json at \"${filePath}\" stores providedInvariants ${JSON.stringify(stored)}, but the canonical value derived from ops.json is ${JSON.stringify(derived)} — same ids, different order. Canonical providedInvariants is sorted ascending.` : `migration.json at \"${filePath}\" stores providedInvariants ${JSON.stringify(stored)}, but the value derived from ops.json is ${JSON.stringify(derived)}. The manifest copy was likely hand-edited without re-emitting.`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\tstored,\n\t\t\tderived,\n\t\t\tdifference: {\n\t\t\t\tmissing,\n\t\t\t\textra\n\t\t\t}\n\t\t}\n\t});\n}\nfunction errorNoInvariantPath(args) {\n\tconst { refName, required, missing, structuralPath } = args;\n\tconst refClause = refName ? `Ref \"${refName}\"` : \"Target\";\n\tconst missingList = missing.map((id) => JSON.stringify(id)).join(\", \");\n\treturn new MigrationToolsError(\"MIGRATION.NO_INVARIANT_PATH\", \"No path covers the required invariants\", {\n\t\twhy: `${refClause} requires invariants the reachable path doesn't cover. required=[${required.map((id) => JSON.stringify(id)).join(\", \")}], missing=[${missingList}].`,\n\t\tfix: \"Add a migration on the path that runs `dataTransform({ invariantId: \\\"<id>\\\", … })` for each missing invariant, or retarget the ref to a hash whose path already provides them.\",\n\t\tmeta: {\n\t\t\trequired,\n\t\t\tmissing,\n\t\t\tstructuralPath,\n\t\t\t...ifDefined(\"refName\", refName)\n\t\t}\n\t});\n}\nfunction errorUnknownInvariant(args) {\n\tconst { refName, unknown, declared } = args;\n\treturn new MigrationToolsError(\"MIGRATION.UNKNOWN_INVARIANT\", \"Ref declares invariants no migration in the graph provides\", {\n\t\twhy: `${refName ? `Ref \"${refName}\" declares` : \"Declares\"} invariants no migration in the graph provides. unknown=[${unknown.map((id) => JSON.stringify(id)).join(\", \")}].`,\n\t\tfix: \"Either the ref has a typo, or the declaring migration has not been authored/attested yet. Re-check the ref file and the migrations directory.\",\n\t\tmeta: {\n\t\t\tunknown,\n\t\t\tdeclared,\n\t\t\t...ifDefined(\"refName\", refName)\n\t\t}\n\t});\n}\nfunction errorMigrationHashMismatch(dir, storedHash, computedHash) {\n\treturn new MigrationToolsError(\"MIGRATION.HASH_MISMATCH\", \"Migration package is corrupt\", {\n\t\twhy: `Stored migrationHash \"${storedHash}\" does not match the recomputed hash \"${computedHash}\" for \"${relative(process.cwd(), dir)}\". The migration.json or ops.json has been edited or partially written since emit.`,\n\t\tfix: reemitHint(dir, \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tdir,\n\t\t\tstoredHash,\n\t\t\tcomputedHash\n\t\t}\n\t});\n}\n/**\n* A ref name that resolves to nothing: no pointer file named `refName`\n* exists, and the hash being resolved (the `contractAt` argument, used as a\n* fallback when the pointer is absent) is not a node in the migration graph\n* either. There is no contract to materialize.\n*/\nfunction errorRefNotResolvable(refName) {\n\treturn new MigrationToolsError(\"MIGRATION.REF_NOT_RESOLVABLE\", `Ref \"${refName}\" is not resolvable`, {\n\t\twhy: `Ref \"${refName}\" has no pointer file, and the hash being resolved is not a node in the migration graph either — there is nothing to materialize a contract from.`,\n\t\tfix: `Create the ref with \"{bin} migration ref set ${refName} <hash>\" (or advance it via \"{bin} db update --advance-ref ${refName}\"), or pass a hash that is a node in the migration graph.`,\n\t\tnextActions: [\n\t\t\t{\n\t\t\t\tkind: \"run-command\",\n\t\t\t\tlabel: `Create the ref \"${refName}\"`,\n\t\t\t\tcommand: `{bin} migration ref set ${refName} <hash>`\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"run-command\",\n\t\t\t\tlabel: `Advance the ref \"${refName}\" as part of an update`,\n\t\t\t\tcommand: `{bin} db update --advance-ref ${refName}`\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"user-choice\",\n\t\t\t\tlabel: \"Pass a hash that is already a node in the migration graph\"\n\t\t\t}\n\t\t],\n\t\tmeta: {\n\t\t\trefName,\n\t\t\tidentifier: refName\n\t\t}\n\t});\n}\nfunction errorBundleNotFoundForGraphNode(hash, explicitLabel) {\n\treturn new MigrationToolsError(\"MIGRATION.BUNDLE_NOT_FOUND_FOR_GRAPH_NODE\", explicitLabel ? `No migration bundle found for reference \"${explicitLabel}\" (resolved hash: ${hash})` : `No migration bundle found for graph node ${hash}`, {\n\t\twhy: `The hash ${hash} is a graph node but no on-disk migration package has a destination (\\`to\\`) hash matching it.`,\n\t\tfix: \"Provide a ref or hash that corresponds to an existing migration package, or run `{bin} migration list` to see available migrations.\",\n\t\tmeta: {\n\t\t\thash,\n\t\t\t...explicitLabel ? { explicitLabel } : {}\n\t\t}\n\t});\n}\nfunction errorContractDeserializationFailed(filePath, message, options) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_DESERIALIZATION_FAILED\", \"Contract failed to deserialize\", {\n\t\twhy: `Contract at \"${filePath}\" failed to deserialize: ${message}`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\tmessage\n\t\t},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\nfunction errorHashNotInGraph(hash, graph) {\n\tconst reachableHashes = [...graph.nodes].sort();\n\tconst reachableList = reachableHashes.length > 0 ? reachableHashes.join(\", \") : \"(none)\";\n\treturn new MigrationToolsError(\"MIGRATION.HASH_NOT_IN_GRAPH\", `Hash \"${hash}\" is not a node in the migration graph`, {\n\t\twhy: `The migration graph contains nodes ${reachableList}; \"${hash}\" isn't one of them.`,\n\t\tfix: `Pass a hash that's the from-or-to of an on-disk migration bundle, use --from with a graph-node hash, or run \"{bin} migration plan\" to introduce it.`,\n\t\tnextActions: [{\n\t\t\tkind: \"user-choice\",\n\t\t\tlabel: \"Pass a hash that is the from-or-to of an on-disk migration bundle, or use --from with a graph-node hash\",\n\t\t\treason: `Graph nodes: ${reachableList}.`\n\t\t}, {\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: `Introduce \"${hash}\" by planning a migration for it`,\n\t\t\tcommand: \"{bin} migration plan\"\n\t\t}],\n\t\tmeta: {\n\t\t\thash,\n\t\t\treachableHashes\n\t\t}\n\t});\n}\nfunction errorContractSnapshotMissing(storageHash, expectedPath) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_SNAPSHOT_MISSING\", \"Contract snapshot is missing\", {\n\t\twhy: `Expected a contract snapshot for ${storageHash} at \"${expectedPath}\" but the file does not exist.`,\n\t\tfix: \"Re-emit the contract snapshot by re-running the command that authored the migration referencing this hash (`{bin} migration plan` for app-space migrations; the extension's contract-space build for extension spaces), or restore migrations/snapshots/ from version control.\",\n\t\tnextActions: [\n\t\t\t{\n\t\t\t\tkind: \"run-command\",\n\t\t\t\tlabel: \"Re-emit the snapshot for an app-space migration\",\n\t\t\t\tcommand: \"{bin} migration plan\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"user-choice\",\n\t\t\t\tlabel: \"For an extension space, re-run that extension's contract-space build instead\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"user-choice\",\n\t\t\t\tlabel: \"Restore migrations/snapshots/ from version control\"\n\t\t\t}\n\t\t],\n\t\tmeta: {\n\t\t\tstorageHash,\n\t\t\texpectedPath\n\t\t}\n\t});\n}\nfunction errorContractSnapshotHashMismatch(storageHash, actualHash, dir) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_SNAPSHOT_HASH_MISMATCH\", \"Contract snapshot hash mismatch\", {\n\t\twhy: `The contract JSON's inner storage.storageHash (\"${actualHash}\") does not match the requested storage hash (\"${storageHash}\") for snapshot directory \"${dir}\".`,\n\t\tfix: \"Pass a contractJson whose storage.storageHash equals the storageHash argument passed to writeContractSnapshot — the two must agree by construction.\",\n\t\tmeta: {\n\t\t\tstorageHash,\n\t\t\tactualHash,\n\t\t\tdir\n\t\t}\n\t});\n}\nfunction errorMigrationContractViewMissing(className, accessor, jsonField) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_VIEW_MISSING\", `${className}.${accessor} requires ${jsonField}`, {\n\t\twhy: `${className}.${accessor} was read, but this instance has no ${jsonField} to build the view from.`,\n\t\tfix: `Set ${jsonField} to the migration's committed contract JSON, or avoid reading ${accessor} on a migration that overrides describe() and carries no contract.`,\n\t\tmeta: {\n\t\t\tclassName,\n\t\t\taccessor,\n\t\t\tjsonField\n\t\t}\n\t});\n}\n//#endregion\nexport { errorOperationsNotArray as A, errorInvalidSpaceId as C, errorNoInitialMigration as D, errorMissingFile as E, errorRefNotResolvable as M, errorSpaceHeadRefMissing as N, errorNoInvariantPath as O, errorUnknownInvariant as P, errorInvalidSlug as S, errorMigrationHashMismatch as T, errorInvalidManifest as _, errorContractSnapshotHashMismatch as a, errorInvalidRefName as b, errorDescribeMissingEndContract as c, errorDuplicateInvariantInEdge as d, errorDuplicateSpaceId as f, errorInvalidJson as g, errorInvalidInvariantId as h, errorContractDeserializationFailed as i, errorProvidedInvariantsMismatch as j, errorNoTarget as k, errorDescriptorHeadHashMismatch as l, errorInvalidDestName as m, errorAmbiguousTarget as n, errorContractSnapshotMissing as o, errorHashNotInGraph as p, errorBundleNotFoundForGraphNode as r, errorDescribeInvalidMetadata as s, MigrationToolsError as t, errorDirectoryExists as u, errorInvalidOperationEntry as v, errorMigrationContractViewMissing as w, errorInvalidRefValue as x, errorInvalidRefFile as y };\n\n//# sourceMappingURL=errors-SoLLYLtw.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,WAAW,KAAK,UAAU;CAClC,MAAM,SAAS,0CAA0C,SAAS,QAAQ,IAAI,GAAG,GAAG,EAAE;CACtF,OAAO,WAAW,GAAG,OAAO,IAAI,aAAa,GAAG,OAAO;AACxD;;;;;;;;;;;;;;;;;AAiBA,IAAI,sBAAsB,cAAc,mBAAmB;CAC1D;CACA,YAAY,MAAM,SAAS,SAAS;EACnC,MAAM,MAAM,SAAS,OAAO;EAC5B,KAAK,WAAW;CACjB;CACA,OAAO,GAAG,OAAO;EAChB,OAAO,mBAAmB,GAAG,KAAK,KAAK,cAAc,SAAS,MAAM,aAAa,eAAe,MAAM,KAAK,WAAW,YAAY;CACnI;AACD;AACA,SAAS,qBAAqB,KAAK;CAClC,OAAO,IAAI,oBAAoB,wBAAwB,sCAAsC;EAC5F,KAAK,kBAAkB,IAAI;EAC3B,KAAK;EACL,MAAM,EAAE,IAAI;CACb,CAAC;AACF;AACA,SAAS,iBAAiB,MAAM,KAAK;CACpC,OAAO,IAAI,oBAAoB,0BAA0B,WAAW,QAAQ;EAC3E,KAAK,aAAa,KAAK,QAAQ,IAAI;EACnC,KAAK,WAAW,KAAK,yFAAyF;EAC9G,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,iBAAiB,UAAU,YAAY;CAC/C,OAAO,IAAI,oBAAoB,0BAA0B,kCAAkC;EAC1F,KAAK,oBAAoB,SAAS,KAAK;EACvC,KAAK,WAAW,QAAQ,QAAQ,GAAG,gDAAgD;EACnF,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,qBAAqB,UAAU,QAAQ;CAC/C,OAAO,IAAI,oBAAoB,8BAA8B,8BAA8B;EAC1F,KAAK,0BAA0B,SAAS,gBAAgB;EACxD,KA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KAAK,sCAAsC,cAAc,KAAK,KAAK;EACnE,KAAK;EACL,aAAa,CAAC;GACb,MAAM;GACN,OAAO;GACP,QAAQ,gBAAgB,cAAc;EACvC,GAAG;GACF,MAAM;GACN,OAAO,cAAc,KAAK;GAC1B,SAAS;EACV,CAAC;EACD,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,6BAA6B,aAAa,cAAc;CAChE,OAAO,IAAI,oBAAoB,uCAAuC,gCAAgC;EACrG,KAAK,oCAAoC,YAAY,OAAO,aAAa;EACzE,KAAK;EACL,aAAa;GACZ;IACC,MAAM;IACN,OAAO;IACP,SAAS;GACV;GACA;IACC,MAAM;IACN,OAAO;GACR;GACA;IACC,MAAM;IACN,OAAO;GACR;EACD;EACA,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,kCAAkC,aAAa,YAAY,KAAK;CACxE,OAAO,IAAI,oBAAoB,6CAA6C,mCAAmC;EAC9G,KAAK,mDAAmD,WAAW,iDAAiD,YAAY,6BAA6B,IAAI;EACjK,KAAK;EACL,MAAM;GACL;GACA;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,kCAAkC,WAAW,UAAU,WAAW;CAC1E,OAAO,IAAI,oBAAoB,mCAAmC,GAAG,UAAU,GAAG,SAAS,YAAY,aAAa;EACnH,KAAK,GAAG,UAAU,GAAG,SAAS,sCAAsC,UAAU;EAC9E,KAAK,OAAO,UAAU,gEAAgE,SAAS;EAC/F,MAAM;GACL;GACA;GACA;EACD;CACD,CAAC;AACF"}
@@ -1,35 +1,17 @@
1
- import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
2
- import "node:module";
3
- import { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing } from "@prisma/orm-framework/errors/control";
1
+ import { r as getEmittedArtifactPaths } from "./exports-CE6OD63o-4Qpqr2W7.mjs";
2
+ import { createRequire } from "node:module";
3
+ import { realpathSync } from "node:fs";
4
4
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
5
- import { dirname, join, resolve } from "pathe";
6
5
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
7
6
  import { blindCast } from "@prisma/orm-framework/utils/casts";
8
- import { access } from "node:fs/promises";
7
+ import { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing } from "@prisma/orm-framework/errors/control";
9
8
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
10
- import { hasCurrentConfigFormatVersion, normalizeContractConfig } from "@prisma/orm-framework/config/config-types";
9
+ import { dirname, join, resolve } from "pathe";
10
+ import { access } from "node:fs/promises";
11
11
  import { collectConfigIssues } from "@prisma/orm-framework/config/config-validation";
12
- //#region \0rolldown/runtime.js
13
- var __defProp = Object.defineProperty;
14
- var __exportAll = (all, no_symbols) => {
15
- let target = {};
16
- for (var name in all) __defProp(target, name, {
17
- get: all[name],
18
- enumerable: true
19
- });
20
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
21
- return target;
22
- };
23
- //#endregion
12
+ import { normalizeContractConfig } from "@prisma/orm-framework/config/config-types";
13
+ import { pathToFileURL } from "node:url";
24
14
  //#region ../../../1-framework/3-tooling/config-loader/dist/exports/index.mjs
25
- var exports_exports = /* @__PURE__ */ __exportAll({
26
- finalizeConfig: () => finalizeConfig,
27
- findNearestConfigPathForFile: () => findNearestConfigPathForFile,
28
- loadConfig: () => loadConfig,
29
- loadConfigForFile: () => loadConfigForFile,
30
- loadConfigForSections: () => loadConfigForSections,
31
- requireConfigSections: () => requireConfigSections
32
- });
33
15
  function finalizeContractSource(source, configDir) {
34
16
  const resolvedInputs = source.inputs?.map((input) => resolve(configDir, input));
35
17
  if (resolvedInputs === void 0) return source;
@@ -67,7 +49,7 @@ function finalizeConfig(config, configDir) {
67
49
  migrations: finalizeMigrationsConfig(config.migrations, configDir)
68
50
  };
69
51
  }
70
- const CONFIG_FILENAME = "prisma-next.config.ts";
52
+ const CONFIG_FILENAME = "prisma.config.ts";
71
53
  async function findNearestConfigPathForFile(filePath) {
72
54
  let current = dirname(resolve(process.cwd(), filePath));
73
55
  while (true) {
@@ -86,6 +68,9 @@ async function fileExists(path) {
86
68
  return false;
87
69
  }
88
70
  }
71
+ function isRecord(value) {
72
+ return typeof value === "object" && value !== null && !Array.isArray(value);
73
+ }
89
74
  function collectArtifactCollisionDiagnostics(contract) {
90
75
  const inputs = contract.source.inputs;
91
76
  const output = contract.output;
@@ -149,7 +134,7 @@ function toConfigLoadFailure(error, configPath) {
149
134
  return errorConfigEvaluationFailed(resolvedPath, { why: String(error) });
150
135
  }
151
136
  /**
152
- * Loads and finalizes the Prisma Next config.
137
+ * Loads and finalizes the Prisma 8 config.
153
138
  *
154
139
  * Failures that prevent evaluation entirely — missing file, module that does
155
140
  * not evaluate (`CONFIG.FILE_NOT_FOUND`, `CONFIG.EVALUATION_FAILED`) — are the
@@ -157,14 +142,24 @@ function toConfigLoadFailure(error, configPath) {
157
142
  * fail the load: they are returned as section-tagged diagnostics so commands
158
143
  * fail only on the sections they read (via {@link requireConfigSections}).
159
144
  */
145
+ /**
146
+ * c12 is resolved to its real on-disk entry before importing: jiti (inside
147
+ * c12) resolves its own transitive imports from the importing file's location,
148
+ * and a symlinked install (pnpm) would otherwise anchor them somewhere the
149
+ * packages are not. Importing at the real location keeps every transitive
150
+ * resolution working.
151
+ */
152
+ async function importC12() {
153
+ return await import(pathToFileURL(realpathSync(createRequire(import.meta.url).resolve("c12"))).href);
154
+ }
160
155
  async function loadConfig(configPath, options) {
161
156
  const cwd = options?.cwd ?? process.cwd();
162
157
  const resolvedConfigPath = configPath ? resolve(cwd, configPath) : void 0;
163
158
  const configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;
164
159
  let result;
165
160
  try {
166
- result = await (await import("c12")).loadConfig({
167
- name: "prisma-next",
161
+ result = await (await importC12()).loadConfig({
162
+ name: "prisma",
168
163
  ...ifDefined("configFile", resolvedConfigPath),
169
164
  cwd: configCwd
170
165
  });
@@ -173,14 +168,25 @@ async function loadConfig(configPath, options) {
173
168
  }
174
169
  if (resolvedConfigPath && result.configFile !== resolvedConfigPath) return notOk(errorConfigFileNotFound(resolvedConfigPath));
175
170
  if (!result.config || Object.keys(result.config).length === 0) return notOk(errorConfigFileNotFound(result.configFile || resolvedConfigPath || configPath));
171
+ /* v8 ignore next -- @preserve */
172
+ const loadedConfigDir = result.configFile ? dirname(result.configFile) : configCwd;
176
173
  /* v8 ignore next -- c12 always returns layers for a config it evaluated */
177
174
  const [requestedLayer] = result.layers ?? [];
178
- if (!hasCurrentConfigFormatVersion(requestedLayer?.config))
175
+ const layerConfig = requestedLayer?.config;
176
+ const engineMarker = isRecord(layerConfig) ? layerConfig["$prismaConfig"] : void 0;
177
+ if (engineMarker !== void 0) {
178
+ if (engineMarker !== 1)
179
179
  /* v8 ignore next -- a config that evaluated always carries its resolved path */
180
+ return notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));
181
+ const orm = result.config["orm"];
182
+ if (orm !== void 0 && !isRecord(orm)) return ok({
183
+ config: buildLoadedConfig({}, loadedConfigDir).config,
184
+ diagnostics: [errorConfigValidation("orm", { why: `The orm section of ${CONFIG_FILENAME} must be an object` })]
185
+ });
186
+ return ok(buildLoadedConfig(orm ?? {}, loadedConfigDir));
187
+ }
188
+ /* v8 ignore next -- a config that evaluated always carries its resolved path */
180
189
  return notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));
181
- /* v8 ignore next -- @preserve */
182
- const loadedConfigDir = result.configFile ? dirname(result.configFile) : configCwd;
183
- return ok(buildLoadedConfig(result.config, loadedConfigDir));
184
190
  }
185
191
  /**
186
192
  * Narrows a {@link LoadedConfig} to the sections a command reads. Fails with
@@ -210,6 +216,6 @@ async function loadConfigForFile(filePath) {
210
216
  return loadConfig(configPath);
211
217
  }
212
218
  //#endregion
213
- export { loadConfigForFile as a, loadConfig as i, finalizeConfig as n, loadConfigForSections as o, findNearestConfigPathForFile as r, requireConfigSections as s, exports_exports as t };
219
+ export { loadConfigForSections as a, loadConfigForFile as i, findNearestConfigPathForFile as n, requireConfigSections as o, loadConfig as r, finalizeConfig as t };
214
220
 
215
- //# sourceMappingURL=exports-BZLNbtkY.mjs.map
221
+ //# sourceMappingURL=exports-BXXeNWlj.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports-BXXeNWlj.mjs","names":[],"sources":["../../../../1-framework/3-tooling/config-loader/dist/exports/index.mjs"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { normalizeContractConfig } from \"@internal/config/config-types\";\nimport { dirname, join, resolve } from \"pathe\";\nimport { realpathSync } from \"node:fs\";\nimport { access } from \"node:fs/promises\";\nimport { pathToFileURL } from \"node:url\";\nimport { collectConfigIssues } from \"@internal/config/config-validation\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing } from \"@internal/errors/control\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\n//#region src/finalize-config.ts\nfunction finalizeContractSource(source, configDir) {\n\tconst resolvedInputs = source.inputs?.map((input) => resolve(configDir, input));\n\tif (resolvedInputs === void 0) return source;\n\treturn {\n\t\t...source,\n\t\tinputs: resolvedInputs\n\t};\n}\n/** Normalizes a contract section and resolves its paths against `configDir`. */\nfunction finalizeContractConfig(contract, configDir) {\n\tconst normalized = normalizeContractConfig(contract);\n\treturn {\n\t\t...normalized,\n\t\tsource: finalizeContractSource(normalized.source, configDir),\n\t\toutput: resolve(configDir, normalized.output)\n\t};\n}\nconst DEFAULT_MIGRATIONS_DIR = \"migrations\";\n/**\n* Resolves the migrations directory against `configDir`, which is what `migrations.dir` is\n* documented to be relative to. The default is applied here too, so no caller re-derives it\n* against a different base — a command run from one directory with `--config` naming a project in\n* another would otherwise read the wrong `migrations/`.\n*/\nfunction finalizeMigrationsConfig(migrations, configDir) {\n\treturn {\n\t\t...migrations,\n\t\tdir: resolve(configDir, migrations?.dir ?? DEFAULT_MIGRATIONS_DIR)\n\t};\n}\nfunction finalizeConfig(config, configDir) {\n\treturn {\n\t\t...config,\n\t\t...config.contract ? { contract: finalizeContractConfig(config.contract, configDir) } : void 0,\n\t\tmigrations: finalizeMigrationsConfig(config.migrations, configDir)\n\t};\n}\n//#endregion\n//#region src/load.ts\nconst CONFIG_FILENAME = \"prisma.config.ts\";\nasync function findNearestConfigPathForFile(filePath) {\n\tlet current = dirname(resolve(process.cwd(), filePath));\n\twhile (true) {\n\t\tconst candidate = join(current, CONFIG_FILENAME);\n\t\tif (await fileExists(candidate)) return candidate;\n\t\tconst parent = dirname(current);\n\t\tif (parent === current) return;\n\t\tcurrent = parent;\n\t}\n}\nasync function fileExists(path) {\n\ttry {\n\t\tawait access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction collectArtifactCollisionDiagnostics(contract) {\n\tconst inputs = contract.source.inputs;\n\tconst output = contract.output;\n\tif (inputs === void 0 || output === void 0) return [];\n\tlet emittedArtifactPaths;\n\ttry {\n\t\temittedArtifactPaths = getEmittedArtifactPaths(output);\n\t} catch (error) {\n\t\treturn [errorConfigValidation(\"contract.output\", {\n\t\t\t/* v8 ignore next -- getEmittedArtifactPaths only ever throws an Error */\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tsection: \"contract\"\n\t\t})];\n\t}\n\tconst emittedPaths = /* @__PURE__ */ new Set([emittedArtifactPaths.jsonPath, emittedArtifactPaths.dtsPath]);\n\tif (inputs.some((input) => emittedPaths.has(input))) return [errorConfigValidation(\"contract.source.inputs[]\", {\n\t\twhy: \"Config.contract.source.inputs must not include emitted artifact paths derived from contract.output\",\n\t\tsection: \"contract\"\n\t})];\n\treturn [];\n}\nfunction buildLoadedConfig(rawConfig, configDir) {\n\tconst issues = collectConfigIssues(rawConfig);\n\tconst diagnostics = issues.map((issue) => errorConfigValidation(issue.field, {\n\t\twhy: issue.message,\n\t\tsection: issue.section\n\t}));\n\tconst raw = blindCast(rawConfig);\n\tconst config = issues.some((issue) => issue.section === \"migrations\") ? raw : {\n\t\t...raw,\n\t\tmigrations: finalizeMigrationsConfig(raw.migrations, configDir)\n\t};\n\tif (config.contract === void 0 || issues.some((issue) => issue.section === \"contract\")) return {\n\t\tconfig,\n\t\tdiagnostics\n\t};\n\tconst contract = finalizeContractConfig(config.contract, configDir);\n\tdiagnostics.push(...collectArtifactCollisionDiagnostics(contract));\n\treturn {\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tcontract\n\t\t},\n\t\tdiagnostics\n\t};\n}\nfunction toConfigLoadFailure(error, configPath) {\n\tif (CliStructuredError.is(error)) return error;\n\tconst resolvedPath = configPath ? resolve(process.cwd(), configPath) : void 0;\n\tif (isStructuredError(error)) return new CliStructuredError(error.code, error.message, {\n\t\t...ifDefined(\"why\", error.why),\n\t\t...ifDefined(\"fix\", error.fix),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\tcause: error\n\t});\n\tif (error instanceof Error) return errorConfigEvaluationFailed(resolvedPath, {\n\t\twhy: error.message,\n\t\tcause: error\n\t});\n\treturn errorConfigEvaluationFailed(resolvedPath, { why: String(error) });\n}\n/**\n* Loads and finalizes the Prisma 8 config.\n*\n* Failures that prevent evaluation entirely — missing file, module that does\n* not evaluate (`CONFIG.FILE_NOT_FOUND`, `CONFIG.EVALUATION_FAILED`) — are the\n* `Result` failure. Structural problems inside an evaluated config do not\n* fail the load: they are returned as section-tagged diagnostics so commands\n* fail only on the sections they read (via {@link requireConfigSections}).\n*/\n/**\n* c12 is resolved to its real on-disk entry before importing: jiti (inside\n* c12) resolves its own transitive imports from the importing file's location,\n* and a symlinked install (pnpm) would otherwise anchor them somewhere the\n* packages are not. Importing at the real location keeps every transitive\n* resolution working.\n*/\nasync function importC12() {\n\treturn await import(pathToFileURL(realpathSync(createRequire(import.meta.url).resolve(\"c12\"))).href);\n}\nasync function loadConfig(configPath, options) {\n\tconst cwd = options?.cwd ?? process.cwd();\n\tconst resolvedConfigPath = configPath ? resolve(cwd, configPath) : void 0;\n\tconst configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;\n\tlet result;\n\ttry {\n\t\tresult = await (await importC12()).loadConfig({\n\t\t\tname: \"prisma\",\n\t\t\t...ifDefined(\"configFile\", resolvedConfigPath),\n\t\t\tcwd: configCwd\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(toConfigLoadFailure(error, configPath));\n\t}\n\tif (resolvedConfigPath && result.configFile !== resolvedConfigPath) return notOk(errorConfigFileNotFound(resolvedConfigPath));\n\tif (!result.config || Object.keys(result.config).length === 0) return notOk(errorConfigFileNotFound(result.configFile || resolvedConfigPath || configPath));\n\t/* v8 ignore next -- @preserve */\n\tconst loadedConfigDir = result.configFile ? dirname(result.configFile) : configCwd;\n\t/* v8 ignore next -- c12 always returns layers for a config it evaluated */\n\tconst [requestedLayer] = result.layers ?? [];\n\tconst layerConfig = requestedLayer?.config;\n\tconst engineMarker = isRecord(layerConfig) ? layerConfig[\"$prismaConfig\"] : void 0;\n\tif (engineMarker !== void 0) {\n\t\tif (engineMarker !== 1)\n /* v8 ignore next -- a config that evaluated always carries its resolved path */\n\t\treturn notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));\n\t\tconst orm = result.config[\"orm\"];\n\t\tif (orm !== void 0 && !isRecord(orm)) return ok({\n\t\t\tconfig: buildLoadedConfig({}, loadedConfigDir).config,\n\t\t\tdiagnostics: [errorConfigValidation(\"orm\", { why: `The orm section of ${CONFIG_FILENAME} must be an object` })]\n\t\t});\n\t\treturn ok(buildLoadedConfig(orm ?? {}, loadedConfigDir));\n\t}\n\t/* v8 ignore next -- a config that evaluated always carries its resolved path */\n\treturn notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));\n}\n/**\n* Narrows a {@link LoadedConfig} to the sections a command reads. Fails with\n* the first diagnostic concerning a required section; diagnostics on other\n* sections are ignored so unrelated commands keep working.\n*/\nfunction requireConfigSections(loaded, sections) {\n\tconst blocking = loaded.diagnostics.find((diagnostic) => {\n\t\tconst section = diagnostic.meta?.[\"section\"];\n\t\treturn typeof section !== \"string\" || sections.some((required) => required === section);\n\t});\n\treturn blocking ? notOk(blocking) : ok(loaded.config);\n}\n/**\n* Convenience composition of {@link loadConfig} and\n* {@link requireConfigSections} for commands that read a fixed set of\n* sections and have no use for diagnostics outside them.\n*/\nasync function loadConfigForSections(configPath, sections) {\n\tconst loaded = await loadConfig(configPath);\n\tif (!loaded.ok) return loaded;\n\treturn requireConfigSections(loaded.value, sections);\n}\nasync function loadConfigForFile(filePath) {\n\tconst configPath = await findNearestConfigPathForFile(filePath);\n\tif (configPath === void 0) return notOk(errorConfigFileNotFound(join(dirname(resolve(process.cwd(), filePath)), CONFIG_FILENAME)));\n\treturn loadConfig(configPath);\n}\n//#endregion\nexport { finalizeConfig, findNearestConfigPathForFile, loadConfig, loadConfigForFile, loadConfigForSections, requireConfigSections };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,uBAAuB,QAAQ,WAAW;CAClD,MAAM,iBAAiB,OAAO,QAAQ,KAAK,UAAU,QAAQ,WAAW,KAAK,CAAC;CAC9E,IAAI,mBAAmB,KAAK,GAAG,OAAO;CACtC,OAAO;EACN,GAAG;EACH,QAAQ;CACT;AACD;;AAEA,SAAS,uBAAuB,UAAU,WAAW;CACpD,MAAM,aAAa,wBAAwB,QAAQ;CACnD,OAAO;EACN,GAAG;EACH,QAAQ,uBAAuB,WAAW,QAAQ,SAAS;EAC3D,QAAQ,QAAQ,WAAW,WAAW,MAAM;CA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