@prisma/orm-toolchain 8.0.0-rc.1-dev.36 → 8.0.0-rc.1-dev.38

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 (138) hide show
  1. package/dist/bin__prisma-next.mjs +23 -23
  2. package/dist/bin__prisma-next.mjs.map +1 -1
  3. package/dist/{caught-errors-BZ-9WASe-DH4DaDha.mjs → caught-errors-DLPzfzIW-CQ9BoXD-.mjs} +3 -3
  4. package/dist/{caught-errors-BZ-9WASe-DH4DaDha.mjs.map → caught-errors-DLPzfzIW-CQ9BoXD-.mjs.map} +1 -1
  5. package/dist/{cli-errors-C6_pH59O-CzD4SYcJ.mjs → cli-errors-BG6bItjG-DwdKIeGz.mjs} +4 -4
  6. package/dist/cli-errors-BG6bItjG-DwdKIeGz.mjs.map +1 -0
  7. package/dist/{cli-errors-f5PRtVdm-C6xVKeQn.d.mts → cli-errors-BiKBrOXc-JPxQqO58.d.mts} +48 -6
  8. package/dist/cli-errors-BiKBrOXc-JPxQqO58.d.mts.map +1 -0
  9. package/dist/cli.mjs +572 -33
  10. package/dist/cli.mjs.map +1 -1
  11. package/dist/cli__commands__contract-emit.mjs +1 -1
  12. package/dist/cli__commands__contract-infer.mjs +1 -1
  13. package/dist/cli__commands__db-init.mjs +1 -1
  14. package/dist/cli__commands__db-schema.mjs +1 -1
  15. package/dist/cli__commands__db-sign.mjs +1 -1
  16. package/dist/cli__commands__db-update.mjs +1 -1
  17. package/dist/cli__commands__db-verify.mjs +1 -1
  18. package/dist/cli__commands__migrate.d.mts +2 -2
  19. package/dist/cli__commands__migrate.mjs +1 -1
  20. package/dist/cli__commands__migration-check.mjs +1 -1
  21. package/dist/cli__commands__migration-graph.d.mts +1 -1
  22. package/dist/cli__commands__migration-graph.mjs +1 -1
  23. package/dist/cli__commands__migration-list.d.mts +1 -1
  24. package/dist/cli__commands__migration-list.mjs +1 -1
  25. package/dist/cli__commands__migration-log.d.mts +1 -1
  26. package/dist/cli__commands__migration-log.mjs +1 -1
  27. package/dist/cli__commands__migration-new.mjs +1 -1
  28. package/dist/cli__commands__migration-plan.d.mts +1 -1
  29. package/dist/cli__commands__migration-plan.mjs +1 -1
  30. package/dist/cli__commands__migration-show.mjs +1 -1
  31. package/dist/cli__commands__migration-status.d.mts +1 -1
  32. package/dist/cli__commands__migration-status.mjs +1 -1
  33. package/dist/cli__commands__ref.mjs +1 -1
  34. package/dist/cli__commands__telemetry.mjs +1 -1
  35. package/dist/cli__control-api.d.mts +11 -3
  36. package/dist/cli__control-api.d.mts.map +1 -1
  37. package/dist/cli__control-api.mjs +15 -15
  38. package/dist/cli__control-api__testing.d.mts +1 -1
  39. package/dist/{client-BqhVohc5-DFRVWFps.mjs → client-DU9qtBxW-BjVHiKzE.mjs} +57 -11
  40. package/dist/client-DU9qtBxW-BjVHiKzE.mjs.map +1 -0
  41. package/dist/{command-helpers-kD9CO1hd-BPhnkBin.mjs → command-helpers-CwLvFwMB-BWwUQhlT.mjs} +3 -3
  42. package/dist/{command-helpers-kD9CO1hd-BPhnkBin.mjs.map → command-helpers-CwLvFwMB-BWwUQhlT.mjs.map} +1 -1
  43. package/dist/{contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs → contract-at-errors-Dptf8RE_-B5gr04Sc.mjs} +3 -3
  44. package/dist/{contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs.map → contract-at-errors-Dptf8RE_-B5gr04Sc.mjs.map} +1 -1
  45. package/dist/{contract-emit-BlvUNMHM-BEioUVR5.mjs → contract-emit-BQFpcb2A-BwT9iVdb.mjs} +5 -5
  46. package/dist/{contract-emit-BlvUNMHM-BEioUVR5.mjs.map → contract-emit-BQFpcb2A-BwT9iVdb.mjs.map} +1 -1
  47. package/dist/contract-emit-Bzt11N4v-BQ2Pr8KG.mjs +2 -0
  48. package/dist/{contract-emit-CrYO0A8x-60BOqXFr.mjs → contract-emit-CZQZ1i4z-p9LSGmmQ.mjs} +6 -6
  49. package/dist/{contract-emit-CrYO0A8x-60BOqXFr.mjs.map → contract-emit-CZQZ1i4z-p9LSGmmQ.mjs.map} +1 -1
  50. package/dist/{contract-infer-C8kLphsm-C7-AIYMc.mjs → contract-infer-C6cYOihE-CIUCgmw0.mjs} +4 -4
  51. package/dist/{contract-infer-C8kLphsm-C7-AIYMc.mjs.map → contract-infer-C6cYOihE-CIUCgmw0.mjs.map} +1 -1
  52. package/dist/{contract-snapshot-resolution-BUUdIcgG-8mbs6-OD.mjs → contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs} +4 -4
  53. package/dist/{contract-snapshot-resolution-BUUdIcgG-8mbs6-OD.mjs.map → contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs.map} +1 -1
  54. package/dist/{contract-space-aggregate-loader-BpdB-mHG-BiU0IUeb.mjs → contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs} +4 -4
  55. package/dist/{contract-space-aggregate-loader-BpdB-mHG-BiU0IUeb.mjs.map → contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs.map} +1 -1
  56. package/dist/{db-init-CyNsXRAB-D3xWQ-vy.mjs → db-init-DypCy1e3-CBrYfhHF.mjs} +6 -6
  57. package/dist/{db-init-CyNsXRAB-D3xWQ-vy.mjs.map → db-init-DypCy1e3-CBrYfhHF.mjs.map} +1 -1
  58. package/dist/{db-init-failure-XYOVL4o7-BitY_JYn.mjs → db-init-failure-BmCcHUfc-BqDxyrJE.mjs} +3 -3
  59. package/dist/{db-init-failure-XYOVL4o7-BitY_JYn.mjs.map → db-init-failure-BmCcHUfc-BqDxyrJE.mjs.map} +1 -1
  60. package/dist/{db-schema-7zNGHgYN-BVaRHPxg.mjs → db-schema-DHfPM-5V-JeCjrQ55.mjs} +4 -4
  61. package/dist/{db-schema-7zNGHgYN-BVaRHPxg.mjs.map → db-schema-DHfPM-5V-JeCjrQ55.mjs.map} +1 -1
  62. package/dist/{db-sign-DAs6J3XG-xxP2CCnO.mjs → db-sign-DbAxRcZh-C-nT9kcG.mjs} +6 -6
  63. package/dist/{db-sign-DAs6J3XG-xxP2CCnO.mjs.map → db-sign-DbAxRcZh-C-nT9kcG.mjs.map} +1 -1
  64. package/dist/{db-update-BX1sOuQk-CpeLgPeN.mjs → db-update-J59yROwL-DCP-_z2W.mjs} +16 -7
  65. package/dist/db-update-J59yROwL-DCP-_z2W.mjs.map +1 -0
  66. package/dist/{db-verify-CN4nmxxF-DSRWae0u.mjs → db-verify-0TpDMziA-CJDKutMN.mjs} +5 -5
  67. package/dist/{db-verify-CN4nmxxF-DSRWae0u.mjs.map → db-verify-0TpDMziA-CJDKutMN.mjs.map} +1 -1
  68. package/dist/{format-DceifGAK-BJhTdkcO.mjs → format-cbJY7l6v-CjMUDTAs.mjs} +5 -5
  69. package/dist/{format-DceifGAK-BJhTdkcO.mjs.map → format-cbJY7l6v-CjMUDTAs.mjs.map} +1 -1
  70. package/dist/{framework-components-CPFWl2Ix-CrIZL3jG.mjs → framework-components-C3K7SBeC-Bj5gx85-.mjs} +3 -3
  71. package/dist/{framework-components-CPFWl2Ix-CrIZL3jG.mjs.map → framework-components-C3K7SBeC-Bj5gx85-.mjs.map} +1 -1
  72. package/dist/{init-SY01IBU--CQFYh2As.mjs → init-Bco4QkKJ-DqUZVrBU.mjs} +4 -4
  73. package/dist/{init-SY01IBU--CQFYh2As.mjs.map → init-Bco4QkKJ-DqUZVrBU.mjs.map} +1 -1
  74. package/dist/{inspect-live-schema-BaLAtOgO-Bs0gs_yP.mjs → inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs} +5 -5
  75. package/dist/{inspect-live-schema-BaLAtOgO-Bs0gs_yP.mjs.map → inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs.map} +1 -1
  76. package/dist/{invariants-1L2zfc6--BpedlAbF.mjs → invariants-1zL5-9Mc-BCeOLxd_.mjs} +4 -4
  77. package/dist/{invariants-1L2zfc6--BpedlAbF.mjs.map → invariants-1zL5-9Mc-BCeOLxd_.mjs.map} +1 -1
  78. package/dist/{legend-aXC5H1jH-Dg1yWonK.mjs → legend-BQcPKTLe-bn9e4_ZU.mjs} +3 -3
  79. package/dist/{legend-aXC5H1jH-Dg1yWonK.mjs.map → legend-BQcPKTLe-bn9e4_ZU.mjs.map} +1 -1
  80. package/dist/{migrate-DRiUHRCS-Cci6EEZv.mjs → migrate-CgSnzAUm-aGstaO5N.mjs} +12 -12
  81. package/dist/{migrate-DRiUHRCS-Cci6EEZv.mjs.map → migrate-CgSnzAUm-aGstaO5N.mjs.map} +1 -1
  82. package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs → migrate-failure-CnoUcDms-taa9pfd7.mjs} +4 -4
  83. package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs.map → migrate-failure-CnoUcDms-taa9pfd7.mjs.map} +1 -1
  84. package/dist/{migrate-show-DutwCc2F-BhGfH7D-.d.mts → migrate-show-Dlo-YzOk-BXo-DmwI.d.mts} +3 -3
  85. package/dist/{migrate-show-DutwCc2F-BhGfH7D-.d.mts.map → migrate-show-Dlo-YzOk-BXo-DmwI.d.mts.map} +1 -1
  86. package/dist/{migrate-show-bdXjSFgh-CQxl5yNp.mjs → migrate-show-kVUG1xdo-bVTW8tu4.mjs} +6 -6
  87. package/dist/{migrate-show-bdXjSFgh-CQxl5yNp.mjs.map → migrate-show-kVUG1xdo-bVTW8tu4.mjs.map} +1 -1
  88. package/dist/{migration-check-BHiINj74-CVazN1LV.mjs → migration-check-BVK9vfan-Dfg8lbeB.mjs} +6 -6
  89. package/dist/{migration-check-BHiINj74-CVazN1LV.mjs.map → migration-check-BVK9vfan-Dfg8lbeB.mjs.map} +1 -1
  90. package/dist/{migration-check-of-RPYRk-HuXtDO8i.mjs → migration-check-CBMoMDX2-DhSEOGNg.mjs} +6 -6
  91. package/dist/{migration-check-of-RPYRk-HuXtDO8i.mjs.map → migration-check-CBMoMDX2-DhSEOGNg.mjs.map} +1 -1
  92. package/dist/{migration-command-scaffold-zJFTGn5k-5AGczeSx.mjs → migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs} +5 -5
  93. package/dist/{migration-command-scaffold-zJFTGn5k-5AGczeSx.mjs.map → migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs.map} +1 -1
  94. package/dist/{migration-graph-DmdVVJoZ-DDBKjUMz.mjs → migration-graph-B30X5398-BH3zB9Mn.mjs} +3 -3
  95. package/dist/{migration-graph-DmdVVJoZ-DDBKjUMz.mjs.map → migration-graph-B30X5398-BH3zB9Mn.mjs.map} +1 -1
  96. package/dist/{migration-graph-D0KHjNJ--CWzX9Zzc.mjs → migration-graph-D2dbLCkl-CCHL0aDA.mjs} +8 -8
  97. package/dist/{migration-graph-D0KHjNJ--CWzX9Zzc.mjs.map → migration-graph-D2dbLCkl-CCHL0aDA.mjs.map} +1 -1
  98. package/dist/{migration-graph-sections-BWcFCOL6-_G0Wb4QR.mjs → migration-graph-sections-0lKA5l1b-CTHQquu7.mjs} +3 -3
  99. package/dist/{migration-graph-sections-BWcFCOL6-_G0Wb4QR.mjs.map → migration-graph-sections-0lKA5l1b-CTHQquu7.mjs.map} +1 -1
  100. package/dist/{migration-list-W0dqabIj-Dc2NH_LY.mjs → migration-list-BQTfSGbT-DoNqbNsu.mjs} +3 -3
  101. package/dist/{migration-list-W0dqabIj-Dc2NH_LY.mjs.map → migration-list-BQTfSGbT-DoNqbNsu.mjs.map} +1 -1
  102. package/dist/{migration-list-B0SANIeM-DiXQ9LyS.mjs → migration-list-DCx0KOFp-B3MiGnpa.mjs} +6 -6
  103. package/dist/{migration-list-B0SANIeM-DiXQ9LyS.mjs.map → migration-list-DCx0KOFp-B3MiGnpa.mjs.map} +1 -1
  104. package/dist/{migration-log-B3iiP8ns-B4tdLSye.mjs → migration-log-CJ6_9_uj-uWyc3vlC.mjs} +6 -6
  105. package/dist/{migration-log-B3iiP8ns-B4tdLSye.mjs.map → migration-log-CJ6_9_uj-uWyc3vlC.mjs.map} +1 -1
  106. package/dist/{migration-new-YSdtJTRp-Dc06LNJe.mjs → migration-new-Bp5dPKnF-D-Fb6vEp.mjs} +7 -7
  107. package/dist/{migration-new-YSdtJTRp-Dc06LNJe.mjs.map → migration-new-Bp5dPKnF-D-Fb6vEp.mjs.map} +1 -1
  108. package/dist/{migration-new-Bf5K9fNK-Cd90rYmm.mjs → migration-new-CXLgOLXz-2C5s_q7n.mjs} +4 -4
  109. package/dist/{migration-new-Bf5K9fNK-Cd90rYmm.mjs.map → migration-new-CXLgOLXz-2C5s_q7n.mjs.map} +1 -1
  110. package/dist/{migration-path-target-5r1leSW5-B0EMgvEv.mjs → migration-path-target-BNTSTPAc-D7dQ4K7x.mjs} +3 -3
  111. package/dist/{migration-path-target-5r1leSW5-B0EMgvEv.mjs.map → migration-path-target-BNTSTPAc-D7dQ4K7x.mjs.map} +1 -1
  112. package/dist/{migration-plan-oterbw8h-_GrKbsRb.mjs → migration-plan-BxfF1Hdo-BKn0xMlY.mjs} +4 -4
  113. package/dist/{migration-plan-oterbw8h-_GrKbsRb.mjs.map → migration-plan-BxfF1Hdo-BKn0xMlY.mjs.map} +1 -1
  114. package/dist/{migration-plan-CZY8HVCh-BbfQvxnb.mjs → migration-plan-C6KrFHJT-CRkTsE7L.mjs} +8 -8
  115. package/dist/{migration-plan-CZY8HVCh-BbfQvxnb.mjs.map → migration-plan-C6KrFHJT-CRkTsE7L.mjs.map} +1 -1
  116. package/dist/{migration-plan-4cnnP6yM-DXzRfi_A.d.mts → migration-plan-CharRhoN-BIB3WL65.d.mts} +3 -3
  117. package/dist/{migration-plan-4cnnP6yM-DXzRfi_A.d.mts.map → migration-plan-CharRhoN-BIB3WL65.d.mts.map} +1 -1
  118. package/dist/{migration-show-iX2cduR4-C3-FENR4.mjs → migration-show-Dhnlx_GU-DhWLLt3Z.mjs} +8 -8
  119. package/dist/{migration-show-iX2cduR4-C3-FENR4.mjs.map → migration-show-Dhnlx_GU-DhWLLt3Z.mjs.map} +1 -1
  120. package/dist/{migration-status-BZ6gOxyJ-sbhPgABr.mjs → migration-status-S88DjM8c-DLHnCKfW.mjs} +10 -10
  121. package/dist/{migration-status-BZ6gOxyJ-sbhPgABr.mjs.map → migration-status-S88DjM8c-DLHnCKfW.mjs.map} +1 -1
  122. package/dist/{project-import-root-BPuwl2j1-DTX9G73z.mjs → project-import-root-nwdoPWap--5vXe4zp.mjs} +3 -3
  123. package/dist/{project-import-root-BPuwl2j1-DTX9G73z.mjs.map → project-import-root-nwdoPWap--5vXe4zp.mjs.map} +1 -1
  124. package/dist/{ref-CVD6j3jA-BAgpZLNM.mjs → ref-C8oaaeky-ColNkWpr.mjs} +5 -5
  125. package/dist/{ref-CVD6j3jA-BAgpZLNM.mjs.map → ref-C8oaaeky-ColNkWpr.mjs.map} +1 -1
  126. package/dist/{ref-CaqNqeRF-cjWFAueu.mjs → ref-gZQjdz8I-CW6n9Fc0.mjs} +4 -4
  127. package/dist/{ref-CaqNqeRF-cjWFAueu.mjs.map → ref-gZQjdz8I-CW6n9Fc0.mjs.map} +1 -1
  128. package/dist/{ref-resolution-D4fAdXo8-Dfaky0yw.mjs → ref-resolution-DAK4OK3x-B-8ZZc0f.mjs} +3 -3
  129. package/dist/{ref-resolution-D4fAdXo8-Dfaky0yw.mjs.map → ref-resolution-DAK4OK3x-B-8ZZc0f.mjs.map} +1 -1
  130. package/dist/{telemetry-fKuZOFpu-DNUWfIHo.mjs → telemetry-DPXFYAsz-CPW2USxs.mjs} +3 -3
  131. package/dist/{telemetry-fKuZOFpu-DNUWfIHo.mjs.map → telemetry-DPXFYAsz-CPW2USxs.mjs.map} +1 -1
  132. package/dist/vite-plugin-contract-emit.mjs +1 -1
  133. package/package.json +12 -12
  134. package/dist/cli-errors-C6_pH59O-CzD4SYcJ.mjs.map +0 -1
  135. package/dist/cli-errors-f5PRtVdm-C6xVKeQn.d.mts.map +0 -1
  136. package/dist/client-BqhVohc5-DFRVWFps.mjs.map +0 -1
  137. package/dist/contract-emit-Csa6R0gt-DvxFlS0O.mjs +0 -2
  138. package/dist/db-update-BX1sOuQk-CpeLgPeN.mjs.map +0 -1
