@prisma/orm-toolchain 8.0.0-rc.1-dev.5 → 8.0.0-rc.1-dev.6

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 (169) hide show
  1. package/dist/{aggregate-B4mhR4Sk.mjs → aggregate-i-rfetSO.mjs} +8 -8
  2. package/dist/{aggregate-B4mhR4Sk.mjs.map → aggregate-i-rfetSO.mjs.map} +1 -1
  3. package/dist/bin__prisma-next.mjs +22 -22
  4. package/dist/bin__prisma-next.mjs.map +1 -1
  5. package/dist/cli.mjs +2 -2
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/cli__commands__contract-emit.mjs +1 -1
  8. package/dist/cli__commands__contract-infer.mjs +1 -1
  9. package/dist/cli__commands__db-init.mjs +1 -1
  10. package/dist/cli__commands__db-schema.mjs +1 -1
  11. package/dist/cli__commands__db-sign.mjs +1 -1
  12. package/dist/cli__commands__db-update.mjs +1 -1
  13. package/dist/cli__commands__db-verify.mjs +1 -1
  14. package/dist/cli__commands__migrate.d.mts +1 -1
  15. package/dist/cli__commands__migrate.mjs +1 -1
  16. package/dist/cli__commands__migration-check.d.mts +1 -1
  17. package/dist/cli__commands__migration-check.mjs +1 -1
  18. package/dist/cli__commands__migration-graph.d.mts +1 -1
  19. package/dist/cli__commands__migration-graph.mjs +1 -1
  20. package/dist/cli__commands__migration-list.d.mts +1 -1
  21. package/dist/cli__commands__migration-list.mjs +1 -1
  22. package/dist/cli__commands__migration-log.d.mts +1 -1
  23. package/dist/cli__commands__migration-log.mjs +1 -1
  24. package/dist/cli__commands__migration-new.mjs +1 -1
  25. package/dist/cli__commands__migration-plan.mjs +1 -1
  26. package/dist/cli__commands__migration-show.mjs +1 -1
  27. package/dist/cli__commands__migration-status.d.mts +1 -1
  28. package/dist/cli__commands__migration-status.mjs +1 -1
  29. package/dist/cli__commands__ref.d.mts +1 -1
  30. package/dist/cli__commands__ref.mjs +1 -1
  31. package/dist/cli__commands__telemetry.mjs +1 -1
  32. package/dist/cli__control-api.d.mts +1 -1
  33. package/dist/cli__control-api.mjs +2 -2
  34. package/dist/cli__migration-cli.mjs +3 -6
  35. package/dist/cli__migration-cli.mjs.map +1 -1
  36. package/dist/{client-75qrAPqf-7l0C0H_b.mjs → client-7aUYC7ci-Bh9mLxkl.mjs} +16 -12
  37. package/dist/client-7aUYC7ci-Bh9mLxkl.mjs.map +1 -0
  38. package/dist/{command-helpers-CAoXqAY9-DWUBcTXM.mjs → command-helpers-C4WpR-QE-CK2gkj6l.mjs} +30 -74
  39. package/dist/command-helpers-C4WpR-QE-CK2gkj6l.mjs.map +1 -0
  40. package/dist/contract-at-errors-YdCQ5OOk-okxG7Eaj.mjs +44 -0
  41. package/dist/contract-at-errors-YdCQ5OOk-okxG7Eaj.mjs.map +1 -0
  42. package/dist/{contract-emit-B6odMoem-C87PBvmo.mjs → contract-emit-CTm2zfuG-8mtkxW8M.mjs} +12 -11
  43. package/dist/contract-emit-CTm2zfuG-8mtkxW8M.mjs.map +1 -0
  44. package/dist/{contract-emit-0hSjbuxp-BJLC-VgC.mjs → contract-emit-D8IXP9Qp-CecAQio1.mjs} +4 -4
  45. package/dist/{contract-emit-0hSjbuxp-BJLC-VgC.mjs.map → contract-emit-D8IXP9Qp-CecAQio1.mjs.map} +1 -1
  46. package/dist/{contract-infer-BnkqpftN-DwBzasOu.mjs → contract-infer-C8-RqHeK-D_dm3onP.mjs} +5 -5
  47. package/dist/contract-infer-C8-RqHeK-D_dm3onP.mjs.map +1 -0
  48. package/dist/{contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs → contract-snapshot-store-DNTOE6fB-BDpjbdCJ.mjs} +3 -3
  49. package/dist/{contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs.map → contract-snapshot-store-DNTOE6fB-BDpjbdCJ.mjs.map} +1 -1
  50. package/dist/{contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs → contract-space-aggregate-loader-CziO_ZRW-DIoQOL0P.mjs} +6 -6
  51. package/dist/contract-space-aggregate-loader-CziO_ZRW-DIoQOL0P.mjs.map +1 -0
  52. package/dist/{db-init-bd0_x2Q8.mjs → db-init-CXMcvoIA.mjs} +9 -12
  53. package/dist/db-init-CXMcvoIA.mjs.map +1 -0
  54. package/dist/{db-schema-CwgAWTqG.mjs → db-schema-j8DERh4t.mjs} +4 -4
  55. package/dist/{db-schema-CwgAWTqG.mjs.map → db-schema-j8DERh4t.mjs.map} +1 -1
  56. package/dist/{db-sign-vqiYfpjI.mjs → db-sign-xV_rpoIc.mjs} +10 -10
  57. package/dist/db-sign-xV_rpoIc.mjs.map +1 -0
  58. package/dist/{db-update-Br0diOCo.mjs → db-update-DXa2DIvu.mjs} +11 -11
  59. package/dist/db-update-DXa2DIvu.mjs.map +1 -0
  60. package/dist/{db-verify-CKPsRFrj-T7nSt7yT.mjs → db-verify-YWHjuKC7-DidK1gx1.mjs} +9 -6
  61. package/dist/db-verify-YWHjuKC7-DidK1gx1.mjs.map +1 -0
  62. package/dist/{errors--qsXZUtL.d.mts → errors-AkMBj-YP.d.mts} +8 -8
  63. package/dist/errors-AkMBj-YP.d.mts.map +1 -0
  64. package/dist/{errors-IpZm1Skp-BH495dRd.mjs → errors-BwusfLIN-BXM7K-ww.mjs} +42 -51
  65. package/dist/errors-BwusfLIN-BXM7K-ww.mjs.map +1 -0
  66. package/dist/{format-ByDm2goZ-BIRlFoo6.mjs → format-Bw3LVJ1v-D10inUT9.mjs} +12 -9
  67. package/dist/format-Bw3LVJ1v-D10inUT9.mjs.map +1 -0
  68. package/dist/{framework-components-CjshQKHA-Dlp6Leo5.mjs → framework-components-3DdB31mk-BPGSuOyZ.mjs} +3 -3
  69. package/dist/{framework-components-CjshQKHA-Dlp6Leo5.mjs.map → framework-components-3DdB31mk-BPGSuOyZ.mjs.map} +1 -1
  70. package/dist/{graph-membership-DW6nnbyQ-Bp2KcVwR.mjs → graph-membership-h9ejuZla-ewjYM5wz.mjs} +3 -3
  71. package/dist/{graph-membership-DW6nnbyQ-Bp2KcVwR.mjs.map → graph-membership-h9ejuZla-ewjYM5wz.mjs.map} +1 -1
  72. package/dist/{init-BGm77aWc-jHVUn63W.mjs → init-CPB89WK2-Di4kgP6B.mjs} +4 -4
  73. package/dist/{init-BGm77aWc-jHVUn63W.mjs.map → init-CPB89WK2-Di4kgP6B.mjs.map} +1 -1
  74. package/dist/{inspect-live-schema-CnwYTRZ0-P-6asJFl.mjs → inspect-live-schema-DEYE4EHW-DmSfKdpv.mjs} +4 -4
  75. package/dist/{inspect-live-schema-CnwYTRZ0-P-6asJFl.mjs.map → inspect-live-schema-DEYE4EHW-DmSfKdpv.mjs.map} +1 -1
  76. package/dist/{invariants-lXzy6txi-DAoP4nTE.mjs → invariants-CMcQxRas-CXX9uhQW.mjs} +3 -3
  77. package/dist/{invariants-lXzy6txi-DAoP4nTE.mjs.map → invariants-CMcQxRas-CXX9uhQW.mjs.map} +1 -1
  78. package/dist/{io-C8TdyBKt-DloEBi70.mjs → io-CL3hSv42-DGZtTs89.mjs} +8 -8
  79. package/dist/{io-C8TdyBKt-DloEBi70.mjs.map → io-CL3hSv42-DGZtTs89.mjs.map} +1 -1
  80. package/dist/{migrate-BdVFDKF2.mjs → migrate-COusRrm7.mjs} +28 -22
  81. package/dist/migrate-COusRrm7.mjs.map +1 -0
  82. package/dist/{migration-check-DcwUnadt-jamDqOmM.mjs → migration-check-CueEJelQ-J81XR_ns.mjs} +10 -10
  83. package/dist/{migration-check-DcwUnadt-jamDqOmM.mjs.map → migration-check-CueEJelQ-J81XR_ns.mjs.map} +1 -1
  84. package/dist/{migration-command-scaffold-BCuoeAki-DMy_5ztW.mjs → migration-command-scaffold-DNRo4exb-9JCezdoT.mjs} +4 -4
  85. package/dist/{migration-command-scaffold-BCuoeAki-DMy_5ztW.mjs.map → migration-command-scaffold-DNRo4exb-9JCezdoT.mjs.map} +1 -1
  86. package/dist/{migration-BuUmO7It.mjs → migration-diUAhNaa.mjs} +3 -3
  87. package/dist/{migration-BuUmO7It.mjs.map → migration-diUAhNaa.mjs.map} +1 -1
  88. package/dist/{migration-graph-vmgkL3k4.mjs → migration-graph-BL6vfLcE.mjs} +4 -4
  89. package/dist/{migration-graph-vmgkL3k4.mjs.map → migration-graph-BL6vfLcE.mjs.map} +1 -1
  90. package/dist/{migration-graph-CBf9ORe7-B4xAF8GN.mjs → migration-graph-D6bN-mX0-DwMWY8DA.mjs} +3 -3
  91. package/dist/{migration-graph-CBf9ORe7-B4xAF8GN.mjs.map → migration-graph-D6bN-mX0-DwMWY8DA.mjs.map} +1 -1
  92. package/dist/{migration-list-BFBeo1_X-ckYMhETH.mjs → migration-list-D2_JdzWC-MRHYYVQE.mjs} +6 -6
  93. package/dist/{migration-list-BFBeo1_X-ckYMhETH.mjs.map → migration-list-D2_JdzWC-MRHYYVQE.mjs.map} +1 -1
  94. package/dist/{migration-log-CS5IWcNq-DI7FTHCA.mjs → migration-log-BXbz6-Lj-CKHbat5f.mjs} +4 -6
  95. package/dist/migration-log-BXbz6-Lj-CKHbat5f.mjs.map +1 -0
  96. package/dist/{migration-new-GmW2anVb.mjs → migration-new-szZFsA3C.mjs} +16 -15
  97. package/dist/migration-new-szZFsA3C.mjs.map +1 -0
  98. package/dist/{migration-path-target-D3Sj55PI-BICblCuk.mjs → migration-path-target-BPYp3LNc-qRQlG_Yn.mjs} +4 -4
  99. package/dist/migration-path-target-BPYp3LNc-qRQlG_Yn.mjs.map +1 -0
  100. package/dist/{migration-plan-q_L84PN1-ClkGgtVz.mjs → migration-plan-CxXAXYc8-Dnp-v8Nl.mjs} +17 -18
  101. package/dist/migration-plan-CxXAXYc8-Dnp-v8Nl.mjs.map +1 -0
  102. package/dist/{migration-show--pW4XhKs.mjs → migration-show-BKsIh7Uz.mjs} +9 -9
  103. package/dist/migration-show-BKsIh7Uz.mjs.map +1 -0
  104. package/dist/{migration-status-CE7cQLDq-P1x1-BsZ.mjs → migration-status-CNnRInne--cvmx56T.mjs} +15 -15
  105. package/dist/migration-status-CNnRInne--cvmx56T.mjs.map +1 -0
  106. package/dist/migration-tools.d.mts +2 -2
  107. package/dist/migration-tools.mjs +12 -12
  108. package/dist/migration-tools__aggregate.mjs +1 -1
  109. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  110. package/dist/migration-tools__errors.d.mts +1 -1
  111. package/dist/migration-tools__errors.mjs +1 -1
  112. package/dist/migration-tools__invariants.mjs +1 -1
  113. package/dist/migration-tools__io.mjs +1 -1
  114. package/dist/migration-tools__migration-graph.mjs +2 -2
  115. package/dist/migration-tools__migration.mjs +1 -1
  116. package/dist/migration-tools__ref-resolution.mjs +1 -1
  117. package/dist/migration-tools__refs.mjs +1 -1
  118. package/dist/migration-tools__spaces.d.mts +1 -1
  119. package/dist/migration-tools__spaces.mjs +2 -2
  120. package/dist/{project-import-root-CpwLCDLY-DkVwAnWj.mjs → project-import-root-C_bd0ooL-CLXW-gp6.mjs} +10 -8
  121. package/dist/project-import-root-C_bd0ooL-CLXW-gp6.mjs.map +1 -0
  122. package/dist/{ref-sHE8zOcm.mjs → ref-DjZ5Y8ju.mjs} +11 -11
  123. package/dist/ref-DjZ5Y8ju.mjs.map +1 -0
  124. package/dist/{ref-advancement-CSPMoQs3-fEipZrdu.mjs → ref-advancement-CSPMoQs3-CPkL3IFF.mjs} +4 -4
  125. package/dist/{ref-advancement-CSPMoQs3-fEipZrdu.mjs.map → ref-advancement-CSPMoQs3-CPkL3IFF.mjs.map} +1 -1
  126. package/dist/{ref-resolution-BjJBWPjX.mjs → ref-resolution-BsdziDFA.mjs} +2 -2
  127. package/dist/{ref-resolution-BjJBWPjX.mjs.map → ref-resolution-BsdziDFA.mjs.map} +1 -1
  128. package/dist/{refs-BDbB9BRB-D6Za3Q49.mjs → refs-DtoeUivZ-qay0UMSP.mjs} +6 -6
  129. package/dist/refs-DtoeUivZ-qay0UMSP.mjs.map +1 -0
  130. package/dist/{spaces-C27bA-xc.mjs → spaces-BNd2Tlk0.mjs} +7 -7
  131. package/dist/spaces-BNd2Tlk0.mjs.map +1 -0
  132. package/dist/{spaces-DxFj5y8l.d.mts → spaces-D5qtTlhj.d.mts} +2 -2
  133. package/dist/{spaces-DxFj5y8l.d.mts.map → spaces-D5qtTlhj.d.mts.map} +1 -1
  134. package/dist/{telemetry-CmbCa3Ld-CmE5zcIG.mjs → telemetry-DVBHDQd6-BEdoMii0.mjs} +3 -3
  135. package/dist/{telemetry-CmbCa3Ld-CmE5zcIG.mjs.map → telemetry-DVBHDQd6-BEdoMii0.mjs.map} +1 -1
  136. package/dist/{types-DZWEs4si-D8UlyJI0.d.mts → types-2n_H3DQ9-Bks8UPEO.d.mts} +8 -2
  137. package/dist/types-2n_H3DQ9-Bks8UPEO.d.mts.map +1 -0
  138. package/dist/{verify-DnVNjc5C-BGdsblBK.mjs → verify-C6L_hiJU-CN3eEe3Y.mjs} +3 -3
  139. package/dist/{verify-DnVNjc5C-BGdsblBK.mjs.map → verify-C6L_hiJU-CN3eEe3Y.mjs.map} +1 -1
  140. package/dist/{verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs → verify-contract-spaces-Ak73-zQK-y4qVyu-y.mjs} +4 -4
  141. package/dist/{verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs.map → verify-contract-spaces-Ak73-zQK-y4qVyu-y.mjs.map} +1 -1
  142. package/dist/vite-plugin-contract-emit.mjs +1 -1
  143. package/package.json +12 -12
  144. package/dist/client-75qrAPqf-7l0C0H_b.mjs.map +0 -1
  145. package/dist/command-helpers-CAoXqAY9-DWUBcTXM.mjs.map +0 -1
  146. package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs +0 -36
  147. package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs.map +0 -1
  148. package/dist/contract-emit-B6odMoem-C87PBvmo.mjs.map +0 -1
  149. package/dist/contract-infer-BnkqpftN-DwBzasOu.mjs.map +0 -1
  150. package/dist/contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs.map +0 -1
  151. package/dist/db-init-bd0_x2Q8.mjs.map +0 -1
  152. package/dist/db-sign-vqiYfpjI.mjs.map +0 -1
  153. package/dist/db-update-Br0diOCo.mjs.map +0 -1
  154. package/dist/db-verify-CKPsRFrj-T7nSt7yT.mjs.map +0 -1
  155. package/dist/errors--qsXZUtL.d.mts.map +0 -1
  156. package/dist/errors-IpZm1Skp-BH495dRd.mjs.map +0 -1
  157. package/dist/format-ByDm2goZ-BIRlFoo6.mjs.map +0 -1
  158. package/dist/migrate-BdVFDKF2.mjs.map +0 -1
  159. package/dist/migration-log-CS5IWcNq-DI7FTHCA.mjs.map +0 -1
  160. package/dist/migration-new-GmW2anVb.mjs.map +0 -1
  161. package/dist/migration-path-target-D3Sj55PI-BICblCuk.mjs.map +0 -1
  162. package/dist/migration-plan-q_L84PN1-ClkGgtVz.mjs.map +0 -1
  163. package/dist/migration-show--pW4XhKs.mjs.map +0 -1
  164. package/dist/migration-status-CE7cQLDq-P1x1-BsZ.mjs.map +0 -1
  165. package/dist/project-import-root-CpwLCDLY-DkVwAnWj.mjs.map +0 -1
  166. package/dist/ref-sHE8zOcm.mjs.map +0 -1
  167. package/dist/refs-BDbB9BRB-D6Za3Q49.mjs.map +0 -1
  168. package/dist/spaces-C27bA-xc.mjs.map +0 -1
  169. package/dist/types-DZWEs4si-D8UlyJI0.d.mts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-toolchain",
3
- "version": "8.0.0-rc.1-dev.5",
3
+ "version": "8.0.0-rc.1-dev.6",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@clack/prompts": "^1.7.0",
16
- "@prisma/orm-framework": "8.0.0-rc.1-dev.5",
16
+ "@prisma/orm-framework": "8.0.0-rc.1-dev.6",
17
17
  "@vercel/detect-agent": "^1.2.3",
18
18
  "arktype": "^2.2.2",
19
19
  "c12": "^3.3.4",
@@ -34,16 +34,16 @@
34
34
  "wrap-ansi": "^10.0.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@internal/cli": "8.0.0-rc.1-dev.5",
38
- "@internal/cli-telemetry": "8.0.0-rc.1-dev.5",
39
- "@internal/config-loader": "8.0.0-rc.1-dev.5",
40
- "@internal/emitter": "8.0.0-rc.1-dev.5",
41
- "@internal/language-server": "8.0.0-rc.1-dev.5",
42
- "@internal/migration-tools": "8.0.0-rc.1-dev.5",
43
- "@internal/publish-surface": "8.0.0-rc.1-dev.5",
44
- "@repo/tsconfig": "8.0.0-rc.1-dev.5",
45
- "@repo/tsdown": "8.0.0-rc.1-dev.5",
46
- "@internal/vite-plugin-contract-emit": "8.0.0-rc.1-dev.5",
37
+ "@internal/cli": "8.0.0-rc.1-dev.6",
38
+ "@internal/cli-telemetry": "8.0.0-rc.1-dev.6",
39
+ "@internal/config-loader": "8.0.0-rc.1-dev.6",
40
+ "@internal/emitter": "8.0.0-rc.1-dev.6",
41
+ "@internal/language-server": "8.0.0-rc.1-dev.6",
42
+ "@internal/migration-tools": "8.0.0-rc.1-dev.6",
43
+ "@internal/publish-surface": "8.0.0-rc.1-dev.6",
44
+ "@repo/tsconfig": "8.0.0-rc.1-dev.6",
45
+ "@repo/tsdown": "8.0.0-rc.1-dev.6",
46
+ "@internal/vite-plugin-contract-emit": "8.0.0-rc.1-dev.6",
47
47
  "tsdown": "0.22.14",
48
48
  "typescript": "5.9.3"
