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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/dist/bin__prisma-next.mjs +23 -23
  2. package/dist/bin__prisma-next.mjs.map +1 -1
  3. package/dist/{caught-errors-BZ-9WASe-DH4DaDha.mjs → caught-errors-DLPzfzIW-CQ9BoXD-.mjs} +3 -3
  4. package/dist/{caught-errors-BZ-9WASe-DH4DaDha.mjs.map → caught-errors-DLPzfzIW-CQ9BoXD-.mjs.map} +1 -1
  5. package/dist/{cli-errors-C6_pH59O-CzD4SYcJ.mjs → cli-errors-BG6bItjG-DwdKIeGz.mjs} +4 -4
  6. package/dist/cli-errors-BG6bItjG-DwdKIeGz.mjs.map +1 -0
  7. package/dist/{cli-errors-f5PRtVdm-C6xVKeQn.d.mts → cli-errors-BiKBrOXc-JPxQqO58.d.mts} +48 -6
  8. package/dist/cli-errors-BiKBrOXc-JPxQqO58.d.mts.map +1 -0
  9. package/dist/cli.mjs +572 -33
  10. package/dist/cli.mjs.map +1 -1
  11. package/dist/cli__commands__contract-emit.mjs +1 -1
  12. package/dist/cli__commands__contract-infer.mjs +1 -1
  13. package/dist/cli__commands__db-init.mjs +1 -1
  14. package/dist/cli__commands__db-schema.mjs +1 -1
  15. package/dist/cli__commands__db-sign.mjs +1 -1
  16. package/dist/cli__commands__db-update.mjs +1 -1
  17. package/dist/cli__commands__db-verify.mjs +1 -1
  18. package/dist/cli__commands__migrate.d.mts +2 -2
  19. package/dist/cli__commands__migrate.mjs +1 -1
  20. package/dist/cli__commands__migration-check.mjs +1 -1
  21. package/dist/cli__commands__migration-graph.d.mts +1 -1
  22. package/dist/cli__commands__migration-graph.mjs +1 -1
  23. package/dist/cli__commands__migration-list.d.mts +1 -1
  24. package/dist/cli__commands__migration-list.mjs +1 -1
  25. package/dist/cli__commands__migration-log.d.mts +1 -1
  26. package/dist/cli__commands__migration-log.mjs +1 -1
  27. package/dist/cli__commands__migration-new.mjs +1 -1
  28. package/dist/cli__commands__migration-plan.d.mts +1 -1
  29. package/dist/cli__commands__migration-plan.mjs +1 -1
  30. package/dist/cli__commands__migration-show.mjs +1 -1
  31. package/dist/cli__commands__migration-status.d.mts +1 -1
  32. package/dist/cli__commands__migration-status.mjs +1 -1
  33. package/dist/cli__commands__ref.mjs +1 -1
  34. package/dist/cli__commands__telemetry.mjs +1 -1
  35. package/dist/cli__control-api.d.mts +11 -3
  36. package/dist/cli__control-api.d.mts.map +1 -1
  37. package/dist/cli__control-api.mjs +15 -15
  38. package/dist/cli__control-api__testing.d.mts +1 -1
  39. package/dist/{client-BqhVohc5-DFRVWFps.mjs → client-DU9qtBxW-BjVHiKzE.mjs} +57 -11
  40. package/dist/client-DU9qtBxW-BjVHiKzE.mjs.map +1 -0
  41. package/dist/{command-helpers-kD9CO1hd-BPhnkBin.mjs → command-helpers-CwLvFwMB-BWwUQhlT.mjs} +3 -3
  42. package/dist/{command-helpers-kD9CO1hd-BPhnkBin.mjs.map → command-helpers-CwLvFwMB-BWwUQhlT.mjs.map} +1 -1
  43. package/dist/{contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs → contract-at-errors-Dptf8RE_-B5gr04Sc.mjs} +3 -3
  44. package/dist/{contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs.map → contract-at-errors-Dptf8RE_-B5gr04Sc.mjs.map} +1 -1
  45. package/dist/{contract-emit-BlvUNMHM-BEioUVR5.mjs → contract-emit-BQFpcb2A-BwT9iVdb.mjs} +5 -5
  46. package/dist/{contract-emit-BlvUNMHM-BEioUVR5.mjs.map → contract-emit-BQFpcb2A-BwT9iVdb.mjs.map} +1 -1
  47. package/dist/contract-emit-Bzt11N4v-BQ2Pr8KG.mjs +2 -0
  48. package/dist/{contract-emit-CrYO0A8x-60BOqXFr.mjs → contract-emit-CZQZ1i4z-p9LSGmmQ.mjs} +6 -6
  49. package/dist/{contract-emit-CrYO0A8x-60BOqXFr.mjs.map → contract-emit-CZQZ1i4z-p9LSGmmQ.mjs.map} +1 -1
  50. package/dist/{contract-infer-C8kLphsm-C7-AIYMc.mjs → contract-infer-C6cYOihE-CIUCgmw0.mjs} +4 -4
  51. package/dist/{contract-infer-C8kLphsm-C7-AIYMc.mjs.map → contract-infer-C6cYOihE-CIUCgmw0.mjs.map} +1 -1
  52. package/dist/{contract-snapshot-resolution-BUUdIcgG-8mbs6-OD.mjs → contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs} +4 -4
  53. package/dist/{contract-snapshot-resolution-BUUdIcgG-8mbs6-OD.mjs.map → contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs.map} +1 -1
  54. package/dist/{contract-space-aggregate-loader-BpdB-mHG-BiU0IUeb.mjs → contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs} +4 -4
  55. package/dist/{contract-space-aggregate-loader-BpdB-mHG-BiU0IUeb.mjs.map → contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs.map} +1 -1
  56. package/dist/{db-init-CyNsXRAB-D3xWQ-vy.mjs → db-init-DypCy1e3-CBrYfhHF.mjs} +6 -6
  57. package/dist/{db-init-CyNsXRAB-D3xWQ-vy.mjs.map → db-init-DypCy1e3-CBrYfhHF.mjs.map} +1 -1
  58. package/dist/{db-init-failure-XYOVL4o7-BitY_JYn.mjs → db-init-failure-BmCcHUfc-BqDxyrJE.mjs} +3 -3
  59. package/dist/{db-init-failure-XYOVL4o7-BitY_JYn.mjs.map → db-init-failure-BmCcHUfc-BqDxyrJE.mjs.map} +1 -1
  60. package/dist/{db-schema-7zNGHgYN-BVaRHPxg.mjs → db-schema-DHfPM-5V-JeCjrQ55.mjs} +4 -4
  61. package/dist/{db-schema-7zNGHgYN-BVaRHPxg.mjs.map → db-schema-DHfPM-5V-JeCjrQ55.mjs.map} +1 -1
  62. package/dist/{db-sign-DAs6J3XG-xxP2CCnO.mjs → db-sign-DbAxRcZh-C-nT9kcG.mjs} +6 -6
  63. package/dist/{db-sign-DAs6J3XG-xxP2CCnO.mjs.map → db-sign-DbAxRcZh-C-nT9kcG.mjs.map} +1 -1
  64. package/dist/{db-update-BX1sOuQk-CpeLgPeN.mjs → db-update-J59yROwL-DCP-_z2W.mjs} +16 -7
  65. package/dist/db-update-J59yROwL-DCP-_z2W.mjs.map +1 -0
  66. package/dist/{db-verify-CN4nmxxF-DSRWae0u.mjs → db-verify-0TpDMziA-CJDKutMN.mjs} +5 -5
  67. package/dist/{db-verify-CN4nmxxF-DSRWae0u.mjs.map → db-verify-0TpDMziA-CJDKutMN.mjs.map} +1 -1
  68. package/dist/{format-DceifGAK-BJhTdkcO.mjs → format-cbJY7l6v-CjMUDTAs.mjs} +5 -5
  69. package/dist/{format-DceifGAK-BJhTdkcO.mjs.map → format-cbJY7l6v-CjMUDTAs.mjs.map} +1 -1
  70. package/dist/{framework-components-CPFWl2Ix-CrIZL3jG.mjs → framework-components-C3K7SBeC-Bj5gx85-.mjs} +3 -3
  71. package/dist/{framework-components-CPFWl2Ix-CrIZL3jG.mjs.map → framework-components-C3K7SBeC-Bj5gx85-.mjs.map} +1 -1
  72. package/dist/{init-SY01IBU--CQFYh2As.mjs → init-Bco4QkKJ-DqUZVrBU.mjs} +4 -4
  73. package/dist/{init-SY01IBU--CQFYh2As.mjs.map → init-Bco4QkKJ-DqUZVrBU.mjs.map} +1 -1
  74. package/dist/{inspect-live-schema-BaLAtOgO-Bs0gs_yP.mjs → inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs} +5 -5
  75. package/dist/{inspect-live-schema-BaLAtOgO-Bs0gs_yP.mjs.map → inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs.map} +1 -1
  76. package/dist/{invariants-1L2zfc6--BpedlAbF.mjs → invariants-1zL5-9Mc-BCeOLxd_.mjs} +4 -4
  77. package/dist/{invariants-1L2zfc6--BpedlAbF.mjs.map → invariants-1zL5-9Mc-BCeOLxd_.mjs.map} +1 -1
  78. package/dist/{legend-aXC5H1jH-Dg1yWonK.mjs → legend-BQcPKTLe-bn9e4_ZU.mjs} +3 -3
  79. package/dist/{legend-aXC5H1jH-Dg1yWonK.mjs.map → legend-BQcPKTLe-bn9e4_ZU.mjs.map} +1 -1
  80. package/dist/{migrate-DRiUHRCS-Cci6EEZv.mjs → migrate-CgSnzAUm-aGstaO5N.mjs} +12 -12
  81. package/dist/{migrate-DRiUHRCS-Cci6EEZv.mjs.map → migrate-CgSnzAUm-aGstaO5N.mjs.map} +1 -1
  82. package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs → migrate-failure-CnoUcDms-taa9pfd7.mjs} +4 -4
  83. package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs.map → migrate-failure-CnoUcDms-taa9pfd7.mjs.map} +1 -1
  84. package/dist/{migrate-show-DutwCc2F-BhGfH7D-.d.mts → migrate-show-Dlo-YzOk-BXo-DmwI.d.mts} +3 -3
  85. package/dist/{migrate-show-DutwCc2F-BhGfH7D-.d.mts.map → migrate-show-Dlo-YzOk-BXo-DmwI.d.mts.map} +1 -1
  86. package/dist/{migrate-show-bdXjSFgh-CQxl5yNp.mjs → migrate-show-kVUG1xdo-bVTW8tu4.mjs} +6 -6
  87. package/dist/{migrate-show-bdXjSFgh-CQxl5yNp.mjs.map → migrate-show-kVUG1xdo-bVTW8tu4.mjs.map} +1 -1
  88. package/dist/{migration-check-BHiINj74-CVazN1LV.mjs → migration-check-BVK9vfan-Dfg8lbeB.mjs} +6 -6
  89. package/dist/{migration-check-BHiINj74-CVazN1LV.mjs.map → migration-check-BVK9vfan-Dfg8lbeB.mjs.map} +1 -1
  90. package/dist/{migration-check-of-RPYRk-HuXtDO8i.mjs → migration-check-CBMoMDX2-DhSEOGNg.mjs} +6 -6
  91. package/dist/{migration-check-of-RPYRk-HuXtDO8i.mjs.map → migration-check-CBMoMDX2-DhSEOGNg.mjs.map} +1 -1
  92. package/dist/{migration-command-scaffold-zJFTGn5k-5AGczeSx.mjs → migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs} +5 -5
  93. package/dist/{migration-command-scaffold-zJFTGn5k-5AGczeSx.mjs.map → migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs.map} +1 -1
  94. package/dist/{migration-graph-DmdVVJoZ-DDBKjUMz.mjs → migration-graph-B30X5398-BH3zB9Mn.mjs} +3 -3
  95. package/dist/{migration-graph-DmdVVJoZ-DDBKjUMz.mjs.map → migration-graph-B30X5398-BH3zB9Mn.mjs.map} +1 -1
  96. package/dist/{migration-graph-D0KHjNJ--CWzX9Zzc.mjs → migration-graph-D2dbLCkl-CCHL0aDA.mjs} +8 -8
  97. package/dist/{migration-graph-D0KHjNJ--CWzX9Zzc.mjs.map → migration-graph-D2dbLCkl-CCHL0aDA.mjs.map} +1 -1
  98. package/dist/{migration-graph-sections-BWcFCOL6-_G0Wb4QR.mjs → migration-graph-sections-0lKA5l1b-CTHQquu7.mjs} +3 -3
  99. package/dist/{migration-graph-sections-BWcFCOL6-_G0Wb4QR.mjs.map → migration-graph-sections-0lKA5l1b-CTHQquu7.mjs.map} +1 -1
  100. package/dist/{migration-list-W0dqabIj-Dc2NH_LY.mjs → migration-list-BQTfSGbT-DoNqbNsu.mjs} +3 -3
  101. package/dist/{migration-list-W0dqabIj-Dc2NH_LY.mjs.map → migration-list-BQTfSGbT-DoNqbNsu.mjs.map} +1 -1
  102. package/dist/{migration-list-B0SANIeM-DiXQ9LyS.mjs → migration-list-DCx0KOFp-B3MiGnpa.mjs} +6 -6
  103. package/dist/{migration-list-B0SANIeM-DiXQ9LyS.mjs.map → migration-list-DCx0KOFp-B3MiGnpa.mjs.map} +1 -1
  104. package/dist/{migration-log-B3iiP8ns-B4tdLSye.mjs → migration-log-CJ6_9_uj-uWyc3vlC.mjs} +6 -6
  105. package/dist/{migration-log-B3iiP8ns-B4tdLSye.mjs.map → migration-log-CJ6_9_uj-uWyc3vlC.mjs.map} +1 -1
  106. package/dist/{migration-new-YSdtJTRp-Dc06LNJe.mjs → migration-new-Bp5dPKnF-D-Fb6vEp.mjs} +7 -7
  107. package/dist/{migration-new-YSdtJTRp-Dc06LNJe.mjs.map → migration-new-Bp5dPKnF-D-Fb6vEp.mjs.map} +1 -1
  108. package/dist/{migration-new-Bf5K9fNK-Cd90rYmm.mjs → migration-new-CXLgOLXz-2C5s_q7n.mjs} +4 -4
  109. package/dist/{migration-new-Bf5K9fNK-Cd90rYmm.mjs.map → migration-new-CXLgOLXz-2C5s_q7n.mjs.map} +1 -1
  110. package/dist/{migration-path-target-5r1leSW5-B0EMgvEv.mjs → migration-path-target-BNTSTPAc-D7dQ4K7x.mjs} +3 -3
  111. package/dist/{migration-path-target-5r1leSW5-B0EMgvEv.mjs.map → migration-path-target-BNTSTPAc-D7dQ4K7x.mjs.map} +1 -1
  112. package/dist/{migration-plan-oterbw8h-_GrKbsRb.mjs → migration-plan-BxfF1Hdo-BKn0xMlY.mjs} +4 -4
  113. package/dist/{migration-plan-oterbw8h-_GrKbsRb.mjs.map → migration-plan-BxfF1Hdo-BKn0xMlY.mjs.map} +1 -1
  114. package/dist/{migration-plan-CZY8HVCh-BbfQvxnb.mjs → migration-plan-C6KrFHJT-CRkTsE7L.mjs} +8 -8
  115. package/dist/{migration-plan-CZY8HVCh-BbfQvxnb.mjs.map → migration-plan-C6KrFHJT-CRkTsE7L.mjs.map} +1 -1
  116. package/dist/{migration-plan-4cnnP6yM-DXzRfi_A.d.mts → migration-plan-CharRhoN-BIB3WL65.d.mts} +3 -3
  117. package/dist/{migration-plan-4cnnP6yM-DXzRfi_A.d.mts.map → migration-plan-CharRhoN-BIB3WL65.d.mts.map} +1 -1
  118. package/dist/{migration-show-iX2cduR4-C3-FENR4.mjs → migration-show-Dhnlx_GU-DhWLLt3Z.mjs} +8 -8
  119. package/dist/{migration-show-iX2cduR4-C3-FENR4.mjs.map → migration-show-Dhnlx_GU-DhWLLt3Z.mjs.map} +1 -1
  120. package/dist/{migration-status-BZ6gOxyJ-sbhPgABr.mjs → migration-status-S88DjM8c-DLHnCKfW.mjs} +10 -10
  121. package/dist/{migration-status-BZ6gOxyJ-sbhPgABr.mjs.map → migration-status-S88DjM8c-DLHnCKfW.mjs.map} +1 -1
  122. package/dist/{project-import-root-BPuwl2j1-DTX9G73z.mjs → project-import-root-nwdoPWap--5vXe4zp.mjs} +3 -3
  123. package/dist/{project-import-root-BPuwl2j1-DTX9G73z.mjs.map → project-import-root-nwdoPWap--5vXe4zp.mjs.map} +1 -1
  124. package/dist/{ref-CVD6j3jA-BAgpZLNM.mjs → ref-C8oaaeky-ColNkWpr.mjs} +5 -5
  125. package/dist/{ref-CVD6j3jA-BAgpZLNM.mjs.map → ref-C8oaaeky-ColNkWpr.mjs.map} +1 -1
  126. package/dist/{ref-CaqNqeRF-cjWFAueu.mjs → ref-gZQjdz8I-CW6n9Fc0.mjs} +4 -4
  127. package/dist/{ref-CaqNqeRF-cjWFAueu.mjs.map → ref-gZQjdz8I-CW6n9Fc0.mjs.map} +1 -1
  128. package/dist/{ref-resolution-D4fAdXo8-Dfaky0yw.mjs → ref-resolution-DAK4OK3x-B-8ZZc0f.mjs} +3 -3
  129. package/dist/{ref-resolution-D4fAdXo8-Dfaky0yw.mjs.map → ref-resolution-DAK4OK3x-B-8ZZc0f.mjs.map} +1 -1
  130. package/dist/{telemetry-fKuZOFpu-DNUWfIHo.mjs → telemetry-DPXFYAsz-CPW2USxs.mjs} +3 -3
  131. package/dist/{telemetry-fKuZOFpu-DNUWfIHo.mjs.map → telemetry-DPXFYAsz-CPW2USxs.mjs.map} +1 -1
  132. package/dist/vite-plugin-contract-emit.mjs +1 -1
  133. package/package.json +12 -12
  134. package/dist/cli-errors-C6_pH59O-CzD4SYcJ.mjs.map +0 -1
  135. package/dist/cli-errors-f5PRtVdm-C6xVKeQn.d.mts.map +0 -1
  136. package/dist/client-BqhVohc5-DFRVWFps.mjs.map +0 -1
  137. package/dist/contract-emit-Csa6R0gt-DvxFlS0O.mjs +0 -2
  138. package/dist/db-update-BX1sOuQk-CpeLgPeN.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-DU9qtBxW-BjVHiKzE.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/client-DU9qtBxW.mjs"],"sourcesContent":["import { t as CliStructuredError$1 } from \"./cli-errors-BG6bItjG.mjs\";\nimport { t as assertFrameworkComponentsCompatible } from \"./framework-components-C3K7SBeC.mjs\";\nimport { t as enrichContract } from \"./contract-enrichment-DrMvvY2A.mjs\";\nimport { n as buildContractSpaceAggregate } from \"./contract-space-aggregate-loader-CoLTf3Ce.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 { createHash } from \"node:crypto\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\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/plan-identity.ts\n/**\n* Content identity of a `db update` plan: what it does (the ordered display\n* operations) and where it lands (the destination storage hash). A\n* `DESTRUCTIVE_CHANGES` refusal names the refused plan by this hash, and the\n* apply that carries the consent back recomputes it to prove it is still\n* applying the plan that was consented to.\n*/\nfunction computePlanHash(plan) {\n\tconst canonical = canonicalizeJson({\n\t\toperations: plan.operations,\n\t\tdestination: { storageHash: plan.destination.storageHash }\n\t});\n\treturn createHash(\"sha256\").update(canonical).digest(\"hex\");\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\tcause: runnerResult.failure\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\tif (options.consentedPlanHash !== void 0) {\n\t\tconst planHash = computePlanHash({\n\t\t\toperations: stripOperations(orderedResolutions.flatMap((r) => r.entry.displayOps)),\n\t\t\tdestination: appPlan.destination\n\t\t});\n\t\tif (planHash !== options.consentedPlanHash) return notOk({\n\t\t\tcode: \"CONSENT_PLAN_MISMATCH\",\n\t\t\tsummary: \"The plan changed between consent and apply\",\n\t\t\twhy: \"The plan recomputed for the consented apply is not the plan that was consented to, so applying it could destroy something nobody agreed to.\",\n\t\t\tconflicts: void 0,\n\t\t\tmeta: void 0,\n\t\t\tconsentPlanMismatch: {\n\t\t\t\tconsentedPlanHash: options.consentedPlanHash,\n\t\t\t\tplanHash\n\t\t\t},\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\t...ifDefined(\"cause\", applied.failure.cause)\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\t...ifDefined(\"cause\", args.cause)\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 && options.consent === void 0) {\n\t\tconst refusal = await guardDestructiveChanges(sharedInputs);\n\t\tif (refusal !== null) return refusal;\n\t}\n\treturn await executeRun({\n\t\t...sharedInputs,\n\t\tmode: options.mode,\n\t\t...ifDefined(\"consentedPlanHash\", options.consent?.planHash)\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\tconst databaseName = await sharedInputs.driver.databaseName?.();\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 explicit consent, which the caller has not given\",\n\t\tconflicts: void 0,\n\t\tmeta: void 0,\n\t\tdestructiveChanges: {\n\t\t\tdestructiveOperations: destructiveOps,\n\t\t\tdatabaseName,\n\t\t\tplanHash: computePlanHash({\n\t\t\t\toperations: planResult.value.plan.operations,\n\t\t\t\tdestination: planResult.value.destination\n\t\t\t})\n\t\t},\n\t\t...ifDefined(\"warnings\", planResult.value.warnings)\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\t...ifDefined(\"cause\", applied.failure.cause)\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(\"consent\", options.consent),\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-DU9qtBxW.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,gBAAgB,YAAY;CACpC,OAAO,WAAW,KAAK,QAAQ;EAC9B,IAAI,GAAG;EACP,OAAO,GAAG;EACV,gBAAgB,GAAG;CACpB,EAAE;AACH;;;;;;;;AAUA,SAAS,gBAAgB,MAAM;CAC9B,MAAM,YAAY,iBAAiB;EAClC,YAAY,KAAK;EACjB,aAAa,EAAE,aAAa,KAAK,YAAY,YAAY;CAC1D,CAAC;CACD,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,KAAK;AAC3D;;;;;AAOA,MAAM,cAAc;;;;;;;;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C;EACF;CACD;AACD"}
