@prisma/orm-toolchain 8.0.0-rc.1-dev.22 → 8.0.0-rc.1-dev.24

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 (242) hide show
  1. package/dist/{aggregate-D53gnb7v.mjs → aggregate-BKbHUHLA.mjs} +7 -7
  2. package/dist/{aggregate-D53gnb7v.mjs.map → aggregate-BKbHUHLA.mjs.map} +1 -1
  3. package/dist/{aggregate-BflrjWPO.d.mts → aggregate-CA6bJ8UO.d.mts} +3 -3
  4. package/dist/{aggregate-BflrjWPO.d.mts.map → aggregate-CA6bJ8UO.d.mts.map} +1 -1
  5. package/dist/bin__prisma-next.mjs +31 -26
  6. package/dist/bin__prisma-next.mjs.map +1 -1
  7. package/dist/{caught-errors-D7Qznyrm-BzYooF6H.mjs → caught-errors-nYuTn3NK-DkD-ZrDr.mjs} +3 -3
  8. package/dist/caught-errors-nYuTn3NK-DkD-ZrDr.mjs.map +1 -0
  9. package/dist/{cli-errors-CDr3WcJP-NFry5GHb.d.mts → cli-errors-C7vbvQuK-DLpSxz4U.d.mts} +16 -8
  10. package/dist/{cli-errors-CDr3WcJP-NFry5GHb.d.mts.map → cli-errors-C7vbvQuK-DLpSxz4U.d.mts.map} +1 -1
  11. package/dist/cli-errors-kU09RUaz-CUkQ9XuM.mjs +235 -0
  12. package/dist/cli-errors-kU09RUaz-CUkQ9XuM.mjs.map +1 -0
  13. package/dist/cli-telemetry.mjs +7 -6
  14. package/dist/cli-telemetry.mjs.map +1 -1
  15. package/dist/cli.d.mts +38 -2
  16. package/dist/cli.d.mts.map +1 -1
  17. package/dist/cli.mjs +358 -5
  18. package/dist/cli.mjs.map +1 -1
  19. package/dist/cli__commands__contract-emit.d.mts +1 -1
  20. package/dist/cli__commands__contract-emit.mjs +1 -1
  21. package/dist/cli__commands__contract-infer.mjs +1 -1
  22. package/dist/cli__commands__db-init.mjs +1 -1
  23. package/dist/cli__commands__db-schema.mjs +1 -1
  24. package/dist/cli__commands__db-sign.mjs +1 -1
  25. package/dist/cli__commands__db-update.mjs +1 -1
  26. package/dist/cli__commands__db-verify.mjs +1 -1
  27. package/dist/cli__commands__migrate.d.mts +2 -2
  28. package/dist/cli__commands__migrate.mjs +1 -1
  29. package/dist/cli__commands__migration-check.mjs +1 -1
  30. package/dist/cli__commands__migration-graph.d.mts +1 -1
  31. package/dist/cli__commands__migration-graph.mjs +1 -1
  32. package/dist/cli__commands__migration-list.d.mts +2 -2
  33. package/dist/cli__commands__migration-list.mjs +1 -1
  34. package/dist/cli__commands__migration-log.d.mts +1 -1
  35. package/dist/cli__commands__migration-log.mjs +1 -1
  36. package/dist/cli__commands__migration-new.mjs +1 -1
  37. package/dist/cli__commands__migration-plan.d.mts +1 -1
  38. package/dist/cli__commands__migration-plan.mjs +1 -1
  39. package/dist/cli__commands__migration-show.mjs +1 -1
  40. package/dist/cli__commands__migration-status.d.mts +1 -1
  41. package/dist/cli__commands__migration-status.mjs +1 -1
  42. package/dist/cli__commands__ref.mjs +1 -1
  43. package/dist/cli__commands__telemetry.mjs +1 -1
  44. package/dist/cli__control-api.d.mts +26 -19
  45. package/dist/cli__control-api.d.mts.map +1 -1
  46. package/dist/cli__control-api.mjs +16 -16
  47. package/dist/cli__control-api__testing.d.mts +66 -0
  48. package/dist/cli__control-api__testing.d.mts.map +1 -0
  49. package/dist/cli__control-api__testing.mjs +255 -0
  50. package/dist/cli__control-api__testing.mjs.map +1 -0
  51. package/dist/cli__migration-cli.mjs +16 -7
  52. package/dist/cli__migration-cli.mjs.map +1 -1
  53. package/dist/{client-Y6qbDk7X-BzKLmBZo.mjs → client-milNsAnF-B92uF3yv.mjs} +11 -11
  54. package/dist/client-milNsAnF-B92uF3yv.mjs.map +1 -0
  55. package/dist/command-helpers-bGYd7Aab-BNSzfbHK.mjs +765 -0
  56. package/dist/command-helpers-bGYd7Aab-BNSzfbHK.mjs.map +1 -0
  57. package/dist/config-loader.d.mts +2 -2
  58. package/dist/config-loader.mjs +2 -2
  59. package/dist/{contract-at-errors-Dv1mxKYO-C29YB4RC.mjs → contract-at-errors-BTeDEXm4-BAIDia2-.mjs} +3 -3
  60. package/dist/contract-at-errors-BTeDEXm4-BAIDia2-.mjs.map +1 -0
  61. package/dist/{contract-emit-CTm2zfuG-7PV9SBY6.mjs → contract-emit-Bdf4DAR4-lKqkbfZT.mjs} +8 -38
  62. package/dist/contract-emit-Bdf4DAR4-lKqkbfZT.mjs.map +1 -0
  63. package/dist/{contract-emit-D8IXP9Qp-Df6NwXn8.mjs → contract-emit-Ci-8sP-b-QzQXK2xQ.mjs} +29 -23
  64. package/dist/contract-emit-Ci-8sP-b-QzQXK2xQ.mjs.map +1 -0
  65. package/dist/{contract-emit-B65_UiFn.d.mts → contract-emit-CvwNE4R1-DEn1V1Zo.d.mts} +2 -2
  66. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +1 -0
  67. package/dist/contract-emit-E6m8HE42-Bfiodzf_.mjs +2 -0
  68. package/dist/{contract-infer-BwT7ngoo-Dx6aAwIN.mjs → contract-infer-hhyMJiwS-BJ5cYC9P.mjs} +7 -6
  69. package/dist/contract-infer-hhyMJiwS-BJ5cYC9P.mjs.map +1 -0
  70. package/dist/{contract-snapshot-resolution-SATuw0JW-CsYq7g_n.mjs → contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs} +7 -7
  71. package/dist/contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs.map +1 -0
  72. package/dist/{contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs → contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs} +2 -2
  73. package/dist/{contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs.map → contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs.map} +1 -1
  74. package/dist/{contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs → contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs} +7 -6
  75. package/dist/contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs.map +1 -0
  76. package/dist/{db-init-CBj_EWg3.mjs → db-init-3CbSYxRI-BlTkWh8n.mjs} +10 -8
  77. package/dist/db-init-3CbSYxRI-BlTkWh8n.mjs.map +1 -0
  78. package/dist/{db-schema-BWpeh0Q_.mjs → db-schema-BVLbe3EL-WLnbuo77.mjs} +6 -5
  79. package/dist/db-schema-BVLbe3EL-WLnbuo77.mjs.map +1 -0
  80. package/dist/{db-sign-DCb_DKtv.mjs → db-sign-Cdw2RmoG-C-X5UheR.mjs} +24 -11
  81. package/dist/db-sign-Cdw2RmoG-C-X5UheR.mjs.map +1 -0
  82. package/dist/{db-update-WX0KitcX.mjs → db-update-BHOdo8PV-BVBNKrJc.mjs} +11 -9
  83. package/dist/db-update-BHOdo8PV-BVBNKrJc.mjs.map +1 -0
  84. package/dist/{db-verify-B8ax2Y_x-Bp4s5Ra6.mjs → db-verify-C9P9oNCs-gieY7hV2.mjs} +33 -16
  85. package/dist/db-verify-C9P9oNCs-gieY7hV2.mjs.map +1 -0
  86. package/dist/{domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs → domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs} +2 -2
  87. package/dist/{domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs.map → domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs.map} +1 -1
  88. package/dist/emitter.d.mts +1 -1
  89. package/dist/emitter.mjs +2 -2
  90. package/dist/emitter__domain-type-generation.mjs +1 -1
  91. package/dist/{exports-BCLg4CiV-okAfZydo.mjs → exports-BCLg4CiV-05kuwcb0.mjs} +4 -4
  92. package/dist/{exports-BCLg4CiV-okAfZydo.mjs.map → exports-BCLg4CiV-05kuwcb0.mjs.map} +1 -1
  93. package/dist/exports-BZLNbtkY.mjs +215 -0
  94. package/dist/exports-BZLNbtkY.mjs.map +1 -0
  95. package/dist/{exports-BN0vFTxG.mjs → exports-CqNUihkI.mjs} +2 -2
  96. package/dist/{exports-BN0vFTxG.mjs.map → exports-CqNUihkI.mjs.map} +1 -1
  97. package/dist/{exports-BnihzVhw.mjs → exports-DaxzMVtq.mjs} +16 -4
  98. package/dist/exports-DaxzMVtq.mjs.map +1 -0
  99. package/dist/{format-Bw3LVJ1v-BJ6lVFMA.mjs → format-Ddhz7xFW-Bo1nhay8.mjs} +18 -15
  100. package/dist/format-Ddhz7xFW-Bo1nhay8.mjs.map +1 -0
  101. package/dist/{framework-components-3DdB31mk-BHyX-OlJ.mjs → framework-components-Cruf6BPK-CaQvMI3T.mjs} +7 -5
  102. package/dist/framework-components-Cruf6BPK-CaQvMI3T.mjs.map +1 -0
  103. package/dist/index-mCsi_ND5.d.mts +49 -0
  104. package/dist/index-mCsi_ND5.d.mts.map +1 -0
  105. package/dist/{init-CPB89WK2-DPZRZ9Ee.mjs → init-BbmawfZx-DCylULYh.mjs} +23 -8
  106. package/dist/init-BbmawfZx-DCylULYh.mjs.map +1 -0
  107. package/dist/{inspect-live-schema-Da76TWOs-CAFqkhGb.mjs → inspect-live-schema-BEQun_1x-CZpCgg8A.mjs} +17 -13
  108. package/dist/inspect-live-schema-BEQun_1x-CZpCgg8A.mjs.map +1 -0
  109. package/dist/{invariants-BzYfO9IL-BXTvx0z9.mjs → invariants-D5TNnX5E-rjPoJGFq.mjs} +4 -3
  110. package/dist/invariants-D5TNnX5E-rjPoJGFq.mjs.map +1 -0
  111. package/dist/{io-CHUUeHh0-CoCBe9eN.mjs → io-CHUUeHh0-CbyTkKP6.mjs} +2 -2
  112. package/dist/{io-CHUUeHh0-CoCBe9eN.mjs.map → io-CHUUeHh0-CbyTkKP6.mjs.map} +1 -1
  113. package/dist/{legend-5iwwlLU2-CB8bdQKJ.mjs → legend-BBtAETiW-BHqTbUjx.mjs} +3 -3
  114. package/dist/legend-BBtAETiW-BHqTbUjx.mjs.map +1 -0
  115. package/dist/{migrate-B-NAuO90.mjs → migrate-B-hpVTxi-DJzFYT2w.mjs} +44 -17
  116. package/dist/migrate-B-hpVTxi-DJzFYT2w.mjs.map +1 -0
  117. package/dist/{migrate-show-B2LkXkoB-D1ZNl84C.mjs → migrate-show-CUymfnbM-BbpcO2FY.mjs} +9 -12
  118. package/dist/migrate-show-CUymfnbM-BbpcO2FY.mjs.map +1 -0
  119. package/dist/{migrate-show-60NNqVia-oGqMaVA9.d.mts → migrate-show-g71Z4vJw-ocdTvf70.d.mts} +10 -5
  120. package/dist/migrate-show-g71Z4vJw-ocdTvf70.d.mts.map +1 -0
  121. package/dist/{migration-DAJY-NmR.mjs → migration-_C5W2uXF.mjs} +2 -2
  122. package/dist/{migration-DAJY-NmR.mjs.map → migration-_C5W2uXF.mjs.map} +1 -1
  123. package/dist/{migration-check-DONPyXff-CGTUpLv-.mjs → migration-check-DHYPMUFe-Cni_ZUzB.mjs} +33 -30
  124. package/dist/migration-check-DHYPMUFe-Cni_ZUzB.mjs.map +1 -0
  125. package/dist/{migration-check-BDjtAn7x-B0nEBR0k.mjs → migration-check-zgqYe3SB-B6LI6wY7.mjs} +22 -9
  126. package/dist/migration-check-zgqYe3SB-B6LI6wY7.mjs.map +1 -0
  127. package/dist/{migration-command-scaffold-BPqXPCFV-Bls2Wwg7.mjs → migration-command-scaffold-DsT7ke7B-D3u913Po.mjs} +26 -8
  128. package/dist/migration-command-scaffold-DsT7ke7B-D3u913Po.mjs.map +1 -0
  129. package/dist/{migration-graph-HKch1Xk4-DyWhXtjZ.mjs → migration-graph-CChCjts3-ERrIm5aT.mjs} +3 -3
  130. package/dist/{migration-graph-HKch1Xk4-DyWhXtjZ.mjs.map → migration-graph-CChCjts3-ERrIm5aT.mjs.map} +1 -1
  131. package/dist/{migration-graph-Dn469b0l.mjs → migration-graph-Dm9gU0oE-DxPD_SNA.mjs} +20 -10
  132. package/dist/migration-graph-Dm9gU0oE-DxPD_SNA.mjs.map +1 -0
  133. package/dist/{migration-list-C9OPCMt--C28yBgVr.mjs → migration-list-Bkase_ZM-D-bErpSr.mjs} +4 -4
  134. package/dist/migration-list-Bkase_ZM-D-bErpSr.mjs.map +1 -0
  135. package/dist/{migration-list-jk4iCtmO.mjs → migration-list-DDGUTC8Y-B_X7rkez.mjs} +19 -9
  136. package/dist/migration-list-DDGUTC8Y-B_X7rkez.mjs.map +1 -0
  137. package/dist/{migration-log-DQzUBrm8-D3m9wcuf.mjs → migration-log-Cft50PRu-DcnHdxT4.mjs} +20 -8
  138. package/dist/migration-log-Cft50PRu-DcnHdxT4.mjs.map +1 -0
  139. package/dist/{migration-new-BkSY6m0t.mjs → migration-new-D9GHbYwF-C8D22HXG.mjs} +25 -5
  140. package/dist/migration-new-D9GHbYwF-C8D22HXG.mjs.map +1 -0
  141. package/dist/{migration-new-g98oB3nC-BcrkxAAt.mjs → migration-new-RorO1I8r-Ch8NQ4GQ.mjs} +19 -18
  142. package/dist/migration-new-RorO1I8r-Ch8NQ4GQ.mjs.map +1 -0
  143. package/dist/{migration-path-target-BPYp3LNc-DsDdLU0J.mjs → migration-path-target-DhGt62Mi-dm4TU1hJ.mjs} +4 -4
  144. package/dist/migration-path-target-DhGt62Mi-dm4TU1hJ.mjs.map +1 -0
  145. package/dist/{migration-plan-CjIYMJZy.mjs → migration-plan-BOhasCLr-GJWYoOA8.mjs} +25 -5
  146. package/dist/migration-plan-BOhasCLr-GJWYoOA8.mjs.map +1 -0
  147. package/dist/{migration-plan-CwuZLXVE-DAJ-JUQT.mjs → migration-plan-DrCTzrXH-CDJbdiC6.mjs} +29 -28
  148. package/dist/migration-plan-DrCTzrXH-CDJbdiC6.mjs.map +1 -0
  149. package/dist/{migration-plan-BsOYRogP-CC1UFAbu.d.mts → migration-plan-t2e_8yD2-w5Ffa0V_.d.mts} +10 -5
  150. package/dist/migration-plan-t2e_8yD2-w5Ffa0V_.d.mts.map +1 -0
  151. package/dist/{migration-show-CW6EKtfw.mjs → migration-show-DRARjIbv-1p6EE_Uw.mjs} +24 -12
  152. package/dist/migration-show-DRARjIbv-1p6EE_Uw.mjs.map +1 -0
  153. package/dist/{migration-status-DSQcBhiN.mjs → migration-status-Yh0eOQJN-YpcPDpNh.mjs} +26 -13
  154. package/dist/migration-status-Yh0eOQJN-YpcPDpNh.mjs.map +1 -0
  155. package/dist/migration-tools.d.mts +2 -2
  156. package/dist/migration-tools.mjs +8 -8
  157. package/dist/migration-tools__aggregate.d.mts +1 -1
  158. package/dist/migration-tools__aggregate.mjs +1 -1
  159. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  160. package/dist/migration-tools__io.mjs +1 -1
  161. package/dist/migration-tools__migration-ts.mjs +1 -1
  162. package/dist/migration-tools__migration.mjs +1 -1
  163. package/dist/migration-tools__spaces.d.mts +1 -1
  164. package/dist/migration-tools__spaces.mjs +2 -2
  165. package/dist/{migration-ts-FyF55c4M.mjs → migration-ts-BoHxxGvi.mjs} +2 -2
  166. package/dist/{migration-ts-FyF55c4M.mjs.map → migration-ts-BoHxxGvi.mjs.map} +1 -1
  167. package/dist/{project-import-root-C_bd0ooL-WkbJLnAA.mjs → project-import-root--e8xli8Z-Bfrvrv67.mjs} +3 -3
  168. package/dist/project-import-root--e8xli8Z-Bfrvrv67.mjs.map +1 -0
  169. package/dist/{ref-eJjxzYTh-CNiyDL4p.mjs → ref-BQcl8Ksv-BYZY0Ktb.mjs} +12 -17
  170. package/dist/ref-BQcl8Ksv-BYZY0Ktb.mjs.map +1 -0
  171. package/dist/{ref-DSAZime8.mjs → ref-Cu7Zc1Hv-_R4MnDfr.mjs} +30 -7
  172. package/dist/ref-Cu7Zc1Hv-_R4MnDfr.mjs.map +1 -0
  173. package/dist/{ref-advancement-DaZBzm7m-BZQtedYC.mjs → ref-advancement-DaZBzm7m-Deq5Cs7O.mjs} +3 -3
  174. package/dist/{ref-advancement-DaZBzm7m-BZQtedYC.mjs.map → ref-advancement-DaZBzm7m-Deq5Cs7O.mjs.map} +1 -1
  175. package/dist/{ref-resolution-_S4xTT2L-BE5zgO2W.mjs → ref-resolution-BYCRg72z-DFhwf-XR.mjs} +3 -3
  176. package/dist/ref-resolution-BYCRg72z-DFhwf-XR.mjs.map +1 -0
  177. package/dist/{spaces-DxuvClN9.mjs → spaces-DBTCE3Js.mjs} +6 -6
  178. package/dist/{spaces-DxuvClN9.mjs.map → spaces-DBTCE3Js.mjs.map} +1 -1
  179. package/dist/{spaces-D5qtTlhj.d.mts → spaces-tWQi7CUv.d.mts} +2 -2
  180. package/dist/{spaces-D5qtTlhj.d.mts.map → spaces-tWQi7CUv.d.mts.map} +1 -1
  181. package/dist/{telemetry-DVBHDQd6-Ckn5oClN.mjs → telemetry-Dh6e0ams-BsjGN3tQ.mjs} +5 -4
  182. package/dist/telemetry-Dh6e0ams-BsjGN3tQ.mjs.map +1 -0
  183. package/dist/terminal-ui-ypPE9cN6-ilMBkmwT.mjs +645 -0
  184. package/dist/terminal-ui-ypPE9cN6-ilMBkmwT.mjs.map +1 -0
  185. package/dist/{verify-C6L_hiJU-B4V3bqvG.mjs → verify-DBsKxZrK-eDPxNiSS.mjs} +3 -3
  186. package/dist/verify-DBsKxZrK-eDPxNiSS.mjs.map +1 -0
  187. package/dist/{verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs → verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs} +2 -2
  188. package/dist/{verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs.map → verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs.map} +1 -1
  189. package/dist/vite-plugin-contract-emit.mjs +16 -4
  190. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  191. package/package.json +14 -12
  192. package/dist/caught-errors-D7Qznyrm-BzYooF6H.mjs.map +0 -1
  193. package/dist/client-Y6qbDk7X-BzKLmBZo.mjs.map +0 -1
  194. package/dist/command-helpers-C4WpR-QE-DE494TSG.mjs +0 -1627
  195. package/dist/command-helpers-C4WpR-QE-DE494TSG.mjs.map +0 -1
  196. package/dist/contract-at-errors-Dv1mxKYO-C29YB4RC.mjs.map +0 -1
  197. package/dist/contract-emit-B65_UiFn.d.mts.map +0 -1
  198. package/dist/contract-emit-CTm2zfuG-7PV9SBY6.mjs.map +0 -1
  199. package/dist/contract-emit-D8IXP9Qp-Df6NwXn8.mjs.map +0 -1
  200. package/dist/contract-infer-BwT7ngoo-Dx6aAwIN.mjs.map +0 -1
  201. package/dist/contract-snapshot-resolution-SATuw0JW-CsYq7g_n.mjs.map +0 -1
  202. package/dist/contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs.map +0 -1
  203. package/dist/db-init-CBj_EWg3.mjs.map +0 -1
  204. package/dist/db-schema-BWpeh0Q_.mjs.map +0 -1
  205. package/dist/db-sign-DCb_DKtv.mjs.map +0 -1
  206. package/dist/db-update-WX0KitcX.mjs.map +0 -1
  207. package/dist/db-verify-B8ax2Y_x-Bp4s5Ra6.mjs.map +0 -1
  208. package/dist/exports-BnihzVhw.mjs.map +0 -1
  209. package/dist/exports-CDX9kZuw.mjs +0 -119
  210. package/dist/exports-CDX9kZuw.mjs.map +0 -1
  211. package/dist/format-Bw3LVJ1v-BJ6lVFMA.mjs.map +0 -1
  212. package/dist/framework-components-3DdB31mk-BHyX-OlJ.mjs.map +0 -1
  213. package/dist/index-Df9igRvP.d.mts +0 -18
  214. package/dist/index-Df9igRvP.d.mts.map +0 -1
  215. package/dist/init-CPB89WK2-DPZRZ9Ee.mjs.map +0 -1
  216. package/dist/inspect-live-schema-Da76TWOs-CAFqkhGb.mjs.map +0 -1
  217. package/dist/invariants-BzYfO9IL-BXTvx0z9.mjs.map +0 -1
  218. package/dist/legend-5iwwlLU2-CB8bdQKJ.mjs.map +0 -1
  219. package/dist/migrate-B-NAuO90.mjs.map +0 -1
  220. package/dist/migrate-show-60NNqVia-oGqMaVA9.d.mts.map +0 -1
  221. package/dist/migrate-show-B2LkXkoB-D1ZNl84C.mjs.map +0 -1
  222. package/dist/migration-check-BDjtAn7x-B0nEBR0k.mjs.map +0 -1
  223. package/dist/migration-check-DONPyXff-CGTUpLv-.mjs.map +0 -1
  224. package/dist/migration-command-scaffold-BPqXPCFV-Bls2Wwg7.mjs.map +0 -1
  225. package/dist/migration-graph-Dn469b0l.mjs.map +0 -1
  226. package/dist/migration-list-C9OPCMt--C28yBgVr.mjs.map +0 -1
  227. package/dist/migration-list-jk4iCtmO.mjs.map +0 -1
  228. package/dist/migration-log-DQzUBrm8-D3m9wcuf.mjs.map +0 -1
  229. package/dist/migration-new-BkSY6m0t.mjs.map +0 -1
  230. package/dist/migration-new-g98oB3nC-BcrkxAAt.mjs.map +0 -1
  231. package/dist/migration-path-target-BPYp3LNc-DsDdLU0J.mjs.map +0 -1
  232. package/dist/migration-plan-BsOYRogP-CC1UFAbu.d.mts.map +0 -1
  233. package/dist/migration-plan-CjIYMJZy.mjs.map +0 -1
  234. package/dist/migration-plan-CwuZLXVE-DAJ-JUQT.mjs.map +0 -1
  235. package/dist/migration-show-CW6EKtfw.mjs.map +0 -1
  236. package/dist/migration-status-DSQcBhiN.mjs.map +0 -1
  237. package/dist/project-import-root-C_bd0ooL-WkbJLnAA.mjs.map +0 -1
  238. package/dist/ref-DSAZime8.mjs.map +0 -1
  239. package/dist/ref-eJjxzYTh-CNiyDL4p.mjs.map +0 -1
  240. package/dist/ref-resolution-_S4xTT2L-BE5zgO2W.mjs.map +0 -1
  241. package/dist/telemetry-DVBHDQd6-Ckn5oClN.mjs.map +0 -1
  242. package/dist/verify-C6L_hiJU-B4V3bqvG.mjs.map +0 -1
