@prisma/orm-toolchain 8.0.0-rc.1-dev.25 → 8.0.0-rc.1-dev.26

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 (160) hide show
  1. package/dist/bin__prisma-next.mjs +24 -24
  2. package/dist/bin__prisma-next.mjs.map +1 -1
  3. package/dist/{caught-errors-nYuTn3NK-DkD-ZrDr.mjs → caught-errors-B_oGFiYw-BqX49eW0.mjs} +3 -3
  4. package/dist/{caught-errors-nYuTn3NK-DkD-ZrDr.mjs.map → caught-errors-B_oGFiYw-BqX49eW0.mjs.map} +1 -1
  5. package/dist/{cli-errors-C7vbvQuK-DLpSxz4U.d.mts → cli-errors-C8DGzS94-CPP3UmRT.d.mts} +6 -5
  6. package/dist/cli-errors-C8DGzS94-CPP3UmRT.d.mts.map +1 -0
  7. package/dist/{cli-errors-kU09RUaz-CUkQ9XuM.mjs → cli-errors-CihMAEVj-C1uUYBop.mjs} +122 -28
  8. package/dist/cli-errors-CihMAEVj-C1uUYBop.mjs.map +1 -0
  9. package/dist/cli.mjs +383 -14
  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.d.mts +1 -1
  21. package/dist/cli__commands__migration-check.mjs +2 -2
  22. package/dist/cli__commands__migration-graph.d.mts +12 -10
  23. package/dist/cli__commands__migration-graph.d.mts.map +1 -1
  24. package/dist/cli__commands__migration-graph.mjs +1 -1
  25. package/dist/cli__commands__migration-list.d.mts +4 -4
  26. package/dist/cli__commands__migration-list.mjs +1 -1
  27. package/dist/cli__commands__migration-log.d.mts +4 -4
  28. package/dist/cli__commands__migration-log.mjs +1 -1
  29. package/dist/cli__commands__migration-new.mjs +1 -1
  30. package/dist/cli__commands__migration-plan.d.mts +1 -1
  31. package/dist/cli__commands__migration-plan.mjs +1 -1
  32. package/dist/cli__commands__migration-show.d.mts +1 -1
  33. package/dist/cli__commands__migration-show.mjs +1 -1
  34. package/dist/cli__commands__migration-status.d.mts +4 -4
  35. package/dist/cli__commands__migration-status.mjs +2 -2
  36. package/dist/cli__commands__ref.mjs +1 -1
  37. package/dist/cli__commands__telemetry.mjs +1 -1
  38. package/dist/cli__control-api.d.mts +33 -31
  39. package/dist/cli__control-api.d.mts.map +1 -1
  40. package/dist/cli__control-api.mjs +15 -15
  41. package/dist/cli__control-api__testing.d.mts +1 -1
  42. package/dist/{client-milNsAnF-B92uF3yv.mjs → client-CaIWFVnh-PVaTEvdx.mjs} +5 -5
  43. package/dist/{client-milNsAnF-B92uF3yv.mjs.map → client-CaIWFVnh-PVaTEvdx.mjs.map} +1 -1
  44. package/dist/{command-helpers-bGYd7Aab-BNSzfbHK.mjs → command-helpers-DutQjYgy-CDfFwtAa.mjs} +16 -5
  45. package/dist/{command-helpers-bGYd7Aab-BNSzfbHK.mjs.map → command-helpers-DutQjYgy-CDfFwtAa.mjs.map} +1 -1
  46. package/dist/{contract-at-errors-BTeDEXm4-BAIDia2-.mjs → contract-at-errors-BsQiGdZC-BY8u2is4.mjs} +3 -3
  47. package/dist/{contract-at-errors-BTeDEXm4-BAIDia2-.mjs.map → contract-at-errors-BsQiGdZC-BY8u2is4.mjs.map} +1 -1
  48. package/dist/contract-emit-BAfPwP3y-DfV1Stry.mjs +2 -0
  49. package/dist/{contract-emit-Ci-8sP-b-QzQXK2xQ.mjs → contract-emit-BJDLPMxp-qaGmQUQr.mjs} +6 -6
  50. package/dist/{contract-emit-Ci-8sP-b-QzQXK2xQ.mjs.map → contract-emit-BJDLPMxp-qaGmQUQr.mjs.map} +1 -1
  51. package/dist/{contract-emit-Bdf4DAR4-lKqkbfZT.mjs → contract-emit-WIAaN0lC-DKOdtrUQ.mjs} +5 -5
  52. package/dist/{contract-emit-Bdf4DAR4-lKqkbfZT.mjs.map → contract-emit-WIAaN0lC-DKOdtrUQ.mjs.map} +1 -1
  53. package/dist/{contract-infer-hhyMJiwS-BJ5cYC9P.mjs → contract-infer-B929dnCJ-KkT9frLY.mjs} +5 -5
  54. package/dist/{contract-infer-hhyMJiwS-BJ5cYC9P.mjs.map → contract-infer-B929dnCJ-KkT9frLY.mjs.map} +1 -1
  55. package/dist/{contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs → contract-snapshot-resolution-D2f9kGs0-BenF4tbi.mjs} +4 -4
  56. package/dist/{contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs.map → contract-snapshot-resolution-D2f9kGs0-BenF4tbi.mjs.map} +1 -1
  57. package/dist/{contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs → contract-space-aggregate-loader-sF0OJ6oz-jRjdZoyZ.mjs} +4 -4
  58. package/dist/{contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs.map → contract-space-aggregate-loader-sF0OJ6oz-jRjdZoyZ.mjs.map} +1 -1
  59. package/dist/{db-init-3CbSYxRI-BlTkWh8n.mjs → db-init-CU_x-p2M-_6oEFLiG.mjs} +7 -7
  60. package/dist/db-init-CU_x-p2M-_6oEFLiG.mjs.map +1 -0
  61. package/dist/{db-schema-BVLbe3EL-WLnbuo77.mjs → db-schema-BKAn8UrM-DP4k7BAB.mjs} +6 -6
  62. package/dist/{db-schema-BVLbe3EL-WLnbuo77.mjs.map → db-schema-BKAn8UrM-DP4k7BAB.mjs.map} +1 -1
  63. package/dist/{db-sign-Cdw2RmoG-C-X5UheR.mjs → db-sign-BQF-jVXg-D467Bhpj.mjs} +9 -9
  64. package/dist/db-sign-BQF-jVXg-D467Bhpj.mjs.map +1 -0
  65. package/dist/{db-update-BHOdo8PV-BVBNKrJc.mjs → db-update-B0_Q4ykE-CT9vcaMu.mjs} +8 -8
  66. package/dist/db-update-B0_Q4ykE-CT9vcaMu.mjs.map +1 -0
  67. package/dist/{db-verify-C9P9oNCs-gieY7hV2.mjs → db-verify-C0DJc8z6-f3gZeEMD.mjs} +9 -9
  68. package/dist/db-verify-C0DJc8z6-f3gZeEMD.mjs.map +1 -0
  69. package/dist/{format-Ddhz7xFW-Bo1nhay8.mjs → format-SYdHyutg-IqXk-tDV.mjs} +5 -5
  70. package/dist/{format-Ddhz7xFW-Bo1nhay8.mjs.map → format-SYdHyutg-IqXk-tDV.mjs.map} +1 -1
  71. package/dist/{framework-components-Cruf6BPK-CaQvMI3T.mjs → framework-components-CXxMNF8E-C-g2cchI.mjs} +3 -3
  72. package/dist/{framework-components-Cruf6BPK-CaQvMI3T.mjs.map → framework-components-CXxMNF8E-C-g2cchI.mjs.map} +1 -1
  73. package/dist/{init-DjdnLDyf-2nVOeVG9.mjs → init-BvE3r7P6-CjJraEPP.mjs} +5 -5
  74. package/dist/{init-DjdnLDyf-2nVOeVG9.mjs.map → init-BvE3r7P6-CjJraEPP.mjs.map} +1 -1
  75. package/dist/{inspect-live-schema-BEQun_1x-CZpCgg8A.mjs → inspect-live-schema-D8d7aI6a-_Q_4S5wm.mjs} +6 -6
  76. package/dist/inspect-live-schema-D8d7aI6a-_Q_4S5wm.mjs.map +1 -0
  77. package/dist/{invariants-D5TNnX5E-rjPoJGFq.mjs → invariants-TW5CizTS-BsIpi4h4.mjs} +4 -4
  78. package/dist/{invariants-D5TNnX5E-rjPoJGFq.mjs.map → invariants-TW5CizTS-BsIpi4h4.mjs.map} +1 -1
  79. package/dist/{legend-BBtAETiW-BHqTbUjx.mjs → legend-QYDKKevn-DCIlAPn4.mjs} +3 -3
  80. package/dist/{legend-BBtAETiW-BHqTbUjx.mjs.map → legend-QYDKKevn-DCIlAPn4.mjs.map} +1 -1
  81. package/dist/{migrate-show-CUymfnbM-BbpcO2FY.mjs → migrate-show-C-fdCznr-BH88FGVn.mjs} +7 -7
  82. package/dist/migrate-show-C-fdCznr-BH88FGVn.mjs.map +1 -0
  83. package/dist/{migrate-show-g71Z4vJw-ocdTvf70.d.mts → migrate-show-DWIvU6Y_-BQyWhZD1.d.mts} +4 -4
  84. package/dist/{migrate-show-g71Z4vJw-ocdTvf70.d.mts.map → migrate-show-DWIvU6Y_-BQyWhZD1.d.mts.map} +1 -1
  85. package/dist/{migrate-B-hpVTxi-DJzFYT2w.mjs → migrate-vNMZJk7M-DKogRyOh.mjs} +14 -14
  86. package/dist/migrate-vNMZJk7M-DKogRyOh.mjs.map +1 -0
  87. package/dist/{migration-check-DHYPMUFe-Cni_ZUzB.mjs → migration-check-C-2GTAGq-Duc0P6Uo.mjs} +16 -16
  88. package/dist/migration-check-C-2GTAGq-Duc0P6Uo.mjs.map +1 -0
  89. package/dist/{migration-check-zgqYe3SB-B6LI6wY7.mjs → migration-check-DATj3HSn-Del6ZSln.mjs} +26 -21
  90. package/dist/migration-check-DATj3HSn-Del6ZSln.mjs.map +1 -0
  91. package/dist/{migration-command-scaffold-DsT7ke7B-D3u913Po.mjs → migration-command-scaffold-BezR8GWB-BZFB2PC-.mjs} +5 -5
  92. package/dist/{migration-command-scaffold-DsT7ke7B-D3u913Po.mjs.map → migration-command-scaffold-BezR8GWB-BZFB2PC-.mjs.map} +1 -1
  93. package/dist/{migration-graph-Dm9gU0oE-DxPD_SNA.mjs → migration-graph-B1mg_jel-HVG6FLD0.mjs} +20 -62
  94. package/dist/migration-graph-B1mg_jel-HVG6FLD0.mjs.map +1 -0
  95. package/dist/{migration-graph-CChCjts3-ERrIm5aT.mjs → migration-graph-BtP1Va3T-CMOZgqVW.mjs} +3 -3
  96. package/dist/{migration-graph-CChCjts3-ERrIm5aT.mjs.map → migration-graph-BtP1Va3T-CMOZgqVW.mjs.map} +1 -1
  97. package/dist/migration-graph-sections-BVqyqBHg-DAwWjIIf.mjs +67 -0
  98. package/dist/migration-graph-sections-BVqyqBHg-DAwWjIIf.mjs.map +1 -0
  99. package/dist/{migration-list-Bkase_ZM-D-bErpSr.mjs → migration-list-AKRIIovW-Cr39jOaI.mjs} +3 -3
  100. package/dist/{migration-list-Bkase_ZM-D-bErpSr.mjs.map → migration-list-AKRIIovW-Cr39jOaI.mjs.map} +1 -1
  101. package/dist/{migration-list-DDGUTC8Y-B_X7rkez.mjs → migration-list-RSlyGyvD-KKmZtdY1.mjs} +7 -7
  102. package/dist/{migration-list-DDGUTC8Y-B_X7rkez.mjs.map → migration-list-RSlyGyvD-KKmZtdY1.mjs.map} +1 -1
  103. package/dist/migration-log-CBfOcyPC-DTqCL1cs.mjs +123 -0
  104. package/dist/migration-log-CBfOcyPC-DTqCL1cs.mjs.map +1 -0
  105. package/dist/{migration-log-Cft50PRu-DcnHdxT4.mjs → migration-log-table-C0dSMG9T-BhBYrdka.mjs} +4 -120
  106. package/dist/migration-log-table-C0dSMG9T-BhBYrdka.mjs.map +1 -0
  107. package/dist/{migration-new-D9GHbYwF-C8D22HXG.mjs → migration-new-1LYliIXy-BK_Xz0Z6.mjs} +5 -5
  108. package/dist/{migration-new-D9GHbYwF-C8D22HXG.mjs.map → migration-new-1LYliIXy-BK_Xz0Z6.mjs.map} +1 -1
  109. package/dist/{migration-new-RorO1I8r-Ch8NQ4GQ.mjs → migration-new-DcPO4tiw-Bew7S-bj.mjs} +7 -7
  110. package/dist/{migration-new-RorO1I8r-Ch8NQ4GQ.mjs.map → migration-new-DcPO4tiw-Bew7S-bj.mjs.map} +1 -1
  111. package/dist/{migration-path-target-DhGt62Mi-dm4TU1hJ.mjs → migration-path-target-yA4h5Zc6-DlzBblBG.mjs} +7 -7
  112. package/dist/migration-path-target-yA4h5Zc6-DlzBblBG.mjs.map +1 -0
  113. package/dist/{migration-plan-BOhasCLr-GJWYoOA8.mjs → migration-plan-B0z2Qpa5-6b1SJSsb.mjs} +5 -5
  114. package/dist/{migration-plan-BOhasCLr-GJWYoOA8.mjs.map → migration-plan-B0z2Qpa5-6b1SJSsb.mjs.map} +1 -1
  115. package/dist/{migration-plan-DrCTzrXH-CDJbdiC6.mjs → migration-plan-Cb7s5Ifx-Bwa2O0Ov.mjs} +8 -8
  116. package/dist/{migration-plan-DrCTzrXH-CDJbdiC6.mjs.map → migration-plan-Cb7s5Ifx-Bwa2O0Ov.mjs.map} +1 -1
  117. package/dist/{migration-plan-t2e_8yD2-w5Ffa0V_.d.mts → migration-plan-s94qwFHi-86F_Aklp.d.mts} +4 -4
  118. package/dist/{migration-plan-t2e_8yD2-w5Ffa0V_.d.mts.map → migration-plan-s94qwFHi-86F_Aklp.d.mts.map} +1 -1
  119. package/dist/{migration-show-DRARjIbv-1p6EE_Uw.mjs → migration-show-BRy1GVBE-NuwoczhZ.mjs} +13 -22
  120. package/dist/migration-show-BRy1GVBE-NuwoczhZ.mjs.map +1 -0
  121. package/dist/{migration-status-Yh0eOQJN-YpcPDpNh.mjs → migration-status-Dob4onB1-0YkQF25g.mjs} +12 -12
  122. package/dist/migration-status-Dob4onB1-0YkQF25g.mjs.map +1 -0
  123. package/dist/{project-import-root--e8xli8Z-Bfrvrv67.mjs → project-import-root-Bkz1gPB2-jhrMFebo.mjs} +3 -3
  124. package/dist/{project-import-root--e8xli8Z-Bfrvrv67.mjs.map → project-import-root-Bkz1gPB2-jhrMFebo.mjs.map} +1 -1
  125. package/dist/{ref-Cu7Zc1Hv-_R4MnDfr.mjs → ref-B643Z0CS-CoJgdv7h.mjs} +5 -5
  126. package/dist/{ref-Cu7Zc1Hv-_R4MnDfr.mjs.map → ref-B643Z0CS-CoJgdv7h.mjs.map} +1 -1
  127. package/dist/{ref-BQcl8Ksv-BYZY0Ktb.mjs → ref-D9J4TNYz-Dk7HCAoq.mjs} +5 -5
  128. package/dist/{ref-BQcl8Ksv-BYZY0Ktb.mjs.map → ref-D9J4TNYz-Dk7HCAoq.mjs.map} +1 -1
  129. package/dist/{ref-resolution-BYCRg72z-DFhwf-XR.mjs → ref-resolution-Bi4lpxM8-BX-7sl0f.mjs} +3 -3
  130. package/dist/{ref-resolution-BYCRg72z-DFhwf-XR.mjs.map → ref-resolution-Bi4lpxM8-BX-7sl0f.mjs.map} +1 -1
  131. package/dist/{schemas-KhXMzNA_-CzZ7GFX_.mjs → schemas-BMkqaqvM-CLaqlat4.mjs} +9 -3
  132. package/dist/{schemas-KhXMzNA_-CzZ7GFX_.mjs.map → schemas-BMkqaqvM-CLaqlat4.mjs.map} +1 -1
  133. package/dist/{schemas-CeGMYFYX-h3OcU__O.d.mts → schemas-Bm2e3Hk1-qLKF0B36.d.mts} +16 -4
  134. package/dist/{schemas-CeGMYFYX-h3OcU__O.d.mts.map → schemas-Bm2e3Hk1-qLKF0B36.d.mts.map} +1 -1
  135. package/dist/{telemetry-Dh6e0ams-BsjGN3tQ.mjs → telemetry-DFEbk6sD-BYEW2bCJ.mjs} +4 -4
  136. package/dist/{telemetry-Dh6e0ams-BsjGN3tQ.mjs.map → telemetry-DFEbk6sD-BYEW2bCJ.mjs.map} +1 -1
  137. package/dist/{terminal-ui-ypPE9cN6-ilMBkmwT.mjs → terminal-ui-DQNCDg2u-B3PFqjB8.mjs} +10 -3
  138. package/dist/terminal-ui-DQNCDg2u-B3PFqjB8.mjs.map +1 -0
  139. package/dist/{verify-DBsKxZrK-eDPxNiSS.mjs → verify-TphNCyMu-h8vrnbud.mjs} +3 -3
  140. package/dist/{verify-DBsKxZrK-eDPxNiSS.mjs.map → verify-TphNCyMu-h8vrnbud.mjs.map} +1 -1
  141. package/dist/vite-plugin-contract-emit.mjs +1 -1
  142. package/package.json +12 -12
  143. package/dist/cli-errors-C7vbvQuK-DLpSxz4U.d.mts.map +0 -1
  144. package/dist/cli-errors-kU09RUaz-CUkQ9XuM.mjs.map +0 -1
  145. package/dist/contract-emit-E6m8HE42-Bfiodzf_.mjs +0 -2
  146. package/dist/db-init-3CbSYxRI-BlTkWh8n.mjs.map +0 -1
  147. package/dist/db-sign-Cdw2RmoG-C-X5UheR.mjs.map +0 -1
  148. package/dist/db-update-BHOdo8PV-BVBNKrJc.mjs.map +0 -1
  149. package/dist/db-verify-C9P9oNCs-gieY7hV2.mjs.map +0 -1
  150. package/dist/inspect-live-schema-BEQun_1x-CZpCgg8A.mjs.map +0 -1
  151. package/dist/migrate-B-hpVTxi-DJzFYT2w.mjs.map +0 -1
  152. package/dist/migrate-show-CUymfnbM-BbpcO2FY.mjs.map +0 -1
  153. package/dist/migration-check-DHYPMUFe-Cni_ZUzB.mjs.map +0 -1
  154. package/dist/migration-check-zgqYe3SB-B6LI6wY7.mjs.map +0 -1
  155. package/dist/migration-graph-Dm9gU0oE-DxPD_SNA.mjs.map +0 -1
  156. package/dist/migration-log-Cft50PRu-DcnHdxT4.mjs.map +0 -1
  157. package/dist/migration-path-target-DhGt62Mi-dm4TU1hJ.mjs.map +0 -1
  158. package/dist/migration-show-DRARjIbv-1p6EE_Uw.mjs.map +0 -1
  159. package/dist/migration-status-Yh0eOQJN-YpcPDpNh.mjs.map +0 -1
  160. package/dist/terminal-ui-ypPE9cN6-ilMBkmwT.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-check-zgqYe3SB-B6LI6wY7.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-check-zgqYe3SB.mjs"],"sourcesContent":["import { i as formatErrorOutput, r as formatErrorJson, t as createTerminalUI } from \"./terminal-ui-ypPE9cN6.mjs\";\nimport { d as setCommandSeeAlso, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, x as formatStyledHeader } from \"./command-helpers-bGYd7Aab.mjs\";\nimport { r as buildReadAggregate } from \"./contract-space-aggregate-loader-DOzo1sk9.mjs\";\nimport { i as runMigrationCheck, n as enumerateCheckSpaces, r as loadAggregateIntegrityViolations, t as checkSingleTarget } from \"./migration-check-DHYPMUFe.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { join, relative } from \"pathe\";\n//#region src/utils/integrity-violation-to-check-failure.ts\nfunction migrationPathRelative(dirPath) {\n\treturn relative(process.cwd(), dirPath);\n}\nfunction migrationFileRelative(dirPath, fileName) {\n\treturn join(migrationPathRelative(dirPath), fileName);\n}\n/**\n* Map one {@link IntegrityViolation} onto a `migration check` failure row.\n* Sole catalogue mapping from integrity violations to `MIGRATION.CHECK_*` codes.\n*/\nfunction integrityViolationToCheckFailure(violation, migrationsDir) {\n\tconst spaceRelative = (spaceId) => migrationPathRelative(join(migrationsDir, spaceId));\n\tconst packageRelative = (spaceId, dirName) => migrationPathRelative(join(migrationsDir, spaceId, dirName));\n\tconst refRelative = (spaceId, refName) => migrationPathRelative(join(migrationsDir, spaceId, \"refs\", `${refName}.json`));\n\tswitch (violation.kind) {\n\t\tcase \"hashMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HASH_MISMATCH\",\n\t\t\twhere: migrationFileRelative(join(migrationsDir, violation.spaceId, violation.dirName), \"migration.json\"),\n\t\t\twhy: `Stored hash ${violation.stored} does not match recomputed hash ${violation.computed}`,\n\t\t\tfix: \"Re-emit the migration package or restore from version control.\"\n\t\t};\n\t\tcase \"providedInvariantsMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_PROVIDED_INVARIANTS_MISMATCH\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" providedInvariants in migration.json disagrees with ops.json.`,\n\t\t\tfix: \"Re-emit the migration package so migration.json and ops.json agree.\"\n\t\t};\n\t\tcase \"packageUnloadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_PACKAGE_UNLOADABLE\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" could not be loaded: ${violation.detail}`,\n\t\t\tfix: \"Re-emit the migration package or restore from version control.\"\n\t\t};\n\t\tcase \"sameSourceAndTarget\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_NOOP_SELF_EDGE\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" in space \"${violation.spaceId}\" has source equal to target (${violation.hash}) with no data invariant — a true no-op self-edge.`,\n\t\t\tfix: \"Add a data operation if this self-edge was meant to carry a data invariant, or delete the migration if it is a true no-op.\"\n\t\t};\n\t\tcase \"orphanSpaceDir\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_ORPHAN_SPACE_DIR\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Contract-space directory \"${violation.spaceId}\" exists on disk but no extension declares it.`,\n\t\t\tfix: \"Remove the orphan directory, or declare the extension in `extensions`.\"\n\t\t};\n\t\tcase \"declaredButUnmigrated\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_DECLARED_BUT_UNMIGRATED\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Extension \"${violation.spaceId}\" is declared in \\`extensions\\` but has no on-disk migrations directory.`,\n\t\t\tfix: \"Re-emit the extension contract-space artefacts with `prisma-next contract emit` and migration planning, or remove the extension from `extensions` if it is unused.\"\n\t\t};\n\t\tcase \"headRefMissing\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HEAD_REF_MISSING\",\n\t\t\twhere: refRelative(violation.spaceId, \"head\"),\n\t\t\twhy: `Head ref \\`refs/head.json\\` is missing for contract space \"${violation.spaceId}\".`,\n\t\t\tfix: \"Re-emit the contract-space migrations and head ref artefacts, or restore `refs/head.json` from version control.\"\n\t\t};\n\t\tcase \"headRefNotInGraph\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HEAD_REF_NOT_IN_GRAPH\",\n\t\t\twhere: refRelative(violation.spaceId, \"head\"),\n\t\t\twhy: `Head ref ${violation.hash} for contract space \"${violation.spaceId}\" is not present in its migration graph.`,\n\t\t\tfix: \"Re-emit the contract space migrations, or restore the missing migration package.\"\n\t\t};\n\t\tcase \"refUnreadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_REF_UNREADABLE\",\n\t\t\twhere: refRelative(violation.spaceId, violation.refName),\n\t\t\twhy: `Ref \"${violation.refName}\" for contract space \"${violation.spaceId}\" is unreadable: ${violation.detail}`,\n\t\t\tfix: \"Repair or remove the corrupt ref file.\"\n\t\t};\n\t\tcase \"targetMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_TARGET_MISMATCH\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Contract space \"${violation.spaceId}\" targets \"${violation.actual}\" but the project targets \"${violation.expected}\".`,\n\t\t\tfix: \"Update the extension to target the configured database, or change the project target.\"\n\t\t};\n\t\tcase \"disjointness\": return {\n\t\t\tspace: \"app\",\n\t\t\tcode: \"MIGRATION.CHECK_SPACE_DISJOINTNESS_VIOLATION\",\n\t\t\twhere: migrationPathRelative(migrationsDir),\n\t\t\twhy: `Storage element \"${violation.element}\" is claimed by multiple contract spaces: ${violation.claimedBy.join(\", \")}.`,\n\t\t\tfix: \"Update the contracts so each storage element is owned by exactly one contract space.\"\n\t\t};\n\t\tcase \"contractUnreadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_CONTRACT_UNREADABLE\",\n\t\t\twhere: migrationFileRelative(join(migrationsDir, violation.spaceId), \"contract.json\"),\n\t\t\twhy: `Contract for space \"${violation.spaceId}\" is unreadable: ${violation.detail}`,\n\t\t\tfix: \"Re-emit the extension contract artefacts, or fix the descriptor producing the invalid contract.\"\n\t\t};\n\t\tcase \"duplicateMigrationHash\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_DUPLICATE_MIGRATION_HASH\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Multiple migrations in space \"${violation.spaceId}\" share migrationHash \"${violation.migrationHash}\" (${violation.dirNames.join(\", \")}).`,\n\t\t\tfix: \"Re-emit one of the conflicting packages so each migrationHash is unique.\"\n\t\t};\n\t}\n}\n//#endregion\n//#region src/commands/migration-check.ts\nasync function executeMigrationCheckCommand(target, options, flags, ui) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"extensions\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return {\n\t\terror: configResult.failure,\n\t\texitCode: 2\n\t};\n\tconst config = configResult.value;\n\tconst { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.config, config, process.cwd());\n\tif (!flags.json && !flags.quiet) {\n\t\tconst details = [{\n\t\t\tlabel: \"config\",\n\t\t\tvalue: configPath\n\t\t}, {\n\t\t\tlabel: \"migrations\",\n\t\t\tvalue: appMigrationsRelative\n\t\t}];\n\t\tif (target) details.push({\n\t\t\tlabel: \"target\",\n\t\t\tvalue: target\n\t\t});\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migration check\",\n\t\t\tdescription: \"Verify artifact and graph integrity\",\n\t\t\tdetails,\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t}\n\tconst loadedAggregate = await buildReadAggregate(config, { migrationsDir });\n\tif (!loadedAggregate.ok) return {\n\t\terror: loadedAggregate.failure,\n\t\texitCode: 2\n\t};\n\tconst spaces = await enumerateCheckSpaces(loadedAggregate.value.aggregate, migrationsDir, process.cwd());\n\tif (target) return await checkSingleTarget(target, {\n\t\tspaces,\n\t\t...options.space !== void 0 ? { spaceFilter: options.space } : {},\n\t\tappMigrationsDir,\n\t\tappMigrationsRelative\n\t});\n\tconst checkResult = await runMigrationCheck({\n\t\tspaces,\n\t\t...options.space !== void 0 ? { spaceFilter: options.space } : {}\n\t});\n\tif (!checkResult.ok) return {\n\t\terror: checkResult.failure,\n\t\texitCode: 2\n\t};\n\tconst failures = [...checkResult.value.failures];\n\tconst allViolations = await loadAggregateIntegrityViolations(config, migrationsDir);\n\tconst scopedViolations = options.space === void 0 ? allViolations : allViolations.filter((v) => v.kind !== \"disjointness\" && v.spaceId === options.space);\n\tfor (const violation of scopedViolations) failures.push(integrityViolationToCheckFailure(violation, migrationsDir));\n\tif (failures.length === 0) return {\n\t\tresult: {\n\t\t\tok: true,\n\t\t\tfailures: [],\n\t\t\tsummary: \"All checks passed\"\n\t\t},\n\t\texitCode: 0\n\t};\n\treturn {\n\t\tresult: {\n\t\t\tok: false,\n\t\t\tfailures,\n\t\t\tsummary: `${failures.length} integrity failure(s)`\n\t\t},\n\t\texitCode: 4\n\t};\n}\nfunction createMigrationCheckCommand() {\n\tconst command = new Command(\"check\");\n\tsetCommandDescriptions(command, \"Verify artifact and graph integrity\", \"Validates that on-disk migration packages are internally consistent\\n(hashes match, manifests are complete) and that the graph is well-formed\\n(edges connect, refs point at valid nodes). The whole-graph check spans\\nevery contract space by default; pass --space <id> to narrow to one. A\\nmigration reference checks a single package, resolved across all contract\\nspaces (narrow with --space; an ambiguous reference is a precondition failure).\\nOffline — does not consult the database.\\nExit codes: 0 = all checks passed, 2 = precondition failed\\n(unresolved target or unknown --space), 4 = integrity failure(s) found.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migration check\",\n\t\t\"prisma-next migration check --space app\",\n\t\t\"prisma-next migration check 20260101-add-users\",\n\t\t\"prisma-next migration check 20260101-add-users --space app\",\n\t\t\"prisma-next migration check --json\"\n\t]);\n\tsetCommandSeeAlso(command, [\n\t\t{\n\t\t\tverb: \"migration status\",\n\t\t\toneLiner: \"Show migration path and pending status\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration list\",\n\t\t\toneLiner: \"List on-disk migrations\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration graph\",\n\t\t\toneLiner: \"Show the migration graph topology\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration show\",\n\t\t\toneLiner: \"Display migration package contents\"\n\t\t}\n\t]);\n\tcommand.exitOverride();\n\taddGlobalOptions(command).argument(\"[target]\", \"Migration reference: directory name, hash/prefix, ref, or path\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--space <id>\", \"Narrow output to a single contract space\").action(async (target, options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tlet outcome;\n\t\ttry {\n\t\t\toutcome = await executeMigrationCheckCommand(target, options, flags, ui);\n\t\t} catch (error) {\n\t\t\toutcome = {\n\t\t\t\tresult: {\n\t\t\t\t\tok: false,\n\t\t\t\t\tfailures: [],\n\t\t\t\t\tsummary: error instanceof Error ? error.message : String(error)\n\t\t\t\t},\n\t\t\t\texitCode: 2\n\t\t\t};\n\t\t}\n\t\tif (outcome.error) {\n\t\t\tconst envelope = outcome.error.toEnvelope();\n\t\t\tif (flags.json) ui.output(formatErrorJson(envelope));\n\t\t\telse if (!flags.quiet) ui.error(formatErrorOutput(envelope, flags));\n\t\t\tprocess.exit(outcome.exitCode);\n\t\t}\n\t\tconst result = outcome.result ?? {\n\t\t\tok: false,\n\t\t\tfailures: [],\n\t\t\tsummary: \"No check result produced\"\n\t\t};\n\t\tif (flags.json) ui.output(JSON.stringify(result, null, 2));\n\t\telse if (!flags.quiet) if (result.ok) {\n\t\t\tconst spaceSuffix = outcome.resolvedSpaceId !== void 0 ? ` (space: ${outcome.resolvedSpaceId})` : \"\";\n\t\t\tui.log(`✔ ${result.summary}${spaceSuffix}`);\n\t\t} else {\n\t\t\tfor (const f of result.failures) {\n\t\t\t\tui.log(`✗ [${f.code}] ${f.where}: ${f.why}`);\n\t\t\t\tui.log(` fix: ${f.fix}`);\n\t\t\t}\n\t\t\tui.log(`\\n${result.summary}`);\n\t\t}\n\t\tprocess.exit(outcome.exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createMigrationCheckCommand as t };\n\n//# sourceMappingURL=migration-check-zgqYe3SB.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,sBAAsB,SAAS;CACvC,OAAO,SAAS,QAAQ,IAAI,GAAG,OAAO;AACvC;AACA,SAAS,sBAAsB,SAAS,UAAU;CACjD,OAAO,KAAK,sBAAsB,OAAO,GAAG,QAAQ;AACrD;;;;;AAKA,SAAS,iCAAiC,WAAW,eAAe;CACnE,MAAM,iBAAiB,YAAY,sBAAsB,KAAK,eAAe,OAAO,CAAC;CACrF,MAAM,mBAAmB,SAAS,YAAY,sBAAsB,KAAK,eAAe,SAAS,OAAO,CAAC;CACzG,MAAM,eAAe,SAAS,YAAY,sBAAsB,KAAK,eAAe,SAAS,QAAQ,GAAG,QAAQ,MAAM,CAAC;CACvH,QAAQ,UAAU,MAAlB;EACC,KAAK,gBAAgB,OAAO;GAC3B,OAAO,UAAU;GACjB,MAAM;GACN,OAAO,sBAAsB,KAAK,eAAe,UAAU,SAAS,UAAU,OAAO,GAAG,gBAAgB;GACxG,KAAK,eAAe,UAAU,OAAO,kCAAkC,UAAU;GACjF,KAAK;EACN;EACA,KAAK,8BAA8B,OAAO;GACzC,OAAO,UAAU;GACjB,MAAM;GACN,OAAO,gBAAgB,UAAU,SAAS,UAAU,OAAO;GAC3D,KAAK,cAAc,UAAU,QAAQ;GACrC,KAAK;EACN;EACA,KAAK,qBAAqB,OAAO;GAChC,OAAO,UAAU;GACjB,MAAM;GACN,OAAO,gBAAgB,UAAU,SAAS,UAAU,OAAO;GAC3D,KAAK,cAAc,UAAU,QAAQ,yBAAyB,UAAU;GACxE,KAAK;EACN;EACA,KAAK,uBAAuB,OAAO;GAClC,OAAO,UAAU;GACjB,MAAM;GACN,OAAO,gBAAgB,UAAU,SAAS,UAAU,OAAO;GAC3D,KAAK,cAAc,UAAU,QAAQ,cAAc,UAAU,QAAQ,gCAAgC,UAAU,KAAK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AC5C,MAAM,KAAK,iBAAiB,KAAK;EACjC,IAAI;EACJ,IAAI;GACH,UAAU,MAAM,6BAA6B,QAAQ,SAAS,OAAO,EAAE;EACxE,SAAS,OAAO;GACf,UAAU;IACT,QAAQ;KACP,IAAI;KACJ,UAAU,CAAC;KACX,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC/D;IACA,UAAU;GACX;EACD;EACA,IAAI,QAAQ,OAAO;GAClB,MAAM,WAAW,QAAQ,MAAM,WAAW;GAC1C,IAAI,MAAM,MAAM,GAAG,OAAO,gBAAgB,QAAQ,CAAC;QAC9C,IAAI,CAAC,MAAM,OAAO,GAAG,MAAM,kBAAkB,UAAU,KAAK,CAAC;GAClE,QAAQ,KAAK,QAAQ,QAAQ;EAC9B;EACA,MAAM,SAAS,QAAQ,UAAU;GAChC,IAAI;GACJ,UAAU,CAAC;GACX,SAAS;EACV;EACA,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;OACpD,IAAI,CAAC,MAAM,OAAO,IAAI,OAAO,IAAI;GACrC,MAAM,cAAc,QAAQ,oBAAoB,KAAK,IAAI,aAAa,QAAQ,gBAAgB,KAAK;GACnG,GAAG,IAAI,KAAK,OAAO,UAAU,aAAa;EAC3C,OAAO;GACN,KAAK,MAAM,KAAK,OAAO,UAAU;IAChC,GAAG,IAAI,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,IAAI,EAAE,KAAK;IAC3C,GAAG,IAAI,UAAU,EAAE,KAAK;GACzB;GACA,GAAG,IAAI,KAAK,OAAO,SAAS;EAC7B;EACA,QAAQ,KAAK,QAAQ,QAAQ;CAC9B,CAAC;CACD,OAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-graph-Dm9gU0oE-DxPD_SNA.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-graph-Dm9gU0oE.mjs"],"sourcesContent":["import { t as createTerminalUI } from \"./terminal-ui-ypPE9cN6.mjs\";\nimport { _ as handleResult, d as setCommandSeeAlso, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, x as formatStyledHeader } from \"./command-helpers-bGYd7Aab.mjs\";\nimport { r as buildReadAggregate } from \"./contract-space-aggregate-loader-DOzo1sk9.mjs\";\nimport { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList, t as listRefsByContractHash } from \"./migration-list-Bkase_ZM.mjs\";\nimport { a as renderMigrationGraphLegend, f as indentMigrationGraphTreeBlock, l as computeGlobalMaxDirNameWidth, p as renderMigrationGraphSpaceTree, u as computeGlobalMaxEdgeTreePrefixWidth } from \"./migration-graph-command-render-BKrg6BPv.mjs\";\nimport { t as buildMigrationSpaceGraphEntries } from \"./migration-graph-CChCjts3.mjs\";\nimport { n as validateLegendOptions, t as shouldShowLegend } from \"./legend-BBtAETiW.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/commands/migration-graph.ts\nfunction computeGraphSummary(spaces) {\n\tconst contractCount = spaces.reduce((count, space) => count + space.contracts.length, 0);\n\tconst migrationCount = spaces.reduce((count, space) => count + space.migrations.length, 0);\n\treturn `${spaces.length} space(s), ${contractCount} contract(s), ${migrationCount} migration(s)`;\n}\nfunction formatMigrationGraphHumanOutput(result) {\n\tconst sections = [];\n\tfor (const section of result.treeSections) {\n\t\tif (section.showHeading) sections.push(`${section.space}:`);\n\t\tif (section.tree.length > 0) sections.push(section.tree);\n\t\telse sections.push(\"(no migrations)\");\n\t\tsections.push(\"\");\n\t}\n\tsections.push(result.summary);\n\treturn sections.join(\"\\n\").trimEnd();\n}\nasync function executeMigrationGraphCommand(options, flags, ui) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"extensions\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst { configPath, migrationsRelative, migrationsDir } = resolveMigrationPaths(options.config, config, process.cwd());\n\tif (!flags.json && !flags.quiet) {\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migration graph\",\n\t\t\tdescription: \"Show the migration graph topology\",\n\t\t\tdetails: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: configPath\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: migrationsRelative\n\t\t\t\t},\n\t\t\t\t...options.space !== void 0 ? [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: options.space\n\t\t\t\t}] : []\n\t\t\t],\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t\tif (shouldShowLegend(options, flags)) {\n\t\t\tui.stderr(renderMigrationGraphLegend({\n\t\t\t\tcolorize: flags.color !== false,\n\t\t\t\tglyphMode: ui.resolveGlyphMode(options.ascii === true)\n\t\t\t}));\n\t\t\tui.stderr(\"\");\n\t\t}\n\t}\n\tconst loaded = await buildReadAggregate(config, { migrationsDir });\n\tif (!loaded.ok) return loaded;\n\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\tconst appGraph = aggregate.app.graph();\n\tconst listResult = runMigrationList({\n\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t...ifDefined(\"spaceFilter\", options.space)\n\t});\n\tif (!listResult.ok) return listResult;\n\tconst scopedSpaces = listResult.value.spaces;\n\tconst showSpaceHeadings = scopedSpaces.length > 1;\n\tconst glyphMode = ui.resolveGlyphMode(options.ascii === true);\n\tconst colorize = flags.color !== false;\n\tconst globalLayoutInputs = showSpaceHeadings ? scopedSpaces.filter((spaceEntry) => spaceEntry.migrations.length > 0).map((spaceEntry) => ({\n\t\tgraph: aggregate.space(spaceEntry.space).graph(),\n\t\tliveContractHash\n\t})) : [];\n\tconst globalMaxEdgeTreePrefixWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxEdgeTreePrefixWidth(globalLayoutInputs) : void 0;\n\tconst globalMaxDirNameWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxDirNameWidth(globalLayoutInputs) : void 0;\n\tconst treeSections = [];\n\tfor (const spaceEntry of scopedSpaces) {\n\t\tconst space = aggregate.space(spaceEntry.space);\n\t\tif (space === void 0) continue;\n\t\tconst graph = space.graph();\n\t\tconst isAppSpace = spaceEntry.space === aggregate.app.spaceId;\n\t\tconst refsByHash = listRefsByContractHash(space);\n\t\tconst tree = spaceEntry.migrations.length === 0 ? \"\" : renderMigrationGraphSpaceTree({\n\t\t\tgraph,\n\t\t\tmigrations: spaceEntry.migrations,\n\t\t\tliveContractHash,\n\t\t\tglyphMode,\n\t\t\tcolorize,\n\t\t\tisAppSpace,\n\t\t\trefsByHash,\n\t\t\t...globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth } : {},\n\t\t\t...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}\n\t\t});\n\t\tconst displayTree = showSpaceHeadings && tree.length > 0 ? indentMigrationGraphTreeBlock(tree, \" \") : tree;\n\t\ttreeSections.push({\n\t\t\tspace: spaceEntry.space,\n\t\t\ttree: displayTree,\n\t\t\tshowHeading: showSpaceHeadings\n\t\t});\n\t}\n\tconst spaces = [...buildMigrationSpaceGraphEntries({\n\t\taggregate,\n\t\tscopedSpaces\n\t})];\n\treturn ok({\n\t\tok: true,\n\t\tgraph: appGraph,\n\t\tspaces,\n\t\ttreeSections,\n\t\tsummary: computeGraphSummary(spaces)\n\t});\n}\nfunction createMigrationGraphCommand() {\n\tconst command = new Command(\"graph\");\n\tsetCommandDescriptions(command, \"Show the migration graph topology\", \"Renders the migration graph topology.\\nOffline — does not consult the database.\\n--ascii swaps box-drawing for pipe-friendly ASCII glyphs.\\nUse --json for machine-readable output, or --dot for Graphviz DOT\\nformat.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migration graph\",\n\t\t\"prisma-next migration graph --json\",\n\t\t\"prisma-next migration graph --dot\",\n\t\t\"prisma-next migration graph --ascii\",\n\t\t\"prisma-next migration graph --legend\",\n\t\t\"prisma-next migration graph --space app\"\n\t]);\n\tsetCommandSeeAlso(command, [\n\t\t{\n\t\t\tverb: \"migration status\",\n\t\t\toneLiner: \"Show migration path and pending status\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration log\",\n\t\t\toneLiner: \"Show executed migration history\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration list\",\n\t\t\toneLiner: \"List on-disk migrations\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration show\",\n\t\t\toneLiner: \"Display migration package contents\"\n\t\t}\n\t]);\n\taddGlobalOptions(command).option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--space <id>\", \"Narrow output to a single contract space\").option(\"--dot\", \"Output in Graphviz DOT format\").option(\"--ascii\", \"Use ASCII glyphs (pipe-friendly)\").option(\"--legend\", \"Print a key for the tree glyphs and lane colors\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst legendValidation = validateLegendOptions(options, flags);\n\t\tif (!legendValidation.ok) process.exit(handleResult(legendValidation, flags, ui));\n\t\tconst exitCode = handleResult(await executeMigrationGraphCommand(options, flags, ui), flags, ui, (graphResult) => {\n\t\t\tif (options.dot) {\n\t\t\t\tconst lines = [\"digraph migrations {\"];\n\t\t\t\tfor (const edge of graphResult.graph.migrationByHash.values()) {\n\t\t\t\t\tconst from = edge.from.slice(0, 12);\n\t\t\t\t\tconst to = edge.to.slice(0, 12);\n\t\t\t\t\tlines.push(` \"${from}\" -> \"${to}\" [label=\"${edge.dirName}\"];`);\n\t\t\t\t}\n\t\t\t\tlines.push(\"}\");\n\t\t\t\tui.output(lines.join(\"\\n\"));\n\t\t\t} else if (flags.json) {\n\t\t\t\tconst jsonResult = {\n\t\t\t\t\tok: true,\n\t\t\t\t\tspaces: [...graphResult.spaces],\n\t\t\t\t\tsummary: graphResult.summary\n\t\t\t\t};\n\t\t\t\tui.output(JSON.stringify(jsonResult, null, 2));\n\t\t\t} else if (!flags.quiet) ui.output(formatMigrationGraphHumanOutput(graphResult));\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { executeMigrationGraphCommand as n, formatMigrationGraphHumanOutput as r, createMigrationGraphCommand as t };\n\n//# sourceMappingURL=migration-graph-Dm9gU0oE.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oBAAoB,QAAQ;CACpC,MAAM,gBAAgB,OAAO,QAAQ,OAAO,UAAU,QAAQ,MAAM,UAAU,QAAQ,CAAC;CACvF,MAAM,iBAAiB,OAAO,QAAQ,OAAO,UAAU,QAAQ,MAAM,WAAW,QAAQ,CAAC;CACzF,OAAO,GAAG,OAAO,OAAO,aAAa,cAAc,gBAAgB,eAAe;AACnF;AACA,SAAS,gCAAgC,QAAQ;CAChD,MAAM,WAAW,CAAC;CAClB,KAAK,MAAM,WAAW,OAAO,cAAc;EAC1C,IAAI,QAAQ,aAAa,SAAS,KAAK,GAAG,QAAQ,MAAM,EAAE;EAC1D,IAAI,QAAQ,KAAK,SAAS,GAAG,SAAS,KAAK,QAAQ,IAAI;OAClD,SAAS,KAAK,iBAAiB;EACpC,SAAS,KAAK,EAAE;CACjB;CACA,SAAS,KAAK,OAAO,OAAO;CAC5B,OAAO,SAAS,KAAK,IAAI,CAAC,CAAC,QAAQ;AACpC;AACA,eAAe,6BAA6B,SAAS,OAAO,IAAI;CAC/D,MAAM,eAAe,MAAM,sBAAsB,QAAQ,QAAQ;EAChE;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CACD,IAAI,CAAC,aAAa,IAAI,OAAO;CAC7B,MAAM,SAAS,aAAa;CAC5B,MAAM,EAAE,YAAY,oBAAoB,kBAAk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Cft50PRu.mjs"],"sourcesContent":["import { A as errorUnexpected, M as requireLiveDatabase } from \"./cli-errors-kU09RUaz.mjs\";\nimport { t as createTerminalUI } from \"./terminal-ui-ypPE9cN6.mjs\";\nimport { _ as handleResult, d as setCommandSeeAlso, f as targetSupportsMigrations, g as parseGlobalFlagsOrExit, i as maskConnectionUrl, l as setCommandDescriptions, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, x as formatStyledHeader } from \"./command-helpers-bGYd7Aab.mjs\";\nimport { t as createControlClient } from \"./client-milNsAnF.mjs\";\nimport { t as mapCaughtMigrationError } from \"./caught-errors-nYuTn3NK.mjs\";\nimport { _ as migrationListEmptySource, g as abbreviateContractHash, o as createAnsiMigrationListStyler, s as IDENTITY_MIGRATION_LIST_STYLER, v as migrationListForwardArrow } from \"./migration-graph-command-render-BKrg6BPv.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport stringWidth from \"string-width\";\n//#region src/utils/formatters/migration-log-table.ts\nconst HEADING_APPLIED_AT = \"Applied at\";\nconst HEADING_SPACE = \"Space\";\nconst HEADING_MIGRATION = \"Migration\";\nconst HEADING_CHANGE = \"Change\";\nconst HEADING_OPS = \"Ops\";\nconst COLUMN_SEPARATOR = \" \";\nconst DIVIDER_CHAR = \"─\";\nconst ASCII_DIVIDER_CHAR = \"-\";\nfunction sortLedgerEntries(entries) {\n\treturn [...entries].sort((left, right) => {\n\t\tconst timeDiff = left.appliedAt.getTime() - right.appliedAt.getTime();\n\t\tif (timeDiff !== 0) return timeDiff;\n\t\tconst spaceDiff = left.space.localeCompare(right.space);\n\t\tif (spaceDiff !== 0) return spaceDiff;\n\t\treturn left.migrationName.localeCompare(right.migrationName);\n\t});\n}\nfunction pad2(value) {\n\treturn String(value).padStart(2, \"0\");\n}\nfunction formatLedgerAppliedAt(date, mode) {\n\tif (mode === \"iso\") return date.toISOString();\n\tif (mode === \"utc\") return `${date.getUTCFullYear()}-${pad2(date.getUTCMonth() + 1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}:${pad2(date.getUTCSeconds())}Z`;\n\tconst offsetMinutes = -date.getTimezoneOffset();\n\tconst sign = offsetMinutes >= 0 ? \"+\" : \"-\";\n\tconst absoluteOffset = Math.abs(offsetMinutes);\n\tconst offsetHours = pad2(Math.floor(absoluteOffset / 60));\n\tconst offsetMins = pad2(absoluteOffset % 60);\n\treturn `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())} ${pad2(date.getHours())}:${pad2(date.getMinutes())}:${pad2(date.getSeconds())} ${sign}${offsetHours}:${offsetMins}`;\n}\nfunction formatHashEndpoint(hash, glyphMode = \"unicode\") {\n\tif (hash === null) return migrationListEmptySource(glyphMode);\n\treturn abbreviateContractHash(hash);\n}\nfunction formatHashTransition(from, to, glyphMode = \"unicode\") {\n\treturn `${formatHashEndpoint(from, glyphMode)} ${migrationListForwardArrow(glyphMode)} ${abbreviateContractHash(to)}`;\n}\nfunction styleHashTransition(from, to, styler, glyphMode = \"unicode\") {\n\treturn `${from === null ? styler.glyph(migrationListEmptySource(glyphMode)) : styler.sourceHash(abbreviateContractHash(from))} ${styler.glyph(migrationListForwardArrow(glyphMode))} ${styler.destHash(abbreviateContractHash(to))}`;\n}\nfunction padVisible(text, targetWidth) {\n\tconst padding = Math.max(0, targetWidth - stringWidth(text));\n\treturn text + \" \".repeat(padding);\n}\nfunction columnWidth(values) {\n\treturn values.reduce((max, value) => Math.max(max, stringWidth(value)), 0);\n}\nfunction padDividerCell(valueWidth, dividerChar) {\n\treturn dividerChar.repeat(valueWidth + 2);\n}\nfunction padTextCell(value, valueWidth) {\n\treturn ` ${padVisible(value, valueWidth)} `;\n}\nfunction padOpsCell(value, valueWidth) {\n\tconst padding = Math.max(0, valueWidth - stringWidth(value));\n\treturn ` ${\" \".repeat(padding)}${value} `;\n}\nfunction renderMigrationLogTable(entries, options = {}) {\n\tconst sorted = sortLedgerEntries(entries);\n\tif (sorted.length === 0) return \"\";\n\tconst styler = options.styler ?? IDENTITY_MIGRATION_LIST_STYLER;\n\tconst glyphMode = options.glyphMode ?? \"unicode\";\n\tconst dividerChar = glyphMode === \"ascii\" ? ASCII_DIVIDER_CHAR : DIVIDER_CHAR;\n\tconst showSpace = new Set(sorted.map((entry) => entry.space)).size > 1;\n\tconst timestampMode = options.utc ? \"utc\" : \"local\";\n\tconst rows = sorted.map((entry) => ({\n\t\tappliedAt: formatLedgerAppliedAt(entry.appliedAt, timestampMode),\n\t\tspace: entry.space,\n\t\tmigrationName: entry.migrationName,\n\t\ttransition: formatHashTransition(entry.from, entry.to, glyphMode),\n\t\tops: `${entry.operationCount} ops`,\n\t\tfrom: entry.from,\n\t\tto: entry.to\n\t}));\n\tconst appliedAtWidth = columnWidth([HEADING_APPLIED_AT, ...rows.map((row) => row.appliedAt)]);\n\tconst spaceWidth = showSpace ? columnWidth([HEADING_SPACE, ...rows.map((row) => row.space)]) : 0;\n\tconst nameWidth = columnWidth([HEADING_MIGRATION, ...rows.map((row) => row.migrationName)]);\n\tconst transitionWidth = columnWidth([HEADING_CHANGE, ...rows.map((row) => row.transition)]);\n\tconst opsWidth = columnWidth([HEADING_OPS, ...rows.map((row) => row.ops)]);\n\tconst headingParts = [padTextCell(HEADING_APPLIED_AT, appliedAtWidth)];\n\tif (showSpace) headingParts.push(padTextCell(HEADING_SPACE, spaceWidth));\n\theadingParts.push(padTextCell(HEADING_MIGRATION, nameWidth), padTextCell(HEADING_CHANGE, transitionWidth), padOpsCell(HEADING_OPS, opsWidth));\n\tconst heading = headingParts.join(COLUMN_SEPARATOR);\n\tconst dividerParts = [padDividerCell(appliedAtWidth, dividerChar)];\n\tif (showSpace) dividerParts.push(padDividerCell(spaceWidth, dividerChar));\n\tdividerParts.push(padDividerCell(nameWidth, dividerChar), padDividerCell(transitionWidth, dividerChar), padDividerCell(opsWidth, dividerChar));\n\treturn [\n\t\theading,\n\t\tdividerParts.map((cell) => styler.summary(cell)).join(COLUMN_SEPARATOR),\n\t\t...rows.map((row) => {\n\t\t\tconst parts = [padTextCell(row.appliedAt, appliedAtWidth)];\n\t\t\tif (showSpace) parts.push(padTextCell(row.space, spaceWidth));\n\t\t\tparts.push(padTextCell(styler.dirName(row.migrationName), nameWidth), padTextCell(styleHashTransition(row.from, row.to, styler, glyphMode), transitionWidth), padOpsCell(row.ops, opsWidth));\n\t\t\treturn parts.join(COLUMN_SEPARATOR);\n\t\t})\n\t].join(\"\\n\");\n}\nfunction serializeLedgerEntriesForJson(entries) {\n\treturn sortLedgerEntries(entries).map((entry) => ({\n\t\tspace: entry.space,\n\t\tname: entry.migrationName,\n\t\thash: entry.migrationHash,\n\t\tfromContract: entry.from,\n\t\ttoContract: entry.to,\n\t\tappliedAt: formatLedgerAppliedAt(entry.appliedAt, \"iso\"),\n\t\toperationCount: entry.operationCount\n\t}));\n}\nconst MIGRATION_LOG_EMPTY_MESSAGE = \"No migrations have been applied to this database.\";\n//#endregion\n//#region src/commands/migration-log.ts\nasync function executeMigrationLogCommand(options, flags, ui) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"driver\",\n\t\t\"extensions\",\n\t\t\"db\",\n\t\t\"migrations\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst { configPath } = resolveMigrationPaths(options.config, config, process.cwd());\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tconst missingDb = requireLiveDatabase({\n\t\tdbConnection,\n\t\thasDriver: !!config.driver,\n\t\twhy: `migration log needs a database connection and driver to read the ledger (set db.connection in ${configPath}, or pass --db <url>)`,\n\t\tcommandName: \"migration log\"\n\t});\n\tif (missingDb) return notOk(missingDb);\n\tif (!targetSupportsMigrations(config.target)) return notOk(errorUnexpected(\"Target does not support migrations\"));\n\tif (!flags.json && !flags.quiet) {\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migration log\",\n\t\t\tdescription: \"Show executed migration history from the database ledger\",\n\t\t\tdetails: [{\n\t\t\t\tlabel: \"config\",\n\t\t\t\tvalue: configPath\n\t\t\t}, ...typeof dbConnection === \"string\" ? [{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: maskConnectionUrl(dbConnection)\n\t\t\t}] : []],\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t}\n\tconst client = createControlClient({\n\t\tfamily: config.family,\n\t\ttarget: config.target,\n\t\tadapter: config.adapter,\n\t\t...ifDefined(\"driver\", config.driver),\n\t\textensions: config.extensions ?? []\n\t});\n\ttry {\n\t\tawait client.connect(dbConnection);\n\t\treturn ok(await client.readLedger());\n\t} catch (error) {\n\t\tconst mapped = mapCaughtMigrationError(error);\n\t\tif (mapped) return notOk(mapped);\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read migration log: ${error instanceof Error ? error.message : String(error)}` }));\n\t} finally {\n\t\tawait client.close();\n\t}\n}\nfunction createMigrationLogCommand() {\n\tconst command = new Command(\"log\");\n\tsetCommandDescriptions(command, \"Show executed migration history\", \"Reads the database ledger and displays every applied migration edge\\nin chronological order, including rollbacks and re-applies, merged\\nacross all contract spaces. Requires a database connection.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migration log --db $DATABASE_URL\",\n\t\t\"prisma-next migration log --utc --db $DATABASE_URL\",\n\t\t\"prisma-next migration log --json --db $DATABASE_URL\"\n\t]);\n\tsetCommandSeeAlso(command, [\n\t\t{\n\t\t\tverb: \"migration status\",\n\t\t\toneLiner: \"Show migration path and pending status\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration list\",\n\t\t\toneLiner: \"List on-disk migrations\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration graph\",\n\t\t\toneLiner: \"Show the migration graph topology\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration show\",\n\t\t\toneLiner: \"Display migration package contents\"\n\t\t}\n\t]);\n\taddGlobalOptions(command).option(\"--db <url>\", \"Database connection string\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--utc\", \"Render human timestamps in UTC instead of local time\").option(\"--ascii\", \"Use ASCII glyphs (pipe-friendly)\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst exitCode = handleResult(await executeMigrationLogCommand(options, flags, ui), flags, ui, (entries) => {\n\t\t\tif (flags.json) {\n\t\t\t\tconst records = serializeLedgerEntriesForJson(entries);\n\t\t\t\tconst result = {\n\t\t\t\t\tok: true,\n\t\t\t\t\trecords,\n\t\t\t\t\tsummary: `${records.length} migration(s) applied`\n\t\t\t\t};\n\t\t\t\tui.output(JSON.stringify(result, null, 2));\n\t\t\t} else if (!flags.quiet) if (entries.length === 0) ui.output(MIGRATION_LOG_EMPTY_MESSAGE);\n\t\t\telse {\n\t\t\t\tconst styler = createAnsiMigrationListStyler({ useColor: ui.useColor });\n\t\t\t\tui.output(renderMigrationLogTable(entries, {\n\t\t\t\t\tutc: options.utc === true,\n\t\t\t\t\tstyler,\n\t\t\t\t\tglyphMode: ui.resolveGlyphMode(options.ascii === true)\n\t\t\t\t}));\n\t\t\t}\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { executeMigrationLogCommand as n, createMigrationLogCommand as t };\n\n//# sourceMappingURL=migration-log-Cft50PRu.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,qBAAqB;AAC3B,MAAM,gBAAgB;AACtB,MAAM,oBAAoB;AAC1B,MAAM,iBAAiB;AACvB,MAAM,cAAc;AACpB,MAAM,mBAAmB;AACzB,MAAM,eAAe;AACrB,MAAM,qBAAqB;AAC3B,SAAS,kBAAkB,SAAS;CACnC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,MAAM,MAAM,UAAU;EACzC,MAAM,WAAW,K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kC,CAAC,CAAC,OAAO,OAAO,YAAY;EAC/R,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,MAAM,KAAK,iBAAiB,KAAK;EACjC,MAAM,WAAW,aAAa,MAAM,2BAA2B,SAAS,OAAO,EAAE,GAAG,OAAO,KAAK,YAAY;GAC3G,IAAI,MAAM,MAAM;IACf,MAAM,UAAU,8BAA8B,OAAO;IACrD,MAAM,SAAS;KACd,IAAI;KACJ;KACA,SAAS,GAAG,QAAQ,OAAO;IAC5B;IACA,GAAG,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;GAC1C,OAAO,IAAI,CAAC,MAAM,OAAO,IAAI,QAAQ,WAAW,GAAG,GAAG,OAAO,2BAA2B;QACnF;IACJ,MAAM,SAAS,8BAA8B,EAAE,UAAU,GAAG,SAAS,CAAC;IACtE,GAAG,OAAO,wBAAwB,SAAS;KAC1C,KAAK,QAAQ,QAAQ;KACrB;KACA,WAAW,GAAG,iBAAiB,QAAQ,UAAU,IAAI;IACtD,CAAC,CAAC;GACH;EACD,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-path-target-DhGt62Mi-dm4TU1hJ.mjs","names":["errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-path-target-DhGt62Mi.mjs"],"sourcesContent":["import { T as errorRuntime } from \"./cli-errors-kU09RUaz.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isAbsolute, relative, resolve } from \"pathe\";\n//#region src/utils/migration-path-target.ts\nfunction looksLikePath(target) {\n\treturn target.includes(\"/\") || target.includes(\"\\\\\");\n}\nfunction resolveAppTargetPath(target, appMigrationsDir, appMigrationsRelative) {\n\tconst targetPath = resolve(target);\n\tconst relativeToApp = relative(appMigrationsDir, targetPath);\n\tif (relativeToApp === \"\" || relativeToApp === \".\" || relativeToApp.startsWith(\"..\") || isAbsolute(relativeToApp)) return notOk(errorRuntime(\"MIGRATION.TARGET_NOT_APP_SPACE\", \"Target must point to an app-space migration\", {\n\t\twhy: `Expected a path under ${appMigrationsRelative}, got ${target}`,\n\t\tfix: \"Pass an app-space migration directory or use a hash prefix.\"\n\t}));\n\treturn ok(targetPath);\n}\n/**\n* Resolve a filesystem-path target to the migration dir that contains it,\n* searching each in-scope space's `migrationsDir`. A path is explicit, so\n* it can belong to at most one space — returns the first match, or `null`\n* when the path falls outside every space dir.\n*/\nfunction resolveTargetPathAcrossSpaces(target, spaces) {\n\tconst targetPath = resolve(target);\n\tfor (const space of spaces) {\n\t\tconst rel = relative(space.migrationsDir, targetPath);\n\t\tif (!(rel === \"\" || rel === \".\" || rel.startsWith(\"..\") || isAbsolute(rel))) return targetPath;\n\t}\n\treturn null;\n}\nfunction findPackageByDirPath(packages, resolvedDirPath) {\n\tconst normalized = resolve(resolvedDirPath);\n\treturn packages.find((p) => resolve(p.dirPath) === normalized);\n}\n//#endregion\nexport { resolveTargetPathAcrossSpaces as i, looksLikePath as n, resolveAppTargetPath as r, findPackageByDirPath as t };\n\n//# sourceMappingURL=migration-path-target-DhGt62Mi.mjs.map"],"mappings":";;;;AAIA,SAAS,cAAc,QAAQ;CAC9B,OAAO,OAAO,SAAS,GAAG,KAAK,OAAO,SAAS,IAAI;AACpD;AACA,SAAS,qBAAqB,QAAQ,kBAAkB,uBAAuB;CAC9E,MAAM,aAAa,QAAQ,MAAM;CACjC,MAAM,gBAAgB,SAAS,kBAAkB,UAAU;CAC3D,IAAI,kBAAkB,MAAM,kBAAkB,OAAO,cAAc,WAAW,IAAI,KAAK,WAAW,aAAa,GAAG,OAAO,MAAMA,eAAa,kCAAkC,+CAA+C;EAC5N,KAAK,yBAAyB,sBAAsB,QAAQ;EAC5D,KAAK;CACN,CAAC,CAAC;CACF,OAAO,GAAG,UAAU;AACrB;;;;;;;AAOA,SAAS,8BAA8B,QAAQ,QAAQ;CACtD,MAAM,aAAa,QAAQ,MAAM;CACjC,KAAK,MAAM,SAAS,QAAQ;EAC3B,MAAM,MAAM,SAAS,MAAM,eAAe,UAAU;EACpD,IAAI,EAAE,QAAQ,MAAM,QAAQ,OAAO,IAAI,WAAW,IAAI,KAAK,WAAW,GAAG,IAAI,OAAO;CACrF;CACA,OAAO;AACR;AACA,SAAS,qBAAqB,UAAU,iBAAiB;CACxD,MAAM,aAAa,QAAQ,eAAe;CAC1C,OAAO,SAAS,MAAM,MAAM,QAAQ,EAAE,OAAO,MAAM,UAAU;AAC9D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-show-DRARjIbv-1p6EE_Uw.mjs","names":["errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-show-DRARjIbv.mjs"],"sourcesContent":["import { A as errorUnexpected, T as errorRuntime, o as errorContractValidationFailed, u as errorFileNotFound } from \"./cli-errors-kU09RUaz.mjs\";\nimport { l as formatMigrationShowOutput, t as createTerminalUI } from \"./terminal-ui-ypPE9cN6.mjs\";\nimport { _ as handleResult, d as setCommandSeeAlso, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, o as resolveContractPath, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, x as formatStyledHeader } from \"./command-helpers-bGYd7Aab.mjs\";\nimport { a as loadContractSpaceAggregateForCli } from \"./contract-space-aggregate-loader-DOzo1sk9.mjs\";\nimport { t as createControlClient } from \"./client-milNsAnF.mjs\";\nimport { n as resolveMigrationRef } from \"./ref-resolution-BYCRg72z.mjs\";\nimport { n as looksLikePath, r as resolveAppTargetPath, t as findPackageByDirPath } from \"./migration-path-target-DhGt62Mi.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { relative } from \"pathe\";\nimport { readFile } from \"node:fs/promises\";\nimport { APP_SPACE_ID, createControlStack } from \"@internal/framework-components/control\";\nimport { castAs } from \"@internal/utils/casts\";\n//#region src/commands/migration-show.ts\nfunction pkgToPresent(spaceId, pkg, client) {\n\tconst ops = castAs(pkg.ops);\n\tconst rawPreview = client.toOperationPreview(ops) ?? { statements: [] };\n\treturn {\n\t\tspace: spaceId,\n\t\tname: pkg.dirName,\n\t\tfromContract: pkg.metadata.from,\n\t\ttoContract: pkg.metadata.to,\n\t\thash: pkg.metadata.migrationHash,\n\t\tcreatedAt: pkg.metadata.createdAt,\n\t\toperations: ops.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\tpreview: { statements: [...rawPreview.statements] }\n\t};\n}\nasync function executeMigrationShowCommand(target, options, flags, ui) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"driver\",\n\t\t\"extensions\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.config, config, process.cwd());\n\tconst contractPathAbsolute = resolveContractPath(config);\n\tconst contractPath = relative(process.cwd(), contractPathAbsolute);\n\tif (!flags.json && !flags.quiet) {\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migration show\",\n\t\t\tdescription: \"Display migration package contents\",\n\t\t\tdetails: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: configPath\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: contractPath\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: appMigrationsRelative\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"target\",\n\t\t\t\t\tvalue: target\n\t\t\t\t}\n\t\t\t],\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t}\n\tconst client = createControlClient({\n\t\tfamily: config.family,\n\t\ttarget: config.target,\n\t\tadapter: config.adapter,\n\t\t...ifDefined(\"driver\", config.driver),\n\t\textensions: config.extensions ?? []\n\t});\n\tlet contractJsonContent;\n\ttry {\n\t\tcontractJsonContent = await readFile(contractPathAbsolute, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return notOk(errorFileNotFound(contractPathAbsolute, {\n\t\t\twhy: `Contract file not found at ${contractPathAbsolute}`,\n\t\t\tfix: `Run \\`prisma-next contract emit\\` to generate ${contractPath}`\n\t\t}));\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: \"Failed to read contract file\" }));\n\t}\n\tconst stack = createControlStack(config);\n\tconst familyInstance = config.family.create(stack);\n\tlet appContract;\n\ttry {\n\t\tappContract = familyInstance.deserializeContract(castAs(JSON.parse(contractJsonContent)));\n\t} catch (error) {\n\t\treturn notOk(errorContractValidationFailed(`Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\tconst loadedAggregate = await loadContractSpaceAggregateForCli({\n\t\ttargetId: config.target.targetId,\n\t\tmigrationsDir,\n\t\tappContract,\n\t\textensions: [],\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t});\n\tif (!loadedAggregate.ok) return notOk(loadedAggregate.failure);\n\tconst aggregate = loadedAggregate.value;\n\tconst packages = aggregate.app.packages;\n\tconst graph = aggregate.app.graph();\n\tconst refs = aggregate.app.refs;\n\tlet appPkg;\n\tif (looksLikePath(target)) {\n\t\tconst resolved = resolveAppTargetPath(target, appMigrationsDir, appMigrationsRelative);\n\t\tif (!resolved.ok) return resolved;\n\t\tconst matched = findPackageByDirPath(packages, resolved.value);\n\t\tif (!matched) return notOk(errorRuntime(\"MIGRATION.PACKAGE_NOT_FOUND\", \"Migration package not found\", {\n\t\t\twhy: `No loaded migration package at ${relative(process.cwd(), resolved.value)}`,\n\t\t\tfix: \"Pass a directory name, hash prefix, or path to an on-disk app-space migration package.\"\n\t\t}));\n\t\tappPkg = matched;\n\t} else {\n\t\tif (packages.length === 0) return notOk(errorRuntime(\"MIGRATION.NO_MIGRATIONS\", \"No migrations found\", {\n\t\t\twhy: `No migration packages found in ${appMigrationsRelative}`,\n\t\t\tfix: \"Run `prisma-next migration plan` to create a migration first.\"\n\t\t}));\n\t\tconst migResult = resolveMigrationRef(target, {\n\t\t\tgraph,\n\t\t\trefs\n\t\t});\n\t\tif (!migResult.ok) return notOk(migResult.failure);\n\t\tconst matchedPkg = packages.find((p) => p.metadata.migrationHash === migResult.value.migrationHash);\n\t\tif (!matchedPkg) return notOk(errorRuntime(\"MIGRATION.PACKAGE_NOT_FOUND\", \"Migration package not found\", {\n\t\t\twhy: `Resolved migration \"${migResult.value.dirName}\" but the package was not loaded`,\n\t\t\tfix: \"The migrations directory may be corrupted. Inspect the migration.json files.\"\n\t\t}));\n\t\tappPkg = matchedPkg;\n\t}\n\tconst migration = pkgToPresent(APP_SPACE_ID, appPkg, client);\n\treturn ok({\n\t\tok: true,\n\t\tsummary: `Migration ${migration.name} in ${migration.space}: ${migration.operations.length} operation(s)`,\n\t\tmigration\n\t});\n}\nfunction createMigrationShowCommand() {\n\tconst command = new Command(\"show\");\n\tsetCommandDescriptions(command, \"Display migration package contents\", \"Shows the operations, statement preview, and metadata for one app-space migration.\\nAccepts a directory path, directory name, or hash prefix.\\nOffline — does not consult the database.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migration show 20260101_100000_add_user\",\n\t\t\"prisma-next migration show a1b2c3\",\n\t\t\"prisma-next migration show 20260101_100000_add_user --json\"\n\t]);\n\tsetCommandSeeAlso(command, [\n\t\t{\n\t\t\tverb: \"migration status\",\n\t\t\toneLiner: \"Show migration path and pending status\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration log\",\n\t\t\toneLiner: \"Show executed migration history\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration list\",\n\t\t\toneLiner: \"List on-disk migrations\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration graph\",\n\t\t\toneLiner: \"Show the migration graph topology\"\n\t\t}\n\t]);\n\taddGlobalOptions(command).argument(\"<target>\", \"Migration reference: directory name, hash/prefix, ref, or path\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").action(async (target, options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst exitCode = handleResult(await executeMigrationShowCommand(target, options, flags, ui), flags, ui, (showResult) => {\n\t\t\tif (flags.json) ui.output(JSON.stringify(showResult, null, 2));\n\t\t\telse if (!flags.quiet) ui.log(formatMigrationShowOutput(showResult, flags));\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createMigrationShowCommand as t };\n\n//# sourceMappingURL=migration-show-DRARjIbv.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,aAAa,SAAS,KAAK,QAAQ;CAC3C,MAAM,MAAM,OAAO,IAAI,GAAG;CAC1B,MAAM,aAAa,OAAO,mBAAmB,GAAG,KAAK,EAAE,YAAY,CAAC,EAAE;CACtE,OAAO;EACN,OAAO;EACP,MAAM,IAAI;EACV,cAAc,IAAI,SAAS;EAC3B,YAAY,IAAI,SAAS;EACzB,MAAM,IAAI,SAAS;EACnB,WAAW,IAAI,SAAS;EACxB,YAAY,IAAI,KAAK,QAAQ;GAC5B,IAAI,GAAG;GACP,OAAO,GAAG;GACV,gBAAgB,GAAG;EACpB,EAAE;EACF,SAAS,EAAE,YAAY,CAAC,GAAG,WAAW,UAAU,EAAE;CACnD;AACD;AACA,eAAe,4BAA4B,QAAQ,SAAS,OAAO,IAAI;CACtE,MAAM,eAAe,MAAM,sBAAsB,QAAQ,QAAQ;EAChE;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CACD,IAAI,CAAC,aAAa,IAAI,OAAO;CAC7B,MAAM,SAAS,aAAa;CAC5B,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,SAAS,aAAa,UAAU,KAAK,MAAM,UAAU,MAAM,IAAI,UAAU,WAAW,OAAO;EAC3F;CACD,CAAC;AACF;AACA,SAAS,6BAA6B;CACrC,MAAM,UAAU,IAAI,QAAQ,MAAM;CAClC,uBAAuB,SAAS,sCAAsC,yLAAyL;CAC/P,mBAAmB,SAAS;EAC3B;EACA;EACA;CACD,CAAC;CACD,kBAAkB,SAAS;EAC1B;GACC,MAAM;GACN,UAAU;EACX;EACA;GACC,MAAM;GACN,UAAU;EACX;EACA;GACC,MAAM;GACN,UAAU;EACX;EACA;GACC,MAAM;GACN,UAAU;EACX;CACD,CAAC;CACD,iBAAiB,OAAO,CAAC,CAAC,SAAS,YAAY,gEAAgE,CAAC,CAAC,OAAO,mBAAmB,+BAA+B,CAAC,CAAC,OAAO,OAAO,QAAQ,YAAY;EAC7M,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,MAAM,KAAK,iBAAiB,KAAK;EACjC,MAAM,WAAW,aAAa,MAAM,4BAA4B,QAAQ,SAAS,OAAO,EAAE,GAAG,OAAO,KAAK,eAAe;GACvH,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU,YAAY,MAAM,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,OAAO,GAAG,IAAI,0BAA0B,YAAY,KAAK,CAAC;EAC3E,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-status-Yh0eOQJN-YpcPDpNh.mjs","names":["CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-status-Yh0eOQJN.mjs"],"sourcesContent":["import { A as errorUnexpected, M as requireLiveDatabase, t as CliStructuredError } from \"./cli-errors-kU09RUaz.mjs\";\nimport { t as createTerminalUI } from \"./terminal-ui-ypPE9cN6.mjs\";\nimport { _ as handleResult, a as readContractEnvelope, d as setCommandSeeAlso, g as parseGlobalFlagsOrExit, i as maskConnectionUrl, l as setCommandDescriptions, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, x as formatStyledHeader } from \"./command-helpers-bGYd7Aab.mjs\";\nimport { i as loadContractRawSafely, l as refusePackageCorruptionOnAggregate, r as buildReadAggregate } from \"./contract-space-aggregate-loader-DOzo1sk9.mjs\";\nimport { t as createControlClient } from \"./client-milNsAnF.mjs\";\nimport { n as refuseUnknownInvariants, r as hasMigrationPath, t as refuseMissingInvariantPath } from \"./invariants-D5TNnX5E.mjs\";\nimport { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList, t as listRefsByContractHash } from \"./migration-list-Bkase_ZM.mjs\";\nimport { t as resolveContractRef } from \"./ref-resolution-BYCRg72z.mjs\";\nimport { a as renderMigrationGraphLegend, f as indentMigrationGraphTreeBlock, l as computeGlobalMaxDirNameWidth, p as renderMigrationGraphSpaceTree, u as computeGlobalMaxEdgeTreePrefixWidth } from \"./migration-graph-command-render-BKrg6BPv.mjs\";\nimport { n as validateLegendOptions, t as shouldShowLegend } from \"./legend-BBtAETiW.mjs\";\nimport { a as statusForMigrationHash, i as originHashForStatus, n as appliedHashesFromLedger, r as deriveStatusEdgeAnnotations, t as readMigrationRefs } from \"./refs-fQLFcMoq.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { dim, yellow } from \"colorette\";\n//#region src/commands/migration-status.ts\nfunction shortDisplayHash(hash) {\n\treturn hash.slice(0, 12);\n}\nfunction resolveTarget(contractHash, activeRefHash) {\n\treturn activeRefHash ?? contractHash;\n}\nfunction buildStatusMigrations(listMigrations, annotations) {\n\treturn listMigrations.map((migration) => ({\n\t\t...migration,\n\t\tstatus: statusForMigrationHash(migration.hash, annotations)\n\t}));\n}\nfunction renderSpaceTree(args) {\n\tconst graph = args.space.graph();\n\tif (graph.nodes.size === 0) return \"\";\n\treturn renderMigrationGraphSpaceTree({\n\t\tgraph,\n\t\tmigrations: args.migrations,\n\t\tliveContractHash: args.liveContractHash,\n\t\trefsByHash: listRefsByContractHash(args.space),\n\t\tstatusOverlayByHash: args.statusOverlay,\n\t\tcolorize: args.colorize,\n\t\tglyphMode: args.glyphMode,\n\t\tisAppSpace: args.isAppSpace,\n\t\t...args.showDbMarker && args.markerHash !== void 0 ? { dbHash: args.markerHash } : {},\n\t\t...args.globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth: args.globalMaxEdgeTreePrefixWidth } : {},\n\t\t...args.globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth: args.globalMaxDirNameWidth } : {}\n\t});\n}\nfunction countPending(migrations) {\n\treturn migrations.filter((m) => m.status === \"pending\").length;\n}\nfunction buildNoPathSummary(args) {\n\tconst markerPart = args.markerHash !== void 0 ? `the database state (${shortDisplayHash(args.markerHash)})` : \"the database state\";\n\tconst targetShort = shortDisplayHash(args.targetHash);\n\tif (!args.explicitTarget) return `No migration path from ${markerPart} to the application's contract (${targetShort}). Run \\`prisma-next migration plan --name <name>\\` to author one.`;\n\treturn `No migration path from ${markerPart} to ${args.refName !== void 0 ? `the target (${targetShort} via \\`${args.refName}\\`)` : `the target (${targetShort})`}. Run \\`prisma-next migration plan --name <name>\\` to author one, or pass \\`--to <contract>\\` to pick a reachable target.`;\n}\nfunction buildStatusHeadline(args) {\n\tif (args.markerDiverged && args.markerHash !== void 0) return `Database marker ${shortDisplayHash(args.markerHash)} is not in the on-disk migration graph`;\n\tif (args.pendingCount === 0) return \"Up to date\";\n\treturn `${args.pendingCount} pending — run \\`prisma-next migrate --to ${shortDisplayHash(args.targetHash)}\\``;\n}\nfunction formatStatusSummary(result, colorize) {\n\tconst c = (fn, s) => colorize ? fn(s) : s;\n\tconst lines = [];\n\tconst pendingTotal = result.spaces.reduce((sum, space) => sum + countPending(space.migrations), 0);\n\tif (result.diagnostics.some((d) => d.code === \"MIGRATION.MARKER_NOT_IN_HISTORY\") || pendingTotal > 0) lines.push(c(yellow, result.summary));\n\telse lines.push(result.summary);\n\tconst missingInvariantsDiagnostic = result.diagnostics.find((d) => d.code === \"MIGRATION.MISSING_INVARIANTS\");\n\tif (missingInvariantsDiagnostic !== void 0) lines.push(c(dim, missingInvariantsDiagnostic.message));\n\treturn lines.join(\"\\n\");\n}\nfunction formatStatusHumanOutput(result, colorize) {\n\tconst sections = [];\n\tfor (const section of result.treeSections) {\n\t\tif (section.showHeading) sections.push(`${section.space}:`);\n\t\tif (section.tree.length > 0) sections.push(section.tree);\n\t\telse sections.push(\"(no migrations)\");\n\t\tsections.push(\"\");\n\t}\n\tsections.push(formatStatusSummary(result, colorize));\n\treturn sections.join(\"\\n\").trimEnd();\n}\nasync function readMarkersAndLedgers(args) {\n\tconst markersBySpace = /* @__PURE__ */ new Map();\n\tconst all = await args.client.readAllMarkers();\n\tfor (const [spaceId, marker] of all) markersBySpace.set(spaceId, marker);\n\tconst ledgersBySpace = /* @__PURE__ */ new Map();\n\tfor (const spaceId of args.spaceIds) ledgersBySpace.set(spaceId, await args.client.readLedger(spaceId));\n\treturn {\n\t\tmarkersBySpace,\n\t\tledgersBySpace\n\t};\n}\nasync function executeMigrationStatusCommand(options, flags, ui) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"driver\",\n\t\t\"extensions\",\n\t\t\"db\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst { configPath, migrationsDir, migrationsRelative, refsDir } = resolveMigrationPaths(options.config, config, process.cwd());\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tconst hasDriver = !!config.driver;\n\tconst usingFromOverride = options.from !== void 0;\n\tif (!usingFromOverride) {\n\t\tconst missingDb = requireLiveDatabase({\n\t\t\tdbConnection,\n\t\t\thasDriver,\n\t\t\twhy: \"migration status needs a database connection to read the marker and ledger (or pass --from for offline path preview)\",\n\t\t\tretryCommand: \"prisma-next migration status --from <contract>\"\n\t\t});\n\t\tif (missingDb) return notOk(missingDb);\n\t}\n\tconst refsResult = await readMigrationRefs(refsDir);\n\tif (!refsResult.ok) return notOk(refsResult.failure);\n\tconst allRefs = refsResult.value;\n\tconst diagnostics = [];\n\tconst loaded = await buildReadAggregate(config, { migrationsDir });\n\tif (!loaded.ok) return notOk(loaded.failure);\n\tconst contractHash = loaded.value.contractHash;\n\ttry {\n\t\tawait readContractEnvelope(config);\n\t} catch (error) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"CONTRACT.UNREADABLE\",\n\t\t\tseverity: \"warn\",\n\t\t\tmessage: `Could not read contract: ${error instanceof Error ? error.message : \"unknown error\"}`,\n\t\t\thints: [\"Run 'prisma-next contract emit' to generate a valid contract\"]\n\t\t});\n\t}\n\tconst { aggregate } = loaded.value;\n\tif (await loadContractRawSafely(config) !== null) {\n\t\tconst corruptionFailure = refusePackageCorruptionOnAggregate(aggregate);\n\t\tif (corruptionFailure) return notOk(corruptionFailure);\n\t}\n\tconst appGraph = aggregate.app.graph();\n\tlet activeRefHash;\n\tlet activeRefName;\n\tlet activeRefEntry;\n\tlet fromOverrideHash;\n\tif (options.to) {\n\t\tconst refResult = resolveContractRef(options.to, {\n\t\t\tgraph: appGraph,\n\t\t\trefs: allRefs\n\t\t});\n\t\tif (!refResult.ok) return notOk(refResult.failure);\n\t\tactiveRefHash = refResult.value.hash;\n\t\tif (refResult.value.provenance.kind === \"ref\") {\n\t\t\tactiveRefName = refResult.value.provenance.refName;\n\t\t\tactiveRefEntry = allRefs[activeRefName];\n\t\t}\n\t}\n\tif (options.from) {\n\t\tconst fromResult = resolveContractRef(options.from, {\n\t\t\tgraph: appGraph,\n\t\t\trefs: allRefs\n\t\t});\n\t\tif (!fromResult.ok) return notOk(fromResult.failure);\n\t\tfromOverrideHash = fromResult.value.hash;\n\t}\n\tconst requiredInvariants = [...activeRefEntry?.invariants ?? []].sort();\n\tif (!flags.json && !flags.quiet) {\n\t\tconst details = [{\n\t\t\tlabel: \"config\",\n\t\t\tvalue: configPath\n\t\t}, {\n\t\t\tlabel: \"migrations\",\n\t\t\tvalue: migrationsRelative\n\t\t}];\n\t\tif (dbConnection && hasDriver) details.push({\n\t\t\tlabel: \"database\",\n\t\t\tvalue: maskConnectionUrl(String(dbConnection))\n\t\t});\n\t\tif (activeRefName) details.push({\n\t\t\tlabel: \"ref\",\n\t\t\tvalue: activeRefName\n\t\t});\n\t\tif (options.from) details.push({\n\t\t\tlabel: \"from\",\n\t\t\tvalue: options.from\n\t\t});\n\t\tif (options.space) details.push({\n\t\t\tlabel: \"space\",\n\t\t\tvalue: options.space\n\t\t});\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migration status\",\n\t\t\tdescription: \"Show migration history and applied status\",\n\t\t\tdetails,\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t\tif (shouldShowLegend(options, flags)) {\n\t\t\tui.stderr(renderMigrationGraphLegend({\n\t\t\t\tcolorize: flags.color !== false,\n\t\t\t\tglyphMode: ui.resolveGlyphMode(options.ascii === true)\n\t\t\t}));\n\t\t\tui.stderr(\"\");\n\t\t}\n\t}\n\tconst listResult = runMigrationList({\n\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t...ifDefined(\"spaceFilter\", options.space)\n\t});\n\tif (!listResult.ok) return listResult;\n\tconst scopedSpaces = listResult.value.spaces;\n\tconst showSpaceHeadings = scopedSpaces.length > 1;\n\tlet markersBySpace = /* @__PURE__ */ new Map();\n\tlet ledgersBySpace = /* @__PURE__ */ new Map();\n\tlet connected = false;\n\tif (dbConnection && hasDriver && !usingFromOverride) {\n\t\tconst client = createControlClient({\n\t\t\tfamily: config.family,\n\t\t\ttarget: config.target,\n\t\t\tadapter: config.adapter,\n\t\t\tdriver: config.driver,\n\t\t\textensions: config.extensions ?? []\n\t\t});\n\t\ttry {\n\t\t\tawait client.connect(dbConnection);\n\t\t\tconnected = true;\n\t\t\tconst read = await readMarkersAndLedgers({\n\t\t\t\tclient,\n\t\t\t\tspaceIds: scopedSpaces.map((s) => s.space)\n\t\t\t});\n\t\t\tmarkersBySpace = new Map(read.markersBySpace);\n\t\t\tledgersBySpace = new Map(read.ledgersBySpace);\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read database state: ${error instanceof Error ? error.message : String(error)}` }));\n\t\t} finally {\n\t\t\tawait client.close();\n\t\t}\n\t}\n\tif (activeRefEntry && activeRefEntry.invariants.length > 0 && connected) {\n\t\tconst invariantRefusal = refuseUnknownInvariants({\n\t\t\tgraph: appGraph,\n\t\t\tmarkerInvariants: markersBySpace.get(aggregate.app.spaceId)?.invariants ?? [],\n\t\t\trefInvariants: activeRefEntry.invariants,\n\t\t\t...ifDefined(\"refName\", activeRefName)\n\t\t});\n\t\tif (invariantRefusal) return notOk(invariantRefusal);\n\t}\n\tconst showAppliedOverlay = connected && !usingFromOverride;\n\tconst showDbMarker = connected && !usingFromOverride;\n\tconst glyphMode = ui.resolveGlyphMode(options.ascii === true);\n\tconst colorize = flags.color !== false;\n\tconst statusSpaces = [];\n\tconst treeSections = [];\n\tlet markerDiverged = false;\n\tlet markerCannotReachTarget = false;\n\tlet headlineTargetHash = activeRefHash ?? contractHash;\n\tlet totalPending = 0;\n\tconst globalLayoutInputs = showSpaceHeadings ? scopedSpaces.filter((spaceEntry) => spaceEntry.migrations.length > 0).map((spaceEntry) => ({\n\t\tgraph: aggregate.space(spaceEntry.space).graph(),\n\t\tliveContractHash: contractHash\n\t})) : [];\n\tconst globalMaxEdgeTreePrefixWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxEdgeTreePrefixWidth(globalLayoutInputs) : void 0;\n\tconst globalMaxDirNameWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxDirNameWidth(globalLayoutInputs) : void 0;\n\tfor (const spaceEntry of scopedSpaces) {\n\t\tconst space = aggregate.space(spaceEntry.space);\n\t\tif (space === void 0) continue;\n\t\tconst graph = space.graph();\n\t\tconst spaceContractHash = space.contract().storage.storageHash;\n\t\tconst targetHash = resolveTarget(spaceContractHash, activeRefHash);\n\t\tif (spaceEntry.space === aggregate.app.spaceId) headlineTargetHash = targetHash;\n\t\tconst markerRecord = markersBySpace.get(spaceEntry.space);\n\t\tconst markerHash = usingFromOverride ? fromOverrideHash : markerRecord?.storageHash ?? void 0;\n\t\tconst originHash = originHashForStatus(markerHash);\n\t\tconst markerInGraph = markerHash === void 0 || graph.nodes.has(markerHash) || markerHash === spaceContractHash;\n\t\tif (connected && !usingFromOverride && markerInGraph && originHash !== targetHash && !hasMigrationPath(graph, originHash, targetHash)) markerCannotReachTarget = true;\n\t\tif (connected && !usingFromOverride && markerHash !== void 0 && !markerInGraph) {\n\t\t\tmarkerDiverged = true;\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"MIGRATION.MARKER_NOT_IN_HISTORY\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\tmessage: \"Database was updated outside the migration system (marker does not match any migration)\",\n\t\t\t\thints: [\"Run 'prisma-next db sign' to overwrite the marker if the database already matches the contract\", \"Run 'prisma-next db update' to push the current contract to the database\"]\n\t\t\t});\n\t\t}\n\t\tconst ledger = ledgersBySpace.get(spaceEntry.space) ?? [];\n\t\tconst annotations = deriveStatusEdgeAnnotations({\n\t\t\tgraph,\n\t\t\ttargetHash,\n\t\t\toriginHash,\n\t\t\tappliedMigrationHashes: showAppliedOverlay ? appliedHashesFromLedger(ledger) : /* @__PURE__ */ new Set(),\n\t\t\tshowAppliedOverlay\n\t\t});\n\t\tconst isAppSpace = spaceEntry.space === aggregate.app.spaceId;\n\t\tconst tree = renderSpaceTree({\n\t\t\tspace,\n\t\t\tliveContractHash: contractHash,\n\t\t\tmigrations: spaceEntry.migrations,\n\t\t\tmarkerHash,\n\t\t\tshowDbMarker,\n\t\t\tstatusOverlay: annotations,\n\t\t\tcolorize,\n\t\t\tglyphMode,\n\t\t\tisAppSpace,\n\t\t\t...globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth } : {},\n\t\t\t...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}\n\t\t});\n\t\tconst migrations = buildStatusMigrations(spaceEntry.migrations, annotations);\n\t\tconst pending = countPending(migrations);\n\t\ttotalPending += pending;\n\t\tstatusSpaces.push({\n\t\t\tspace: spaceEntry.space,\n\t\t\tcurrentContract: markerHash ?? null,\n\t\t\ttargetContract: targetHash,\n\t\t\tmigrations: [...migrations]\n\t\t});\n\t\tconst displayTree = showSpaceHeadings && tree.length > 0 ? indentMigrationGraphTreeBlock(tree, \" \") : tree;\n\t\ttreeSections.push({\n\t\t\tspace: spaceEntry.space,\n\t\t\ttree: displayTree,\n\t\t\tshowHeading: showSpaceHeadings\n\t\t});\n\t}\n\tif (connected && requiredInvariants.length > 0) {\n\t\tconst markerInvariants = markersBySpace.get(aggregate.app.spaceId)?.invariants ?? [];\n\t\tconst markerSet = new Set(markerInvariants);\n\t\tconst missing = requiredInvariants.filter((id) => !markerSet.has(id));\n\t\tif (missing.length > 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"MIGRATION.MISSING_INVARIANTS\",\n\t\t\t\t...ifDefined(\"ref\", activeRefName),\n\t\t\t\tinvariants: missing,\n\t\t\t\tmessage: `missing invariant(s): ${missing.join(\", \")}`\n\t\t\t});\n\t\t\tif (activeRefHash !== void 0) {\n\t\t\t\tconst pathRefusal = refuseMissingInvariantPath({\n\t\t\t\t\tgraph: appGraph,\n\t\t\t\t\toriginHash: originHashForStatus(markersBySpace.get(aggregate.app.spaceId)?.storageHash),\n\t\t\t\t\ttargetHash: activeRefHash,\n\t\t\t\t\tmissing,\n\t\t\t\t\t...ifDefined(\"refName\", activeRefName)\n\t\t\t\t});\n\t\t\t\tif (pathRefusal) return notOk(pathRefusal);\n\t\t\t}\n\t\t}\n\t}\n\tconst appMarkerHash = markersBySpace.get(aggregate.app.spaceId)?.storageHash;\n\tconst summary = markerCannotReachTarget ? buildNoPathSummary({\n\t\tmarkerHash: appMarkerHash,\n\t\ttargetHash: headlineTargetHash,\n\t\texplicitTarget: options.to !== void 0,\n\t\trefName: activeRefName\n\t}) : buildStatusHeadline({\n\t\tpendingCount: totalPending,\n\t\ttargetHash: headlineTargetHash,\n\t\tmarkerDiverged,\n\t\tmarkerHash: appMarkerHash\n\t});\n\tif (scopedSpaces.every((s) => s.migrations.length === 0)) return ok({\n\t\tok: true,\n\t\tspaces: statusSpaces,\n\t\tsummary: \"No migrations found\",\n\t\tdiagnostics,\n\t\ttreeSections\n\t});\n\treturn ok({\n\t\tok: true,\n\t\tspaces: statusSpaces,\n\t\tsummary,\n\t\tdiagnostics,\n\t\ttreeSections\n\t});\n}\nfunction createMigrationStatusCommand() {\n\tconst command = new Command(\"status\");\n\tsetCommandDescriptions(command, \"Show migration path and pending status\", \"Shows which migrations are pending between the database marker and\\nthe target contract. Requires a database connection.\\nPass --from for an offline path preview without a database.\\nUse `migration graph` for topology, `migration log` for history,\\nand `migration list` for on-disk enumeration.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migration status --db $DATABASE_URL\",\n\t\t\"prisma-next migration status --to production --db $DATABASE_URL\",\n\t\t\"prisma-next migration status --from abc123 --to production\",\n\t\t\"prisma-next migration status --from abc123 --to production --json\",\n\t\t\"prisma-next migration status --ascii --from abc123 --to production\",\n\t\t\"prisma-next migration status --legend --from abc123 --to production\"\n\t]);\n\tsetCommandSeeAlso(command, [\n\t\t{\n\t\t\tverb: \"migration log\",\n\t\t\toneLiner: \"Show executed migration history\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration list\",\n\t\t\toneLiner: \"List on-disk migrations\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration graph\",\n\t\t\toneLiner: \"Show the migration graph topology\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration show\",\n\t\t\toneLiner: \"Display migration package contents\"\n\t\t}\n\t]);\n\taddGlobalOptions(command).option(\"--db <url>\", \"Database connection string\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--space <id>\", \"Narrow output to a single contract space\").option(\"--to <contract>\", \"Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\").option(\"--from <contract>\", \"Origin contract reference; same grammar as --to. Supplying --from switches to offline path computation.\").option(\"--legend\", \"Print a key for the tree glyphs and lane colors\").option(\"--ascii\", \"Use ASCII glyphs (pipe-friendly)\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst legendValidation = validateLegendOptions(options, flags);\n\t\tif (!legendValidation.ok) process.exit(handleResult(legendValidation, flags, ui));\n\t\tconst exitCode = handleResult(await executeMigrationStatusCommand(options, flags, ui), flags, ui, (statusResult) => {\n\t\t\tif (flags.json) {\n\t\t\t\tconst jsonResult = {\n\t\t\t\t\tok: true,\n\t\t\t\t\tspaces: [...statusResult.spaces],\n\t\t\t\t\tsummary: statusResult.summary,\n\t\t\t\t\tdiagnostics: [...statusResult.diagnostics]\n\t\t\t\t};\n\t\t\t\tui.output(JSON.stringify(jsonResult, null, 2));\n\t\t\t} else if (!flags.quiet) ui.output(formatStatusHumanOutput(statusResult, flags.color !== false));\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { formatStatusHumanOutput as a, executeMigrationStatusCommand as i, buildStatusHeadline as n, formatStatusSummary as o, createMigrationStatusCommand as r, buildNoPathSummary as t };\n\n//# sourceMappingURL=migration-status-Yh0eOQJN.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,iBAAiB,MAAM;CAC/B,OAAO,KAAK,MAAM,GAAG,EAAE;AACxB;AACA,SAAS,cAAc,cAAc,eAAe;CACnD,OAAO,iBAAiB;AACzB;AACA,SAAS,sBAAsB,gBAAgB,aAAa;CAC3D,OAAO,eAAe,KA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B,OAAO,CAAC,CAAC,OAAO,cAAc,4BAA4B,CAAC,CAAC,OAAO,mBAAmB,+BAA+B,CAAC,CAAC,OAAO,gBAAgB,0CAA0C,CAAC,CAAC,OAAO,mBAAmB,2FAA2F,CAAC,CAAC,OAAO,qBAAqB,yGAAyG,CAAC,CAAC,OAAO,YAAY,iDAAiD,CAAC,CAAC,OAAO,WAAW,kCAAkC,CAAC,CAAC,OAAO,OAAO,YAAY;EAC9lB,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,MAAM,KAAK,iBAAiB,KAAK;EACjC,MAAM,mBAAmB,sBAAsB,SAAS,KAAK;EAC7D,IAAI,CAAC,iBAAiB,IAAI,QAAQ,KAAK,aAAa,kBAAkB,OAAO,EAAE,CAAC;EAChF,MAAM,WAAW,aAAa,MAAM,8BAA8B,SAAS,OAAO,EAAE,GAAG,OAAO,KAAK,iBAAiB;GACnH,IAAI,MAAM,MAAM;IACf,MAAM,aAAa;KAClB,IAAI;KACJ,QAAQ,CAAC,GAAG,aAAa,MAAM;KAC/B,SAAS,aAAa;KACtB,aAAa,CAAC,GAAG,aAAa,WAAW;IAC1C;IACA,GAAG,OAAO,KAAK,UAAU,YAAY,MAAM,CAAC,CAAC;GAC9C,OAAO,IAAI,CAAC,MAAM,OAAO,GAAG,OAAO,wBAAwB,cAAc,MAAM,UAAU,KAAK,CAAC;EAChG,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"terminal-ui-ypPE9cN6-ilMBkmwT.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/terminal-ui-ypPE9cN6.mjs"],"sourcesContent":["import { bold, cyan, dim, green, red, yellow } from \"colorette\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport * as clack from \"@clack/prompts\";\n//#region src/utils/formatters/helpers.ts\n/**\n* Checks if verbose output is enabled at the specified level.\n*/\nfunction isVerbose(flags, level) {\n\treturn (flags.verbose ?? 0) >= level;\n}\n/**\n* Creates a color-aware formatter function.\n* Returns a function that applies the color only if colors are enabled.\n*/\nfunction createColorFormatter(useColor, colorFn) {\n\treturn useColor ? colorFn : (text) => text;\n}\n/**\n* Formats text with dim styling if colors are enabled.\n*/\nfunction formatDim(useColor, text) {\n\treturn useColor ? dim(text) : text;\n}\n//#endregion\n//#region src/utils/formatters/migrations.ts\n/**\n* Render a single statement of an `OperationPreview` for the human-readable\n* preview block. SQL statements get a trailing `;` if missing so the rendered\n* preview is byte-identical to the legacy `string[]`-based renderer for SQL\n* targets. Other languages (`'mongodb-shell'`) render verbatim.\n*/\nfunction renderPreviewStatement(text, language) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return void 0;\n\tif (language === \"sql\") return trimmed.endsWith(\";\") ? trimmed : `${trimmed};`;\n\treturn trimmed;\n}\n/**\n* Choose the header label for a preview block. SQL-only previews keep the\n* legacy `DDL preview` label so the rendered output is byte-identical to the\n* pre-aggregate SQL CLI; previews from any other family — or a mix that\n* includes any non-SQL language — use the family-agnostic `Operation preview`\n* label.\n*\n* An empty `statements` array deliberately renders as `Operation preview`\n* rather than `DDL preview`: `Array.prototype.every` is vacuously true for\n* empty arrays, but we have no evidence the preview is SQL-only when no\n* statements are present, so the family-agnostic label is the safer default.\n*/\nfunction previewBlockHeader(preview) {\n\treturn preview.statements.length > 0 && preview.statements.every((s) => s.language === \"sql\") ? \"DDL preview\" : \"Operation preview\";\n}\nfunction formatPlannerWarningsBlock(warnings, useColor) {\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [\"\", \"Warnings:\"];\n\tfor (const warning of warnings) lines.push(` ${formatDimText(`- ${warning.summary}`)}`);\n\treturn lines;\n}\n/**\n* Render the shared per-space execution block consumed by the `db init`\n* / `db update` / `migrate` summaries. Always shows: space\n* label (`Extension space: <id>` or `App space`) → per-op lines under\n* each space → per-space marker hash (when known).\n*\n* `mode` controls the marker label phrasing — `'apply'` shows\n* `marker → <hash>` (post-apply), `'plan'` omits the marker line\n* entirely (no marker has been written yet).\n*/\nfunction formatPerSpaceBlock(perSpace, mode, useColor) {\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatCyan = createColorFormatter(useColor, cyan);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [];\n\tfor (let s = 0; s < perSpace.length; s++) {\n\t\tconst space = perSpace[s];\n\t\tif (s > 0) lines.push(\"\");\n\t\tconst header = space.kind === \"app\" ? formatCyan(\"App space\") : formatCyan(`Extension space: ${space.spaceId}`);\n\t\tlines.push(header);\n\t\tif (space.operations.length === 0) lines.push(` ${formatDimText(\"(no operations)\")}`);\n\t\telse for (let i = 0; i < space.operations.length; i++) {\n\t\t\tconst op = space.operations[i];\n\t\t\tconst treeChar = i === space.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(` ${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (mode === \"apply\" && space.marker) lines.push(` ${formatDimText(`marker: ${space.marker.storageHash}`)}`);\n\t}\n\treturn lines;\n}\n/**\n* Formats human-readable output for migration commands (db init, db update) in plan mode.\n*/\nfunction formatMigrationPlanOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst operationCount = result.plan?.operations.length ?? 0;\n\tconst spaceCount = result.perSpace?.length ?? 0;\n\tif (spaceCount > 0) lines.push(`${formatGreen(\"✔\")} Planned ${operationCount} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}`);\n\telse lines.push(`${formatGreen(\"✔\")} Planned ${operationCount} operation(s)`);\n\tif (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tif (result.perSpace && result.perSpace.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(...formatPerSpaceBlock(result.perSpace, \"plan\", useColor));\n\t\tif (result.perSpace.some((s) => s.operations.some((op) => op.operationClass === \"destructive\"))) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t} else if (result.plan?.operations && result.plan.operations.length > 0) {\n\t\tlines.push(`${formatDimText(\"│\")}`);\n\t\tfor (let i = 0; i < result.plan.operations.length; i++) {\n\t\t\tconst op = result.plan.operations[i];\n\t\t\tif (!op) continue;\n\t\t\tconst treeChar = i === result.plan.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (result.plan.operations.some((op) => op.operationClass === \"destructive\")) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t}\n\tif (result.plan?.destination) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(`Destination hash: ${result.plan.destination.storageHash}`)}`);\n\t}\n\tif (result.plannedAdvanceRef) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Would advance ref \"${result.plannedAdvanceRef.name}\" → ${result.plannedAdvanceRef.hash}`));\n\t}\n\tconst preview = result.plan?.preview;\n\tif (preview) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(previewBlockHeader(preview))}`);\n\t\tif (preview.statements.length === 0) lines.push(`${formatDimText(\"No operations.\")}`);\n\t\telse {\n\t\t\tlines.push(\"\");\n\t\t\tfor (const statement of preview.statements) {\n\t\t\t\tconst rendered = renderPreviewStatement(statement.text, statement.language);\n\t\t\t\tif (rendered) lines.push(rendered);\n\t\t\t}\n\t\t}\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(`Total time: ${result.timings.total}ms`)}`);\n\tlines.push(\"\");\n\tlines.push(`${formatDimText(\"This is a dry run. No changes were applied.\")}`);\n\tlines.push(`${formatDimText(\"Run without --dry-run to apply changes.\")}`);\n\treturn lines.join(\"\\n\");\n}\nfunction formatMigrationApplyCommandOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tlines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\tif (result.perSpace.length > 0) {\n\t\tlines.push(\"\");\n\t\tfor (const line of formatPerSpaceBlock(result.perSpace, \"apply\", useColor)) lines.push(line);\n\t}\n\tif (result.advancedRef) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Advanced ref \"${result.advancedRef.name}\" → ${result.advancedRef.hash}`));\n\t}\n\tlines.push(\"\");\n\tlines.push(formatDimText(\"Next: prisma-next migration status\"));\n\tif (isVerbose(flags, 1) && result.timings) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Total time: ${result.timings.total}ms`));\n\t}\n\treturn lines.join(\"\\n\");\n}\nfunction formatSpaceShowBlock(space, useColor) {\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [];\n\tlines.push(`${formatGreen(\"✔\")} ${space.name}`);\n\tlines.push(`${formatDimText(` from: ${space.fromContract ?? \"(baseline)\"}`)}`);\n\tlines.push(`${formatDimText(` to: ${space.toContract}`)}`);\n\tlines.push(`${formatDimText(` hash: ${space.hash}`)}`);\n\tlines.push(`${formatDimText(` created: ${space.createdAt}`)}`);\n\tlines.push(\"\");\n\tlines.push(`${space.operations.length} operation(s)`);\n\tif (space.operations.length > 0) {\n\t\tlines.push(`${formatDimText(\"│\")}`);\n\t\tfor (let i = 0; i < space.operations.length; i++) {\n\t\t\tconst op = space.operations[i];\n\t\t\tconst treeChar = i === space.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (space.operations.some((op) => op.operationClass === \"destructive\")) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t}\n\tif (space.preview.statements.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(previewBlockHeader(space.preview))}`);\n\t\tlines.push(\"\");\n\t\tfor (const statement of space.preview.statements) {\n\t\t\tconst rendered = renderPreviewStatement(statement.text, statement.language);\n\t\t\tif (rendered) lines.push(rendered);\n\t\t}\n\t}\n\treturn lines;\n}\nfunction formatMigrationShowOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst useColor = flags.color !== false;\n\treturn formatSpaceShowBlock(result.migration, useColor).join(\"\\n\");\n}\n/**\n* Formats human-readable output for migration commands (db init, db update) in apply mode.\n*/\nfunction formatMigrationApplyOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (result.ok) {\n\t\tconst executed = result.execution?.operationsExecuted ?? 0;\n\t\tconst spaceCount = result.perSpace?.length ?? 0;\n\t\tif (executed === 0) {\n\t\t\tconst acrossClause = spaceCount > 0 ? ` across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}` : \"\";\n\t\t\tlines.push(`${formatGreen(\"✔\")} Database already matches contract${acrossClause}`);\n\t\t} else if (spaceCount > 0) lines.push(`${formatGreen(\"✔\")} Applied ${executed} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}`);\n\t\telse lines.push(`${formatGreen(\"✔\")} Applied ${executed} operation(s)`);\n\t\tif (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));\n\t\tif (result.perSpace && result.perSpace.length > 0) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(...formatPerSpaceBlock(result.perSpace, \"apply\", useColor));\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(formatDimText(`Run 'prisma-next migration status' to confirm ${spaceCount === 1 ? \"the space is\" : \"all spaces are\"} up to date.`));\n\t\t} else if (result.marker) {\n\t\t\tlines.push(`${formatDimText(` App-space marker: ${result.marker.storageHash}`)}`);\n\t\t\tif (result.marker.profileHash) lines.push(`${formatDimText(` Profile hash: ${result.marker.profileHash}`)}`);\n\t\t}\n\t\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t\tif (result.advancedRef) lines.push(formatDimText(`Advanced ref \"${result.advancedRef.name}\" → ${result.advancedRef.hash}`));\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for migration commands (db init, db update).\n*/\nfunction formatMigrationJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n//#endregion\n//#region src/utils/formatters/errors.ts\n/**\n* The display label for a schema-diff issue in the shared error envelope,\n* derived from which sides are present: expected-only is a missing object,\n* actual-only an extra one, both a mismatch. `undefined` when the entry is not\n* a schema-diff issue (it carries neither side) so the caller can fall through\n* to its generic label.\n*/\nfunction schemaDiffIssueLabel(issue) {\n\tconst hasExpected = issue.expected !== void 0;\n\tconst hasActual = issue.actual !== void 0;\n\tif (hasExpected && hasActual) return \"mismatch\";\n\tif (hasExpected) return \"missing\";\n\tif (hasActual) return \"extra\";\n}\n/**\n* Formats error output for human-readable display.\n*/\nfunction formatErrorOutput(error, flags) {\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatRed = createColorFormatter(useColor, red);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tlines.push(`${formatRed(\"✖\")} ${error.summary} (${error.code})`);\n\tif (error.why) lines.push(`${formatDimText(` Why: ${error.why}`)}`);\n\tif (error.fix) lines.push(`${formatDimText(` Fix: ${error.fix}`)}`);\n\tif (error.where?.path) {\n\t\tconst whereLine = error.where.line ? `${error.where.path}:${error.where.line}` : error.where.path;\n\t\tlines.push(`${formatDimText(` Where: ${whereLine}`)}`);\n\t}\n\tif (error.meta?.[\"conflicts\"]) {\n\t\tconst conflicts = error.meta[\"conflicts\"];\n\t\tif (conflicts.length > 0) {\n\t\t\tconst maxToShow = isVerbose(flags, 1) ? conflicts.length : Math.min(3, conflicts.length);\n\t\t\tconst header = isVerbose(flags, 1) ? \" Conflicts:\" : ` Conflicts (showing ${maxToShow} of ${conflicts.length}):`;\n\t\t\tlines.push(`${formatDimText(header)}`);\n\t\t\tfor (const conflict of conflicts.slice(0, maxToShow)) lines.push(`${formatDimText(` - [${conflict.kind}] ${conflict.summary}`)}`);\n\t\t\tif (!isVerbose(flags, 1) && conflicts.length > maxToShow) lines.push(`${formatDimText(\" Re-run with -v/--verbose to see all conflicts\")}`);\n\t\t}\n\t}\n\tif (error.meta?.[\"issues\"]) {\n\t\tconst issues = error.meta[\"issues\"];\n\t\tif (issues.length > 0) {\n\t\t\tconst maxToShow = isVerbose(flags, 1) ? issues.length : Math.min(3, issues.length);\n\t\t\tconst header = isVerbose(flags, 1) ? \" Issues:\" : ` Issues (showing ${maxToShow} of ${issues.length}):`;\n\t\t\tlines.push(`${formatDimText(header)}`);\n\t\t\tfor (const issue of issues.slice(0, maxToShow)) {\n\t\t\t\tconst label = issue.kind ?? schemaDiffIssueLabel(issue) ?? \"issue\";\n\t\t\t\tconst message = issue.message ?? issue.path?.join(\"/\") ?? \"\";\n\t\t\t\tlines.push(`${formatDimText(` - [${label}] ${message}`)}`);\n\t\t\t}\n\t\t\tif (!isVerbose(flags, 1) && issues.length > maxToShow) lines.push(`${formatDimText(\" Re-run with -v/--verbose to see all issues\")}`);\n\t\t}\n\t}\n\tif (error.docsUrl && isVerbose(flags, 1)) lines.push(formatDimText(error.docsUrl));\n\tconst plannerWarnings = error.meta?.[\"plannerWarnings\"];\n\tif (Array.isArray(plannerWarnings) && plannerWarnings.length > 0) {\n\t\tconst typedWarnings = blindCast(plannerWarnings);\n\t\tlines.push(...formatPlannerWarningsBlock(typedWarnings, useColor));\n\t}\n\tif (isVerbose(flags, 2) && error.meta) lines.push(`${formatDimText(` Meta: ${JSON.stringify(error.meta, null, 2)}`)}`);\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats error output as JSON.\n*/\nfunction formatErrorJson(error) {\n\treturn JSON.stringify(error, null, 2);\n}\n//#endregion\n//#region src/utils/glyph-mode.ts\nfunction localeString(env) {\n\treturn env[\"LC_ALL\"] ?? env[\"LC_CTYPE\"] ?? env[\"LANG\"] ?? \"\";\n}\nfunction isUtf8Locale(env) {\n\tconst locale = localeString(env);\n\tif (locale.length === 0) return false;\n\treturn /UTF-8|utf8/i.test(locale);\n}\nfunction detectGlyphMode(input) {\n\tif (!input.isTTY) return \"ascii\";\n\tif (!isUtf8Locale(input.env)) return \"ascii\";\n\treturn \"unicode\";\n}\n//#endregion\n//#region src/utils/shutdown.ts\nfunction createShutdownHandler(options) {\n\tconst exit = options?.exit ?? ((code) => process.exit(code));\n\tconst gracePeriodMs = options?.gracePeriodMs ?? 3e3;\n\tconst controller = new AbortController();\n\tlet shuttingDown = false;\n\tlet graceTimer;\n\tconst onSignal = () => {\n\t\tif (shuttingDown) {\n\t\t\texit(130);\n\t\t\treturn;\n\t\t}\n\t\tshuttingDown = true;\n\t\tcontroller.abort();\n\t\tgraceTimer = setTimeout(() => exit(130), gracePeriodMs);\n\t\tgraceTimer.unref();\n\t};\n\treturn {\n\t\tsignal: controller.signal,\n\t\tisShuttingDown: () => shuttingDown,\n\t\tonSignal,\n\t\tclearGraceTimer: () => {\n\t\t\tif (graceTimer !== void 0) {\n\t\t\t\tclearTimeout(graceTimer);\n\t\t\t\tgraceTimer = void 0;\n\t\t\t}\n\t\t}\n\t};\n}\nconst globalHandler = createShutdownHandler();\n/**\n* The global AbortSignal. Pass this to any async operation that should\n* be cancellable on Ctrl+C (e.g., DB queries, long-running emit).\n*/\nconst shutdownSignal = globalHandler.signal;\n/**\n* Installs SIGINT and SIGTERM handlers. Call once at CLI startup.\n*\n* - First signal: aborts the controller, starts a 3s grace timer.\n* - Second signal: force-exits immediately.\n*/\nlet installed = false;\nfunction installShutdownHandlers() {\n\tif (installed) return;\n\tinstalled = true;\n\tprocess.on(\"SIGINT\", globalHandler.onSignal);\n\tprocess.on(\"SIGTERM\", globalHandler.onSignal);\n}\n//#endregion\n//#region src/utils/terminal-ui.ts\n/**\n* Composable CLI output abstraction.\n*\n* Follows the Unix convention of separating data from decoration:\n* - **stdout** — data output only (`ui.output()`). This is what scripts and pipes capture.\n* - **stderr** — all decoration (spinners, logs, notes, intro/outro). Visible in terminal, invisible in pipes.\n*\n* Rules:\n* 1. All methods except `output()` and `error()` write to stderr only in interactive mode.\n* 2. `output(data)` always writes to stdout — if a command calls it, there is data to emit.\n* 3. `error()` always writes to stderr — errors matter even when piped.\n* 4. Decoration is suppressed when piped unless `--format pretty` was explicit (`forcePretty`).\n* 5. Never write data to stderr — decoration methods are for human context only.\n* 6. Never write decoration to stdout — it breaks pipes, `$(...)` captures, and `> file` redirects.\n*/\nvar TerminalUI = class TerminalUI {\n\t/**\n\t* True when stdout is a TTY (interactive terminal).\n\t* False when piped (e.g., `prisma-next db verify | jq`).\n\t*/\n\tisInteractive;\n\t/**\n\t* Whether color output is enabled.\n\t*/\n\tuseColor;\n\t/**\n\t* When true, decoration methods write even on non-TTY stdout\n\t* (explicit `--format pretty`).\n\t*/\n\tforcePretty;\n\t/**\n\t* Whether stdout is a TTY — used for migration-list graph glyph detection.\n\t*/\n\tstdoutIsTTY;\n\t/**\n\t* Process environment snapshot for locale-aware glyph detection.\n\t*/\n\tenv;\n\tstatic stderrOpts = { output: process.stderr };\n\tconstructor(options) {\n\t\tthis.isInteractive = options?.interactive ?? !!process.stdout.isTTY;\n\t\tthis.forcePretty = options?.forcePretty ?? false;\n\t\tthis.useColor = options?.color ?? (this.isInteractive || this.forcePretty);\n\t\tthis.stdoutIsTTY = options?.stdoutIsTTY ?? !!process.stdout.isTTY;\n\t\tthis.env = options?.env ?? process.env;\n\t}\n\tget isTTY() {\n\t\treturn this.stdoutIsTTY;\n\t}\n\t/**\n\t* Resolve glyph mode for migration list/tree output. `--ascii` forces ASCII;\n\t* otherwise delegates to the pure {@link detectGlyphMode} helper.\n\t*/\n\tresolveGlyphMode(forceAscii) {\n\t\tif (forceAscii) return \"ascii\";\n\t\treturn detectGlyphMode(this.glyphModeInput());\n\t}\n\tglyphModeInput() {\n\t\treturn {\n\t\t\tisTTY: this.stdoutIsTTY,\n\t\t\tenv: this.env\n\t\t};\n\t}\n\tget shouldDecorate() {\n\t\treturn this.isInteractive || this.forcePretty;\n\t}\n\t/**\n\t* Log a message line to stderr. No-op when piped unless forcePretty.\n\t*/\n\tlog(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.message(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a success message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tsuccess(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.success(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a warning message to stderr. No-op when piped unless forcePretty.\n\t*/\n\twarn(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.warn(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log an error message to stderr. Always writes (errors matter even in pipes).\n\t*/\n\terror(message) {\n\t\tclack.log.error(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log an info message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tinfo(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.info(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a step message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tstep(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.step(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display a note box on stderr. No-op when piped unless forcePretty.\n\t*/\n\tnote(message, title) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.note(message, title, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display intro banner on stderr. No-op when piped unless forcePretty.\n\t*/\n\tintro(title) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.intro(title, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display outro banner on stderr. No-op when piped unless forcePretty.\n\t*/\n\toutro(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.outro(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Create a Clack spinner on stderr with a 100ms delay threshold.\n\t* The spinner only appears if the operation takes longer than the threshold,\n\t* avoiding flicker for fast operations. Returns a no-op spinner when not decorating.\n\t*/\n\tspinner(delayMs = 100) {\n\t\tconst noop = {\n\t\t\tstart: () => {},\n\t\t\tstop: () => {},\n\t\t\tcancel: () => {},\n\t\t\terror: () => {},\n\t\t\tmessage: () => {},\n\t\t\tclear: () => {},\n\t\t\tget isCancelled() {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\tif (!this.shouldDecorate) return noop;\n\t\tlet inner;\n\t\tlet timer;\n\t\tlet pendingMsg;\n\t\tlet settled = false;\n\t\tconst ensureCleared = () => {\n\t\t\tif (timer !== void 0) {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = void 0;\n\t\t\t}\n\t\t};\n\t\tconst onAbort = () => {\n\t\t\tif (!settled) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.cancel(\"Interrupted\");\n\t\t\t}\n\t\t};\n\t\tif (!shutdownSignal.aborted) shutdownSignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\treturn {\n\t\t\tstart(msg) {\n\t\t\t\tpendingMsg = msg;\n\t\t\t\ttimer = setTimeout(() => {\n\t\t\t\t\tif (!settled) {\n\t\t\t\t\t\tinner = clack.spinner(TerminalUI.stderrOpts);\n\t\t\t\t\t\tinner.start(pendingMsg);\n\t\t\t\t\t}\n\t\t\t\t}, delayMs);\n\t\t\t},\n\t\t\tstop(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.stop(msg);\n\t\t\t},\n\t\t\tcancel(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.cancel(msg);\n\t\t\t},\n\t\t\terror(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.error(msg);\n\t\t\t},\n\t\t\tmessage(msg) {\n\t\t\t\tpendingMsg = msg;\n\t\t\t\tif (inner) inner.message(msg);\n\t\t\t},\n\t\t\tclear() {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.clear();\n\t\t\t},\n\t\t\tget isCancelled() {\n\t\t\t\treturn inner?.isCancelled ?? false;\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Prompt for yes/no confirmation on stderr. Returns true if confirmed.\n\t* In non-interactive mode or when cancelled (Ctrl-C), returns false.\n\t*/\n\tasync confirm(message) {\n\t\tif (!this.isInteractive) return false;\n\t\tconst result = await clack.confirm({\n\t\t\tmessage,\n\t\t\t...TerminalUI.stderrOpts\n\t\t});\n\t\tif (clack.isCancel(result)) return false;\n\t\treturn result;\n\t}\n\t/**\n\t* Write a raw line to stderr. No-op when piped unless forcePretty.\n\t* Use for decoration that doesn't fit Clack's log format (e.g. styled headers).\n\t*/\n\tstderr(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tprocess.stderr.write(`${message}\\n`);\n\t}\n\t/**\n\t* Write machine-readable data to stdout.\n\t* Always writes — if a command calls output(), there is data to emit.\n\t*\n\t* This is what scripts and pipes capture: `prisma-next db verify --json | jq .ok`\n\t*/\n\toutput(data) {\n\t\tprocess.stdout.write(`${data}\\n`);\n\t}\n\tgreen(text) {\n\t\treturn this.useColor ? green(text) : text;\n\t}\n\tred(text) {\n\t\treturn this.useColor ? red(text) : text;\n\t}\n\tcyan(text) {\n\t\treturn this.useColor ? cyan(text) : text;\n\t}\n\tdim(text) {\n\t\treturn this.useColor ? dim(text) : text;\n\t}\n\tbold(text) {\n\t\treturn this.useColor ? bold(text) : text;\n\t}\n\tyellow(text) {\n\t\treturn this.useColor ? yellow(text) : text;\n\t}\n};\nfunction createTerminalUI(flags, runtime) {\n\treturn new TerminalUI({\n\t\tcolor: flags.color,\n\t\tinteractive: flags.interactive,\n\t\tforcePretty: flags.format === \"pretty\" && flags.explicitFormat,\n\t\tstdoutIsTTY: runtime?.isTTY,\n\t\tenv: runtime?.env\n\t});\n}\n//#endregion\nexport { formatMigrationApplyCommandOutput as a, formatMigrationPlanOutput as c, formatDim as d, isVerbose as f, formatErrorOutput as i, formatMigrationShowOutput as l, installShutdownHandlers as n, formatMigrationApplyOutput as o, formatErrorJson as r, formatMigrationJson as s, createTerminalUI as t, createColorFormatter as u };\n\n//# sourceMappingURL=terminal-ui-ypPE9cN6.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,UAAU,OAAO,OAAO;CAChC,QAAQ,MAAM,WAAW,MAAM;AAChC;;;;;AAKA,SAAS,qBAAqB,UAAU,SAAS;CAChD,OAAO,WAAW,WAAW,SAAS;AACvC;;;;AAIA,SAAS,UAAU,UAAU,MAAM;CAClC,OAAO,WAAW,IAAI,IAAI,IAAI;AAC/B;;;;;;;AASA,SAAS,uBAAuB,MAAM,UAAU;CAC/C,MAAM,UAAU,KAAK,KAAK;CAC1B,IAAI,CAAC,SAAS,OAAO,KAAK;CAC1B,IAAI,aAAa,OAAO,OAAO,QAAQ,SAAS,GAAG,IAAI,UAAU,GAAG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