@@ -1,34 +1,34 @@
1
1
  #!/usr/bin/env node
2
2
  import { i as createScaffoldSpecifierResolver } from "./import-roots-NDOIEDVj.mjs";
3
3
  import { f as installShutdownHandlers, t as BIN_NAME } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
4
- import { a as formatCommandHelp, b as setCommandExamples, d as isCI$1, i as deriveCanPrompt, m as parseGlobalFlagsOrExit, o as formatRootHelp, p as parseGlobalFlags, t as addGlobalOptions, y as setCommandDescriptions } from "./command-helpers-kD9CO1hd-BPhnkBin.mjs";
5
- import { t as createContractEmitCommand } from "./contract-emit-BlvUNMHM-BEioUVR5.mjs";
6
- import { t as createFormatCommand } from "./format-DceifGAK-BJhTdkcO.mjs";
7
- import { t as createDbInitCommand } from "./db-init-CyNsXRAB-D3xWQ-vy.mjs";
8
- import { t as createDbUpdateCommand } from "./db-update-BX1sOuQk-CpeLgPeN.mjs";
9
- import { t as createDbSchemaCommand } from "./db-schema-7zNGHgYN-BVaRHPxg.mjs";
10
- import { t as createDbSignCommand } from "./db-sign-DAs6J3XG-xxP2CCnO.mjs";
11
- import { t as createDbVerifyCommand } from "./db-verify-CN4nmxxF-DSRWae0u.mjs";
12
- import { t as createContractInferCommand } from "./contract-infer-C8kLphsm-C7-AIYMc.mjs";
13
- import { t as createMigrationNewCommand } from "./migration-new-Bf5K9fNK-Cd90rYmm.mjs";
14
- import { t as createMigrationPlanCommand } from "./migration-plan-oterbw8h-_GrKbsRb.mjs";
15
- import { t as createMigrationShowCommand } from "./migration-show-iX2cduR4-C3-FENR4.mjs";
16
- import { r as createMigrationStatusCommand } from "./migration-status-BZ6gOxyJ-sbhPgABr.mjs";
17
- import { t as createMigrationLogCommand } from "./migration-log-B3iiP8ns-B4tdLSye.mjs";
18
- import { t as createMigrationListCommand } from "./migration-list-B0SANIeM-DiXQ9LyS.mjs";
19
- import { t as createMigrationGraphCommand } from "./migration-graph-D0KHjNJ--CWzX9Zzc.mjs";
20
- import { t as createMigrationCheckCommand } from "./migration-check-BHiINj74-CVazN1LV.mjs";
21
- import { t as createMigrateCommand } from "./migrate-DRiUHRCS-Cci6EEZv.mjs";
22
- import { t as createRefCommand } from "./ref-CaqNqeRF-cjWFAueu.mjs";
4
+ import { a as formatCommandHelp, b as setCommandExamples, d as isCI$1, i as deriveCanPrompt, m as parseGlobalFlagsOrExit, o as formatRootHelp, p as parseGlobalFlags, t as addGlobalOptions, y as setCommandDescriptions } from "./command-helpers-CwLvFwMB-BWwUQhlT.mjs";
5
+ import { t as createContractEmitCommand } from "./contract-emit-BQFpcb2A-BwT9iVdb.mjs";
6
+ import { t as createFormatCommand } from "./format-cbJY7l6v-CjMUDTAs.mjs";
7
+ import { t as createDbInitCommand } from "./db-init-DypCy1e3-CBrYfhHF.mjs";
8
+ import { t as createDbUpdateCommand } from "./db-update-J59yROwL-DCP-_z2W.mjs";
9
+ import { t as createDbSchemaCommand } from "./db-schema-DHfPM-5V-JeCjrQ55.mjs";
10
+ import { t as createDbSignCommand } from "./db-sign-DbAxRcZh-C-nT9kcG.mjs";
11
+ import { t as createDbVerifyCommand } from "./db-verify-0TpDMziA-CJDKutMN.mjs";
12
+ import { t as createContractInferCommand } from "./contract-infer-C6cYOihE-CIUCgmw0.mjs";
13
+ import { t as createMigrationNewCommand } from "./migration-new-CXLgOLXz-2C5s_q7n.mjs";
14
+ import { t as createMigrationPlanCommand } from "./migration-plan-BxfF1Hdo-BKn0xMlY.mjs";
15
+ import { t as createMigrationShowCommand } from "./migration-show-Dhnlx_GU-DhWLLt3Z.mjs";
16
+ import { r as createMigrationStatusCommand } from "./migration-status-S88DjM8c-DLHnCKfW.mjs";
17
+ import { t as createMigrationLogCommand } from "./migration-log-CJ6_9_uj-uWyc3vlC.mjs";
18
+ import { t as createMigrationListCommand } from "./migration-list-DCx0KOFp-B3MiGnpa.mjs";
19
+ import { t as createMigrationGraphCommand } from "./migration-graph-D2dbLCkl-CCHL0aDA.mjs";
20
+ import { t as createMigrationCheckCommand } from "./migration-check-BVK9vfan-Dfg8lbeB.mjs";
21
+ import { t as createMigrateCommand } from "./migrate-CgSnzAUm-aGstaO5N.mjs";
22
+ import { t as createRefCommand } from "./ref-gZQjdz8I-CW6n9Fc0.mjs";
23
23
  import { a as resolveGating, i as readUserConfig, r as ensureInstallationId, s as runTelemetry, u as userConfigPath } from "./exports-CqNUihkI.mjs";
24
- import { t as createTelemetryCommand } from "./telemetry-fKuZOFpu-DNUWfIHo.mjs";
24
+ import { t as createTelemetryCommand } from "./telemetry-DPXFYAsz-CPW2USxs.mjs";
25
25
  import { keepInternalSpecifiers } from "@prisma/orm-framework/components/emission";
26
26
  import { Command } from "commander";
27
27
  import { DEFAULT_CONTRACT_SOURCE_DIR } from "@prisma/orm-framework/config/config-types";
28
28
  import { fileURLToPath } from "node:url";
29
29
  import { distance } from "closest-match";
30
- //#region ../../../1-framework/3-tooling/cli/dist/package-Dy2ioA7c.mjs
31
- var version = "8.0.0-rc.1-dev.36";
30
+ //#region ../../../1-framework/3-tooling/cli/dist/package-QGxf-71P.mjs
31
+ var version = "8.0.0-rc.1-dev.38";
32
32
  //#endregion
33
33
  //#region ../../../1-framework/3-tooling/cli/dist/code-templates-D_dhXHNG.mjs