@@ -1,4 +1,4 @@
1
- import { O as errorRuntime$1, p as errorInvalidOutputFormat, t as CliStructuredError$1, x as errorOutputFormatMutex } from "./cli-errors-C6_pH59O-CzD4SYcJ.mjs";
1
+ import { S as errorOutputFormatMutex, k as errorRuntime$1, m as errorInvalidOutputFormat, t as CliStructuredError$1 } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
2
2
  import { a as formatErrorJson, i as formatDim, n as createColorFormatter, o as formatErrorOutput, r as createTerminalUI } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
3
3
  import { c as spaceMigrationDirectory, t as APP_SPACE_ID$1 } from "./verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs";
4
4
  import "@prisma/orm-framework/utils/defined";
@@ -11,7 +11,7 @@ import wrapAnsi from "wrap-ansi";
11
11
  import stringWidth from "string-width";
12
12
  import stripAnsi from "strip-ansi";
13
13
  import { isCI } from "ci-info";
14
- //#region ../../../1-framework/3-tooling/cli/dist/command-helpers-kD9CO1hd.mjs
14
+ //#region ../../../1-framework/3-tooling/cli/dist/command-helpers-CwLvFwMB.mjs
15
15
  /**
16
16
  * Fixed width for left column in help output.
17
17
  */
