@prisma/orm-toolchain 8.0.0-rc.1-dev.29 → 8.0.0-rc.1-dev.31

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 (150) hide show
  1. package/dist/{aggregate-BKbHUHLA.mjs → aggregate-BBsCbXgJ.mjs} +8 -8
  2. package/dist/{aggregate-BKbHUHLA.mjs.map → aggregate-BBsCbXgJ.mjs.map} +1 -1
  3. package/dist/bin__prisma-next.mjs +25 -25
  4. package/dist/bin__prisma-next.mjs.map +1 -1
  5. package/dist/cli.mjs +12 -12
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/cli__commands__contract-emit.mjs +1 -1
  8. package/dist/cli__commands__contract-infer.mjs +1 -1
  9. package/dist/cli__commands__db-init.mjs +1 -1
  10. package/dist/cli__commands__db-schema.mjs +1 -1
  11. package/dist/cli__commands__db-sign.mjs +1 -1
  12. package/dist/cli__commands__db-update.mjs +1 -1
  13. package/dist/cli__commands__db-verify.mjs +1 -1
  14. package/dist/cli__commands__migrate.mjs +1 -1
  15. package/dist/cli__commands__migration-check.mjs +1 -1
  16. package/dist/cli__commands__migration-graph.mjs +1 -1
  17. package/dist/cli__commands__migration-list.mjs +1 -1
  18. package/dist/cli__commands__migration-log.mjs +1 -1
  19. package/dist/cli__commands__migration-new.mjs +1 -1
  20. package/dist/cli__commands__migration-plan.mjs +1 -1
  21. package/dist/cli__commands__migration-show.mjs +1 -1
  22. package/dist/cli__commands__migration-status.mjs +1 -1
  23. package/dist/cli__commands__ref.mjs +1 -1
  24. package/dist/cli__commands__telemetry.mjs +1 -1
  25. package/dist/cli__control-api.mjs +15 -15
  26. package/dist/cli__migration-cli.mjs +2 -2
  27. package/dist/{client-DLPcSdv7-Cukdon0q.mjs → client-C4Gh4PBz-BMUlBcuE.mjs} +6 -6
  28. package/dist/{client-DLPcSdv7-Cukdon0q.mjs.map → client-C4Gh4PBz-BMUlBcuE.mjs.map} +1 -1
  29. package/dist/{command-helpers-uzQbbM97-EaL4zWf5.mjs → command-helpers-Dw3LDEu_-B4AETH4D.mjs} +4 -4
  30. package/dist/{command-helpers-uzQbbM97-EaL4zWf5.mjs.map → command-helpers-Dw3LDEu_-B4AETH4D.mjs.map} +1 -1
  31. package/dist/{contract-at-errors-BsQiGdZC-BY8u2is4.mjs → contract-at-errors-BsQiGdZC-D8l9-WWt.mjs} +2 -2
  32. package/dist/{contract-at-errors-BsQiGdZC-BY8u2is4.mjs.map → contract-at-errors-BsQiGdZC-D8l9-WWt.mjs.map} +1 -1
  33. package/dist/{contract-emit-D-vxAjLQ-DjSGIBvi.mjs → contract-emit-CIdgw3Kq-BcfYaUfn.mjs} +4 -4
  34. package/dist/{contract-emit-D-vxAjLQ-DjSGIBvi.mjs.map → contract-emit-CIdgw3Kq-BcfYaUfn.mjs.map} +1 -1
  35. package/dist/{contract-infer-ButdiRXM-9KdWYvza.mjs → contract-infer-xOEwVWds-CE5gw1PF.mjs} +5 -5
  36. package/dist/{contract-infer-ButdiRXM-9KdWYvza.mjs.map → contract-infer-xOEwVWds-CE5gw1PF.mjs.map} +1 -1
  37. package/dist/{contract-snapshot-resolution-RIn-ByLW-BRTjU_01.mjs → contract-snapshot-resolution-BnH6_mw7-BrzAsS93.mjs} +6 -6
  38. package/dist/{contract-snapshot-resolution-RIn-ByLW-BRTjU_01.mjs.map → contract-snapshot-resolution-BnH6_mw7-BrzAsS93.mjs.map} +1 -1
  39. package/dist/{contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs → contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs} +3 -3
  40. package/dist/{contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs.map → contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs.map} +1 -1
  41. package/dist/{contract-space-aggregate-loader-Cd0X2M_C-CFBkD540.mjs → contract-space-aggregate-loader-1wG1OiDk-D75luh5-.mjs} +5 -5
  42. package/dist/{contract-space-aggregate-loader-Cd0X2M_C-CFBkD540.mjs.map → contract-space-aggregate-loader-1wG1OiDk-D75luh5-.mjs.map} +1 -1
  43. package/dist/{db-init-BO7P4kCG-CftJygKc.mjs → db-init-CEk9Utl4-vGmJajwZ.mjs} +6 -6
  44. package/dist/{db-init-BO7P4kCG-CftJygKc.mjs.map → db-init-CEk9Utl4-vGmJajwZ.mjs.map} +1 -1
  45. package/dist/{db-schema-6CB4Rljf-VFKrJ3VO.mjs → db-schema-D_PJvBI3-BTnfCqbX.mjs} +6 -6
  46. package/dist/{db-schema-6CB4Rljf-VFKrJ3VO.mjs.map → db-schema-D_PJvBI3-BTnfCqbX.mjs.map} +1 -1
  47. package/dist/{db-sign-CkX4HXCx-B0mTmQ5a.mjs → db-sign-Bparnnii-Yd5pb4VF.mjs} +7 -7
  48. package/dist/{db-sign-CkX4HXCx-B0mTmQ5a.mjs.map → db-sign-Bparnnii-Yd5pb4VF.mjs.map} +1 -1
  49. package/dist/{db-update-fAeM1XbT-B5XoGE92.mjs → db-update-CsKZyDYp-B8Zl7W4k.mjs} +7 -7
  50. package/dist/{db-update-fAeM1XbT-B5XoGE92.mjs.map → db-update-CsKZyDYp-B8Zl7W4k.mjs.map} +1 -1
  51. package/dist/{db-verify-_flf8M9q-BD-mhGC1.mjs → db-verify-B33E7HXH-D87fiNt3.mjs} +6 -6
  52. package/dist/{db-verify-_flf8M9q-BD-mhGC1.mjs.map → db-verify-B33E7HXH-D87fiNt3.mjs.map} +1 -1
  53. package/dist/{errors-Co-8oaiB-CB-6Uqki.mjs → errors-CXbGUWGu-BQi6YS-H.mjs} +51 -2
  54. package/dist/errors-CXbGUWGu-BQi6YS-H.mjs.map +1 -0
  55. package/dist/{errors-NRmFpwR1.d.mts → errors-KWM8yBAL.d.mts} +3 -1
  56. package/dist/errors-KWM8yBAL.d.mts.map +1 -0
  57. package/dist/{format-DZ7Vowat-CXVeLGp_.mjs → format-CYdgHub4-Cs6VcFje.mjs} +4 -4
  58. package/dist/{format-DZ7Vowat-CXVeLGp_.mjs.map → format-CYdgHub4-Cs6VcFje.mjs.map} +1 -1
  59. package/dist/{graph-membership-BEmNEMtP-rz61CLM5.mjs → graph-membership-BViWUMpP-Cgu4Z2ox.mjs} +3 -3
  60. package/dist/{graph-membership-BEmNEMtP-rz61CLM5.mjs.map → graph-membership-BViWUMpP-Cgu4Z2ox.mjs.map} +1 -1
  61. package/dist/{init-Cej3fMLO-BCRVDzA4.mjs → init-BeZ2ToIf-DF-CGxnO.mjs} +3 -3
  62. package/dist/{init-Cej3fMLO-BCRVDzA4.mjs.map → init-BeZ2ToIf-DF-CGxnO.mjs.map} +1 -1
  63. package/dist/{inspect-live-schema-Do1dDQxw-DBSSeLrX.mjs → inspect-live-schema-BAiaX0n9-DBQFEsMC.mjs} +4 -4
  64. package/dist/{inspect-live-schema-Do1dDQxw-DBSSeLrX.mjs.map → inspect-live-schema-BAiaX0n9-DBQFEsMC.mjs.map} +1 -1
  65. package/dist/{invariants-C1WVUAH7-DlOBTTkM.mjs → invariants-CTHy88OP-DJ-i5yTz.mjs} +3 -3
  66. package/dist/{invariants-C1WVUAH7-DlOBTTkM.mjs.map → invariants-CTHy88OP-DJ-i5yTz.mjs.map} +1 -1
  67. package/dist/{invariants-4d2LkjQL-Ch5J3Rd7.mjs → invariants-CsxL0lbZ-B9Hfpj2R.mjs} +6 -6
  68. package/dist/{invariants-4d2LkjQL-Ch5J3Rd7.mjs.map → invariants-CsxL0lbZ-B9Hfpj2R.mjs.map} +1 -1
  69. package/dist/{io-CHUUeHh0-CbyTkKP6.mjs → io-635GlNx1-D94PxRc-.mjs} +5 -5
  70. package/dist/{io-CHUUeHh0-CbyTkKP6.mjs.map → io-635GlNx1-D94PxRc-.mjs.map} +1 -1
  71. package/dist/{migrate-Bs4Mi3N0-BdbjoiNr.mjs → migrate-DYx_CSbN-BuQ0lk-0.mjs} +12 -12
  72. package/dist/{migrate-Bs4Mi3N0-BdbjoiNr.mjs.map → migrate-DYx_CSbN-BuQ0lk-0.mjs.map} +1 -1
  73. package/dist/{migrate-show-BYZ_NAoY-DCyUeA4P.mjs → migrate-show-CPZEq35I-DeL3WVjs.mjs} +9 -9
  74. package/dist/{migrate-show-BYZ_NAoY-DCyUeA4P.mjs.map → migrate-show-CPZEq35I-DeL3WVjs.mjs.map} +1 -1
  75. package/dist/{migration-check-RlegqnJv-ZUcop5v4.mjs → migration-check-BUAcSrvA-DSS5Yvco.mjs} +9 -9
  76. package/dist/{migration-check-RlegqnJv-ZUcop5v4.mjs.map → migration-check-BUAcSrvA-DSS5Yvco.mjs.map} +1 -1
  77. package/dist/{migration-check-ASAenQ02-B9a5jI8S.mjs → migration-check-D0ABv6pO-BCJRf3lE.mjs} +6 -6
  78. package/dist/{migration-check-ASAenQ02-B9a5jI8S.mjs.map → migration-check-D0ABv6pO-BCJRf3lE.mjs.map} +1 -1
  79. package/dist/{migration-command-scaffold-Bc5j_ehJ-BF4cqm9C.mjs → migration-command-scaffold-CIMPoR6f-Ba-S9gXa.mjs} +4 -4
  80. package/dist/{migration-command-scaffold-Bc5j_ehJ-BF4cqm9C.mjs.map → migration-command-scaffold-CIMPoR6f-Ba-S9gXa.mjs.map} +1 -1
  81. package/dist/{migration-graph-BYRfJ6pm-WucWOxZ8.mjs → migration-graph-BsGstA5L-BQiNbrkP.mjs} +8 -8
  82. package/dist/{migration-graph-BYRfJ6pm-WucWOxZ8.mjs.map → migration-graph-BsGstA5L-BQiNbrkP.mjs.map} +1 -1
  83. package/dist/{migration-graph-BtP1Va3T-CMOZgqVW.mjs → migration-graph-BtP1Va3T-C8PpuaYw.mjs} +2 -2
  84. package/dist/{migration-graph-BtP1Va3T-CMOZgqVW.mjs.map → migration-graph-BtP1Va3T-C8PpuaYw.mjs.map} +1 -1
  85. package/dist/{migration-graph-DDaOHo10-yJFAbKCu.mjs → migration-graph-_SJImD5V-D5RCc651.mjs} +3 -3
  86. package/dist/{migration-graph-DDaOHo10-yJFAbKCu.mjs.map → migration-graph-_SJImD5V-D5RCc651.mjs.map} +1 -1
  87. package/dist/{migration-graph-sections-CceYWPCP-Bz8vmjNZ.mjs → migration-graph-sections-CceYWPCP-LqImOaK1.mjs} +2 -2
  88. package/dist/{migration-graph-sections-CceYWPCP-Bz8vmjNZ.mjs.map → migration-graph-sections-CceYWPCP-LqImOaK1.mjs.map} +1 -1
  89. package/dist/{migration-_C5W2uXF.mjs → migration-gubSSeMk.mjs} +3 -3
  90. package/dist/{migration-_C5W2uXF.mjs.map → migration-gubSSeMk.mjs.map} +1 -1
  91. package/dist/{migration-list-AKRIIovW-Cr39jOaI.mjs → migration-list-AKRIIovW-BN-Zrwk0.mjs} +3 -3
  92. package/dist/{migration-list-AKRIIovW-Cr39jOaI.mjs.map → migration-list-AKRIIovW-BN-Zrwk0.mjs.map} +1 -1
  93. package/dist/{migration-list-ChJ4YC1Y-De7g_D3K.mjs → migration-list-BiVyonwG-CdMbBV5Z.mjs} +6 -6
  94. package/dist/{migration-list-ChJ4YC1Y-De7g_D3K.mjs.map → migration-list-BiVyonwG-CdMbBV5Z.mjs.map} +1 -1
  95. package/dist/{migration-log-W8xgEvD8-sVkmO78U.mjs → migration-log-Z3-L172x-CvQTNJvI.mjs} +5 -5
  96. package/dist/{migration-log-W8xgEvD8-sVkmO78U.mjs.map → migration-log-Z3-L172x-CvQTNJvI.mjs.map} +1 -1
  97. package/dist/{migration-new-BHv-aJzG-Bj7aJDNX.mjs → migration-new-DDnQd7Ql-1WT_J_zf.mjs} +5 -5
  98. package/dist/{migration-new-BHv-aJzG-Bj7aJDNX.mjs.map → migration-new-DDnQd7Ql-1WT_J_zf.mjs.map} +1 -1
  99. package/dist/{migration-new-BGI2g0SC-SUBmaeRN.mjs → migration-new-ZlgxFcbH-CxlZs2hr.mjs} +8 -8
  100. package/dist/{migration-new-BGI2g0SC-SUBmaeRN.mjs.map → migration-new-ZlgxFcbH-CxlZs2hr.mjs.map} +1 -1
  101. package/dist/{migration-plan-31dDf3Wj-_kWI5F9v.mjs → migration-plan-CROSunPS-B66Rh_6T.mjs} +5 -5
  102. package/dist/{migration-plan-31dDf3Wj-_kWI5F9v.mjs.map → migration-plan-CROSunPS-B66Rh_6T.mjs.map} +1 -1
  103. package/dist/{migration-plan-B4ND_Xr3-CXfh2r_I.mjs → migration-plan-DiLJTAep-2B463CwW.mjs} +14 -14
  104. package/dist/{migration-plan-B4ND_Xr3-CXfh2r_I.mjs.map → migration-plan-DiLJTAep-2B463CwW.mjs.map} +1 -1
  105. package/dist/{migration-show-CxT14RTs-Bpfd4_FB.mjs → migration-show-mJD52S2d-DiD-rCBB.mjs} +7 -7
  106. package/dist/{migration-show-CxT14RTs-Bpfd4_FB.mjs.map → migration-show-mJD52S2d-DiD-rCBB.mjs.map} +1 -1
  107. package/dist/{migration-status-gC9RLpz5-3uPzlkh_.mjs → migration-status-Df6EwEun-CbrQHa3S.mjs} +10 -10
  108. package/dist/{migration-status-gC9RLpz5-3uPzlkh_.mjs.map → migration-status-Df6EwEun-CbrQHa3S.mjs.map} +1 -1
  109. package/dist/migration-tools.d.mts +1 -1
  110. package/dist/migration-tools.mjs +12 -12
  111. package/dist/migration-tools__aggregate.mjs +1 -1
  112. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  113. package/dist/migration-tools__errors.d.mts +1 -1
  114. package/dist/migration-tools__errors.mjs +1 -1
  115. package/dist/migration-tools__invariants.mjs +1 -1
  116. package/dist/migration-tools__io.mjs +1 -1
  117. package/dist/migration-tools__migration-graph.mjs +2 -2
  118. package/dist/migration-tools__migration.mjs +1 -1
  119. package/dist/migration-tools__ref-resolution.mjs +1 -1
  120. package/dist/migration-tools__refs.mjs +1 -1
  121. package/dist/migration-tools__spaces.mjs +2 -2
  122. package/dist/{ref-Dmj_cDrl-Cax2R649.mjs → ref-Cycefq_T-DQE5AM66.mjs} +5 -5
  123. package/dist/{ref-Dmj_cDrl-Cax2R649.mjs.map → ref-Cycefq_T-DQE5AM66.mjs.map} +1 -1
  124. package/dist/{ref-CbeIycGH-Da61MuYq.mjs → ref-DftuSibc-CasZ6LgA.mjs} +10 -10
  125. package/dist/{ref-CbeIycGH-Da61MuYq.mjs.map → ref-DftuSibc-CasZ6LgA.mjs.map} +1 -1
  126. package/dist/{ref-advancement-DaZBzm7m-Deq5Cs7O.mjs → ref-advancement-DaZBzm7m-WoqnFAyr.mjs} +4 -4
  127. package/dist/{ref-advancement-DaZBzm7m-Deq5Cs7O.mjs.map → ref-advancement-DaZBzm7m-WoqnFAyr.mjs.map} +1 -1
  128. package/dist/{ref-resolution-Bi4lpxM8-BX-7sl0f.mjs → ref-resolution-Bi4lpxM8-BbfL_yv8.mjs} +2 -2
  129. package/dist/{ref-resolution-Bi4lpxM8-BX-7sl0f.mjs.map → ref-resolution-Bi4lpxM8-BbfL_yv8.mjs.map} +1 -1
  130. package/dist/{ref-resolution-Ct2GMcNB.mjs → ref-resolution-sGcINe7o.mjs} +2 -2
  131. package/dist/{ref-resolution-Ct2GMcNB.mjs.map → ref-resolution-sGcINe7o.mjs.map} +1 -1
  132. package/dist/{refs-B2BL8z3i-DGGFB7Mj.mjs → refs-WK86uYYp-B6EZkmmT.mjs} +19 -3
  133. package/dist/refs-WK86uYYp-B6EZkmmT.mjs.map +1 -0
  134. package/dist/{refs-fQLFcMoq-UTlvnijY.mjs → refs-fQLFcMoq-aTBeUU9H.mjs} +4 -4
  135. package/dist/{refs-fQLFcMoq-UTlvnijY.mjs.map → refs-fQLFcMoq-aTBeUU9H.mjs.map} +1 -1
  136. package/dist/{spaces-DBTCE3Js.mjs → spaces-BG2w0P8d.mjs} +6 -6
  137. package/dist/{spaces-DBTCE3Js.mjs.map → spaces-BG2w0P8d.mjs.map} +1 -1
  138. package/dist/{telemetry-D4LZGV1f-C5BrCb0w.mjs → telemetry-LP1Suxsf-CY1l7lD0.mjs} +4 -4
  139. package/dist/{telemetry-D4LZGV1f-C5BrCb0w.mjs.map → telemetry-LP1Suxsf-CY1l7lD0.mjs.map} +1 -1
  140. package/dist/{terminal-ui-CUZTa2vH-WvAtuIOS.mjs → terminal-ui-JJKxvT0q-CPDEJqqU.mjs} +35 -4
  141. package/dist/terminal-ui-JJKxvT0q-CPDEJqqU.mjs.map +1 -0
  142. package/dist/{verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs → verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs} +4 -4
  143. package/dist/{verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs.map → verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map} +1 -1
  144. package/dist/{verify-DGFra-rl-B5lkrUrV.mjs → verify-wUSBDQwh-Bv3NV9WG.mjs} +3 -3
  145. package/dist/{verify-DGFra-rl-B5lkrUrV.mjs.map → verify-wUSBDQwh-Bv3NV9WG.mjs.map} +1 -1
  146. package/package.json +12 -12
  147. package/dist/errors-Co-8oaiB-CB-6Uqki.mjs.map +0 -1
  148. package/dist/errors-NRmFpwR1.d.mts.map +0 -1
  149. package/dist/refs-B2BL8z3i-DGGFB7Mj.mjs.map +0 -1
  150. package/dist/terminal-ui-CUZTa2vH-WvAtuIOS.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"bin__prisma-next.mjs","names":["isCI"],"sources":["../../../../1-framework/3-tooling/cli/dist/package-BdFVQseM.mjs","../../../../1-framework/3-tooling/cli/dist/code-templates-D_dhXHNG.mjs","../../../../1-framework/3-tooling/cli/dist/cli.mjs"],"sourcesContent":["//#region package.json\nvar version = \"8.0.0-rc.1-dev.29\";\n//#endregion\nexport { version as t };\n\n//# sourceMappingURL=package-BdFVQseM.mjs.map","import { createScaffoldSpecifierResolver } from \"@internal/publish-surface/import-roots\";\nimport { DEFAULT_CONTRACT_SOURCE_DIR } from \"@internal/config/config-types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\n//#region src/commands/init/templates/code-templates.ts\n/**\n* The resolver a scaffold for `target` is written against.\n*\n* A scaffold is always on the facade root: `init` writes an application around\n* one database package, and the workspace names are not published, so a project\n* scaffolded against them could not install (ADR 242). Both the files `init`\n* writes and the dependency it adds go through this, so they cannot disagree.\n*/\nfunction scaffoldSpecifierResolverFor(target) {\n\treturn createScaffoldSpecifierResolver({\n\t\tmode: \"facade\",\n\t\tfacade: target === \"postgres\" ? \"@prisma/orm-postgres\" : \"@prisma/orm-mongo\"\n\t});\n}\n/**\n* The package name a scaffolded project depends on and imports from, for the\n* import root it is being scaffolded against.\n*\n* Every specifier the scaffold writes derives from this one, and `init` builds\n* a single resolver and hands it to both the file templates and the dependency\n* it installs — so the two cannot disagree. The one caller that deliberately\n* does not thread a resolver is the re-init cleanup in `inputs.ts`, which\n* inspects a manifest an earlier run wrote rather than writing one.\n*\n* Resolvers for scaffolding should come from `createScaffoldSpecifierResolver`\n* in the publish-surface package, which rejects the roots a facade-shaped\n* scaffold cannot express. (Named without its scope on purpose: JSDoc survives\n* into the published bundle, where an internal package name would trip the\n* shell tarball checks.)\n*/\nfunction targetPackageName(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\");\n}\n/** One entrypoint of the scaffolded project's target package. */\nfunction targetEntrypoint(target, subpath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(`${target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\"}/${subpath}`);\n}\nfunction targetLabel(target) {\n\treturn target === \"postgres\" ? \"PostgreSQL\" : \"MongoDB\";\n}\nfunction defaultSchemaPath(authoring) {\n\tif (authoring === \"typescript\") return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.ts`;\n\treturn `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.prisma`;\n}\nfunction starterSchema(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? starterSchemaTsMongo(builder) : starterSchemaTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? starterSchemaPslMongo() : starterSchemaPslPostgres();\n}\n/**\n* Renders a short authoring-appropriate schema sample (FR5.1) for embedding\n* in `prisma-next.md`. Returns a complete fenced markdown code block.\n*\n* The sample intentionally shows just one model: it's illustrative, not\n* a substitute for the full scaffolded contract file. The TS samples use\n* the same outer shape as `starterSchemaTs*` (FR5.3) so a user reading\n* the doc and the file side-by-side sees the same structure.\n*/\nfunction schemaSample(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? schemaSampleTsMongo(builder) : schemaSampleTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? schemaSamplePslMongo() : schemaSamplePslPostgres();\n}\nfunction schemaSamplePslPostgres() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n}\n\\`\\`\\``;\n}\nfunction schemaSamplePslMongo() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n @@map(\"users\")\n}\n\\`\\`\\``;\n}\nfunction schemaSampleTsPostgres(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction schemaSampleTsMongo(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction starterSchemaPslPostgres() {\n\treturn `// use prisma-next\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n posts Post[]\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId Int\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n`;\n}\nfunction starterSchemaPslMongo() {\n\treturn `// use prisma-next\n\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n posts Post[]\n @@map(\"users\")\n}\n\nmodel Post {\n id ObjectId @id @map(\"_id\")\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId ObjectId\n @@map(\"posts\")\n}\n`;\n}\nfunction starterSchemaTsPostgres(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n posts: rel.hasMany('Post', { by: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n fields: {\n id: field.id.uuidv7String(),\n title: field.text(),\n content: field.text().optional(),\n authorId: field.uuidString(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: 'id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction starterSchemaTsMongo(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n relations: {\n posts: rel.hasMany('Post', { from: '_id', to: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n collection: 'posts',\n fields: {\n _id: field.objectId(),\n title: field.string(),\n content: field.string().optional(),\n authorId: field.objectId(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: '_id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction configFile(target, contractPath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn `import 'dotenv/config';\nimport { defineConfig } from '${targetEntrypoint(target, \"config\", resolveImportSpecifier)}';\n\nexport default defineConfig({\n contract: ${JSON.stringify(contractPath)},\n db: {\n connection: process.env['DATABASE_URL']!,\n },\n});\n`;\n}\nfunction dbFile(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst runtime = targetEntrypoint(target, \"runtime\", resolveImportSpecifier);\n\tif (target === \"postgres\") return `import postgres from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = postgres<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n\treturn `import mongo from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = mongo<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n}\n//#endregion\nexport { schemaSample as a, targetLabel as c, scaffoldSpecifierResolverFor as i, targetPackageName as l, dbFile as n, starterSchema as o, defaultSchemaPath as r, targetEntrypoint as s, configFile as t };\n\n//# sourceMappingURL=code-templates-D_dhXHNG.mjs.map","#!/usr/bin/env node\nimport { t as version } from \"./package-BdFVQseM.mjs\";\nimport { n as installShutdownHandlers } from \"./terminal-ui-CUZTa2vH.mjs\";\nimport { _ as parseGlobalFlagsOrExit, b as formatCommandHelp, d as setCommandExamples, g as parseGlobalFlags, h as deriveCanPrompt, t as addGlobalOptions, u as setCommandDescriptions, x as formatRootHelp, y as isCI } from \"./command-helpers-uzQbbM97.mjs\";\nimport { t as createContractEmitCommand } from \"./contract-emit-D-vxAjLQ.mjs\";\nimport { t as createContractInferCommand } from \"./contract-infer-ButdiRXM.mjs\";\nimport { r as defaultSchemaPath } from \"./code-templates-D_dhXHNG.mjs\";\nimport { t as createDbInitCommand } from \"./db-init-BO7P4kCG.mjs\";\nimport { t as createDbSchemaCommand } from \"./db-schema-6CB4Rljf.mjs\";\nimport { t as createDbSignCommand } from \"./db-sign-CkX4HXCx.mjs\";\nimport { t as createDbUpdateCommand } from \"./db-update-fAeM1XbT.mjs\";\nimport { t as createDbVerifyCommand } from \"./db-verify-_flf8M9q.mjs\";\nimport { t as createFormatCommand } from \"./format-DZ7Vowat.mjs\";\nimport { t as createMigrateCommand } from \"./migrate-Bs4Mi3N0.mjs\";\nimport { t as createMigrationCheckCommand } from \"./migration-check-ASAenQ02.mjs\";\nimport { t as createMigrationGraphCommand } from \"./migration-graph-BYRfJ6pm.mjs\";\nimport { t as createMigrationListCommand } from \"./migration-list-ChJ4YC1Y.mjs\";\nimport { t as createMigrationLogCommand } from \"./migration-log-W8xgEvD8.mjs\";\nimport { t as createMigrationNewCommand } from \"./migration-new-BHv-aJzG.mjs\";\nimport { t as createMigrationPlanCommand } from \"./migration-plan-31dDf3Wj.mjs\";\nimport { t as createMigrationShowCommand } from \"./migration-show-CxT14RTs.mjs\";\nimport { r as createMigrationStatusCommand } from \"./migration-status-gC9RLpz5.mjs\";\nimport { t as createRefCommand } from \"./ref-Dmj_cDrl.mjs\";\nimport { t as createTelemetryCommand } from \"./telemetry-D4LZGV1f.mjs\";\nimport { Command } from \"commander\";\nimport { ensureInstallationId, readUserConfig, resolveGating, runTelemetry, userConfigPath } from \"@internal/cli-telemetry\";\nimport { distance } from \"closest-match\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/commands/init/index.ts\nfunction createInitCommand() {\n\tconst command = new Command(\"init\");\n\tsetCommandDescriptions(command, \"Initialize a new Prisma Next project\", `Scaffolds config, schema, and runtime files, installs dependencies,\nand emits the contract. Gets you from zero to typed queries in one step.\n\nRun interactively for a guided experience, or supply --target / --authoring\nand --yes for a fully scriptable run (CI, AI coding agents, automation).\n\nExit codes (see CLI Style Guide § Exit Codes):\n 0 OK Init succeeded.\\n 1 INTERNAL_ERROR Unexpected bug in prisma-next (please report).\\n 2 PRECONDITION Bad flags / missing prerequisite (e.g. no package.json).\\n 3 USER_ABORTED User cancelled an interactive prompt.\\n 4 INSTALL_FAILED Dependency installation failed (init-specific).\\n 5 EMIT_FAILED \\`contract emit\\` failed after install (init-specific).\\n 6 SKILL_INSTALL_FAILED Agent-skill install failed (re-run with --no-skill to skip).`);\n\tsetCommandExamples(command, [\n\t\t\"prisma-next init\",\n\t\t\"prisma-next init --yes --target postgres --authoring psl\",\n\t\t\"prisma-next init --yes --target mongodb --authoring typescript --json\",\n\t\t\"prisma-next init --yes --force --target postgres --authoring psl # overwrite an existing scaffold\",\n\t\t\"prisma-next init --no-install # skip pnpm/npm install + emit\",\n\t\t\"prisma-next init --no-skill # skip the skills install (air-gapped / restricted env)\"\n\t]);\n\treturn addGlobalOptions(command).option(\"--target <db>\", \"Database target: postgres or mongodb\").option(\"--authoring <style>\", \"Schema authoring style: psl or typescript\").option(\"--schema-path <path>\", `Where to write the starter schema (default: ${defaultSchemaPath(\"psl\")})`).option(\"--force\", \"Overwrite an existing scaffold without prompting\").option(\"--write-env\", \"Write a .env file from .env.example (gitignored; default: only .env.example)\").option(\"--probe-db\", \"Connect to DATABASE_URL once and check the server version against the target minimum (opt-in; off by default)\").option(\"--strict-probe\", \"Treat a failed --probe-db as fatal (no-op without --probe-db; init is offline-by-default)\").option(\"--no-install\", \"Skip dependency installation and contract emission\").option(\"--no-skill\", \"Skip Prisma Next skills install (air-gapped CI, restricted registries, etc.)\").action(async (options) => {\n\t\tconst { runInit } = await import(\"./init-Cej3fMLO.mjs\");\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst canPrompt = deriveCanPrompt({\n\t\t\tflagsInteractive: flags.interactive,\n\t\t\toptionInteractive: options.interactive,\n\t\t\tstdinIsTTY: Boolean(process.stdin.isTTY)\n\t\t});\n\t\tconst exitCode = await runInit(process.cwd(), {\n\t\t\toptions,\n\t\t\tflags,\n\t\t\tcanPrompt\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n}\n//#endregion\n//#region src/commands/lsp.ts\nfunction createLspCommand() {\n\tconst command = new Command(\"lsp\");\n\tsetCommandDescriptions(command, \"Start the Prisma Next language server\", \"Launches a Language Server Protocol server that publishes PSL parse diagnostics\\nand handles whole-document PSL formatting for the schema inputs declared in\\nyour config (contract.source.inputs). Formatting uses the Prisma Next PSL\\nformatter and the formatter block from the project config.\\nCommunicates over stdio; intended to be spawned by an\\neditor, not run interactively. The server keeps running until the editor client\\ndisconnects.\");\n\tsetCommandExamples(command, [\"prisma-next lsp --stdio\"]);\n\taddGlobalOptions(command).option(\"--stdio\", \"Communicate with the editor over stdio (the default and only transport)\").action(async () => {\n\t\tconst { startServer } = await import(\"@internal/language-server\");\n\t\tstartServer();\n\t});\n\treturn command;\n}\n//#endregion\n//#region src/utils/suggest-command.ts\n/**\n* Suggests similar command names for a mistyped input.\n*\n* Uses Levenshtein distance to find close matches. Only suggests commands\n* within a reasonable distance threshold (40% of the input length, minimum 2).\n* Returns up to 3 suggestions in case of ties.\n*\n* @returns Array of suggested command names (empty if nothing is close enough).\n*/\nfunction suggestCommands(input, candidates) {\n\tif (candidates.length === 0) return [];\n\tconst maxDistance = Math.max(2, Math.ceil(input.length * .4));\n\tconst scored = candidates.map((name) => ({\n\t\tname,\n\t\tdist: distance(input, name)\n\t})).filter((entry) => entry.dist <= maxDistance).sort((a, b) => a.dist - b.dist);\n\tif (scored.length === 0) return [];\n\tconst bestDist = scored[0].dist;\n\treturn scored.filter((entry) => entry.dist === bestDist).slice(0, 3).map((entry) => entry.name);\n}\n//#endregion\n//#region src/utils/telemetry.ts\n/**\n* Resolve the commander command path from a leaf `Command`, walking up\n* the parent chain. Result is rooted at the program name and ends at\n* the leaf — `['prisma-next', 'migration', 'new']` for\n* `prisma-next migration new …`.\n*/\nfunction commandPathFor(actionCommand) {\n\tconst path = [];\n\tlet cursor = actionCommand;\n\twhile (cursor !== null) {\n\t\tpath.unshift(cursor.name());\n\t\tcursor = cursor.parent;\n\t}\n\treturn path;\n}\nfunction commanderOptionSnapshots(actionCommand) {\n\treturn actionCommand.options.map((option) => {\n\t\tconst attributeName = option.attributeName();\n\t\treturn {\n\t\t\tattributeName,\n\t\t\tlongName: option.long ?? null,\n\t\t\tsource: actionCommand.getOptionValueSource(attributeName) ?? null\n\t\t};\n\t});\n}\n/**\n* Project commander's leaf `Command` into the wire-shape snapshot the\n* telemetry sanitiser consumes. Pure projection — no env, no I/O.\n*/\nfunction commanderSnapshotForTelemetry(actionCommand) {\n\treturn {\n\t\tcommandPath: commandPathFor(actionCommand),\n\t\tpositionalArgs: actionCommand.args,\n\t\toptions: commanderOptionSnapshots(actionCommand)\n\t};\n}\nfunction resolveTelemetryGate() {\n\tif (isCI()) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"ci\"\n\t\t}\n\t};\n\tconst userConfig = readUserConfig();\n\tif (!resolveGating({\n\t\tenv: process.env,\n\t\tconfig: userConfig\n\t}).enabled) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"gated-off\"\n\t\t}\n\t};\n\treturn {\n\t\tenabled: true,\n\t\tuserConfig\n\t};\n}\n/**\n* Path to the compiled sender script inside `@internal/cli-telemetry`'s\n* `dist/`. Resolved off this module's `import.meta.url` via the package\n* specifier `@internal/cli-telemetry/sender`, so the consumer pays\n* no attention to internal package layout.\n*/\nfunction senderPath() {\n\treturn fileURLToPath(new URL(import.meta.resolve(\"@internal/cli-telemetry/sender\")));\n}\nfunction fireTelemetry(actionCommand, userConfig) {\n\treturn runTelemetry({\n\t\tcommand: commanderSnapshotForTelemetry(actionCommand),\n\t\tversion,\n\t\tprojectRoot: process.cwd(),\n\t\tsenderPath: senderPath(),\n\t\tisCI: isCI(),\n\t\tenv: process.env,\n\t\tuserConfig\n\t});\n}\n/**\n* preAction-stage entry point. Synchronous by construction: resolve\n* env/CI/user-consent gates (cheap, all in-memory and a single tiny\n* user-config read), then — only when enabled — `fork()` the detached\n* sender script. The forked child loads `prisma-next.config.*` via\n* c12 on its own (see `loadProjectConfig` in cli-telemetry); the\n* parent does no project-config I/O on the command's hot path.\n*\n* Privacy invariant: gate resolution always happens before any project\n* config touches disk. The child loading user TS code is acceptable\n* only because it's gated behind the same resolved-enabled signal.\n*/\n/**\n* Builds the one-time first-run disclosure. The resolved absolute path to\n* the user-level config file is substituted in so the user can see exactly\n* which file to edit (it must not be confused with `prisma-next.config.ts`).\n* `prisma-next telemetry disable` is named as the primary, friendliest\n* opt-out, alongside the env vars and the config edit.\n*/\nfunction firstRunNotice(configPath) {\n\treturn [\n\t\t\"Prisma Next collects anonymous CLI usage data, enabled by default.\",\n\t\t\"What's collected and why: https://prisma-next.dev/docs/cli/telemetry.\",\n\t\t\"Opt out: run \\\"prisma-next telemetry disable\\\", set DO_NOT_TRACK=1 or\",\n\t\t`PRISMA_NEXT_DISABLE_TELEMETRY=1, or set \"enableTelemetry\": false in ${configPath}.`\n\t].join(\" \");\n}\n/**\n* Best-effort first-run disclosure + installationId mint. Runs only on the\n* gating-enabled path. Prints the notice to stderr (never stdout) and mints\n* a persistent id without touching `enableTelemetry`, so the opt-out default\n* stays intact and no unasked-for consent is recorded.\n*\n* Every step is wrapped so an un-writable config dir (or any other failure)\n* never throws and never blocks the command. Returns the minted (or\n* pre-existing) id so the caller can forward it to `runTelemetry` without a\n* redundant disk read. On mint failure it returns `undefined`: the notice may\n* reprint next run, and `runTelemetry` no-ops on the missing id.\n*/\nfunction discloseAndMintOnFirstRun() {\n\ttry {\n\t\tprocess.stderr.write(`${firstRunNotice(userConfigPath())}\\n`);\n\t} catch {}\n\ttry {\n\t\treturn ensureInstallationId();\n\t} catch {}\n}\n/**\n* True when the run is the `telemetry` command (or one of its\n* subcommands). The usage-telemetry preAction fire is exempted for it:\n* it would be absurd for `telemetry disable` to send a usage event before\n* disabling, or for `telemetry status` to mint an id + send while merely\n* reporting state. This is the only command-specific exemption.\n*\n* The check is rooted at the program: the path must be\n* `['prisma-next', 'telemetry', …]`, so it matches the top-level\n* `telemetry` command and its subcommands without matching a hypothetical\n* nested `… telemetry` elsewhere.\n*/\nfunction isTelemetryCommand(actionCommand) {\n\treturn commandPathFor(actionCommand)[1] === \"telemetry\";\n}\nfunction fireTelemetryFromPreAction(actionCommand) {\n\tif (isTelemetryCommand(actionCommand)) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst gate = resolveTelemetryGate();\n\tif (!gate.enabled) return gate.outcome;\n\tconst storedId = gate.userConfig.installationId;\n\tif (typeof storedId !== \"string\" || storedId.length === 0) {\n\t\tconst installationId = discloseAndMintOnFirstRun();\n\t\treturn fireTelemetry(actionCommand, installationId === void 0 ? gate.userConfig : {\n\t\t\t...gate.userConfig,\n\t\t\tinstallationId\n\t\t});\n\t}\n\treturn fireTelemetry(actionCommand, gate.userConfig);\n}\n//#endregion\n//#region src/cli.ts\ninstallShutdownHandlers();\n/**\n* Lookup table mapping removed subcommands to their replacement verbs.\n* Keyed by `<parent>:<subcommand>` (e.g. `migration:apply`).\n* The handler consults this before falling back to the fuzzy suggest engine.\n*/\nconst removedVerbRedirects = {\n\t\"migration:apply\": \"Use `prisma-next migrate --to <contract>` instead.\",\n\t\"migration:ref\": \"Use `prisma-next ref set|list|delete` instead.\"\n};\n/**\n* Removed flags on specific subcommands. Keyed by `<parent>:<sub>:<flag>`.\n* Checked during the pre-parse argv scan before commander sees the flags.\n*/\nconst removedFlagRedirects = {\n\t\"migration:status:graph\": \"Use `prisma-next migration graph` to view the migration graph.\",\n\t\"migration:status:all\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:limit\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:ref\": \"Use `--to <contract>` instead of `--ref`.\"\n};\n/**\n* Formats the \"Did you mean ...?\" hint for an unknown command.\n*/\nfunction formatSuggestion(input, candidates) {\n\tconst suggestions = suggestCommands(input, candidates.map((c) => c));\n\tif (suggestions.length === 0) return \"\";\n\tif (suggestions.length === 1) return `\\nDid you mean ${suggestions[0]}?\\n`;\n\treturn `\\nDid you mean one of these?\\n${suggestions.map((s) => ` ${s}`).join(\"\\n\")}\\n`;\n}\nconst program = new Command();\nprogram.name(\"prisma-next\").description(\"Prisma Next CLI\").version(version);\nprogram.hook(\"preAction\", (_thisCommand, actionCommand) => {\n\ttry {\n\t\tfireTelemetryFromPreAction(actionCommand);\n\t} catch {}\n});\nconst versionOption = program.options.find((opt) => opt.flags.includes(\"--version\"));\nif (versionOption) versionOption.description = \"Output the version number\";\nprogram.configureOutput({\n\twriteErr: () => {},\n\twriteOut: (str) => {\n\t\tprocess.stdout.write(str);\n\t}\n});\nconst rootHelpFormatter = (cmd) => {\n\treturn formatRootHelp({\n\t\tprogram: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n};\nprogram.configureHelp({\n\tformatHelp: rootHelpFormatter,\n\tsubcommandDescription: () => \"\"\n});\nprogram.exitOverride((err) => {\n\tif (err) {\n\t\tconst errorCode = err.code;\n\t\tconst errorMessage = String(err.message ?? \"\");\n\t\tconst errorName = err.name ?? \"\";\n\t\tif (errorCode === \"commander.unknownCommand\" || errorCode === \"commander.unknownArgument\" || errorName === \"CommanderError\" && (errorMessage.includes(\"unknown command\") || errorMessage.includes(\"unknown argument\"))) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst match = errorMessage.match(/unknown command ['\"]([^'\"]+)['\"]/);\n\t\t\tconst commandName = match ? match[1] : process.argv[3] || process.argv[2] || \"unknown\";\n\t\t\tconst firstArg = process.argv[2];\n\t\t\tconst parentCommand = firstArg ? program.commands.find((cmd) => cmd.name() === firstArg) : void 0;\n\t\t\tif (parentCommand && commandName !== firstArg) {\n\t\t\t\tconst subNames = parentCommand.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, subNames)}\\n`);\n\t\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\t\tcommand: parentCommand,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t} else {\n\t\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\t\tconst helpText = formatRootHelp({\n\t\t\t\t\tprogram,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t}\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.help\" || errorCode === \"commander.helpDisplayed\" || errorCode === \"outputHelp\" || errorMessage === \"(outputHelp)\" || errorMessage.includes(\"outputHelp\") || errorName === \"CommanderError\" && errorMessage.includes(\"outputHelp\")) {\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.missingArgument\" || errorCode === \"commander.missingMandatoryOptionValue\" || errorName === \"CommanderError\" && (errorMessage.includes(\"missing\") || errorMessage.includes(\"required\"))) {\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tprocess.stderr.write(`Unhandled error: ${err.message}\\n`);\n\t\tif (err.stack) process.stderr.write(`${err.stack}\\n`);\n\t\tprocess.exit(1);\n\t}\n\tprocess.exit(0);\n});\nconst contractCommand = new Command(\"contract\");\nsetCommandDescriptions(contractCommand, \"Contract management commands\", \"Define and emit your application data contract. The contract describes your schema as a\\ndeclarative data structure that can be signed and verified against your database.\");\ncontractCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst contractEmitCommand = createContractEmitCommand();\ncontractCommand.addCommand(contractEmitCommand);\nconst contractInferCommand = createContractInferCommand();\ncontractCommand.addCommand(contractInferCommand);\nconst dbCommand = new Command(\"db\");\nsetCommandDescriptions(dbCommand, \"Database management commands\", \"Verify and sign your database with your contract. Ensure your database schema matches\\nyour contract, and sign it to record the contract hash for future verification.\");\ndbCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst dbVerifyCommand = createDbVerifyCommand();\ndbCommand.addCommand(dbVerifyCommand);\nconst dbInitCommand = createDbInitCommand();\ndbCommand.addCommand(dbInitCommand);\nconst dbUpdateCommand = createDbUpdateCommand();\ndbCommand.addCommand(dbUpdateCommand);\nconst dbSchemaCommand = createDbSchemaCommand();\ndbCommand.addCommand(dbSchemaCommand);\nconst dbSignCommand = createDbSignCommand();\ndbCommand.addCommand(dbSignCommand);\nconst migrationCommand = new Command(\"migration\");\nsetCommandDescriptions(migrationCommand, \"On-disk migration management commands\", \"Plan, apply, and scaffold on-disk migration packages. Migrations are\\ncontract-to-contract edges stored as versioned directories under migrations/.\");\nmigrationCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst migrationPlanCommand = createMigrationPlanCommand();\nmigrationCommand.addCommand(migrationPlanCommand);\nconst migrationNewCommand = createMigrationNewCommand();\nmigrationCommand.addCommand(migrationNewCommand);\nconst migrationShowCommand = createMigrationShowCommand();\nmigrationCommand.addCommand(migrationShowCommand);\nconst migrationStatusCommand = createMigrationStatusCommand();\nmigrationCommand.addCommand(migrationStatusCommand);\nconst migrationLogCommand = createMigrationLogCommand();\nmigrationCommand.addCommand(migrationLogCommand);\nconst migrationListCommand = createMigrationListCommand();\nmigrationCommand.addCommand(migrationListCommand);\nconst migrationGraphCommand = createMigrationGraphCommand();\nmigrationCommand.addCommand(migrationGraphCommand);\nconst migrationCheckCommand = createMigrationCheckCommand();\nmigrationCommand.addCommand(migrationCheckCommand);\nconst migrateCommand = createMigrateCommand();\nconst refCommand = createRefCommand();\nconst telemetryCommand = createTelemetryCommand();\nconst initCommand = createInitCommand();\nconst formatCommand = createFormatCommand();\nconst lspCommand = createLspCommand();\nprogram.addCommand(initCommand);\nprogram.addCommand(migrateCommand);\nprogram.addCommand(formatCommand);\nprogram.addCommand(lspCommand);\nprogram.addCommand(contractCommand);\nprogram.addCommand(dbCommand);\nprogram.addCommand(migrationCommand);\nprogram.addCommand(refCommand);\nprogram.addCommand(telemetryCommand);\nconst TELEMETRY_CRASH_TEST_SLEEP_MS = 200;\nif (process.env[\"PRISMA_NEXT_ENABLE_TEST_COMMANDS\"] === \"1\") {\n\tconst telemetryCrashTestCommand = new Command(\"__telemetry-crash-test\").description(\"Internal: deliberately throw for the telemetry e2e suite.\").action(async () => {\n\t\tawait new Promise((settle) => setTimeout(settle, TELEMETRY_CRASH_TEST_SLEEP_MS));\n\t\tthrow new Error(\"__telemetry-crash-test: intentional crash for e2e coverage\");\n\t});\n\ttelemetryCrashTestCommand.configureHelp({ visibleCommands: () => [] });\n\tprogram.addCommand(telemetryCrashTestCommand, { hidden: true });\n}\nconst helpCommand = new Command(\"help\").description(\"Show usage instructions\").configureHelp({ formatHelp: (cmd) => {\n\treturn formatCommandHelp({\n\t\tcommand: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n} }).action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stdout.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nprogram.addCommand(helpCommand);\nprogram.action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stderr.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nconst args = process.argv.slice(2);\nif (args.length > 0) {\n\tconst commandName = args[0];\n\tif (commandName === \"--version\" || commandName === \"-V\") {\n\t\tprocess.stdout.write(`${program.version()}\\n`);\n\t\tprocess.exit(0);\n\t}\n\tif (!(commandName === \"--help\" || commandName === \"-h\")) {\n\t\tconst command = program.commands.find((cmd) => cmd.name() === commandName);\n\t\tif (!command) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\tconst helpText = formatRootHelp({\n\t\t\t\tprogram,\n\t\t\t\tflags\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(2);\n\t\t} else if (command.commands.length > 0 && args.length >= 2) {\n\t\t\tconst subcommandName = args[1];\n\t\t\tconst redirect = removedVerbRedirects[`${commandName}:${subcommandName}`];\n\t\t\tif (redirect) {\n\t\t\t\tprocess.stderr.write(`Unknown command: ${subcommandName}\\n${redirect}\\n`);\n\t\t\t\tprocess.exit(2);\n\t\t\t}\n\t\t\tfor (let i = 2; i < args.length; i++) {\n\t\t\t\tconst arg = args[i];\n\t\t\t\tif (!arg.startsWith(\"--\")) continue;\n\t\t\t\tconst flagRedirect = removedFlagRedirects[`${commandName}:${subcommandName}:${arg.slice(2)}`];\n\t\t\t\tif (flagRedirect) {\n\t\t\t\t\tprocess.stderr.write(`Unknown option: ${arg}\\n${flagRedirect}\\n`);\n\t\t\t\t\tprocess.exit(2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (command.commands.length > 0 && args.length === 1) {\n\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\tcommand,\n\t\t\t\tflags: parseGlobalFlags({})\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(0);\n\t\t}\n\t}\n}\nprogram.parse();\n//#endregion\nexport {};\n\n//# sourceMapp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AQ,KAAK,CAAC;IACf;GACD;EACD;EACA,IAAI,QAAQ,SAAS,SAAS,KAAK,KAAK,WAAW,GAAG;GACrD,MAAM,WAAW,kBAAkB;IAClC;IACA,OAAO,iBAAiB,CAAC,CAAC;GAC3B,CAAC;GACD,QAAQ,OAAO,MAAM,GAAG,SAAS,GAAG;GACpC,QAAQ,KAAK,CAAC;EACf;CACD;AACD;AACA,QAAQ,MAAM"}