@@ -0,0 +1,645 @@
1
+ import { blindCast } from "@prisma/orm-framework/utils/casts";
2
+ import { bold, cyan, dim, green, red, yellow } from "colorette";
3
+ import * as clack from "@clack/prompts";
4
+ //#region ../../../1-framework/3-tooling/cli/dist/terminal-ui-ypPE9cN6.mjs
5
+ /**
6
+ * Checks if verbose output is enabled at the specified level.
7
+ */
8
+ function isVerbose(flags, level) {
9
+ return (flags.verbose ?? 0) >= level;
10
+ }
11
+ /**
12
+ * Creates a color-aware formatter function.
13
+ * Returns a function that applies the color only if colors are enabled.
14
+ */
15
+ function createColorFormatter(useColor, colorFn) {
16
+ return useColor ? colorFn : (text) => text;
17
+ }
18
+ /**
19
+ * Formats text with dim styling if colors are enabled.
20
+ */
21
+ function formatDim(useColor, text) {
22
+ return useColor ? dim(text) : text;
23
+ }
24
+ /**
25
+ * Render a single statement of an `OperationPreview` for the human-readable
26
+ * preview block. SQL statements get a trailing `;` if missing so the rendered
27
+ * preview is byte-identical to the legacy `string[]`-based renderer for SQL
28
+ * targets. Other languages (`'mongodb-shell'`) render verbatim.
29
+ */
30
+ function renderPreviewStatement(text, language) {
31
+ const trimmed = text.trim();
32
+ if (!trimmed) return void 0;
33
+ if (language === "sql") return trimmed.endsWith(";") ? trimmed : `${trimmed};`;
34
+ return trimmed;
35
+ }
36
+ /**
37
+ * Choose the header label for a preview block. SQL-only previews keep the
38
+ * legacy `DDL preview` label so the rendered output is byte-identical to the
39
+ * pre-aggregate SQL CLI; previews from any other family — or a mix that
40
+ * includes any non-SQL language — use the family-agnostic `Operation preview`
41
+ * label.
42
+ *
43
+ * An empty `statements` array deliberately renders as `Operation preview`
44
+ * rather than `DDL preview`: `Array.prototype.every` is vacuously true for
45
+ * empty arrays, but we have no evidence the preview is SQL-only when no
46
+ * statements are present, so the family-agnostic label is the safer default.
47
+ */
48
+ function previewBlockHeader(preview) {
49
+ return preview.statements.length > 0 && preview.statements.every((s) => s.language === "sql") ? "DDL preview" : "Operation preview";
50
+ }
51
+ function formatPlannerWarningsBlock(warnings, useColor) {
52
+ const formatDimText = (text) => formatDim(useColor, text);
53
+ const lines = ["", "Warnings:"];
54
+ for (const warning of warnings) lines.push(` ${formatDimText(`- ${warning.summary}`)}`);
55
+ return lines;
56
+ }
57
+ /**
58
+ * Render the shared per-space execution block consumed by the `db init`
59
+ * / `db update` / `migrate` summaries. Always shows: space
60
+ * label (`Extension space: <id>` or `App space`) → per-op lines under
61
+ * each space → per-space marker hash (when known).
62
+ *
63
+ * `mode` controls the marker label phrasing — `'apply'` shows
64
+ * `marker → <hash>` (post-apply), `'plan'` omits the marker line
65
+ * entirely (no marker has been written yet).
66
+ */
67
+ function formatPerSpaceBlock(perSpace, mode, useColor) {
68
+ const formatYellow = createColorFormatter(useColor, yellow);
69
+ const formatCyan = createColorFormatter(useColor, cyan);
70
+ const formatDimText = (text) => formatDim(useColor, text);
71
+ const lines = [];
72
+ for (let s = 0; s < perSpace.length; s++) {
73
+ const space = perSpace[s];
74
+ if (s > 0) lines.push("");
75
+ const header = space.kind === "app" ? formatCyan("App space") : formatCyan(`Extension space: ${space.spaceId}`);
76
+ lines.push(header);
77
+ if (space.operations.length === 0) lines.push(` ${formatDimText("(no operations)")}`);
78
+ else for (let i = 0; i < space.operations.length; i++) {
79
+ const op = space.operations[i];
80
+ const treeChar = i === space.operations.length - 1 ? "└" : "├";
81
+ const destructiveMarker = op.operationClass === "destructive" ? ` ${formatYellow("(destructive)")}` : "";
82
+ lines.push(` ${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);
83
+ }
84
+ if (mode === "apply" && space.marker) lines.push(` ${formatDimText(`marker: ${space.marker.storageHash}`)}`);
85
+ }
86
+ return lines;
87
+ }
88
+ /**
89
+ * Formats human-readable output for migration commands (db init, db update) in plan mode.
90
+ */
91
+ function formatMigrationPlanOutput(result, flags) {
92
+ if (flags.quiet) return "";
93
+ const lines = [];
94
+ const useColor = flags.color !== false;
95
+ const formatGreen = createColorFormatter(useColor, green);
96
+ const formatDimText = (text) => formatDim(useColor, text);
97
+ const operationCount = result.plan?.operations.length ?? 0;
98
+ const spaceCount = result.perSpace?.length ?? 0;
99
+ if (spaceCount > 0) lines.push(`${formatGreen("✔")} Planned ${operationCount} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? "" : "s"}`);
100
+ else lines.push(`${formatGreen("✔")} Planned ${operationCount} operation(s)`);
101
+ if (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));
102
+ const formatYellow = createColorFormatter(useColor, yellow);
103
+ if (result.perSpace && result.perSpace.length > 0) {
104
+ lines.push("");
105
+ lines.push(...formatPerSpaceBlock(result.perSpace, "plan", useColor));
106
+ if (result.perSpace.some((s) => s.operations.some((op) => op.operationClass === "destructive"))) {
107
+ lines.push("");
108
+ lines.push(`${formatYellow("⚠")} This migration contains destructive operations that may cause data loss.`);
109
+ }
110
+ } else if (result.plan?.operations && result.plan.operations.length > 0) {
111
+ lines.push(`${formatDimText("│")}`);
112
+ for (let i = 0; i < result.plan.operations.length; i++) {
113
+ const op = result.plan.operations[i];
114
+ if (!op) continue;
115
+ const treeChar = i === result.plan.operations.length - 1 ? "└" : "├";
116
+ const destructiveMarker = op.operationClass === "destructive" ? ` ${formatYellow("(destructive)")}` : "";
117
+ lines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);
118
+ }
119
+ if (result.plan.operations.some((op) => op.operationClass === "destructive")) {
120
+ lines.push("");
121
+ lines.push(`${formatYellow("⚠")} This migration contains destructive operations that may cause data loss.`);
122
+ }
123
+ }
124
+ if (result.plan?.destination) {
125
+ lines.push("");
126
+ lines.push(`${formatDimText(`Destination hash: ${result.plan.destination.storageHash}`)}`);
127
+ }
128
+ if (result.plannedAdvanceRef) {
129
+ lines.push("");
130
+ lines.push(formatDimText(`Would advance ref "${result.plannedAdvanceRef.name}" → ${result.plannedAdvanceRef.hash}`));
131
+ }
132
+ const preview = result.plan?.preview;
133
+ if (preview) {
134
+ lines.push("");
135
+ lines.push(`${formatDimText(previewBlockHeader(preview))}`);
136
+ if (preview.statements.length === 0) lines.push(`${formatDimText("No operations.")}`);
137
+ else {
138
+ lines.push("");
139
+ for (const statement of preview.statements) {
140
+ const rendered = renderPreviewStatement(statement.text, statement.language);
141
+ if (rendered) lines.push(rendered);
142
+ }
143
+ }
144
+ }
145
+ if (isVerbose(flags, 1)) lines.push(`${formatDimText(`Total time: ${result.timings.total}ms`)}`);
146
+ lines.push("");
147
+ lines.push(`${formatDimText("This is a dry run. No changes were applied.")}`);
148
+ lines.push(`${formatDimText("Run without --dry-run to apply changes.")}`);
149
+ return lines.join("\n");
150
+ }
151
+ function formatMigrationApplyCommandOutput(result, flags) {
152
+ if (flags.quiet) return "";
153
+ const lines = [];
154
+ const useColor = flags.color !== false;
155
+ const formatGreen = createColorFormatter(useColor, green);
156
+ const formatDimText = (text) => formatDim(useColor, text);
157
+ lines.push(`${formatGreen("✔")} ${result.summary}`);
158
+ if (result.perSpace.length > 0) {
159
+ lines.push("");
160
+ for (const line of formatPerSpaceBlock(result.perSpace, "apply", useColor)) lines.push(line);
161
+ }
162
+ if (result.advancedRef) {
163
+ lines.push("");
164
+ lines.push(formatDimText(`Advanced ref "${result.advancedRef.name}" → ${result.advancedRef.hash}`));
165
+ }
166
+ lines.push("");
167
+ lines.push(formatDimText("Next: prisma-next migration status"));
168
+ if (isVerbose(flags, 1) && result.timings) {
169
+ lines.push("");
170
+ lines.push(formatDimText(`Total time: ${result.timings.total}ms`));
171
+ }
172
+ return lines.join("\n");
173
+ }
174
+ function formatSpaceShowBlock(space, useColor) {
175
+ const formatGreen = createColorFormatter(useColor, green);
176
+ const formatYellow = createColorFormatter(useColor, yellow);
177
+ const formatDimText = (text) => formatDim(useColor, text);
178
+ const lines = [];
179
+ lines.push(`${formatGreen("✔")} ${space.name}`);
180
+ lines.push(`${formatDimText(` from: ${space.fromContract ?? "(baseline)"}`)}`);
181
+ lines.push(`${formatDimText(` to: ${space.toContract}`)}`);
182
+ lines.push(`${formatDimText(` hash: ${space.hash}`)}`);
183
+ lines.push(`${formatDimText(` created: ${space.createdAt}`)}`);
184
+ lines.push("");
185
+ lines.push(`${space.operations.length} operation(s)`);
186
+ if (space.operations.length > 0) {
187
+ lines.push(`${formatDimText("│")}`);
188
+ for (let i = 0; i < space.operations.length; i++) {
189
+ const op = space.operations[i];
190
+ const treeChar = i === space.operations.length - 1 ? "└" : "├";
191
+ const destructiveMarker = op.operationClass === "destructive" ? ` ${formatYellow("(destructive)")}` : "";
192
+ lines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);
193
+ }
194
+ if (space.operations.some((op) => op.operationClass === "destructive")) {
195
+ lines.push("");
196
+ lines.push(`${formatYellow("⚠")} This migration contains destructive operations that may cause data loss.`);
197
+ }
198
+ }
199
+ if (space.preview.statements.length > 0) {
200
+ lines.push("");
201
+ lines.push(`${formatDimText(previewBlockHeader(space.preview))}`);
202
+ lines.push("");
203
+ for (const statement of space.preview.statements) {
204
+ const rendered = renderPreviewStatement(statement.text, statement.language);
205
+ if (rendered) lines.push(rendered);
206
+ }
207
+ }
208
+ return lines;
209
+ }
210
+ function formatMigrationShowOutput(result, flags) {
211
+ if (flags.quiet) return "";
212
+ const useColor = flags.color !== false;
213
+ return formatSpaceShowBlock(result.migration, useColor).join("\n");
214
+ }
215
+ /**
216
+ * Formats human-readable output for migration commands (db init, db update) in apply mode.
217
+ */
218
+ function formatMigrationApplyOutput(result, flags) {
219
+ if (flags.quiet) return "";
220
+ const lines = [];
221
+ const useColor = flags.color !== false;
222
+ const formatGreen = createColorFormatter(useColor, green);
223
+ const formatDimText = (text) => formatDim(useColor, text);
224
+ if (result.ok) {
225
+ const executed = result.execution?.operationsExecuted ?? 0;
226
+ const spaceCount = result.perSpace?.length ?? 0;
227
+ if (executed === 0) {
228
+ const acrossClause = spaceCount > 0 ? ` across ${spaceCount} contract space${spaceCount === 1 ? "" : "s"}` : "";
229
+ lines.push(`${formatGreen("✔")} Database already matches contract${acrossClause}`);
230
+ } else if (spaceCount > 0) lines.push(`${formatGreen("✔")} Applied ${executed} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? "" : "s"}`);
231
+ else lines.push(`${formatGreen("✔")} Applied ${executed} operation(s)`);
232
+ if (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));
233
+ if (result.perSpace && result.perSpace.length > 0) {
234
+ lines.push("");
235
+ lines.push(...formatPerSpaceBlock(result.perSpace, "apply", useColor));
236
+ lines.push("");
237
+ lines.push(formatDimText(`Run 'prisma-next migration status' to confirm ${spaceCount === 1 ? "the space is" : "all spaces are"} up to date.`));
238
+ } else if (result.marker) {
239
+ lines.push(`${formatDimText(` App-space marker: ${result.marker.storageHash}`)}`);
240
+ if (result.marker.profileHash) lines.push(`${formatDimText(` Profile hash: ${result.marker.profileHash}`)}`);
241
+ }
242
+ if (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);
243
+ if (result.advancedRef) lines.push(formatDimText(`Advanced ref "${result.advancedRef.name}" → ${result.advancedRef.hash}`));
244
+ }
245
+ return lines.join("\n");
246
+ }
247
+ /**
248
+ * Formats JSON output for migration commands (db init, db update).
249
+ */
250
+ function formatMigrationJson(result) {
251
+ return JSON.stringify(result, null, 2);
252
+ }
253
+ /**
254
+ * The display label for a schema-diff issue in the shared error envelope,
255
+ * derived from which sides are present: expected-only is a missing object,
256
+ * actual-only an extra one, both a mismatch. `undefined` when the entry is not
257
+ * a schema-diff issue (it carries neither side) so the caller can fall through
258
+ * to its generic label.
259
+ */
260
+ function schemaDiffIssueLabel(issue) {
261
+ const hasExpected = issue.expected !== void 0;
262
+ const hasActual = issue.actual !== void 0;
263
+ if (hasExpected && hasActual) return "mismatch";
264
+ if (hasExpected) return "missing";
265
+ if (hasActual) return "extra";
266
+ }
267
+ /**
268
+ * Formats error output for human-readable display.
269
+ */
270
+ function formatErrorOutput(error, flags) {
271
+ const lines = [];
272
+ const useColor = flags.color !== false;
273
+ const formatRed = createColorFormatter(useColor, red);
274
+ const formatDimText = (text) => formatDim(useColor, text);
275
+ lines.push(`${formatRed("✖")} ${error.summary} (${error.code})`);
276
+ if (error.why) lines.push(`${formatDimText(` Why: ${error.why}`)}`);
277
+ if (error.fix) lines.push(`${formatDimText(` Fix: ${error.fix}`)}`);
278
+ if (error.where?.path) {
279
+ const whereLine = error.where.line ? `${error.where.path}:${error.where.line}` : error.where.path;
280
+ lines.push(`${formatDimText(` Where: ${whereLine}`)}`);
281
+ }
282
+ if (error.meta?.["conflicts"]) {
283
+ const conflicts = error.meta["conflicts"];
284
+ if (conflicts.length > 0) {
285
+ const maxToShow = isVerbose(flags, 1) ? conflicts.length : Math.min(3, conflicts.length);
286
+ const header = isVerbose(flags, 1) ? " Conflicts:" : ` Conflicts (showing ${maxToShow} of ${conflicts.length}):`;
287
+ lines.push(`${formatDimText(header)}`);
288
+ for (const conflict of conflicts.slice(0, maxToShow)) lines.push(`${formatDimText(` - [${conflict.kind}] ${conflict.summary}`)}`);
289
+ if (!isVerbose(flags, 1) && conflicts.length > maxToShow) lines.push(`${formatDimText(" Re-run with -v/--verbose to see all conflicts")}`);
290
+ }
291
+ }
292
+ if (error.meta?.["issues"]) {
293
+ const issues = error.meta["issues"];
294
+ if (issues.length > 0) {
295
+ const maxToShow = isVerbose(flags, 1) ? issues.length : Math.min(3, issues.length);
296
+ const header = isVerbose(flags, 1) ? " Issues:" : ` Issues (showing ${maxToShow} of ${issues.length}):`;
297
+ lines.push(`${formatDimText(header)}`);
298
+ for (const issue of issues.slice(0, maxToShow)) {
299
+ const label = issue.kind ?? schemaDiffIssueLabel(issue) ?? "issue";
300
+ const message = issue.message ?? issue.path?.join("/") ?? "";
301
+ lines.push(`${formatDimText(` - [${label}] ${message}`)}`);
302
+ }
303
+ if (!isVerbose(flags, 1) && issues.length > maxToShow) lines.push(`${formatDimText(" Re-run with -v/--verbose to see all issues")}`);
304
+ }
305
+ }
306
+ if (error.docsUrl && isVerbose(flags, 1)) lines.push(formatDimText(error.docsUrl));
307
+ const plannerWarnings = error.meta?.["plannerWarnings"];
308
+ if (Array.isArray(plannerWarnings) && plannerWarnings.length > 0) {
309
+ const typedWarnings = blindCast(plannerWarnings);
310
+ lines.push(...formatPlannerWarningsBlock(typedWarnings, useColor));
311
+ }
312
+ if (isVerbose(flags, 2) && error.meta) lines.push(`${formatDimText(` Meta: ${JSON.stringify(error.meta, null, 2)}`)}`);
313
+ return lines.join("\n");
314
+ }
315
+ /**
316
+ * Formats error output as JSON.
317
+ */
318
+ function formatErrorJson(error) {
319
+ return JSON.stringify(error, null, 2);
320
+ }
321
+ function localeString(env) {
322
+ return env["LC_ALL"] ?? env["LC_CTYPE"] ?? env["LANG"] ?? "";
323
+ }
324
+ function isUtf8Locale(env) {
325
+ const locale = localeString(env);
326
+ if (locale.length === 0) return false;
327
+ return /UTF-8|utf8/i.test(locale);
328
+ }
329
+ function detectGlyphMode(input) {
330
+ if (!input.isTTY) return "ascii";
331
+ if (!isUtf8Locale(input.env)) return "ascii";
332
+ return "unicode";
333
+ }
334
+ function createShutdownHandler(options) {
335
+ const exit = options?.exit ?? ((code) => process.exit(code));
336
+ const gracePeriodMs = options?.gracePeriodMs ?? 3e3;
337
+ const controller = new AbortController();
338
+ let shuttingDown = false;
339
+ let graceTimer;
340
+ const onSignal = () => {
341
+ if (shuttingDown) {
342
+ exit(130);
343
+ return;
344
+ }
345
+ shuttingDown = true;
346
+ controller.abort();
347
+ graceTimer = setTimeout(() => exit(130), gracePeriodMs);
348
+ graceTimer.unref();
349
+ };
350
+ return {
351
+ signal: controller.signal,
352
+ isShuttingDown: () => shuttingDown,
353
+ onSignal,
354
+ clearGraceTimer: () => {
355
+ if (graceTimer !== void 0) {
356
+ clearTimeout(graceTimer);
357
+ graceTimer = void 0;
358
+ }
359
+ }
360
+ };
361
+ }
362
+ const globalHandler = createShutdownHandler();
363
+ /**
364
+ * The global AbortSignal. Pass this to any async operation that should
365
+ * be cancellable on Ctrl+C (e.g., DB queries, long-running emit).
366
+ */
367
+ const shutdownSignal = globalHandler.signal;
368
+ /**
369
+ * Installs SIGINT and SIGTERM handlers. Call once at CLI startup.
370
+ *
371
+ * - First signal: aborts the controller, starts a 3s grace timer.
372
+ * - Second signal: force-exits immediately.
373
+ */
374
+ let installed = false;
375
+ function installShutdownHandlers() {
376
+ if (installed) return;
377
+ installed = true;
378
+ process.on("SIGINT", globalHandler.onSignal);
379
+ process.on("SIGTERM", globalHandler.onSignal);
380
+ }
381
+ /**
382
+ * Composable CLI output abstraction.
383
+ *
384
+ * Follows the Unix convention of separating data from decoration:
385
+ * - **stdout** — data output only (`ui.output()`). This is what scripts and pipes capture.
386
+ * - **stderr** — all decoration (spinners, logs, notes, intro/outro). Visible in terminal, invisible in pipes.
387
+ *
388
+ * Rules:
389
+ * 1. All methods except `output()` and `error()` write to stderr only in interactive mode.
390
+ * 2. `output(data)` always writes to stdout — if a command calls it, there is data to emit.
391
+ * 3. `error()` always writes to stderr — errors matter even when piped.
392
+ * 4. Decoration is suppressed when piped unless `--format pretty` was explicit (`forcePretty`).
393
+ * 5. Never write data to stderr — decoration methods are for human context only.
394
+ * 6. Never write decoration to stdout — it breaks pipes, `$(...)` captures, and `> file` redirects.
395
+ */
396
+ var TerminalUI = class TerminalUI {
397
+ /**
398
+ * True when stdout is a TTY (interactive terminal).
399
+ * False when piped (e.g., `prisma-next db verify | jq`).
400
+ */
401
+ isInteractive;
402
+ /**
403
+ * Whether color output is enabled.
404
+ */
405
+ useColor;
406
+ /**
407
+ * When true, decoration methods write even on non-TTY stdout
408
+ * (explicit `--format pretty`).
409
+ */
410
+ forcePretty;
411
+ /**
412
+ * Whether stdout is a TTY — used for migration-list graph glyph detection.
413
+ */
414
+ stdoutIsTTY;
415
+ /**
416
+ * Process environment snapshot for locale-aware glyph detection.
417
+ */
418
+ env;
419
+ static stderrOpts = { output: process.stderr };
420
+ constructor(options) {
421
+ this.isInteractive = options?.interactive ?? !!process.stdout.isTTY;
422
+ this.forcePretty = options?.forcePretty ?? false;
423
+ this.useColor = options?.color ?? (this.isInteractive || this.forcePretty);
424
+ this.stdoutIsTTY = options?.stdoutIsTTY ?? !!process.stdout.isTTY;
425
+ this.env = options?.env ?? process.env;
426
+ }
427
+ get isTTY() {
428
+ return this.stdoutIsTTY;
429
+ }
430
+ /**
431
+ * Resolve glyph mode for migration list/tree output. `--ascii` forces ASCII;
432
+ * otherwise delegates to the pure {@link detectGlyphMode} helper.
433
+ */
434
+ resolveGlyphMode(forceAscii) {
435
+ if (forceAscii) return "ascii";
436
+ return detectGlyphMode(this.glyphModeInput());
437
+ }
438
+ glyphModeInput() {
439
+ return {
440
+ isTTY: this.stdoutIsTTY,
441
+ env: this.env
442
+ };
443
+ }
444
+ get shouldDecorate() {
445
+ return this.isInteractive || this.forcePretty;
446
+ }
447
+ /**
448
+ * Log a message line to stderr. No-op when piped unless forcePretty.
449
+ */
450
+ log(message) {
451
+ if (!this.shouldDecorate) return;
452
+ clack.log.message(message, TerminalUI.stderrOpts);
453
+ }
454
+ /**
455
+ * Log a success message to stderr. No-op when piped unless forcePretty.
456
+ */
457
+ success(message) {
458
+ if (!this.shouldDecorate) return;
459
+ clack.log.success(message, TerminalUI.stderrOpts);
460
+ }
461
+ /**
462
+ * Log a warning message to stderr. No-op when piped unless forcePretty.
463
+ */
464
+ warn(message) {
465
+ if (!this.shouldDecorate) return;
466
+ clack.log.warn(message, TerminalUI.stderrOpts);
467
+ }
468
+ /**
469
+ * Log an error message to stderr. Always writes (errors matter even in pipes).
470
+ */
471
+ error(message) {
472
+ clack.log.error(message, TerminalUI.stderrOpts);
473
+ }
474
+ /**
475
+ * Log an info message to stderr. No-op when piped unless forcePretty.
476
+ */
477
+ info(message) {
478
+ if (!this.shouldDecorate) return;
479
+ clack.log.info(message, TerminalUI.stderrOpts);
480
+ }
481
+ /**
482
+ * Log a step message to stderr. No-op when piped unless forcePretty.
483
+ */
484
+ step(message) {
485
+ if (!this.shouldDecorate) return;
486
+ clack.log.step(message, TerminalUI.stderrOpts);
487
+ }
488
+ /**
489
+ * Display a note box on stderr. No-op when piped unless forcePretty.
490
+ */
491
+ note(message, title) {
492
+ if (!this.shouldDecorate) return;
493
+ clack.note(message, title, TerminalUI.stderrOpts);
494
+ }
495
+ /**
496
+ * Display intro banner on stderr. No-op when piped unless forcePretty.
497
+ */
498
+ intro(title) {
499
+ if (!this.shouldDecorate) return;
500
+ clack.intro(title, TerminalUI.stderrOpts);
501
+ }
502
+ /**
503
+ * Display outro banner on stderr. No-op when piped unless forcePretty.
504
+ */
505
+ outro(message) {
506
+ if (!this.shouldDecorate) return;
507
+ clack.outro(message, TerminalUI.stderrOpts);
508
+ }
509
+ /**
510
+ * Create a Clack spinner on stderr with a 100ms delay threshold.
511
+ * The spinner only appears if the operation takes longer than the threshold,
512
+ * avoiding flicker for fast operations. Returns a no-op spinner when not decorating.
513
+ */
514
+ spinner(delayMs = 100) {
515
+ const noop = {
516
+ start: () => {},
517
+ stop: () => {},
518
+ cancel: () => {},
519
+ error: () => {},
520
+ message: () => {},
521
+ clear: () => {},
522
+ get isCancelled() {
523
+ return false;
524
+ }
525
+ };
526
+ if (!this.shouldDecorate) return noop;
527
+ let inner;
528
+ let timer;
529
+ let pendingMsg;
530
+ let settled = false;
531
+ const ensureCleared = () => {
532
+ if (timer !== void 0) {
533
+ clearTimeout(timer);
534
+ timer = void 0;
535
+ }
536
+ };
537
+ const onAbort = () => {
538
+ if (!settled) {
539
+ settled = true;
540
+ ensureCleared();
541
+ if (inner) inner.cancel("Interrupted");
542
+ }
543
+ };
544
+ if (!shutdownSignal.aborted) shutdownSignal.addEventListener("abort", onAbort, { once: true });
545
+ return {
546
+ start(msg) {
547
+ pendingMsg = msg;
548
+ timer = setTimeout(() => {
549
+ if (!settled) {
550
+ inner = clack.spinner(TerminalUI.stderrOpts);
551
+ inner.start(pendingMsg);
552
+ }
553
+ }, delayMs);
554
+ },
555
+ stop(msg) {
556
+ settled = true;
557
+ ensureCleared();
558
+ if (inner) inner.stop(msg);
559
+ },
560
+ cancel(msg) {
561
+ settled = true;
562
+ ensureCleared();
563
+ if (inner) inner.cancel(msg);
564
+ },
565
+ error(msg) {
566
+ settled = true;
567
+ ensureCleared();
568
+ if (inner) inner.error(msg);
569
+ },
570
+ message(msg) {
571
+ pendingMsg = msg;
572
+ if (inner) inner.message(msg);
573
+ },
574
+ clear() {
575
+ settled = true;
576
+ ensureCleared();
577
+ if (inner) inner.clear();
578
+ },
579
+ get isCancelled() {
580
+ return inner?.isCancelled ?? false;
581
+ }
582
+ };
583
+ }
584
+ /**
585
+ * Prompt for yes/no confirmation on stderr. Returns true if confirmed.
586
+ * In non-interactive mode or when cancelled (Ctrl-C), returns false.
587
+ */
588
+ async confirm(message) {
589
+ if (!this.isInteractive) return false;
590
+ const result = await clack.confirm({
591
+ message,
592
+ ...TerminalUI.stderrOpts
593
+ });
594
+ if (clack.isCancel(result)) return false;
595
+ return result;
596
+ }
597
+ /**
598
+ * Write a raw line to stderr. No-op when piped unless forcePretty.
599
+ * Use for decoration that doesn't fit Clack's log format (e.g. styled headers).
600
+ */
601
+ stderr(message) {
602
+ if (!this.shouldDecorate) return;
603
+ process.stderr.write(`${message}\n`);
604
+ }
605
+ /**
606
+ * Write machine-readable data to stdout.
607
+ * Always writes — if a command calls output(), there is data to emit.
608
+ *
609
+ * This is what scripts and pipes capture: `prisma-next db verify --json | jq .ok`
610
+ */
611
+ output(data) {
612
+ process.stdout.write(`${data}\n`);
613
+ }
614
+ green(text) {
615
+ return this.useColor ? green(text) : text;
616
+ }
617
+ red(text) {
618
+ return this.useColor ? red(text) : text;
619
+ }
620
+ cyan(text) {
621
+ return this.useColor ? cyan(text) : text;
622
+ }
623
+ dim(text) {
624
+ return this.useColor ? dim(text) : text;
625
+ }
626
+ bold(text) {
627
+ return this.useColor ? bold(text) : text;
628
+ }
629
+ yellow(text) {
630
+ return this.useColor ? yellow(text) : text;
631
+ }
632
+ };
633
+ function createTerminalUI(flags, runtime) {
634
+ return new TerminalUI({
635
+ color: flags.color,
636
+ interactive: flags.interactive,
637
+ forcePretty: flags.format === "pretty" && flags.explicitFormat,
638
+ stdoutIsTTY: runtime?.isTTY,
639
+ env: runtime?.env
640
+ });
641
+ }
642
+ //#endregion
643
+ export { formatErrorOutput as a, formatMigrationJson as c, installShutdownHandlers as d, isVerbose as f, formatErrorJson as i, formatMigrationPlanOutput as l, createTerminalUI as n, formatMigrationApplyCommandOutput as o, formatDim as r, formatMigrationApplyOutput as s, createColorFormatter as t, formatMigrationShowOutput as u };
644
+
645
+ //# sourceMappingURL=terminal-ui-ypPE9cN6-ilMBkmwT.mjs.map