34
34
  /**
@@ -338,7 +338,7 @@ Exit codes (see CLI Style Guide § Exit Codes):
338
338
  "prisma-next init --no-skill # skip the skills install (air-gapped / restricted env)"
339
339
  ]);
340
340
  return addGlobalOptions(command).option("--target <db>", "Database target: postgres or mongodb").option("--authoring <style>", "Schema authoring style: psl or typescript").option("--schema-path <path>", `Where to write the starter schema (default: ${defaultSchemaPath("psl")})`).option("--force", "Overwrite an existing scaffold without prompting").option("--write-env", "Write a .env file from .env.example (gitignored; default: only .env.example)").option("--probe-db", "Connect to DATABASE_URL once and check the server version against the target minimum (opt-in; off by default)").option("--strict-probe", "Treat a failed --probe-db as fatal (no-op without --probe-db; init is offline-by-default)").option("--no-install", "Skip dependency installation and contract emission").option("--no-skill", "Skip Prisma Next skills install (air-gapped CI, restricted registries, etc.)").action(async (options) => {
341
- const { runInit } = await import("./init-SY01IBU--CQFYh2As.mjs");
341
+ const { runInit } = await import("./init-Bco4QkKJ-DqUZVrBU.mjs");
342
342
  const flags = parseGlobalFlagsOrExit(options);
343
343
  const canPrompt = deriveCanPrompt({
344
344
  flagsInteractive: flags.interactive,
@@ -1 +1 @@
1
- {"version":3,"file":"bin__prisma-next.mjs","names":["isCI"],"sources":["../../../../1-framework/3-tooling/cli/dist/package-Dy2ioA7c.mjs","../../../../1-framework/3-tooling/cli/dist/code-templates-D_dhXHNG.mjs","../../../../1-framework/3-tooling/cli/dist/cli.mjs"],"sourcesContent":["//#region package.json\nvar version = \"8.0.0-rc.1-dev.36\";\n//#endregion\nexport { version as t };\n\n//# sourceMappingURL=package-Dy2ioA7c.mjs.map","import { createScaffoldSpecifierResolver } from \"@internal/publish-surface/import-roots\";\nimport { DEFAULT_CONTRACT_SOURCE_DIR } from \"@internal/config/config-types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\n//#region src/commands/init/templates/code-templates.ts\n/**\n* The resolver a scaffold for `target` is written against.\n*\n* A scaffold is always on the facade root: `init` writes an application around\n* one database package, and the workspace names are not published, so a project\n* scaffolded against them could not install (ADR 242). Both the files `init`\n* writes and the dependency it adds go through this, so they cannot disagree.\n*/\nfunction scaffoldSpecifierResolverFor(target) {\n\treturn createScaffoldSpecifierResolver({\n\t\tmode: \"facade\",\n\t\tfacade: target === \"postgres\" ? \"@prisma/orm-postgres\" : \"@prisma/orm-mongo\"\n\t});\n}\n/**\n* The package name a scaffolded project depends on and imports from, for the\n* import root it is being scaffolded against.\n*\n* Every specifier the scaffold writes derives from this one, and `init` builds\n* a single resolver and hands it to both the file templates and the dependency\n* it installs — so the two cannot disagree. The one caller that deliberately\n* does not thread a resolver is the re-init cleanup in `inputs.ts`, which\n* inspects a manifest an earlier run wrote rather than writing one.\n*\n* Resolvers for scaffolding should come from `createScaffoldSpecifierResolver`\n* in the publish-surface package, which rejects the roots a facade-shaped\n* scaffold cannot express. (Named without its scope on purpose: JSDoc survives\n* into the published bundle, where an internal package name would trip the\n* shell tarball checks.)\n*/\nfunction targetPackageName(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\");\n}\n/** One entrypoint of the scaffolded project's target package. */\nfunction targetEntrypoint(target, subpath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(`${target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\"}/${subpath}`);\n}\nfunction targetLabel(target) {\n\treturn target === \"postgres\" ? \"PostgreSQL\" : \"MongoDB\";\n}\nfunction defaultSchemaPath(authoring) {\n\tif (authoring === \"typescript\") return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.ts`;\n\treturn `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.prisma`;\n}\nfunction starterSchema(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? starterSchemaTsMongo(builder) : starterSchemaTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? starterSchemaPslMongo() : starterSchemaPslPostgres();\n}\n/**\n* Renders a short authoring-appropriate schema sample (FR5.1) for embedding\n* in `prisma-next.md`. Returns a complete fenced markdown code block.\n*\n* The sample intentionally shows just one model: it's illustrative, not\n* a substitute for the full scaffolded contract file. The TS samples use\n* the same outer shape as `starterSchemaTs*` (FR5.3) so a user reading\n* the doc and the file side-by-side sees the same structure.\n*/\nfunction schemaSample(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? schemaSampleTsMongo(builder) : schemaSampleTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? schemaSamplePslMongo() : schemaSamplePslPostgres();\n}\nfunction schemaSamplePslPostgres() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n}\n\\`\\`\\``;\n}\nfunction schemaSamplePslMongo() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n @@map(\"users\")\n}\n\\`\\`\\``;\n}\nfunction schemaSampleTsPostgres(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction schemaSampleTsMongo(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction starterSchemaPslPostgres() {\n\treturn `// use prisma-next\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n posts Post[]\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId Int\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n`;\n}\nfunction starterSchemaPslMongo() {\n\treturn `// use prisma-next\n\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n posts Post[]\n @@map(\"users\")\n}\n\nmodel Post {\n id ObjectId @id @map(\"_id\")\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId ObjectId\n @@map(\"posts\")\n}\n`;\n}\nfunction starterSchemaTsPostgres(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n posts: rel.hasMany('Post', { by: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n fields: {\n id: field.id.uuidv7String(),\n title: field.text(),\n content: field.text().optional(),\n authorId: field.uuidString(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: 'id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction starterSchemaTsMongo(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n relations: {\n posts: rel.hasMany('Post', { from: '_id', to: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n collection: 'posts',\n fields: {\n _id: field.objectId(),\n title: field.string(),\n content: field.string().optional(),\n authorId: field.objectId(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: '_id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction configFile(target, contractPath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn `import 'dotenv/config';\nimport { defineConfig } from '${targetEntrypoint(target, \"config\", resolveImportSpecifier)}';\n\nexport default defineConfig({\n contract: ${JSON.stringify(contractPath)},\n db: {\n connection: process.env['DATABASE_URL']!,\n },\n});\n`;\n}\nfunction dbFile(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst runtime = targetEntrypoint(target, \"runtime\", resolveImportSpecifier);\n\tif (target === \"postgres\") return `import postgres from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = postgres<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n\treturn `import mongo from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = mongo<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n}\n//#endregion\nexport { schemaSample as a, targetLabel as c, scaffoldSpecifierResolverFor as i, targetPackageName as l, dbFile as n, starterSchema as o, defaultSchemaPath as r, targetEntrypoint as s, configFile as t };\n\n//# sourceMappingURL=code-templates-D_dhXHNG.mjs.map","#!/usr/bin/env node\nimport { t as version } from \"./package-Dy2ioA7c.mjs\";\nimport { f as BIN_NAME, n as installShutdownHandlers } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { _ as parseGlobalFlagsOrExit, b as formatCommandHelp, d as setCommandExamples, g as parseGlobalFlags, h as deriveCanPrompt, t as addGlobalOptions, u as setCommandDescriptions, x as formatRootHelp, y as isCI } from \"./command-helpers-kD9CO1hd.mjs\";\nimport { t as createContractEmitCommand } from \"./contract-emit-BlvUNMHM.mjs\";\nimport { t as createContractInferCommand } from \"./contract-infer-C8kLphsm.mjs\";\nimport { r as defaultSchemaPath } from \"./code-templates-D_dhXHNG.mjs\";\nimport { t as createDbInitCommand } from \"./db-init-CyNsXRAB.mjs\";\nimport { t as createDbSchemaCommand } from \"./db-schema-7zNGHgYN.mjs\";\nimport { t as createDbSignCommand } from \"./db-sign-DAs6J3XG.mjs\";\nimport { t as createDbUpdateCommand } from \"./db-update-BX1sOuQk.mjs\";\nimport { t as createDbVerifyCommand } from \"./db-verify-CN4nmxxF.mjs\";\nimport { t as createFormatCommand } from \"./format-DceifGAK.mjs\";\nimport { t as createMigrateCommand } from \"./migrate-DRiUHRCS.mjs\";\nimport { t as createMigrationCheckCommand } from \"./migration-check-BHiINj74.mjs\";\nimport { t as createMigrationGraphCommand } from \"./migration-graph-D0KHjNJ-.mjs\";\nimport { t as createMigrationListCommand } from \"./migration-list-B0SANIeM.mjs\";\nimport { t as createMigrationLogCommand } from \"./migration-log-B3iiP8ns.mjs\";\nimport { t as createMigrationNewCommand } from \"./migration-new-Bf5K9fNK.mjs\";\nimport { t as createMigrationPlanCommand } from \"./migration-plan-oterbw8h.mjs\";\nimport { t as createMigrationShowCommand } from \"./migration-show-iX2cduR4.mjs\";\nimport { r as createMigrationStatusCommand } from \"./migration-status-BZ6gOxyJ.mjs\";\nimport { t as createRefCommand } from \"./ref-CaqNqeRF.mjs\";\nimport { t as createTelemetryCommand } from \"./telemetry-fKuZOFpu.mjs\";\nimport { Command } from \"commander\";\nimport { ensureInstallationId, readUserConfig, resolveGating, runTelemetry, userConfigPath } from \"@internal/cli-telemetry\";\nimport { distance } from \"closest-match\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/commands/init/index.ts\nfunction createInitCommand() {\n\tconst command = new Command(\"init\");\n\tsetCommandDescriptions(command, \"Initialize a new Prisma Next project\", `Scaffolds config, schema, and runtime files, installs dependencies,\nand emits the contract. Gets you from zero to typed queries in one step.\n\nRun interactively for a guided experience, or supply --target / --authoring\nand --yes for a fully scriptable run (CI, AI coding agents, automation).\n\nExit codes (see CLI Style Guide § Exit Codes):\n 0 OK Init succeeded.\\n 1 INTERNAL_ERROR Unexpected bug in prisma-next (please report).\\n 2 PRECONDITION Bad flags / missing prerequisite (e.g. no package.json).\\n 3 USER_ABORTED User cancelled an interactive prompt.\\n 4 INSTALL_FAILED Dependency installation failed (init-specific).\\n 5 EMIT_FAILED \\`contract emit\\` failed after install (init-specific).\\n 6 SKILL_INSTALL_FAILED Agent-skill install failed (re-run with --no-skill to skip).`);\n\tsetCommandExamples(command, [\n\t\t\"prisma-next init\",\n\t\t\"prisma-next init --yes --target postgres --authoring psl\",\n\t\t\"prisma-next init --yes --target mongodb --authoring typescript --json\",\n\t\t\"prisma-next init --yes --force --target postgres --authoring psl # overwrite an existing scaffold\",\n\t\t\"prisma-next init --no-install # skip pnpm/npm install + emit\",\n\t\t\"prisma-next init --no-skill # skip the skills install (air-gapped / restricted env)\"\n\t]);\n\treturn addGlobalOptions(command).option(\"--target <db>\", \"Database target: postgres or mongodb\").option(\"--authoring <style>\", \"Schema authoring style: psl or typescript\").option(\"--schema-path <path>\", `Where to write the starter schema (default: ${defaultSchemaPath(\"psl\")})`).option(\"--force\", \"Overwrite an existing scaffold without prompting\").option(\"--write-env\", \"Write a .env file from .env.example (gitignored; default: only .env.example)\").option(\"--probe-db\", \"Connect to DATABASE_URL once and check the server version against the target minimum (opt-in; off by default)\").option(\"--strict-probe\", \"Treat a failed --probe-db as fatal (no-op without --probe-db; init is offline-by-default)\").option(\"--no-install\", \"Skip dependency installation and contract emission\").option(\"--no-skill\", \"Skip Prisma Next skills install (air-gapped CI, restricted registries, etc.)\").action(async (options) => {\n\t\tconst { runInit } = await import(\"./init-SY01IBU-.mjs\");\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst canPrompt = deriveCanPrompt({\n\t\t\tflagsInteractive: flags.interactive,\n\t\t\toptionInteractive: options.interactive,\n\t\t\tstdinIsTTY: Boolean(process.stdin.isTTY)\n\t\t});\n\t\tconst exitCode = await runInit(process.cwd(), {\n\t\t\toptions,\n\t\t\tflags,\n\t\t\tcanPrompt\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n}\n//#endregion\n//#region src/commands/lsp.ts\nfunction createLspCommand() {\n\tconst command = new Command(\"lsp\");\n\tsetCommandDescriptions(command, \"Start the Prisma Next language server\", \"Launches a Language Server Protocol server that publishes PSL parse diagnostics\\nand handles whole-document PSL formatting for the schema inputs declared in\\nyour config (contract.source.inputs). Formatting uses the Prisma Next PSL\\nformatter and the formatter block from the project config.\\nCommunicates over stdio; intended to be spawned by an\\neditor, not run interactively. The server keeps running until the editor client\\ndisconnects.\");\n\tsetCommandExamples(command, [\"prisma-next lsp --stdio\"]);\n\taddGlobalOptions(command).option(\"--stdio\", \"Communicate with the editor over stdio (the default and only transport)\").action(async () => {\n\t\tconst { startServer } = await import(\"@internal/language-server\");\n\t\tstartServer();\n\t});\n\treturn command;\n}\n//#endregion\n//#region src/utils/suggest-command.ts\n/**\n* Suggests similar command names for a mistyped input.\n*\n* Uses Levenshtein distance to find close matches. Only suggests commands\n* within a reasonable distance threshold (40% of the input length, minimum 2).\n* Returns up to 3 suggestions in case of ties.\n*\n* @returns Array of suggested command names (empty if nothing is close enough).\n*/\nfunction suggestCommands(input, candidates) {\n\tif (candidates.length === 0) return [];\n\tconst maxDistance = Math.max(2, Math.ceil(input.length * .4));\n\tconst scored = candidates.map((name) => ({\n\t\tname,\n\t\tdist: distance(input, name)\n\t})).filter((entry) => entry.dist <= maxDistance).sort((a, b) => a.dist - b.dist);\n\tif (scored.length === 0) return [];\n\tconst bestDist = scored[0].dist;\n\treturn scored.filter((entry) => entry.dist === bestDist).slice(0, 3).map((entry) => entry.name);\n}\n//#endregion\n//#region src/utils/telemetry.ts\n/**\n* Resolve the commander command path from a leaf `Command`, walking up\n* the parent chain. Result is rooted at the program name and ends at\n* the leaf — `['prisma-next', 'migration', 'new']` for\n* `prisma-next migration new …`.\n*/\nfunction commandPathFor(actionCommand) {\n\tconst path = [];\n\tlet cursor = actionCommand;\n\twhile (cursor !== null) {\n\t\tpath.unshift(cursor.name());\n\t\tcursor = cursor.parent;\n\t}\n\treturn path;\n}\nfunction commanderOptionSnapshots(actionCommand) {\n\treturn actionCommand.options.map((option) => {\n\t\tconst attributeName = option.attributeName();\n\t\treturn {\n\t\t\tattributeName,\n\t\t\tlongName: option.long ?? null,\n\t\t\tsource: actionCommand.getOptionValueSource(attributeName) ?? null\n\t\t};\n\t});\n}\n/**\n* Project commander's leaf `Command` into the wire-shape snapshot the\n* telemetry sanitiser consumes. Pure projection — no env, no I/O.\n*/\nfunction commanderSnapshotForTelemetry(actionCommand) {\n\treturn {\n\t\tcommandPath: commandPathFor(actionCommand),\n\t\tpositionalArgs: actionCommand.args,\n\t\toptions: commanderOptionSnapshots(actionCommand)\n\t};\n}\nfunction resolveTelemetryGate() {\n\tif (isCI()) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"ci\"\n\t\t}\n\t};\n\tconst userConfig = readUserConfig();\n\tif (!resolveGating({\n\t\tenv: process.env,\n\t\tconfig: userConfig\n\t}).enabled) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"gated-off\"\n\t\t}\n\t};\n\treturn {\n\t\tenabled: true,\n\t\tuserConfig\n\t};\n}\n/**\n* Path to the compiled sender script inside `@internal/cli-telemetry`'s\n* `dist/`. Resolved off this module's `import.meta.url` via the package\n* specifier `@internal/cli-telemetry/sender`, so the consumer pays\n* no attention to internal package layout.\n*/\nfunction senderPath() {\n\treturn fileURLToPath(new URL(import.meta.resolve(\"@internal/cli-telemetry/sender\")));\n}\nfunction fireTelemetry(actionCommand, userConfig) {\n\treturn runTelemetry({\n\t\tcommand: commanderSnapshotForTelemetry(actionCommand),\n\t\tversion,\n\t\tprojectRoot: process.cwd(),\n\t\tsenderPath: senderPath(),\n\t\tisCI: isCI(),\n\t\tenv: process.env,\n\t\tuserConfig\n\t});\n}\n/**\n* preAction-stage entry point. Synchronous by construction: resolve\n* env/CI/user-consent gates (cheap, all in-memory and a single tiny\n* user-config read), then — only when enabled — `fork()` the detached\n* sender script. The forked child loads `prisma-next.config.*` via\n* c12 on its own (see `loadProjectConfig` in cli-telemetry); the\n* parent does no project-config I/O on the command's hot path.\n*\n* Privacy invariant: gate resolution always happens before any project\n* config touches disk. The child loading user TS code is acceptable\n* only because it's gated behind the same resolved-enabled signal.\n*/\n/**\n* Builds the one-time first-run disclosure. The resolved absolute path to\n* the user-level config file is substituted in so the user can see exactly\n* which file to edit (it must not be confused with `prisma-next.config.ts`).\n* `prisma-next telemetry disable` is named as the primary, friendliest\n* opt-out, alongside the env vars and the config edit.\n*/\nfunction firstRunNotice(configPath) {\n\treturn [\n\t\t\"Prisma Next collects anonymous CLI usage data, enabled by default.\",\n\t\t\"What's collected and why: https://prisma-next.dev/docs/cli/telemetry.\",\n\t\t\"Opt out: run \\\"prisma-next telemetry disable\\\", set DO_NOT_TRACK=1 or\",\n\t\t`PRISMA_NEXT_DISABLE_TELEMETRY=1, or set \"enableTelemetry\": false in ${configPath}.`\n\t].join(\" \");\n}\n/**\n* Best-effort first-run disclosure + installationId mint. Runs only on the\n* gating-enabled path. Prints the notice to stderr (never stdout) and mints\n* a persistent id without touching `enableTelemetry`, so the opt-out default\n* stays intact and no unasked-for consent is recorded.\n*\n* Every step is wrapped so an un-writable config dir (or any other failure)\n* never throws and never blocks the command. Returns the minted (or\n* pre-existing) id so the caller can forward it to `runTelemetry` without a\n* redundant disk read. On mint failure it returns `undefined`: the notice may\n* reprint next run, and `runTelemetry` no-ops on the missing id.\n*/\nfunction discloseAndMintOnFirstRun() {\n\ttry {\n\t\tprocess.stderr.write(`${firstRunNotice(userConfigPath())}\\n`);\n\t} catch {}\n\ttry {\n\t\treturn ensureInstallationId();\n\t} catch {}\n}\n/**\n* True when the run is the `telemetry` command (or one of its\n* subcommands). The usage-telemetry preAction fire is exempted for it:\n* it would be absurd for `telemetry disable` to send a usage event before\n* disabling, or for `telemetry status` to mint an id + send while merely\n* reporting state. This is the only command-specific exemption.\n*\n* The check is rooted at the program: the path must be\n* `['prisma-next', 'telemetry', …]`, so it matches the top-level\n* `telemetry` command and its subcommands without matching a hypothetical\n* nested `… telemetry` elsewhere.\n*/\nfunction isTelemetryCommand(actionCommand) {\n\treturn commandPathFor(actionCommand)[1] === \"telemetry\";\n}\nfunction fireTelemetryFromPreAction(actionCommand) {\n\tif (isTelemetryCommand(actionCommand)) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst gate = resolveTelemetryGate();\n\tif (!gate.enabled) return gate.outcome;\n\tconst storedId = gate.userConfig.installationId;\n\tif (typeof storedId !== \"string\" || storedId.length === 0) {\n\t\tconst installationId = discloseAndMintOnFirstRun();\n\t\treturn fireTelemetry(actionCommand, installationId === void 0 ? gate.userConfig : {\n\t\t\t...gate.userConfig,\n\t\t\tinstallationId\n\t\t});\n\t}\n\treturn fireTelemetry(actionCommand, gate.userConfig);\n}\n//#endregion\n//#region src/cli.ts\ninstallShutdownHandlers();\n/**\n* Lookup table mapping removed subcommands to their replacement verbs.\n* Keyed by `<parent>:<subcommand>` (e.g. `migration:apply`).\n* The handler consults this before falling back to the fuzzy suggest engine.\n*/\nconst removedVerbRedirects = {\n\t\"migration:apply\": \"Use `prisma-next migrate --to <contract>` instead.\",\n\t\"migration:ref\": \"Use `prisma-next ref set|list|delete` instead.\"\n};\n/**\n* Removed flags on specific subcommands. Keyed by `<parent>:<sub>:<flag>`.\n* Checked during the pre-parse argv scan before commander sees the flags.\n*/\nconst removedFlagRedirects = {\n\t\"migration:status:graph\": \"Use `prisma-next migration graph` to view the migration graph.\",\n\t\"migration:status:all\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:limit\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:ref\": \"Use `--to <contract>` instead of `--ref`.\"\n};\n/**\n* Formats the \"Did you mean ...?\" hint for an unknown command.\n*/\nfunction formatSuggestion(input, candidates) {\n\tconst suggestions = suggestCommands(input, candidates.map((c) => c));\n\tif (suggestions.length === 0) return \"\";\n\tif (suggestions.length === 1) return `\\nDid you mean ${suggestions[0]}?\\n`;\n\treturn `\\nDid you mean one of these?\\n${suggestions.map((s) => ` ${s}`).join(\"\\n\")}\\n`;\n}\nconst program = new Command();\nprogram.name(BIN_NAME).description(\"Prisma Next CLI\").version(version);\nprogram.hook(\"preAction\", (_thisCommand, actionCommand) => {\n\ttry {\n\t\tfireTelemetryFromPreAction(actionCommand);\n\t} catch {}\n});\nconst versionOption = program.options.find((opt) => opt.flags.includes(\"--version\"));\nif (versionOption) versionOption.description = \"Output the version number\";\nprogram.configureOutput({\n\twriteErr: () => {},\n\twriteOut: (str) => {\n\t\tprocess.stdout.write(str);\n\t}\n});\nconst rootHelpFormatter = (cmd) => {\n\treturn formatRootHelp({\n\t\tprogram: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n};\nprogram.configureHelp({\n\tformatHelp: rootHelpFormatter,\n\tsubcommandDescription: () => \"\"\n});\nprogram.exitOverride((err) => {\n\tif (err) {\n\t\tconst errorCode = err.code;\n\t\tconst errorMessage = String(err.message ?? \"\");\n\t\tconst errorName = err.name ?? \"\";\n\t\tif (errorCode === \"commander.unknownCommand\" || errorCode === \"commander.unknownArgument\" || errorName === \"CommanderError\" && (errorMessage.includes(\"unknown command\") || errorMessage.includes(\"unknown argument\"))) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst match = errorMessage.match(/unknown command ['\"]([^'\"]+)['\"]/);\n\t\t\tconst commandName = match ? match[1] : process.argv[3] || process.argv[2] || \"unknown\";\n\t\t\tconst firstArg = process.argv[2];\n\t\t\tconst parentCommand = firstArg ? program.commands.find((cmd) => cmd.name() === firstArg) : void 0;\n\t\t\tif (parentCommand && commandName !== firstArg) {\n\t\t\t\tconst subNames = parentCommand.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, subNames)}\\n`);\n\t\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\t\tcommand: parentCommand,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t} else {\n\t\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\t\tconst helpText = formatRootHelp({\n\t\t\t\t\tprogram,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t}\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.help\" || errorCode === \"commander.helpDisplayed\" || errorCode === \"outputHelp\" || errorMessage === \"(outputHelp)\" || errorMessage.includes(\"outputHelp\") || errorName === \"CommanderError\" && errorMessage.includes(\"outputHelp\")) {\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.missingArgument\" || errorCode === \"commander.missingMandatoryOptionValue\" || errorName === \"CommanderError\" && (errorMessage.includes(\"missing\") || errorMessage.includes(\"required\"))) {\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tprocess.stderr.write(`Unhandled error: ${err.message}\\n`);\n\t\tif (err.stack) process.stderr.write(`${err.stack}\\n`);\n\t\tprocess.exit(1);\n\t}\n\tprocess.exit(0);\n});\nconst contractCommand = new Command(\"contract\");\nsetCommandDescriptions(contractCommand, \"Contract management commands\", \"Define and emit your application data contract. The contract describes your schema as a\\ndeclarative data structure that can be signed and verified against your database.\");\ncontractCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst contractEmitCommand = createContractEmitCommand();\ncontractCommand.addCommand(contractEmitCommand);\nconst contractInferCommand = createContractInferCommand();\ncontractCommand.addCommand(contractInferCommand);\nconst dbCommand = new Command(\"db\");\nsetCommandDescriptions(dbCommand, \"Database management commands\", \"Verify and sign your database with your contract. Ensure your database schema matches\\nyour contract, and sign it to record the contract hash for future verification.\");\ndbCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst dbVerifyCommand = createDbVerifyCommand();\ndbCommand.addCommand(dbVerifyCommand);\nconst dbInitCommand = createDbInitCommand();\ndbCommand.addCommand(dbInitCommand);\nconst dbUpdateCommand = createDbUpdateCommand();\ndbCommand.addCommand(dbUpdateCommand);\nconst dbSchemaCommand = createDbSchemaCommand();\ndbCommand.addCommand(dbSchemaCommand);\nconst dbSignCommand = createDbSignCommand();\ndbCommand.addCommand(dbSignCommand);\nconst migrationCommand = new Command(\"migration\");\nsetCommandDescriptions(migrationCommand, \"On-disk migration management commands\", \"Plan, apply, and scaffold on-disk migration packages. Migrations are\\ncontract-to-contract edges stored as versioned directories under migrations/.\");\nmigrationCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst migrationPlanCommand = createMigrationPlanCommand();\nmigrationCommand.addCommand(migrationPlanCommand);\nconst migrationNewCommand = createMigrationNewCommand();\nmigrationCommand.addCommand(migrationNewCommand);\nconst migrationShowCommand = createMigrationShowCommand();\nmigrationCommand.addCommand(migrationShowCommand);\nconst migrationStatusCommand = createMigrationStatusCommand();\nmigrationCommand.addCommand(migrationStatusCommand);\nconst migrationLogCommand = createMigrationLogCommand();\nmigrationCommand.addCommand(migrationLogCommand);\nconst migrationListCommand = createMigrationListCommand();\nmigrationCommand.addCommand(migrationListCommand);\nconst migrationGraphCommand = createMigrationGraphCommand();\nmigrationCommand.addCommand(migrationGraphCommand);\nconst migrationCheckCommand = createMigrationCheckCommand();\nmigrationCommand.addCommand(migrationCheckCommand);\nconst migrateCommand = createMigrateCommand();\nconst refCommand = createRefCommand();\nconst telemetryCommand = createTelemetryCommand();\nconst initCommand = createInitCommand();\nconst formatCommand = createFormatCommand();\nconst lspCommand = createLspCommand();\nprogram.addCommand(initCommand);\nprogram.addCommand(migrateCommand);\nprogram.addCommand(formatCommand);\nprogram.addCommand(lspCommand);\nprogram.addCommand(contractCommand);\nprogram.addCommand(dbCommand);\nprogram.addCommand(migrationCommand);\nprogram.addCommand(refCommand);\nprogram.addCommand(telemetryCommand);\nconst TELEMETRY_CRASH_TEST_SLEEP_MS = 200;\nif (process.env[\"PRISMA_NEXT_ENABLE_TEST_COMMANDS\"] === \"1\") {\n\tconst telemetryCrashTestCommand = new Command(\"__telemetry-crash-test\").description(\"Internal: deliberately throw for the telemetry e2e suite.\").action(async () => {\n\t\tawait new Promise((settle) => setTimeout(settle, TELEMETRY_CRASH_TEST_SLEEP_MS));\n\t\tthrow new Error(\"__telemetry-crash-test: intentional crash for e2e coverage\");\n\t});\n\ttelemetryCrashTestCommand.configureHelp({ visibleCommands: () => [] });\n\tprogram.addCommand(telemetryCrashTestCommand, { hidden: true });\n}\nconst helpCommand = new Command(\"help\").description(\"Show usage instructions\").configureHelp({ formatHelp: (cmd) => {\n\treturn formatCommandHelp({\n\t\tcommand: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n} }).action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stdout.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nprogram.addCommand(helpCommand);\nprogram.action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stderr.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nconst args = process.argv.slice(2);\nif (args.length > 0) {\n\tconst commandName = args[0];\n\tif (commandName === \"--version\" || commandName === \"-V\") {\n\t\tprocess.stdout.write(`${program.version()}\\n`);\n\t\tprocess.exit(0);\n\t}\n\tif (!(commandName === \"--help\" || commandName === \"-h\")) {\n\t\tconst command = program.commands.find((cmd) => cmd.name() === commandName);\n\t\tif (!command) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\tconst helpText = formatRootHelp({\n\t\t\t\tprogram,\n\t\t\t\tflags\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(2);\n\t\t} else if (command.commands.length > 0 && args.length >= 2) {\n\t\t\tconst subcommandName = args[1];\n\t\t\tconst redirect = removedVerbRedirects[`${commandName}:${subcommandName}`];\n\t\t\tif (redirect) {\n\t\t\t\tprocess.stderr.write(`Unknown command: ${subcommandName}\\n${redirect}\\n`);\n\t\t\t\tprocess.exit(2);\n\t\t\t}\n\t\t\tfor (let i = 2; i < args.length; i++) {\n\t\t\t\tconst arg = args[i];\n\t\t\t\tif (!arg.startsWith(\"--\")) continue;\n\t\t\t\tconst flagRedirect = removedFlagRedirects[`${commandName}:${subcommandName}:${arg.slice(2)}`];\n\t\t\t\tif (flagRedirect) {\n\t\t\t\t\tprocess.stderr.write(`Unknown option: ${arg}\\n${flagRedirect}\\n`);\n\t\t\t\t\tprocess.exit(2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (command.commands.length > 0 && args.length === 1) {\n\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\tcommand,\n\t\t\t\tflags: parseGlobalFlags({})\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(0);\n\t\t}\n\t}\n}\nprogram.parse();\n//#endregion\nexport {};\n\n//# sourceMappingURL=cli.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAI,UAAU;;;;;;;;;;;ACWd,SAAS,6BAA6B,QAAQ;CAC7C,OAAO,gCAAgC;EACtC,MAAM;EACN,QAAQ,WAAW,aAAa,yBAAyB;CAC1D,CAAC;AACF;;;;;;;;;;;;;;;;;AAiBA,SAAS,kBAAkB,QAAQ,yBAAyB,wBAAwB;CACnF,OAAO,uBAAuB,WAAW,aAAa,uBAAuB,iBAAiB;AAC/F;;AAEA,SAAS,iBAAiB,QAAQ,SAAS,yBAAyB,wBAAwB;CAC3F,OAAO,uBAAuB,GAAG,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;EACzE,IAAI,CAAC,SAAS;GACb,MAAM,QAAQ,iBAAiB,CAAC,CAAC;GACjC,MAAM,WAAW,QAAQ,SAAS,KAAK,MAAM,EAAE,KAAK,CAAC;GACrD,QAAQ,OAAO,MAAM,oBAAoB,cAAc,iBAAiB,aAAa,QAAQ,EAAE,GAAG;GAClG,MAAM,WAAW,eAAe;IAC/B;IACA;GACD,CAAC;GACD,QAAQ,OAAO,MAAM,GAAG,SAAS,GAAG;GACpC,QAAQ,KAAK,CAAC;EACf,OAAO,IAAI,QAAQ,SAAS,SAAS,KAAK,KAAK,UAAU,GAAG;GAC3D,MAAM,iBAAiB,KAAK;GAC5B,MAAM,WAAW,qBAAqB,GAAG,YAAY,GAAG;GACxD,IAAI,UAAU;IACb,QAAQ,OAAO,MAAM,oBAAoB,eAAe,IAAI,SAAS,GAAG;IACxE,QAAQ,KAAK,CAAC;GACf;GACA,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;IACrC,MAAM,MAAM,KAAK;IACjB,IAAI,CAAC,IAAI,WAAW,IAAI,GAAG;IAC3B,MAAM,eAAe,qBAAqB,GAAG,YAAY,GAAG,eAAe,GAAG,IAAI,MAAM,CAAC;IACzF,IAAI,cAAc;KACjB,QAAQ,OAAO,MAAM,mBAAmB,IAAI,IAAI,aAAa,GAAG;KAChE,QAAQ,KAAK,CAAC;IACf;GACD;EACD;EACA,IAAI,QAAQ,SAAS,SAAS,KAAK,KAAK,WAAW,GAAG;GACrD,MAAM,WAAW,kBAAkB;IAClC;IACA,OAAO,iBAAiB,CAAC,CAAC;GAC3B,CAAC;GACD,QAAQ,OAAO,MAAM,GAAG,SAAS,GAAG;GACpC,QAAQ,KAAK,CAAC;EACf;CACD;AACD;AACA,QAAQ,MAAM"}
1
+ {"version":3,"file":"bin__prisma-next.mjs","names":["isCI"],"sources":["../../../../1-framework/3-tooling/cli/dist/package-QGxf-71P.mjs","../../../../1-framework/3-tooling/cli/dist/code-templates-D_dhXHNG.mjs","../../../../1-framework/3-tooling/cli/dist/cli.mjs"],"sourcesContent":["//#region package.json\nvar version = \"8.0.0-rc.1-dev.38\";\n//#endregion\nexport { version as t };\n\n//# sourceMappingURL=package-QGxf-71P.mjs.map","import { createScaffoldSpecifierResolver } from \"@internal/publish-surface/import-roots\";\nimport { DEFAULT_CONTRACT_SOURCE_DIR } from \"@internal/config/config-types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\n//#region src/commands/init/templates/code-templates.ts\n/**\n* The resolver a scaffold for `target` is written against.\n*\n* A scaffold is always on the facade root: `init` writes an application around\n* one database package, and the workspace names are not published, so a project\n* scaffolded against them could not install (ADR 242). Both the files `init`\n* writes and the dependency it adds go through this, so they cannot disagree.\n*/\nfunction scaffoldSpecifierResolverFor(target) {\n\treturn createScaffoldSpecifierResolver({\n\t\tmode: \"facade\",\n\t\tfacade: target === \"postgres\" ? \"@prisma/orm-postgres\" : \"@prisma/orm-mongo\"\n\t});\n}\n/**\n* The package name a scaffolded project depends on and imports from, for the\n* import root it is being scaffolded against.\n*\n* Every specifier the scaffold writes derives from this one, and `init` builds\n* a single resolver and hands it to both the file templates and the dependency\n* it installs — so the two cannot disagree. The one caller that deliberately\n* does not thread a resolver is the re-init cleanup in `inputs.ts`, which\n* inspects a manifest an earlier run wrote rather than writing one.\n*\n* Resolvers for scaffolding should come from `createScaffoldSpecifierResolver`\n* in the publish-surface package, which rejects the roots a facade-shaped\n* scaffold cannot express. (Named without its scope on purpose: JSDoc survives\n* into the published bundle, where an internal package name would trip the\n* shell tarball checks.)\n*/\nfunction targetPackageName(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\");\n}\n/** One entrypoint of the scaffolded project's target package. */\nfunction targetEntrypoint(target, subpath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(`${target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\"}/${subpath}`);\n}\nfunction targetLabel(target) {\n\treturn target === \"postgres\" ? \"PostgreSQL\" : \"MongoDB\";\n}\nfunction defaultSchemaPath(authoring) {\n\tif (authoring === \"typescript\") return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.ts`;\n\treturn `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.prisma`;\n}\nfunction starterSchema(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? starterSchemaTsMongo(builder) : starterSchemaTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? starterSchemaPslMongo() : starterSchemaPslPostgres();\n}\n/**\n* Renders a short authoring-appropriate schema sample (FR5.1) for embedding\n* in `prisma-next.md`. Returns a complete fenced markdown code block.\n*\n* The sample intentionally shows just one model: it's illustrative, not\n* a substitute for the full scaffolded contract file. The TS samples use\n* the same outer shape as `starterSchemaTs*` (FR5.3) so a user reading\n* the doc and the file side-by-side sees the same structure.\n*/\nfunction schemaSample(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? schemaSampleTsMongo(builder) : schemaSampleTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? schemaSamplePslMongo() : schemaSamplePslPostgres();\n}\nfunction schemaSamplePslPostgres() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n}\n\\`\\`\\``;\n}\nfunction schemaSamplePslMongo() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n @@map(\"users\")\n}\n\\`\\`\\``;\n}\nfunction schemaSampleTsPostgres(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction schemaSampleTsMongo(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction starterSchemaPslPostgres() {\n\treturn `// use prisma-next\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n posts Post[]\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId Int\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n`;\n}\nfunction starterSchemaPslMongo() {\n\treturn `// use prisma-next\n\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n posts Post[]\n @@map(\"users\")\n}\n\nmodel Post {\n id ObjectId @id @map(\"_id\")\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId ObjectId\n @@map(\"posts\")\n}\n`;\n}\nfunction starterSchemaTsPostgres(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n posts: rel.hasMany('Post', { by: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n fields: {\n id: field.id.uuidv7String(),\n title: field.text(),\n content: field.text().optional(),\n authorId: field.uuidString(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: 'id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction starterSchemaTsMongo(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n relations: {\n posts: rel.hasMany('Post', { from: '_id', to: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n collection: 'posts',\n fields: {\n _id: field.objectId(),\n title: field.string(),\n content: field.string().optional(),\n authorId: field.objectId(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: '_id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction configFile(target, contractPath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn `import 'dotenv/config';\nimport { defineConfig } from '${targetEntrypoint(target, \"config\", resolveImportSpecifier)}';\n\nexport default defineConfig({\n contract: ${JSON.stringify(contractPath)},\n db: {\n connection: process.env['DATABASE_URL']!,\n },\n});\n`;\n}\nfunction dbFile(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst runtime = targetEntrypoint(target, \"runtime\", resolveImportSpecifier);\n\tif (target === \"postgres\") return `import postgres from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = postgres<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n\treturn `import mongo from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = mongo<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n}\n//#endregion\nexport { schemaSample as a, targetLabel as c, scaffoldSpecifierResolverFor as i, targetPackageName as l, dbFile as n, starterSchema as o, defaultSchemaPath as r, targetEntrypoint as s, configFile as t };\n\n//# sourceMappingURL=code-templates-D_dhXHNG.mjs.map","#!/usr/bin/env node\nimport { t as version } from \"./package-QGxf-71P.mjs\";\nimport { f as BIN_NAME, n as installShutdownHandlers } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { _ as parseGlobalFlagsOrExit, b as formatCommandHelp, d as setCommandExamples, g as parseGlobalFlags, h as deriveCanPrompt, t as addGlobalOptions, u as setCommandDescriptions, x as formatRootHelp, y as isCI } from \"./command-helpers-CwLvFwMB.mjs\";\nimport { t as createContractEmitCommand } from \"./contract-emit-BQFpcb2A.mjs\";\nimport { t as createContractInferCommand } from \"./contract-infer-C6cYOihE.mjs\";\nimport { r as defaultSchemaPath } from \"./code-templates-D_dhXHNG.mjs\";\nimport { t as createDbInitCommand } from \"./db-init-DypCy1e3.mjs\";\nimport { t as createDbSchemaCommand } from \"./db-schema-DHfPM-5V.mjs\";\nimport { t as createDbSignCommand } from \"./db-sign-DbAxRcZh.mjs\";\nimport { t as createDbUpdateCommand } from \"./db-update-J59yROwL.mjs\";\nimport { t as createDbVerifyCommand } from \"./db-verify-0TpDMziA.mjs\";\nimport { t as createFormatCommand } from \"./format-cbJY7l6v.mjs\";\nimport { t as createMigrateCommand } from \"./migrate-CgSnzAUm.mjs\";\nimport { t as createMigrationCheckCommand } from \"./migration-check-BVK9vfan.mjs\";\nimport { t as createMigrationGraphCommand } from \"./migration-graph-D2dbLCkl.mjs\";\nimport { t as createMigrationListCommand } from \"./migration-list-DCx0KOFp.mjs\";\nimport { t as createMigrationLogCommand } from \"./migration-log-CJ6_9_uj.mjs\";\nimport { t as createMigrationNewCommand } from \"./migration-new-CXLgOLXz.mjs\";\nimport { t as createMigrationPlanCommand } from \"./migration-plan-BxfF1Hdo.mjs\";\nimport { t as createMigrationShowCommand } from \"./migration-show-Dhnlx_GU.mjs\";\nimport { r as createMigrationStatusCommand } from \"./migration-status-S88DjM8c.mjs\";\nimport { t as createRefCommand } from \"./ref-gZQjdz8I.mjs\";\nimport { t as createTelemetryCommand } from \"./telemetry-DPXFYAsz.mjs\";\nimport { Command } from \"commander\";\nimport { ensureInstallationId, readUserConfig, resolveGating, runTelemetry, userConfigPath } from \"@internal/cli-telemetry\";\nimport { distance } from \"closest-match\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/commands/init/index.ts\nfunction createInitCommand() {\n\tconst command = new Command(\"init\");\n\tsetCommandDescriptions(command, \"Initialize a new Prisma Next project\", `Scaffolds config, schema, and runtime files, installs dependencies,\nand emits the contract. Gets you from zero to typed queries in one step.\n\nRun interactively for a guided experience, or supply --target / --authoring\nand --yes for a fully scriptable run (CI, AI coding agents, automation).\n\nExit codes (see CLI Style Guide § Exit Codes):\n 0 OK Init succeeded.\\n 1 INTERNAL_ERROR Unexpected bug in prisma-next (please report).\\n 2 PRECONDITION Bad flags / missing prerequisite (e.g. no package.json).\\n 3 USER_ABORTED User cancelled an interactive prompt.\\n 4 INSTALL_FAILED Dependency installation failed (init-specific).\\n 5 EMIT_FAILED \\`contract emit\\` failed after install (init-specific).\\n 6 SKILL_INSTALL_FAILED Agent-skill install failed (re-run with --no-skill to skip).`);\n\tsetCommandExamples(command, [\n\t\t\"prisma-next init\",\n\t\t\"prisma-next init --yes --target postgres --authoring psl\",\n\t\t\"prisma-next init --yes --target mongodb --authoring typescript --json\",\n\t\t\"prisma-next init --yes --force --target postgres --authoring psl # overwrite an existing scaffold\",\n\t\t\"prisma-next init --no-install # skip pnpm/npm install + emit\",\n\t\t\"prisma-next init --no-skill # skip the skills install (air-gapped / restricted env)\"\n\t]);\n\treturn addGlobalOptions(command).option(\"--target <db>\", \"Database target: postgres or mongodb\").option(\"--authoring <style>\", \"Schema authoring style: psl or typescript\").option(\"--schema-path <path>\", `Where to write the starter schema (default: ${defaultSchemaPath(\"psl\")})`).option(\"--force\", \"Overwrite an existing scaffold without prompting\").option(\"--write-env\", \"Write a .env file from .env.example (gitignored; default: only .env.example)\").option(\"--probe-db\", \"Connect to DATABASE_URL once and check the server version against the target minimum (opt-in; off by default)\").option(\"--strict-probe\", \"Treat a failed --probe-db as fatal (no-op without --probe-db; init is offline-by-default)\").option(\"--no-install\", \"Skip dependency installation and contract emission\").option(\"--no-skill\", \"Skip Prisma Next skills install (air-gapped CI, restricted registries, etc.)\").action(async (options) => {\n\t\tconst { runInit } = await import(\"./init-Bco4QkKJ.mjs\");\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst canPrompt = deriveCanPrompt({\n\t\t\tflagsInteractive: flags.interactive,\n\t\t\toptionInteractive: options.interactive,\n\t\t\tstdinIsTTY: Boolean(process.stdin.isTTY)\n\t\t});\n\t\tconst exitCode = await runInit(process.cwd(), {\n\t\t\toptions,\n\t\t\tflags,\n\t\t\tcanPrompt\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n}\n//#endregion\n//#region src/commands/lsp.ts\nfunction createLspCommand() {\n\tconst command = new Command(\"lsp\");\n\tsetCommandDescriptions(command, \"Start the Prisma Next language server\", \"Launches a Language Server Protocol server that publishes PSL parse diagnostics\\nand handles whole-document PSL formatting for the schema inputs declared in\\nyour config (contract.source.inputs). Formatting uses the Prisma Next PSL\\nformatter and the formatter block from the project config.\\nCommunicates over stdio; intended to be spawned by an\\neditor, not run interactively. The server keeps running until the editor client\\ndisconnects.\");\n\tsetCommandExamples(command, [\"prisma-next lsp --stdio\"]);\n\taddGlobalOptions(command).option(\"--stdio\", \"Communicate with the editor over stdio (the default and only transport)\").action(async () => {\n\t\tconst { startServer } = await import(\"@internal/language-server\");\n\t\tstartServer();\n\t});\n\treturn command;\n}\n//#endregion\n//#region src/utils/suggest-command.ts\n/**\n* Suggests similar command names for a mistyped input.\n*\n* Uses Levenshtein distance to find close matches. Only suggests commands\n* within a reasonable distance threshold (40% of the input length, minimum 2).\n* Returns up to 3 suggestions in case of ties.\n*\n* @returns Array of suggested command names (empty if nothing is close enough).\n*/\nfunction suggestCommands(input, candidates) {\n\tif (candidates.length === 0) return [];\n\tconst maxDistance = Math.max(2, Math.ceil(input.length * .4));\n\tconst scored = candidates.map((name) => ({\n\t\tname,\n\t\tdist: distance(input, name)\n\t})).filter((entry) => entry.dist <= maxDistance).sort((a, b) => a.dist - b.dist);\n\tif (scored.length === 0) return [];\n\tconst bestDist = scored[0].dist;\n\treturn scored.filter((entry) => entry.dist === bestDist).slice(0, 3).map((entry) => entry.name);\n}\n//#endregion\n//#region src/utils/telemetry.ts\n/**\n* Resolve the commander command path from a leaf `Command`, walking up\n* the parent chain. Result is rooted at the program name and ends at\n* the leaf — `['prisma-next', 'migration', 'new']` for\n* `prisma-next migration new …`.\n*/\nfunction commandPathFor(actionCommand) {\n\tconst path = [];\n\tlet cursor = actionCommand;\n\twhile (cursor !== null) {\n\t\tpath.unshift(cursor.name());\n\t\tcursor = cursor.parent;\n\t}\n\treturn path;\n}\nfunction commanderOptionSnapshots(actionCommand) {\n\treturn actionCommand.options.map((option) => {\n\t\tconst attributeName = option.attributeName();\n\t\treturn {\n\t\t\tattributeName,\n\t\t\tlongName: option.long ?? null,\n\t\t\tsource: actionCommand.getOptionValueSource(attributeName) ?? null\n\t\t};\n\t});\n}\n/**\n* Project commander's leaf `Command` into the wire-shape snapshot the\n* telemetry sanitiser consumes. Pure projection — no env, no I/O.\n*/\nfunction commanderSnapshotForTelemetry(actionCommand) {\n\treturn {\n\t\tcommandPath: commandPathFor(actionCommand),\n\t\tpositionalArgs: actionCommand.args,\n\t\toptions: commanderOptionSnapshots(actionCommand)\n\t};\n}\nfunction resolveTelemetryGate() {\n\tif (isCI()) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"ci\"\n\t\t}\n\t};\n\tconst userConfig = readUserConfig();\n\tif (!resolveGating({\n\t\tenv: process.env,\n\t\tconfig: userConfig\n\t}).enabled) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"gated-off\"\n\t\t}\n\t};\n\treturn {\n\t\tenabled: true,\n\t\tuserConfig\n\t};\n}\n/**\n* Path to the compiled sender script inside `@internal/cli-telemetry`'s\n* `dist/`. Resolved off this module's `import.meta.url` via the package\n* specifier `@internal/cli-telemetry/sender`, so the consumer pays\n* no attention to internal package layout.\n*/\nfunction senderPath() {\n\treturn fileURLToPath(new URL(import.meta.resolve(\"@internal/cli-telemetry/sender\")));\n}\nfunction fireTelemetry(actionCommand, userConfig) {\n\treturn runTelemetry({\n\t\tcommand: commanderSnapshotForTelemetry(actionCommand),\n\t\tversion,\n\t\tprojectRoot: process.cwd(),\n\t\tsenderPath: senderPath(),\n\t\tisCI: isCI(),\n\t\tenv: process.env,\n\t\tuserConfig\n\t});\n}\n/**\n* preAction-stage entry point. Synchronous by construction: resolve\n* env/CI/user-consent gates (cheap, all in-memory and a single tiny\n* user-config read), then — only when enabled — `fork()` the detached\n* sender script. The forked child loads `prisma-next.config.*` via\n* c12 on its own (see `loadProjectConfig` in cli-telemetry); the\n* parent does no project-config I/O on the command's hot path.\n*\n* Privacy invariant: gate resolution always happens before any project\n* config touches disk. The child loading user TS code is acceptable\n* only because it's gated behind the same resolved-enabled signal.\n*/\n/**\n* Builds the one-time first-run disclosure. The resolved absolute path to\n* the user-level config file is substituted in so the user can see exactly\n* which file to edit (it must not be confused with `prisma-next.config.ts`).\n* `prisma-next telemetry disable` is named as the primary, friendliest\n* opt-out, alongside the env vars and the config edit.\n*/\nfunction firstRunNotice(configPath) {\n\treturn [\n\t\t\"Prisma Next collects anonymous CLI usage data, enabled by default.\",\n\t\t\"What's collected and why: https://prisma-next.dev/docs/cli/telemetry.\",\n\t\t\"Opt out: run \\\"prisma-next telemetry disable\\\", set DO_NOT_TRACK=1 or\",\n\t\t`PRISMA_NEXT_DISABLE_TELEMETRY=1, or set \"enableTelemetry\": false in ${configPath}.`\n\t].join(\" \");\n}\n/**\n* Best-effort first-run disclosure + installationId mint. Runs only on the\n* gating-enabled path. Prints the notice to stderr (never stdout) and mints\n* a persistent id without touching `enableTelemetry`, so the opt-out default\n* stays intact and no unasked-for consent is recorded.\n*\n* Every step is wrapped so an un-writable config dir (or any other failure)\n* never throws and never blocks the command. Returns the minted (or\n* pre-existing) id so the caller can forward it to `runTelemetry` without a\n* redundant disk read. On mint failure it returns `undefined`: the notice may\n* reprint next run, and `runTelemetry` no-ops on the missing id.\n*/\nfunction discloseAndMintOnFirstRun() {\n\ttry {\n\t\tprocess.stderr.write(`${firstRunNotice(userConfigPath())}\\n`);\n\t} catch {}\n\ttry {\n\t\treturn ensureInstallationId();\n\t} catch {}\n}\n/**\n* True when the run is the `telemetry` command (or one of its\n* subcommands). The usage-telemetry preAction fire is exempted for it:\n* it would be absurd for `telemetry disable` to send a usage event before\n* disabling, or for `telemetry status` to mint an id + send while merely\n* reporting state. This is the only command-specific exemption.\n*\n* The check is rooted at the program: the path must be\n* `['prisma-next', 'telemetry', …]`, so it matches the top-level\n* `telemetry` command and its subcommands without matching a hypothetical\n* nested `… telemetry` elsewhere.\n*/\nfunction isTelemetryCommand(actionCommand) {\n\treturn commandPathFor(actionCommand)[1] === \"telemetry\";\n}\nfunction fireTelemetryFromPreAction(actionCommand) {\n\tif (isTelemetryCommand(actionCommand)) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst gate = resolveTelemetryGate();\n\tif (!gate.enabled) return gate.outcome;\n\tconst storedId = gate.userConfig.installationId;\n\tif (typeof storedId !== \"string\" || storedId.length === 0) {\n\t\tconst installationId = discloseAndMintOnFirstRun();\n\t\treturn fireTelemetry(actionCommand, installationId === void 0 ? gate.userConfig : {\n\t\t\t...gate.userConfig,\n\t\t\tinstallationId\n\t\t});\n\t}\n\treturn fireTelemetry(actionCommand, gate.userConfig);\n}\n//#endregion\n//#region src/cli.ts\ninstallShutdownHandlers();\n/**\n* Lookup table mapping removed subcommands to their replacement verbs.\n* Keyed by `<parent>:<subcommand>` (e.g. `migration:apply`).\n* The handler consults this before falling back to the fuzzy suggest engine.\n*/\nconst removedVerbRedirects = {\n\t\"migration:apply\": \"Use `prisma-next migrate --to <contract>` instead.\",\n\t\"migration:ref\": \"Use `prisma-next ref set|list|delete` instead.\"\n};\n/**\n* Removed flags on specific subcommands. Keyed by `<parent>:<sub>:<flag>`.\n* Checked during the pre-parse argv scan before commander sees the flags.\n*/\nconst removedFlagRedirects = {\n\t\"migration:status:graph\": \"Use `prisma-next migration graph` to view the migration graph.\",\n\t\"migration:status:all\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:limit\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:ref\": \"Use `--to <contract>` instead of `--ref`.\"\n};\n/**\n* Formats the \"Did you mean ...?\" hint for an unknown command.\n*/\nfunction formatSuggestion(input, candidates) {\n\tconst suggestions = suggestCommands(input, candidates.map((c) => c));\n\tif (suggestions.length === 0) return \"\";\n\tif (suggestions.length === 1) return `\\nDid you mean ${suggestions[0]}?\\n`;\n\treturn `\\nDid you mean one of these?\\n${suggestions.map((s) => ` ${s}`).join(\"\\n\")}\\n`;\n}\nconst program = new Command();\nprogram.name(BIN_NAME).description(\"Prisma Next CLI\").version(version);\nprogram.hook(\"preAction\", (_thisCommand, actionCommand) => {\n\ttry {\n\t\tfireTelemetryFromPreAction(actionCommand);\n\t} catch {}\n});\nconst versionOption = program.options.find((opt) => opt.flags.includes(\"--version\"));\nif (versionOption) versionOption.description = \"Output the version number\";\nprogram.configureOutput({\n\twriteErr: () => {},\n\twriteOut: (str) => {\n\t\tprocess.stdout.write(str);\n\t}\n});\nconst rootHelpFormatter = (cmd) => {\n\treturn formatRootHelp({\n\t\tprogram: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n};\nprogram.configureHelp({\n\tformatHelp: rootHelpFormatter,\n\tsubcommandDescription: () => \"\"\n});\nprogram.exitOverride((err) => {\n\tif (err) {\n\t\tconst errorCode = err.code;\n\t\tconst errorMessage = String(err.message ?? \"\");\n\t\tconst errorName = err.name ?? \"\";\n\t\tif (errorCode === \"commander.unknownCommand\" || errorCode === \"commander.unknownArgument\" || errorName === \"CommanderError\" && (errorMessage.includes(\"unknown command\") || errorMessage.includes(\"unknown argument\"))) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst match = errorMessage.match(/unknown command ['\"]([^'\"]+)['\"]/);\n\t\t\tconst commandName = match ? match[1] : process.argv[3] || process.argv[2] || \"unknown\";\n\t\t\tconst firstArg = process.argv[2];\n\t\t\tconst parentCommand = firstArg ? program.commands.find((cmd) => cmd.name() === firstArg) : void 0;\n\t\t\tif (parentCommand && commandName !== firstArg) {\n\t\t\t\tconst subNames = parentCommand.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, subNames)}\\n`);\n\t\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\t\tcommand: parentCommand,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t} else {\n\t\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\t\tconst helpText = formatRootHelp({\n\t\t\t\t\tprogram,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t}\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.help\" || errorCode === \"commander.helpDisplayed\" || errorCode === \"outputHelp\" || errorMessage === \"(outputHelp)\" || errorMessage.includes(\"outputHelp\") || errorName === \"CommanderError\" && errorMessage.includes(\"outputHelp\")) {\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.missingArgument\" || errorCode === \"commander.missingMandatoryOptionValue\" || errorName === \"CommanderError\" && (errorMessage.includes(\"missing\") || errorMessage.includes(\"required\"))) {\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tprocess.stderr.write(`Unhandled error: ${err.message}\\n`);\n\t\tif (err.stack) process.stderr.write(`${err.stack}\\n`);\n\t\tprocess.exit(1);\n\t}\n\tprocess.exit(0);\n});\nconst contractCommand = new Command(\"contract\");\nsetCommandDescriptions(contractCommand, \"Contract management commands\", \"Define and emit your application data contract. The contract describes your schema as a\\ndeclarative data structure that can be signed and verified against your database.\");\ncontractCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst contractEmitCommand = createContractEmitCommand();\ncontractCommand.addCommand(contractEmitCommand);\nconst contractInferCommand = createContractInferCommand();\ncontractCommand.addCommand(contractInferCommand);\nconst dbCommand = new Command(\"db\");\nsetCommandDescriptions(dbCommand, \"Database management commands\", \"Verify and sign your database with your contract. Ensure your database schema matches\\nyour contract, and sign it to record the contract hash for future verification.\");\ndbCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst dbVerifyCommand = createDbVerifyCommand();\ndbCommand.addCommand(dbVerifyCommand);\nconst dbInitCommand = createDbInitCommand();\ndbCommand.addCommand(dbInitCommand);\nconst dbUpdateCommand = createDbUpdateCommand();\ndbCommand.addCommand(dbUpdateCommand);\nconst dbSchemaCommand = createDbSchemaCommand();\ndbCommand.addCommand(dbSchemaCommand);\nconst dbSignCommand = createDbSignCommand();\ndbCommand.addCommand(dbSignCommand);\nconst migrationCommand = new Command(\"migration\");\nsetCommandDescriptions(migrationCommand, \"On-disk migration management commands\", \"Plan, apply, and scaffold on-disk migration packages. Migrations are\\ncontract-to-contract edges stored as versioned directories under migrations/.\");\nmigrationCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst migrationPlanCommand = createMigrationPlanCommand();\nmigrationCommand.addCommand(migrationPlanCommand);\nconst migrationNewCommand = createMigrationNewCommand();\nmigrationCommand.addCommand(migrationNewCommand);\nconst migrationShowCommand = createMigrationShowCommand();\nmigrationCommand.addCommand(migrationShowCommand);\nconst migrationStatusCommand = createMigrationStatusCommand();\nmigrationCommand.addCommand(migrationStatusCommand);\nconst migrationLogCommand = createMigrationLogCommand();\nmigrationCommand.addCommand(migrationLogCommand);\nconst migrationListCommand = createMigrationListCommand();\nmigrationCommand.addCommand(migrationListCommand);\nconst migrationGraphCommand = createMigrationGraphCommand();\nmigrationCommand.addCommand(migrationGraphCommand);\nconst migrationCheckCommand = createMigrationCheckCommand();\nmigrationCommand.addCommand(migrationCheckCommand);\nconst migrateCommand = createMigrateCommand();\nconst refCommand = createRefCommand();\nconst telemetryCommand = createTelemetryCommand();\nconst initCommand = createInitCommand();\nconst formatCommand = createFormatCommand();\nconst lspCommand = createLspCommand();\nprogram.addCommand(initCommand);\nprogram.addCommand(migrateCommand);\nprogram.addCommand(formatCommand);\nprogram.addCommand(lspCommand);\nprogram.addCommand(contractCommand);\nprogram.addCommand(dbCommand);\nprogram.addCommand(migrationCommand);\nprogram.addCommand(refCommand);\nprogram.addCommand(telemetryCommand);\nconst TELEMETRY_CRASH_TEST_SLEEP_MS = 200;\nif (process.env[\"PRISMA_NEXT_ENABLE_TEST_COMMANDS\"] === \"1\") {\n\tconst telemetryCrashTestCommand = new Command(\"__telemetry-crash-test\").description(\"Internal: deliberately throw for the telemetry e2e suite.\").action(async () => {\n\t\tawait new Promise((settle) => setTimeout(settle, TELEMETRY_CRASH_TEST_SLEEP_MS));\n\t\tthrow new Error(\"__telemetry-crash-test: intentional crash for e2e coverage\");\n\t});\n\ttelemetryCrashTestCommand.configureHelp({ visibleCommands: () => [] });\n\tprogram.addCommand(telemetryCrashTestCommand, { hidden: true });\n}\nconst helpCommand = new Command(\"help\").description(\"Show usage instructions\").configureHelp({ formatHelp: (cmd) => {\n\treturn formatCommandHelp({\n\t\tcommand: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n} }).action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stdout.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nprogram.addCommand(helpCommand);\nprogram.action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stderr.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nconst args = process.argv.slice(2);\nif (args.length > 0) {\n\tconst commandName = args[0];\n\tif (commandName === \"--version\" || commandName === \"-V\") {\n\t\tprocess.stdout.write(`${program.version()}\\n`);\n\t\tprocess.exit(0);\n\t}\n\tif (!(commandName === \"--help\" || commandName === \"-h\")) {\n\t\tconst command = program.commands.find((cmd) => cmd.name() === commandName);\n\t\tif (!command) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\tconst helpText = formatRootHelp({\n\t\t\t\tprogram,\n\t\t\t\tflags\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(2);\n\t\t} else if (command.commands.length > 0 && args.length >= 2) {\n\t\t\tconst subcommandName = args[1];\n\t\t\tconst redirect = removedVerbRedirects[`${commandName}:${subcommandName}`];\n\t\t\tif (redirect) {\n\t\t\t\tprocess.stderr.write(`Unknown command: ${subcommandName}\\n${redirect}\\n`);\n\t\t\t\tprocess.exit(2);\n\t\t\t}\n\t\t\tfor (let i = 2; i < args.length; i++) {\n\t\t\t\tconst arg = args[i];\n\t\t\t\tif (!arg.startsWith(\"--\")) continue;\n\t\t\t\tconst flagRedirect = removedFlagRedirects[`${commandName}:${subcommandName}:${arg.slice(2)}`];\n\t\t\t\tif (flagRedirect) {\n\t\t\t\t\tprocess.stderr.write(`Unknown option: ${arg}\\n${flagRedirect}\\n`);\n\t\t\t\t\tprocess.exit(2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (command.commands.length > 0 && args.length === 1) {\n\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\tcommand,\n\t\t\t\tflags: parseGlobalFlags({})\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(0);\n\t\t}\n\t}\n}\nprogram.parse();\n//#endregion\nexport {};\n\n//# sourceMappingURL=cli.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAI,UAAU;;;;;;;;;;;ACWd,SAAS,6BAA6B,QAAQ;CAC7C,OAAO,gCAAgC;EACtC,MAAM;EACN,QAAQ,WAAW,aAAa,yBAAyB;CAC1D,CAAC;AACF;;;;;;;;;;;;;;;;;AAiBA,SAAS,kBAAkB,QAAQ,yBAAyB,wBAAwB;CACnF,OAAO,uBAAuB,WAAW,aAAa,uBAAuB,iBAAiB;AAC/F;;AAEA,SAAS,iBAAiB,QAAQ,SAAS,yBAAyB,wBAAwB;CAC3F,OAAO,uBAAuB,GAAG,WAAW,aAAa,uBAAuB,kBAAkB,GAAG,SAAS;AAC/G;AACA,SAAS,YAAY,QAAQ;CAC5B,OAAO,WAAW,aAAa,eAAe;AAC/C;AACA,SAAS,kBAAkB,WAAW;CACrC,IAAI,cAAc,cAAc,OAAO,GAAG,4BAA4B;CACtE,OAAO,GAAG,4BAA4B;AACvC;AACA,SAAS,cAAc,QAAQ,WAAW,yBAAyB,wBAAwB;CAC1F,IAAI,cAAc,cAAc;EAC/B,MAAM,UAAU,iBAAiB,QAAQ,oBAAoB,sBAAsB;EACnF,OAAO,WAAW,UAAU,qBAAqB,OAAO,IAAI,wBAAwB,OAAO;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AAK;GAC5B,MAAM,WAAW,qBAAqB,GAAG,YAAY,GAAG;GACxD,IAAI,UAAU;IACb,QAAQ,OAAO,MAAM,oBAAoB,eAAe,IAAI,SAAS,GAAG;IACxE,QAAQ,KAAK,CAAC;GACf;GACA,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;IACrC,MAAM,MAAM,KAAK;IACjB,IAAI,CAAC,IAAI,WAAW,IAAI,GAAG;IAC3B,MAAM,eAAe,qBAAqB,GAAG,YAAY,GAAG,eAAe,GAAG,IAAI,MAAM,CAAC;IACzF,IAAI,cAAc;KACjB,QAAQ,OAAO,MAAM,mBAAmB,IAAI,IAAI,aAAa,GAAG;KAChE,QAAQ,KAAK,CAAC;IACf;GACD;EACD;EACA,IAAI,QAAQ,SAAS,SAAS,KAAK,KAAK,WAAW,GAAG;GACrD,MAAM,WAAW,kBAAkB;IAClC;IACA,OAAO,iBAAiB,CAAC,CAAC;GAC3B,CAAC;GACD,QAAQ,OAAO,MAAM,GAAG,SAAS,GAAG;GACpC,QAAQ,KAAK,CAAC;EACf;CACD;AACD;AACA,QAAQ,MAAM"}
@@ -1,5 +1,5 @@
1
- import { t as CliStructuredError$1 } from "./cli-errors-C6_pH59O-CzD4SYcJ.mjs";
2
- //#region ../../../1-framework/3-tooling/cli/dist/caught-errors-BZ-9WASe.mjs
1
+ import { t as CliStructuredError$1 } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
2
+ //#region ../../../1-framework/3-tooling/cli/dist/caught-errors-DLPzfzIW.mjs
3
3
  /**
4
4
  * Classifies errors caught around migration-tools calls so commands never import the MigrationToolsError class directly.
5
5
  */
@@ -11,4 +11,4 @@ function mapCaughtMigrationError(error) {
11
11
  //#endregion
12
12
  export { mapCaughtMigrationError as t };
13
13
 
14
- //# sourceMappingURL=caught-errors-BZ-9WASe-DH4DaDha.mjs.map
14
+ //# sourceMappingURL=caught-errors-DLPzfzIW-CQ9BoXD-.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"caught-errors-BZ-9WASe-DH4DaDha.mjs","names":["CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/caught-errors-BZ-9WASe.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./cli-errors-C6_pH59O.mjs\";\n//#region src/control-api/operations/caught-errors.ts\n/**\n* Classifies errors caught around migration-tools calls so commands never import the MigrationToolsError class directly.\n*/\n/** CliStructuredError (including MigrationToolsError) → identity; anything else → null (caller rethrows/wraps). */\nfunction mapCaughtMigrationError(error) {\n\tif (CliStructuredError.is(error)) return error;\n\treturn null;\n}\n//#endregion\nexport { mapCaughtMigrationError as t };\n\n//# sourceMappingURL=caught-errors-BZ-9WASe.mjs.map"],"mappings":";;;;;;AAMA,SAAS,wBAAwB,OAAO;CACvC,IAAIA,qBAAmB,GAAG,KAAK,GAAG,OAAO;CACzC,OAAO;AACR"}
1
+ {"version":3,"file":"caught-errors-DLPzfzIW-CQ9BoXD-.mjs","names":["CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/caught-errors-DLPzfzIW.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./cli-errors-BG6bItjG.mjs\";\n//#region src/control-api/operations/caught-errors.ts\n/**\n* Classifies errors caught around migration-tools calls so commands never import the MigrationToolsError class directly.\n*/\n/** CliStructuredError (including MigrationToolsError) → identity; anything else → null (caller rethrows/wraps). */\nfunction mapCaughtMigrationError(error) {\n\tif (CliStructuredError.is(error)) return error;\n\treturn null;\n}\n//#endregion\nexport { mapCaughtMigrationError as t };\n\n//# sourceMappingURL=caught-errors-DLPzfzIW.mjs.map"],"mappings":";;;;;;AAMA,SAAS,wBAAwB,OAAO;CACvC,IAAIA,qBAAmB,GAAG,KAAK,GAAG,OAAO;CACzC,OAAO;AACR"}
@@ -1,8 +1,8 @@
1
1
  import { CliStructuredError as CliStructuredError$1, errorConfigValidation as errorConfigValidation$1, errorContractConfigMissing as errorContractConfigMissing$1, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorFileNotFound, errorInvalidOutputFormat, errorMigrationPlanningFailed, errorOutputFormatMutex, errorTargetMigrationNotSupported, errorUnexpected } from "@prisma/orm-framework/errors/control";
2
2
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
3
- import { ERROR_CODE_DESTRUCTIVE_CHANGES, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorRunnerFailed, errorRuntime as errorRuntime$1, errorTargetMismatch } from "@prisma/orm-framework/errors/execution";
3
+ import { ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorRunnerFailed, errorRuntime as errorRuntime$1, errorTargetMismatch } from "@prisma/orm-framework/errors/execution";
4
4
  import "@prisma/orm-framework/errors/migration";
5
- //#region ../../../1-framework/3-tooling/cli/dist/cli-errors-C6_pH59O.mjs
5
+ //#region ../../../1-framework/3-tooling/cli/dist/cli-errors-BG6bItjG.mjs
6
6
  /**
7
7
  * The typed remediation the CLI attaches to its own errors and findings.
8
8
  * Constructors live here rather than in any library the CLI calls: naming a
@@ -325,6 +325,6 @@ function mapRefResolutionError(error) {
325
325
  }
326
326
  }
327
327
  //#endregion
328
- export { errorSpaceNotFound as A, errorPlanForgotTheFlag as C, errorRunnerFailed as D, errorRefSetHashNotInGraph as E, requireLiveDatabase as F, runCommandAction as I, errorTargetMismatch as M, errorUnexpected as N, errorRuntime$1 as O, mapRefResolutionError as P, errorPathUnreachable as S, errorRefSetEmptySentinel as T, errorMarkerMissing as _, errorConfigValidation$1 as a, errorNoMigrations as b, errorDatabaseConnectionRequired as c, errorFileNotFound as d, errorHashMismatch as f, errorMarkerMismatch as g, errorLegendHumanOnly as h, errorAmbiguousMigrationRef as i, errorTargetMigrationNotSupported as j, errorSnapshotMissing as k, errorDestructiveChanges as l, errorInvalidSpaceId as m, ERROR_CODE_DESTRUCTIVE_CHANGES as n, errorContractConfigMissing$1 as o, errorInvalidOutputFormat as p, chooseAction as r, errorContractValidationFailed as s, CliStructuredError$1 as t, errorDriverRequired as u, errorMigrationPackageNotFound as v, errorRefSetBundleNotFound as w, errorOutputFormatMutex as x, errorMigrationPlanningFailed as y };
328
+ export { errorSnapshotMissing as A, errorPathUnreachable as C, errorRefSetHashNotInGraph as D, errorRefSetEmptySentinel as E, mapRefResolutionError as F, requireLiveDatabase as I, runCommandAction as L, errorTargetMigrationNotSupported as M, errorTargetMismatch as N, errorRunnerFailed as O, errorUnexpected as P, errorOutputFormatMutex as S, errorRefSetBundleNotFound as T, errorMarkerMismatch as _, errorConfigValidation$1 as a, errorMigrationPlanningFailed as b, errorContractValidationFailed as c, errorDriverRequired as d, errorFileNotFound as f, errorLegendHumanOnly as g, errorInvalidSpaceId as h, errorAmbiguousMigrationRef as i, errorSpaceNotFound as j, errorRuntime$1 as k, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, ERROR_CODE_DESTRUCTIVE_CHANGES as n, errorConsentPlanMismatch as o, errorHashMismatch as p, chooseAction as r, errorContractConfigMissing$1 as s, CliStructuredError$1 as t, errorDestructiveChanges as u, errorMarkerMissing as v, errorPlanForgotTheFlag as w, errorNoMigrations as x, errorMigrationPackageNotFound as y };
329
329
 
330
- //# sourceMappingURL=cli-errors-C6_pH59O-CzD4SYcJ.mjs.map
330
+ //# sourceMappingURL=cli-errors-BG6bItjG-DwdKIeGz.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-errors-BG6bItjG-DwdKIeGz.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/cli-errors-BG6bItjG.mjs"],"sourcesContent":["import { CliStructuredError as CliStructuredError$1, errorConfigValidation, errorContractConfigMissing as errorContractConfigMissing$1, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorFileNotFound, errorInvalidOutputFormat, errorMigrationPlanningFailed, errorOutputFormatMutex, errorTargetMigrationNotSupported, errorUnexpected } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorRunnerFailed, errorRuntime as errorRuntime$1, errorTargetMismatch } from \"@internal/errors/execution\";\nimport \"@internal/errors/migration\";\n//#region src/utils/next-actions.ts\n/**\n* The typed remediation the CLI attaches to its own errors and findings.\n* Constructors live here rather than in any library the CLI calls: naming a\n* runnable invocation is something only the CLI can do.\n*/\nfunction runCommandAction(label, command) {\n\treturn {\n\t\tkind: \"run-command\",\n\t\tlabel,\n\t\tcommand\n\t};\n}\n/** Advice the user acts on themselves — there is no command to run. */\nfunction chooseAction(label) {\n\treturn {\n\t\tkind: \"user-choice\",\n\t\tlabel\n\t};\n}\n//#endregion\n//#region src/utils/cli-errors.ts\n/**\n* A CLI-raised error that carries the typed remediation as well as the prose.\n* Only the CLI knows which invocation fixes a failure, so only errors raised\n* here spell one; the foundation classes every library also raises keep\n* carrying `code`, `why` and `fix` alone.\n*\n* Both fields are required: the `fix` prose is what the commander shell still\n* renders, and the handler boundary drops it in favour of `nextActions` when it\n* settles the engine's envelope.\n*/\nvar ActionableCliError = class extends CliStructuredError$1 {\n\tnextActions;\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t\tthis.nextActions = options.nextActions;\n\t}\n};\nfunction errorRefSetHashNotInGraph(resolvedHash, reachableHashes, graphTipHash) {\n\tconst reachableList = reachableHashes.length > 0 ? reachableHashes.join(\", \") : \"(none — migration graph is empty)\";\n\tconst fix = reachableHashes.length > 0 ? graphTipHash !== null ? `Set the ref to a graph-node hash such as ${graphTipHash}, or run \\`prisma-next migration plan\\` to extend the graph.` : \"Set the ref to a hash that appears in the migration graph.\" : \"Run `prisma-next migration plan` first.\";\n\tconst nextActions = reachableHashes.length > 0 ? graphTipHash !== null ? [chooseAction(`Set the ref to a graph-node hash such as ${graphTipHash}`), runCommandAction(\"Extend the migration graph\", \"prisma-next migration plan\")] : [chooseAction(\"Set the ref to a hash that appears in the migration graph\")] : [runCommandAction(\"Plan the first migration\", \"prisma-next migration plan\")];\n\treturn new ActionableCliError(\"MIGRATION.HASH_NOT_IN_GRAPH\", `Resolved contract hash is not in the migration graph: ${resolvedHash}`, {\n\t\twhy: reachableHashes.length > 0 ? `The migration graph reaches ${reachableList}; resolved ${resolvedHash} isn't a graph node.` : \"The migration graph is empty — no hashes reachable.\",\n\t\tfix,\n\t\tnextActions,\n\t\tmeta: {\n\t\t\tresolvedHash,\n\t\t\treachableHashes: [...reachableHashes],\n\t\t\t...graphTipHash !== null ? { graphTipHash } : {}\n\t\t}\n\t});\n}\nfunction errorRefSetEmptySentinel(hash) {\n\treturn new ActionableCliError(\"MIGRATION.REF_SET_EMPTY_SENTINEL\", `Cannot set ref to the empty-database sentinel: ${hash}`, {\n\t\twhy: \"The empty-database sentinel is a planner internal; it is not a valid ref target.\",\n\t\tfix: \"Set the ref to a contract hash from the migration graph, or use another ref name.\",\n\t\tnextActions: [chooseAction(\"Set the ref to a contract hash from the migration graph\"), chooseAction(\"Or use another ref name\")],\n\t\tmeta: { hash }\n\t});\n}\n/**\n* `--legend` was combined with a machine-readable or silent output flag.\n* The legend is human-only decoration on stderr.\n*/\nfunction errorLegendHumanOnly(conflictingFlag) {\n\treturn new ActionableCliError(\"MIGRATION.LEGEND_HUMAN_ONLY\", \"`--legend` is only available for human-readable output\", {\n\t\twhy: `\\`--legend\\` prints a glyph key to stderr and cannot be combined with ${conflictingFlag}.`,\n\t\tfix: `Omit ${conflictingFlag} to print the legend alongside the tree, or omit --legend when using ${conflictingFlag}.`,\n\t\tnextActions: [chooseAction(`Omit ${conflictingFlag} to print the legend alongside the tree`), chooseAction(`Or omit --legend when using ${conflictingFlag}`)],\n\t\tmeta: { conflictingFlag }\n\t});\n}\n/**\n* `--space <id>` was given a value that doesn't satisfy the contract-space\n* naming rule (`[a-z][a-z0-9_-]{0,63}` per `isValidSpaceId`). Fires before\n* any fs work — the input is syntactically rejected the same way an on-disk\n* directory with that name would be skipped by the enumerator.\n*/\nfunction errorInvalidSpaceId(spaceId) {\n\treturn new ActionableCliError(\"MIGRATION.INVALID_SPACE_ID\", `Invalid contract space id: ${spaceId}`, {\n\t\twhy: \"Contract space ids must match [a-z][a-z0-9_-]{0,63} (lowercase, starts with a letter, max 64 characters — the rule applied to every on-disk space directory).\",\n\t\tfix: \"Pass a space id that matches the directory naming rule, or omit --space to list every space.\",\n\t\tnextActions: [chooseAction(\"Pass a space id matching [a-z][a-z0-9_-]{0,63}\"), runCommandAction(\"Or list every space\", \"prisma-next migration list\")],\n\t\tmeta: { spaceId }\n\t});\n}\n/**\n* `migration list --space <id>` was given a contract-space id that has no\n* directory under `migrations/`. Distinct from \"the space exists but is\n* empty\" — that path renders the empty-state line and exits 0 per the\n* slice spec § Empty-state. This error fires only when `<projectMigrationsDir>/<spaceId>`\n* does not exist on disk.\n*\n* `availableSpaces` lists the contract-space directory names actually\n* present, sorted lex-asc, so the diagnostic can suggest a near match\n* without making the user reach for `ls`.\n*/\nfunction errorSpaceNotFound(spaceId, availableSpaces) {\n\tconst availableList = availableSpaces.length > 0 ? availableSpaces.join(\", \") : \"(none — no contract spaces on disk yet)\";\n\tconst fix = availableSpaces.length > 0 ? `Pick one of: ${availableList}. Run \\`prisma-next migration list\\` (no --space) to see every space's migrations.` : \"Author a migration with `prisma-next migration new` to create the first contract-space directory.\";\n\tconst nextActions = availableSpaces.length > 0 ? [chooseAction(`Pick one of: ${availableList}`), runCommandAction(\"See every space's migrations\", \"prisma-next migration list\")] : [runCommandAction(\"Author the first migration, which creates the contract-space directory\", \"prisma-next migration new\")];\n\treturn new ActionableCliError(\"MIGRATION.SPACE_NOT_FOUND\", `Unknown contract space: ${spaceId}`, {\n\t\twhy: `No directory named \"${spaceId}\" exists under the migrations root.`,\n\t\tfix,\n\t\tnextActions,\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\tavailableSpaces: [...availableSpaces]\n\t\t}\n\t});\n}\n/**\n* A `migration show` target resolved to a directory or a graph node, but no\n* on-disk package was loaded for it.\n*/\nfunction errorMigrationPackageNotFound(why) {\n\treturn new ActionableCliError(\"MIGRATION.PACKAGE_NOT_FOUND\", \"Migration package not found\", {\n\t\twhy,\n\t\tfix: \"Pass a directory name, hash prefix, or path to an on-disk app-space migration package.\",\n\t\tnextActions: [chooseAction(\"Pass a directory name, hash prefix, or path to an on-disk app-space migration package\"), runCommandAction(\"List what is on disk\", \"prisma-next migration list\")]\n\t});\n}\n/** The app space has no migration packages at all, so no target can resolve. */\nfunction errorNoMigrations(appMigrationsRelative) {\n\treturn new ActionableCliError(\"MIGRATION.NO_MIGRATIONS\", \"No migrations found\", {\n\t\twhy: `No migration packages found in ${appMigrationsRelative}`,\n\t\tfix: \"Run `prisma-next migration plan` to create a migration first.\",\n\t\tnextActions: [runCommandAction(\"Create the first migration\", \"prisma-next migration plan\")]\n\t});\n}\nfunction errorRefSetBundleNotFound(hash) {\n\treturn new ActionableCliError(\"MIGRATION.REF_SET_BUNDLE_NOT_FOUND\", `No migration bundle matches graph-node hash ${hash}`, {\n\t\twhy: `The hash is a graph node but no on-disk bundle has metadata.to = ${hash}.`,\n\t\tfix: \"Run `pnpm fixtures:check`, or re-emit the migration that produces this hash so its bundle is restored.\",\n\t\tnextActions: [runCommandAction(\"Restore the checked-in fixtures\", \"pnpm fixtures:check\"), chooseAction(\"Or re-emit the migration that produces this hash\")],\n\t\tmeta: { hash }\n\t});\n}\nfunction errorPlanForgotTheFlag(resolvedHash, reachableRefs, graphTipHash, options) {\n\tconst reachableList = reachableRefs.length > 0 ? reachableRefs.map((r) => `${r.name} (${r.hash})`).join(\", \") : \"(none)\";\n\tconst refFix = reachableRefs.length > 0 ? `Run migration plan with ${reachableRefs.map((r) => `--from ${r.name}`).join(\" or \")}.` : graphTipHash !== null ? `Run migration plan --from ${graphTipHash}.` : \"Commit pending migrations first, then run migration plan.\";\n\tconst nextActions = reachableRefs.length > 0 ? reachableRefs.map((ref) => runCommandAction(`Plan from ${ref.name}`, `prisma-next migration plan --from ${ref.name}`)) : graphTipHash !== null ? [runCommandAction(\"Plan from the graph tip\", `prisma-next migration plan --from ${graphTipHash}`)] : [chooseAction(\"Commit pending migrations first, then run migration plan\")];\n\treturn new ActionableCliError(\"MIGRATION.HASH_NOT_IN_GRAPH\", `Resolved from-hash is not in the migration graph: ${resolvedHash}`, {\n\t\twhy: `The migration graph reaches ${reachableList}; resolved ${resolvedHash} isn't a graph node.`,\n\t\tfix: refFix,\n\t\tnextActions,\n\t\tmeta: {\n\t\t\tresolvedHash,\n\t\t\treachableRefs: reachableRefs.map((r) => r.name),\n\t\t\t...graphTipHash !== null ? { graphTipHash } : {}\n\t\t},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* `viaRef: true` (the default) mirrors migration-tools' `errorRefNotResolvable`:\n* a ref name with no pointer file, where the fallback hash isn't a graph\n* node either — there's nothing to materialize a contract from.\n* `viaRef: false` is a distinct, ref-independent case: an explicit `--from\n* <hash>` that doesn't name a ref, on an empty migration graph, so there is\n* no graph node and no ref to resolve a contract through.\n*/\nfunction errorSnapshotMissing(identifier, options) {\n\tconst viaRef = options?.viaRef !== false;\n\tconst fix = viaRef ? `Create the ref with \"prisma-next ref set ${identifier} <hash>\" (or advance it via \"prisma-next db update --advance-ref ${identifier}\"), or pass a hash that is a node in the migration graph.` : `No contract source exists for hash \"${identifier}\" on an empty migration graph. Use --from with a ref name (its contract resolves through the snapshot store), or run db update first.`;\n\tconst nextActions = viaRef ? [\n\t\trunCommandAction(`Create the ref \"${identifier}\"`, `prisma-next ref set ${identifier} <hash>`),\n\t\trunCommandAction(\"Or advance it from the database\", `prisma-next db update --advance-ref ${identifier}`),\n\t\tchooseAction(\"Or pass a hash that is a node in the migration graph\")\n\t] : [chooseAction(\"Pass --from a ref name, whose contract resolves through the snapshot store\"), runCommandAction(\"Or populate the graph first\", \"prisma-next db update\")];\n\treturn new ActionableCliError(\"MIGRATION.SNAPSHOT_MISSING\", viaRef ? `Ref \"${identifier}\" is not resolvable` : `No contract source for from-hash \"${identifier}\"`, {\n\t\twhy: viaRef ? `Ref \"${identifier}\" has no pointer file, and the hash being resolved is not a node in the migration graph either.` : `Hash \"${identifier}\" is not a node in the migration graph (the graph is empty), and it does not name a ref either.`,\n\t\tfix,\n\t\tnextActions,\n\t\tmeta: {\n\t\t\tidentifier,\n\t\t\tviaRef\n\t\t},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\nfunction errorMarkerMismatch(markerHash, reachableHashes, graphTip) {\n\tconst reachableList = reachableHashes.length > 0 ? reachableHashes.join(\", \") : \"(none — migration graph is empty)\";\n\tconst planFromFix = graphTip !== null ? `Run \\`prisma-next migration plan --from ${graphTip}\\` if the live marker is canonical and the on-disk graph needs catching up.` : \"Run `prisma-next migration plan` if the live marker is canonical and the on-disk graph needs catching up.\";\n\tconst planCommand = graphTip !== null ? `prisma-next migration plan --from ${graphTip}` : \"prisma-next migration plan\";\n\treturn new ActionableCliError(\"MIGRATION.MARKER_MISMATCH\", \"Database marker is not reachable in the on-disk migration graph\", {\n\t\twhy: `DB marker is ${markerHash}, but the on-disk migration graph reaches: ${reachableList}.`,\n\t\tfix: [\n\t\t\tplanFromFix,\n\t\t\t`Run \\`prisma-next ref set db ${markerHash}\\` if the on-disk graph is canonical and the local \\`db\\` ref drifted.`,\n\t\t\t\"Investigate whether the database was migrated by an out-of-band process.\"\n\t\t].join(\"\\n\"),\n\t\tnextActions: [\n\t\t\trunCommandAction(\"Catch the on-disk graph up to the live marker\", planCommand),\n\t\t\trunCommandAction(\"Point the local db ref at the live marker\", `prisma-next ref set db ${markerHash}`),\n\t\t\tchooseAction(\"Investigate whether the database was migrated by an out-of-band process\")\n\t\t],\n\t\tmeta: {\n\t\t\tmarkerHash,\n\t\t\treachableHashes: [...reachableHashes],\n\t\t\t...graphTip !== null ? { graphTip } : {}\n\t\t}\n\t});\n}\nconst ROLLBACK_IS_DESTRUCTIVE = \"A rollback (reverse) plan is expected to contain destructive (DROP) operations — review them before applying\";\nconst NARROWER_CASES_NEED_A_HINT = \"Narrower cases (rename inference, re-adding a required field without a safe default, or a type change that needs data) may additionally need a hint in the planned migration\";\nfunction errorPathUnreachable(failure) {\n\tconst meta = failure.meta ?? {};\n\tconst fromHashMeta = typeof meta[\"fromHash\"] === \"string\" ? meta[\"fromHash\"] : null;\n\tconst planFromHash = fromHashMeta === \"<empty>\" ? null : fromHashMeta;\n\tconst targetHash = typeof meta[\"targetHash\"] === \"string\" ? meta[\"targetHash\"] : typeof meta[\"target\"] === \"string\" ? meta[\"target\"] : null;\n\tconst deadEnds = meta[\"deadEnds\"];\n\tconst deadEndsSuffix = Array.isArray(deadEnds) && deadEnds.length > 0 ? ` Dead-ends: ${deadEnds.map(String).join(\", \")}.` : \"\";\n\tconst neverPlanned = meta[\"kind\"] === \"neverPlanned\";\n\tconst planCommand = (() => {\n\t\tif (neverPlanned) return \"prisma-next migration plan --name <slug>\";\n\t\tif (planFromHash !== null && targetHash !== null) return `prisma-next migration plan --from ${planFromHash} --to ${targetHash} --name <slug>`;\n\t\tif (targetHash !== null) return `prisma-next migration plan --to ${targetHash} --name <slug>`;\n\t\tif (planFromHash !== null) return `prisma-next migration plan --from ${planFromHash} --name <slug>`;\n\t\treturn \"prisma-next migration plan\";\n\t})();\n\tconst applyCommand = targetHash !== null && !neverPlanned ? `prisma-next migrate --to ${targetHash}` : \"prisma-next migrate\";\n\treturn new ActionableCliError(\"MIGRATION.PATH_UNREACHABLE\", failure.summary, {\n\t\twhy: failure.why ?? `Cannot reach target \"${targetHash ?? \"<unknown>\"}\" from current marker \"${fromHashMeta ?? \"<unknown>\"}\".${deadEndsSuffix}`,\n\t\tfix: [\n\t\t\t\"Plan the missing edge, then apply it:\",\n\t\t\t` 1. ${planCommand}`,\n\t\t\t` 2. ${applyCommand}`,\n\t\t\t`${ROLLBACK_IS_DESTRUCTIVE}.`,\n\t\t\t`${NARROWER_CASES_NEED_A_HINT}.`,\n\t\t\t\"Inspect the on-disk graph with `prisma-next migration list`, or `prisma-next migration show <bundle>` for any bundle in the path you expected.\"\n\t\t].join(\"\\n\"),\n\t\tnextActions: [\n\t\t\trunCommandAction(\"Plan the missing edge\", planCommand),\n\t\t\trunCommandAction(\"Apply it\", applyCommand),\n\t\t\tchooseAction(ROLLBACK_IS_DESTRUCTIVE),\n\t\t\tchooseAction(NARROWER_CASES_NEED_A_HINT),\n\t\t\trunCommandAction(\"Inspect the on-disk graph\", \"prisma-next migration list\"),\n\t\t\trunCommandAction(\"Inspect a bundle in the path you expected\", \"prisma-next migration show <bundle>\")\n\t\t],\n\t\tmeta: { ...meta }\n\t});\n}\n/**\n* Shared \"needs a live database\" precondition for read verbs that consult the\n* marker/ledger (`migration log`, `migration status`). A command needs both a\n* connection string and a control-plane driver; either missing yields the same\n* `CONFIG.DB_CONNECTION_REQUIRED` envelope with `meta.missingFlags` (canonical long-form flags\n* per CLI Style Guide §Errors) so callers can react programmatically. Returns\n* `null` when both are present.\n*/\nfunction requireLiveDatabase(args) {\n\tif (args.dbConnection && args.hasDriver) return null;\n\tconst missingFlags = args.dbConnection ? [] : [\"--db\"];\n\treturn errorDatabaseConnectionRequired({\n\t\twhy: args.why,\n\t\tmissingFlags,\n\t\t...ifDefined(\"commandName\", args.commandName),\n\t\t...ifDefined(\"retryCommand\", args.retryCommand)\n\t});\n}\n/**\n* Maps a `RefResolutionError` from the contract/migration reference\n* resolver into a CLI structured error envelope.\n*/\n/**\n* A migration ref (dirName or hash-prefix) resolves in more than one contract\n* space. The user must qualify with `--space <id>` to disambiguate.\n*/\nfunction errorAmbiguousMigrationRef(ref, spaceIds) {\n\tconst spaceList = spaceIds.join(\", \");\n\treturn new ActionableCliError(\"MIGRATION.AMBIGUOUS_MIGRATION_REF\", `Ambiguous migration reference: \"${ref}\" resolves in multiple spaces — qualify with --space <id>`, {\n\t\twhy: `\"${ref}\" matches migrations in spaces: ${spaceList}.`,\n\t\tfix: `Qualify with --space <id> to select one space. Available matching spaces: ${spaceList}.`,\n\t\tnextActions: [chooseAction(`Qualify with --space <id>, one of: ${spaceList}`)],\n\t\tmeta: {\n\t\t\tref,\n\t\t\tspaceIds: [...spaceIds]\n\t\t}\n\t});\n}\nfunction mapRefResolutionError(error) {\n\tswitch (error.kind) {\n\t\tcase \"not-found\": {\n\t\t\tconst fix = error.grammar === \"contract\" ? \"Provide a valid contract hash, ref name, or migration directory name.\" : \"Provide a valid migration directory name or migration hash.\";\n\t\t\treturn new ActionableCliError(\"MIGRATION.REF_NOT_FOUND\", `Not a known ${error.grammar} reference: \"${error.input}\"`, {\n\t\t\t\twhy: `No ${error.grammar} matching \"${error.input}\" exists in the migration graph or refs index.`,\n\t\t\t\tfix,\n\t\t\t\tnextActions: [chooseAction(fix)],\n\t\t\t\tmeta: {\n\t\t\t\t\tinput: error.input,\n\t\t\t\t\tgrammar: error.grammar\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tcase \"ambiguous\": return new ActionableCliError(\"MIGRATION.REF_AMBIGUOUS\", `Ambiguous ${error.grammar} reference: \"${error.input}\"`, {\n\t\t\twhy: `\"${error.input}\" matches multiple ${error.grammar}s: ${error.candidates.join(\", \")}`,\n\t\t\tfix: \"Provide a longer prefix or use the full hash to disambiguate.\",\n\t\t\tnextActions: [chooseAction(\"Provide a longer prefix or use the full hash to disambiguate\")],\n\t\t\tmeta: {\n\t\t\t\tinput: error.input,\n\t\t\t\tcandidates: error.candidates,\n\t\t\t\tgrammar: error.grammar\n\t\t\t}\n\t\t});\n\t\tcase \"wrong-grammar\": return new ActionableCliError(\"MIGRATION.REF_WRONG_GRAMMAR\", error.message, {\n\t\t\twhy: error.message,\n\t\t\tfix: error.fix,\n\t\t\tnextActions: [chooseAction(error.fix)],\n\t\t\tmeta: {\n\t\t\t\tinput: error.input,\n\t\t\t\texpectedGrammar: error.expectedGrammar\n\t\t\t}\n\t\t});\n\t\tcase \"invalid-format\": return new ActionableCliError(\"MIGRATION.REF_INVALID_FORMAT\", `Invalid reference format: \"${error.input}\"`, {\n\t\t\twhy: error.reason,\n\t\t\tfix: \"Provide a valid contract hash, ref name, or migration directory name.\",\n\t\t\tnextActions: [chooseAction(\"Provide a valid contract hash, ref name, or migration directory name\")],\n\t\t\tmeta: { input: error.input }\n\t\t});\n\t}\n}\n//#endregion\nexport { errorSpaceNotFound as A, errorPlanForgotTheFlag as C, errorRunnerFailed as D, errorRefSetHashNotInGraph as E, requireLiveDatabase as F, chooseAction as I, runCommandAction as L, errorTargetMismatch as M, errorUnexpected as N, errorRuntime$1 as O, mapRefResolutionError as P, errorPathUnreachable as S, errorRefSetEmptySentinel as T, errorMarkerMissing as _, errorConsentPlanMismatch as a, errorNoMigrations as b, errorDatabaseConnectionRequired as c, errorFileNotFound as d, errorHashMismatch as f, errorMarkerMismatch as g, errorLegendHumanOnly as h, errorConfigValidation as i, errorTargetMigrationNotSupported as j, errorSnapshotMissing as k, errorDestructiveChanges as l, errorInvalidSpaceId as m, ERROR_CODE_DESTRUCTIVE_CHANGES as n, errorContractConfigMissing$1 as o, errorInvalidOutputFormat as p, errorAmbiguousMigrationRef as r, errorContractValidationFailed as s, CliStructuredError$1 as t, errorDriverRequired as u, errorMigrationPackageNotFound as v, errorRefSetBundleNotFound as w, errorOutputFormatMutex as x, errorMigrationPlanningFailed as y };\n\n//# sourceMappingURL=cli-errors-BG6bItjG.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,iBAAiB,OAAO,SAAS;CACzC,OAAO;EACN,MAAM;EACN;EACA;CACD;AACD;;AAEA,SAAS,aAAa,OAAO;CAC5B,OAAO;EACN,MAAM;EACN;CACD;AACD;;;;;;;;;;;AAaA,IAAI,qBAAqB,cAAc,qBAAqB;CAC3D;CACA,YAAY,MAAM,SAAS,SAAS;EACnC,MAAM,MAAM,SAAS,OAAO;EAC5B,KAAK,cAAc,QAAQ;CAC5B;AACD;AACA,SAAS,0BAA0B,cAAc,iBAAiB,cAAc;CAC/E,MAAM,gBAAgB,gBAAgB,SAAS,IAAI,gBAAgB,KAA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AAK,aAAa;GACjB,MAAM,MAAM,MAAM,YAAY,aAAa,0EAA0E;GACrH,OAAO,IAAI,mBAAmB,2BAA2B,eAAe,MAAM,QAAQ,eAAe,MAAM,MAAM,IAAI;IACpH,KAAK,MAAM,MAAM,QAAQ,aAAa,MAAM,MAAM;IAClD;IACA,aAAa,CAAC,aAAa,GAAG,CAAC;IAC/B,MAAM;KACL,OAAO,MAAM;KACb,SAAS,MAAM;IAChB;GACD,CAAC;EACF;EACA,KAAK,aAAa,OAAO,IAAI,mBAAmB,2BAA2B,aAAa,MAAM,QAAQ,eAAe,MAAM,MAAM,IAAI;GACpI,KAAK,IAAI,MAAM,MAAM,qBAAqB,MAAM,QAAQ,KAAK,MAAM,WAAW,KAAK,IAAI;GACvF,KAAK;GACL,aAAa,CAAC,aAAa,8DAA8D,CAAC;GAC1F,MAAM;IACL,OAAO,MAAM;IACb,YAAY,MAAM;IAClB,SAAS,MAAM;GAChB;EACD,CAAC;EACD,KAAK,iBAAiB,OAAO,IAAI,mBAAmB,+BAA+B,MAAM,SAAS;GACjG,KAAK,MAAM;GACX,KAAK,MAAM;GACX,aAAa,CAAC,aAAa,MAAM,GAAG,CAAC;GACrC,MAAM;IACL,OAAO,MAAM;IACb,iBAAiB,MAAM;GACxB;EACD,CAAC;EACD,KAAK,kBAAkB,OAAO,IAAI,mBAAmB,gCAAgC,8BAA8B,MAAM,MAAM,IAAI;GAClI,KAAK,MAAM;GACX,KAAK;GACL,aAAa,CAAC,aAAa,sEAAsE,CAAC;GAClG,MAAM,EAAE,OAAO,MAAM,MAAM;EAC5B,CAAC;CACF;AACD"}
@@ -10,7 +10,7 @@ import { Contract, ContractMarkerRecord, LedgerEntryRecord } from "@prisma/orm-f
10
10
  import "@prisma/cli-engine/protocol";
11
11
  import { AuthoringPslBlockDescriptorNamespace } from "@prisma/orm-framework/components/authoring";
12
12
  import { PslDocumentAst } from "@prisma/orm-framework/components/psl-ast";
13
- //#region ../../../1-framework/3-tooling/cli/dist/cli-errors-f5PRtVdm.d.mts
13
+ //#region ../../../1-framework/3-tooling/cli/dist/cli-errors-BiKBrOXc.d.mts
14
14
  //#region src/control-api/operations/db-verify.d.ts
15
15
  /**
16
16
  * Inputs for the aggregate `db verify` operation.
@@ -251,10 +251,20 @@ interface DbUpdateOptions {
251
251
  * When true, allows applying plans that contain destructive operations
252
252
  * (e.g., DROP TABLE, DROP COLUMN, ALTER TYPE).
253
253
  * When false (default), the operation returns a failure if the plan
254
- * includes destructive operations, prompting the user to confirm interactively
255
- * or re-run with -y/--yes.
254
+ * includes destructive operations, which `db update` turns into its consent
255
+ * prompt: the user types the database name, or passes `--confirm <database>`
256
+ * where there is nobody to ask.
256
257
  */
257
258
  readonly acceptDataLoss?: boolean;
259
+ /**
260
+ * Consent to the destructive plan a prior `DESTRUCTIVE_CHANGES` refusal
261
+ * named, identified by that refusal's `planHash`. The apply recomputes its
262
+ * plan and refuses with `CONSENT_PLAN_MISMATCH` when the fresh plan is not
263
+ * the one that was consented to.
264
+ */
265
+ readonly consent?: {
266
+ readonly planHash: string;
267
+ };
258
268
  /**
259
269
  * On-disk migrations directory. Always required — every `db update`
260
270
  * routes through the per-space flow, which reads on-disk
@@ -481,7 +491,33 @@ interface DbUpdateSuccess {
481
491
  /**
482
492
  * Failure codes for dbUpdate operation.
483
493
  */
484
- type DbUpdateFailureCode = 'PLANNING_FAILED' | 'RUNNER_FAILED' | 'DESTRUCTIVE_CHANGES';
494
+ type DbUpdateFailureCode = 'PLANNING_FAILED' | 'RUNNER_FAILED' | 'DESTRUCTIVE_CHANGES' | 'CONSENT_PLAN_MISMATCH';
495
+ /** One planned operation whose class is destructive, as the refusal names it. */
496
+ interface DestructivePlanOperation {
497
+ readonly id: string;
498
+ readonly label: string;
499
+ }
500
+ /**
501
+ * The verdict a `DESTRUCTIVE_CHANGES` refusal carries: what the plan would
502
+ * destroy, the database it would destroy it in, and the identity of the plan
503
+ * that was refused. Consent is granted against `planHash` — the caller passes
504
+ * it back as `DbUpdateOptions.consent`.
505
+ */
506
+ interface DestructiveChangesVerdict {
507
+ readonly destructiveOperations: ReadonlyArray<DestructivePlanOperation>;
508
+ /** The connected database's name, when the driver can name it. */
509
+ readonly databaseName: string | undefined;
510
+ /** Content hash of the refused plan. */
511
+ readonly planHash: string;
512
+ }
513
+ /**
514
+ * Why an apply carrying consent was refused: the plan recomputed for the
515
+ * apply is not the plan that was consented to.
516
+ */
517
+ interface ConsentPlanMismatchVerdict {
518
+ readonly consentedPlanHash: string;
519
+ readonly planHash: string;
520
+ }
485
521
  /**
486
522
  * Failure details for dbUpdate operation.
487
523
  */
@@ -492,6 +528,10 @@ interface DbUpdateFailure {
492
528
  readonly conflicts: ReadonlyArray<MigrationPlannerConflict> | undefined;
493
529
  readonly warnings?: ReadonlyArray<MigrationPlannerConflict>;
494
530
  readonly meta: Record<string, unknown> | undefined;
531
+ /** Present exactly when `code` is `'DESTRUCTIVE_CHANGES'`. */
532
+ readonly destructiveChanges?: DestructiveChangesVerdict;
533
+ /** Present exactly when `code` is `'CONSENT_PLAN_MISMATCH'`. */
534
+ readonly consentPlanMismatch?: ConsentPlanMismatchVerdict;
495
535
  /** Underlying failure or error for diagnostics; never serialized into envelopes. */
496
536
  readonly cause?: unknown;
497
537
  }
@@ -688,7 +728,9 @@ interface ContractEmitOptions {
688
728
  /**
689
729
  * Path to the prisma-next.config.ts file. Used to find the project manifest
690
730
  * whose dependencies decide the import specifiers in emitted files; the
691
- * config itself is never read from it.
731
+ * config itself is never read from it. Omit it and the manifest is looked up
732
+ * from the directory the artifacts are written to, which is the package that
733
+ * will import them.
692
734
  */
693
735
  readonly configPath?: string;
694
736
  /**
@@ -910,4 +952,4 @@ interface ControlClient {
910
952
  }
911
953
  //#endregion
912
954
  export { OnControlProgress as A, EmitResult as C, IntrospectOptions as D, ExecuteDbVerifyResult as E, executeDbVerify as F, SchemaVerifyOptions as M, SignOptions as N, MigratePathDecision as O, VerifyOptions as P, EmitOptions as S, ExecuteDbVerifyOptions as T, DbUpdateResult as _, ControlClient as a, EmitFailure as b, CreateControlClient as c, DbInitOptions as d, DbInitResult as f, DbUpdateOptions as g, DbUpdateFailureCode as h, ControlActionName as i, PerSpaceExecutionEntry as j, MigrateResult as k, DbInitFailure as l, DbUpdateFailure as m, ContractEmitOptions as n, ControlClientOptions as o, DbInitSuccess as p, ContractEmitResult as r, ControlProgressEvent as s, CliStructuredError$2 as t, DbInitFailureCode as u, DbUpdateSuccess as v, EmitSuccess as w, EmitFailureCode as x, EmitContractConfig as y };
913
- //# sourceMappingURL=cli-errors-f5PRtVdm-C6xVKeQn.d.mts.map
955
+ //# sourceMappingURL=cli-errors-BiKBrOXc-JPxQqO58.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-errors-BiKBrOXc-JPxQqO58.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/cli-errors-BiKBrOXc.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAuBU,uBAAuB,0BAA0B;WAChD,QAAQ,sBAAsB,WAAW;WACzC,gBAAgB,sBAAsB;WACtC,UAAU;WACV;WACA,UAAU;WACV,YAAY,cAAc,2BAA2B,WAAW;WAChE,qBAAqB,cAAc,+BAA+B,WAAW;WAC7E;WACA;WACA;WACA,aAAa;;;;;;;;;;;;;;UAcd;WACC,eAAe,oBAAoB;;;;;;WAMnC;WACA;WACA;;KAEN,wBAAwB,OAAO,wBAAwB;;;;;;;;;;;;;;;;;iBAiB3C,gBAAgB,0BAA0B,0BAA0B,SAAS,uBAAuB,WAAW,aAAa,QAAQ;;;;;;;;;;;;;;UAc3I;WACC,QAAQ;WACR,QAAQ;WACR,SAAS;;WAET,SAAS;WACT,aAAa,cAAc;;;;;;WAM3B;;;;;;KAMN,uBAAuB,SAAS,yBAAyB;;;;KAIzD;;;;;;;;;;;;;;KAcA;WACM,QAAQ;WACR;WACA;WACA;WACA;;WAEA,QAAQ;WACR;WACA;WACA;;;;;;;KAON,qBAAqB,OAAO;;;;UAIvB;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