1
+ {"version":3,"file":"bin__prisma-next.mjs","names":["isCI"],"sources":["../../../../1-framework/3-tooling/cli/dist/package-D2F5YrZ7.mjs","../../../../1-framework/3-tooling/cli/dist/code-templates-D_dhXHNG.mjs","../../../../1-framework/3-tooling/cli/dist/cli.mjs"],"sourcesContent":["//#region package.json\nvar version = \"8.0.0-rc.1-dev.31\";\n//#endregion\nexport { version as t };\n\n//# sourceMappingURL=package-D2F5YrZ7.mjs.map","import { createScaffoldSpecifierResolver } from \"@internal/publish-surface/import-roots\";\nimport { DEFAULT_CONTRACT_SOURCE_DIR } from \"@internal/config/config-types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\n//#region src/commands/init/templates/code-templates.ts\n/**\n* The resolver a scaffold for `target` is written against.\n*\n* A scaffold is always on the facade root: `init` writes an application around\n* one database package, and the workspace names are not published, so a project\n* scaffolded against them could not install (ADR 242). Both the files `init`\n* writes and the dependency it adds go through this, so they cannot disagree.\n*/\nfunction scaffoldSpecifierResolverFor(target) {\n\treturn createScaffoldSpecifierResolver({\n\t\tmode: \"facade\",\n\t\tfacade: target === \"postgres\" ? \"@prisma/orm-postgres\" : \"@prisma/orm-mongo\"\n\t});\n}\n/**\n* The package name a scaffolded project depends on and imports from, for the\n* import root it is being scaffolded against.\n*\n* Every specifier the scaffold writes derives from this one, and `init` builds\n* a single resolver and hands it to both the file templates and the dependency\n* it installs — so the two cannot disagree. The one caller that deliberately\n* does not thread a resolver is the re-init cleanup in `inputs.ts`, which\n* inspects a manifest an earlier run wrote rather than writing one.\n*\n* Resolvers for scaffolding should come from `createScaffoldSpecifierResolver`\n* in the publish-surface package, which rejects the roots a facade-shaped\n* scaffold cannot express. (Named without its scope on purpose: JSDoc survives\n* into the published bundle, where an internal package name would trip the\n* shell tarball checks.)\n*/\nfunction targetPackageName(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\");\n}\n/** One entrypoint of the scaffolded project's target package. */\nfunction targetEntrypoint(target, subpath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(`${target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\"}/${subpath}`);\n}\nfunction targetLabel(target) {\n\treturn target === \"postgres\" ? \"PostgreSQL\" : \"MongoDB\";\n}\nfunction defaultSchemaPath(authoring) {\n\tif (authoring === \"typescript\") return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.ts`;\n\treturn `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.prisma`;\n}\nfunction starterSchema(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? starterSchemaTsMongo(builder) : starterSchemaTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? starterSchemaPslMongo() : starterSchemaPslPostgres();\n}\n/**\n* Renders a short authoring-appropriate schema sample (FR5.1) for embedding\n* in `prisma-next.md`. Returns a complete fenced markdown code block.\n*\n* The sample intentionally shows just one model: it's illustrative, not\n* a substitute for the full scaffolded contract file. The TS samples use\n* the same outer shape as `starterSchemaTs*` (FR5.3) so a user reading\n* the doc and the file side-by-side sees the same structure.\n*/\nfunction schemaSample(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? schemaSampleTsMongo(builder) : schemaSampleTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? schemaSamplePslMongo() : schemaSamplePslPostgres();\n}\nfunction schemaSamplePslPostgres() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n}\n\\`\\`\\``;\n}\nfunction schemaSamplePslMongo() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n @@map(\"users\")\n}\n\\`\\`\\``;\n}\nfunction schemaSampleTsPostgres(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction schemaSampleTsMongo(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction starterSchemaPslPostgres() {\n\treturn `// use prisma-next\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n posts Post[]\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId Int\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n`;\n}\nfunction starterSchemaPslMongo() {\n\treturn `// use prisma-next\n\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n posts Post[]\n @@map(\"users\")\n}\n\nmodel Post {\n id ObjectId @id @map(\"_id\")\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId ObjectId\n @@map(\"posts\")\n}\n`;\n}\nfunction starterSchemaTsPostgres(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n posts: rel.hasMany('Post', { by: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n fields: {\n id: field.id.uuidv7String(),\n title: field.text(),\n content: field.text().optional(),\n authorId: field.uuidString(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: 'id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction starterSchemaTsMongo(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n relations: {\n posts: rel.hasMany('Post', { from: '_id', to: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n collection: 'posts',\n fields: {\n _id: field.objectId(),\n title: field.string(),\n content: field.string().optional(),\n authorId: field.objectId(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: '_id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction configFile(target, contractPath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn `import 'dotenv/config';\nimport { defineConfig } from '${targetEntrypoint(target, \"config\", resolveImportSpecifier)}';\n\nexport default defineConfig({\n contract: ${JSON.stringify(contractPath)},\n db: {\n connection: process.env['DATABASE_URL']!,\n },\n});\n`;\n}\nfunction dbFile(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst runtime = targetEntrypoint(target, \"runtime\", resolveImportSpecifier);\n\tif (target === \"postgres\") return `import postgres from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = postgres<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n\treturn `import mongo from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = mongo<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n}\n//#endregion\nexport { schemaSample as a, targetLabel as c, scaffoldSpecifierResolverFor as i, targetPackageName as l, dbFile as n, starterSchema as o, defaultSchemaPath as r, targetEntrypoint as s, configFile as t };\n\n//# sourceMappingURL=code-templates-D_dhXHNG.mjs.map","#!/usr/bin/env node\nimport { t as version } from \"./package-D2F5YrZ7.mjs\";\nimport { d as BIN_NAME, n as installShutdownHandlers } from \"./terminal-ui-JJKxvT0q.mjs\";\nimport { _ as parseGlobalFlagsOrExit, b as formatCommandHelp, d as setCommandExamples, g as parseGlobalFlags, h as deriveCanPrompt, t as addGlobalOptions, u as setCommandDescriptions, x as formatRootHelp, y as isCI } from \"./command-helpers-Dw3LDEu_.mjs\";\nimport { t as createContractEmitCommand } from \"./contract-emit-CIdgw3Kq.mjs\";\nimport { t as createContractInferCommand } from \"./contract-infer-xOEwVWds.mjs\";\nimport { r as defaultSchemaPath } from \"./code-templates-D_dhXHNG.mjs\";\nimport { t as createDbInitCommand } from \"./db-init-CEk9Utl4.mjs\";\nimport { t as createDbSchemaCommand } from \"./db-schema-D_PJvBI3.mjs\";\nimport { t as createDbSignCommand } from \"./db-sign-Bparnnii.mjs\";\nimport { t as createDbUpdateCommand } from \"./db-update-CsKZyDYp.mjs\";\nimport { t as createDbVerifyCommand } from \"./db-verify-B33E7HXH.mjs\";\nimport { t as createFormatCommand } from \"./format-CYdgHub4.mjs\";\nimport { t as createMigrateCommand } from \"./migrate-DYx_CSbN.mjs\";\nimport { t as createMigrationCheckCommand } from \"./migration-check-D0ABv6pO.mjs\";\nimport { t as createMigrationGraphCommand } from \"./migration-graph-BsGstA5L.mjs\";\nimport { t as createMigrationListCommand } from \"./migration-list-BiVyonwG.mjs\";\nimport { t as createMigrationLogCommand } from \"./migration-log-Z3-L172x.mjs\";\nimport { t as createMigrationNewCommand } from \"./migration-new-DDnQd7Ql.mjs\";\nimport { t as createMigrationPlanCommand } from \"./migration-plan-CROSunPS.mjs\";\nimport { t as createMigrationShowCommand } from \"./migration-show-mJD52S2d.mjs\";\nimport { r as createMigrationStatusCommand } from \"./migration-status-Df6EwEun.mjs\";\nimport { t as createRefCommand } from \"./ref-Cycefq_T.mjs\";\nimport { t as createTelemetryCommand } from \"./telemetry-LP1Suxsf.mjs\";\nimport { Command } from \"commander\";\nimport { ensureInstallationId, readUserConfig, resolveGating, runTelemetry, userConfigPath } from \"@internal/cli-telemetry\";\nimport { distance } from \"closest-match\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/commands/init/index.ts\nfunction createInitCommand() {\n\tconst command = new Command(\"init\");\n\tsetCommandDescriptions(command, \"Initialize a new Prisma Next project\", `Scaffolds config, schema, and runtime files, installs dependencies,\nand emits the contract. Gets you from zero to typed queries in one step.\n\nRun interactively for a guided experience, or supply --target / --authoring\nand --yes for a fully scriptable run (CI, AI coding agents, automation).\n\nExit codes (see CLI Style Guide § Exit Codes):\n 0 OK Init succeeded.\\n 1 INTERNAL_ERROR Unexpected bug in prisma-next (please report).\\n 2 PRECONDITION Bad flags / missing prerequisite (e.g. no package.json).\\n 3 USER_ABORTED User cancelled an interactive prompt.\\n 4 INSTALL_FAILED Dependency installation failed (init-specific).\\n 5 EMIT_FAILED \\`contract emit\\` failed after install (init-specific).\\n 6 SKILL_INSTALL_FAILED Agent-skill install failed (re-run with --no-skill to skip).`);\n\tsetCommandExamples(command, [\n\t\t\"prisma-next init\",\n\t\t\"prisma-next init --yes --target postgres --authoring psl\",\n\t\t\"prisma-next init --yes --target mongodb --authoring typescript --json\",\n\t\t\"prisma-next init --yes --force --target postgres --authoring psl # overwrite an existing scaffold\",\n\t\t\"prisma-next init --no-install # skip pnpm/npm install + emit\",\n\t\t\"prisma-next init --no-skill # skip the skills install (air-gapped / restricted env)\"\n\t]);\n\treturn addGlobalOptions(command).option(\"--target <db>\", \"Database target: postgres or mongodb\").option(\"--authoring <style>\", \"Schema authoring style: psl or typescript\").option(\"--schema-path <path>\", `Where to write the starter schema (default: ${defaultSchemaPath(\"psl\")})`).option(\"--force\", \"Overwrite an existing scaffold without prompting\").option(\"--write-env\", \"Write a .env file from .env.example (gitignored; default: only .env.example)\").option(\"--probe-db\", \"Connect to DATABASE_URL once and check the server version against the target minimum (opt-in; off by default)\").option(\"--strict-probe\", \"Treat a failed --probe-db as fatal (no-op without --probe-db; init is offline-by-default)\").option(\"--no-install\", \"Skip dependency installation and contract emission\").option(\"--no-skill\", \"Skip Prisma Next skills install (air-gapped CI, restricted registries, etc.)\").action(async (options) => {\n\t\tconst { runInit } = await import(\"./init-BeZ2ToIf.mjs\");\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst canPrompt = deriveCanPrompt({\n\t\t\tflagsInteractive: flags.interactive,\n\t\t\toptionInteractive: options.interactive,\n\t\t\tstdinIsTTY: Boolean(process.stdin.isTTY)\n\t\t});\n\t\tconst exitCode = await runInit(process.cwd(), {\n\t\t\toptions,\n\t\t\tflags,\n\t\t\tcanPrompt\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n}\n//#endregion\n//#region src/commands/lsp.ts\nfunction createLspCommand() {\n\tconst command = new Command(\"lsp\");\n\tsetCommandDescriptions(command, \"Start the Prisma Next language server\", \"Launches a Language Server Protocol server that publishes PSL parse diagnostics\\nand handles whole-document PSL formatting for the schema inputs declared in\\nyour config (contract.source.inputs). Formatting uses the Prisma Next PSL\\nformatter and the formatter block from the project config.\\nCommunicates over stdio; intended to be spawned by an\\neditor, not run interactively. The server keeps running until the editor client\\ndisconnects.\");\n\tsetCommandExamples(command, [\"prisma-next lsp --stdio\"]);\n\taddGlobalOptions(command).option(\"--stdio\", \"Communicate with the editor over stdio (the default and only transport)\").action(async () => {\n\t\tconst { startServer } = await import(\"@internal/language-server\");\n\t\tstartServer();\n\t});\n\treturn command;\n}\n//#endregion\n//#region src/utils/suggest-command.ts\n/**\n* Suggests similar command names for a mistyped input.\n*\n* Uses Levenshtein distance to find close matches. Only suggests commands\n* within a reasonable distance threshold (40% of the input length, minimum 2).\n* Returns up to 3 suggestions in case of ties.\n*\n* @returns Array of suggested command names (empty if nothing is close enough).\n*/\nfunction suggestCommands(input, candidates) {\n\tif (candidates.length === 0) return [];\n\tconst maxDistance = Math.max(2, Math.ceil(input.length * .4));\n\tconst scored = candidates.map((name) => ({\n\t\tname,\n\t\tdist: distance(input, name)\n\t})).filter((entry) => entry.dist <= maxDistance).sort((a, b) => a.dist - b.dist);\n\tif (scored.length === 0) return [];\n\tconst bestDist = scored[0].dist;\n\treturn scored.filter((entry) => entry.dist === bestDist).slice(0, 3).map((entry) => entry.name);\n}\n//#endregion\n//#region src/utils/telemetry.ts\n/**\n* Resolve the commander command path from a leaf `Command`, walking up\n* the parent chain. Result is rooted at the program name and ends at\n* the leaf — `['prisma-next', 'migration', 'new']` for\n* `prisma-next migration new …`.\n*/\nfunction commandPathFor(actionCommand) {\n\tconst path = [];\n\tlet cursor = actionCommand;\n\twhile (cursor !== null) {\n\t\tpath.unshift(cursor.name());\n\t\tcursor = cursor.parent;\n\t}\n\treturn path;\n}\nfunction commanderOptionSnapshots(actionCommand) {\n\treturn actionCommand.options.map((option) => {\n\t\tconst attributeName = option.attributeName();\n\t\treturn {\n\t\t\tattributeName,\n\t\t\tlongName: option.long ?? null,\n\t\t\tsource: actionCommand.getOptionValueSource(attributeName) ?? null\n\t\t};\n\t});\n}\n/**\n* Project commander's leaf `Command` into the wire-shape snapshot the\n* telemetry sanitiser consumes. Pure projection — no env, no I/O.\n*/\nfunction commanderSnapshotForTelemetry(actionCommand) {\n\treturn {\n\t\tcommandPath: commandPathFor(actionCommand),\n\t\tpositionalArgs: actionCommand.args,\n\t\toptions: commanderOptionSnapshots(actionCommand)\n\t};\n}\nfunction resolveTelemetryGate() {\n\tif (isCI()) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"ci\"\n\t\t}\n\t};\n\tconst userConfig = readUserConfig();\n\tif (!resolveGating({\n\t\tenv: process.env,\n\t\tconfig: userConfig\n\t}).enabled) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"gated-off\"\n\t\t}\n\t};\n\treturn {\n\t\tenabled: true,\n\t\tuserConfig\n\t};\n}\n/**\n* Path to the compiled sender script inside `@internal/cli-telemetry`'s\n* `dist/`. Resolved off this module's `import.meta.url` via the package\n* specifier `@internal/cli-telemetry/sender`, so the consumer pays\n* no attention to internal package layout.\n*/\nfunction senderPath() {\n\treturn fileURLToPath(new URL(import.meta.resolve(\"@internal/cli-telemetry/sender\")));\n}\nfunction fireTelemetry(actionCommand, userConfig) {\n\treturn runTelemetry({\n\t\tcommand: commanderSnapshotForTelemetry(actionCommand),\n\t\tversion,\n\t\tprojectRoot: process.cwd(),\n\t\tsenderPath: senderPath(),\n\t\tisCI: isCI(),\n\t\tenv: process.env,\n\t\tuserConfig\n\t});\n}\n/**\n* preAction-stage entry point. Synchronous by construction: resolve\n* env/CI/user-consent gates (cheap, all in-memory and a single tiny\n* user-config read), then — only when enabled — `fork()` the detached\n* sender script. The forked child loads `prisma-next.config.*` via\n* c12 on its own (see `loadProjectConfig` in cli-telemetry); the\n* parent does no project-config I/O on the command's hot path.\n*\n* Privacy invariant: gate resolution always happens before any project\n* config touches disk. The child loading user TS code is acceptable\n* only because it's gated behind the same resolved-enabled signal.\n*/\n/**\n* Builds the one-time first-run disclosure. The resolved absolute path to\n* the user-level config file is substituted in so the user can see exactly\n* which file to edit (it must not be confused with `prisma-next.config.ts`).\n* `prisma-next telemetry disable` is named as the primary, friendliest\n* opt-out, alongside the env vars and the config edit.\n*/\nfunction firstRunNotice(configPath) {\n\treturn [\n\t\t\"Prisma Next collects anonymous CLI usage data, enabled by default.\",\n\t\t\"What's collected and why: https://prisma-next.dev/docs/cli/telemetry.\",\n\t\t\"Opt out: run \\\"prisma-next telemetry disable\\\", set DO_NOT_TRACK=1 or\",\n\t\t`PRISMA_NEXT_DISABLE_TELEMETRY=1, or set \"enableTelemetry\": false in ${configPath}.`\n\t].join(\" \");\n}\n/**\n* Best-effort first-run disclosure + installationId mint. Runs only on the\n* gating-enabled path. Prints the notice to stderr (never stdout) and mints\n* a persistent id without touching `enableTelemetry`, so the opt-out default\n* stays intact and no unasked-for consent is recorded.\n*\n* Every step is wrapped so an un-writable config dir (or any other failure)\n* never throws and never blocks the command. Returns the minted (or\n* pre-existing) id so the caller can forward it to `runTelemetry` without a\n* redundant disk read. On mint failure it returns `undefined`: the notice may\n* reprint next run, and `runTelemetry` no-ops on the missing id.\n*/\nfunction discloseAndMintOnFirstRun() {\n\ttry {\n\t\tprocess.stderr.write(`${firstRunNotice(userConfigPath())}\\n`);\n\t} catch {}\n\ttry {\n\t\treturn ensureInstallationId();\n\t} catch {}\n}\n/**\n* True when the run is the `telemetry` command (or one of its\n* subcommands). The usage-telemetry preAction fire is exempted for it:\n* it would be absurd for `telemetry disable` to send a usage event before\n* disabling, or for `telemetry status` to mint an id + send while merely\n* reporting state. This is the only command-specific exemption.\n*\n* The check is rooted at the program: the path must be\n* `['prisma-next', 'telemetry', …]`, so it matches the top-level\n* `telemetry` command and its subcommands without matching a hypothetical\n* nested `… telemetry` elsewhere.\n*/\nfunction isTelemetryCommand(actionCommand) {\n\treturn commandPathFor(actionCommand)[1] === \"telemetry\";\n}\nfunction fireTelemetryFromPreAction(actionCommand) {\n\tif (isTelemetryCommand(actionCommand)) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst gate = resolveTelemetryGate();\n\tif (!gate.enabled) return gate.outcome;\n\tconst storedId = gate.userConfig.installationId;\n\tif (typeof storedId !== \"string\" || storedId.length === 0) {\n\t\tconst installationId = discloseAndMintOnFirstRun();\n\t\treturn fireTelemetry(actionCommand, installationId === void 0 ? gate.userConfig : {\n\t\t\t...gate.userConfig,\n\t\t\tinstallationId\n\t\t});\n\t}\n\treturn fireTelemetry(actionCommand, gate.userConfig);\n}\n//#endregion\n//#region src/cli.ts\ninstallShutdownHandlers();\n/**\n* Lookup table mapping removed subcommands to their replacement verbs.\n* Keyed by `<parent>:<subcommand>` (e.g. `migration:apply`).\n* The handler consults this before falling back to the fuzzy suggest engine.\n*/\nconst removedVerbRedirects = {\n\t\"migration:apply\": \"Use `prisma-next migrate --to <contract>` instead.\",\n\t\"migration:ref\": \"Use `prisma-next ref set|list|delete` instead.\"\n};\n/**\n* Removed flags on specific subcommands. Keyed by `<parent>:<sub>:<flag>`.\n* Checked during the pre-parse argv scan before commander sees the flags.\n*/\nconst removedFlagRedirects = {\n\t\"migration:status:graph\": \"Use `prisma-next migration graph` to view the migration graph.\",\n\t\"migration:status:all\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:limit\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:ref\": \"Use `--to <contract>` instead of `--ref`.\"\n};\n/**\n* Formats the \"Did you mean ...?\" hint for an unknown command.\n*/\nfunction formatSuggestion(input, candidates) {\n\tconst suggestions = suggestCommands(input, candidates.map((c) => c));\n\tif (suggestions.length === 0) return \"\";\n\tif (suggestions.length === 1) return `\\nDid you mean ${suggestions[0]}?\\n`;\n\treturn `\\nDid you mean one of these?\\n${suggestions.map((s) => ` ${s}`).join(\"\\n\")}\\n`;\n}\nconst program = new Command();\nprogram.name(BIN_NAME).description(\"Prisma Next CLI\").version(version);\nprogram.hook(\"preAction\", (_thisCommand, actionCommand) => {\n\ttry {\n\t\tfireTelemetryFromPreAction(actionCommand);\n\t} catch {}\n});\nconst versionOption = program.options.find((opt) => opt.flags.includes(\"--version\"));\nif (versionOption) versionOption.description = \"Output the version number\";\nprogram.configureOutput({\n\twriteErr: () => {},\n\twriteOut: (str) => {\n\t\tprocess.stdout.write(str);\n\t}\n});\nconst rootHelpFormatter = (cmd) => {\n\treturn formatRootHelp({\n\t\tprogram: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n};\nprogram.configureHelp({\n\tformatHelp: rootHelpFormatter,\n\tsubcommandDescription: () => \"\"\n});\nprogram.exitOverride((err) => {\n\tif (err) {\n\t\tconst errorCode = err.code;\n\t\tconst errorMessage = String(err.message ?? \"\");\n\t\tconst errorName = err.name ?? \"\";\n\t\tif (errorCode === \"commander.unknownCommand\" || errorCode === \"commander.unknownArgument\" || errorName === \"CommanderError\" && (errorMessage.includes(\"unknown command\") || errorMessage.includes(\"unknown argument\"))) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst match = errorMessage.match(/unknown command ['\"]([^'\"]+)['\"]/);\n\t\t\tconst commandName = match ? match[1] : process.argv[3] || process.argv[2] || \"unknown\";\n\t\t\tconst firstArg = process.argv[2];\n\t\t\tconst parentCommand = firstArg ? program.commands.find((cmd) => cmd.name() === firstArg) : void 0;\n\t\t\tif (parentCommand && commandName !== firstArg) {\n\t\t\t\tconst subNames = parentCommand.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, subNames)}\\n`);\n\t\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\t\tcommand: parentCommand,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t} else {\n\t\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\t\tconst helpText = formatRootHelp({\n\t\t\t\t\tprogram,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t}\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.help\" || errorCode === \"commander.helpDisplayed\" || errorCode === \"outputHelp\" || errorMessage === \"(outputHelp)\" || errorMessage.includes(\"outputHelp\") || errorName === \"CommanderError\" && errorMessage.includes(\"outputHelp\")) {\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.missingArgument\" || errorCode === \"commander.missingMandatoryOptionValue\" || errorName === \"CommanderError\" && (errorMessage.includes(\"missing\") || errorMessage.includes(\"required\"))) {\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tprocess.stderr.write(`Unhandled error: ${err.message}\\n`);\n\t\tif (err.stack) process.stderr.write(`${err.stack}\\n`);\n\t\tprocess.exit(1);\n\t}\n\tprocess.exit(0);\n});\nconst contractCommand = new Command(\"contract\");\nsetCommandDescriptions(contractCommand, \"Contract management commands\", \"Define and emit your application data contract. The contract describes your schema as a\\ndeclarative data structure that can be signed and verified against your database.\");\ncontractCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst contractEmitCommand = createContractEmitCommand();\ncontractCommand.addCommand(contractEmitCommand);\nconst contractInferCommand = createContractInferCommand();\ncontractCommand.addCommand(contractInferCommand);\nconst dbCommand = new Command(\"db\");\nsetCommandDescriptions(dbCommand, \"Database management commands\", \"Verify and sign your database with your contract. Ensure your database schema matches\\nyour contract, and sign it to record the contract hash for future verification.\");\ndbCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst dbVerifyCommand = createDbVerifyCommand();\ndbCommand.addCommand(dbVerifyCommand);\nconst dbInitCommand = createDbInitCommand();\ndbCommand.addCommand(dbInitCommand);\nconst dbUpdateCommand = createDbUpdateCommand();\ndbCommand.addCommand(dbUpdateCommand);\nconst dbSchemaCommand = createDbSchemaCommand();\ndbCommand.addCommand(dbSchemaCommand);\nconst dbSignCommand = createDbSignCommand();\ndbCommand.addCommand(dbSignCommand);\nconst migrationCommand = new Command(\"migration\");\nsetCommandDescriptions(migrationCommand, \"On-disk migration management commands\", \"Plan, apply, and scaffold on-disk migration packages. Migrations are\\ncontract-to-contract edges stored as versioned directories under migrations/.\");\nmigrationCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst migrationPlanCommand = createMigrationPlanCommand();\nmigrationCommand.addCommand(migrationPlanCommand);\nconst migrationNewCommand = createMigrationNewCommand();\nmigrationCommand.addCommand(migrationNewCommand);\nconst migrationShowCommand = createMigrationShowCommand();\nmigrationCommand.addCommand(migrationShowCommand);\nconst migrationStatusCommand = createMigrationStatusCommand();\nmigrationCommand.addCommand(migrationStatusCommand);\nconst migrationLogCommand = createMigrationLogCommand();\nmigrationCommand.addCommand(migrationLogCommand);\nconst migrationListCommand = createMigrationListCommand();\nmigrationCommand.addCommand(migrationListCommand);\nconst migrationGraphCommand = createMigrationGraphCommand();\nmigrationCommand.addCommand(migrationGraphCommand);\nconst migrationCheckCommand = createMigrationCheckCommand();\nmigrationCommand.addCommand(migrationCheckCommand);\nconst migrateCommand = createMigrateCommand();\nconst refCommand = createRefCommand();\nconst telemetryCommand = createTelemetryCommand();\nconst initCommand = createInitCommand();\nconst formatCommand = createFormatCommand();\nconst lspCommand = createLspCommand();\nprogram.addCommand(initCommand);\nprogram.addCommand(migrateCommand);\nprogram.addCommand(formatCommand);\nprogram.addCommand(lspCommand);\nprogram.addCommand(contractCommand);\nprogram.addCommand(dbCommand);\nprogram.addCommand(migrationCommand);\nprogram.addCommand(refCommand);\nprogram.addCommand(telemetryCommand);\nconst TELEMETRY_CRASH_TEST_SLEEP_MS = 200;\nif (process.env[\"PRISMA_NEXT_ENABLE_TEST_COMMANDS\"] === \"1\") {\n\tconst telemetryCrashTestCommand = new Command(\"__telemetry-crash-test\").description(\"Internal: deliberately throw for the telemetry e2e suite.\").action(async () => {\n\t\tawait new Promise((settle) => setTimeout(settle, TELEMETRY_CRASH_TEST_SLEEP_MS));\n\t\tthrow new Error(\"__telemetry-crash-test: intentional crash for e2e coverage\");\n\t});\n\ttelemetryCrashTestCommand.configureHelp({ visibleCommands: () => [] });\n\tprogram.addCommand(telemetryCrashTestCommand, { hidden: true });\n}\nconst helpCommand = new Command(\"help\").description(\"Show usage instructions\").configureHelp({ formatHelp: (cmd) => {\n\treturn formatCommandHelp({\n\t\tcommand: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n} }).action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stdout.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nprogram.addCommand(helpCommand);\nprogram.action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stderr.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nconst args = process.argv.slice(2);\nif (args.length > 0) {\n\tconst commandName = args[0];\n\tif (commandName === \"--version\" || commandName === \"-V\") {\n\t\tprocess.stdout.write(`${program.version()}\\n`);\n\t\tprocess.exit(0);\n\t}\n\tif (!(commandName === \"--help\" || commandName === \"-h\")) {\n\t\tconst command = program.commands.find((cmd) => cmd.name() === commandName);\n\t\tif (!command) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\tconst helpText = formatRootHelp({\n\t\t\t\tprogram,\n\t\t\t\tflags\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(2);\n\t\t} else if (command.commands.length > 0 && args.length >= 2) {\n\t\t\tconst subcommandName = args[1];\n\t\t\tconst redirect = removedVerbRedirects[`${commandName}:${subcommandName}`];\n\t\t\tif (redirect) {\n\t\t\t\tprocess.stderr.write(`Unknown command: ${subcommandName}\\n${redirect}\\n`);\n\t\t\t\tprocess.exit(2);\n\t\t\t}\n\t\t\tfor (let i = 2; i < args.length; i++) {\n\t\t\t\tconst arg = args[i];\n\t\t\t\tif (!arg.startsWith(\"--\")) continue;\n\t\t\t\tconst flagRedirect = removedFlagRedirects[`${commandName}:${subcommandName}:${arg.slice(2)}`];\n\t\t\t\tif (flagRedirect) {\n\t\t\t\t\tprocess.stderr.write(`Unknown option: ${arg}\\n${flagRedirect}\\n`);\n\t\t\t\t\tprocess.exit(2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (command.commands.length > 0 && args.length === 1) {\n\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\tcommand,\n\t\t\t\tflags: parseGlobalFlags({})\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(0);\n\t\t}\n\t}\n}\nprogram.parse();\n//#endregion\nexport {};\n\n//# sourceMappingURL=cli.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAI,UAAU;;;;;;;;;;;ACWd,SAAS,6BAA6B,QAAQ;CAC7C,OAAO,gCAAgC;EACtC,MAAM;EACN,QAAQ,WAAW,aAAa,yBAAyB;CAC1D,CAAC;AACF;;;;;;;;;;;;;;;;;AAiBA,SAAS,kBAAkB,QAAQ,yBAAyB,wBAAwB;CACnF,OAAO,uBAAuB,WAAW,aAAa,uBAAuB,iBAAiB;AAC/F;;AAEA,SAAS,iBAAiB,QAAQ,SAAS,yBAAyB,wBAAwB;CAC3F,OAAO,uBAAuB,GA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AAW;EACzE,IAAI,CAAC,SAAS;GACb,MAAM,QAAQ,iBAAiB,CAAC,CAAC;GACjC,MAAM,WAAW,QAAQ,SAAS,KAAK,MAAM,EAAE,KAAK,CAAC;GACrD,QAAQ,OAAO,MAAM,oBAAoB,cAAc,iBAAiB,aAAa,QAAQ,EAAE,GAAG;GAClG,MAAM,WAAW,eAAe;IAC/B;IACA;GACD,CAAC;GACD,QAAQ,OAAO,MAAM,GAAG,SAAS,GAAG;GACpC,QAAQ,KAAK,CAAC;EACf,OAAO,IAAI,QAAQ,SAAS,SAAS,KAAK,KAAK,UAAU,GAAG;GAC3D,MAAM,iBAAiB,KAAK;GAC5B,MAAM,WAAW,qBAAqB,GAAG,YAAY,GAAG;GACxD,IAAI,UAAU;IACb,QAAQ,OAAO,MAAM,oBAAoB,eAAe,IAAI,SAAS,GAAG;IACxE,QAAQ,KAAK,CAAC;GACf;GACA,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;IACrC,MAAM,MAAM,KAAK;IACjB,IAAI,CAAC,IAAI,WAAW,IAAI,GAAG;IAC3B,MAAM,eAAe,qBAAqB,GAAG,YAAY,GAAG,eAAe,GAAG,IAAI,MAAM,CAAC;IACzF,IAAI,cAAc;KACjB,QAAQ,OAAO,MAAM,mBAAmB,IAAI,IAAI,aAAa,GAAG;KAChE,QAAQ,KAAK,CAAC;IACf;GACD;EACD;EACA,IAAI,QAAQ,SAAS,SAAS,KAAK,KAAK,WAAW,GAAG;GACrD,MAAM,WAAW,kBAAkB;IAClC;IACA,OAAO,iBAAiB,CAAC,CAAC;GAC3B,CAAC;GACD,QAAQ,OAAO,MAAM,GAAG,SAAS,GAAG;GACpC,QAAQ,KAAK,CAAC;EACf;CACD;AACD;AACA,QAAQ,MAAM"}
package/dist/cli.mjs CHANGED
@@ -1,20 +1,20 @@
1
1
  import { i as loadConfig } from "./exports-BZLNbtkY.mjs";
2
2
  import { F as requireLiveDatabase, N as errorUnexpected, a as errorConfigValidation$1, b as errorNoMigrations, d as errorFileNotFound, h as errorLegendHumanOnly, j as errorTargetMigrationNotSupported, s as errorContractValidationFailed, v as errorMigrationPackageNotFound } from "./cli-errors-CihMAEVj-C1uUYBop.mjs";
3
3
  import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
4
- import { p as previewBlockHeader } from "./terminal-ui-CUZTa2vH-WvAtuIOS.mjs";
5
- import { c as spaceMigrationDirectory } from "./verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs";
6
- import { S as targetSupportsMigrations, f as maskConnectionUrl, n as closeQuietly } from "./command-helpers-uzQbbM97-EaL4zWf5.mjs";
7
- import { t as createContractEmitCommand } from "./contract-emit-D-vxAjLQ-DjSGIBvi.mjs";
8
- import { t as createFormatCommand } from "./format-DZ7Vowat-CXVeLGp_.mjs";
9
- import { a as loadContractSpaceAggregateForCli, r as buildReadAggregate } from "./contract-space-aggregate-loader-Cd0X2M_C-CFBkD540.mjs";
10
- import { t as createControlClient } from "./client-DLPcSdv7-Cukdon0q.mjs";
4
+ import { m as previewBlockHeader } from "./terminal-ui-JJKxvT0q-CPDEJqqU.mjs";
5
+ import { c as spaceMigrationDirectory } from "./verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs";
6
+ import { S as targetSupportsMigrations, f as maskConnectionUrl, n as closeQuietly } from "./command-helpers-Dw3LDEu_-B4AETH4D.mjs";
7
+ import { t as createContractEmitCommand } from "./contract-emit-CIdgw3Kq-BcfYaUfn.mjs";
8
+ import { t as createFormatCommand } from "./format-CYdgHub4-Cs6VcFje.mjs";
9
+ import { a as loadContractSpaceAggregateForCli, r as buildReadAggregate } from "./contract-space-aggregate-loader-1wG1OiDk-D75luh5-.mjs";
10
+ import { t as createControlClient } from "./client-C4Gh4PBz-BMUlBcuE.mjs";
11
11
  import { t as mapCaughtMigrationError } from "./caught-errors-B_oGFiYw-BqX49eW0.mjs";
12
- import { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList } from "./migration-list-AKRIIovW-Cr39jOaI.mjs";
13
- import { n as resolveMigrationRef } from "./ref-resolution-Bi4lpxM8-BX-7sl0f.mjs";
12
+ import { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList } from "./migration-list-AKRIIovW-BN-Zrwk0.mjs";
13
+ import { n as resolveMigrationRef } from "./ref-resolution-Bi4lpxM8-BbfL_yv8.mjs";
14
14
  import { S as toneSpans, b as renderMigrationListWithStyle, d as createToneMigrationListStyler, n as TONE_MIGRATION_GRAPH_PALETTE, v as renderMigrationGraphLegend, x as toneDrawing } from "./migration-graph-command-render-CgdHruiZ-B6V4gmUe.mjs";
15
15
  import { n as looksLikePath, r as resolveAppTargetPath, t as findPackageByDirPath } from "./migration-path-target-yA4h5Zc6-DlzBblBG.mjs";
16
- import { t as buildMigrationSpaceGraphEntries } from "./migration-graph-BtP1Va3T-CMOZgqVW.mjs";
17
- import { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from "./migration-graph-sections-CceYWPCP-Bz8vmjNZ.mjs";
16
+ import { t as buildMigrationSpaceGraphEntries } from "./migration-graph-BtP1Va3T-C8PpuaYw.mjs";
17
+ import { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from "./migration-graph-sections-CceYWPCP-LqImOaK1.mjs";
18
18
  import { a as sortLedgerEntries, i as serializeLedgerEntriesForJson, n as formatLedgerAppliedAt, o as styleHashTransition, t as MIGRATION_LOG_EMPTY_MESSAGE } from "./migration-log-table-JR7fFVbE-DR2mom6h.mjs";
19
19
  import { CliStructuredError } from "@prisma/orm-framework/errors/control";
20
20
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
@@ -31,7 +31,7 @@ import { defineCommand, defineCommandFamily, defineConfigSection, flag, position
31
31
  import { CliStructuredError as CliStructuredError$1, notOk, ok } from "@prisma/cli-engine/protocol";
32
32
  import { pathToFileURL } from "node:url";
33
33
  import { build } from "esbuild";
34
- //#region ../../../1-framework/3-tooling/cli/dist/load-config-DFptcz_M.mjs
34
+ //#region ../../../1-framework/3-tooling/cli/dist/load-config-Dmql8awN.mjs
35
35
  const MISSING_CONFIG_ACTION = {
36
36
  kind: "run-command",
37
37
  label: "Create a configuration file",
package/dist/cli.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":["CliStructuredError","errorConfigValidation"],"sources":["../../../../1-framework/3-tooling/cli/dist/load-config-DFptcz_M.mjs","../../../../1-framework/3-tooling/cli/dist/exports/index.mjs"],"sourcesContent":["import { A as errorTargetMigrationNotSupported, M as errorUnexpected, P as requireLiveDatabase, _ as errorMigrationPackageNotFound, i as errorConfigValidation, m as errorLegendHumanOnly, o as errorContractValidationFailed, u as errorFileNotFound, y as errorNoMigrations } from \"./cli-errors-CihMAEVj.mjs\";\nimport { u as previewBlockHeader } from \"./terminal-ui-CUZTa2vH.mjs\";\nimport { a as maskConnectionUrl, n as closeQuietly, p as targetSupportsMigrations } from \"./command-helpers-uzQbbM97.mjs\";\nimport { a as loadContractSpaceAggregateForCli, r as buildReadAggregate } from \"./contract-space-aggregate-loader-Cd0X2M_C.mjs\";\nimport { t as createControlClient } from \"./client-DLPcSdv7.mjs\";\nimport { t as mapCaughtMigrationError } from \"./caught-errors-B_oGFiYw.mjs\";\nimport { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList } from \"./migration-list-AKRIIovW.mjs\";\nimport { n as resolveMigrationRef } from \"./ref-resolution-Bi4lpxM8.mjs\";\nimport { S as toneSpans, a as renderMigrationGraphLegend, b as TONE_MIGRATION_GRAPH_PALETTE, l as renderMigrationListWithStyle, s as createToneMigrationListStyler, x as toneDrawing } from \"./migration-graph-command-render-CgdHruiZ.mjs\";\nimport { n as looksLikePath, r as resolveAppTargetPath, t as findPackageByDirPath } from \"./migration-path-target-yA4h5Zc6.mjs\";\nimport { t as buildMigrationSpaceGraphEntries } from \"./migration-graph-BtP1Va3T.mjs\";\nimport { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from \"./migration-graph-sections-CceYWPCP.mjs\";\nimport { a as sortLedgerEntries, i as serializeLedgerEntriesForJson, n as formatLedgerAppliedAt, o as styleHashTransition, t as MIGRATION_LOG_EMPTY_MESSAGE } from \"./migration-log-table-JR7fFVbE.mjs\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { normalize, relative, resolve } from \"pathe\";\nimport { readFile } from \"node:fs/promises\";\nimport { APP_SPACE_ID, createControlStack } from \"@internal/framework-components/control\";\nimport { spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { DOCS_BASE, isStructuredError } from \"@internal/utils/structured-error\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, flag, positional } from \"@prisma/cli-engine\";\nimport { collectConfigIssues } from \"@internal/config/config-validation\";\nimport { CliStructuredError, notOk, ok } from \"@prisma/cli-engine/protocol\";\nconst MISSING_CONFIG_ACTION = {\n\tkind: \"run-command\",\n\tlabel: \"Create a configuration file\",\n\tcommand: \"prisma-next init\"\n};\nfunction editConfigAction(field) {\n\treturn {\n\t\tkind: \"edit-file\",\n\t\tlabel: `Correct ${field} in prisma-next.config.ts`\n\t};\n}\nfunction issueDiagnostic(issue) {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: issue.message,\n\t\twhy: issue.message,\n\t\tnextActions: [editConfigAction(issue.field)],\n\t\tmeta: {\n\t\t\tfield: issue.field,\n\t\t\tsection: issue.section\n\t\t}\n\t};\n}\nfunction sectionAbsentDiagnostic() {\n\treturn {\n\t\tcode: \"CONFIG.FILE_NOT_FOUND\",\n\t\tseverity: \"error\",\n\t\tsummary: \"No Prisma Next configuration was loaded\",\n\t\twhy: `The orm config section is absent, so prisma-next.config.ts was never evaluated.`,\n\t\tnextActions: [MISSING_CONFIG_ACTION]\n\t};\n}\nfunction notAnObjectDiagnostic() {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: \"Prisma Next configuration must be an object\",\n\t\twhy: `The orm config section is not an object, so no section can be read from it.`,\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Export a configuration object from prisma-next.config.ts\"\n\t\t}]\n\t};\n}\nfunction unreadableDiagnostic(error) {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: \"Prisma Next configuration could not be inspected\",\n\t\twhy: error instanceof Error ? error.message : String(error),\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Export a plain configuration object from prisma-next.config.ts\"\n\t\t}]\n\t};\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/**\n* An emitted artifact listed as its own contract input makes every emit\n* consume its previous output. Structural, filesystem-free, and therefore the\n* section validator's business rather than the loader's.\n*/\nfunction collectArtifactCollisionIssues(raw) {\n\tconst contract = raw[\"contract\"];\n\tif (!isRecord(contract)) return [];\n\tconst source = contract[\"source\"];\n\tconst output = contract[\"output\"];\n\tif (!isRecord(source) || typeof output !== \"string\") return [];\n\tconst inputs = source[\"inputs\"];\n\tif (!Array.isArray(inputs)) return [];\n\tlet emitted;\n\ttry {\n\t\temitted = getEmittedArtifactPaths(output);\n\t} catch (error) {\n\t\treturn [{\n\t\t\tsection: \"contract\",\n\t\t\tfield: \"contract.output\",\n\t\t\tmessage: error instanceof Error ? error.message : String(error)\n\t\t}];\n\t}\n\tconst emittedPaths = /* @__PURE__ */ new Set([normalize(emitted.jsonPath), normalize(emitted.dtsPath)]);\n\tif (!inputs.some((input) => typeof input === \"string\" && emittedPaths.has(normalize(input)))) return [];\n\treturn [{\n\t\tsection: \"contract\",\n\t\tfield: \"contract.source.inputs[]\",\n\t\tmessage: \"Config.contract.source.inputs must not include emitted artifact paths derived from contract.output\"\n\t}];\n}\nfunction validate(raw) {\n\tif (raw === void 0) return {\n\t\tok: false,\n\t\tdiagnostics: [sectionAbsentDiagnostic()]\n\t};\n\tif (!isRecord(raw)) return {\n\t\tok: false,\n\t\tdiagnostics: [notAnObjectDiagnostic()]\n\t};\n\tlet issues;\n\ttry {\n\t\tissues = [...collectConfigIssues(raw), ...collectArtifactCollisionIssues(raw)];\n\t} catch (error) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tdiagnostics: [unreadableDiagnostic(error)]\n\t\t};\n\t}\n\tif (issues.length > 0) return {\n\t\tok: false,\n\t\tdiagnostics: issues.map(issueDiagnostic)\n\t};\n\treturn {\n\t\tok: true,\n\t\tvalue: blindCast(raw),\n\t\tdiagnostics: []\n\t};\n}\nconst ormConfigSection = defineConfigSection({\n\tname: \"orm\",\n\tvalidate\n});\n//#endregion\n//#region src/orm/normalize-error.ts\n/**\n* `isStructuredError` is the repo's own check, and it is the one that matters here: it holds the\n* regular expression for a dotted `NAMESPACE.SUBCODE`, so only a code the protocol accepts\n* reaches `Diagnostic['code']`.\n*/\nfunction isRaisedError(error) {\n\treturn error instanceof Error && isStructuredError(error);\n}\n/**\n* The fallback for anything that is not a structured error: a bare throw, and also an error whose\n* `code` is not a dotted one — a Node `ENOENT`, say. The rejected code survives in `meta` rather\n* than in `code`, where it would produce a docs link to a page that does not exist.\n*/\nfunction toUnexpected(error) {\n\tconst summary = error instanceof Error ? error.message : String(error);\n\tconst rejectedCode = error instanceof Error ? Reflect.get(error, \"code\") : void 0;\n\treturn new CliStructuredError(\"CLI.UNEXPECTED\", summary, {\n\t\t...ifDefined(\"meta\", typeof rejectedCode === \"string\" ? { code: rejectedCode } : void 0),\n\t\tcause: error\n\t});\n}\n/**\n* Both classes name themselves `CliStructuredError`, so the engine's duck test\n* accepts prisma/prisma's too, and a CLI factory carrying typed actions looks\n* conformant without being one — its `toEnvelope` still writes `fix` and no\n* `nextActions`. Only an error the engine itself built is already in protocol\n* shape, and `@prisma/cli-engine` is an exact-pinned, unbundled dependency, so\n* there is one module instance and identity holds.\n*/\nfunction conformsToProtocol(error) {\n\treturn error instanceof CliStructuredError;\n}\n/**\n* Turns the transitional `fix` prose into typed actions. A multi-line fix is\n* several pieces of advice, so it becomes one action per line.\n*/\nfunction actionsFromFix(fix) {\n\tif (fix === void 0) return [];\n\treturn fix.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0).map((label) => ({\n\t\tkind: \"user-choice\",\n\t\tlabel\n\t}));\n}\n/**\n* Projects a prisma/prisma-raised error onto the engine's diagnostic shape.\n*/\nfunction toEngineDiagnostic(error) {\n\treturn {\n\t\tcode: error.code,\n\t\tseverity: error.severity ?? \"error\",\n\t\tsummary: error.message,\n\t\t...ifDefined(\"why\", error.why),\n\t\tnextActions: error.nextActions ?? actionsFromFix(error.fix),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\t...ifDefined(\"docsUrl\", error.docsUrl)\n\t};\n}\n/**\n* The handler boundary's single conversion. Handlers pass every error they\n* return through `notOk` — and every error a top-of-handler catch sees —\n* through this, so a settled envelope always carries `nextActions` and never\n* the non-protocol `fix` field.\n*/\nfunction normalizeError(error) {\n\tif (conformsToProtocol(error)) return error;\n\tif (!isRaisedError(error)) return toUnexpected(error);\n\tconst diagnostic = toEngineDiagnostic(error);\n\treturn new CliStructuredError(diagnostic.code, diagnostic.summary, {\n\t\tseverity: diagnostic.severity,\n\t\tnextActions: diagnostic.nextActions,\n\t\t...ifDefined(\"why\", diagnostic.why),\n\t\t...ifDefined(\"where\", diagnostic.where),\n\t\t...ifDefined(\"meta\", diagnostic.meta),\n\t\t...ifDefined(\"docsUrl\", diagnostic.docsUrl),\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/orm/define-command.ts\n/**\n* `defineCommand` with the ORM's error boundary already attached. Every ORM command is defined\n* through this rather than through `defineCommand` directly.\n*\n* Without it, an error a handler throws reaches the engine, whose duck test accepts\n* prisma/prisma's `CliStructuredError` — both classes carry that name — and then settles it\n* through fields the engine's own class has and this one does not. The envelope that results is\n* off-protocol. Catching here means every handler settles through the single conversion instead.\n*/\nfunction defineOrmCommand(def) {\n\treturn defineCommand({\n\t\t...def,\n\t\thandler: async (args, ctx) => {\n\t\t\ttry {\n\t\t\t\treturn await def.handler(args, ctx);\n\t\t\t} catch (error) {\n\t\t\t\treturn notOk(normalizeError(error));\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\n//#region src/orm/migration/paths.ts\n/**\n* Where migrations live for this project. Resolved against the invocation\n* directory, which is also the config file's directory for every default\n* invocation.\n*/\nfunction migrationsDirFor(config, cwd) {\n\treturn resolve(cwd, config.migrations?.dir ?? \"migrations\");\n}\n/** The app subspace under {@link migrationsDirFor}. */\nfunction appMigrationsDirFor(config, cwd) {\n\treturn spaceMigrationDirectory(migrationsDirFor(config, cwd), APP_SPACE_ID);\n}\n/**\n* The emitted contract. The config loader has already resolved\n* `contract.output` against the config file's directory, so this only has an\n* effect for a config handed in raw, as tests do.\n*/\nfunction contractPathFor(config, cwd) {\n\tconst output = config.contract?.output;\n\treturn output === void 0 ? void 0 : resolve(cwd, output);\n}\n/**\n* The header's rendering of a path: relative to where the user invoked the\n* CLI, as the commander shell rendered it against the config file.\n*/\nfunction displayPath(path, cwd) {\n\treturn relative(cwd, path);\n}\n//#endregion\n//#region src/orm/migration/graph.ts\n/**\n* The tree is a drawing for a reader; the DOT document is a graph description\n* for another program, so it is the one thing here that belongs on stdout.\n*/\nfunction graphPresentations(inputs) {\n\tconst { tree, dot, legend } = inputs;\n\treturn {\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t}, ...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]]\n\t\t\t},\n\t\t\t...tree === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(tree)\n\t\t\t}],\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}]\n\t\t],\n\t\t...dot === void 0 ? {} : { stdout: () => dot.split(\"\\n\") },\n\t\tjson: () => inputs.document\n\t};\n}\nfunction graphSummary(spaces) {\n\tconst contracts = spaces.reduce((count, space) => count + space.contracts.length, 0);\n\tconst migrations = spaces.reduce((count, space) => count + space.migrations.length, 0);\n\treturn `${spaces.length} space(s), ${contracts} contract(s), ${migrations} migration(s)`;\n}\nconst migrationGraphCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show the migration graph topology\",\n\t\tdescription: \"Renders the migration graph topology. Offline — does not consult the\\ndatabase. --ascii swaps box-drawing for pipe-friendly ASCII glyphs.\\n--dot emits Graphviz DOT for the app graph instead of the tree, and\\nignores --space; in json mode the result carries the DOT text alongside\\nthe graph document.\",\n\t\texamples: [\n\t\t\t\"migration graph\",\n\t\t\t\"migration graph --json\",\n\t\t\t\"migration graph --dot\",\n\t\t\t\"migration graph --ascii\",\n\t\t\t\"migration graph --legend\",\n\t\t\t\"migration graph --space app\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tdot: flag.boolean({ brief: \"Emit Graphviz DOT for the app graph\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" }),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tif (args.flags.legend && args.flags.dot) return notOk(normalizeError(errorLegendHumanOnly(\"--dot\")));\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk(normalizeError(listed.failure));\n\t\tconst scopedSpaces = listed.value.spaces;\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst graphSpaces = [...buildMigrationSpaceGraphEntries({\n\t\t\taggregate,\n\t\t\tscopedSpaces\n\t\t})];\n\t\tconst summary = graphSummary(graphSpaces);\n\t\tconst graphDocument = {\n\t\t\tok: true,\n\t\t\tspaces: graphSpaces,\n\t\t\tsummary\n\t\t};\n\t\tconst dot = args.flags.dot ? renderMigrationGraphDot(aggregate.app.graph()) : void 0;\n\t\tconst document = dot === void 0 ? graphDocument : {\n\t\t\t...graphDocument,\n\t\t\tdot\n\t\t};\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst tree = dot === void 0 ? renderMigrationGraphSections(buildMigrationGraphTreeSections({\n\t\t\taggregate,\n\t\t\tscopedSpaces,\n\t\t\tliveContractHash,\n\t\t\tglyphMode,\n\t\t\tcolorize: true,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}), styler.summary(summary)) : void 0;\n\t\tconst legend = args.flags.legend ? renderMigrationGraphLegend({\n\t\t\tcolorize: true,\n\t\t\tglyphMode,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}) : void 0;\n\t\treturn ok(ctx.present({ data: document }, graphPresentations({\n\t\t\tdocument,\n\t\t\ttree,\n\t\t\tdot,\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tspace: args.flags.space,\n\t\t\tlegend\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/list.ts\nfunction listPresentations(inputs) {\n\tconst legend = inputs.legend;\n\treturn {\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t}, ...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(inputs.tree)\n\t\t\t},\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}]\n\t\t],\n\t\tjson: () => inputs.list\n\t};\n}\nconst migrationListCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"List on-disk migrations per contract space\",\n\t\tdescription: \"Enumerates every on-disk migration under migrations/<space>/ for every\\ncontract space found on disk. Offline — does not consult the database.\\nHuman output draws the shared migration graph tree with operation counts,\\ninvariants on each migration row, and refs on destination contract nodes.\\nPass --space <id> to narrow to one contract space. --ascii forces ASCII\\ntree glyphs.\",\n\t\texamples: [\n\t\t\t\"migration list\",\n\t\t\t\"migration list --space app\",\n\t\t\t\"migration list --ascii\",\n\t\t\t\"migration list --legend\",\n\t\t\t\"migration list --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tascii: flag.boolean({ brief: \"Use ASCII kind glyphs (pipe-friendly)\" }),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk(normalizeError(listed.failure));\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst tree = renderMigrationListWithStyle(listed.value, styler, glyphMode, {\n\t\t\tcolorize: true,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE,\n\t\t\tliveContractHash,\n\t\t\tgraphForSpace: (spaceId) => aggregate.space(spaceId)?.graph(),\n\t\t\tappSpaceId: aggregate.app.spaceId\n\t\t});\n\t\tconst legend = args.flags.legend ? renderMigrationGraphLegend({\n\t\t\tcolorize: true,\n\t\t\tglyphMode,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}) : void 0;\n\t\treturn ok(ctx.present({ data: listed.value }, listPresentations({\n\t\t\tlist: listed.value,\n\t\t\ttree,\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tspace: args.flags.space,\n\t\t\tlegend\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/flags.ts\n/**\n* The database connection override, declared from here by every command that\n* accepts one so its brief and placeholder cannot drift apart. Resolution\n* order is the flag, then `config.db.connection`, then\n* `CONFIG.DB_CONNECTION_REQUIRED`.\n*/\nconst dbFlag = flag.string({\n\tbrief: \"Database connection string\",\n\tplaceholder: \"url\"\n});\n//#endregion\n//#region src/orm/migration/log.ts\nconst HEADING_APPLIED_AT = \"Applied at\";\nconst HEADING_SPACE = \"Space\";\nconst HEADING_MIGRATION = \"Migration\";\nconst HEADING_CHANGE = \"Change\";\nconst HEADING_OPS = \"Ops\";\n/**\n* The ledger laid out for the engine to size. The Space heading appears only\n* when more than one contract space has run, as it does in the commander shell.\n*/\nfunction ledgerGrid(entries, options) {\n\tconst styler = createToneMigrationListStyler();\n\tconst sorted = sortLedgerEntries(entries);\n\tconst showSpace = new Set(sorted.map((entry) => entry.space)).size > 1;\n\tconst headings = [HEADING_APPLIED_AT];\n\tif (showSpace) headings.push(HEADING_SPACE);\n\theadings.push(HEADING_MIGRATION, HEADING_CHANGE, HEADING_OPS);\n\treturn {\n\t\theadings,\n\t\trows: sorted.map((entry) => {\n\t\t\tconst cells = [formatLedgerAppliedAt(entry.appliedAt, options.utc ? \"utc\" : \"local\")];\n\t\t\tif (showSpace) cells.push(entry.space);\n\t\t\tcells.push(toneSpans(styler.dirName(entry.migrationName)), toneSpans(styleHashTransition(entry.from, entry.to, styler, options.glyphMode)), `${entry.operationCount} ops`);\n\t\t\treturn cells;\n\t\t})\n\t};\n}\nfunction logPresentations(inputs) {\n\tconst grid = inputs.grid;\n\treturn {\n\t\thuman: () => [...inputs.database === void 0 ? [] : [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: inputs.database\n\t\t\t}]\n\t\t}], ...grid === void 0 ? [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: MIGRATION_LOG_EMPTY_MESSAGE\n\t\t}] : [{\n\t\t\tkind: \"table\",\n\t\t\tcolumns: grid.headings,\n\t\t\trows: grid.rows\n\t\t}]],\n\t\tjson: () => inputs.document\n\t};\n}\nconst migrationLogCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show executed migration history\",\n\t\tdescription: \"Reads the database ledger and displays every applied migration edge in\\nchronological order, including rollbacks and re-applies, merged across\\nall contract spaces. Requires a database connection.\",\n\t\texamples: [\n\t\t\t\"migration log\",\n\t\t\t\"migration log --db $DATABASE_URL\",\n\t\t\t\"migration log --utc\",\n\t\t\t\"migration log --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tdb: dbFlag,\n\t\tutc: flag.boolean({ brief: \"Render human timestamps in UTC instead of local time\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\tconst missingDb = requireLiveDatabase({\n\t\t\tdbConnection,\n\t\t\thasDriver: ctx.config.driver !== void 0,\n\t\t\twhy: \"migration log needs a database connection and driver to read the ledger (set db.connection in prisma-next.config.ts, or pass --db <url>)\",\n\t\t\tcommandName: \"migration log\"\n\t\t});\n\t\tif (missingDb !== null) return notOk(normalizeError(missingDb));\n\t\tif (!targetSupportsMigrations(ctx.config.target)) return notOk(normalizeError(errorTargetMigrationNotSupported({ why: \"migration log reads the ledger a migration runner writes, and the configured target provides no runner.\" })));\n\t\tconst client = createControlClient({\n\t\t\tfamily: ctx.config.family,\n\t\t\ttarget: ctx.config.target,\n\t\t\tadapter: ctx.config.adapter,\n\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\textensions: ctx.config.extensions ?? []\n\t\t});\n\t\tlet entries;\n\t\ttry {\n\t\t\tawait client.connect(dbConnection);\n\t\t\tentries = await client.readLedger();\n\t\t} catch (error) {\n\t\t\treturn notOk(normalizeError(mapCaughtMigrationError(error) ?? errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read migration log: ${error instanceof Error ? error.message : String(error)}` })));\n\t\t} finally {\n\t\t\tawait closeQuietly(client);\n\t\t}\n\t\tconst records = serializeLedgerEntriesForJson(entries);\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\trecords,\n\t\t\tsummary: `${records.length} migration(s) applied`\n\t\t};\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\treturn ok(ctx.present({ data: document }, logPresentations({\n\t\t\tdocument,\n\t\t\tgrid: entries.length === 0 ? void 0 : ledgerGrid(entries, {\n\t\t\t\tutc: args.flags.utc,\n\t\t\t\tglyphMode\n\t\t\t}),\n\t\t\tdatabase: typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/show.ts\n/** One node per operation, the destructive ones carrying the warning glyph. */\nfunction operationNodes(migration) {\n\treturn migration.operations.map((operation) => operation.operationClass === \"destructive\" ? {\n\t\tlabel: operation.label,\n\t\tstatus: \"warn\"\n\t} : { label: operation.label });\n}\nfunction operationBlocks(migration) {\n\tif (migration.operations.length === 0) return [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttext: \"No operations.\"\n\t}];\n\tconst destructive = migration.operations.some((operation) => operation.operationClass === \"destructive\");\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: [{\n\t\t\tlabel: `${migration.operations.length} operation(s)`,\n\t\t\tchildren: operationNodes(migration)\n\t\t}]\n\t}, ...destructive ? [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"This migration contains destructive operations that may cause data loss.\"\n\t}] : []];\n}\n/**\n* The statement preview: text a database would run, printed verbatim rather\n* than laid out, so nothing is re-wrapped between here and the reader.\n*/\nfunction previewBlocks(migration) {\n\tconst statements = migration.preview.statements.map((statement) => statement.text.trim()).filter((text) => text.length > 0).map((text) => text.endsWith(\";\") ? text : `${text};`);\n\tif (statements.length === 0) return [];\n\treturn [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: previewBlockHeader(migration.preview)\n\t}, {\n\t\tkind: \"drawing\",\n\t\tlines: statements\n\t}];\n}\nfunction showPresentations(inputs) {\n\tconst migration = inputs.document.migration;\n\treturn {\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.appMigrationsRelative\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"target\",\n\t\t\t\t\t\tvalue: inputs.target\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: [{\n\t\t\t\t\ttext: migration.name,\n\t\t\t\t\ttone: \"emphasis\"\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\t\tvalue: migration.fromContract === null ? [{\n\t\t\t\t\t\t\ttext: \"(baseline)\",\n\t\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t\t}] : [{\n\t\t\t\t\t\t\ttext: migration.fromContract,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.toContract,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"hash\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.hash,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"created\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.createdAt,\n\t\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t...operationBlocks(migration),\n\t\t\t...previewBlocks(migration)\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\n/**\n* A path-looking target must land inside `migrations/app/`; anything else is a\n* migration reference resolved against the app graph and refs. Both routes are\n* app-space only, as they are today.\n*/\nfunction resolvePackage(inputs) {\n\tif (looksLikePath(inputs.target)) {\n\t\tconst path = resolveAppTargetPath(inputs.cwd, inputs.target, inputs.appMigrationsDir, inputs.appMigrationsRelative);\n\t\tif (!path.ok) return notOk(normalizeError(path.failure));\n\t\tconst matched = findPackageByDirPath(inputs.packages, path.value);\n\t\treturn matched === void 0 ? notOk(normalizeError(errorMigrationPackageNotFound(`No loaded migration package at ${relative(inputs.cwd, path.value)}`))) : ok(matched);\n\t}\n\tif (inputs.packages.length === 0) return notOk(normalizeError(errorNoMigrations(inputs.appMigrationsRelative)));\n\tconst ref = resolveMigrationRef(inputs.target, {\n\t\tgraph: inputs.graph,\n\t\trefs: inputs.refs\n\t});\n\tif (!ref.ok) return notOk(normalizeError(ref.failure));\n\tconst matched = inputs.packages.find((candidate) => candidate.metadata.migrationHash === ref.value.migrationHash);\n\treturn matched === void 0 ? notOk(normalizeError(errorMigrationPackageNotFound(`Resolved migration \"${ref.value.dirName}\" but the package was not loaded`))) : ok(matched);\n}\nconst migrationShowCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Display migration package contents\",\n\t\tdescription: \"Shows the operations, statement preview, and metadata for one app-space\\nmigration. Accepts a directory path, directory name, or hash prefix.\\nOffline — does not consult the database.\",\n\t\texamples: [\n\t\t\t\"migration show 20260101_100000_add_user\",\n\t\t\t\"migration show a1b2c3\",\n\t\t\t\"migration show migrations/app/20260101_100000_add_user\",\n\t\t\t\"migration show 20260101_100000_add_user --json\"\n\t\t]\n\t},\n\targs: { positionals: { target: positional.string({\n\t\tbrief: \"Migration reference: directory name, hash/prefix, ref, or path\",\n\t\tplaceholder: \"target\"\n\t}) } },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst { target } = args.positionals;\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\tif (contractPath === void 0) return notOk(normalizeError(errorConfigValidation(\"contract.output\", {\n\t\t\twhy: \"migration show reads the emitted contract from config.contract.output; the config has no value to read.\",\n\t\t\tsection: \"contract\"\n\t\t})));\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsDir = appMigrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsRelative = displayPath(appMigrationsDir, ctx.cwd);\n\t\tlet contractJson;\n\t\ttry {\n\t\t\tcontractJson = await readFile(contractPath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\treturn notOk(normalizeError(Reflect.get(Object(error), \"code\") === \"ENOENT\" ? errorFileNotFound(contractPath, {\n\t\t\t\twhy: `Contract file not found at ${contractPath}`,\n\t\t\t\tfix: `Run \\`prisma-next contract emit\\` to generate ${relative(ctx.cwd, contractPath)}`\n\t\t\t}) : errorUnexpected(error instanceof Error ? error.message : String(error), { why: \"Failed to read contract file\" })));\n\t\t}\n\t\tconst familyInstance = ctx.config.family.create(createControlStack(ctx.config));\n\t\tlet appContract;\n\t\ttry {\n\t\t\tappContract = familyInstance.deserializeContract(castAs(JSON.parse(contractJson)));\n\t\t} catch (error) {\n\t\t\treturn notOk(normalizeError(errorContractValidationFailed(`Contract at ${contractPath} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPath } })));\n\t\t}\n\t\tconst loaded = await loadContractSpaceAggregateForCli({\n\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\tmigrationsDir,\n\t\t\tappContract,\n\t\t\textensions: [],\n\t\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t\t});\n\t\tif (!loaded.ok) return notOk(normalizeError(loaded.failure));\n\t\tconst aggregate = loaded.value;\n\t\tconst resolved = resolvePackage({\n\t\t\ttarget,\n\t\t\tcwd: ctx.cwd,\n\t\t\tappMigrationsDir,\n\t\t\tappMigrationsRelative,\n\t\t\tpackages: aggregate.app.packages,\n\t\t\tgraph: aggregate.app.graph(),\n\t\t\trefs: aggregate.app.refs\n\t\t});\n\t\tif (!resolved.ok) return notOk(resolved.failure);\n\t\tconst pkg = resolved.value;\n\t\tconst client = createControlClient({\n\t\t\tfamily: ctx.config.family,\n\t\t\ttarget: ctx.config.target,\n\t\t\tadapter: ctx.config.adapter,\n\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\textensions: ctx.config.extensions ?? []\n\t\t});\n\t\tconst ops = castAs(pkg.ops);\n\t\tconst preview = client.toOperationPreview(ops) ?? { statements: [] };\n\t\tconst migration = {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tname: pkg.dirName,\n\t\t\thash: pkg.metadata.migrationHash,\n\t\t\tfromContract: pkg.metadata.from,\n\t\t\ttoContract: pkg.metadata.to,\n\t\t\tcreatedAt: pkg.metadata.createdAt,\n\t\t\toperations: ops.map((op) => ({\n\t\t\t\tid: op.id,\n\t\t\t\tlabel: op.label,\n\t\t\t\toperationClass: op.operationClass\n\t\t\t})),\n\t\t\tpreview: { statements: [...preview.statements] }\n\t\t};\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\tsummary: `Migration ${migration.name} in ${migration.space}: ${migration.operations.length} operation(s)`,\n\t\t\tmigration\n\t\t};\n\t\treturn ok(ctx.present({ data: document }, showPresentations({\n\t\t\tdocument,\n\t\t\tcontractPath: displayPath(contractPath, ctx.cwd),\n\t\t\tappMigrationsRelative,\n\t\t\ttarget\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/family.ts\n/**\n* The engine derives each diagnostic's docs link from this base plus the\n* dotted code.\n*/\nconst DOCS_BASE_URL = `${DOCS_BASE}/`;\n/**\n* The unit the ORM contributes to a CLI: its config section, its commands by\n* name, where its diagnostics are documented, and the invocations it retired.\n* The shell owns the command tree, so nothing here says where a command mounts.\n*/\nconst ormCommandFamily = defineCommandFamily({\n\tconfigSection: ormConfigSection,\n\tcommands: {\n\t\t\"migration graph\": migrationGraphCommand,\n\t\t\"migration list\": migrationListCommand,\n\t\t\"migration log\": migrationLogCommand,\n\t\t\"migration show\": migrationShowCommand\n\t},\n\tdocsBaseUrl: DOCS_BASE_URL,\n\tredirects: [{\n\t\tfrom: \"migration apply\",\n\t\treplacement: \"{bin} migrate --to <contract>\",\n\t\treason: \"Applying a migration is a move to a target contract, not a verb of its own.\"\n\t}, {\n\t\tfrom: \"migration ref\",\n\t\treplacement: \"{bin} ref set|list|delete\",\n\t\treason: \"Refs are managed by their own command, for every space rather than migrations alone.\"\n\t}]\n});\n//#endregion\n//#region src/orm/load-config.ts\n/** The file the ORM's loader reads when `--config` names none. */\nconst ORM_CONFIG_FILENAME = \"prisma-next.config.ts\";\n/**\n* Builds the engine's `Runtime.config` from `prisma-next.config.ts`.\n*\n* The engine's own loader reads `prisma.config.ts` and the `$prismaConfig`\n* marker, which is not the file this bin reads, so the bin owns the load: the\n* ORM's c12 loader evaluates the module asynchronously and finalizes paths\n* against the config file's own directory. The whole result nests as the\n* single `orm` section — the engine models one section per family, and\n* `contract`, `db`, `migrations` and the rest are subsections of it.\n*\n* Only failures that prevent evaluation entirely are diagnostics here, and\n* they carry `section: null` so they fail exactly the commands that read\n* config. Structural verdicts belong to the section validator.\n*/\nasync function loadOrmConfig(options) {\n\tconst path = resolve(options.cwd, options.configPath ?? ORM_CONFIG_FILENAME);\n\tconst loaded = await loadConfig(options.configPath, { cwd: options.cwd });\n\tif (!loaded.ok) return {\n\t\tpath,\n\t\tsections: {},\n\t\tdiagnostics: [{\n\t\t\tsection: null,\n\t\t\tdiagnostic: toEngineDiagnostic(loaded.failure)\n\t\t}]\n\t};\n\treturn {\n\t\tpath,\n\t\tsections: { [\"orm\"]: loaded.value.config },\n\t\tdiagnostics: []\n\t};\n}\n//#endregion\nexport { migrationListCommand as a, ormConfigSection as c, migrationLogCommand as i, ormCommandFamily as n, migrationGraphCommand as o, migrationShowCommand as r, normalizeError as s, loadOrmConfig as t };\n\n//# sourceMappingURL=load-config-DFptcz_M.mjs.map","import { t as createContractEmitCommand } from \"../contract-emit-D-vxAjLQ.mjs\";\nimport { t as createFormatCommand } from \"../format-DZ7Vowat.mjs\";\nimport { c as ormConfigSection, n as ormCommandFamily, t as loadOrmConfig } from \"../load-config-DFptcz_M.mjs\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { join, resolve } from \"pathe\";\nimport { existsSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { tmpdir } from \"node:os\";\nimport { pathToFileURL } from \"node:url\";\nimport { build } from \"esbuild\";\n//#region src/load-ts-contract.ts\nfunction contractSourceError(code, message, options) {\n\tconst error = new CliStructuredError(code, message, options?.meta !== void 0 ? { meta: options.meta } : void 0);\n\tif (options?.cause !== void 0) error.cause = options.cause;\n\treturn error;\n}\nconst DEFAULT_ALLOWLIST = [\n\t\"@internal/*\",\n\t\"@prisma/orm-*\",\n\t\"node:crypto\"\n];\nfunction isAllowedImport(importPath, allowlist) {\n\tfor (const pattern of allowlist) if (pattern.endsWith(\"/*\")) {\n\t\tconst prefix = pattern.slice(0, -2);\n\t\tif (importPath === prefix || importPath.startsWith(`${prefix}/`)) return true;\n\t} else if (pattern.endsWith(\"*\")) {\n\t\tconst prefix = pattern.slice(0, -1);\n\t\tif (importPath.startsWith(prefix)) return true;\n\t} else if (importPath === pattern) return true;\n\treturn false;\n}\nfunction validatePurity(value, entryPath) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tconst path = /* @__PURE__ */ new WeakSet();\n\tfunction check(value) {\n\t\tif (value === null || typeof value !== \"object\") return;\n\t\tif (path.has(value)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export contains circular references\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"circular\"\n\t\t} });\n\t\tpath.add(value);\n\t\ttry {\n\t\t\tfor (const key in value) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\t\t\tif (descriptor && (descriptor.get || descriptor.set)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains getter/setter at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"getter\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tif (descriptor && typeof descriptor.value === \"function\") throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains function at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"function\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tcheck(value[key]);\n\t\t\t}\n\t\t} finally {\n\t\t\tpath.delete(value);\n\t\t}\n\t}\n\ttry {\n\t\tcheck(value);\n\t\tJSON.stringify(value);\n\t} catch (error) {\n\t\tif (error instanceof Error) {\n\t\t\tif (error.message.includes(\"getter\") || error.message.includes(\"circular\")) throw error;\n\t\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export is not JSON-serializable: ${error.message}`, {\n\t\t\t\tmeta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"not-json-serializable\"\n\t\t\t\t},\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export is not JSON-serializable\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-json-serializable\"\n\t\t} });\n\t}\n}\nfunction createImportAllowlistPlugin(allowlist, entryPath, collected) {\n\tconst entryAbs = resolve(entryPath);\n\tfunction isFromEntry(importer) {\n\t\treturn importer === entryAbs || importer === entryPath || importer === \"<stdin>\";\n\t}\n\treturn {\n\t\tname: \"import-allowlist\",\n\t\tsetup(build) {\n\t\t\tbuild.onResolve({ filter: /.*/ }, (args) => {\n\t\t\t\tif (args.kind === \"entry-point\") return;\n\t\t\t\tif (args.path.startsWith(\".\") || args.path.startsWith(\"/\")) return;\n\t\t\t\tif (isFromEntry(args.importer) && !isAllowedImport(args.path, allowlist)) {\n\t\t\t\t\tcollected.add(args.path);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpath: args.path,\n\t\t\t\t\t\texternal: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n}\n/**\n* Loads a contract from a TypeScript file and returns it as Contract.\n*\n* **Responsibility: Parsing Only**\n* This function loads and parses a TypeScript contract file. It does NOT normalize the contract.\n* The contract should already be normalized if it was built using the contract builder.\n*\n* Normalization must happen in the contract builder when the contract is created.\n* This function only validates that the contract is JSON-serializable and returns it as-is.\n*\n* @param entryPath - Path to the TypeScript contract file\n* @param options - Optional configuration (import allowlist)\n* @returns The contract as Contract (should already be normalized)\n* @throws structured errors: `CLI.FILE_NOT_FOUND`, `CONTRACT.SOURCE_LOAD_FAILED`,\n* `CONTRACT.SOURCE_IMPORT_DISALLOWED`, `CONTRACT.MODULE_EXPORT_MISSING`, `CONTRACT.EXPORT_INVALID`\n*/\nasync function loadContractFromTs(entryPath, options) {\n\tconst allowlist = options?.allowlist ?? DEFAULT_ALLOWLIST;\n\tif (!existsSync(entryPath)) throw new CliStructuredError(\"CLI.FILE_NOT_FOUND\", `Contract file not found: ${entryPath}`, { where: { path: entryPath } });\n\tconst tempFile = join(tmpdir(), `prisma-next-contract-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);\n\tconst disallowedFromEntry = /* @__PURE__ */ new Set();\n\ttry {\n\t\tconst result = await build({\n\t\t\tentryPoints: [entryPath],\n\t\t\tbundle: true,\n\t\t\tformat: \"esm\",\n\t\t\tplatform: \"node\",\n\t\t\ttarget: \"es2022\",\n\t\t\toutfile: tempFile,\n\t\t\twrite: false,\n\t\t\tmetafile: true,\n\t\t\tplugins: [createImportAllowlistPlugin(allowlist, entryPath, disallowedFromEntry)],\n\t\t\tlogLevel: \"error\"\n\t\t});\n\t\tif (result.errors.length > 0) throw contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to bundle contract file: ${result.errors.map((e) => e.text).join(\"\\n\")}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\tstage: \"bundle\"\n\t\t} });\n\t\tif (!result.outputFiles || result.outputFiles.length === 0) throw new InternalError(\"No output files generated from bundling\");\n\t\tif (disallowedFromEntry.size > 0) throw contractSourceError(\"CONTRACT.SOURCE_IMPORT_DISALLOWED\", `Disallowed imports detected. Only imports matching the allowlist are permitted:\\n Allowlist: ${allowlist.join(\", \")}\\n Disallowed imports: ${[...disallowedFromEntry].join(\", \")}`, { meta: {\n\t\t\tallowlist: [...allowlist],\n\t\t\tdisallowed: [...disallowedFromEntry]\n\t\t} });\n\t\tconst bundleContent = result.outputFiles[0]?.text;\n\t\tif (bundleContent === void 0) throw new InternalError(\"Bundle content is undefined\");\n\t\twriteFileSync(tempFile, bundleContent, \"utf-8\");\n\t\tconst module = await import(\n\t\t\t/* @vite-ignore */\n\t\t\tpathToFileURL(tempFile).href\n);\n\t\tunlinkSync(tempFile);\n\t\tlet contract;\n\t\tif (module.default !== void 0) contract = module.default;\n\t\telse if (module.contract !== void 0) contract = module.contract;\n\t\telse throw new CliStructuredError(\"CONTRACT.MODULE_EXPORT_MISSING\", `Contract file must export a contract as default export or named export 'contract'. Found exports: ${Object.keys(module).join(\", \") || \"none\"}`, { where: { path: entryPath } });\n\t\tif (typeof contract !== \"object\" || contract === null) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export must be an object, got ${typeof contract}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-object\"\n\t\t} });\n\t\tvalidatePurity(contract, entryPath);\n\t\treturn contract;\n\t} catch (error) {\n\t\ttry {\n\t\t\tif (tempFile) unlinkSync(tempFile);\n\t\t} catch {}\n\t\tif (error instanceof Error) throw error;\n\t\tthrow contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to load contract from ${entryPath}: ${String(error)}`, {\n\t\t\tmeta: {\n\t\t\t\tpath: entryPath,\n\t\t\t\tstage: \"import\"\n\t\t\t},\n\t\t\tcause: error\n\t\t});\n\t}\n}\n//#endregion\nexport { createContractEmitCommand, createFormatCommand, loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,wBAAwB;CAC7B,MAAM;CACN,OAAO;CACP,SAAS;AACV;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO;EACN,MAAM;EACN,OAAO,WAAW,MAAM;CACzB;AACD;AACA,SAAS,gBAAgB,OAAO;CAC/B,OAAO;EACN,MAAM;EACN,UAAU;EACV,SAAS,MAAM;EACf,KAAK,MAAM;EACX,aAAa,CAAC,iBAAiB,MAAM,KAAK,CAAC;EAC3C,MAAM;GACL,OAAO,MAAM;GACb,SAAS,MAAM;EAChB;CACD;AACD;AACA,SAAS,0BAA0B;CAClC,OAAO;EACN,MAAM;EACN,UAAU;EACV,SAAS;EACT,KAAK;EACL,aAAa,CAAC,qBAAqB;CACpC;AACD;AACA,SAAS,wBAAwB;CAChC,OAAO;EACN,MAAM;EACN,UAAU;EACV,SAAS;EACT,KAAK;EACL,aAAa,CAAC;GACb,MAAM;GACN,OAAO;EACR,CAAC;CACF;AACD;AACA,SAAS,qBAAqB,OAAO;CACpC,OAAO;EACN,MAAM;EACN,UAAU;EACV,SAAS;EACT,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAC1D,aAAa,CAAC;GACb,MAAM;GACN,OAAO;EACR,CAAC;CACF;AACD;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC3E;;;;;;AAMA,SAAS,+BAA+B,KAAK;CAC5C,MAAM,WAAW,IAAI;CACrB,IAAI,CAAC,SAAS,Q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0BAA0B,CAAC,GAAG,mBAAmB,CAAC,CAAC,KAAK,IAAI,KAAK,EAAE,MAAM;GAC/R,WAAW,CAAC,GAAG,SAAS;GACxB,YAAY,CAAC,GAAG,mBAAmB;EACpC,EAAE,CAAC;EACH,MAAM,gBAAgB,OAAO,YAAY,EAAE,EAAE;EAC7C,IAAI,kBAAkB,KAAK,GAAG,MAAM,IAAI,cAAc,6BAA6B;EACnF,cAAc,UAAU,eAAe,OAAO;EAC9C,MAAM,SAAS,MAAM;;GAEpB,cAAc,QAAQ,CAAC,CAAC;;EAEzB,WAAW,QAAQ;EACnB,IAAI;EACJ,IAAI,OAAO,YAAY,KAAK,GAAG,WAAW,OAAO;OAC5C,IAAI,OAAO,aAAa,KAAK,GAAG,WAAW,OAAO;OAClD,MAAM,IAAI,mBAAmB,kCAAkC,qGAAqG,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,EAAE,CAAC;EACnP,IAAI,OAAO,aAAa,YAAY,aAAa,MAAM,MAAM,oBAAoB,2BAA2B,0CAA0C,OAAO,YAAY,EAAE,MAAM;GAChL,MAAM;GACN,QAAQ;EACT,EAAE,CAAC;EACH,eAAe,UAAU,SAAS;EAClC,OAAO;CACR,SAAS,OAAO;EACf,IAAI;GACH,IAAI,UAAU,WAAW,QAAQ;EAClC,QAAQ,CAAC;EACT,IAAI,iBAAiB,OAAO,MAAM;EAClC,MAAM,oBAAoB,+BAA+B,gCAAgC,UAAU,IAAI,OAAO,KAAK,KAAK;GACvH,MAAM;IACL,MAAM;IACN,OAAO;GACR;GACA,OAAO;EACR,CAAC;CACF;AACD"}
1
+ {"version":3,"file":"cli.mjs","names":["CliStructuredError","errorConfigValidation"],"sources":["../../../../1-framework/3-tooling/cli/dist/load-config-Dmql8awN.mjs","../../../../1-framework/3-tooling/cli/dist/exports/index.mjs"],"sourcesContent":["import { A as errorTargetMigrationNotSupported, M as errorUnexpected, P as requireLiveDatabase, _ as errorMigrationPackageNotFound, i as errorConfigValidation, m as errorLegendHumanOnly, o as errorContractValidationFailed, u as errorFileNotFound, y as errorNoMigrations } from \"./cli-errors-CihMAEVj.mjs\";\nimport { u as previewBlockHeader } from \"./terminal-ui-JJKxvT0q.mjs\";\nimport { a as maskConnectionUrl, n as closeQuietly, p as targetSupportsMigrations } from \"./command-helpers-Dw3LDEu_.mjs\";\nimport { a as loadContractSpaceAggregateForCli, r as buildReadAggregate } from \"./contract-space-aggregate-loader-1wG1OiDk.mjs\";\nimport { t as createControlClient } from \"./client-C4Gh4PBz.mjs\";\nimport { t as mapCaughtMigrationError } from \"./caught-errors-B_oGFiYw.mjs\";\nimport { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList } from \"./migration-list-AKRIIovW.mjs\";\nimport { n as resolveMigrationRef } from \"./ref-resolution-Bi4lpxM8.mjs\";\nimport { S as toneSpans, a as renderMigrationGraphLegend, b as TONE_MIGRATION_GRAPH_PALETTE, l as renderMigrationListWithStyle, s as createToneMigrationListStyler, x as toneDrawing } from \"./migration-graph-command-render-CgdHruiZ.mjs\";\nimport { n as looksLikePath, r as resolveAppTargetPath, t as findPackageByDirPath } from \"./migration-path-target-yA4h5Zc6.mjs\";\nimport { t as buildMigrationSpaceGraphEntries } from \"./migration-graph-BtP1Va3T.mjs\";\nimport { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from \"./migration-graph-sections-CceYWPCP.mjs\";\nimport { a as sortLedgerEntries, i as serializeLedgerEntriesForJson, n as formatLedgerAppliedAt, o as styleHashTransition, t as MIGRATION_LOG_EMPTY_MESSAGE } from \"./migration-log-table-JR7fFVbE.mjs\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { normalize, relative, resolve } from \"pathe\";\nimport { readFile } from \"node:fs/promises\";\nimport { APP_SPACE_ID, createControlStack } from \"@internal/framework-components/control\";\nimport { spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { DOCS_BASE, isStructuredError } from \"@internal/utils/structured-error\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, flag, positional } from \"@prisma/cli-engine\";\nimport { collectConfigIssues } from \"@internal/config/config-validation\";\nimport { CliStructuredError, notOk, ok } from \"@prisma/cli-engine/protocol\";\nconst MISSING_CONFIG_ACTION = {\n\tkind: \"run-command\",\n\tlabel: \"Create a configuration file\",\n\tcommand: \"prisma-next init\"\n};\nfunction editConfigAction(field) {\n\treturn {\n\t\tkind: \"edit-file\",\n\t\tlabel: `Correct ${field} in prisma-next.config.ts`\n\t};\n}\nfunction issueDiagnostic(issue) {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: issue.message,\n\t\twhy: issue.message,\n\t\tnextActions: [editConfigAction(issue.field)],\n\t\tmeta: {\n\t\t\tfield: issue.field,\n\t\t\tsection: issue.section\n\t\t}\n\t};\n}\nfunction sectionAbsentDiagnostic() {\n\treturn {\n\t\tcode: \"CONFIG.FILE_NOT_FOUND\",\n\t\tseverity: \"error\",\n\t\tsummary: \"No Prisma Next configuration was loaded\",\n\t\twhy: `The orm config section is absent, so prisma-next.config.ts was never evaluated.`,\n\t\tnextActions: [MISSING_CONFIG_ACTION]\n\t};\n}\nfunction notAnObjectDiagnostic() {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: \"Prisma Next configuration must be an object\",\n\t\twhy: `The orm config section is not an object, so no section can be read from it.`,\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Export a configuration object from prisma-next.config.ts\"\n\t\t}]\n\t};\n}\nfunction unreadableDiagnostic(error) {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: \"Prisma Next configuration could not be inspected\",\n\t\twhy: error instanceof Error ? error.message : String(error),\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Export a plain configuration object from prisma-next.config.ts\"\n\t\t}]\n\t};\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/**\n* An emitted artifact listed as its own contract input makes every emit\n* consume its previous output. Structural, filesystem-free, and therefore the\n* section validator's business rather than the loader's.\n*/\nfunction collectArtifactCollisionIssues(raw) {\n\tconst contract = raw[\"contract\"];\n\tif (!isRecord(contract)) return [];\n\tconst source = contract[\"source\"];\n\tconst output = contract[\"output\"];\n\tif (!isRecord(source) || typeof output !== \"string\") return [];\n\tconst inputs = source[\"inputs\"];\n\tif (!Array.isArray(inputs)) return [];\n\tlet emitted;\n\ttry {\n\t\temitted = getEmittedArtifactPaths(output);\n\t} catch (error) {\n\t\treturn [{\n\t\t\tsection: \"contract\",\n\t\t\tfield: \"contract.output\",\n\t\t\tmessage: error instanceof Error ? error.message : String(error)\n\t\t}];\n\t}\n\tconst emittedPaths = /* @__PURE__ */ new Set([normalize(emitted.jsonPath), normalize(emitted.dtsPath)]);\n\tif (!inputs.some((input) => typeof input === \"string\" && emittedPaths.has(normalize(input)))) return [];\n\treturn [{\n\t\tsection: \"contract\",\n\t\tfield: \"contract.source.inputs[]\",\n\t\tmessage: \"Config.contract.source.inputs must not include emitted artifact paths derived from contract.output\"\n\t}];\n}\nfunction validate(raw) {\n\tif (raw === void 0) return {\n\t\tok: false,\n\t\tdiagnostics: [sectionAbsentDiagnostic()]\n\t};\n\tif (!isRecord(raw)) return {\n\t\tok: false,\n\t\tdiagnostics: [notAnObjectDiagnostic()]\n\t};\n\tlet issues;\n\ttry {\n\t\tissues = [...collectConfigIssues(raw), ...collectArtifactCollisionIssues(raw)];\n\t} catch (error) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tdiagnostics: [unreadableDiagnostic(error)]\n\t\t};\n\t}\n\tif (issues.length > 0) return {\n\t\tok: false,\n\t\tdiagnostics: issues.map(issueDiagnostic)\n\t};\n\treturn {\n\t\tok: true,\n\t\tvalue: blindCast(raw),\n\t\tdiagnostics: []\n\t};\n}\nconst ormConfigSection = defineConfigSection({\n\tname: \"orm\",\n\tvalidate\n});\n//#endregion\n//#region src/orm/normalize-error.ts\n/**\n* `isStructuredError` is the repo's own check, and it is the one that matters here: it holds the\n* regular expression for a dotted `NAMESPACE.SUBCODE`, so only a code the protocol accepts\n* reaches `Diagnostic['code']`.\n*/\nfunction isRaisedError(error) {\n\treturn error instanceof Error && isStructuredError(error);\n}\n/**\n* The fallback for anything that is not a structured error: a bare throw, and also an error whose\n* `code` is not a dotted one — a Node `ENOENT`, say. The rejected code survives in `meta` rather\n* than in `code`, where it would produce a docs link to a page that does not exist.\n*/\nfunction toUnexpected(error) {\n\tconst summary = error instanceof Error ? error.message : String(error);\n\tconst rejectedCode = error instanceof Error ? Reflect.get(error, \"code\") : void 0;\n\treturn new CliStructuredError(\"CLI.UNEXPECTED\", summary, {\n\t\t...ifDefined(\"meta\", typeof rejectedCode === \"string\" ? { code: rejectedCode } : void 0),\n\t\tcause: error\n\t});\n}\n/**\n* Both classes name themselves `CliStructuredError`, so the engine's duck test\n* accepts prisma/prisma's too, and a CLI factory carrying typed actions looks\n* conformant without being one — its `toEnvelope` still writes `fix` and no\n* `nextActions`. Only an error the engine itself built is already in protocol\n* shape, and `@prisma/cli-engine` is an exact-pinned, unbundled dependency, so\n* there is one module instance and identity holds.\n*/\nfunction conformsToProtocol(error) {\n\treturn error instanceof CliStructuredError;\n}\n/**\n* Turns the transitional `fix` prose into typed actions. A multi-line fix is\n* several pieces of advice, so it becomes one action per line.\n*/\nfunction actionsFromFix(fix) {\n\tif (fix === void 0) return [];\n\treturn fix.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0).map((label) => ({\n\t\tkind: \"user-choice\",\n\t\tlabel\n\t}));\n}\n/**\n* Projects a prisma/prisma-raised error onto the engine's diagnostic shape.\n*/\nfunction toEngineDiagnostic(error) {\n\treturn {\n\t\tcode: error.code,\n\t\tseverity: error.severity ?? \"error\",\n\t\tsummary: error.message,\n\t\t...ifDefined(\"why\", error.why),\n\t\tnextActions: error.nextActions ?? actionsFromFix(error.fix),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\t...ifDefined(\"docsUrl\", error.docsUrl)\n\t};\n}\n/**\n* The handler boundary's single conversion. Handlers pass every error they\n* return through `notOk` — and every error a top-of-handler catch sees —\n* through this, so a settled envelope always carries `nextActions` and never\n* the non-protocol `fix` field.\n*/\nfunction normalizeError(error) {\n\tif (conformsToProtocol(error)) return error;\n\tif (!isRaisedError(error)) return toUnexpected(error);\n\tconst diagnostic = toEngineDiagnostic(error);\n\treturn new CliStructuredError(diagnostic.code, diagnostic.summary, {\n\t\tseverity: diagnostic.severity,\n\t\tnextActions: diagnostic.nextActions,\n\t\t...ifDefined(\"why\", diagnostic.why),\n\t\t...ifDefined(\"where\", diagnostic.where),\n\t\t...ifDefined(\"meta\", diagnostic.meta),\n\t\t...ifDefined(\"docsUrl\", diagnostic.docsUrl),\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/orm/define-command.ts\n/**\n* `defineCommand` with the ORM's error boundary already attached. Every ORM command is defined\n* through this rather than through `defineCommand` directly.\n*\n* Without it, an error a handler throws reaches the engine, whose duck test accepts\n* prisma/prisma's `CliStructuredError` — both classes carry that name — and then settles it\n* through fields the engine's own class has and this one does not. The envelope that results is\n* off-protocol. Catching here means every handler settles through the single conversion instead.\n*/\nfunction defineOrmCommand(def) {\n\treturn defineCommand({\n\t\t...def,\n\t\thandler: async (args, ctx) => {\n\t\t\ttry {\n\t\t\t\treturn await def.handler(args, ctx);\n\t\t\t} catch (error) {\n\t\t\t\treturn notOk(normalizeError(error));\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\n//#region src/orm/migration/paths.ts\n/**\n* Where migrations live for this project. Resolved against the invocation\n* directory, which is also the config file's directory for every default\n* invocation.\n*/\nfunction migrationsDirFor(config, cwd) {\n\treturn resolve(cwd, config.migrations?.dir ?? \"migrations\");\n}\n/** The app subspace under {@link migrationsDirFor}. */\nfunction appMigrationsDirFor(config, cwd) {\n\treturn spaceMigrationDirectory(migrationsDirFor(config, cwd), APP_SPACE_ID);\n}\n/**\n* The emitted contract. The config loader has already resolved\n* `contract.output` against the config file's directory, so this only has an\n* effect for a config handed in raw, as tests do.\n*/\nfunction contractPathFor(config, cwd) {\n\tconst output = config.contract?.output;\n\treturn output === void 0 ? void 0 : resolve(cwd, output);\n}\n/**\n* The header's rendering of a path: relative to where the user invoked the\n* CLI, as the commander shell rendered it against the config file.\n*/\nfunction displayPath(path, cwd) {\n\treturn relative(cwd, path);\n}\n//#endregion\n//#region src/orm/migration/graph.ts\n/**\n* The tree is a drawing for a reader; the DOT document is a graph description\n* for another program, so it is the one thing here that belongs on stdout.\n*/\nfunction graphPresentations(inputs) {\n\tconst { tree, dot, legend } = inputs;\n\treturn {\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t}, ...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]]\n\t\t\t},\n\t\t\t...tree === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(tree)\n\t\t\t}],\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}]\n\t\t],\n\t\t...dot === void 0 ? {} : { stdout: () => dot.split(\"\\n\") },\n\t\tjson: () => inputs.document\n\t};\n}\nfunction graphSummary(spaces) {\n\tconst contracts = spaces.reduce((count, space) => count + space.contracts.length, 0);\n\tconst migrations = spaces.reduce((count, space) => count + space.migrations.length, 0);\n\treturn `${spaces.length} space(s), ${contracts} contract(s), ${migrations} migration(s)`;\n}\nconst migrationGraphCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show the migration graph topology\",\n\t\tdescription: \"Renders the migration graph topology. Offline — does not consult the\\ndatabase. --ascii swaps box-drawing for pipe-friendly ASCII glyphs.\\n--dot emits Graphviz DOT for the app graph instead of the tree, and\\nignores --space; in json mode the result carries the DOT text alongside\\nthe graph document.\",\n\t\texamples: [\n\t\t\t\"migration graph\",\n\t\t\t\"migration graph --json\",\n\t\t\t\"migration graph --dot\",\n\t\t\t\"migration graph --ascii\",\n\t\t\t\"migration graph --legend\",\n\t\t\t\"migration graph --space app\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tdot: flag.boolean({ brief: \"Emit Graphviz DOT for the app graph\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" }),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tif (args.flags.legend && args.flags.dot) return notOk(normalizeError(errorLegendHumanOnly(\"--dot\")));\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk(normalizeError(listed.failure));\n\t\tconst scopedSpaces = listed.value.spaces;\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst graphSpaces = [...buildMigrationSpaceGraphEntries({\n\t\t\taggregate,\n\t\t\tscopedSpaces\n\t\t})];\n\t\tconst summary = graphSummary(graphSpaces);\n\t\tconst graphDocument = {\n\t\t\tok: true,\n\t\t\tspaces: graphSpaces,\n\t\t\tsummary\n\t\t};\n\t\tconst dot = args.flags.dot ? renderMigrationGraphDot(aggregate.app.graph()) : void 0;\n\t\tconst document = dot === void 0 ? graphDocument : {\n\t\t\t...graphDocument,\n\t\t\tdot\n\t\t};\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst tree = dot === void 0 ? renderMigrationGraphSections(buildMigrationGraphTreeSections({\n\t\t\taggregate,\n\t\t\tscopedSpaces,\n\t\t\tliveContractHash,\n\t\t\tglyphMode,\n\t\t\tcolorize: true,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}), styler.summary(summary)) : void 0;\n\t\tconst legend = args.flags.legend ? renderMigrationGraphLegend({\n\t\t\tcolorize: true,\n\t\t\tglyphMode,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}) : void 0;\n\t\treturn ok(ctx.present({ data: document }, graphPresentations({\n\t\t\tdocument,\n\t\t\ttree,\n\t\t\tdot,\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tspace: args.flags.space,\n\t\t\tlegend\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/list.ts\nfunction listPresentations(inputs) {\n\tconst legend = inputs.legend;\n\treturn {\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t}, ...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(inputs.tree)\n\t\t\t},\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}]\n\t\t],\n\t\tjson: () => inputs.list\n\t};\n}\nconst migrationListCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"List on-disk migrations per contract space\",\n\t\tdescription: \"Enumerates every on-disk migration under migrations/<space>/ for every\\ncontract space found on disk. Offline — does not consult the database.\\nHuman output draws the shared migration graph tree with operation counts,\\ninvariants on each migration row, and refs on destination contract nodes.\\nPass --space <id> to narrow to one contract space. --ascii forces ASCII\\ntree glyphs.\",\n\t\texamples: [\n\t\t\t\"migration list\",\n\t\t\t\"migration list --space app\",\n\t\t\t\"migration list --ascii\",\n\t\t\t\"migration list --legend\",\n\t\t\t\"migration list --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tascii: flag.boolean({ brief: \"Use ASCII kind glyphs (pipe-friendly)\" }),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk(normalizeError(listed.failure));\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst tree = renderMigrationListWithStyle(listed.value, styler, glyphMode, {\n\t\t\tcolorize: true,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE,\n\t\t\tliveContractHash,\n\t\t\tgraphForSpace: (spaceId) => aggregate.space(spaceId)?.graph(),\n\t\t\tappSpaceId: aggregate.app.spaceId\n\t\t});\n\t\tconst legend = args.flags.legend ? renderMigrationGraphLegend({\n\t\t\tcolorize: true,\n\t\t\tglyphMode,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}) : void 0;\n\t\treturn ok(ctx.present({ data: listed.value }, listPresentations({\n\t\t\tlist: listed.value,\n\t\t\ttree,\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tspace: args.flags.space,\n\t\t\tlegend\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/flags.ts\n/**\n* The database connection override, declared from here by every command that\n* accepts one so its brief and placeholder cannot drift apart. Resolution\n* order is the flag, then `config.db.connection`, then\n* `CONFIG.DB_CONNECTION_REQUIRED`.\n*/\nconst dbFlag = flag.string({\n\tbrief: \"Database connection string\",\n\tplaceholder: \"url\"\n});\n//#endregion\n//#region src/orm/migration/log.ts\nconst HEADING_APPLIED_AT = \"Applied at\";\nconst HEADING_SPACE = \"Space\";\nconst HEADING_MIGRATION = \"Migration\";\nconst HEADING_CHANGE = \"Change\";\nconst HEADING_OPS = \"Ops\";\n/**\n* The ledger laid out for the engine to size. The Space heading appears only\n* when more than one contract space has run, as it does in the commander shell.\n*/\nfunction ledgerGrid(entries, options) {\n\tconst styler = createToneMigrationListStyler();\n\tconst sorted = sortLedgerEntries(entries);\n\tconst showSpace = new Set(sorted.map((entry) => entry.space)).size > 1;\n\tconst headings = [HEADING_APPLIED_AT];\n\tif (showSpace) headings.push(HEADING_SPACE);\n\theadings.push(HEADING_MIGRATION, HEADING_CHANGE, HEADING_OPS);\n\treturn {\n\t\theadings,\n\t\trows: sorted.map((entry) => {\n\t\t\tconst cells = [formatLedgerAppliedAt(entry.appliedAt, options.utc ? \"utc\" : \"local\")];\n\t\t\tif (showSpace) cells.push(entry.space);\n\t\t\tcells.push(toneSpans(styler.dirName(entry.migrationName)), toneSpans(styleHashTransition(entry.from, entry.to, styler, options.glyphMode)), `${entry.operationCount} ops`);\n\t\t\treturn cells;\n\t\t})\n\t};\n}\nfunction logPresentations(inputs) {\n\tconst grid = inputs.grid;\n\treturn {\n\t\thuman: () => [...inputs.database === void 0 ? [] : [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: inputs.database\n\t\t\t}]\n\t\t}], ...grid === void 0 ? [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: MIGRATION_LOG_EMPTY_MESSAGE\n\t\t}] : [{\n\t\t\tkind: \"table\",\n\t\t\tcolumns: grid.headings,\n\t\t\trows: grid.rows\n\t\t}]],\n\t\tjson: () => inputs.document\n\t};\n}\nconst migrationLogCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show executed migration history\",\n\t\tdescription: \"Reads the database ledger and displays every applied migration edge in\\nchronological order, including rollbacks and re-applies, merged across\\nall contract spaces. Requires a database connection.\",\n\t\texamples: [\n\t\t\t\"migration log\",\n\t\t\t\"migration log --db $DATABASE_URL\",\n\t\t\t\"migration log --utc\",\n\t\t\t\"migration log --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tdb: dbFlag,\n\t\tutc: flag.boolean({ brief: \"Render human timestamps in UTC instead of local time\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\tconst missingDb = requireLiveDatabase({\n\t\t\tdbConnection,\n\t\t\thasDriver: ctx.config.driver !== void 0,\n\t\t\twhy: \"migration log needs a database connection and driver to read the ledger (set db.connection in prisma-next.config.ts, or pass --db <url>)\",\n\t\t\tcommandName: \"migration log\"\n\t\t});\n\t\tif (missingDb !== null) return notOk(normalizeError(missingDb));\n\t\tif (!targetSupportsMigrations(ctx.config.target)) return notOk(normalizeError(errorTargetMigrationNotSupported({ why: \"migration log reads the ledger a migration runner writes, and the configured target provides no runner.\" })));\n\t\tconst client = createControlClient({\n\t\t\tfamily: ctx.config.family,\n\t\t\ttarget: ctx.config.target,\n\t\t\tadapter: ctx.config.adapter,\n\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\textensions: ctx.config.extensions ?? []\n\t\t});\n\t\tlet entries;\n\t\ttry {\n\t\t\tawait client.connect(dbConnection);\n\t\t\tentries = await client.readLedger();\n\t\t} catch (error) {\n\t\t\treturn notOk(normalizeError(mapCaughtMigrationError(error) ?? errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read migration log: ${error instanceof Error ? error.message : String(error)}` })));\n\t\t} finally {\n\t\t\tawait closeQuietly(client);\n\t\t}\n\t\tconst records = serializeLedgerEntriesForJson(entries);\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\trecords,\n\t\t\tsummary: `${records.length} migration(s) applied`\n\t\t};\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\treturn ok(ctx.present({ data: document }, logPresentations({\n\t\t\tdocument,\n\t\t\tgrid: entries.length === 0 ? void 0 : ledgerGrid(entries, {\n\t\t\t\tutc: args.flags.utc,\n\t\t\t\tglyphMode\n\t\t\t}),\n\t\t\tdatabase: typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/show.ts\n/** One node per operation, the destructive ones carrying the warning glyph. */\nfunction operationNodes(migration) {\n\treturn migration.operations.map((operation) => operation.operationClass === \"destructive\" ? {\n\t\tlabel: operation.label,\n\t\tstatus: \"warn\"\n\t} : { label: operation.label });\n}\nfunction operationBlocks(migration) {\n\tif (migration.operations.length === 0) return [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttext: \"No operations.\"\n\t}];\n\tconst destructive = migration.operations.some((operation) => operation.operationClass === \"destructive\");\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: [{\n\t\t\tlabel: `${migration.operations.length} operation(s)`,\n\t\t\tchildren: operationNodes(migration)\n\t\t}]\n\t}, ...destructive ? [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"This migration contains destructive operations that may cause data loss.\"\n\t}] : []];\n}\n/**\n* The statement preview: text a database would run, printed verbatim rather\n* than laid out, so nothing is re-wrapped between here and the reader.\n*/\nfunction previewBlocks(migration) {\n\tconst statements = migration.preview.statements.map((statement) => statement.text.trim()).filter((text) => text.length > 0).map((text) => text.endsWith(\";\") ? text : `${text};`);\n\tif (statements.length === 0) return [];\n\treturn [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: previewBlockHeader(migration.preview)\n\t}, {\n\t\tkind: \"drawing\",\n\t\tlines: statements\n\t}];\n}\nfunction showPresentations(inputs) {\n\tconst migration = inputs.document.migration;\n\treturn {\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.appMigrationsRelative\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"target\",\n\t\t\t\t\t\tvalue: inputs.target\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: [{\n\t\t\t\t\ttext: migration.name,\n\t\t\t\t\ttone: \"emphasis\"\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\t\tvalue: migration.fromContract === null ? [{\n\t\t\t\t\t\t\ttext: \"(baseline)\",\n\t\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t\t}] : [{\n\t\t\t\t\t\t\ttext: migration.fromContract,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.toContract,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"hash\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.hash,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"created\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.createdAt,\n\t\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t...operationBlocks(migration),\n\t\t\t...previewBlocks(migration)\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\n/**\n* A path-looking target must land inside `migrations/app/`; anything else is a\n* migration reference resolved against the app graph and refs. Both routes are\n* app-space only, as they are today.\n*/\nfunction resolvePackage(inputs) {\n\tif (looksLikePath(inputs.target)) {\n\t\tconst path = resolveAppTargetPath(inputs.cwd, inputs.target, inputs.appMigrationsDir, inputs.appMigrationsRelative);\n\t\tif (!path.ok) return notOk(normalizeError(path.failure));\n\t\tconst matched = findPackageByDirPath(inputs.packages, path.value);\n\t\treturn matched === void 0 ? notOk(normalizeError(errorMigrationPackageNotFound(`No loaded migration package at ${relative(inputs.cwd, path.value)}`))) : ok(matched);\n\t}\n\tif (inputs.packages.length === 0) return notOk(normalizeError(errorNoMigrations(inputs.appMigrationsRelative)));\n\tconst ref = resolveMigrationRef(inputs.target, {\n\t\tgraph: inputs.graph,\n\t\trefs: inputs.refs\n\t});\n\tif (!ref.ok) return notOk(normalizeError(ref.failure));\n\tconst matched = inputs.packages.find((candidate) => candidate.metadata.migrationHash === ref.value.migrationHash);\n\treturn matched === void 0 ? notOk(normalizeError(errorMigrationPackageNotFound(`Resolved migration \"${ref.value.dirName}\" but the package was not loaded`))) : ok(matched);\n}\nconst migrationShowCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Display migration package contents\",\n\t\tdescription: \"Shows the operations, statement preview, and metadata for one app-space\\nmigration. Accepts a directory path, directory name, or hash prefix.\\nOffline — does not consult the database.\",\n\t\texamples: [\n\t\t\t\"migration show 20260101_100000_add_user\",\n\t\t\t\"migration show a1b2c3\",\n\t\t\t\"migration show migrations/app/20260101_100000_add_user\",\n\t\t\t\"migration show 20260101_100000_add_user --json\"\n\t\t]\n\t},\n\targs: { positionals: { target: positional.string({\n\t\tbrief: \"Migration reference: directory name, hash/prefix, ref, or path\",\n\t\tplaceholder: \"target\"\n\t}) } },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst { target } = args.positionals;\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\tif (contractPath === void 0) return notOk(normalizeError(errorConfigValidation(\"contract.output\", {\n\t\t\twhy: \"migration show reads the emitted contract from config.contract.output; the config has no value to read.\",\n\t\t\tsection: \"contract\"\n\t\t})));\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsDir = appMigrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsRelative = displayPath(appMigrationsDir, ctx.cwd);\n\t\tlet contractJson;\n\t\ttry {\n\t\t\tcontractJson = await readFile(contractPath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\treturn notOk(normalizeError(Reflect.get(Object(error), \"code\") === \"ENOENT\" ? errorFileNotFound(contractPath, {\n\t\t\t\twhy: `Contract file not found at ${contractPath}`,\n\t\t\t\tfix: `Run \\`prisma-next contract emit\\` to generate ${relative(ctx.cwd, contractPath)}`\n\t\t\t}) : errorUnexpected(error instanceof Error ? error.message : String(error), { why: \"Failed to read contract file\" })));\n\t\t}\n\t\tconst familyInstance = ctx.config.family.create(createControlStack(ctx.config));\n\t\tlet appContract;\n\t\ttry {\n\t\t\tappContract = familyInstance.deserializeContract(castAs(JSON.parse(contractJson)));\n\t\t} catch (error) {\n\t\t\treturn notOk(normalizeError(errorContractValidationFailed(`Contract at ${contractPath} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPath } })));\n\t\t}\n\t\tconst loaded = await loadContractSpaceAggregateForCli({\n\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\tmigrationsDir,\n\t\t\tappContract,\n\t\t\textensions: [],\n\t\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t\t});\n\t\tif (!loaded.ok) return notOk(normalizeError(loaded.failure));\n\t\tconst aggregate = loaded.value;\n\t\tconst resolved = resolvePackage({\n\t\t\ttarget,\n\t\t\tcwd: ctx.cwd,\n\t\t\tappMigrationsDir,\n\t\t\tappMigrationsRelative,\n\t\t\tpackages: aggregate.app.packages,\n\t\t\tgraph: aggregate.app.graph(),\n\t\t\trefs: aggregate.app.refs\n\t\t});\n\t\tif (!resolved.ok) return notOk(resolved.failure);\n\t\tconst pkg = resolved.value;\n\t\tconst client = createControlClient({\n\t\t\tfamily: ctx.config.family,\n\t\t\ttarget: ctx.config.target,\n\t\t\tadapter: ctx.config.adapter,\n\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\textensions: ctx.config.extensions ?? []\n\t\t});\n\t\tconst ops = castAs(pkg.ops);\n\t\tconst preview = client.toOperationPreview(ops) ?? { statements: [] };\n\t\tconst migration = {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tname: pkg.dirName,\n\t\t\thash: pkg.metadata.migrationHash,\n\t\t\tfromContract: pkg.metadata.from,\n\t\t\ttoContract: pkg.metadata.to,\n\t\t\tcreatedAt: pkg.metadata.createdAt,\n\t\t\toperations: ops.map((op) => ({\n\t\t\t\tid: op.id,\n\t\t\t\tlabel: op.label,\n\t\t\t\toperationClass: op.operationClass\n\t\t\t})),\n\t\t\tpreview: { statements: [...preview.statements] }\n\t\t};\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\tsummary: `Migration ${migration.name} in ${migration.space}: ${migration.operations.length} operation(s)`,\n\t\t\tmigration\n\t\t};\n\t\treturn ok(ctx.present({ data: document }, showPresentations({\n\t\t\tdocument,\n\t\t\tcontractPath: displayPath(contractPath, ctx.cwd),\n\t\t\tappMigrationsRelative,\n\t\t\ttarget\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/family.ts\n/**\n* The engine derives each diagnostic's docs link from this base plus the\n* dotted code.\n*/\nconst DOCS_BASE_URL = `${DOCS_BASE}/`;\n/**\n* The unit the ORM contributes to a CLI: its config section, its commands by\n* name, where its diagnostics are documented, and the invocations it retired.\n* The shell owns the command tree, so nothing here says where a command mounts.\n*/\nconst ormCommandFamily = defineCommandFamily({\n\tconfigSection: ormConfigSection,\n\tcommands: {\n\t\t\"migration graph\": migrationGraphCommand,\n\t\t\"migration list\": migrationListCommand,\n\t\t\"migration log\": migrationLogCommand,\n\t\t\"migration show\": migrationShowCommand\n\t},\n\tdocsBaseUrl: DOCS_BASE_URL,\n\tredirects: [{\n\t\tfrom: \"migration apply\",\n\t\treplacement: \"{bin} migrate --to <contract>\",\n\t\treason: \"Applying a migration is a move to a target contract, not a verb of its own.\"\n\t}, {\n\t\tfrom: \"migration ref\",\n\t\treplacement: \"{bin} ref set|list|delete\",\n\t\treason: \"Refs are managed by their own command, for every space rather than migrations alone.\"\n\t}]\n});\n//#endregion\n//#region src/orm/load-config.ts\n/** The file the ORM's loader reads when `--config` names none. */\nconst ORM_CONFIG_FILENAME = \"prisma-next.config.ts\";\n/**\n* Builds the engine's `Runtime.config` from `prisma-next.config.ts`.\n*\n* The engine's own loader reads `prisma.config.ts` and the `$prismaConfig`\n* marker, which is not the file this bin reads, so the bin owns the load: the\n* ORM's c12 loader evaluates the module asynchronously and finalizes paths\n* against the config file's own directory. The whole result nests as the\n* single `orm` section — the engine models one section per family, and\n* `contract`, `db`, `migrations` and the rest are subsections of it.\n*\n* Only failures that prevent evaluation entirely are diagnostics here, and\n* they carry `section: null` so they fail exactly the commands that read\n* config. Structural verdicts belong to the section validator.\n*/\nasync function loadOrmConfig(options) {\n\tconst path = resolve(options.cwd, options.configPath ?? ORM_CONFIG_FILENAME);\n\tconst loaded = await loadConfig(options.configPath, { cwd: options.cwd });\n\tif (!loaded.ok) return {\n\t\tpath,\n\t\tsections: {},\n\t\tdiagnostics: [{\n\t\t\tsection: null,\n\t\t\tdiagnostic: toEngineDiagnostic(loaded.failure)\n\t\t}]\n\t};\n\treturn {\n\t\tpath,\n\t\tsections: { [\"orm\"]: loaded.value.config },\n\t\tdiagnostics: []\n\t};\n}\n//#endregion\nexport { migrationListCommand as a, ormConfigSection as c, migrationLogCommand as i, ormCommandFamily as n, migrationGraphCommand as o, migrationShowCommand as r, normalizeError as s, loadOrmConfig as t };\n\n//# sourceMappingURL=load-config-Dmql8awN.mjs.map","import { t as createContractEmitCommand } from \"../contract-emit-CIdgw3Kq.mjs\";\nimport { t as createFormatCommand } from \"../format-CYdgHub4.mjs\";\nimport { c as ormConfigSection, n as ormCommandFamily, t as loadOrmConfig } from \"../load-config-Dmql8awN.mjs\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { join, resolve } from \"pathe\";\nimport { existsSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { tmpdir } from \"node:os\";\nimport { pathToFileURL } from \"node:url\";\nimport { build } from \"esbuild\";\n//#region src/load-ts-contract.ts\nfunction contractSourceError(code, message, options) {\n\tconst error = new CliStructuredError(code, message, options?.meta !== void 0 ? { meta: options.meta } : void 0);\n\tif (options?.cause !== void 0) error.cause = options.cause;\n\treturn error;\n}\nconst DEFAULT_ALLOWLIST = [\n\t\"@internal/*\",\n\t\"@prisma/orm-*\",\n\t\"node:crypto\"\n];\nfunction isAllowedImport(importPath, allowlist) {\n\tfor (const pattern of allowlist) if (pattern.endsWith(\"/*\")) {\n\t\tconst prefix = pattern.slice(0, -2);\n\t\tif (importPath === prefix || importPath.startsWith(`${prefix}/`)) return true;\n\t} else if (pattern.endsWith(\"*\")) {\n\t\tconst prefix = pattern.slice(0, -1);\n\t\tif (importPath.startsWith(prefix)) return true;\n\t} else if (importPath === pattern) return true;\n\treturn false;\n}\nfunction validatePurity(value, entryPath) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tconst path = /* @__PURE__ */ new WeakSet();\n\tfunction check(value) {\n\t\tif (value === null || typeof value !== \"object\") return;\n\t\tif (path.has(value)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export contains circular references\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"circular\"\n\t\t} });\n\t\tpath.add(value);\n\t\ttry {\n\t\t\tfor (const key in value) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\t\t\tif (descriptor && (descriptor.get || descriptor.set)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains getter/setter at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"getter\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tif (descriptor && typeof descriptor.value === \"function\") throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains function at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"function\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tcheck(value[key]);\n\t\t\t}\n\t\t} finally {\n\t\t\tpath.delete(value);\n\t\t}\n\t}\n\ttry {\n\t\tcheck(value);\n\t\tJSON.stringify(value);\n\t} catch (error) {\n\t\tif (error instanceof Error) {\n\t\t\tif (error.message.includes(\"getter\") || error.message.includes(\"circular\")) throw error;\n\t\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export is not JSON-serializable: ${error.message}`, {\n\t\t\t\tmeta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"not-json-serializable\"\n\t\t\t\t},\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export is not JSON-serializable\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-json-serializable\"\n\t\t} });\n\t}\n}\nfunction createImportAllowlistPlugin(allowlist, entryPath, collected) {\n\tconst entryAbs = resolve(entryPath);\n\tfunction isFromEntry(importer) {\n\t\treturn importer === entryAbs || importer === entryPath || importer === \"<stdin>\";\n\t}\n\treturn {\n\t\tname: \"import-allowlist\",\n\t\tsetup(build) {\n\t\t\tbuild.onResolve({ filter: /.*/ }, (args) => {\n\t\t\t\tif (args.kind === \"entry-point\") return;\n\t\t\t\tif (args.path.startsWith(\".\") || args.path.startsWith(\"/\")) return;\n\t\t\t\tif (isFromEntry(args.importer) && !isAllowedImport(args.path, allowlist)) {\n\t\t\t\t\tcollected.add(args.path);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpath: args.path,\n\t\t\t\t\t\texternal: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n}\n/**\n* Loads a contract from a TypeScript file and returns it as Contract.\n*\n* **Responsibility: Parsing Only**\n* This function loads and parses a TypeScript contract file. It does NOT normalize the contract.\n* The contract should already be normalized if it was built using the contract builder.\n*\n* Normalization must happen in the contract builder when the contract is created.\n* This function only validates that the contract is JSON-serializable and returns it as-is.\n*\n* @param entryPath - Path to the TypeScript contract file\n* @param options - Optional configuration (import allowlist)\n* @returns The contract as Contract (should already be normalized)\n* @throws structured errors: `CLI.FILE_NOT_FOUND`, `CONTRACT.SOURCE_LOAD_FAILED`,\n* `CONTRACT.SOURCE_IMPORT_DISALLOWED`, `CONTRACT.MODULE_EXPORT_MISSING`, `CONTRACT.EXPORT_INVALID`\n*/\nasync function loadContractFromTs(entryPath, options) {\n\tconst allowlist = options?.allowlist ?? DEFAULT_ALLOWLIST;\n\tif (!existsSync(entryPath)) throw new CliStructuredError(\"CLI.FILE_NOT_FOUND\", `Contract file not found: ${entryPath}`, { where: { path: entryPath } });\n\tconst tempFile = join(tmpdir(), `prisma-next-contract-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);\n\tconst disallowedFromEntry = /* @__PURE__ */ new Set();\n\ttry {\n\t\tconst result = await build({\n\t\t\tentryPoints: [entryPath],\n\t\t\tbundle: true,\n\t\t\tformat: \"esm\",\n\t\t\tplatform: \"node\",\n\t\t\ttarget: \"es2022\",\n\t\t\toutfile: tempFile,\n\t\t\twrite: false,\n\t\t\tmetafile: true,\n\t\t\tplugins: [createImportAllowlistPlugin(allowlist, entryPath, disallowedFromEntry)],\n\t\t\tlogLevel: \"error\"\n\t\t});\n\t\tif (result.errors.length > 0) throw contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to bundle contract file: ${result.errors.map((e) => e.text).join(\"\\n\")}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\tstage: \"bundle\"\n\t\t} });\n\t\tif (!result.outputFiles || result.outputFiles.length === 0) throw new InternalError(\"No output files generated from bundling\");\n\t\tif (disallowedFromEntry.size > 0) throw contractSourceError(\"CONTRACT.SOURCE_IMPORT_DISALLOWED\", `Disallowed imports detected. Only imports matching the allowlist are permitted:\\n Allowlist: ${allowlist.join(\", \")}\\n Disallowed imports: ${[...disallowedFromEntry].join(\", \")}`, { meta: {\n\t\t\tallowlist: [...allowlist],\n\t\t\tdisallowed: [...disallowedFromEntry]\n\t\t} });\n\t\tconst bundleContent = result.outputFiles[0]?.text;\n\t\tif (bundleContent === void 0) throw new InternalError(\"Bundle content is undefined\");\n\t\twriteFileSync(tempFile, bundleContent, \"utf-8\");\n\t\tconst module = await import(\n\t\t\t/* @vite-ignore */\n\t\t\tpathToFileURL(tempFile).href\n);\n\t\tunlinkSync(tempFile);\n\t\tlet contract;\n\t\tif (module.default !== void 0) contract = module.default;\n\t\telse if (module.contract !== void 0) contract = module.contract;\n\t\telse throw new CliStructuredError(\"CONTRACT.MODULE_EXPORT_MISSING\", `Contract file must export a contract as default export or named export 'contract'. Found exports: ${Object.keys(module).join(\", \") || \"none\"}`, { where: { path: entryPath } });\n\t\tif (typeof contract !== \"object\" || contract === null) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export must be an object, got ${typeof contract}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-object\"\n\t\t} });\n\t\tvalidatePurity(contract, entryPath);\n\t\treturn contract;\n\t} catch (error) {\n\t\ttry {\n\t\t\tif (tempFile) unlinkSync(tempFile);\n\t\t} catch {}\n\t\tif (error instanceof Error) throw error;\n\t\tthrow contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to load contract from ${entryPath}: ${String(error)}`, {\n\t\t\tmeta: {\n\t\t\t\tpath: entryPath,\n\t\t\t\tstage: \"import\"\n\t\t\t},\n\t\t\tcause: error\n\t\t});\n\t}\n}\n//#endregion\nexport { createContractEmitCommand, createFormatCommand, loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,wBAAwB;CAC7B,MAAM;CACN,OAAO;CACP,SAAS;AACV;AACA,SAAS,iBAAiB,OAAO;C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nB,IAAI;EACJ,IAAI,OAAO,YAAY,KAAK,GAAG,WAAW,OAAO;OAC5C,IAAI,OAAO,aAAa,KAAK,GAAG,WAAW,OAAO;OAClD,MAAM,IAAI,mBAAmB,kCAAkC,qGAAqG,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,EAAE,CAAC;EACnP,IAAI,OAAO,aAAa,YAAY,aAAa,MAAM,MAAM,oBAAoB,2BAA2B,0CAA0C,OAAO,YAAY,EAAE,MAAM;GAChL,MAAM;GACN,QAAQ;EACT,EAAE,CAAC;EACH,eAAe,UAAU,SAAS;EAClC,OAAO;CACR,SAAS,OAAO;EACf,IAAI;GACH,IAAI,UAAU,WAAW,QAAQ;EAClC,QAAQ,CAAC;EACT,IAAI,iBAAiB,OAAO,MAAM;EAClC,MAAM,oBAAoB,+BAA+B,gCAAgC,UAAU,IAAI,OAAO,KAAK,KAAK;GACvH,MAAM;IACL,MAAM;IACN,OAAO;GACR;GACA,OAAO;EACR,CAAC;CACF;AACD"}
@@ -1,2 +1,2 @@
1
- import { t as createContractEmitCommand } from "./contract-emit-D-vxAjLQ-DjSGIBvi.mjs";
1
+ import { t as createContractEmitCommand } from "./contract-emit-CIdgw3Kq-BcfYaUfn.mjs";
2
2
  export { createContractEmitCommand };
@@ -1,2 +1,2 @@
1
- import { t as createContractInferCommand } from "./contract-infer-ButdiRXM-9KdWYvza.mjs";
1
+ import { t as createContractInferCommand } from "./contract-infer-xOEwVWds-CE5gw1PF.mjs";
2
2
  export { createContractInferCommand };