49
49
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-75qrAPqf-7l0C0H_b.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/client-75qrAPqf.mjs"],"sourcesContent":["import { F as CliStructuredError$1 } from \"./command-helpers-CAoXqAY9.mjs\";\nimport { t as assertFrameworkComponentsCompatible } from \"./framework-components-CjshQKHA.mjs\";\nimport { t as enrichContract } from \"./contract-enrichment-DrMvvY2A.mjs\";\nimport { t as buildContractSpaceAggregate } from \"./contract-space-aggregate-loader-CFH-336b.mjs\";\nimport { emit } from \"@internal/emitter\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { APP_SPACE_ID, createControlStack, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView } from \"@internal/framework-components/control\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { allStorageElementsExternal, buildFabricatedMigrationEdge, collectAggregateNamespaces, planMigration, requireHeadRef, resolveRecordedPath, verifyMigration } from \"@internal/migration-tools/aggregate\";\nimport { EMPTY_CONTRACT_HASH } from \"@internal/migration-tools/constants\";\nimport { errorNoInvariantPath } from \"@internal/migration-tools/errors\";\nimport { findPathWithDecision } from \"@internal/migration-tools/migration-graph\";\n//#region src/control-api/operations/migration-helpers.ts\n/**\n* Strips operation objects to their public shape (id, label, operationClass).\n* Used at the API boundary to avoid leaking internal fields (precheck, execute, postcheck, etc.).\n*/\nfunction stripOperations(operations) {\n\treturn operations.map((op) => ({\n\t\tid: op.id,\n\t\tlabel: op.label,\n\t\toperationClass: op.operationClass\n\t}));\n}\n//#endregion\n//#region src/control-api/operations/run-migration.ts\n/**\n* Span id emitted via `onProgress` for the run phase. Stable\n* identifier consumed by the structured-output renderer and by tests.\n*/\nconst RUN_SPAN_ID = \"apply\";\n/**\n* Runner-driving tail shared by every run caller — `db init`,\n* `db update`, and `migrate`. Consumes already-resolved per-space\n* plans (the planner-vs-replay distinction is owned by the caller) and\n* dispatches them to the runner in canonical order.\n*\n* Marker advancement is part of the runner's per-space transaction\n* (the SQL family runner writes the marker as the last step of each\n* space's transaction), so this primitive does not advance markers\n* separately — by the time `execute` returns ok, every\n* space's marker has been advanced to its plan's destination.\n*\n* Span emission (`spanStart 'apply'` / `spanEnd 'apply'`) is owned here\n* so callers don't have to duplicate it; the `action` field on each\n* progress event is taken from the caller's `action` argument.\n*/\nasync function runMigration(inputs) {\n\tconst { aggregate, perSpacePlans, applyOrder, driver, familyInstance, migrations, frameworkComponents, policy, action, onProgress } = inputs;\n\tconst orderedResolutions = collectOrdered(applyOrder, perSpacePlans);\n\tconst runner = migrations.createRunner(familyInstance);\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanStart\",\n\t\tspanId: RUN_SPAN_ID,\n\t\tlabel: progressLabelForAction(action)\n\t});\n\tconst perSpaceOptions = orderedResolutions.map((r) => ({\n\t\tspace: r.spaceId,\n\t\tplan: r.entry.plan,\n\t\tdriver,\n\t\tdestinationContract: r.entry.destinationContract,\n\t\tpolicy,\n\t\tframeworkComponents,\n\t\tmigrationEdges: r.entry.migrationEdges,\n\t\tstrictVerification: false\n\t}));\n\tconst runnerResult = await runner.execute({\n\t\tdriver,\n\t\tperSpaceOptions\n\t});\n\tif (!runnerResult.ok) {\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: RUN_SPAN_ID,\n\t\t\toutcome: \"error\"\n\t\t});\n\t\treturn notOk({\n\t\t\tsummary: runnerResult.failure.summary,\n\t\t\t...ifDefined(\"why\", runnerResult.failure.why),\n\t\t\tmeta: {\n\t\t\t\t...runnerResult.failure.meta ?? {},\n\t\t\t\tfailingSpace: runnerResult.failure.failingSpace,\n\t\t\t\trunnerErrorCode: runnerResult.failure.code\n\t\t\t}\n\t\t});\n\t}\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanEnd\",\n\t\tspanId: RUN_SPAN_ID,\n\t\toutcome: \"ok\"\n\t});\n\treturn ok({\n\t\torderedResolutions,\n\t\ttotalOpsPlanned: runnerResult.value.perSpaceResults.reduce((sum, r) => sum + r.value.operationsPlanned, 0),\n\t\ttotalOpsExecuted: runnerResult.value.perSpaceResults.reduce((sum, r) => sum + r.value.operationsExecuted, 0),\n\t\tperSpace: buildPerSpaceBreakdown(orderedResolutions, aggregate.app.spaceId, { includeMarkers: true })\n\t});\n}\n/**\n* Project the planner's per-space resolutions into the\n* `PerSpaceExecutionEntry[]` shape the CLI surfaces.\n*\n* `includeMarkers` is `true` for apply-mode (each space's marker is\n* the `destination.storageHash` of its plan, which the runner\n* advances as the last step of each space's transaction) and `false`\n* for plan-mode (no marker has been written yet).\n*\n* Exported alongside {@link runMigration} so plan-mode callers can\n* assemble the same per-space block without going through the runner.\n*/\nfunction buildPerSpaceBreakdown(orderedResolutions, appSpaceId, options) {\n\treturn orderedResolutions.map((r) => {\n\t\tconst operations = r.entry.displayOps.map((op) => ({\n\t\t\tid: op.id,\n\t\t\tlabel: op.label,\n\t\t\toperationClass: op.operationClass\n\t\t}));\n\t\tconst base = {\n\t\t\tspaceId: r.spaceId,\n\t\t\tkind: r.spaceId === appSpaceId ? \"app\" : \"extension\",\n\t\t\toperations\n\t\t};\n\t\tif (!options.includeMarkers) return base;\n\t\treturn {\n\t\t\t...base,\n\t\t\tmarker: { storageHash: r.entry.plan.destination.storageHash }\n\t\t};\n\t});\n}\n/**\n* Materialise the `applyOrder` ordering into resolved per-space\n* entries. Throws if the planner output is missing a contract space listed\n* in `applyOrder` — a wiring bug that should never reach runtime.\n*\n* Exported so callers building their own success envelopes after a\n* plan-mode dispatch can replay the same ordering.\n*/\nfunction collectOrdered(applyOrder, perSpace) {\n\treturn applyOrder.map((spaceId) => {\n\t\tconst entry = perSpace.get(spaceId);\n\t\tif (!entry) throw new InternalError(`planner output missing per-space plan for \"${spaceId}\"`);\n\t\treturn {\n\t\t\tspaceId,\n\t\t\tentry\n\t\t};\n\t});\n}\n/**\n* Action-appropriate label for the `spanStart` event the run\n* primitive emits. `runMigration` is shared by `db init`, `db update`,\n* and `migrate`; the span label tracks the user-visible action\n* so structured-progress output reads naturally for each surface.\n*/\nfunction progressLabelForAction(action) {\n\tswitch (action) {\n\t\tcase \"dbInit\": return \"Initialising database across spaces\";\n\t\tcase \"dbUpdate\": return \"Updating database across spaces\";\n\t\tcase \"migrate\": return \"Running migration plan across spaces\";\n\t}\n}\n//#endregion\n//#region src/control-api/operations/db-run.ts\n/**\n* Span IDs emitted via `onProgress` during the run flow.\n* Stable identifiers consumed by the structured-output renderer and by\n* tests asserting on span ids. The `apply` span itself is owned by\n* the {@link runMigration} primitive — only the introspect / plan\n* spans are emitted directly here.\n*/\nconst SPAN_IDS$1 = {\n\tintrospect: \"introspect\",\n\tplan: \"plan\"\n};\n/**\n* Loader → planner → runner pipeline shared by `db init` and `db update`.\n*\n* The pipeline:\n*\n* 1. **Load**: build a {@link ContractSpaceAggregate} from the descriptor\n* set + on-disk on-disk artefacts. Any layout / drift / disjointness /\n* integrity violation short-circuits with a structured error.\n* 2. **Read DB state**: marker rows (`familyInstance.readAllMarkers`)\n* + introspected schema (`familyInstance.introspect`).\n* 3. **Plan**: {@link planMigration} chooses `resolveRecordedPath` vs\n* `planFromDiff` per space according to `callerPolicy.ignoreGraphFor`.\n* The app space is forced through `planFromDiff` (today's daily-driver\n* behaviour); every extension space walks its on-disk graph via\n* `resolveRecordedPath`.\n* 4. **Apply** (when `mode === 'apply'`): every per-space `MigrationPlan`\n* feeds into the runner's `execute` — one outer\n* transaction across every space; failure on any space rolls back\n* every space's writes.\n*/\nasync function executeRun(options) {\n\tconst { driver, adapter, familyInstance, contract, mode, migrations, frameworkComponents, migrationsDir, extensions, targetId, policy, action, onProgress } = options;\n\tconst loaded = await buildContractSpaceAggregate({\n\t\ttargetId,\n\t\tmigrationsDir,\n\t\tappContract: contract,\n\t\textensions,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t});\n\tif (!loaded.ok) throw loaded.failure;\n\tconst aggregate = loaded.value;\n\tconst markerRows = await familyInstance.readAllMarkers({ driver });\n\tif (mode === \"apply\") {\n\t\tconst orphanMarkerError = detectOrphanMarkers(aggregate, markerRows);\n\t\tif (orphanMarkerError !== null) throw orphanMarkerError;\n\t}\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanStart\",\n\t\tspanId: SPAN_IDS$1.introspect,\n\t\tlabel: \"Introspecting database schema\"\n\t});\n\tconst schemaIR = await familyInstance.introspect({\n\t\tdriver,\n\t\tcontract: collectAggregateNamespaces(aggregate)\n\t});\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanEnd\",\n\t\tspanId: SPAN_IDS$1.introspect,\n\t\toutcome: \"ok\"\n\t});\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanStart\",\n\t\tspanId: SPAN_IDS$1.plan,\n\t\tlabel: \"Planning migration\"\n\t});\n\tconst planResult = await planMigration({\n\t\taggregate,\n\t\tcurrentDBState: {\n\t\t\tmarkersBySpaceId: markerRows,\n\t\t\tschemaIntrospection: schemaIR\n\t\t},\n\t\tadapter,\n\t\tmigrations,\n\t\tframeworkComponents,\n\t\tcallerPolicy: { ignoreGraphFor: /* @__PURE__ */ new Set([aggregate.app.spaceId]) },\n\t\toperationPolicy: policy\n\t});\n\tif (!planResult.ok) {\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: SPAN_IDS$1.plan,\n\t\t\toutcome: \"error\"\n\t\t});\n\t\treturn mapPlannerError(planResult.failure);\n\t}\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanEnd\",\n\t\tspanId: SPAN_IDS$1.plan,\n\t\toutcome: \"ok\"\n\t});\n\tconst orderedResolutions = collectOrdered(planResult.value.applyOrder, planResult.value.perSpace);\n\tconst plannerWarnings = aggregatePlannerWarnings(orderedResolutions);\n\tconst appResolution = orderedResolutions.find((r) => r.spaceId === aggregate.app.spaceId);\n\tif (!appResolution) throw new InternalError(\"Aggregate planner returned no plan for the app space — the planner is supposed to always emit one.\");\n\tconst appPlan = appResolution.entry.plan;\n\tif (mode === \"plan\") {\n\t\tconst aggregateOps = orderedResolutions.flatMap((r) => r.entry.displayOps);\n\t\tconst preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(aggregateOps) : void 0;\n\t\tconst perSpace = buildPerSpaceBreakdown(orderedResolutions, aggregate.app.spaceId, { includeMarkers: false });\n\t\tconst summary = `Planned ${aggregateOps.length} operation(s) across ${orderedResolutions.length} space(s)`;\n\t\treturn wrapPlanResult({\n\t\t\toperations: aggregateOps,\n\t\t\tdestination: appPlan.destination,\n\t\t\tpreview,\n\t\t\tperSpace,\n\t\t\tsummary,\n\t\t\t...ifDefined(\"warnings\", plannerWarnings)\n\t\t});\n\t}\n\tconst applied = await runMigration({\n\t\taggregate,\n\t\tperSpacePlans: planResult.value.perSpace,\n\t\tapplyOrder: planResult.value.applyOrder,\n\t\tdriver,\n\t\tfamilyInstance,\n\t\tmigrations,\n\t\tframeworkComponents,\n\t\tpolicy,\n\t\taction,\n\t\t...ifDefined(\"onProgress\", onProgress)\n\t});\n\tif (!applied.ok) return buildRunnerFailure({\n\t\tsummary: applied.failure.summary,\n\t\t...ifDefined(\"why\", applied.failure.why),\n\t\tmeta: applied.failure.meta,\n\t\t...ifDefined(\"warnings\", plannerWarnings)\n\t});\n\tconst aggregateOps = applied.value.orderedResolutions.flatMap((r) => r.entry.displayOps);\n\tconst summary = action === \"dbInit\" ? `Applied ${applied.value.totalOpsExecuted} operation(s) across ${applied.value.orderedResolutions.length} space(s), database signed` : applied.value.totalOpsExecuted === 0 ? `Database already matches contract across ${applied.value.orderedResolutions.length} space(s), signature updated` : `Applied ${applied.value.totalOpsExecuted} operation(s) across ${applied.value.orderedResolutions.length} space(s), signature updated`;\n\treturn wrapApplyResult({\n\t\toperations: aggregateOps,\n\t\tdestination: appPlan.destination,\n\t\toperationsPlanned: applied.value.totalOpsPlanned,\n\t\toperationsExecuted: applied.value.totalOpsExecuted,\n\t\tperSpace: applied.value.perSpace,\n\t\tsummary,\n\t\t...ifDefined(\"warnings\", plannerWarnings)\n\t});\n}\nfunction aggregatePlannerWarnings(orderedResolutions) {\n\tconst warnings = orderedResolutions.flatMap((r) => r.entry.warnings ?? []);\n\treturn warnings.length > 0 ? warnings : void 0;\n}\n/**\n* Compare the live `_prisma_marker` rows against the aggregate's\n* declared contract spaces. Any marker row whose `space` is not a space of\n* the aggregate is an \"orphan\" — typically a marker left behind by\n* an extension that was removed from `extensions` without first\n* cleaning up its on-disk migrations / database tables.\n*\n* Returns a {@link CliStructuredError} envelope (code\n* `MIGRATION.CONTRACT_SPACE_VIOLATION`, `kind: 'orphanMarker'`) for the\n* first orphan it finds, or `null`\n* when every marker row maps to a declared contract space. Mirrors the M2\n* `runContractSpaceVerifierMarkerCheck` envelope so downstream\n* tooling (integration tests, JSON consumers) keeps asserting on the\n* same shape.\n*/\nfunction detectOrphanMarkers(aggregate, markerRows) {\n\tconst aggregateSpaceIds = /* @__PURE__ */ new Set([aggregate.app.spaceId, ...aggregate.extensions.map((m) => m.spaceId)]);\n\tconst orphans = [];\n\tfor (const [spaceId, row] of markerRows) if (row !== null && row !== void 0 && !aggregateSpaceIds.has(spaceId)) orphans.push(spaceId);\n\tif (orphans.length === 0) return null;\n\torphans.sort((a, b) => a.localeCompare(b));\n\treturn new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", orphans.length === 1 ? `Orphan contract-space marker detected for \"${orphans[0]}\"` : `Orphan contract-space markers detected for ${orphans.length} spaces`, {\n\t\twhy: `The database has \\`_prisma_marker\\` rows for spaces (${orphans.map((s) => `\"${s}\"`).join(\", \")}) that are not declared in the project's \\`extensions\\`. The aggregate pipeline refuses to advance markers it cannot account for.`,\n\t\tfix: \"Either re-declare the missing extension(s) in `extensions` (so the aggregate owns them again), or remove the orphan marker row(s) from `_prisma_marker` once you have confirmed the corresponding tables can be safely retired.\",\n\t\tdocsUrl: \"https://pris.ly/contract-spaces\",\n\t\tmeta: { violations: orphans.map((spaceId) => ({\n\t\t\tkind: \"orphanMarker\",\n\t\t\tspaceId\n\t\t})) }\n\t});\n}\nfunction mapPlannerError(error) {\n\tif (error.kind === \"planFromDiffFailed\") return blindCast(notOk({\n\t\tcode: \"PLANNING_FAILED\",\n\t\tsummary: \"Migration planning failed due to conflicts\",\n\t\tconflicts: error.conflicts,\n\t\twhy: void 0,\n\t\tmeta: void 0\n\t}));\n\tif (error.kind === \"extensionPathUnreachable\") return buildRunnerFailure({\n\t\tsummary: `Cannot resolve apply path for extension space \"${error.spaceId}\"`,\n\t\twhy: `No path in the on-disk migration graph for extension space \"${error.spaceId}\" reaches the on-disk head ref hash \"${error.target}\".`,\n\t\tmeta: {\n\t\t\tspaceId: error.spaceId,\n\t\t\ttarget: error.target\n\t\t}\n\t});\n\tif (error.kind === \"extensionPathUnsatisfiable\") return buildRunnerFailure({\n\t\tsummary: `Cannot resolve apply path for extension space \"${error.spaceId}\"`,\n\t\twhy: `On-disk migration graph for extension space \"${error.spaceId}\" reaches the on-disk head ref but does not cover required invariants: ${error.missingInvariants.join(\", \")}.`,\n\t\tmeta: {\n\t\t\tspaceId: error.spaceId,\n\t\t\tmissingInvariants: error.missingInvariants\n\t\t}\n\t});\n\treturn buildRunnerFailure({\n\t\tsummary: `Aggregate planner policy conflict for space \"${error.spaceId}\"`,\n\t\twhy: error.detail,\n\t\tmeta: { spaceId: error.spaceId }\n\t});\n}\nfunction wrapPlanResult(args) {\n\treturn ok({\n\t\tmode: \"plan\",\n\t\tplan: {\n\t\t\toperations: stripOperations(args.operations),\n\t\t\t...ifDefined(\"preview\", args.preview)\n\t\t},\n\t\tdestination: {\n\t\t\tstorageHash: args.destination.storageHash,\n\t\t\t...ifDefined(\"profileHash\", args.destination.profileHash)\n\t\t},\n\t\tperSpace: args.perSpace,\n\t\tsummary: args.summary,\n\t\t...ifDefined(\"warnings\", args.warnings)\n\t});\n}\nfunction wrapApplyResult(args) {\n\treturn ok({\n\t\tmode: \"apply\",\n\t\tplan: { operations: stripOperations(args.operations) },\n\t\tdestination: {\n\t\t\tstorageHash: args.destination.storageHash,\n\t\t\t...ifDefined(\"profileHash\", args.destination.profileHash)\n\t\t},\n\t\texecution: {\n\t\t\toperationsPlanned: args.operationsPlanned,\n\t\t\toperationsExecuted: args.operationsExecuted\n\t\t},\n\t\tmarker: args.destination.profileHash ? {\n\t\t\tstorageHash: args.destination.storageHash,\n\t\t\tprofileHash: args.destination.profileHash\n\t\t} : { storageHash: args.destination.storageHash },\n\t\tperSpace: args.perSpace,\n\t\tsummary: args.summary,\n\t\t...ifDefined(\"warnings\", args.warnings)\n\t});\n}\nfunction buildRunnerFailure(args) {\n\treturn blindCast(notOk({\n\t\tcode: \"RUNNER_FAILED\",\n\t\tsummary: args.summary,\n\t\twhy: args.why,\n\t\tmeta: args.meta,\n\t\tconflicts: void 0,\n\t\t...ifDefined(\"warnings\", args.warnings)\n\t}));\n}\n//#endregion\n//#region src/control-api/operations/db-init.ts\n/**\n* Execute `db init` against the configured contract.\n*\n* Routes through the loader → planner → runner pipeline (sub-spec\n* \"Commit-by-commit § Commit 4\"). Always additive-only; destructive\n* changes belong to `db update`.\n*/\nasync function executeDbInit(options) {\n\treturn await executeRun({\n\t\tdriver: options.driver,\n\t\tadapter: options.adapter,\n\t\tfamilyInstance: options.familyInstance,\n\t\tcontract: options.contract,\n\t\tmode: options.mode,\n\t\tmigrations: options.migrations,\n\t\tframeworkComponents: options.frameworkComponents,\n\t\tmigrationsDir: options.migrationsDir,\n\t\ttargetId: options.targetId,\n\t\textensions: options.extensions ?? [],\n\t\tpolicy: { allowedOperationClasses: [\"additive\"] },\n\t\taction: \"dbInit\",\n\t\t...ifDefined(\"onProgress\", options.onProgress)\n\t});\n}\n//#endregion\n//#region src/control-api/operations/db-update.ts\nconst DB_UPDATE_POLICY = { allowedOperationClasses: [\n\t\"additive\",\n\t\"widening\",\n\t\"destructive\"\n] };\n/**\n* Execute `db update` against the configured contract.\n*\n* Routes through the loader → planner → runner pipeline. Destructive\n* operations require either `acceptDataLoss: true` or a prior\n* `mode: 'plan'` invocation that surfaces the destructive ops; the\n* confirmation gate is implemented here so the lower-level applier\n* remains policy-agnostic.\n*/\nasync function executeDbUpdate(options) {\n\tconst sharedInputs = {\n\t\tdriver: options.driver,\n\t\tadapter: options.adapter,\n\t\tfamilyInstance: options.familyInstance,\n\t\tcontract: options.contract,\n\t\tmigrations: options.migrations,\n\t\tframeworkComponents: options.frameworkComponents,\n\t\tmigrationsDir: options.migrationsDir,\n\t\ttargetId: options.targetId,\n\t\textensions: options.extensions ?? [],\n\t\tpolicy: DB_UPDATE_POLICY,\n\t\taction: \"dbUpdate\",\n\t\t...ifDefined(\"onProgress\", options.onProgress)\n\t};\n\tif (options.mode === \"apply\" && !options.acceptDataLoss) {\n\t\tconst gate = await guardDestructiveChanges(sharedInputs);\n\t\tif (gate !== null) return gate;\n\t}\n\treturn await executeRun({\n\t\t...sharedInputs,\n\t\tmode: options.mode\n\t});\n}\n/**\n* Pre-plan once when running `db update apply` without `acceptDataLoss`.\n* Surfaces destructive operations across every space; if any are\n* planned, returns a `DESTRUCTIVE_CHANGES` failure that the CLI shows\n* as a confirmation prompt. Returns `null` when the apply is safe to\n* run.\n*/\nasync function guardDestructiveChanges(sharedInputs) {\n\tconst planResult = await executeRun({\n\t\t...sharedInputs,\n\t\tmode: \"plan\"\n\t});\n\tif (!planResult.ok) return planResult;\n\tconst destructiveOps = planResult.value.plan.operations.filter((op) => op.operationClass === \"destructive\").map((op) => ({\n\t\tid: op.id,\n\t\tlabel: op.label\n\t}));\n\tif (destructiveOps.length === 0) return null;\n\treturn notOk({\n\t\tcode: \"DESTRUCTIVE_CHANGES\",\n\t\tsummary: `Planned ${destructiveOps.length} destructive operation(s) that require confirmation`,\n\t\twhy: \"Destructive operations require confirmation — re-run with -y to accept\",\n\t\tconflicts: void 0,\n\t\tmeta: { destructiveOperations: destructiveOps }\n\t});\n}\n//#endregion\n//#region src/control-api/operations/db-verify.ts\n/**\n* Span IDs emitted via `onProgress` during the aggregate verify flow.\n* Mirrors the span identifiers used by the legacy precheck / marker-check\n* helpers so structured-output renderers and progress tests keep working.\n*/\nconst SPAN_IDS = {\n\tintrospect: \"introspect\",\n\tverify: \"verify\"\n};\n/**\n* Loader → verifier pipeline shared by `db verify` modes (`full`,\n* `marker-only`, `schema-only`).\n*\n* 1. **Load**: build a {@link import('@internal/migration-tools/aggregate').ContractSpaceAggregate}\n* from descriptors + on-disk on-disk artefacts. Layout / drift /\n* integrity / disjointness violations short-circuit with a\n* structured CLI error.\n* 2. **Read DB state**: marker rows + (when `skipSchema` is `false`)\n* schema introspection.\n* 3. **Verify**: {@link verifyMigration} returns per-space `markerCheck` +\n* per-space `schemaCheck` (each contract space verified against the full schema,\n* then scoped to its own contract space). Marker mismatches map to\n* `CliStructuredError` (code `5002`) so callers (CLI command) can render\n* and exit. Verify results are returned to the caller verbatim.\n*/\nasync function executeDbVerify(options) {\n\tconst { driver, familyInstance, onProgress, skipSchema, skipMarker } = options;\n\tconst loaded = await buildContractSpaceAggregate(buildLoadInputs(options));\n\tif (!loaded.ok) return notOk(loaded.failure);\n\tconst aggregate = loaded.value;\n\tconst markersBySpaceId = await familyInstance.readAllMarkers({ driver });\n\tconst schemaIntrospection = skipSchema ? null : await runIntrospection({\n\t\tdriver,\n\t\tfamilyInstance,\n\t\tonProgress,\n\t\tcontract: collectAggregateNamespaces(aggregate)\n\t});\n\tconst classifySubjectGranularity = hasSchemaSubjectClassifier(familyInstance) ? (issue) => familyInstance.classifySubjectGranularity(issue) : void 0;\n\tconst classifyEntityKind = hasSchemaSubjectClassifier(familyInstance) ? (issue) => familyInstance.classifyEntityKind(issue) : void 0;\n\temitVerifySpan(onProgress, \"spanStart\");\n\treturn finaliseVerifyResult({\n\t\tverifyResult: verifyMigration({\n\t\t\taggregate,\n\t\t\tmarkersBySpaceId,\n\t\t\tschemaIntrospection,\n\t\t\tmode: options.mode,\n\t\t\tverifySchemaForSpace: createPerSpaceVerifier(options),\n\t\t\t...ifDefined(\"classifySubjectGranularity\", classifySubjectGranularity),\n\t\t\t...ifDefined(\"classifyEntityKind\", classifyEntityKind)\n\t\t}),\n\t\taggregate,\n\t\tskipMarker,\n\t\tonProgress\n\t});\n}\nfunction buildLoadInputs(options) {\n\treturn {\n\t\ttargetId: options.targetId,\n\t\tmigrationsDir: options.migrationsDir,\n\t\tappContract: options.contract,\n\t\textensions: options.extensions,\n\t\tdeserializeContract: (json) => options.familyInstance.deserializeContract(json)\n\t};\n}\nasync function runIntrospection(args) {\n\tconst { driver, familyInstance, onProgress, contract } = args;\n\tonProgress?.({\n\t\taction: \"dbVerify\",\n\t\tkind: \"spanStart\",\n\t\tspanId: SPAN_IDS.introspect,\n\t\tlabel: \"Introspecting database schema\"\n\t});\n\ttry {\n\t\tconst result = await familyInstance.introspect({\n\t\t\tdriver,\n\t\t\tcontract\n\t\t});\n\t\tonProgress?.({\n\t\t\taction: \"dbVerify\",\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: SPAN_IDS.introspect,\n\t\t\toutcome: \"ok\"\n\t\t});\n\t\treturn result;\n\t} catch (error) {\n\t\tonProgress?.({\n\t\t\taction: \"dbVerify\",\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: SPAN_IDS.introspect,\n\t\t\toutcome: \"error\"\n\t\t});\n\t\tthrow error;\n\t}\n}\n/**\n* Build the per-space schema callback handed to the aggregate verifier.\n* When `skipSchema` is true the callback short-circuits with a synthetic\n* `ok` result so the verifier still runs the (cheap) schemaCheck loop\n* without invoking the family's verification path.\n*/\nfunction createPerSpaceVerifier(options) {\n\tconst { skipSchema, familyInstance, frameworkComponents } = options;\n\treturn (schema, space, verifyMode) => {\n\t\tif (skipSchema) return buildSkippedSchemaResult(space);\n\t\treturn familyInstance.verifySchema({\n\t\t\tcontract: space.contract(),\n\t\t\tschema,\n\t\t\tstrict: verifyMode === \"strict\",\n\t\t\tframeworkComponents\n\t\t});\n\t};\n}\nfunction emitVerifySpan(onProgress, kind) {\n\tif (kind === \"spanStart\") {\n\t\tonProgress?.({\n\t\t\taction: \"dbVerify\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: SPAN_IDS.verify,\n\t\t\tlabel: \"Verifying contract spaces\"\n\t\t});\n\t\treturn;\n\t}\n\tonProgress?.({\n\t\taction: \"dbVerify\",\n\t\tkind: \"spanEnd\",\n\t\tspanId: SPAN_IDS.verify,\n\t\toutcome: kind === \"spanEndOk\" ? \"ok\" : \"error\"\n\t});\n}\n/**\n* Map an {@link VerifierOutput} to the operation's\n* {@link ExecuteDbVerifyResult}, applying the `skipMarker` policy used\n* by the CLI's `--schema-only` mode.\n*/\nfunction finaliseVerifyResult(args) {\n\tconst { verifyResult, aggregate, skipMarker, onProgress } = args;\n\tif (!verifyResult.ok) {\n\t\temitVerifySpan(onProgress, \"spanEndError\");\n\t\treturn notOk(new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", \"Aggregate verifier introspection failed\", {\n\t\t\twhy: verifyResult.failure.detail,\n\t\t\tfix: \"Check database connectivity and the introspection tooling.\",\n\t\t\tdocsUrl: \"https://pris.ly/contract-spaces\"\n\t\t}));\n\t}\n\tconst markerError = skipMarker ? null : mapMarkerCheckFailures(aggregate.app.spaceId, verifyResult.value.markerCheck);\n\tif (markerError !== null) {\n\t\temitVerifySpan(onProgress, \"spanEndError\");\n\t\treturn notOk(markerError);\n\t}\n\temitVerifySpan(onProgress, \"spanEndOk\");\n\treturn ok({\n\t\tschemaResults: verifyResult.value.schemaCheck.perSpace,\n\t\tunclaimed: verifyResult.value.schemaCheck.unclaimed,\n\t\tspaceOrder: [aggregate.app.spaceId, ...aggregate.extensions.map((e) => e.spaceId)],\n\t\tappSpaceId: aggregate.app.spaceId\n\t});\n}\nfunction buildSkippedSchemaResult(space) {\n\tconst contract = space.contract();\n\tconst headRef = requireHeadRef(space);\n\tconst profileHash = castAs(contract).profileHash;\n\treturn {\n\t\tok: true,\n\t\tsummary: \"Schema verification skipped\",\n\t\tcontract: {\n\t\t\tstorageHash: headRef.hash,\n\t\t\t...profileHash ? { profileHash } : {}\n\t\t},\n\t\ttarget: { expected: contract.target },\n\t\tschema: { issues: [] },\n\t\ttimings: { total: 0 }\n\t};\n}\n/**\n* Translate per-space marker check failures and orphan markers into a\n* single CLI structured error envelope. Preserves the legacy code\n* `MIGRATION.CONTRACT_SPACE_VIOLATION` (was emitted by\n* `runContractSpaceVerifierMarkerCheck`).\n*/\nfunction mapMarkerCheckFailures(appSpaceId, section) {\n\tconst violations = [];\n\tfor (const [spaceId, result] of section.perSpace) {\n\t\tif (result.kind === \"ok\" || result.kind === \"absent\") continue;\n\t\tif (result.kind === \"hashMismatch\") {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\tspaceId,\n\t\t\t\tremediation: spaceId === appSpaceId ? \"Run `prisma-next db update` to advance the marker, or roll the database back to the recorded hash.\" : `Apply on-disk migrations under \\`migrations/${spaceId}/\\` to advance the marker, or remove the conflicting marker row.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (result.kind === \"missingInvariants\") violations.push({\n\t\t\tkind: \"invariantsMismatch\",\n\t\t\tspaceId,\n\t\t\tremediation: `Re-apply the migrations under \\`migrations/${spaceId}/\\` so the marker carries invariants: ${result.missing.join(\", \")}.`\n\t\t});\n\t}\n\tfor (const orphan of section.orphanMarkers) violations.push({\n\t\tkind: \"orphanMarker\",\n\t\tspaceId: orphan.spaceId,\n\t\tremediation: `Add the corresponding extension to \\`extensions\\` in \\`prisma-next.config.ts\\`, or delete the orphan marker row for \"${orphan.spaceId}\".`\n\t});\n\tif (violations.length === 0) return null;\n\tconst lines = violations.map((v) => `- [${v.kind}] ${v.spaceId}: ${v.remediation}`);\n\treturn new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", violations.length === 1 ? \"Contract-space verifier found a violation\" : `Contract-space verifier found violations (${violations.length})`, {\n\t\twhy: `The on-disk \\`migrations/\\` directory, the \\`extensions\\` declaration, and the live database marker rows are not in agreement.\\n${lines.join(\"\\n\")}`,\n\t\tfix: violations[0]?.remediation ?? \"Review and reconcile the violations listed above.\",\n\t\tdocsUrl: \"https://pris.ly/contract-spaces\",\n\t\tmeta: { violations }\n\t});\n}\n//#endregion\n//#region src/control-api/operations/migrate.ts\n/**\n* Apply pending migrations across every contract space (app +\n* extensions). Replay-only: graph-walk against the on-disk graph for\n* every contract space; no synth, no introspection.\n*\n* Pipeline:\n*\n* 1. Load aggregate from disk (loader hydrates extension graphs;\n* caller provides app-space packages).\n* 2. Read live marker rows per space (`familyInstance.readAllMarkers`).\n* 3. Per space: `resolveRecordedPath` plots the path from the live\n* marker to `space.headRef.hash` (or `refHash` for the app\n* space when provided). An empty-graph space whose elements are ALL\n* externally managed resolves declaratively (marker to head, zero\n* ops), mirroring the db-init aggregate planner: such a space ships\n* no DDL and has nothing to author. Every other empty-graph space\n* fails loudly — \"never planned\" is a user-error condition for\n* replay.\n* 4. Hand off to {@link runMigration} (the runner-driving tail\n* shared with `db init` / `db update`). Marker advancement is\n* inside the per-space transaction.\n*\n* Encodes the replay-only contract: the app contract space must have an\n* authored migration graph on disk before this operation can advance it.\n*/\nasync function executeMigrate(options) {\n\tconst { driver, familyInstance, contract, migrations, frameworkComponents, migrationsDir, extensions, targetId, refHash, refInvariants, refName, onProgress } = options;\n\tconst loaded = await buildContractSpaceAggregate({\n\t\ttargetId,\n\t\tmigrationsDir,\n\t\tappContract: contract,\n\t\textensions,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t});\n\tif (!loaded.ok) throw loaded.failure;\n\tconst aggregate = loaded.value;\n\tconst markerRows = await familyInstance.readAllMarkers({ driver });\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tconst perSpacePlans = /* @__PURE__ */ new Map();\n\tconst atHeadResolutions = /* @__PURE__ */ new Map();\n\tfor (const space of allSpaces) {\n\t\tconst isAppSpace = space.spaceId === aggregate.app.spaceId;\n\t\tconst headRef = requireHeadRef(space);\n\t\tconst spaceTargetHash = isAppSpace && refHash !== void 0 ? refHash : headRef.hash;\n\t\tconst outcome = planSpacePath({\n\t\t\tspace,\n\t\t\taggregate,\n\t\t\ttargetHash: spaceTargetHash,\n\t\t\trefInvariants: isAppSpace && refHash !== void 0 ? refInvariants : void 0,\n\t\t\tliveMarker: markerRows.get(space.spaceId) ?? null,\n\t\t\t...isAppSpace ? { refName } : {}\n\t\t});\n\t\tif (outcome.kind === \"at-head\") {\n\t\t\tatHeadResolutions.set(space.spaceId, outcome.plan);\n\t\t\tcontinue;\n\t\t}\n\t\tif (outcome.kind === \"never-planned\") return notOk(buildNeverPlannedFailure(outcome.spaceId, outcome.targetHash));\n\t\tif (outcome.kind === \"unreachable\") return notOk(buildPathNotFoundFailure(outcome.spaceId, outcome.liveMarker, outcome.targetHash));\n\t\tif (outcome.kind === \"unsatisfiable\") {\n\t\t\tconst structural = findPathWithDecision(outcome.targetSpace.graph(), outcome.liveHash, spaceTargetHash, { required: /* @__PURE__ */ new Set() });\n\t\t\tconst structuralPath = structural.kind === \"ok\" ? structural.decision.selectedPath.map((edge) => ({\n\t\t\t\tdirName: edge.dirName,\n\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\tfrom: edge.from,\n\t\t\t\tto: edge.to,\n\t\t\t\tinvariants: edge.invariants\n\t\t\t})) : [];\n\t\t\tthrow errorNoInvariantPath({\n\t\t\t\t...outcome.refName !== void 0 ? { refName: outcome.refName } : {},\n\t\t\t\trequired: outcome.targetInvariants,\n\t\t\t\tmissing: outcome.missing,\n\t\t\t\tstructuralPath\n\t\t\t});\n\t\t}\n\t\tperSpacePlans.set(space.spaceId, outcome.plan);\n\t}\n\tconst canonicalOrder = [...aggregate.extensions.map((m) => m.spaceId), aggregate.app.spaceId];\n\tconst applyOrder = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId));\n\tif (!applyOrder.some((spaceId) => {\n\t\tconst entry = perSpacePlans.get(spaceId);\n\t\treturn entry !== void 0 && planRequiresExecution(entry);\n\t})) {\n\t\tconst ordered = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId) || atHeadResolutions.has(spaceId)).map((spaceId) => {\n\t\t\tconst entry = perSpacePlans.get(spaceId) ?? atHeadResolutions.get(spaceId);\n\t\t\tif (entry === void 0) throw new InternalError(`Unreachable: missing per-space plan for \"${spaceId}\"`);\n\t\t\treturn {\n\t\t\t\tspaceId,\n\t\t\t\tentry\n\t\t\t};\n\t\t});\n\t\tconst perSpace = buildPerSpaceBreakdown(ordered, aggregate.app.spaceId, { includeMarkers: true });\n\t\tconst totalSpaces = ordered.length;\n\t\treturn ok(buildSuccess({\n\t\t\taggregate,\n\t\t\torderedResolutions: ordered,\n\t\t\tperSpace,\n\t\t\ttotalOpsExecuted: 0,\n\t\t\tsummary: totalSpaces === 0 ? \"Already up to date — no contract spaces are loaded\" : totalSpaces === 1 ? \"Already up to date\" : `Already up to date across ${totalSpaces} space(s)`\n\t\t}));\n\t}\n\tconst applied = await runMigration({\n\t\taggregate,\n\t\tperSpacePlans,\n\t\tapplyOrder,\n\t\tdriver,\n\t\tfamilyInstance,\n\t\tmigrations,\n\t\tframeworkComponents,\n\t\tpolicy: { allowedOperationClasses: [\n\t\t\t\"additive\",\n\t\t\t\"widening\",\n\t\t\t\"destructive\",\n\t\t\t\"data\"\n\t\t] },\n\t\taction: \"migrate\",\n\t\t...ifDefined(\"onProgress\", onProgress)\n\t});\n\tif (!applied.ok) return notOk({\n\t\tcode: \"RUNNER_FAILED\",\n\t\tsummary: applied.failure.summary,\n\t\twhy: applied.failure.why,\n\t\tmeta: applied.failure.meta\n\t});\n\tconst orderedAll = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId) || atHeadResolutions.has(spaceId)).map((spaceId) => {\n\t\tif (perSpacePlans.has(spaceId)) {\n\t\t\tconst fromRunner = applied.value.orderedResolutions.find((r) => r.spaceId === spaceId);\n\t\t\tif (fromRunner !== void 0) return fromRunner;\n\t\t}\n\t\tconst entry = atHeadResolutions.get(spaceId);\n\t\tif (entry === void 0) throw new InternalError(`Unreachable: missing per-space plan for \"${spaceId}\"`);\n\t\treturn {\n\t\t\tspaceId,\n\t\t\tentry\n\t\t};\n\t});\n\tconst perSpaceAll = buildPerSpaceBreakdown(orderedAll, aggregate.app.spaceId, { includeMarkers: true });\n\tconst summary = `Applied ${applied.value.orderedResolutions.reduce((sum, r) => sum + r.entry.migrationEdges.length, 0)} migration(s) (${applied.value.totalOpsExecuted} operation(s)) across ${orderedAll.length} contract space(s)`;\n\treturn ok(buildSuccess({\n\t\taggregate,\n\t\torderedResolutions: orderedAll,\n\t\tperSpace: perSpaceAll,\n\t\ttotalOpsExecuted: applied.value.totalOpsExecuted,\n\t\tsummary\n\t}));\n}\n/**\n* Compute the graph-walk path for one contract space.\n*\n* Encapsulates the invariant-correct input assembly that both\n* `executeMigrate` and `executeMigrateShowCommand` must use:\n* - `currentMarker` carries the full live marker including `invariants`\n* (not a stripped `{ storageHash, invariants: [] }` shell).\n* - `targetInvariants` uses the caller-supplied `refInvariants` when a\n* `--to` ref was resolved (not always the file head ref's invariants).\n*\n* Both callers map the returned `SpacePathOutcome` to their own error\n* representation; the path-compute logic is shared and identical.\n*\n* @internal Exported for `executeMigrateShowCommand`.\n*/\nfunction planSpacePath({ space, aggregate, targetHash, refInvariants, liveMarker, refName }) {\n\tconst isAppSpace = space.spaceId === aggregate.app.spaceId;\n\tconst headRef = requireHeadRef(space);\n\tif (space.graph().nodes.size === 0) {\n\t\tconst liveHash = liveMarker?.storageHash;\n\t\tif (targetHash === liveHash || liveHash === void 0 && targetHash === EMPTY_CONTRACT_HASH) return {\n\t\t\tkind: \"at-head\",\n\t\t\tplan: buildAtHeadResolution({\n\t\t\t\taggregateTargetId: aggregate.targetId,\n\t\t\t\tspace,\n\t\t\t\ttargetHash,\n\t\t\t\tliveMarker\n\t\t\t})\n\t\t};\n\t\tif (!isAppSpace && allStorageElementsExternal(space.contract())) {\n\t\t\tif (headRef.invariants.length > 0) return {\n\t\t\t\tkind: \"unsatisfiable\",\n\t\t\t\tspaceId: space.spaceId,\n\t\t\t\tisAppSpace,\n\t\t\t\tmissing: [...headRef.invariants].sort(),\n\t\t\t\ttargetInvariants: headRef.invariants,\n\t\t\t\ttargetSpace: space,\n\t\t\t\tliveHash: liveHash ?? EMPTY_CONTRACT_HASH,\n\t\t\t\trefName: void 0\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tkind: \"ok\",\n\t\t\t\tplan: buildAtHeadResolution({\n\t\t\t\t\taggregateTargetId: aggregate.targetId,\n\t\t\t\t\tspace,\n\t\t\t\t\ttargetHash,\n\t\t\t\t\tliveMarker\n\t\t\t\t})\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tkind: \"never-planned\",\n\t\t\tspaceId: space.spaceId,\n\t\t\ttargetHash\n\t\t};\n\t}\n\tconst targetInvariants = isAppSpace && refInvariants !== void 0 ? refInvariants : headRef.invariants;\n\tconst targetSpace = targetHash === headRef.hash && targetInvariants === headRef.invariants ? space : {\n\t\t...space,\n\t\theadRef: {\n\t\t\thash: targetHash,\n\t\t\tinvariants: targetInvariants\n\t\t}\n\t};\n\tconst walked = resolveRecordedPath({\n\t\taggregateTargetId: aggregate.targetId,\n\t\tspace: targetSpace,\n\t\tcurrentMarker: liveMarker,\n\t\t...isAppSpace && refName !== void 0 ? { refName } : {}\n\t});\n\tif (walked.kind === \"unreachable\") return {\n\t\tkind: \"unreachable\",\n\t\tspaceId: space.spaceId,\n\t\tliveMarker,\n\t\ttargetHash\n\t};\n\tif (walked.kind === \"unsatisfiable\") {\n\t\tconst liveHash = liveMarker?.storageHash ?? EMPTY_CONTRACT_HASH;\n\t\treturn {\n\t\t\tkind: \"unsatisfiable\",\n\t\t\tspaceId: space.spaceId,\n\t\t\tisAppSpace,\n\t\t\tmissing: walked.missing,\n\t\t\ttargetInvariants,\n\t\t\ttargetSpace,\n\t\t\tliveHash,\n\t\t\trefName\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"ok\",\n\t\tplan: walked.result\n\t};\n}\n/**\n* Build a zero-op {@link PerSpacePlan} for an empty-graph space —\n* either one whose live marker already matches the target (at-head), or\n* an all-external extension space whose marker must advance to the head\n* ref with no DDL (declared-state). Lets the apply pipeline thread the\n* space through `perSpacePlans` -> `applyOrder` -> the success\n* envelope's `perSpace[]` block so the result reflects every loaded\n* space, even when there is nothing to execute.\n*/\nfunction buildAtHeadResolution(args) {\n\tconst { aggregateTargetId, space, targetHash, liveMarker } = args;\n\treturn {\n\t\tplan: {\n\t\t\ttargetId: aggregateTargetId,\n\t\t\tspaceId: space.spaceId,\n\t\t\torigin: liveMarker === null ? null : { storageHash: liveMarker.storageHash },\n\t\t\tdestination: { storageHash: targetHash },\n\t\t\toperations: [],\n\t\t\tprovidedInvariants: []\n\t\t},\n\t\tdisplayOps: [],\n\t\tdestinationContract: space.contract(),\n\t\tstrategy: \"declared-state\",\n\t\tmigrationEdges: [buildFabricatedMigrationEdge({\n\t\t\tcurrentMarkerStorageHash: liveMarker?.storageHash,\n\t\t\tdestinationStorageHash: targetHash,\n\t\t\toperationCount: 0\n\t\t})]\n\t};\n}\n/**\n* A plan needs the runner when it executes operations or advances the\n* space's marker (a declared-state resolution has zero operations but a\n* destination hash the live marker doesn't carry yet).\n*/\nfunction planRequiresExecution(entry) {\n\tif (entry.plan.operations.length > 0) return true;\n\treturn entry.plan.origin?.storageHash !== entry.plan.destination.storageHash;\n}\nfunction buildSuccess(args) {\n\tconst appResolution = args.orderedResolutions.find((r) => r.spaceId === args.aggregate.app.spaceId);\n\tconst appMarkerHash = appResolution?.entry.plan.destination.storageHash ?? requireHeadRef(args.aggregate.app).hash;\n\tconst applied = args.orderedResolutions.flatMap((r) => {\n\t\treturn r.entry.migrationEdges.map((edge) => ({\n\t\t\tspaceId: r.spaceId,\n\t\t\tdirName: edge.dirName,\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tfrom: edge.from,\n\t\t\tto: edge.to,\n\t\t\toperationsExecuted: edge.operationCount\n\t\t}));\n\t});\n\tconst appPlan = appResolution?.entry;\n\tconst pathDecision = appPlan?.pathDecision ? {\n\t\tfromHash: appPlan.pathDecision.fromHash,\n\t\ttoHash: appPlan.pathDecision.toHash,\n\t\talternativeCount: appPlan.pathDecision.alternativeCount,\n\t\ttieBreakReasons: appPlan.pathDecision.tieBreakReasons,\n\t\t...appPlan.pathDecision.refName !== void 0 ? { refName: appPlan.pathDecision.refName } : {},\n\t\trequiredInvariants: appPlan.pathDecision.requiredInvariants ?? [],\n\t\tsatisfiedInvariants: appPlan.pathDecision.satisfiedInvariants ?? [],\n\t\tselectedPath: appPlan.pathDecision.selectedPath.map((entry) => ({\n\t\t\tdirName: entry.dirName,\n\t\t\tmigrationHash: entry.migrationHash,\n\t\t\tfrom: entry.from,\n\t\t\tto: entry.to,\n\t\t\tinvariants: entry.invariants\n\t\t}))\n\t} : void 0;\n\treturn {\n\t\tmigrationsApplied: applied.length,\n\t\tmarkerHash: appMarkerHash,\n\t\tapplied,\n\t\tsummary: args.summary,\n\t\tperSpace: args.perSpace,\n\t\t...pathDecision !== void 0 ? { pathDecision } : {}\n\t};\n}\n/**\n* Build the `neverPlanned` failure raised when a contract space that\n* declares managed storage elements has no on-disk migration graph but\n* migrate was asked to reach a target hash. All-external spaces never reach\n* this: they resolve declaratively (marker advances to the head ref with\n* zero operations). The `why` states only the condition; the recovery\n* sequence is composed by `errorPathUnreachable`'s `fix`.\n*\n* @internal Exported for testing only.\n*/\nfunction buildNeverPlannedFailure(spaceId, targetHash) {\n\treturn {\n\t\tcode: \"MIGRATION_PATH_NOT_FOUND\",\n\t\tsummary: `No on-disk migrations for contract space \"${spaceId}\"`,\n\t\twhy: `migrate is replay-only: a contract space that declares managed storage elements must have an authored migration graph on disk. Space \"${spaceId}\" has no migrations under \\`migrations/${spaceId}/\\` but its head ref targets \"${targetHash}\".`,\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\ttarget: targetHash,\n\t\t\tkind: \"neverPlanned\"\n\t\t}\n\t};\n}\n/**\n* Build the `pathUnreachable` failure raised when an emitted contract has no\n* on-disk migration edge from the current marker to the target. The `why`\n* states only the condition (no edge between the two named states, and migrate\n* replays edges rather than inventing them); the recovery sequence — plan the\n* edge, then re-apply — is composed by `errorPathUnreachable`'s `fix`, so the\n* two read as one non-redundant plan-then-apply story.\n*\n* @internal Exported for testing only.\n*/\nfunction buildPathNotFoundFailure(spaceId, marker, targetHash) {\n\tconst fromHash = marker?.storageHash ?? \"<empty>\";\n\treturn {\n\t\tcode: \"MIGRATION_PATH_NOT_FOUND\",\n\t\tsummary: spaceId === \"app\" ? \"Current contract has no planned migration path\" : `Current contract has no planned migration path for contract space \"${spaceId}\"`,\n\t\twhy: `No migration edge connects the current state \"${fromHash}\" to the target \"${targetHash}\" in contract space \"${spaceId}\". The on-disk migration graph does not join the two, and migrate replays existing edges — it never invents one.`,\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\tfromHash,\n\t\t\ttargetHash,\n\t\t\tkind: \"pathUnreachable\"\n\t\t}\n\t};\n}\n//#endregion\n//#region src/control-api/client.ts\n/**\n* Creates a programmatic control client for Prisma Next operations.\n*\n* The client accepts framework component descriptors at creation time,\n* manages driver lifecycle via connect()/close(), and exposes domain\n* operations that delegate to the existing family instance methods.\n*\n* @see {@link ControlClient} for the client interface\n* @see README.md \"Programmatic Control API\" section for usage examples\n*/\nfunction createControlClient(options) {\n\treturn new ControlClientImpl(options);\n}\n/**\n* Implementation of ControlClient.\n* Manages initialization and connection state, delegates operations to family instance.\n*/\nvar ControlClientImpl = class {\n\toptions;\n\tstack = null;\n\tdriver = null;\n\tfamilyInstance = null;\n\tframeworkComponents = null;\n\tinitialized = false;\n\tdefaultConnection;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t\tthis.defaultConnection = options.connection;\n\t}\n\tinit() {\n\t\tif (this.initialized) return;\n\t\tthis.stack = createControlStack({\n\t\t\tfamily: this.options.family,\n\t\t\ttarget: this.options.target,\n\t\t\tadapter: this.options.adapter,\n\t\t\tdriver: this.options.driver,\n\t\t\textensions: this.options.extensions\n\t\t});\n\t\tthis.familyInstance = this.options.family.create(this.stack);\n\t\tconst rawComponents = [\n\t\t\tthis.options.target,\n\t\t\tthis.options.adapter,\n\t\t\t...this.options.extensions ?? []\n\t\t];\n\t\tthis.frameworkComponents = assertFrameworkComponentsCompatible(this.options.family.familyId, this.options.target.targetId, rawComponents);\n\t\tthis.initialized = true;\n\t}\n\tasync connect(connection) {\n\t\tthis.init();\n\t\tif (this.driver) throw new CliStructuredError(\"DRIVER.ALREADY_CONNECTED\", \"Already connected. Call close() before reconnecting.\");\n\t\tconst resolvedConnection = connection ?? this.defaultConnection;\n\t\tif (resolvedConnection === void 0) throw new CliStructuredError(\"CONFIG.DB_CONNECTION_REQUIRED\", \"No connection provided. Pass a connection to connect() or provide a default connection when creating the client.\");\n\t\tif (!this.stack?.driver) throw new CliStructuredError(\"CONFIG.DRIVER_REQUIRED\", \"Driver is not configured. Pass a driver descriptor when creating the control client to enable database operations.\");\n\t\tthis.driver = await this.stack.driver.create(resolvedConnection);\n\t}\n\tasync close() {\n\t\tif (this.driver) {\n\t\t\tawait this.driver.close();\n\t\t\tthis.driver = null;\n\t\t}\n\t}\n\t/**\n\t* Construct the control adapter once for a migration operation and return\n\t* it, mirroring how the runtime plane builds the execution adapter once in\n\t* `createExecutionStack`. Only `dbInit` / `dbUpdate` need it (it lowers the\n\t* planner's DDL); read-only operations never build it. The descriptor is\n\t* optional on the stack — targets without migrations omit it.\n\t*/\n\tbuildControlAdapter() {\n\t\tthis.init();\n\t\tif (!this.stack?.adapter) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" requires an adapter for migrations`);\n\t\treturn this.stack.adapter.create(this.stack);\n\t}\n\tasync ensureConnected() {\n\t\tthis.init();\n\t\tif (!this.driver && this.defaultConnection !== void 0) await this.connect(this.defaultConnection);\n\t\tif (!this.driver || !this.familyInstance || !this.frameworkComponents) throw new CliStructuredError(\"DRIVER.NOT_CONNECTED\", \"Not connected. Call connect(connection) first.\");\n\t\treturn {\n\t\t\tdriver: this.driver,\n\t\t\tfamilyInstance: this.familyInstance,\n\t\t\tframeworkComponents: this.frameworkComponents\n\t\t};\n\t}\n\tasync connectWithProgress(connection, action, onProgress) {\n\t\tif (connection === void 0) return;\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"connect\",\n\t\t\tlabel: \"Connecting to database...\"\n\t\t});\n\t\ttry {\n\t\t\tawait this.connect(connection);\n\t\t\tonProgress?.({\n\t\t\t\taction,\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"connect\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction,\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"connect\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync verify(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"verify\", onProgress);\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"verify\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"verify\",\n\t\t\tlabel: \"Verifying database marker...\"\n\t\t});\n\t\ttry {\n\t\t\tconst result = await familyInstance.verify({\n\t\t\t\tdriver,\n\t\t\t\tcontract,\n\t\t\t\texpectedTargetId: this.options.target.targetId,\n\t\t\t\tcontractPath: \"\"\n\t\t\t});\n\t\t\tonProgress?.({\n\t\t\t\taction: \"verify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"verify\",\n\t\t\t\toutcome: result.ok ? \"ok\" : \"error\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"verify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"verify\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync schemaVerify(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"schemaVerify\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"schemaVerify\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"schemaVerify\",\n\t\t\tlabel: \"Verifying database schema...\"\n\t\t});\n\t\ttry {\n\t\t\tconst schema = await familyInstance.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract\n\t\t\t});\n\t\t\tconst result = familyInstance.verifySchema({\n\t\t\t\tcontract,\n\t\t\t\tschema,\n\t\t\t\tstrict: options.strict ?? false,\n\t\t\t\tframeworkComponents\n\t\t\t});\n\t\t\tonProgress?.({\n\t\t\t\taction: \"schemaVerify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"schemaVerify\",\n\t\t\t\toutcome: result.ok ? \"ok\" : \"error\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"schemaVerify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"schemaVerify\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync sign(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"sign\", onProgress);\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"sign\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"sign\",\n\t\t\tlabel: \"Signing database...\"\n\t\t});\n\t\ttry {\n\t\t\tconst result = await familyInstance.sign({\n\t\t\t\tdriver,\n\t\t\t\tcontract,\n\t\t\t\tcontractPath: options.contractPath ?? \"\",\n\t\t\t\t...ifDefined(\"configPath\", options.configPath)\n\t\t\t});\n\t\t\tonProgress?.({\n\t\t\t\taction: \"sign\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"sign\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"sign\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"sign\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync dbInit(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbInit\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tif (!hasMigrations(this.options.target)) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" does not support migrations`);\n\t\tconst adapter = this.buildControlAdapter();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\treturn executeDbInit({\n\t\t\tdriver,\n\t\t\tadapter,\n\t\t\tfamilyInstance,\n\t\t\tcontract,\n\t\t\tmode: options.mode,\n\t\t\tmigrations: this.options.target.migrations,\n\t\t\tframeworkComponents,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync dbUpdate(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbUpdate\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tif (!hasMigrations(this.options.target)) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" does not support migrations`);\n\t\tconst adapter = this.buildControlAdapter();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\treturn executeDbUpdate({\n\t\t\tdriver,\n\t\t\tadapter,\n\t\t\tfamilyInstance,\n\t\t\tcontract,\n\t\t\tmode: options.mode,\n\t\t\tmigrations: this.options.target.migrations,\n\t\t\tframeworkComponents,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\t...ifDefined(\"acceptDataLoss\", options.acceptDataLoss),\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync dbVerify(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbVerify\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\treturn executeDbVerify({\n\t\t\tdriver,\n\t\t\tfamilyInstance,\n\t\t\tcontract: options.contract,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\tframeworkComponents,\n\t\t\tmode: options.strict ? \"strict\" : \"lenient\",\n\t\t\tskipSchema: options.skipSchema,\n\t\t\tskipMarker: options.skipMarker,\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync readMarker() {\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\treturn familyInstance.readMarker({\n\t\t\tdriver,\n\t\t\tspace: APP_SPACE_ID\n\t\t});\n\t}\n\tasync readAllMarkers() {\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\treturn familyInstance.readAllMarkers({ driver });\n\t}\n\t/** Reads the per-migration journal; omit `space` to return every space. */\n\tasync readLedger(space) {\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\treturn familyInstance.readLedger({\n\t\t\tdriver,\n\t\t\t...ifDefined(\"space\", space)\n\t\t});\n\t}\n\tasync migrate(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"migrate\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tif (!hasMigrations(this.options.target)) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" does not support migrations`);\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\treturn executeMigrate({\n\t\t\tdriver,\n\t\t\tfamilyInstance,\n\t\t\tcontract,\n\t\t\tmigrations: this.options.target.migrations,\n\t\t\tframeworkComponents,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\t...ifDefined(\"refHash\", options.refHash),\n\t\t\t...ifDefined(\"refInvariants\", options.refInvariants),\n\t\t\t...ifDefined(\"refName\", options.refName),\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync introspect(options) {\n\t\tconst onProgress = options?.onProgress;\n\t\tawait this.connectWithProgress(options?.connection, \"introspect\", onProgress);\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\toptions?.schema;\n\t\tonProgress?.({\n\t\t\taction: \"introspect\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"introspect\",\n\t\t\tlabel: \"Introspecting database schema...\"\n\t\t});\n\t\ttry {\n\t\t\tconst result = await familyInstance.introspect({ driver });\n\t\t\tonProgress?.({\n\t\t\t\taction: \"introspect\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"introspect\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"introspect\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"introspect\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\ttoSchemaView(schemaIR) {\n\t\tthis.init();\n\t\tif (this.familyInstance && hasSchemaView(this.familyInstance)) return this.familyInstance.toSchemaView(schemaIR);\n\t}\n\tinferPslContract(schemaIR) {\n\t\tthis.init();\n\t\tif (this.familyInstance && hasPslContractInfer(this.familyInstance)) return this.familyInstance.inferPslContract(schemaIR);\n\t}\n\tgetPslBlockDescriptors() {\n\t\tthis.init();\n\t\treturn this.stack.authoringContributions.pslBlockDescriptors;\n\t}\n\ttoOperationPreview(operations) {\n\t\tthis.init();\n\t\tif (this.familyInstance && hasOperationPreview(this.familyInstance)) return this.familyInstance.toOperationPreview(operations);\n\t}\n\tasync emit(options) {\n\t\tconst { onProgress, contractConfig } = options;\n\t\tthis.init();\n\t\tif (!this.familyInstance) throw new InternalError(\"Family instance was not initialized. This is a bug.\");\n\t\tlet contractRaw;\n\t\tonProgress?.({\n\t\t\taction: \"emit\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"resolveSource\",\n\t\t\tlabel: \"Resolving contract source...\"\n\t\t});\n\t\ttry {\n\t\t\tconst stack = this.stack;\n\t\t\tconst sourceContext = {\n\t\t\t\tcomposedExtensions: stack.extensions.map((p) => p.id),\n\t\t\t\tcomposedExtensionContracts: stack.extensionContracts,\n\t\t\t\tauthoringContributions: stack.authoringContributions,\n\t\t\t\tcodecLookup: stack.codecLookup,\n\t\t\t\tcontrolMutationDefaults: stack.controlMutationDefaults,\n\t\t\t\tresolvedInputs: contractConfig.source.inputs ?? [],\n\t\t\t\tcapabilities: stack.capabilities\n\t\t\t};\n\t\t\tconst providerResult = await contractConfig.source.load(sourceContext);\n\t\t\tif (!providerResult.ok) {\n\t\t\t\tonProgress?.({\n\t\t\t\t\taction: \"emit\",\n\t\t\t\t\tkind: \"spanEnd\",\n\t\t\t\t\tspanId: \"resolveSource\",\n\t\t\t\t\toutcome: \"error\"\n\t\t\t\t});\n\t\t\t\treturn notOk({\n\t\t\t\t\tcode: \"CONTRACT_SOURCE_INVALID\",\n\t\t\t\t\tsummary: providerResult.failure.summary,\n\t\t\t\t\twhy: providerResult.failure.summary,\n\t\t\t\t\tmeta: providerResult.failure.meta,\n\t\t\t\t\tdiagnostics: providerResult.failure\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontractRaw = providerResult.value;\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"resolveSource\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"resolveSource\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\treturn notOk({\n\t\t\t\tcode: \"CONTRACT_SOURCE_INVALID\",\n\t\t\t\tsummary: \"Failed to resolve contract source\",\n\t\t\t\twhy: message,\n\t\t\t\tdiagnostics: {\n\t\t\t\t\tsummary: \"Contract source provider threw an exception\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PROVIDER_THROW\",\n\t\t\t\t\t\tmessage\n\t\t\t\t\t}]\n\t\t\t\t},\n\t\t\t\tmeta: void 0\n\t\t\t});\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"emit\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"emit\",\n\t\t\tlabel: \"Emitting contract...\"\n\t\t});\n\t\ttry {\n\t\t\tconst enrichedIR = enrichContract(contractRaw, this.frameworkComponents ?? []);\n\t\t\tconst rawContractJson = this.options.target.contractSerializer.serializeContract(enrichedIR);\n\t\t\tlet deserializedContract;\n\t\t\ttry {\n\t\t\t\tdeserializedContract = this.familyInstance.deserializeContract(rawContractJson);\n\t\t\t} catch (error) {\n\t\t\t\tonProgress?.({\n\t\t\t\t\taction: \"emit\",\n\t\t\t\t\tkind: \"spanEnd\",\n\t\t\t\t\tspanId: \"emit\",\n\t\t\t\t\toutcome: \"error\"\n\t\t\t\t});\n\t\t\t\treturn notOk({\n\t\t\t\t\tcode: \"CONTRACT_VALIDATION_FAILED\",\n\t\t\t\t\tsummary: \"Contract validation failed\",\n\t\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\t\tmeta: void 0\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst result = await emit(deserializedContract, this.stack, this.options.family.emission, { serializeContract: (contract) => this.options.target.contractSerializer.serializeContract(contract) });\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"emit\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t\treturn ok({\n\t\t\t\tstorageHash: result.storageHash,\n\t\t\t\t...ifDefined(\"executionHash\", result.executionHash),\n\t\t\t\tprofileHash: result.profileHash,\n\t\t\t\tcontractJson: result.contractJson,\n\t\t\t\tcontractDts: result.contractDts\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"emit\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\treturn notOk({\n\t\t\t\tcode: \"EMIT_FAILED\",\n\t\t\t\tsummary: \"Failed to emit contract\",\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tmeta: void 0\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { executeDbInit as a, executeDbUpdate as i, planSpacePath as n, executeDbVerify as r, createControlClient as t };\n\n//# sourceMappingURL=client-75qrAPqf.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,gBAAgB,YAAY;CACpC,OAAO,WAAW,KAAK,QAAQ;EAC9B,IAAI,GAAG;EACP,OAAO,GAAG;EACV,gBAAgB,GAAG;CACpB,EAAE;AACH;;;;;AAOA,MAAM,cAAc;;;;;;;;;;;;;;;;;AAiBpB,eAAe,aAAa,QAAQ;CACnC,MAAM,EAAE,WAAW,eAAe,YAAY,QAAQ,gBAAgB,YAAY,qBAAqB,QAAQ,QAAQ,eAAe;CACtI,MAAM,qBAAqB,eAAe,YAAY,aAAa;CACnE,MAAM,SAAS,WAAW,aAAa,cAAc;CACrD,aAAa;EACZ;EACA,MAAM;EACN,QAAQ;EACR,OAAO,uBAAuB,MAAM;CACrC,CAAC;CACD,MAAM,kBAAkB,mBAAmB,KAAK,OAAO;EACtD,OAAO,EAAE;EACT,MAAM,EAAE,MAAM;EACd;EACA,qBAAqB,EAAE,MAAM;EAC7B;EACA;EACA,gBAAgB,EAAE,MAAM;EACxB,oBAAoB;CACrB,EAAE;CACF,MAAM,eAAe,MAAM,OAAO,QAAQ;EACzC;EACA;CACD,CAAC;CACD,IAAI,CAAC,aAAa,IAAI;EACrB,aAAa;GACZ;GACA,MAAM;GACN,QAAQ;GACR,SAAS;EACV,CAAC;EACD,OAAO,MAAM;GACZ,SAAS,aAAa,QAAQ;GAC9B,GAAG,UAAU,OAAO,aAAa,Q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,IAAI;GACH,MAAM,aAAa,eAAe,aAAa,KAAK,uBAAuB,CAAC,CAAC;GAC7E,MAAM,kBAAkB,KAAK,QAAQ,OAAO,mBAAmB,kBAAkB,UAAU;GAC3F,IAAI;GACJ,IAAI;IACH,uBAAuB,KAAK,eAAe,oBAAoB,eAAe;GAC/E,SAAS,OAAO;IACf,aAAa;KACZ,QAAQ;KACR,MAAM;KACN,QAAQ;KACR,SAAS;IACV,CAAC;IACD,OAAO,MAAM;KACZ,MAAM;KACN,SAAS;KACT,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;KAC1D,MAAM,KAAK;IACZ,CAAC;GACF;GACA,MAAM,SAAS,MAAM,KAAK,sBAAsB,KAAK,OAAO,KAAK,QAAQ,OAAO,UAAU,EAAE,oBAAoB,aAAa,KAAK,QAAQ,OAAO,mBAAmB,kBAAkB,QAAQ,EAAE,CAAC;GACjM,aAAa;IACZ,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,SAAS;GACV,CAAC;GACD,OAAO,GAAG;IACT,aAAa,OAAO;IACpB,GAAG,UAAU,iBAAiB,OAAO,aAAa;IAClD,aAAa,OAAO;IACpB,cAAc,OAAO;IACrB,aAAa,OAAO;GACrB,CAAC;EACF,SAAS,OAAO;GACf,aAAa;IACZ,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,SAAS;GACV,CAAC;GACD,OAAO,MAAM;IACZ,MAAM;IACN,SAAS;IACT,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC1D,MAAM,KAAK;GACZ,CAAC;EACF;CACD;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-helpers-CAoXqAY9-DWUBcTXM.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/command-helpers-CAoXqAY9.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 { notOk } from \"@internal/utils/result\";\nimport { relative, resolve } from \"pathe\";\nimport { readFile } from \"node:fs/promises\";\nimport { hasMigrations } from \"@internal/framework-components/control\";\nimport { ERROR_CODE_DESTRUCTIVE_CHANGES, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorRunnerFailed, errorRuntime, errorRuntime as errorRuntime$1, errorTargetMismatch } from \"@internal/errors/execution\";\nimport \"@internal/errors/migration\";\nimport { APP_SPACE_ID as APP_SPACE_ID$1, spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\nimport { blue, bold, cyan, dim, green, magenta, red, yellow } from \"colorette\";\nimport wrapAnsi from \"wrap-ansi\";\nimport stringWidth from \"string-width\";\nimport stripAnsi from \"strip-ansi\";\nimport { isCI } from \"ci-info\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport * as clack from \"@clack/prompts\";\n//#region src/utils/cli-errors.ts\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\treturn errorRuntime(`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\tmeta: {\n\t\t\tcode: \"MIGRATION.HASH_NOT_IN_GRAPH\",\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 errorRuntime(`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\tmeta: {\n\t\t\tcode: \"MIGRATION.REF_SET_EMPTY_SENTINEL\",\n\t\t\thash\n\t\t}\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 errorRuntime(\"`--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\tmeta: {\n\t\t\tcode: \"MIGRATION.LEGEND_HUMAN_ONLY\",\n\t\t\tconflictingFlag\n\t\t}\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 errorRuntime(`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\tmeta: {\n\t\t\tcode: \"MIGRATION.INVALID_SPACE_ID\",\n\t\t\tspaceId\n\t\t}\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\treturn errorRuntime(`Unknown contract space: ${spaceId}`, {\n\t\twhy: `No directory named \"${spaceId}\" exists under the migrations root.`,\n\t\tfix,\n\t\tmeta: {\n\t\t\tcode: \"MIGRATION.SPACE_NOT_FOUND\",\n\t\t\tspaceId,\n\t\t\tavailableSpaces: [...availableSpaces]\n\t\t}\n\t});\n}\nfunction errorRefSetBundleNotFound(hash) {\n\treturn errorRuntime(`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\tmeta: {\n\t\t\tcode: \"MIGRATION.REF_SET_BUNDLE_NOT_FOUND\",\n\t\t\thash\n\t\t}\n\t});\n}\nfunction errorPlanForgotTheFlag(resolvedHash, reachableRefs, graphTipHash) {\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\treturn errorRuntime(`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\tmeta: {\n\t\t\tcode: \"MIGRATION.HASH_NOT_IN_GRAPH\",\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});\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\treturn errorRuntime(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\tmeta: {\n\t\t\tcode: \"MIGRATION.SNAPSHOT_MISSING\",\n\t\t\tidentifier,\n\t\t\tviaRef\n\t\t}\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\treturn errorRuntime(\"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\tmeta: {\n\t\t\tcode: \"MIGRATION.MARKER_MISMATCH\",\n\t\t\tmarkerHash,\n\t\t\treachableHashes: [...reachableHashes],\n\t\t\t...graphTip !== null ? { graphTip } : {}\n\t\t}\n\t});\n}\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 errorRuntime(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\"A rollback (reverse) plan is expected to contain destructive (DROP) operations — review them before applying.\",\n\t\t\t\"Narrower cases (rename inference, re-adding a NOT NULL column without a safe default, or a type change that needs data) may additionally need a hint in the planned migration.\",\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\tmeta: {\n\t\t\t...meta,\n\t\t\tcode: \"MIGRATION.PATH_UNREACHABLE\"\n\t\t}\n\t});\n}\n/**\n* Maps a `MigrationToolsError` raised by the migration-tools loader/graph\n* surface (`readMigrationPackage`, `readMigrationsDir`, `readRefs`,\n* `resolveRef`, `reconstructGraph`, ...) into a CLI `errorRuntime` envelope.\n*\n* The full `error.details` payload is forwarded into `meta` so machine\n* consumers (`--json`) see structural fields like `dir`, `storedHash`,\n* `computedHash` (for `MIGRATION.HASH_MISMATCH`) alongside the stable\n* `code`. The user-visible `summary`/`why`/`fix` text is unchanged.\n*\n* Callers are expected to gate on `MigrationToolsError.is(error)` first\n* (mirroring the original inline pattern); non-`MigrationToolsError`\n* values are caller-classified (rethrow, wrap with command-specific\n* `errorUnexpected`, etc.).\n*/\nfunction mapMigrationToolsError(error) {\n\treturn errorRuntime(error.message, {\n\t\twhy: error.why,\n\t\tfix: error.fix,\n\t\tmeta: {\n\t\t\tcode: error.code,\n\t\t\t...error.details ?? {}\n\t\t}\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 errorRuntime(`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\tmeta: {\n\t\t\tcode: \"MIGRATION.AMBIGUOUS_MIGRATION_REF\",\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\": return errorRuntime(`Not a known ${error.grammar} reference: \"${error.input}\"`, {\n\t\t\twhy: `No ${error.grammar} matching \"${error.input}\" exists in the migration graph or refs index.`,\n\t\t\tfix: 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\tmeta: {\n\t\t\t\tinput: error.input,\n\t\t\t\tgrammar: error.grammar\n\t\t\t}\n\t\t});\n\t\tcase \"ambiguous\": return errorRuntime(`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\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 errorRuntime(error.message, {\n\t\t\twhy: error.message,\n\t\t\tfix: 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 errorRuntime(`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\tmeta: { input: error.input }\n\t\t});\n\t}\n}\n//#endregion\n//#region src/utils/formatters/helpers.ts\n/**\n* Checks if verbose output is enabled at the specified level.\n*/\nfunction isVerbose(flags, level) {\n\treturn (flags.verbose ?? 0) >= level;\n}\n/**\n* Creates a color-aware formatter function.\n* Returns a function that applies the color only if colors are enabled.\n*/\nfunction createColorFormatter(useColor, colorFn) {\n\treturn useColor ? colorFn : (text) => text;\n}\n/**\n* Formats text with dim styling if colors are enabled.\n*/\nfunction formatDim(useColor, text) {\n\treturn useColor ? dim(text) : text;\n}\n//#endregion\n//#region src/utils/formatters/styled.ts\n/**\n* Fixed width for left column in help output.\n*/\nconst LEFT_COLUMN_WIDTH$1 = 20;\n/**\n* Creates an arrow segment badge with green background and white text.\n* Body: green background with white \"prisma-next\" text\n* Tip: dark grey arrow pointing right (Powerline separator)\n*/\nfunction createPrismaNextBadge$1(useColor) {\n\tif (!useColor) return \"prisma-next\";\n\treturn bold(\"prisma-next\");\n}\n/**\n* Creates a padding function.\n*/\nfunction createPadFunction() {\n\treturn (s, w) => s + \" \".repeat(Math.max(0, w - s.length));\n}\n/**\n* Formats a header line: brand + operation + intent\n*/\nfunction formatHeaderLine$1(options) {\n\tif (options.operation) return `${options.brand} ${options.operation} → ${options.intent}`;\n\treturn `${options.brand} ${options.intent}`;\n}\n/**\n* Formats a \"Read more\" URL line.\n* The \"Read more\" label is in default color (not cyan), and the URL is blue.\n*/\nfunction formatReadMoreLine$1(options) {\n\tconst labelPadded = createPadFunction()(\"Read more\", options.maxLabelWidth);\n\tconst valueColored = options.useColor ? blue(options.url) : options.url;\n\treturn `${options.formatDimText(\"│\")} ${labelPadded} ${valueColored}`;\n}\n/**\n* Pads text to a fixed width, accounting for ANSI escape codes.\n* Uses string-width to measure the actual display width.\n*/\nfunction padToFixedWidth(text, width) {\n\tconst actualWidth = stringWidth(text);\n\tconst padding = Math.max(0, width - actualWidth);\n\treturn text + \" \".repeat(padding);\n}\n/**\n* Renders a command tree structure.\n* Handles both single-level (subcommands of a command) and multi-level (top-level commands with subcommands) trees.\n*/\nfunction renderCommandTree(options) {\n\tconst { commands, useColor, formatDimText, hasItemsAfter, continuationPrefix } = options;\n\tconst lines = [];\n\tif (commands.length === 0) return lines;\n\tfor (let i = 0; i < commands.length; i++) {\n\t\tconst cmd = commands[i];\n\t\tif (!cmd) continue;\n\t\tconst subcommands = cmd.commands.filter((subcmd) => !subcmd.name().startsWith(\"_\"));\n\t\tconst isLastCommand = i === commands.length - 1;\n\t\tif (subcommands.length > 0) {\n\t\t\tconst treePrefix = `${isLastCommand && !hasItemsAfter ? formatDimText(\"└\") : formatDimText(\"├\")}─ `;\n\t\t\tconst treePrefixWidth = stringWidth(stripAnsi(treePrefix));\n\t\t\tconst remainingWidth = LEFT_COLUMN_WIDTH$1 - treePrefixWidth;\n\t\t\tconst commandNamePadded = padToFixedWidth(cmd.name(), remainingWidth);\n\t\t\tconst commandNameColored = useColor ? cyan(commandNamePadded) : commandNamePadded;\n\t\t\tlines.push(`${formatDimText(\"│\")} ${treePrefix}${commandNameColored}`);\n\t\t\tfor (let j = 0; j < subcommands.length; j++) {\n\t\t\t\tconst subcmd = subcommands[j];\n\t\t\t\tif (!subcmd) continue;\n\t\t\t\tconst isLastSubcommand = j === subcommands.length - 1;\n\t\t\t\tconst shortDescription = subcmd.description() || \"\";\n\t\t\t\tconst treeChar = isLastSubcommand ? \"└\" : \"├\";\n\t\t\t\tconst continuation = continuationPrefix ?? (isLastCommand && isLastSubcommand && !hasItemsAfter ? \" \" : formatDimText(\"│\"));\n\t\t\t\tconst subTreePrefix = `${continuation === \" \" ? \" \" : continuation} ${formatDimText(treeChar)}─ `;\n\t\t\t\tconst subTreePrefixWidth = stringWidth(stripAnsi(subTreePrefix));\n\t\t\t\tconst subRemainingWidth = LEFT_COLUMN_WIDTH$1 - subTreePrefixWidth;\n\t\t\t\tconst subcommandNamePadded = padToFixedWidth(subcmd.name(), subRemainingWidth);\n\t\t\t\tconst subcommandNameColored = useColor ? cyan(subcommandNamePadded) : subcommandNamePadded;\n\t\t\t\tlines.push(`${formatDimText(\"│\")} ${subTreePrefix}${subcommandNameColored} ${shortDescription}`);\n\t\t\t}\n\t\t} else {\n\t\t\tconst treePrefix = `${isLastCommand && !hasItemsAfter ? formatDimText(\"└\") : formatDimText(\"├\")}─ `;\n\t\t\tconst treePrefixWidth = stringWidth(stripAnsi(treePrefix));\n\t\t\tconst remainingWidth = LEFT_COLUMN_WIDTH$1 - treePrefixWidth;\n\t\t\tconst commandNamePadded = padToFixedWidth(cmd.name(), remainingWidth);\n\t\t\tconst commandNameColored = useColor ? cyan(commandNamePadded) : commandNamePadded;\n\t\t\tconst shortDescription = cmd.description() || \"\";\n\t\t\tlines.push(`${formatDimText(\"│\")} ${treePrefix}${commandNameColored} ${shortDescription}`);\n\t\t}\n\t}\n\treturn lines;\n}\n/**\n* Formats the header in the new experimental visual style.\n* This header appears at the start of command output, showing the operation,\n* intent, documentation link, and parameters.\n*/\nfunction formatStyledHeader(options) {\n\tconst lines = [];\n\tconst useColor = options.flags.color !== false;\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst brand = createPrismaNextBadge$1(useColor);\n\tconst operation = useColor ? bold(options.command) : options.command;\n\tconst intent = formatDimText(options.description);\n\tlines.push(formatHeaderLine$1({\n\t\tbrand,\n\t\toperation,\n\t\tintent\n\t}));\n\tlines.push(formatDimText(\"│\"));\n\tfor (const detail of options.details) {\n\t\tconst labelPadded = padToFixedWidth(`${detail.label}:`, LEFT_COLUMN_WIDTH$1);\n\t\tconst labelColored = useColor ? cyan(labelPadded) : labelPadded;\n\t\tlines.push(`${formatDimText(\"│\")} ${labelColored} ${detail.value}`);\n\t}\n\tif (options.url) {\n\t\tlines.push(formatDimText(\"│\"));\n\t\tlines.push(formatReadMoreLine$1({\n\t\t\turl: options.url,\n\t\t\tmaxLabelWidth: LEFT_COLUMN_WIDTH$1,\n\t\t\tuseColor,\n\t\t\tformatDimText\n\t\t}));\n\t}\n\tlines.push(formatDimText(\"└\"));\n\treturn `${lines.join(\"\\n\")}\\n`;\n}\n/**\n* Formats a success message in the styled output format.\n*/\nfunction formatSuccessMessage(flags) {\n\treturn `${createColorFormatter(flags.color !== false, green)(\"✔\")} Success`;\n}\n//#endregion\n//#region src/utils/formatters/help.ts\n/**\n* Fixed width for left column in help output.\n* Must match the value in styled.ts.\n*/\nconst LEFT_COLUMN_WIDTH = 20;\n/**\n* Minimum width for right column wrapping in help output.\n*/\nconst RIGHT_COLUMN_MIN_WIDTH = 40;\n/**\n* Maximum width for right column wrapping in help output (when terminal is wide enough).\n*/\nconst RIGHT_COLUMN_MAX_WIDTH = 90;\n/**\n* Gets the terminal width, or returns a default if not available.\n*/\nfunction getTerminalWidth() {\n\tconst terminalWidth = process.stderr.columns || process.stdout.columns;\n\tconst envWidth = Number.parseInt(process.env[\"CLI_WIDTH\"] || \"\", 10);\n\treturn terminalWidth || (Number.isFinite(envWidth) ? envWidth : 80);\n}\n/**\n* Calculates the available width for the right column based on terminal width.\n*/\nfunction calculateRightColumnWidth() {\n\tconst availableWidth = getTerminalWidth() - 2 - LEFT_COLUMN_WIDTH - 2;\n\treturn Math.max(RIGHT_COLUMN_MIN_WIDTH, Math.min(availableWidth, RIGHT_COLUMN_MAX_WIDTH));\n}\n/**\n* Creates the CLI brand badge.\n*/\nfunction createPrismaNextBadge(useColor) {\n\treturn useColor ? bold(\"prisma-next\") : \"prisma-next\";\n}\n/**\n* Formats a header line: brand + operation + intent\n*/\nfunction formatHeaderLine(options) {\n\tif (options.operation) return `${options.brand} ${options.operation} → ${options.intent}`;\n\treturn `${options.brand} ${options.intent}`;\n}\n/**\n* Wraps text to fit within a specified width using wrap-ansi.\n*/\nfunction wrapTextAnsi(text, width) {\n\treturn wrapAnsi(text, width, {\n\t\thard: false,\n\t\ttrim: true\n\t}).split(\"\\n\");\n}\n/**\n* Formats a default value as \"default: <value>\" with dimming.\n*/\nfunction formatDefaultValue(value, useColor) {\n\tconst defaultText = `default: ${String(value)}`;\n\treturn useColor ? dim(defaultText) : defaultText;\n}\n/**\n* Formats a \"Read more\" URL line.\n*/\nfunction formatReadMoreLine(options) {\n\tconst labelPadded = `Read more${\" \".repeat(Math.max(0, options.maxLabelWidth - 9))}`;\n\tconst valueColored = options.useColor ? blue(options.url) : options.url;\n\treturn `${options.formatDimText(\"│\")} ${labelPadded} ${valueColored}`;\n}\n/**\n* Formats multiline description with \"Prisma Next\" in green.\n*/\nfunction formatMultilineDescription(options) {\n\tconst lines = [];\n\tconst formatGreen = (text) => options.useColor ? green(text) : text;\n\tconst wrapWidth = 24 + calculateRightColumnWidth() - 2;\n\tfor (const descLine of options.descriptionLines) {\n\t\tconst wrappedLines = wrapTextAnsi(descLine.replace(/Prisma Next/g, (match) => formatGreen(match)), wrapWidth);\n\t\tfor (const wrappedLine of wrappedLines) lines.push(`${options.formatDimText(\"│\")} ${wrappedLine}`);\n\t}\n\treturn lines;\n}\n/**\n* Maps command paths to their documentation URLs.\n*/\nfunction getCommandDocsUrl(commandPath) {\n\treturn {\n\t\t\"contract emit\": \"https://pris.ly/contract-emit\",\n\t\t\"contract infer\": \"https://pris.ly/contract-infer\",\n\t\t\"db schema\": \"https://pris.ly/db-schema\",\n\t\t\"db verify\": \"https://pris.ly/db-verify\",\n\t\t\"db update\": \"https://pris.ly/db-update\",\n\t\t\"migration plan\": \"https://pris.ly/migration-plan\",\n\t\tmigrate: \"https://pris.ly/migrate\",\n\t\t\"migration show\": \"https://pris.ly/migration-show\",\n\t\t\"migration status\": \"https://pris.ly/migration-status\"\n\t}[commandPath];\n}\n/**\n* Builds the full command path from a command and its parents.\n*/\nfunction buildCommandPath(command) {\n\tconst parts = [];\n\tlet current = command;\n\twhile (current && current.name() !== \"prisma-next\") {\n\t\tparts.unshift(current.name());\n\t\tcurrent = current.parent ?? void 0;\n\t}\n\treturn parts.join(\" \");\n}\n/**\n* Formats help output for a command using the styled format.\n*/\nfunction formatCommandHelp(options) {\n\tconst { command, flags } = options;\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst commandPath = buildCommandPath(command);\n\tconst shortDescription = command.description() || \"\";\n\tconst longDescription = getLongDescription(command);\n\tconst argsSuffix = command.registeredArguments.map((arg) => arg.required ? `<${arg.name()}>` : `[${arg.name()}]`).join(\" \");\n\tconst brand = createPrismaNextBadge(useColor);\n\tconst commandWithArgs = argsSuffix ? `${commandPath} ${argsSuffix}` : commandPath;\n\tconst operation = useColor ? bold(commandWithArgs) : commandWithArgs;\n\tconst intent = formatDimText(shortDescription);\n\tlines.push(formatHeaderLine({\n\t\tbrand,\n\t\toperation,\n\t\tintent\n\t}));\n\tlines.push(formatDimText(\"│\"));\n\tconst optionsList = command.options.map((opt) => {\n\t\tconst description = opt.description || \"\";\n\t\tconst defaultValue = opt.defaultValue;\n\t\treturn {\n\t\t\tflags: opt.flags,\n\t\t\tdescription,\n\t\t\tdefaultValue\n\t\t};\n\t});\n\tconst subcommands = command.commands.filter((cmd) => !cmd.name().startsWith(\"_\"));\n\tif (subcommands.length > 0) {\n\t\tconst treeLines = renderCommandTree({\n\t\t\tcommands: subcommands,\n\t\t\tuseColor,\n\t\t\tformatDimText,\n\t\t\thasItemsAfter: optionsList.length > 0\n\t\t});\n\t\tlines.push(...treeLines);\n\t}\n\tif (subcommands.length > 0 && optionsList.length > 0) lines.push(formatDimText(\"│\"));\n\tif (optionsList.length > 0) for (const opt of optionsList) {\n\t\tconst flagsPadded = padToFixedWidth(opt.flags, LEFT_COLUMN_WIDTH);\n\t\tlet flagsColored = flagsPadded;\n\t\tif (useColor) {\n\t\t\tflagsColored = flagsPadded.replace(/(<[^>]+>)/g, (match) => magenta(match));\n\t\t\tflagsColored = cyan(flagsColored);\n\t\t}\n\t\tconst rightColumnWidth = calculateRightColumnWidth();\n\t\tconst wrappedDescription = wrapTextAnsi(opt.description, rightColumnWidth);\n\t\tlines.push(`${formatDimText(\"│\")} ${flagsColored} ${wrappedDescription[0] || \"\"}`);\n\t\tfor (let i = 1; i < wrappedDescription.length; i++) {\n\t\t\tconst emptyLabel = \" \".repeat(LEFT_COLUMN_WIDTH);\n\t\t\tlines.push(`${formatDimText(\"│\")} ${emptyLabel} ${wrappedDescription[i] || \"\"}`);\n\t\t}\n\t\tif (opt.defaultValue !== void 0) {\n\t\t\tconst emptyLabel = \" \".repeat(LEFT_COLUMN_WIDTH);\n\t\t\tconst defaultText = formatDefaultValue(opt.defaultValue, useColor);\n\t\t\tlines.push(`${formatDimText(\"│\")} ${emptyLabel} ${defaultText}`);\n\t\t}\n\t}\n\tconst docsUrl = getCommandDocsUrl(commandPath);\n\tif (docsUrl) {\n\t\tlines.push(formatDimText(\"│\"));\n\t\tlines.push(formatReadMoreLine({\n\t\t\turl: docsUrl,\n\t\t\tmaxLabelWidth: LEFT_COLUMN_WIDTH,\n\t\t\tuseColor,\n\t\t\tformatDimText\n\t\t}));\n\t}\n\tconst examples = getCommandExamples(command);\n\tif (examples && examples.length > 0) {\n\t\tlines.push(formatDimText(\"│\"));\n\t\tlines.push(`${formatDimText(\"│\")} ${formatDimText(\"Examples:\")}`);\n\t\tfor (const example of examples) lines.push(`${formatDimText(\"│\")} ${useColor ? dim(\"$\") : \"$\"} ${example}`);\n\t}\n\tconst seeAlso = getCommandSeeAlso(command);\n\tif (seeAlso && seeAlso.length > 0) {\n\t\tlines.push(formatDimText(\"│\"));\n\t\tlines.push(`${formatDimText(\"│\")} ${formatDimText(\"See also:\")}`);\n\t\tfor (const ref of seeAlso) lines.push(`${formatDimText(\"│\")} ${ref.verb} ${formatDimText(ref.oneLiner)}`);\n\t}\n\tif (longDescription) {\n\t\tlines.push(formatDimText(\"│\"));\n\t\tconst descriptionLines = longDescription.split(\"\\n\").filter((line) => line.trim().length > 0);\n\t\tlines.push(...formatMultilineDescription({\n\t\t\tdescriptionLines,\n\t\t\tuseColor,\n\t\t\tformatDimText\n\t\t}));\n\t}\n\tlines.push(formatDimText(\"└\"));\n\treturn `${lines.join(\"\\n\")}\\n`;\n}\n/**\n* Formats help output for the root program using the styled format.\n*/\nfunction formatRootHelp(options) {\n\tconst { program, flags } = options;\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst brand = createPrismaNextBadge(useColor);\n\tconst intent = formatDimText(\"Manage your data layer\");\n\tlines.push(formatHeaderLine({\n\t\tbrand,\n\t\toperation: \"\",\n\t\tintent\n\t}));\n\tlines.push(formatDimText(\"│\"));\n\tconst topLevelCommands = program.commands.filter((cmd) => !cmd.name().startsWith(\"_\") && cmd.name() !== \"help\");\n\tconst globalOptions = program.options.map((opt) => {\n\t\tconst description = opt.description || \"\";\n\t\tconst defaultValue = opt.defaultValue;\n\t\treturn {\n\t\t\tflags: opt.flags,\n\t\t\tdescription,\n\t\t\tdefaultValue\n\t\t};\n\t});\n\tif (topLevelCommands.length > 0) {\n\t\tconst treeLines = renderCommandTree({\n\t\t\tcommands: topLevelCommands,\n\t\t\tuseColor,\n\t\t\tformatDimText,\n\t\t\thasItemsAfter: globalOptions.length > 0\n\t\t});\n\t\tlines.push(...treeLines);\n\t}\n\tif (topLevelCommands.length > 0 && globalOptions.length > 0) lines.push(formatDimText(\"│\"));\n\tif (globalOptions.length > 0) for (const opt of globalOptions) {\n\t\tconst flagsPadded = padToFixedWidth(opt.flags, LEFT_COLUMN_WIDTH);\n\t\tlet flagsColored = flagsPadded;\n\t\tif (useColor) {\n\t\t\tflagsColored = flagsPadded.replace(/(<[^>]+>)/g, (match) => magenta(match));\n\t\t\tflagsColored = cyan(flagsColored);\n\t\t}\n\t\tconst rightColumnWidth = calculateRightColumnWidth();\n\t\tconst wrappedDescription = wrapTextAnsi(opt.description, rightColumnWidth);\n\t\tlines.push(`${formatDimText(\"│\")} ${flagsColored} ${wrappedDescription[0] || \"\"}`);\n\t\tfor (let i = 1; i < wrappedDescription.length; i++) {\n\t\t\tconst emptyLabel = \" \".repeat(LEFT_COLUMN_WIDTH);\n\t\t\tlines.push(`${formatDimText(\"│\")} ${emptyLabel} ${wrappedDescription[i] || \"\"}`);\n\t\t}\n\t\tif (opt.defaultValue !== void 0) {\n\t\t\tconst emptyLabel = \" \".repeat(LEFT_COLUMN_WIDTH);\n\t\t\tconst defaultText = formatDefaultValue(opt.defaultValue, useColor);\n\t\t\tlines.push(`${formatDimText(\"│\")} ${emptyLabel} ${defaultText}`);\n\t\t}\n\t}\n\tconst formatGreen = (text) => useColor ? green(text) : text;\n\tconst descriptionLines = [`Use ${formatGreen(\"Prisma Next\")} to define your data layer as a contract. Sign your database and application with the same contract to guarantee compatibility. Plan and apply migrations to safely evolve your schema.`];\n\tif (descriptionLines.length > 0) {\n\t\tlines.push(formatDimText(\"│\"));\n\t\tlines.push(...formatMultilineDescription({\n\t\t\tdescriptionLines,\n\t\t\tuseColor,\n\t\t\tformatDimText\n\t\t}));\n\t}\n\tlines.push(formatDimText(\"└\"));\n\treturn `${lines.join(\"\\n\")}\\n`;\n}\n//#endregion\n//#region src/utils/is-ci.ts\n/**\n* Returns true when the process is running in any CI environment recognised\n* by the `ci-info` package. The single source of truth for CI detection\n* across this CLI — colour-output suppression and telemetry-skip both call\n* this helper, so neither path drifts from the other when a new CI provider\n* is added upstream.\n*\n* `ci-info` checks the standard `CI=true` marker plus dozens of\n* provider-specific environment variables (Buildkite, Jenkins, Drone,\n* Bitbucket Pipelines, Azure Pipelines, AWS CodeBuild, …) that the raw\n* `process.env.CI` read misses.\n*\n*/\nfunction isCI$1() {\n\treturn isCI;\n}\n//#endregion\n//#region src/utils/formatters/migrations.ts\n/**\n* Render a single statement of an `OperationPreview` for the human-readable\n* preview block. SQL statements get a trailing `;` if missing so the rendered\n* preview is byte-identical to the legacy `string[]`-based renderer for SQL\n* targets. Other languages (`'mongodb-shell'`) render verbatim.\n*/\nfunction renderPreviewStatement(text, language) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return void 0;\n\tif (language === \"sql\") return trimmed.endsWith(\";\") ? trimmed : `${trimmed};`;\n\treturn trimmed;\n}\n/**\n* Choose the header label for a preview block. SQL-only previews keep the\n* legacy `DDL preview` label so the rendered output is byte-identical to the\n* pre-aggregate SQL CLI; previews from any other family — or a mix that\n* includes any non-SQL language — use the family-agnostic `Operation preview`\n* label.\n*\n* An empty `statements` array deliberately renders as `Operation preview`\n* rather than `DDL preview`: `Array.prototype.every` is vacuously true for\n* empty arrays, but we have no evidence the preview is SQL-only when no\n* statements are present, so the family-agnostic label is the safer default.\n*/\nfunction previewBlockHeader(preview) {\n\treturn preview.statements.length > 0 && preview.statements.every((s) => s.language === \"sql\") ? \"DDL preview\" : \"Operation preview\";\n}\nfunction formatPlannerWarningsBlock(warnings, useColor) {\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [\"\", \"Warnings:\"];\n\tfor (const warning of warnings) lines.push(` ${formatDimText(`- ${warning.summary}`)}`);\n\treturn lines;\n}\n/**\n* Render the shared per-space execution block consumed by the `db init`\n* / `db update` / `migrate` summaries. Always shows: space\n* label (`Extension space: <id>` or `App space`) → per-op lines under\n* each space → per-space marker hash (when known).\n*\n* `mode` controls the marker label phrasing — `'apply'` shows\n* `marker → <hash>` (post-apply), `'plan'` omits the marker line\n* entirely (no marker has been written yet).\n*/\nfunction formatPerSpaceBlock(perSpace, mode, useColor) {\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatCyan = createColorFormatter(useColor, cyan);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [];\n\tfor (let s = 0; s < perSpace.length; s++) {\n\t\tconst space = perSpace[s];\n\t\tif (s > 0) lines.push(\"\");\n\t\tconst header = space.kind === \"app\" ? formatCyan(\"App space\") : formatCyan(`Extension space: ${space.spaceId}`);\n\t\tlines.push(header);\n\t\tif (space.operations.length === 0) lines.push(` ${formatDimText(\"(no operations)\")}`);\n\t\telse for (let i = 0; i < space.operations.length; i++) {\n\t\t\tconst op = space.operations[i];\n\t\t\tconst treeChar = i === space.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(` ${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (mode === \"apply\" && space.marker) lines.push(` ${formatDimText(`marker: ${space.marker.storageHash}`)}`);\n\t}\n\treturn lines;\n}\n/**\n* Formats human-readable output for migration commands (db init, db update) in plan mode.\n*/\nfunction formatMigrationPlanOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst operationCount = result.plan?.operations.length ?? 0;\n\tconst spaceCount = result.perSpace?.length ?? 0;\n\tif (spaceCount > 0) lines.push(`${formatGreen(\"✔\")} Planned ${operationCount} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}`);\n\telse lines.push(`${formatGreen(\"✔\")} Planned ${operationCount} operation(s)`);\n\tif (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tif (result.perSpace && result.perSpace.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(...formatPerSpaceBlock(result.perSpace, \"plan\", useColor));\n\t\tif (result.perSpace.some((s) => s.operations.some((op) => op.operationClass === \"destructive\"))) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t} else if (result.plan?.operations && result.plan.operations.length > 0) {\n\t\tlines.push(`${formatDimText(\"│\")}`);\n\t\tfor (let i = 0; i < result.plan.operations.length; i++) {\n\t\t\tconst op = result.plan.operations[i];\n\t\t\tif (!op) continue;\n\t\t\tconst treeChar = i === result.plan.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (result.plan.operations.some((op) => op.operationClass === \"destructive\")) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t}\n\tif (result.plan?.destination) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(`Destination hash: ${result.plan.destination.storageHash}`)}`);\n\t}\n\tif (result.plannedAdvanceRef) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Would advance ref \"${result.plannedAdvanceRef.name}\" → ${result.plannedAdvanceRef.hash}`));\n\t}\n\tconst preview = result.plan?.preview;\n\tif (preview) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(previewBlockHeader(preview))}`);\n\t\tif (preview.statements.length === 0) lines.push(`${formatDimText(\"No operations.\")}`);\n\t\telse {\n\t\t\tlines.push(\"\");\n\t\t\tfor (const statement of preview.statements) {\n\t\t\t\tconst rendered = renderPreviewStatement(statement.text, statement.language);\n\t\t\t\tif (rendered) lines.push(rendered);\n\t\t\t}\n\t\t}\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(`Total time: ${result.timings.total}ms`)}`);\n\tlines.push(\"\");\n\tlines.push(`${formatDimText(\"This is a dry run. No changes were applied.\")}`);\n\tlines.push(`${formatDimText(\"Run without --dry-run to apply changes.\")}`);\n\treturn lines.join(\"\\n\");\n}\nfunction formatMigrationApplyCommandOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tlines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\tif (result.perSpace.length > 0) {\n\t\tlines.push(\"\");\n\t\tfor (const line of formatPerSpaceBlock(result.perSpace, \"apply\", useColor)) lines.push(line);\n\t}\n\tif (result.advancedRef) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Advanced ref \"${result.advancedRef.name}\" → ${result.advancedRef.hash}`));\n\t}\n\tlines.push(\"\");\n\tlines.push(formatDimText(\"Next: prisma-next migration status\"));\n\tif (isVerbose(flags, 1) && result.timings) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Total time: ${result.timings.total}ms`));\n\t}\n\treturn lines.join(\"\\n\");\n}\nfunction formatSpaceShowBlock(space, useColor) {\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [];\n\tlines.push(`${formatGreen(\"✔\")} ${space.name}`);\n\tlines.push(`${formatDimText(` from: ${space.fromContract ?? \"(baseline)\"}`)}`);\n\tlines.push(`${formatDimText(` to: ${space.toContract}`)}`);\n\tlines.push(`${formatDimText(` hash: ${space.hash}`)}`);\n\tlines.push(`${formatDimText(` created: ${space.createdAt}`)}`);\n\tlines.push(\"\");\n\tlines.push(`${space.operations.length} operation(s)`);\n\tif (space.operations.length > 0) {\n\t\tlines.push(`${formatDimText(\"│\")}`);\n\t\tfor (let i = 0; i < space.operations.length; i++) {\n\t\t\tconst op = space.operations[i];\n\t\t\tconst treeChar = i === space.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (space.operations.some((op) => op.operationClass === \"destructive\")) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t}\n\tif (space.preview.statements.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(previewBlockHeader(space.preview))}`);\n\t\tlines.push(\"\");\n\t\tfor (const statement of space.preview.statements) {\n\t\t\tconst rendered = renderPreviewStatement(statement.text, statement.language);\n\t\t\tif (rendered) lines.push(rendered);\n\t\t}\n\t}\n\treturn lines;\n}\nfunction formatMigrationShowOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst useColor = flags.color !== false;\n\treturn formatSpaceShowBlock(result.migration, useColor).join(\"\\n\");\n}\n/**\n* Formats human-readable output for migration commands (db init, db update) in apply mode.\n*/\nfunction formatMigrationApplyOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (result.ok) {\n\t\tconst executed = result.execution?.operationsExecuted ?? 0;\n\t\tconst spaceCount = result.perSpace?.length ?? 0;\n\t\tif (executed === 0) {\n\t\t\tconst acrossClause = spaceCount > 0 ? ` across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}` : \"\";\n\t\t\tlines.push(`${formatGreen(\"✔\")} Database already matches contract${acrossClause}`);\n\t\t} else if (spaceCount > 0) lines.push(`${formatGreen(\"✔\")} Applied ${executed} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}`);\n\t\telse lines.push(`${formatGreen(\"✔\")} Applied ${executed} operation(s)`);\n\t\tif (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));\n\t\tif (result.perSpace && result.perSpace.length > 0) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(...formatPerSpaceBlock(result.perSpace, \"apply\", useColor));\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(formatDimText(`Run 'prisma-next migration status' to confirm ${spaceCount === 1 ? \"the space is\" : \"all spaces are\"} up to date.`));\n\t\t} else if (result.marker) {\n\t\t\tlines.push(`${formatDimText(` App-space marker: ${result.marker.storageHash}`)}`);\n\t\t\tif (result.marker.profileHash) lines.push(`${formatDimText(` Profile hash: ${result.marker.profileHash}`)}`);\n\t\t}\n\t\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t\tif (result.advancedRef) lines.push(formatDimText(`Advanced ref \"${result.advancedRef.name}\" → ${result.advancedRef.hash}`));\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for migration commands (db init, db update).\n*/\nfunction formatMigrationJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n//#endregion\n//#region src/utils/formatters/errors.ts\n/**\n* The display label for a schema-diff issue in the shared error envelope,\n* derived from which sides are present: expected-only is a missing object,\n* actual-only an extra one, both a mismatch. `undefined` when the entry is not\n* a schema-diff issue (it carries neither side) so the caller can fall through\n* to its generic label.\n*/\nfunction schemaDiffIssueLabel(issue) {\n\tconst hasExpected = issue.expected !== void 0;\n\tconst hasActual = issue.actual !== void 0;\n\tif (hasExpected && hasActual) return \"mismatch\";\n\tif (hasExpected) return \"missing\";\n\tif (hasActual) return \"extra\";\n}\n/**\n* Formats error output for human-readable display.\n*/\nfunction formatErrorOutput(error, flags) {\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatRed = createColorFormatter(useColor, red);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tlines.push(`${formatRed(\"✖\")} ${error.summary} (${error.code})`);\n\tif (error.why) lines.push(`${formatDimText(` Why: ${error.why}`)}`);\n\tif (error.fix) lines.push(`${formatDimText(` Fix: ${error.fix}`)}`);\n\tif (error.where?.path) {\n\t\tconst whereLine = error.where.line ? `${error.where.path}:${error.where.line}` : error.where.path;\n\t\tlines.push(`${formatDimText(` Where: ${whereLine}`)}`);\n\t}\n\tif (error.meta?.[\"conflicts\"]) {\n\t\tconst conflicts = error.meta[\"conflicts\"];\n\t\tif (conflicts.length > 0) {\n\t\t\tconst maxToShow = isVerbose(flags, 1) ? conflicts.length : Math.min(3, conflicts.length);\n\t\t\tconst header = isVerbose(flags, 1) ? \" Conflicts:\" : ` Conflicts (showing ${maxToShow} of ${conflicts.length}):`;\n\t\t\tlines.push(`${formatDimText(header)}`);\n\t\t\tfor (const conflict of conflicts.slice(0, maxToShow)) lines.push(`${formatDimText(` - [${conflict.kind}] ${conflict.summary}`)}`);\n\t\t\tif (!isVerbose(flags, 1) && conflicts.length > maxToShow) lines.push(`${formatDimText(\" Re-run with -v/--verbose to see all conflicts\")}`);\n\t\t}\n\t}\n\tif (error.meta?.[\"issues\"]) {\n\t\tconst issues = error.meta[\"issues\"];\n\t\tif (issues.length > 0) {\n\t\t\tconst maxToShow = isVerbose(flags, 1) ? issues.length : Math.min(3, issues.length);\n\t\t\tconst header = isVerbose(flags, 1) ? \" Issues:\" : ` Issues (showing ${maxToShow} of ${issues.length}):`;\n\t\t\tlines.push(`${formatDimText(header)}`);\n\t\t\tfor (const issue of issues.slice(0, maxToShow)) {\n\t\t\t\tconst label = issue.kind ?? schemaDiffIssueLabel(issue) ?? \"issue\";\n\t\t\t\tconst message = issue.message ?? issue.path?.join(\"/\") ?? \"\";\n\t\t\t\tlines.push(`${formatDimText(` - [${label}] ${message}`)}`);\n\t\t\t}\n\t\t\tif (!isVerbose(flags, 1) && issues.length > maxToShow) lines.push(`${formatDimText(\" Re-run with -v/--verbose to see all issues\")}`);\n\t\t}\n\t}\n\tif (error.docsUrl && isVerbose(flags, 1)) lines.push(formatDimText(error.docsUrl));\n\tconst plannerWarnings = error.meta?.[\"plannerWarnings\"];\n\tif (Array.isArray(plannerWarnings) && plannerWarnings.length > 0) {\n\t\tconst typedWarnings = blindCast(plannerWarnings);\n\t\tlines.push(...formatPlannerWarningsBlock(typedWarnings, useColor));\n\t}\n\tif (isVerbose(flags, 2) && error.meta) lines.push(`${formatDimText(` Meta: ${JSON.stringify(error.meta, null, 2)}`)}`);\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats error output as JSON.\n*/\nfunction formatErrorJson(error) {\n\treturn JSON.stringify(error, null, 2);\n}\n//#endregion\n//#region src/utils/result-handler.ts\n/**\n* Processes a CLI command result, handling both success and error cases.\n* Formats output appropriately and returns the exit code.\n* Never throws - returns exit code for commands to use with process.exit().\n*\n* Error output:\n* - JSON mode: JSON error to stdout (piped) via ui.output(), human sees nothing on stderr.\n* - Interactive: human-readable error to stderr.\n*/\nfunction handleResult(result, flags, ui, onSuccess) {\n\tif (result.ok) {\n\t\tif (onSuccess) onSuccess(result.value);\n\t\treturn 0;\n\t}\n\tconst envelope = result.failure.toEnvelope();\n\tif (flags.json) ui.output(formatErrorJson(envelope));\n\telse ui.error(formatErrorOutput(envelope, flags));\n\treturn result.failure.code === \"CLI.INIT_USER_ABORTED\" ? 3 : 2;\n}\n//#endregion\n//#region src/utils/glyph-mode.ts\nfunction localeString(env) {\n\treturn env[\"LC_ALL\"] ?? env[\"LC_CTYPE\"] ?? env[\"LANG\"] ?? \"\";\n}\nfunction isUtf8Locale(env) {\n\tconst locale = localeString(env);\n\tif (locale.length === 0) return false;\n\treturn /UTF-8|utf8/i.test(locale);\n}\nfunction detectGlyphMode(input) {\n\tif (!input.isTTY) return \"ascii\";\n\tif (!isUtf8Locale(input.env)) return \"ascii\";\n\treturn \"unicode\";\n}\n//#endregion\n//#region src/utils/shutdown.ts\nfunction createShutdownHandler(options) {\n\tconst exit = options?.exit ?? ((code) => process.exit(code));\n\tconst gracePeriodMs = options?.gracePeriodMs ?? 3e3;\n\tconst controller = new AbortController();\n\tlet shuttingDown = false;\n\tlet graceTimer;\n\tconst onSignal = () => {\n\t\tif (shuttingDown) {\n\t\t\texit(130);\n\t\t\treturn;\n\t\t}\n\t\tshuttingDown = true;\n\t\tcontroller.abort();\n\t\tgraceTimer = setTimeout(() => exit(130), gracePeriodMs);\n\t\tgraceTimer.unref();\n\t};\n\treturn {\n\t\tsignal: controller.signal,\n\t\tisShuttingDown: () => shuttingDown,\n\t\tonSignal,\n\t\tclearGraceTimer: () => {\n\t\t\tif (graceTimer !== void 0) {\n\t\t\t\tclearTimeout(graceTimer);\n\t\t\t\tgraceTimer = void 0;\n\t\t\t}\n\t\t}\n\t};\n}\nconst globalHandler = createShutdownHandler();\n/**\n* The global AbortSignal. Pass this to any async operation that should\n* be cancellable on Ctrl+C (e.g., DB queries, long-running emit).\n*/\nconst shutdownSignal = globalHandler.signal;\n/**\n* Installs SIGINT and SIGTERM handlers. Call once at CLI startup.\n*\n* - First signal: aborts the controller, starts a 3s grace timer.\n* - Second signal: force-exits immediately.\n*/\nlet installed = false;\nfunction installShutdownHandlers() {\n\tif (installed) return;\n\tinstalled = true;\n\tprocess.on(\"SIGINT\", globalHandler.onSignal);\n\tprocess.on(\"SIGTERM\", globalHandler.onSignal);\n}\n//#endregion\n//#region src/utils/terminal-ui.ts\n/**\n* Composable CLI output abstraction.\n*\n* Follows the Unix convention of separating data from decoration:\n* - **stdout** — data output only (`ui.output()`). This is what scripts and pipes capture.\n* - **stderr** — all decoration (spinners, logs, notes, intro/outro). Visible in terminal, invisible in pipes.\n*\n* Rules:\n* 1. All methods except `output()` and `error()` write to stderr only in interactive mode.\n* 2. `output(data)` always writes to stdout — if a command calls it, there is data to emit.\n* 3. `error()` always writes to stderr — errors matter even when piped.\n* 4. Decoration is suppressed when piped unless `--format pretty` was explicit (`forcePretty`).\n* 5. Never write data to stderr — decoration methods are for human context only.\n* 6. Never write decoration to stdout — it breaks pipes, `$(...)` captures, and `> file` redirects.\n*/\nvar TerminalUI = class TerminalUI {\n\t/**\n\t* True when stdout is a TTY (interactive terminal).\n\t* False when piped (e.g., `prisma-next db verify | jq`).\n\t*/\n\tisInteractive;\n\t/**\n\t* Whether color output is enabled.\n\t*/\n\tuseColor;\n\t/**\n\t* When true, decoration methods write even on non-TTY stdout\n\t* (explicit `--format pretty`).\n\t*/\n\tforcePretty;\n\t/**\n\t* Whether stdout is a TTY — used for migration-list graph glyph detection.\n\t*/\n\tstdoutIsTTY;\n\t/**\n\t* Process environment snapshot for locale-aware glyph detection.\n\t*/\n\tenv;\n\tstatic stderrOpts = { output: process.stderr };\n\tconstructor(options) {\n\t\tthis.isInteractive = options?.interactive ?? !!process.stdout.isTTY;\n\t\tthis.forcePretty = options?.forcePretty ?? false;\n\t\tthis.useColor = options?.color ?? (this.isInteractive || this.forcePretty);\n\t\tthis.stdoutIsTTY = options?.stdoutIsTTY ?? !!process.stdout.isTTY;\n\t\tthis.env = options?.env ?? process.env;\n\t}\n\tget isTTY() {\n\t\treturn this.stdoutIsTTY;\n\t}\n\t/**\n\t* Resolve glyph mode for migration list/tree output. `--ascii` forces ASCII;\n\t* otherwise delegates to the pure {@link detectGlyphMode} helper.\n\t*/\n\tresolveGlyphMode(forceAscii) {\n\t\tif (forceAscii) return \"ascii\";\n\t\treturn detectGlyphMode(this.glyphModeInput());\n\t}\n\tglyphModeInput() {\n\t\treturn {\n\t\t\tisTTY: this.stdoutIsTTY,\n\t\t\tenv: this.env\n\t\t};\n\t}\n\tget shouldDecorate() {\n\t\treturn this.isInteractive || this.forcePretty;\n\t}\n\t/**\n\t* Log a message line to stderr. No-op when piped unless forcePretty.\n\t*/\n\tlog(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.message(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a success message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tsuccess(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.success(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a warning message to stderr. No-op when piped unless forcePretty.\n\t*/\n\twarn(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.warn(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log an error message to stderr. Always writes (errors matter even in pipes).\n\t*/\n\terror(message) {\n\t\tclack.log.error(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log an info message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tinfo(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.info(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a step message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tstep(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.step(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display a note box on stderr. No-op when piped unless forcePretty.\n\t*/\n\tnote(message, title) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.note(message, title, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display intro banner on stderr. No-op when piped unless forcePretty.\n\t*/\n\tintro(title) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.intro(title, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display outro banner on stderr. No-op when piped unless forcePretty.\n\t*/\n\toutro(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.outro(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Create a Clack spinner on stderr with a 100ms delay threshold.\n\t* The spinner only appears if the operation takes longer than the threshold,\n\t* avoiding flicker for fast operations. Returns a no-op spinner when not decorating.\n\t*/\n\tspinner(delayMs = 100) {\n\t\tconst noop = {\n\t\t\tstart: () => {},\n\t\t\tstop: () => {},\n\t\t\tcancel: () => {},\n\t\t\terror: () => {},\n\t\t\tmessage: () => {},\n\t\t\tclear: () => {},\n\t\t\tget isCancelled() {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\tif (!this.shouldDecorate) return noop;\n\t\tlet inner;\n\t\tlet timer;\n\t\tlet pendingMsg;\n\t\tlet settled = false;\n\t\tconst ensureCleared = () => {\n\t\t\tif (timer !== void 0) {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = void 0;\n\t\t\t}\n\t\t};\n\t\tconst onAbort = () => {\n\t\t\tif (!settled) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.cancel(\"Interrupted\");\n\t\t\t}\n\t\t};\n\t\tif (!shutdownSignal.aborted) shutdownSignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\treturn {\n\t\t\tstart(msg) {\n\t\t\t\tpendingMsg = msg;\n\t\t\t\ttimer = setTimeout(() => {\n\t\t\t\t\tif (!settled) {\n\t\t\t\t\t\tinner = clack.spinner(TerminalUI.stderrOpts);\n\t\t\t\t\t\tinner.start(pendingMsg);\n\t\t\t\t\t}\n\t\t\t\t}, delayMs);\n\t\t\t},\n\t\t\tstop(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.stop(msg);\n\t\t\t},\n\t\t\tcancel(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.cancel(msg);\n\t\t\t},\n\t\t\terror(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.error(msg);\n\t\t\t},\n\t\t\tmessage(msg) {\n\t\t\t\tpendingMsg = msg;\n\t\t\t\tif (inner) inner.message(msg);\n\t\t\t},\n\t\t\tclear() {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.clear();\n\t\t\t},\n\t\t\tget isCancelled() {\n\t\t\t\treturn inner?.isCancelled ?? false;\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Prompt for yes/no confirmation on stderr. Returns true if confirmed.\n\t* In non-interactive mode or when cancelled (Ctrl-C), returns false.\n\t*/\n\tasync confirm(message) {\n\t\tif (!this.isInteractive) return false;\n\t\tconst result = await clack.confirm({\n\t\t\tmessage,\n\t\t\t...TerminalUI.stderrOpts\n\t\t});\n\t\tif (clack.isCancel(result)) return false;\n\t\treturn result;\n\t}\n\t/**\n\t* Write a raw line to stderr. No-op when piped unless forcePretty.\n\t* Use for decoration that doesn't fit Clack's log format (e.g. styled headers).\n\t*/\n\tstderr(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tprocess.stderr.write(`${message}\\n`);\n\t}\n\t/**\n\t* Write machine-readable data to stdout.\n\t* Always writes — if a command calls output(), there is data to emit.\n\t*\n\t* This is what scripts and pipes capture: `prisma-next db verify --json | jq .ok`\n\t*/\n\toutput(data) {\n\t\tprocess.stdout.write(`${data}\\n`);\n\t}\n\tgreen(text) {\n\t\treturn this.useColor ? green(text) : text;\n\t}\n\tred(text) {\n\t\treturn this.useColor ? red(text) : text;\n\t}\n\tcyan(text) {\n\t\treturn this.useColor ? cyan(text) : text;\n\t}\n\tdim(text) {\n\t\treturn this.useColor ? dim(text) : text;\n\t}\n\tbold(text) {\n\t\treturn this.useColor ? bold(text) : text;\n\t}\n\tyellow(text) {\n\t\treturn this.useColor ? yellow(text) : text;\n\t}\n};\nfunction createTerminalUI(flags, runtime) {\n\treturn new TerminalUI({\n\t\tcolor: flags.color,\n\t\tinteractive: flags.interactive,\n\t\tforcePretty: flags.format === \"pretty\" && flags.explicitFormat,\n\t\tstdoutIsTTY: runtime?.isTTY,\n\t\tenv: runtime?.env\n\t});\n}\n//#endregion\n//#region src/utils/global-flags.ts\nfunction isJsonFlagSet(json) {\n\treturn json === true;\n}\nfunction resolveOutputFormat(options) {\n\tconst formatOption = options.format;\n\tconst jsonFlag = isJsonFlagSet(options.json);\n\tif (formatOption !== void 0) {\n\t\tif (formatOption !== \"pretty\" && formatOption !== \"json\") throw errorInvalidOutputFormat(formatOption);\n\t\tif (jsonFlag && formatOption === \"pretty\") throw errorOutputFormatMutex();\n\t\treturn {\n\t\t\tformat: formatOption,\n\t\t\texplicitFormat: true\n\t\t};\n\t}\n\tif (jsonFlag) return {\n\t\tformat: \"json\",\n\t\texplicitFormat: false\n\t};\n\tif (!process.stdout.isTTY) return {\n\t\tformat: \"json\",\n\t\texplicitFormat: false\n\t};\n\treturn {\n\t\tformat: \"pretty\",\n\t\texplicitFormat: false\n\t};\n}\nfunction inferJsonModeForParseError(options) {\n\tif (options.format === \"json\") return true;\n\tif (isJsonFlagSet(options.json) && options.format !== \"pretty\") return true;\n\tif (options.format !== void 0) return false;\n\treturn !process.stdout.isTTY;\n}\nfunction emitGlobalFlagParseError(error, options) {\n\tconst jsonMode = inferJsonModeForParseError(options);\n\tconst flags = {\n\t\tformat: jsonMode ? \"json\" : \"pretty\",\n\t\texplicitFormat: false,\n\t\t...jsonMode ? { json: true } : {},\n\t\tcolor: false,\n\t\tverbose: 0,\n\t\tinteractive: false\n\t};\n\tconst ui = createTerminalUI(flags);\n\tconst exitCode = handleResult(notOk(error), flags, ui);\n\tprocess.exit(exitCode);\n}\n/**\n* Parses global flags from CLI options.\n* Handles verbosity flags (-v, --trace), output format (--format, --json),\n* quiet mode, color, interactivity (--interactive/--no-interactive), and\n* auto-accept (-y/--yes).\n*\n* On invalid or conflicting format flags, prints a structured CLI error\n* envelope and exits with code 2.\n*/\nfunction parseGlobalFlagsOrExit(options) {\n\ttry {\n\t\treturn parseGlobalFlags(options);\n\t} catch (error) {\n\t\tif (CliStructuredError$1.is(error)) emitGlobalFlagParseError(error, options);\n\t\tthrow error;\n\t}\n}\n/**\n* Parses global flags from CLI options.\n* Handles verbosity flags (-v, --trace), output format (--format, --json),\n* quiet mode, color, interactivity (--interactive/--no-interactive), and\n* auto-accept (-y/--yes).\n*\n* Throws {@link CliStructuredError} for invalid or conflicting format flags.\n*/\nfunction parseGlobalFlags(options) {\n\tconst { format, explicitFormat } = resolveOutputFormat(options);\n\tconst flags = {\n\t\tformat,\n\t\texplicitFormat\n\t};\n\tif (format === \"json\") flags.json = true;\n\tif (options.quiet || options.q) flags.quiet = true;\n\tif (options.trace || process.env[\"PRISMA_NEXT_TRACE\"] === \"1\") flags.verbose = 2;\n\telse if (options.verbose || options.v || process.env[\"PRISMA_NEXT_DEBUG\"] === \"1\") flags.verbose = 1;\n\telse flags.verbose = 0;\n\tif (process.env[\"NO_COLOR\"] || flags.json) flags.color = false;\n\telse if (options[\"no-color\"]) flags.color = false;\n\telse if (options.color !== void 0) flags.color = options.color;\n\telse flags.color = process.stdout.isTTY && !isCI$1();\n\tif (options[\"no-interactive\"]) flags.interactive = false;\n\telse if (options.interactive !== void 0) flags.interactive = options.interactive;\n\telse flags.interactive = !!process.stdout.isTTY;\n\tif (options.yes || options.y) flags.yes = true;\n\treturn flags;\n}\n/**\n* Bridges the two TTY checks (stdout via `flags`, stdin via\n* `process.stdin.isTTY`) into the `canPrompt` boolean the interactive\n* `init` flow consumes.\n*\n* Per the [Style Guide § Interactivity](../../../../../../../docs/CLI%20Style%20Guide.md#interactivity):\n*\n* - `flags.interactive` governs *decoration* (TerminalUI, intro/outro,\n* spinners) and is derived from stdout-TTY by `parseGlobalFlags`,\n* honouring `--interactive` / `--no-interactive`.\n* - Prompting additionally requires a stdin TTY — closing stdin is a\n* common signal in CI / agent environments even when stdout stays\n* attached.\n* - `--interactive` is the explicit override: when the user passes it,\n* we honour it (e.g. testing flows where stdin is stubbed).\n*\n* Single source of truth for the interactive-prompt decision: both the\n* `init` action handler and the preAction telemetry bridge derive\n* prompt-eligibility from this helper so they cannot drift. Lives in\n* `global-flags` (alongside `parseGlobalFlags`) to keep\n* `utils/telemetry` and `commands/init/index` free of an import cycle.\n*\n* Exported so callers and tests can derive the same value without\n* touching `process` globals.\n*/\nfunction deriveCanPrompt(opts) {\n\tif (opts.optionInteractive === true) return true;\n\tif (opts.flagsInteractive === false) return false;\n\treturn opts.stdinIsTTY;\n}\n//#endregion\n//#region src/utils/command-helpers.ts\nconst longDescriptions = /* @__PURE__ */ new WeakMap();\nconst commandExamples = /* @__PURE__ */ new WeakMap();\nconst commandSeeAlso = /* @__PURE__ */ new WeakMap();\n/**\n* Sets both short and long descriptions for a command.\n* The short description is used in command trees and headers.\n* The long description is shown at the bottom of help output.\n*/\nfunction setCommandDescriptions(command, shortDescription, longDescription) {\n\tcommand.description(shortDescription);\n\tif (longDescription) longDescriptions.set(command, longDescription);\n\treturn command;\n}\n/**\n* Sets copy-pastable examples for a command, shown in help text.\n*/\nfunction setCommandExamples(command, examples) {\n\tcommandExamples.set(command, examples);\n\treturn command;\n}\n/**\n* Gets the long description from a command if it was set via setCommandDescriptions.\n*/\nfunction getLongDescription(command) {\n\treturn longDescriptions.get(command);\n}\n/**\n* Gets examples from a command if set via setCommandExamples.\n*/\nfunction getCommandExamples(command) {\n\treturn commandExamples.get(command);\n}\n/**\n* Sets cross-references to related commands, rendered in a \"See also\"\n* section below the Examples block in help output.\n*/\nfunction setCommandSeeAlso(command, refs) {\n\tcommandSeeAlso.set(command, refs);\n\treturn command;\n}\n/**\n* Gets the see-also cross-references from a command.\n*/\nfunction getCommandSeeAlso(command) {\n\treturn commandSeeAlso.get(command);\n}\n/**\n* Resolves the absolute path to contract.json from the config.\n*/\nfunction resolveContractPath(config) {\n\tif (config.contract?.output === void 0) throw errorRuntime$1(\"config.contract.output is required to resolve the contract path\", {\n\t\twhy: \"CLI commands read the emitted contract from config.contract.output; the config has no value to read.\",\n\t\tfix: \"Ensure your prisma-next.config.ts goes through `defineConfig()`, which normalises a default output when the provider supplies an input path, or set `contract.output` explicitly.\"\n\t});\n\treturn resolve(config.contract.output);\n}\n/**\n* Resolves the migrations directory and config path from CLI options.\n* Shared by migrate, migration-plan, and migration-status.\n*\n* - `migrationsDir` is the project's top-level `migrations/` directory\n* (the root that the aggregate loader walks for every contract space).\n* - `appMigrationsDir` is the app subspace directory under it\n* (`<migrationsDir>/<APP_SPACE_ID>/`). Every per-app reader / writer\n* (`migration new`, `migration plan`, `migrate`,\n* `migration status`, `migration show`, `migration ref`) operates on\n* this directory. Extensions own their own `migrations/<spaceId>/`.\n* - `refsDir` is the app's refs directory (`<appMigrationsDir>/refs/`).\n* The framework does not maintain refs at the migrations root.\n*/\nfunction resolveMigrationPaths(configOption, config) {\n\tconst configPath = configOption ? relative(process.cwd(), resolve(configOption)) : \"prisma-next.config.ts\";\n\tconst migrationsDir = resolve(configOption ? resolve(configOption, \"..\") : process.cwd(), config.migrations?.dir ?? \"migrations\");\n\tconst migrationsRelative = relative(process.cwd(), migrationsDir);\n\tconst appMigrationsDir = spaceMigrationDirectory(migrationsDir, APP_SPACE_ID$1);\n\treturn {\n\t\tconfigPath,\n\t\tmigrationsDir,\n\t\tmigrationsRelative,\n\t\tappMigrationsDir,\n\t\tappMigrationsRelative: relative(process.cwd(), appMigrationsDir),\n\t\trefsDir: resolve(appMigrationsDir, \"refs\")\n\t};\n}\nfunction collectDeclaredInvariants(graph) {\n\tconst declared = /* @__PURE__ */ new Set();\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) for (const inv of edge.invariants) declared.add(inv);\n\treturn declared;\n}\n/**\n* Maps a `MigrationEdge` to the structural-edge shape used in the\n* `MIGRATION.NO_INVARIANT_PATH` error envelope. Shared between\n* `migrate` and `migration status` so both commands surface\n* the same JSON wire shape when an invariant-aware route is unsatisfiable.\n*/\nfunction toStructuralEdge(edge) {\n\treturn {\n\t\tdirName: edge.dirName,\n\t\tmigrationHash: edge.migrationHash,\n\t\tfrom: edge.from,\n\t\tto: edge.to,\n\t\tinvariants: edge.invariants\n\t};\n}\nfunction targetSupportsMigrations(target) {\n\treturn hasMigrations(target);\n}\nfunction getTargetMigrations(target) {\n\treturn hasMigrations(target) ? target.migrations : void 0;\n}\n/**\n* Reads and parses contract.json, validating the framework-level envelope\n* fields (storageHash, schemaVersion, target, targetFamily).\n*\n* Family-specific validation (storage structure, codec mappings, etc.)\n* happens downstream in the control client via the family instance.\n*/\nasync function readContractEnvelope(config) {\n\tconst contractPath = resolveContractPath(config);\n\tconst content = await readFile(contractPath, \"utf-8\");\n\tconst json = JSON.parse(content);\n\tconst { schemaVersion, target, targetFamily, profileHash } = json;\n\tconst storageHash = json[\"storage\"]?.[\"storageHash\"];\n\tif (typeof storageHash !== \"string\") throw new CliStructuredError$1(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing a valid storage.storageHash. Run \\`prisma-next contract emit\\` to regenerate.`, { where: { path: contractPath } });\n\tif (typeof schemaVersion !== \"string\") throw new CliStructuredError$1(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing schemaVersion.`, { where: { path: contractPath } });\n\tif (typeof target !== \"string\") throw new CliStructuredError$1(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing target.`, { where: { path: contractPath } });\n\tif (typeof targetFamily !== \"string\") throw new CliStructuredError$1(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing targetFamily.`, { where: { path: contractPath } });\n\treturn {\n\t\t...json,\n\t\tstorageHash,\n\t\tschemaVersion,\n\t\ttarget,\n\t\ttargetFamily,\n\t\t...typeof profileHash === \"string\" ? { profileHash } : {}\n\t};\n}\n/**\n* Masks credentials in a database connection URL.\n* Handles standard URLs (username + password + query params) and libpq-style key=value strings.\n*/\nfunction maskConnectionUrl(url) {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tif (parsed.username) parsed.username = \"****\";\n\t\tif (parsed.password) parsed.password = \"****\";\n\t\tfor (const key of [...parsed.searchParams.keys()]) if (/password/i.test(key)) parsed.searchParams.set(key, \"****\");\n\t\treturn parsed.toString();\n\t} catch {\n\t\treturn url.replace(/password\\s*=\\s*\\S+/gi, \"password=****\").replace(/user\\s*=\\s*\\S+/gi, \"user=****\");\n\t}\n}\n/**\n* Strips raw connection URL fragments from an error message to prevent credential leakage.\n* Call this before surfacing driver errors to the user.\n*/\nfunction sanitizeErrorMessage(message, connectionUrl) {\n\tif (!connectionUrl) return message;\n\ttry {\n\t\tconst parsed = new URL(connectionUrl);\n\t\tlet sanitized = message;\n\t\tsanitized = sanitized.replaceAll(connectionUrl, maskConnectionUrl(connectionUrl));\n\t\tif (parsed.password) sanitized = sanitized.replaceAll(parsed.password, \"****\");\n\t\tif (parsed.username) sanitized = sanitized.replaceAll(parsed.username, \"****\");\n\t\treturn sanitized;\n\t} catch {\n\t\treturn message.replace(/password\\s*=\\s*\\S+/gi, \"password=****\").replace(/user\\s*=\\s*\\S+/gi, \"user=****\");\n\t}\n}\n/**\n* Registers the global CLI options shared by every command:\n* --format, --json, -q/--quiet, -v/--verbose, --trace, --color, --no-color,\n* --interactive, --no-interactive, -y/--yes.\n*\n* Also sets up the styled help formatter.\n*/\nfunction addGlobalOptions(command) {\n\treturn command.configureHelp({ formatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t} }).option(\"--format <pretty|json>\", \"Output format (default: pretty, or json when stdout is not a TTY)\").option(\"--json\", \"Output as JSON (alias for --format json)\").option(\"-q, --quiet\", \"Quiet mode: errors only\").option(\"-v, --verbose\", \"Verbose output: debug info, timings\").option(\"--trace\", \"Trace output: deep internals, stack traces\").option(\"--color\", \"Force color output\").option(\"--no-color\", \"Disable color output\").option(\"--interactive\", \"Force interactive mode\").option(\"--no-interactive\", \"Disable interactive prompts\").option(\"-y, --yes\", \"Auto-accept prompts\");\n}\n//#endregion\nexport { errorRefSetBundleNotFound as $, formatStyledHeader as A, errorContractValidationFailed as B, formatMigrationApplyOutput as C, isCI$1 as D, formatMigrationShowOutput as E, CliStructuredError$1 as F, errorHashMismatch as G, errorDestructiveChanges as H, ERROR_CODE_DESTRUCTIVE_CHANGES as I, errorMarkerMismatch as J, errorInvalidSpaceId as K, errorAmbiguousMigrationRef as L, createColorFormatter as M, formatDim as N, formatCommandHelp as O, isVerbose as P, errorPlanForgotTheFlag as Q, errorConfigValidation as R, formatMigrationApplyCommandOutput as S, formatMigrationPlanOutput as T, errorDriverRequired as U, errorDatabaseConnectionRequired as V, errorFileNotFound as W, errorMigrationPlanningFailed as X, errorMarkerMissing as Y, errorPathUnreachable as Z, createTerminalUI as _, readContractEnvelope as a, errorSpaceNotFound as at, formatErrorJson as b, sanitizeErrorMessage as c, errorUnexpected as ct, setCommandSeeAlso as d, requireLiveDatabase as dt, errorRefSetEmptySentinel as et, targetSupportsMigrations as f, parseGlobalFlagsOrExit as g, parseGlobalFlags as h, maskConnectionUrl as i, errorSnapshotMissing as it, formatSuccessMessage as j, formatRootHelp as k, setCommandDescriptions as l, mapMigrationToolsError as lt, deriveCanPrompt as m, collectDeclaredInvariants as n, errorRunnerFailed as nt, resolveContractPath as o, errorTargetMigrationNotSupported as ot, toStructuralEdge as p, errorLegendHumanOnly as q, getTargetMigrations as r, errorRuntime$1 as rt, resolveMigrationPaths as s, errorTargetMismatch as st, addGlobalOptions as t, errorRefSetHashNotInGraph as tt, setCommandExamples as u, mapRefResolutionError as ut, installShutdownHandlers as v, formatMigrationJson as w, formatErrorOutput as x, handleResult as y, errorContractConfigMissing$1 as z };\n\n//# sourceMappingURL=command-helpers-CAoXqAY9.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,0BAA0B,cAAc,iBAAiB,cAAc;CAC/E,MAAM,gBAAgB,gBAAgB,SAAS,IAAI,gBAAgB,KAAK,IAAI,IAAI;CAChF,MAAM,MAAM,gBAAgB,SAAS,IAAI,iBAAiB,OAAO,4CAA4C,aAAa,gEAAgE,+DAA+D;CACzP,OAAO,aAAa,yDAAyD,gBAAgB;EAC5F,KAAK,gBAAgB,SAAS,IAAI,+BAA+B,cAAc,aAAa,aAAa,wBAAwB;EACjI;EACA,MAAM;GACL,MAAM;GACN;GACA,iBAAiB,CAAC,GAAG,eAAe;GACpC,GAAG,iBAAiB,OAAO,EAAE,aAAa,IAAI,CAAC;EAChD;CACD,CAAC;AACF;AACA,SAAS,yBAAyB,MAAM;CACvC,OAAO,aAAa,kDAAkD,QAAQ;EAC7E,KAAK;EACL,KAAK;EACL,MAAM;GACL,MAAM;GAC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CAC3B,IAAI;EACH,MAAM,SAAS,IAAI,IAAI,aAAa;EACpC,IAAI,YAAY;EAChB,YAAY,UAAU,WAAW,eAAe,kBAAkB,aAAa,CAAC;EAChF,IAAI,OAAO,UAAU,YAAY,UAAU,WAAW,OAAO,UAAU,MAAM;EAC7E,IAAI,OAAO,UAAU,YAAY,UAAU,WAAW,OAAO,UAAU,MAAM;EAC7E,OAAO;CACR,QAAQ;EACP,OAAO,QAAQ,QAAQ,wBAAwB,eAAe,CAAC,CAAC,QAAQ,oBAAoB,WAAW;CACxG;AACD;;;;;;;;AAQA,SAAS,iBAAiB,SAAS;CAClC,OAAO,QAAQ,cAAc,EAAE,aAAa,QAAQ;EACnD,OAAO,kBAAkB;GACxB,SAAS;GACT,OAAO,iBAAiB,CAAC,CAAC;EAC3B,CAAC;CACF,EAAE,CAAC,CAAC,CAAC,OAAO,0BAA0B,mEAAmE,CAAC,CAAC,OAAO,UAAU,0CAA0C,CAAC,CAAC,OAAO,eAAe,yBAAyB,CAAC,CAAC,OAAO,iBAAiB,qCAAqC,CAAC,CAAC,OAAO,WAAW,4CAA4C,CAAC,CAAC,OAAO,WAAW,oBAAoB,CAAC,CAAC,OAAO,cAAc,sBAAsB,CAAC,CAAC,OAAO,iBAAiB,wBAAwB,CAAC,CAAC,OAAO,oBAAoB,6BAA6B,CAAC,CAAC,OAAO,aAAa,qBAAqB;AACnkB"}
@@ -1,36 +0,0 @@
1
- import { t as MigrationToolsError } from "./errors-IpZm1Skp-BH495dRd.mjs";
2
- import { N as errorUnexpected, Z as mapMigrationToolsError, d as errorContractValidationFailed, h as errorFileNotFound, k as errorSnapshotMissing, t as CliStructuredError$1 } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
3
- import { notOk } from "@prisma/orm-framework/utils/result";
4
- //#region ../../../1-framework/3-tooling/cli/dist/contract-at-errors-BX7w-p19.mjs
5
- function mapContractAtError(error, options) {
6
- if (MigrationToolsError.is(error)) switch (error.code) {
7
- case "MIGRATION.REF_NOT_RESOLVABLE": return notOk(errorSnapshotMissing(typeof error.details?.["refName"] === "string" ? error.details["refName"] : typeof error.details?.["identifier"] === "string" ? error.details["identifier"] : "unknown"));
8
- case "MIGRATION.CONTRACT_DESERIALIZATION_FAILED": {
9
- const filePath = typeof error.details?.["filePath"] === "string" ? error.details["filePath"] : "unknown";
10
- return notOk(errorContractValidationFailed(`Predecessor contract at ${filePath} failed to deserialize: ${typeof error.details?.["message"] === "string" ? error.details["message"] : error.message}`, { where: { path: filePath } }));
11
- }
12
- case "MIGRATION.INVALID_JSON": {
13
- const filePath = typeof error.details?.["filePath"] === "string" ? error.details["filePath"] : "unknown";
14
- const message = typeof error.details?.["parseError"] === "string" ? error.details["parseError"] : error.message;
15
- return notOk(errorContractValidationFailed((options?.artifactRole ?? "from") === "to" ? `Target contract at ${filePath} failed to deserialize: ${message}` : `Predecessor contract at ${filePath} failed to deserialize: ${message}`, { where: { path: filePath } }));
16
- }
17
- case "MIGRATION.BUNDLE_NOT_FOUND_FOR_GRAPH_NODE": return notOk(errorUnexpected(error.message, {
18
- why: error.why,
19
- fix: error.fix
20
- }));
21
- case "MIGRATION.CONTRACT_SNAPSHOT_MISSING": {
22
- const expectedPath = typeof error.details?.["expectedPath"] === "string" ? error.details["expectedPath"] : "migrations/snapshots/";
23
- return notOk(errorFileNotFound(expectedPath, {
24
- why: (options?.artifactRole ?? "from") === "to" ? `Target migration is missing its contract snapshot at ${expectedPath}` : `Predecessor migration is missing its contract snapshot at ${expectedPath}`,
25
- fix: "Restore migrations/snapshots/ from version control, or re-run the command that produced this migration to regenerate its snapshot."
26
- }));
27
- }
28
- default: return notOk(mapMigrationToolsError(error));
29
- }
30
- if (CliStructuredError$1.is(error)) return notOk(error);
31
- throw error;
32
- }
33
- //#endregion
34
- export { mapContractAtError as t };
35
-
36
- //# sourceMappingURL=contract-at-errors-BX7w-p19-SxA8eaV2.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract-at-errors-BX7w-p19-SxA8eaV2.mjs","names":["CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/contract-at-errors-BX7w-p19.mjs"],"sourcesContent":["import { B as errorContractValidationFailed, F as CliStructuredError, W as errorFileNotFound, ct as errorUnexpected, it as errorSnapshotMissing, lt as mapMigrationToolsError } from \"./command-helpers-CAoXqAY9.mjs\";\nimport { notOk } from \"@internal/utils/result\";\nimport { MigrationToolsError } from \"@internal/migration-tools/errors\";\n//#region src/utils/contract-at-errors.ts\nfunction mapContractAtError(error, options) {\n\tif (MigrationToolsError.is(error)) switch (error.code) {\n\t\tcase \"MIGRATION.REF_NOT_RESOLVABLE\": return notOk(errorSnapshotMissing(typeof error.details?.[\"refName\"] === \"string\" ? error.details[\"refName\"] : typeof error.details?.[\"identifier\"] === \"string\" ? error.details[\"identifier\"] : \"unknown\"));\n\t\tcase \"MIGRATION.CONTRACT_DESERIALIZATION_FAILED\": {\n\t\t\tconst filePath = typeof error.details?.[\"filePath\"] === \"string\" ? error.details[\"filePath\"] : \"unknown\";\n\t\t\treturn notOk(errorContractValidationFailed(`Predecessor contract at ${filePath} failed to deserialize: ${typeof error.details?.[\"message\"] === \"string\" ? error.details[\"message\"] : error.message}`, { where: { path: filePath } }));\n\t\t}\n\t\tcase \"MIGRATION.INVALID_JSON\": {\n\t\t\tconst filePath = typeof error.details?.[\"filePath\"] === \"string\" ? error.details[\"filePath\"] : \"unknown\";\n\t\t\tconst message = typeof error.details?.[\"parseError\"] === \"string\" ? error.details[\"parseError\"] : error.message;\n\t\t\treturn notOk(errorContractValidationFailed((options?.artifactRole ?? \"from\") === \"to\" ? `Target contract at ${filePath} failed to deserialize: ${message}` : `Predecessor contract at ${filePath} failed to deserialize: ${message}`, { where: { path: filePath } }));\n\t\t}\n\t\tcase \"MIGRATION.BUNDLE_NOT_FOUND_FOR_GRAPH_NODE\": return notOk(errorUnexpected(error.message, {\n\t\t\twhy: error.why,\n\t\t\tfix: error.fix\n\t\t}));\n\t\tcase \"MIGRATION.CONTRACT_SNAPSHOT_MISSING\": {\n\t\t\tconst expectedPath = typeof error.details?.[\"expectedPath\"] === \"string\" ? error.details[\"expectedPath\"] : \"migrations/snapshots/\";\n\t\t\treturn notOk(errorFileNotFound(expectedPath, {\n\t\t\t\twhy: (options?.artifactRole ?? \"from\") === \"to\" ? `Target migration is missing its contract snapshot at ${expectedPath}` : `Predecessor migration is missing its contract snapshot at ${expectedPath}`,\n\t\t\t\tfix: \"Restore migrations/snapshots/ from version control, or re-run the command that produced this migration to regenerate its snapshot.\"\n\t\t\t}));\n\t\t}\n\t\tdefault: return notOk(mapMigrationToolsError(error));\n\t}\n\tif (CliStructuredError.is(error)) return notOk(error);\n\tthrow error;\n}\n//#endregion\nexport { mapContractAtError as t };\n\n//# sourceMappingURL=contract-at-errors-BX7w-p19.mjs.map"],"mappings":";;;;AAIA,SAAS,mBAAmB,OAAO,SAAS;CAC3C,IAAI,oBAAoB,GAAG,KAAK,GAAG,QAAQ,MAAM,MAAd;EAClC,KAAK,gCAAgC,OAAO,MAAM,qBAAqB,OAAO,MAAM,UAAU,eAAe,WAAW,MAAM,QAAQ,aAAa,OAAO,MAAM,UAAU,kBAAkB,WAAW,MAAM,QAAQ,gBAAgB,SAAS,CAAC;EAC/O,KAAK,6CAA6C;GACjD,MAAM,WAAW,OAAO,MAAM,UAAU,gBAAgB,WAAW,MAAM,QAAQ,cAAc;GAC/F,OAAO,MAAM,8BAA8B,2BAA2B,SAAS,0BAA0B,OAAO,MAAM,UAAU,eAAe,WAAW,MAAM,QAAQ,aAAa,MAAM,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,EAAE,CAAC,CAAC;EACrO;EACA,KAAK,0BAA0B;GAC9B,MAAM,WAAW,OAAO,MAAM,UAAU,gBAAgB,WAAW,MAAM,QAAQ,cAAc;GAC/F,MAAM,UAAU,OAAO,MAAM,UAAU,kBAAkB,WAAW,MAAM,QAAQ,gBAAgB,MAAM;GACxG,OAAO,MAAM,+BAA+B,SAAS,gBAAgB,Y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