@@ -773,4 +773,4 @@ function addGlobalOptions(command) {
773
773
  //#endregion
774
774
  export { toStructuralEdge as C, targetSupportsMigrations as S, resolveMigrationPaths as _, formatCommandHelp as a, setCommandExamples as b, formatSuccessMessage as c, isCI$1 as d, maskConnectionUrl as f, resolveContractPath as g, readContractEnvelope as h, deriveCanPrompt as i, getTargetMigrations as l, parseGlobalFlagsOrExit as m, closeQuietly as n, formatRootHelp as o, parseGlobalFlags as p, collectDeclaredInvariants as r, formatStyledHeader as s, addGlobalOptions as t, handleResult as u, sanitizeErrorMessage as v, setCommandSeeAlso as x, setCommandDescriptions as y };
775
775
 
776
- //# sourceMappingURL=command-helpers-kD9CO1hd-BPhnkBin.mjs.map
776
+ //# sourceMappingURL=command-helpers-CwLvFwMB-BWwUQhlT.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-helpers-kD9CO1hd-BPhnkBin.mjs","names":["CliStructuredError","errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/command-helpers-kD9CO1hd.mjs"],"sourcesContent":["import { D as errorRuntime, b as errorOutputFormatMutex, f as errorInvalidOutputFormat, t as CliStructuredError } from \"./cli-errors-C6_pH59O.mjs\";\nimport { i as formatErrorOutput, m as formatDim, p as createColorFormatter, r as formatErrorJson, t as createTerminalUI } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport \"@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 { APP_SPACE_ID as APP_SPACE_ID$1, spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\nimport { blue, bold, cyan, dim, green, magenta } from \"colorette\";\nimport wrapAnsi from \"wrap-ansi\";\nimport stringWidth from \"string-width\";\nimport stripAnsi from \"strip-ansi\";\nimport { isCI } from \"ci-info\";\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/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/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.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(\"CONFIG.VALIDATION_FAILED\", \"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*\n* `cwd` is the directory the command was invoked from; every relative path in\n* the result is computed against it.\n*/\nfunction resolveMigrationPaths(configOption, config, cwd) {\n\tconst resolvedConfigPath = configOption ? resolve(cwd, configOption) : void 0;\n\tconst configPath = resolvedConfigPath ? relative(cwd, resolvedConfigPath) : \"prisma-next.config.ts\";\n\tconst migrationsDir = resolve(resolvedConfigPath ? resolve(resolvedConfigPath, \"..\") : cwd, config.migrations?.dir ?? \"migrations\");\n\tconst migrationsRelative = relative(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(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}\n/**\n* Hangs up without letting the hang-up decide the command's result. A rejection out of a\n* `finally` replaces the value the `try`/`catch` already returned, so an unguarded close turns a\n* mapped connection error into an unmapped one — and that is the case it hits most, because a\n* `connect()` that failed leaves nothing to close.\n*/\nasync function closeQuietly(client) {\n\ttry {\n\t\tawait client.close();\n\t} catch {}\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(\"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(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing schemaVersion.`, { where: { path: contractPath } });\n\tif (typeof target !== \"string\") throw new CliStructuredError(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing target.`, { where: { path: contractPath } });\n\tif (typeof targetFamily !== \"string\") throw new CliStructuredError(\"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 { formatSuccessMessage as C, formatStyledHeader as S, parseGlobalFlagsOrExit as _, maskConnectionUrl as a, formatCommandHelp as b, resolveMigrationPaths as c, setCommandExamples as d, setCommandSeeAlso as f, parseGlobalFlags as g, deriveCanPrompt as h, getTargetMigrations as i, sanitizeErrorMessage as l, toStructuralEdge as m, closeQuietly as n, readContractEnvelope as o, targetSupportsMigrations as p, collectDeclaredInvariants as r, resolveContractPath as s, addGlobalOptions as t, setCommandDescriptions as u, handleResult as v, formatRootHelp as x, isCI$1 as y };\n\n//# sourceMappingURL=command-helpers-kD9CO1hd.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,sBAAsB;;;;;;AAM5B,SAAS,wBAAwB,UAAU;CAC1C,IAAI,CAAC,UAAU,OAAO;CACt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CAAC,eAAe,OAAO;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
+ {"version":3,"file":"command-helpers-CwLvFwMB-BWwUQhlT.mjs","names":["CliStructuredError","errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/command-helpers-CwLvFwMB.mjs"],"sourcesContent":["import { O as errorRuntime, p as errorInvalidOutputFormat, t as CliStructuredError, x as errorOutputFormatMutex } from \"./cli-errors-BG6bItjG.mjs\";\nimport { i as formatErrorOutput, m as formatDim, p as createColorFormatter, r as formatErrorJson, t as createTerminalUI } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport \"@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 { APP_SPACE_ID as APP_SPACE_ID$1, spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\nimport { blue, bold, cyan, dim, green, magenta } from \"colorette\";\nimport wrapAnsi from \"wrap-ansi\";\nimport stringWidth from \"string-width\";\nimport stripAnsi from \"strip-ansi\";\nimport { isCI } from \"ci-info\";\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/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/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.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(\"CONFIG.VALIDATION_FAILED\", \"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*\n* `cwd` is the directory the command was invoked from; every relative path in\n* the result is computed against it.\n*/\nfunction resolveMigrationPaths(configOption, config, cwd) {\n\tconst resolvedConfigPath = configOption ? resolve(cwd, configOption) : void 0;\n\tconst configPath = resolvedConfigPath ? relative(cwd, resolvedConfigPath) : \"prisma-next.config.ts\";\n\tconst migrationsDir = resolve(resolvedConfigPath ? resolve(resolvedConfigPath, \"..\") : cwd, config.migrations?.dir ?? \"migrations\");\n\tconst migrationsRelative = relative(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(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}\n/**\n* Hangs up without letting the hang-up decide the command's result. A rejection out of a\n* `finally` replaces the value the `try`/`catch` already returned, so an unguarded close turns a\n* mapped connection error into an unmapped one — and that is the case it hits most, because a\n* `connect()` that failed leaves nothing to close.\n*/\nasync function closeQuietly(client) {\n\ttry {\n\t\tawait client.close();\n\t} catch {}\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(\"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(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing schemaVersion.`, { where: { path: contractPath } });\n\tif (typeof target !== \"string\") throw new CliStructuredError(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing target.`, { where: { path: contractPath } });\n\tif (typeof targetFamily !== \"string\") throw new CliStructuredError(\"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 { formatSuccessMessage as C, formatStyledHeader as S, parseGlobalFlagsOrExit as _, maskConnectionUrl as a, formatCommandHelp as b, resolveMigrationPaths as c, setCommandExamples as d, setCommandSeeAlso as f, parseGlobalFlags as g, deriveCanPrompt as h, getTargetMigrations as i, sanitizeErrorMessage as l, toStructuralEdge as m, closeQuietly as n, readContractEnvelope as o, targetSupportsMigrations as p, collectDeclaredInvariants as r, resolveContractPath as s, addGlobalOptions as t, setCommandDescriptions as u, handleResult as v, formatRootHelp as x, isCI$1 as y };\n\n//# sourceMappingURL=command-helpers-CwLvFwMB.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,sBAAsB;;;;;;AAM5B,SAAS,wBAAwB,UAAU;CAC1C,IAAI,CAAC,UAAU,OAAO;CACtB,OAAO,KAAK,aAAa;AAC1B;;;;AAIA,SAAS,oBAAoB;CAC5B,QAAQ,GAAG,MAAM,IAAI,IAAI,OAAO,KAAK,IAAI,GAAG,IAAI,EAAE,MAAM,CAAC;AAC1D;;;;AAIA,SAAS,mBAAmB,SAAS;CACpC,IAAI,QAAQ,WAAW,OAAO,GAAG,QAAQ,MAAM,GAAG,QAAQ,UAAU,KAAK,QAAQ;CACjF,OAAO,GAAG,QAAQ,MAAM,GAAG,QAAQ;AACpC;;;;;AAKA,SAAS,qBAAqB,SAAS;CACtC,MAAM,cAAc,kBAAk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;;;;;;;;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,7 +1,7 @@
1
- import { N as errorUnexpected, d as errorFileNotFound, k as errorSnapshotMissing, s as errorContractValidationFailed, t as CliStructuredError$1 } from "./cli-errors-C6_pH59O-CzD4SYcJ.mjs";
1
+ import { A as errorSnapshotMissing, P as errorUnexpected, c as errorContractValidationFailed, f as errorFileNotFound, t as CliStructuredError$1 } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
2
2
  import { t as MigrationToolsError } from "./errors-CXbGUWGu-BQi6YS-H.mjs";
3
3
  import { notOk } from "@prisma/orm-framework/utils/result";
4
- //#region ../../../1-framework/3-tooling/cli/dist/contract-at-errors-CLFX1-Gc.mjs
4
+ //#region ../../../1-framework/3-tooling/cli/dist/contract-at-errors-Dptf8RE_.mjs
5
5
  function mapContractAtError(error, options) {
6
6
  if (MigrationToolsError.is(error)) switch (error.code) {
7
7
  case "MIGRATION.REF_NOT_RESOLVABLE": return notOk(errorSnapshotMissing(typeof error.meta?.["refName"] === "string" ? error.meta["refName"] : typeof error.meta?.["identifier"] === "string" ? error.meta["identifier"] : "unknown", { cause: error }));
@@ -41,4 +41,4 @@ function mapContractAtError(error, options) {
41
41
  //#endregion
42
42
  export { mapContractAtError as t };
43
43
 
44
- //# sourceMappingURL=contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs.map
44
+ //# sourceMappingURL=contract-at-errors-Dptf8RE_-B5gr04Sc.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs","names":["CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/contract-at-errors-CLFX1-Gc.mjs"],"sourcesContent":["import { M as errorUnexpected, O as errorSnapshotMissing, o as errorContractValidationFailed, t as CliStructuredError, u as errorFileNotFound } from \"./cli-errors-C6_pH59O.mjs\";\nimport { notOk } from \"@internal/utils/result\";\nimport { MigrationToolsError } from \"@internal/migration-tools/errors\";\n//#region src/control-api/operations/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.meta?.[\"refName\"] === \"string\" ? error.meta[\"refName\"] : typeof error.meta?.[\"identifier\"] === \"string\" ? error.meta[\"identifier\"] : \"unknown\", { cause: error }));\n\t\tcase \"MIGRATION.CONTRACT_DESERIALIZATION_FAILED\": {\n\t\t\tconst filePath = typeof error.meta?.[\"filePath\"] === \"string\" ? error.meta[\"filePath\"] : \"unknown\";\n\t\t\treturn notOk(errorContractValidationFailed(`Predecessor contract at ${filePath} failed to deserialize: ${typeof error.meta?.[\"message\"] === \"string\" ? error.meta[\"message\"] : error.message}`, {\n\t\t\t\twhere: { path: filePath },\n\t\t\t\tcause: error\n\t\t\t}));\n\t\t}\n\t\tcase \"MIGRATION.INVALID_JSON\": {\n\t\t\tconst filePath = typeof error.meta?.[\"filePath\"] === \"string\" ? error.meta[\"filePath\"] : \"unknown\";\n\t\t\tconst message = typeof error.meta?.[\"parseError\"] === \"string\" ? error.meta[\"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}`, {\n\t\t\t\twhere: { path: filePath },\n\t\t\t\tcause: error\n\t\t\t}));\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\tcause: error\n\t\t}));\n\t\tcase \"MIGRATION.CONTRACT_SNAPSHOT_MISSING\": {\n\t\t\tconst expectedPath = typeof error.meta?.[\"expectedPath\"] === \"string\" ? error.meta[\"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\tcause: error\n\t\t\t}));\n\t\t}\n\t\tdefault: return notOk(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-CLFX1-Gc.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,OAAO,eAAe,WAAW,MAAM,KAAK,aAAa,OAAO,MAAM,OAAO,kBAAkB,WAAW,MAAM,KAAK,gBAAgB,WAAW,EAAE,OAAO,MAAM,CAAC,CAAC;EACrP,KAAK,6CAA6C;GACjD,MAAM,WAAW,OAAO,MAAM,OAAO,gBAAgB,WAAW,MAAM,KAAK,cAAc;GACzF,OAAO,MAAM,8BAA8B,2BAA2B,SAAS,0BAA0B,OAAO,MAAM,OAAO,eAAe,WAAW,MAAM,KAAK,aAAa,MAAM,WAAW;IAC/L,OAAO,EAAE,MAAM,SAAS;IACxB,OAAO;GACR,CAAC,CAAC;EACH;EACA,KAAK,0BAA0B;GAC9B,MAAM,WAAW,OAAO,MAAM,OAAO,gBAAgB,WAAW,MAAM,KAAK,cAAc;GACzF,MAAM,UAAU,OAAO,MAAM,OAAO,kBAAkB,WAAW,MAAM,KAAK,gBAAgB,MAAM;GAClG,OAAO,MAAM,+BAA+B,SAAS,gBAAgB,YAAY,OAAO,sBAAsB,SAAS,0BAA0B,YAAY,2BAA2B,SAAS,0BAA0B,WAAW;IACrO,OAAO,EAAE,MAAM,SAAS;IACxB,OAAO;GACR,CAAC,CAAC;EACH;EACA,KAAK,6CAA6C,OAAO,MAAM,gBAAgB,MAAM,SAAS;GAC7F,KAAK,MAAM;GACX,KAAK,MAAM;GACX,OAAO;EACR,CAAC,CAAC;EACF,KAAK,uCAAuC;GAC3C,MAAM,eAAe,OAAO,MAAM,OAAO,oBAAoB,WAAW,MAAM,KAAK,kBAAkB;GACrG,OAAO,MAAM,kBAAkB,cAAc;IAC5C,MAAM,SAAS,gBAAgB,YAAY,OAAO,wDAAwD,iBAAiB,6DAA6D;IACxL,KAAK;IACL,OAAO;GACR,CAAC,CAAC;EACH;EACA,SAAS,OAAO,MAAM,KAAK;CAC5B;CACA,IAAIA,qBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;CACpD,MAAM;AACP"}
1
+ {"version":3,"file":"contract-at-errors-Dptf8RE_-B5gr04Sc.mjs","names":["CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/contract-at-errors-Dptf8RE_.mjs"],"sourcesContent":["import { N as errorUnexpected, d as errorFileNotFound, k as errorSnapshotMissing, s as errorContractValidationFailed, t as CliStructuredError } from \"./cli-errors-BG6bItjG.mjs\";\nimport { notOk } from \"@internal/utils/result\";\nimport { MigrationToolsError } from \"@internal/migration-tools/errors\";\n//#region src/control-api/operations/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.meta?.[\"refName\"] === \"string\" ? error.meta[\"refName\"] : typeof error.meta?.[\"identifier\"] === \"string\" ? error.meta[\"identifier\"] : \"unknown\", { cause: error }));\n\t\tcase \"MIGRATION.CONTRACT_DESERIALIZATION_FAILED\": {\n\t\t\tconst filePath = typeof error.meta?.[\"filePath\"] === \"string\" ? error.meta[\"filePath\"] : \"unknown\";\n\t\t\treturn notOk(errorContractValidationFailed(`Predecessor contract at ${filePath} failed to deserialize: ${typeof error.meta?.[\"message\"] === \"string\" ? error.meta[\"message\"] : error.message}`, {\n\t\t\t\twhere: { path: filePath },\n\t\t\t\tcause: error\n\t\t\t}));\n\t\t}\n\t\tcase \"MIGRATION.INVALID_JSON\": {\n\t\t\tconst filePath = typeof error.meta?.[\"filePath\"] === \"string\" ? error.meta[\"filePath\"] : \"unknown\";\n\t\t\tconst message = typeof error.meta?.[\"parseError\"] === \"string\" ? error.meta[\"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}`, {\n\t\t\t\twhere: { path: filePath },\n\t\t\t\tcause: error\n\t\t\t}));\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\tcause: error\n\t\t}));\n\t\tcase \"MIGRATION.CONTRACT_SNAPSHOT_MISSING\": {\n\t\t\tconst expectedPath = typeof error.meta?.[\"expectedPath\"] === \"string\" ? error.meta[\"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\tcause: error\n\t\t\t}));\n\t\t}\n\t\tdefault: return notOk(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-Dptf8RE_.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,OAAO,eAAe,WAAW,MAAM,KAAK,aAAa,OAAO,MAAM,OAAO,kBAAkB,WAAW,MAAM,KAAK,gBAAgB,WAAW,EAAE,OAAO,MAAM,CAAC,CAAC;EACrP,KAAK,6CAA6C;GACjD,MAAM,WAAW,OAAO,MAAM,OAAO,gBAAgB,WAAW,MAAM,KAAK,cAAc;GACzF,OAAO,MAAM,8BAA8B,2BAA2B,SAAS,0BAA0B,OAAO,MAAM,OAAO,eAAe,WAAW,MAAM,KAAK,aAAa,MAAM,WAAW;IAC/L,OAAO,EAAE,MAAM,SAAS;IACxB,OAAO;GACR,CAAC,CAAC;EACH;EACA,KAAK,0BAA0B;GAC9B,MAAM,WAAW,OAAO,MAAM,OAAO,gBAAgB,WAAW,MAAM,KAAK,cAAc;GACzF,MAAM,UAAU,OAAO,MAAM,OAAO,kBAAkB,WAAW,MAAM,KAAK,gBAAgB,MAAM;GAClG,OAAO,MAAM,+BAA+B,SAAS,gBAAgB,YAAY,OAAO,sBAAsB,SAAS,0BAA0B,YAAY,2BAA2B,SAAS,0BAA0B,WAAW;IACrO,OAAO,EAAE,MAAM,SAAS;IACxB,OAAO;GACR,CAAC,CAAC;EACH;EACA,KAAK,6CAA6C,OAAO,MAAM,gBAAgB,MAAM,SAAS;GAC7F,KAAK,MAAM;GACX,KAAK,MAAM;GACX,OAAO;EACR,CAAC,CAAC;EACF,KAAK,uCAAuC;GAC3C,MAAM,eAAe,OAAO,MAAM,OAAO,oBAAoB,WAAW,MAAM,KAAK,kBAAkB;GACrG,OAAO,MAAM,kBAAkB,cAAc;IAC5C,MAAM,SAAS,gBAAgB,YAAY,OAAO,wDAAwD,iBAAiB,6DAA6D;IACxL,KAAK;IACL,OAAO;GACR,CAAC,CAAC;EACH;EACA,SAAS,OAAO,MAAM,KAAK;CAC5B;CACA,IAAIA,qBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;CACpD,MAAM;AACP"}
@@ -1,16 +1,16 @@
1
1
  import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
2
- import { N as errorUnexpected, t as CliStructuredError$1 } from "./cli-errors-C6_pH59O-CzD4SYcJ.mjs";
2
+ import { P as errorUnexpected, t as CliStructuredError$1 } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
3
3
  import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
4
- import { n as executeContractEmit } from "./contract-emit-CrYO0A8x-60BOqXFr.mjs";
4
+ import { n as executeContractEmit } from "./contract-emit-CZQZ1i4z-p9LSGmmQ.mjs";
5
5
  import { p as isVerbose, r as createTerminalUI } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
6
- import { b as setCommandExamples, c as formatSuccessMessage, m as parseGlobalFlagsOrExit, s as formatStyledHeader, t as addGlobalOptions, u as handleResult, y as setCommandDescriptions } from "./command-helpers-kD9CO1hd-BPhnkBin.mjs";
6
+ import { b as setCommandExamples, c as formatSuccessMessage, m as parseGlobalFlagsOrExit, s as formatStyledHeader, t as addGlobalOptions, u as handleResult, y as setCommandDescriptions } from "./command-helpers-CwLvFwMB-BWwUQhlT.mjs";
7
7
  import { t as createProgressAdapter } from "./progress-adapter-CjAeTxY_-BXYSd1eY.mjs";
8
8
  import { errorContractConfigMissing } from "@prisma/orm-framework/errors/control";
9
9
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
10
10
  import { dirname, join, relative, resolve } from "pathe";
11
11
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
12
12
  import { Command } from "commander";
13
- //#region ../../../1-framework/3-tooling/cli/dist/contract-emit-BlvUNMHM.mjs
13
+ //#region ../../../1-framework/3-tooling/cli/dist/contract-emit-BQFpcb2A.mjs
14
14
  /**
15
15
  * Formats human-readable output for contract emit.
16
16
  */
@@ -151,4 +151,4 @@ function createContractEmitCommand() {
151
151
  //#endregion
152
152
  export { createContractEmitCommand as t };
153
153
 
154
- //# sourceMappingURL=contract-emit-BlvUNMHM-BEioUVR5.mjs.map
154
+ //# sourceMappingURL=contract-emit-BQFpcb2A-BwT9iVdb.mjs.map