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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/dist/{aggregate-B4mhR4Sk.mjs → aggregate-i-rfetSO.mjs} +8 -8
  2. package/dist/{aggregate-B4mhR4Sk.mjs.map → aggregate-i-rfetSO.mjs.map} +1 -1
  3. package/dist/bin__prisma-next.mjs +22 -22
  4. package/dist/bin__prisma-next.mjs.map +1 -1
  5. package/dist/cli.mjs +2 -2
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/cli__commands__contract-emit.mjs +1 -1
  8. package/dist/cli__commands__contract-infer.mjs +1 -1
  9. package/dist/cli__commands__db-init.mjs +1 -1
  10. package/dist/cli__commands__db-schema.mjs +1 -1
  11. package/dist/cli__commands__db-sign.mjs +1 -1
  12. package/dist/cli__commands__db-update.mjs +1 -1
  13. package/dist/cli__commands__db-verify.mjs +1 -1
  14. package/dist/cli__commands__migrate.d.mts +1 -1
  15. package/dist/cli__commands__migrate.mjs +1 -1
  16. package/dist/cli__commands__migration-check.d.mts +1 -1
  17. package/dist/cli__commands__migration-check.mjs +1 -1
  18. package/dist/cli__commands__migration-graph.d.mts +1 -1
  19. package/dist/cli__commands__migration-graph.mjs +1 -1
  20. package/dist/cli__commands__migration-list.d.mts +1 -1
  21. package/dist/cli__commands__migration-list.mjs +1 -1
  22. package/dist/cli__commands__migration-log.d.mts +1 -1
  23. package/dist/cli__commands__migration-log.mjs +1 -1
  24. package/dist/cli__commands__migration-new.mjs +1 -1
  25. package/dist/cli__commands__migration-plan.mjs +1 -1
  26. package/dist/cli__commands__migration-show.mjs +1 -1
  27. package/dist/cli__commands__migration-status.d.mts +1 -1
  28. package/dist/cli__commands__migration-status.mjs +1 -1
  29. package/dist/cli__commands__ref.d.mts +1 -1
  30. package/dist/cli__commands__ref.mjs +1 -1
  31. package/dist/cli__commands__telemetry.mjs +1 -1
  32. package/dist/cli__control-api.d.mts +1 -1
  33. package/dist/cli__control-api.mjs +2 -2
  34. package/dist/cli__migration-cli.mjs +3 -6
  35. package/dist/cli__migration-cli.mjs.map +1 -1
  36. package/dist/{client-75qrAPqf-7l0C0H_b.mjs → client-7aUYC7ci-Bh9mLxkl.mjs} +16 -12
  37. package/dist/client-7aUYC7ci-Bh9mLxkl.mjs.map +1 -0
  38. package/dist/{command-helpers-CAoXqAY9-DWUBcTXM.mjs → command-helpers-C4WpR-QE-CK2gkj6l.mjs} +30 -74
  39. package/dist/command-helpers-C4WpR-QE-CK2gkj6l.mjs.map +1 -0
  40. package/dist/contract-at-errors-YdCQ5OOk-okxG7Eaj.mjs +44 -0
  41. package/dist/contract-at-errors-YdCQ5OOk-okxG7Eaj.mjs.map +1 -0
  42. package/dist/{contract-emit-B6odMoem-C87PBvmo.mjs → contract-emit-CTm2zfuG-8mtkxW8M.mjs} +12 -11
  43. package/dist/contract-emit-CTm2zfuG-8mtkxW8M.mjs.map +1 -0
  44. package/dist/{contract-emit-0hSjbuxp-BJLC-VgC.mjs → contract-emit-D8IXP9Qp-CecAQio1.mjs} +4 -4
  45. package/dist/{contract-emit-0hSjbuxp-BJLC-VgC.mjs.map → contract-emit-D8IXP9Qp-CecAQio1.mjs.map} +1 -1
  46. package/dist/{contract-infer-BnkqpftN-DwBzasOu.mjs → contract-infer-C8-RqHeK-D_dm3onP.mjs} +5 -5
  47. package/dist/contract-infer-C8-RqHeK-D_dm3onP.mjs.map +1 -0
  48. package/dist/{contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs → contract-snapshot-store-DNTOE6fB-BDpjbdCJ.mjs} +3 -3
  49. package/dist/{contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs.map → contract-snapshot-store-DNTOE6fB-BDpjbdCJ.mjs.map} +1 -1
  50. package/dist/{contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs → contract-space-aggregate-loader-CziO_ZRW-DIoQOL0P.mjs} +6 -6
  51. package/dist/contract-space-aggregate-loader-CziO_ZRW-DIoQOL0P.mjs.map +1 -0
  52. package/dist/{db-init-bd0_x2Q8.mjs → db-init-CXMcvoIA.mjs} +9 -12
  53. package/dist/db-init-CXMcvoIA.mjs.map +1 -0
  54. package/dist/{db-schema-CwgAWTqG.mjs → db-schema-j8DERh4t.mjs} +4 -4
  55. package/dist/{db-schema-CwgAWTqG.mjs.map → db-schema-j8DERh4t.mjs.map} +1 -1
  56. package/dist/{db-sign-vqiYfpjI.mjs → db-sign-xV_rpoIc.mjs} +10 -10
  57. package/dist/db-sign-xV_rpoIc.mjs.map +1 -0
  58. package/dist/{db-update-Br0diOCo.mjs → db-update-DXa2DIvu.mjs} +11 -11
  59. package/dist/db-update-DXa2DIvu.mjs.map +1 -0
  60. package/dist/{db-verify-CKPsRFrj-T7nSt7yT.mjs → db-verify-YWHjuKC7-DidK1gx1.mjs} +9 -6
  61. package/dist/db-verify-YWHjuKC7-DidK1gx1.mjs.map +1 -0
  62. package/dist/{errors--qsXZUtL.d.mts → errors-AkMBj-YP.d.mts} +8 -8
  63. package/dist/errors-AkMBj-YP.d.mts.map +1 -0
  64. package/dist/{errors-IpZm1Skp-BH495dRd.mjs → errors-BwusfLIN-BXM7K-ww.mjs} +42 -51
  65. package/dist/errors-BwusfLIN-BXM7K-ww.mjs.map +1 -0
  66. package/dist/{format-ByDm2goZ-BIRlFoo6.mjs → format-Bw3LVJ1v-D10inUT9.mjs} +12 -9
  67. package/dist/format-Bw3LVJ1v-D10inUT9.mjs.map +1 -0
  68. package/dist/{framework-components-CjshQKHA-Dlp6Leo5.mjs → framework-components-3DdB31mk-BPGSuOyZ.mjs} +3 -3
  69. package/dist/{framework-components-CjshQKHA-Dlp6Leo5.mjs.map → framework-components-3DdB31mk-BPGSuOyZ.mjs.map} +1 -1
  70. package/dist/{graph-membership-DW6nnbyQ-Bp2KcVwR.mjs → graph-membership-h9ejuZla-ewjYM5wz.mjs} +3 -3
  71. package/dist/{graph-membership-DW6nnbyQ-Bp2KcVwR.mjs.map → graph-membership-h9ejuZla-ewjYM5wz.mjs.map} +1 -1
  72. package/dist/{init-BGm77aWc-jHVUn63W.mjs → init-CPB89WK2-Di4kgP6B.mjs} +4 -4
  73. package/dist/{init-BGm77aWc-jHVUn63W.mjs.map → init-CPB89WK2-Di4kgP6B.mjs.map} +1 -1
  74. package/dist/{inspect-live-schema-CnwYTRZ0-P-6asJFl.mjs → inspect-live-schema-DEYE4EHW-DmSfKdpv.mjs} +4 -4
  75. package/dist/{inspect-live-schema-CnwYTRZ0-P-6asJFl.mjs.map → inspect-live-schema-DEYE4EHW-DmSfKdpv.mjs.map} +1 -1
  76. package/dist/{invariants-lXzy6txi-DAoP4nTE.mjs → invariants-CMcQxRas-CXX9uhQW.mjs} +3 -3
  77. package/dist/{invariants-lXzy6txi-DAoP4nTE.mjs.map → invariants-CMcQxRas-CXX9uhQW.mjs.map} +1 -1
  78. package/dist/{io-C8TdyBKt-DloEBi70.mjs → io-CL3hSv42-DGZtTs89.mjs} +8 -8
  79. package/dist/{io-C8TdyBKt-DloEBi70.mjs.map → io-CL3hSv42-DGZtTs89.mjs.map} +1 -1
  80. package/dist/{migrate-BdVFDKF2.mjs → migrate-COusRrm7.mjs} +28 -22
  81. package/dist/migrate-COusRrm7.mjs.map +1 -0
  82. package/dist/{migration-check-CcG-fB8r-qpu6xdbA.mjs → migration-check-CueEJelQ-J81XR_ns.mjs} +10 -10
  83. package/dist/migration-check-CueEJelQ-J81XR_ns.mjs.map +1 -0
  84. package/dist/{migration-command-scaffold-BCuoeAki-DMy_5ztW.mjs → migration-command-scaffold-DNRo4exb-9JCezdoT.mjs} +4 -4
  85. package/dist/{migration-command-scaffold-BCuoeAki-DMy_5ztW.mjs.map → migration-command-scaffold-DNRo4exb-9JCezdoT.mjs.map} +1 -1
  86. package/dist/{migration-BuUmO7It.mjs → migration-diUAhNaa.mjs} +3 -3
  87. package/dist/{migration-BuUmO7It.mjs.map → migration-diUAhNaa.mjs.map} +1 -1
  88. package/dist/{migration-graph-vmgkL3k4.mjs → migration-graph-BL6vfLcE.mjs} +4 -4
  89. package/dist/{migration-graph-vmgkL3k4.mjs.map → migration-graph-BL6vfLcE.mjs.map} +1 -1
  90. package/dist/{migration-graph-CBf9ORe7-B4xAF8GN.mjs → migration-graph-D6bN-mX0-DwMWY8DA.mjs} +3 -3
  91. package/dist/{migration-graph-CBf9ORe7-B4xAF8GN.mjs.map → migration-graph-D6bN-mX0-DwMWY8DA.mjs.map} +1 -1
  92. package/dist/{migration-list-BFBeo1_X-ckYMhETH.mjs → migration-list-D2_JdzWC-MRHYYVQE.mjs} +6 -6
  93. package/dist/{migration-list-BFBeo1_X-ckYMhETH.mjs.map → migration-list-D2_JdzWC-MRHYYVQE.mjs.map} +1 -1
  94. package/dist/{migration-log-CS5IWcNq-DI7FTHCA.mjs → migration-log-BXbz6-Lj-CKHbat5f.mjs} +4 -6
  95. package/dist/migration-log-BXbz6-Lj-CKHbat5f.mjs.map +1 -0
  96. package/dist/{migration-new-GmW2anVb.mjs → migration-new-szZFsA3C.mjs} +16 -15
  97. package/dist/migration-new-szZFsA3C.mjs.map +1 -0
  98. package/dist/{migration-path-target-D3Sj55PI-BICblCuk.mjs → migration-path-target-BPYp3LNc-qRQlG_Yn.mjs} +4 -4
  99. package/dist/migration-path-target-BPYp3LNc-qRQlG_Yn.mjs.map +1 -0
  100. package/dist/{migration-plan-q_L84PN1-ClkGgtVz.mjs → migration-plan-CxXAXYc8-Dnp-v8Nl.mjs} +17 -18
  101. package/dist/migration-plan-CxXAXYc8-Dnp-v8Nl.mjs.map +1 -0
  102. package/dist/{migration-show--pW4XhKs.mjs → migration-show-BKsIh7Uz.mjs} +9 -9
  103. package/dist/migration-show-BKsIh7Uz.mjs.map +1 -0
  104. package/dist/{migration-status-CFlzlRmu-QHUxHm_l.mjs → migration-status-CNnRInne--cvmx56T.mjs} +15 -15
  105. package/dist/migration-status-CNnRInne--cvmx56T.mjs.map +1 -0
  106. package/dist/migration-tools.d.mts +2 -2
  107. package/dist/migration-tools.mjs +12 -12
  108. package/dist/migration-tools__aggregate.mjs +1 -1
  109. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  110. package/dist/migration-tools__errors.d.mts +1 -1
  111. package/dist/migration-tools__errors.mjs +1 -1
  112. package/dist/migration-tools__invariants.mjs +1 -1
  113. package/dist/migration-tools__io.mjs +1 -1
  114. package/dist/migration-tools__migration-graph.mjs +2 -2
  115. package/dist/migration-tools__migration.mjs +1 -1
  116. package/dist/migration-tools__ref-resolution.mjs +1 -1
  117. package/dist/migration-tools__refs.mjs +1 -1
  118. package/dist/migration-tools__spaces.d.mts +1 -1
  119. package/dist/migration-tools__spaces.mjs +2 -2
  120. package/dist/{project-import-root-CpwLCDLY-DkVwAnWj.mjs → project-import-root-C_bd0ooL-CLXW-gp6.mjs} +10 -8
  121. package/dist/project-import-root-C_bd0ooL-CLXW-gp6.mjs.map +1 -0
  122. package/dist/{ref-sHE8zOcm.mjs → ref-DjZ5Y8ju.mjs} +11 -11
  123. package/dist/ref-DjZ5Y8ju.mjs.map +1 -0
  124. package/dist/{ref-advancement-CSPMoQs3-fEipZrdu.mjs → ref-advancement-CSPMoQs3-CPkL3IFF.mjs} +4 -4
  125. package/dist/{ref-advancement-CSPMoQs3-fEipZrdu.mjs.map → ref-advancement-CSPMoQs3-CPkL3IFF.mjs.map} +1 -1
  126. package/dist/{ref-resolution-BjJBWPjX.mjs → ref-resolution-BsdziDFA.mjs} +2 -2
  127. package/dist/{ref-resolution-BjJBWPjX.mjs.map → ref-resolution-BsdziDFA.mjs.map} +1 -1
  128. package/dist/{refs-BDbB9BRB-D6Za3Q49.mjs → refs-DtoeUivZ-qay0UMSP.mjs} +6 -6
  129. package/dist/refs-DtoeUivZ-qay0UMSP.mjs.map +1 -0
  130. package/dist/{spaces-C27bA-xc.mjs → spaces-BNd2Tlk0.mjs} +7 -7
  131. package/dist/spaces-BNd2Tlk0.mjs.map +1 -0
  132. package/dist/{spaces-DxFj5y8l.d.mts → spaces-D5qtTlhj.d.mts} +2 -2
  133. package/dist/{spaces-DxFj5y8l.d.mts.map → spaces-D5qtTlhj.d.mts.map} +1 -1
  134. package/dist/{telemetry-CmbCa3Ld-CmE5zcIG.mjs → telemetry-DVBHDQd6-BEdoMii0.mjs} +3 -3
  135. package/dist/{telemetry-CmbCa3Ld-CmE5zcIG.mjs.map → telemetry-DVBHDQd6-BEdoMii0.mjs.map} +1 -1
  136. package/dist/{types-DZWEs4si-D8UlyJI0.d.mts → types-2n_H3DQ9-Bks8UPEO.d.mts} +8 -2
  137. package/dist/types-2n_H3DQ9-Bks8UPEO.d.mts.map +1 -0
  138. package/dist/{verify-DnVNjc5C-BGdsblBK.mjs → verify-C6L_hiJU-CN3eEe3Y.mjs} +3 -3
  139. package/dist/{verify-DnVNjc5C-BGdsblBK.mjs.map → verify-C6L_hiJU-CN3eEe3Y.mjs.map} +1 -1
  140. package/dist/{verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs → verify-contract-spaces-Ak73-zQK-y4qVyu-y.mjs} +4 -4
  141. package/dist/{verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs.map → verify-contract-spaces-Ak73-zQK-y4qVyu-y.mjs.map} +1 -1
  142. package/dist/vite-plugin-contract-emit.mjs +1 -1
  143. package/package.json +12 -12
  144. package/dist/client-75qrAPqf-7l0C0H_b.mjs.map +0 -1
  145. package/dist/command-helpers-CAoXqAY9-DWUBcTXM.mjs.map +0 -1
  146. package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs +0 -36
  147. package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs.map +0 -1
  148. package/dist/contract-emit-B6odMoem-C87PBvmo.mjs.map +0 -1
  149. package/dist/contract-infer-BnkqpftN-DwBzasOu.mjs.map +0 -1
  150. package/dist/contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs.map +0 -1
  151. package/dist/db-init-bd0_x2Q8.mjs.map +0 -1
  152. package/dist/db-sign-vqiYfpjI.mjs.map +0 -1
  153. package/dist/db-update-Br0diOCo.mjs.map +0 -1
  154. package/dist/db-verify-CKPsRFrj-T7nSt7yT.mjs.map +0 -1
  155. package/dist/errors--qsXZUtL.d.mts.map +0 -1
  156. package/dist/errors-IpZm1Skp-BH495dRd.mjs.map +0 -1
  157. package/dist/format-ByDm2goZ-BIRlFoo6.mjs.map +0 -1
  158. package/dist/migrate-BdVFDKF2.mjs.map +0 -1
  159. package/dist/migration-check-CcG-fB8r-qpu6xdbA.mjs.map +0 -1
  160. package/dist/migration-log-CS5IWcNq-DI7FTHCA.mjs.map +0 -1
  161. package/dist/migration-new-GmW2anVb.mjs.map +0 -1
  162. package/dist/migration-path-target-D3Sj55PI-BICblCuk.mjs.map +0 -1
  163. package/dist/migration-plan-q_L84PN1-ClkGgtVz.mjs.map +0 -1
  164. package/dist/migration-show--pW4XhKs.mjs.map +0 -1
  165. package/dist/migration-status-CFlzlRmu-QHUxHm_l.mjs.map +0 -1
  166. package/dist/project-import-root-CpwLCDLY-DkVwAnWj.mjs.map +0 -1
  167. package/dist/ref-sHE8zOcm.mjs.map +0 -1
  168. package/dist/refs-BDbB9BRB-D6Za3Q49.mjs.map +0 -1
  169. package/dist/spaces-C27bA-xc.mjs.map +0 -1
  170. package/dist/types-DZWEs4si-D8UlyJI0.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-BwusfLIN-BXM7K-ww.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/errors-BwusfLIN.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { dirname, relative } from \"pathe\";\n//#region src/errors.ts\n/**\n* Build the canonical \"re-emit this package\" remediation hint.\n*\n* Every on-disk migration package ships its own `migration.ts` author-time\n* file. Running it regenerates `migration.json` and `ops.json` with the\n* correct hash + metadata, so it is the right primitive whenever a single\n* package's on-disk artifacts are missing, malformed, or otherwise corrupt.\n* Pointing users at `migration plan` would emit a *new* package rather than\n* heal the broken one.\n*/\nfunction reemitHint(dir, fallback) {\n\tconst reemit = `Re-emit the package by running \\`node \"${relative(process.cwd(), dir)}/migration.ts\"\\``;\n\treturn fallback ? `${reemit}, ${fallback}` : `${reemit}.`;\n}\n/**\n* Structured error for migration tooling operations.\n*\n* Follows the NAMESPACE.SUBCODE convention from ADR 027. All codes live under\n* the MIGRATION namespace. These are tooling-time errors (file I/O, hash\n* verification, migration history reconstruction), distinct from the runtime\n* MIGRATION.* codes for apply-time failures (PRECHECK_FAILED, POSTCHECK_FAILED,\n* etc.).\n*\n* Fields:\n* - code: Stable machine-readable code (MIGRATION.SUBCODE)\n* - category: Always 'MIGRATION'\n* - why: Explains the cause in plain language\n* - fix: Actionable remediation step\n* - meta: Machine-readable structured data for agents\n*/\nvar MigrationToolsError = class extends CliStructuredError {\n\tcategory;\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t\tthis.category = \"MIGRATION\";\n\t}\n\tstatic is(error) {\n\t\treturn CliStructuredError.is(error) && \"category\" in error && error.category === \"MIGRATION\" && error.code.startsWith(\"MIGRATION.\");\n\t}\n};\nfunction errorDirectoryExists(dir) {\n\treturn new MigrationToolsError(\"MIGRATION.DIR_EXISTS\", \"Migration directory already exists\", {\n\t\twhy: `The directory \"${dir}\" already exists. Each migration must have a unique directory.`,\n\t\tfix: \"Use --name to pick a different name, or delete the existing directory and re-run.\",\n\t\tmeta: { dir }\n\t});\n}\nfunction errorMissingFile(file, dir) {\n\treturn new MigrationToolsError(\"MIGRATION.FILE_MISSING\", `Missing ${file}`, {\n\t\twhy: `Expected \"${file}\" in \"${dir}\" but the file does not exist.`,\n\t\tfix: reemitHint(dir, \"or delete the directory if the migration is unwanted and the source TypeScript is gone.\"),\n\t\tmeta: {\n\t\t\tfile,\n\t\t\tdir\n\t\t}\n\t});\n}\nfunction errorInvalidJson(filePath, parseError) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_JSON\", \"Invalid JSON in migration file\", {\n\t\twhy: `Failed to parse \"${filePath}\": ${parseError}`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\tparseError\n\t\t}\n\t});\n}\nfunction errorInvalidManifest(filePath, reason) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_MANIFEST\", \"Invalid migration manifest\", {\n\t\twhy: `Migration manifest at \"${filePath}\" is invalid: ${reason}`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\treason\n\t\t}\n\t});\n}\nfunction errorDescribeMissingEndContract() {\n\treturn new MigrationToolsError(\"MIGRATION.DESCRIBE_INVALID\", \"Migration.describe(): provide endContractJson or override describe() — a migration needs a destination contract hash.\", {\n\t\twhy: \"Migration.describe() was called on a migration that carries no endContractJson and does not override describe(), so no destination contract hash can be derived.\",\n\t\tfix: \"Set endContractJson on the migration, or override describe() to return the { from, to } metadata explicitly.\",\n\t\tmeta: { reason: \"missing-end-contract\" }\n\t});\n}\nfunction errorDescribeInvalidMetadata(summary) {\n\treturn new MigrationToolsError(\"MIGRATION.DESCRIBE_INVALID\", `describe() returned invalid metadata: ${summary}`, {\n\t\twhy: `The migration's describe() returned metadata that failed schema validation: ${summary}.`,\n\t\tfix: \"Ensure describe() returns { from: string | null, to: string } with valid contract hashes.\",\n\t\tmeta: {\n\t\t\treason: \"invalid-metadata\",\n\t\t\tsummary\n\t\t}\n\t});\n}\nfunction errorOperationsNotArray() {\n\treturn new MigrationToolsError(\"MIGRATION.PLAN_NOT_ARRAY\", \"operations must be an array\", {\n\t\twhy: \"The migration instance's `operations` getter returned a non-array value.\",\n\t\tfix: \"Ensure the `operations` getter returns an array of migration operations.\",\n\t\tmeta: {}\n\t});\n}\nfunction errorSpaceHeadRefMissing(spaceId) {\n\treturn new MigrationToolsError(\"MIGRATION.CHECK_HEAD_REF_MISSING\", `Contract space \"${spaceId}\" has no head ref; its contract cannot be resolved from the snapshot store without one.`, {\n\t\twhy: `Contract space \"${spaceId}\" declares no refs/head.json, so there is no hash to resolve its contract against the snapshot store.`,\n\t\tfix: \"Re-emit the contract-space migrations and head-ref artifacts (the extension's contract-space build), or restore refs/head.json from version control.\",\n\t\tmeta: { spaceId }\n\t});\n}\nfunction errorInvalidOperationEntry(index, reason) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_OPERATION_ENTRY\", \"Migration operation entry is malformed\", {\n\t\twhy: `Operation at index ${index} returned by the migration class failed schema validation: ${reason}.`,\n\t\tfix: \"Update the migration class so each entry of `operations` carries `id` (string), `label` (string), and `operationClass` (one of 'additive' | 'widening' | 'destructive' | 'data').\",\n\t\tmeta: {\n\t\t\tindex,\n\t\t\treason\n\t\t}\n\t});\n}\nfunction errorInvalidSlug(slug) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_NAME\", \"Invalid migration name\", {\n\t\twhy: `The slug \"${slug}\" contains no valid characters after sanitization (only a-z, 0-9 are kept).`,\n\t\tfix: \"Provide a name with at least one alphanumeric character, e.g. --name add_users.\",\n\t\tmeta: { slug }\n\t});\n}\nfunction errorInvalidDestName(destName) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_DEST_NAME\", \"Invalid copy destination name\", {\n\t\twhy: `The destination name \"${destName}\" must be a single path segment (no \"..\" or directory separators).`,\n\t\tfix: \"Use a simple file name such as \\\"contract.json\\\" for each destination in the copy list.\",\n\t\tmeta: { destName }\n\t});\n}\nfunction errorInvalidSpaceId(spaceId) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_SPACE_ID\", \"Invalid contract space identifier\", {\n\t\twhy: `The space id \"${spaceId}\" does not match the required pattern /^[a-z][a-z0-9_-]{0,63}$/. Space ids are used as filesystem directory names under \\`migrations/\\`, so the pattern is conservative on purpose.`,\n\t\tfix: \"Pick a lowercase identifier that begins with a letter and contains only lowercase letters, digits, hyphens, or underscores; max 64 characters total.\",\n\t\tmeta: { spaceId }\n\t});\n}\nfunction errorDescriptorHeadHashMismatch(args) {\n\tconst { extensionId, recomputedHash, headRefHash } = args;\n\treturn new MigrationToolsError(\"MIGRATION.DESCRIPTOR_HEAD_HASH_MISMATCH\", \"Extension descriptor's headRef.hash does not match its contractJson\", {\n\t\twhy: `Extension \"${extensionId}\" publishes a \\`contractSpace\\` whose \\`headRef.hash\\` (${headRefHash}) does not match the canonical hash recomputed from \\`contractSpace.contractJson\\` (${recomputedHash}). This means the extension descriptor was published with stale \\`headRef.hash\\` — typically because the contract was bumped without rerunning the extension's emit pipeline.`,\n\t\tfix: \"Re-run the extension authoring pipeline so `contractJson.storage.storageHash` and `headRef.hash` agree, then republish the extension. If you are the extension author and you intentionally bumped `contractJson`, recompute and update `headRef.hash` (and refresh any on-disk migration metadata that derives from it).\",\n\t\tmeta: {\n\t\t\textensionId,\n\t\t\trecomputedHash,\n\t\t\theadRefHash\n\t\t}\n\t});\n}\nfunction errorDuplicateSpaceId(spaceId) {\n\treturn new MigrationToolsError(\"MIGRATION.DUPLICATE_SPACE_ID\", \"Duplicate contract space identifier\", {\n\t\twhy: `The space id \"${spaceId}\" appears more than once in the per-space planner input. Each space id must be unique across the inputs (the per-space planner emits one output entry per id).`,\n\t\tfix: \"Deduplicate the inputs before passing them to `planAllSpaces` — typically by checking your `extensions` declaration for repeated entries.\",\n\t\tmeta: { spaceId }\n\t});\n}\nfunction errorAmbiguousTarget(branchTips, context) {\n\tconst divergenceInfo = context ? `\\nDivergence point: ${context.divergencePoint}\\nBranches:\\n${context.branches.map((b) => ` → ${b.tip} (${b.edges.length} edge(s): ${b.edges.map((e) => e.dirName).join(\" → \") || \"direct\"})`).join(\"\\n\")}` : \"\";\n\treturn new MigrationToolsError(\"MIGRATION.AMBIGUOUS_TARGET\", \"Ambiguous migration target\", {\n\t\twhy: `The migration history has diverged into multiple branches: ${branchTips.join(\", \")}. This typically happens when two developers plan migrations from the same starting point.${divergenceInfo}`,\n\t\tfix: \"Use `ref set <name> <hash>` to target a specific branch, delete one of the conflicting migration directories and re-run `migration plan`, or use --from <hash> to explicitly select a starting point.\",\n\t\tmeta: {\n\t\t\tbranchTips,\n\t\t\t...context ? {\n\t\t\t\tdivergencePoint: context.divergencePoint,\n\t\t\t\tbranches: context.branches\n\t\t\t} : {}\n\t\t}\n\t});\n}\nfunction errorNoInitialMigration(nodes) {\n\treturn new MigrationToolsError(\"MIGRATION.NO_INITIAL_MIGRATION\", \"No initial migration found\", {\n\t\twhy: `No migration starts from the empty contract state (known hashes: ${nodes.join(\", \")}). At least one migration must originate from the empty state.`,\n\t\tfix: \"Inspect the migrations directory for corrupted migration.json files. At least one migration must start from the empty contract hash.\",\n\t\tmeta: { nodes }\n\t});\n}\nfunction errorInvalidRefFile(filePath, reason) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_REF_FILE\", \"Invalid ref file\", {\n\t\twhy: `Ref file at \"${filePath}\" is invalid: ${reason}`,\n\t\tfix: \"Ensure the ref file contains valid JSON with { \\\"hash\\\": \\\"<64 hex chars>\\\", \\\"invariants\\\": [\\\"...\\\"] }.\",\n\t\tmeta: {\n\t\t\tpath: filePath,\n\t\t\treason\n\t\t}\n\t});\n}\nfunction errorInvalidRefName(refName) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_REF_NAME\", \"Invalid ref name\", {\n\t\twhy: `Ref name \"${refName}\" is invalid. Names must be lowercase alphanumeric with hyphens or forward slashes (no \".\" or \"..\" segments).`,\n\t\tfix: `Use a valid ref name (e.g., \"staging\", \"envs/production\").`,\n\t\tmeta: { refName }\n\t});\n}\nfunction errorNoTarget(reachableHashes) {\n\treturn new MigrationToolsError(\"MIGRATION.NO_TARGET\", \"No migration target could be resolved\", {\n\t\twhy: `The migration history contains cycles and no target can be resolved automatically (reachable hashes: ${reachableHashes.join(\", \")}). This typically happens after rollback migrations (e.g., C1→C2→C1).`,\n\t\tfix: \"Use --from <hash> to specify the planning origin explicitly.\",\n\t\tmeta: { reachableHashes }\n\t});\n}\nfunction errorInvalidRefValue(value) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_REF_VALUE\", \"Invalid ref value\", {\n\t\twhy: `Ref value \"${value}\" is not a valid contract hash. Values must be a 64-character hex digest or \"empty\".`,\n\t\tfix: \"Use a valid storage hash from `prisma-next contract emit` output or an existing migration.\",\n\t\tmeta: { value }\n\t});\n}\nfunction errorInvalidInvariantId(invariantId) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_INVARIANT_ID\", \"Invalid invariantId\", {\n\t\twhy: `invariantId ${JSON.stringify(invariantId)} is invalid. Ids must be non-empty and contain no whitespace or control characters (including Unicode whitespace like NBSP); other content (kebab-case, camelCase, namespaced, Unicode letters) is allowed.`,\n\t\tfix: \"Pick an invariantId without spaces, tabs, newlines, or control characters — e.g. \\\"backfill-user-phone\\\", \\\"users/backfill-phone\\\", or \\\"BackfillUserPhone\\\".\",\n\t\tmeta: { invariantId }\n\t});\n}\nfunction errorDuplicateInvariantInEdge(invariantId) {\n\treturn new MigrationToolsError(\"MIGRATION.DUPLICATE_INVARIANT_IN_EDGE\", \"Duplicate invariantId on a single migration\", {\n\t\twhy: `invariantId \"${invariantId}\" is declared by more than one dataTransform on the same migration. The marker stores invariants as a set and the routing layer treats them as edge-level, so two ops cannot share a routing identity.`,\n\t\tfix: \"Rename one of the conflicting dataTransform invariantIds, or drop invariantId on the op that does not need to be routing-visible.\",\n\t\tmeta: { invariantId }\n\t});\n}\nfunction errorProvidedInvariantsMismatch(filePath, stored, derived) {\n\tconst storedSet = new Set(stored);\n\tconst derivedSet = new Set(derived);\n\tconst missing = [...derivedSet].filter((id) => !storedSet.has(id));\n\tconst extra = [...storedSet].filter((id) => !derivedSet.has(id));\n\treturn new MigrationToolsError(\"MIGRATION.PROVIDED_INVARIANTS_MISMATCH\", \"providedInvariants on migration.json disagrees with ops.json\", {\n\t\twhy: missing.length === 0 && extra.length === 0 ? `migration.json at \"${filePath}\" stores providedInvariants ${JSON.stringify(stored)}, but the canonical value derived from ops.json is ${JSON.stringify(derived)} — same ids, different order. Canonical providedInvariants is sorted ascending.` : `migration.json at \"${filePath}\" stores providedInvariants ${JSON.stringify(stored)}, but the value derived from ops.json is ${JSON.stringify(derived)}. The manifest copy was likely hand-edited without re-emitting.`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\tstored,\n\t\t\tderived,\n\t\t\tdifference: {\n\t\t\t\tmissing,\n\t\t\t\textra\n\t\t\t}\n\t\t}\n\t});\n}\nfunction errorNoInvariantPath(args) {\n\tconst { refName, required, missing, structuralPath } = args;\n\tconst refClause = refName ? `Ref \"${refName}\"` : \"Target\";\n\tconst missingList = missing.map((id) => JSON.stringify(id)).join(\", \");\n\treturn new MigrationToolsError(\"MIGRATION.NO_INVARIANT_PATH\", \"No path covers the required invariants\", {\n\t\twhy: `${refClause} requires invariants the reachable path doesn't cover. required=[${required.map((id) => JSON.stringify(id)).join(\", \")}], missing=[${missingList}].`,\n\t\tfix: \"Add a migration on the path that runs `dataTransform({ invariantId: \\\"<id>\\\", … })` for each missing invariant, or retarget the ref to a hash whose path already provides them.\",\n\t\tmeta: {\n\t\t\trequired,\n\t\t\tmissing,\n\t\t\tstructuralPath,\n\t\t\t...ifDefined(\"refName\", refName)\n\t\t}\n\t});\n}\nfunction errorUnknownInvariant(args) {\n\tconst { refName, unknown, declared } = args;\n\treturn new MigrationToolsError(\"MIGRATION.UNKNOWN_INVARIANT\", \"Ref declares invariants no migration in the graph provides\", {\n\t\twhy: `${refName ? `Ref \"${refName}\" declares` : \"Declares\"} invariants no migration in the graph provides. unknown=[${unknown.map((id) => JSON.stringify(id)).join(\", \")}].`,\n\t\tfix: \"Either the ref has a typo, or the declaring migration has not been authored/attested yet. Re-check the ref file and the migrations directory.\",\n\t\tmeta: {\n\t\t\tunknown,\n\t\t\tdeclared,\n\t\t\t...ifDefined(\"refName\", refName)\n\t\t}\n\t});\n}\nfunction errorMigrationHashMismatch(dir, storedHash, computedHash) {\n\treturn new MigrationToolsError(\"MIGRATION.HASH_MISMATCH\", \"Migration package is corrupt\", {\n\t\twhy: `Stored migrationHash \"${storedHash}\" does not match the recomputed hash \"${computedHash}\" for \"${relative(process.cwd(), dir)}\". The migration.json or ops.json has been edited or partially written since emit.`,\n\t\tfix: reemitHint(dir, \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tdir,\n\t\t\tstoredHash,\n\t\t\tcomputedHash\n\t\t}\n\t});\n}\n/**\n* A ref name that resolves to nothing: no pointer file named `refName`\n* exists, and the hash being resolved (the `contractAt` argument, used as a\n* fallback when the pointer is absent) is not a node in the migration graph\n* either. There is no contract to materialize.\n*/\nfunction errorRefNotResolvable(refName) {\n\treturn new MigrationToolsError(\"MIGRATION.REF_NOT_RESOLVABLE\", `Ref \"${refName}\" is not resolvable`, {\n\t\twhy: `Ref \"${refName}\" has no pointer file, and the hash being resolved is not a node in the migration graph either — there is nothing to materialize a contract from.`,\n\t\tfix: `Create the ref with \"prisma-next ref set ${refName} <hash>\" (or advance it via \"prisma-next db update --advance-ref ${refName}\"), or pass a hash that is a node in the migration graph.`,\n\t\tmeta: {\n\t\t\trefName,\n\t\t\tidentifier: refName\n\t\t}\n\t});\n}\nfunction errorBundleNotFoundForGraphNode(hash, explicitLabel) {\n\treturn new MigrationToolsError(\"MIGRATION.BUNDLE_NOT_FOUND_FOR_GRAPH_NODE\", explicitLabel ? `No migration bundle found for reference \"${explicitLabel}\" (resolved hash: ${hash})` : `No migration bundle found for graph node ${hash}`, {\n\t\twhy: `The hash ${hash} is a graph node but no on-disk migration package has a destination (\\`to\\`) hash matching it.`,\n\t\tfix: \"Provide a ref or hash that corresponds to an existing migration package, or run `migration list` to see available migrations.\",\n\t\tmeta: {\n\t\t\thash,\n\t\t\t...explicitLabel ? { explicitLabel } : {}\n\t\t}\n\t});\n}\nfunction errorContractDeserializationFailed(filePath, message) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_DESERIALIZATION_FAILED\", \"Contract failed to deserialize\", {\n\t\twhy: `Contract at \"${filePath}\" failed to deserialize: ${message}`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\tmessage\n\t\t}\n\t});\n}\nfunction errorHashNotInGraph(hash, graph) {\n\tconst reachableHashes = [...graph.nodes].sort();\n\tconst reachableList = reachableHashes.length > 0 ? reachableHashes.join(\", \") : \"(none)\";\n\treturn new MigrationToolsError(\"MIGRATION.HASH_NOT_IN_GRAPH\", `Hash \"${hash}\" is not a node in the migration graph`, {\n\t\twhy: `The migration graph contains nodes ${reachableList}; \"${hash}\" isn't one of them.`,\n\t\tfix: `Pass a hash that's the from-or-to of an on-disk migration bundle, use --from with a graph-node hash, or run \"prisma-next migration plan\" to introduce it.`,\n\t\tmeta: {\n\t\t\thash,\n\t\t\treachableHashes\n\t\t}\n\t});\n}\nfunction errorContractSnapshotMissing(storageHash, expectedPath) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_SNAPSHOT_MISSING\", \"Contract snapshot is missing\", {\n\t\twhy: `Expected a contract snapshot for ${storageHash} at \"${expectedPath}\" but the file does not exist.`,\n\t\tfix: \"Re-emit the contract snapshot by re-running the command that authored the migration referencing this hash (`prisma-next migration plan` for app-space migrations; the extension's contract-space build for extension spaces), or restore migrations/snapshots/ from version control.\",\n\t\tmeta: {\n\t\t\tstorageHash,\n\t\t\texpectedPath\n\t\t}\n\t});\n}\nfunction errorContractSnapshotHashMismatch(storageHash, actualHash, dir) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_SNAPSHOT_HASH_MISMATCH\", \"Contract snapshot hash mismatch\", {\n\t\twhy: `The contract JSON's inner storage.storageHash (\"${actualHash}\") does not match the requested storage hash (\"${storageHash}\") for snapshot directory \"${dir}\".`,\n\t\tfix: \"Pass a contractJson whose storage.storageHash equals the storageHash argument passed to writeContractSnapshot — the two must agree by construction.\",\n\t\tmeta: {\n\t\t\tstorageHash,\n\t\t\tactualHash,\n\t\t\tdir\n\t\t}\n\t});\n}\nfunction errorMigrationContractViewMissing(className, accessor, jsonField) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_VIEW_MISSING\", `${className}.${accessor} requires ${jsonField}`, {\n\t\twhy: `${className}.${accessor} was read, but this instance has no ${jsonField} to build the view from.`,\n\t\tfix: `Set ${jsonField} to the migration's committed contract JSON, or avoid reading ${accessor} on a migration that overrides describe() and carries no contract.`,\n\t\tmeta: {\n\t\t\tclassName,\n\t\t\taccessor,\n\t\t\tjsonField\n\t\t}\n\t});\n}\n//#endregion\nexport { errorOperationsNotArray as A, errorInvalidSpaceId as C, errorNoInitialMigration as D, errorMissingFile as E, errorRefNotResolvable as M, errorSpaceHeadRefMissing as N, errorNoInvariantPath as O, errorUnknownInvariant as P, errorInvalidSlug as S, errorMigrationHashMismatch as T, errorInvalidManifest as _, errorContractSnapshotHashMismatch as a, errorInvalidRefName as b, errorDescribeMissingEndContract as c, errorDuplicateInvariantInEdge as d, errorDuplicateSpaceId as f, errorInvalidJson as g, errorInvalidInvariantId as h, errorContractDeserializationFailed as i, errorProvidedInvariantsMismatch as j, errorNoTarget as k, errorDescriptorHeadHashMismatch as l, errorInvalidDestName as m, errorAmbiguousTarget as n, errorContractSnapshotMissing as o, errorHashNotInGraph as p, errorBundleNotFoundForGraphNode as r, errorDescribeInvalidMetadata as s, MigrationToolsError as t, errorDirectoryExists as u, errorInvalidOperationEntry as v, errorMigrationContractViewMissing as w, errorInvalidRefValue as x, errorInvalidRefFile as y };\n\n//# sourceMappingURL=errors-BwusfLIN.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,WAAW,KAAK,UAAU;CAClC,MAAM,SAAS,0CAA0C,SAAS,QAAQ,IAAI,GAAG,GAAG,EAAE;CACtF,OAAO,WAAW,GAAG,OAAO,IAAI,aAAa,GAAG,OAAO;AACxD;;;;;;;;;;;;;;;;;AAiB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ACL;GACA;GACA;EACD;CACD,CAAC;AACF"}
@@ -1,4 +1,4 @@
1
- import { N as errorUnexpected, O as errorRuntime$1, W as formatStyledHeader, ct as setCommandExamples, o as createTerminalUI, q as handleResult, r as addGlobalOptions, st as setCommandDescriptions, t as CliStructuredError$1, tt as parseGlobalFlagsOrExit } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
1
+ import { N as errorUnexpected, O as errorRuntime$1, W as formatStyledHeader, et as parseGlobalFlagsOrExit, o as createTerminalUI, ot as setCommandDescriptions, q as handleResult, r as addGlobalOptions, st as setCommandExamples, t as CliStructuredError$1 } from "./command-helpers-C4WpR-QE-CK2gkj6l.mjs";
2
2
  import { r as loadConfig } from "./exports-CDX9kZuw.mjs";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
4
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
@@ -8,7 +8,7 @@ import { isStructuredError } from "@prisma/orm-framework/utils/structured-error"
8
8
  import { Command } from "commander";
9
9
  import { EOL } from "node:os";
10
10
  import { format } from "@prisma/orm-framework/psl-parser/format";
11
- //#region ../../../1-framework/3-tooling/cli/dist/format-ByDm2goZ.mjs
11
+ //#region ../../../1-framework/3-tooling/cli/dist/format-Bw3LVJ1v.mjs
12
12
  function resolveNewline(formatterNewline, eol) {
13
13
  if (formatterNewline !== void 0) return formatterNewline;
14
14
  return eol === "\r\n" ? "CRLF" : "LF";
@@ -30,9 +30,10 @@ async function executeFormat(options) {
30
30
  try {
31
31
  contents = await readFile(inputPath, "utf-8");
32
32
  } catch (error) {
33
- return notOk(errorRuntime$1("Failed to read contract source file", {
33
+ return notOk(errorRuntime$1("CONTRACT.SOURCE_LOAD_FAILED", "Failed to read contract source file", {
34
34
  why: error instanceof Error ? error.message : String(error),
35
- fix: `Check that ${inputPath} exists and is readable.`
35
+ fix: `Check that ${inputPath} exists and is readable.`,
36
+ cause: error
36
37
  }));
37
38
  }
38
39
  const formatOptions = {
@@ -43,19 +44,21 @@ async function executeFormat(options) {
43
44
  try {
44
45
  formatted = format(contents, formatOptions);
45
46
  } catch (error) {
46
- if (isStructuredError(error) && error.code === "PSL.PARSE_FAILED") return notOk(errorRuntime$1("Cannot format PSL with parse errors", {
47
+ if (isStructuredError(error) && error.code === "PSL.PARSE_FAILED") return notOk(errorRuntime$1("PSL.PARSE_FAILED", "Cannot format PSL with parse errors", {
47
48
  why: error.message,
48
49
  fix: "Fix the parse errors in your schema and try again.",
49
- meta: { diagnostics: error.meta?.["diagnostics"] }
50
+ meta: { diagnostics: error.meta?.["diagnostics"] },
51
+ cause: error
50
52
  }));
51
53
  return notOk(errorUnexpected(error instanceof Error ? error.message : String(error)));
52
54
  }
53
55
  try {
54
56
  await writeFile(inputPath, formatted, "utf-8");
55
57
  } catch (error) {
56
- return notOk(errorRuntime$1("Failed to write formatted contract source file", {
58
+ return notOk(errorRuntime$1("CLI.FILE_WRITE_FAILED", "Failed to write formatted contract source file", {
57
59
  why: error instanceof Error ? error.message : String(error),
58
- fix: `Check that ${inputPath} is writable.`
60
+ fix: `Check that ${inputPath} is writable.`,
61
+ cause: error
59
62
  }));
60
63
  }
61
64
  return ok({
@@ -98,4 +101,4 @@ function createFormatCommand() {
98
101
  //#endregion
99
102
  export { createFormatCommand as t };
100
103
 
101
- //# sourceMappingURL=format-ByDm2goZ-BIRlFoo6.mjs.map
104
+ //# sourceMappingURL=format-Bw3LVJ1v-D10inUT9.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-Bw3LVJ1v-D10inUT9.mjs","names":["CliStructuredError","errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/format-Bw3LVJ1v.mjs"],"sourcesContent":["import { A as formatStyledHeader, F as CliStructuredError, _ as createTerminalUI, ct as errorUnexpected, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, rt as errorRuntime, t as addGlobalOptions, u as setCommandExamples, y as handleResult } from \"./command-helpers-C4WpR-QE.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { relative, resolve } from \"pathe\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { EOL } from \"node:os\";\nimport { format } from \"@internal/psl-parser/format\";\n//#region src/control-api/operations/format.ts\nfunction resolveNewline(formatterNewline, eol) {\n\tif (formatterNewline !== void 0) return formatterNewline;\n\treturn eol === \"\\r\\n\" ? \"CRLF\" : \"LF\";\n}\nasync function executeFormat(options) {\n\tconst eol = options.eol ?? EOL;\n\tlet config;\n\ttry {\n\t\tconfig = await loadConfig(options.configPath);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error)));\n\t}\n\tconst source = config.contract?.source;\n\tif (source?.format !== \"psl\") return ok({ formatted: false });\n\tconst inputPath = source.inputs?.[0];\n\tif (inputPath === void 0) return ok({ formatted: false });\n\tlet contents;\n\ttry {\n\t\tcontents = await readFile(inputPath, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"CONTRACT.SOURCE_LOAD_FAILED\", \"Failed to read contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} exists and is readable.`,\n\t\t\tcause: error\n\t\t}));\n\t}\n\tconst formatOptions = {\n\t\tindent: config.formatter?.indent ?? 2,\n\t\tnewline: resolveNewline(config.formatter?.newline, eol)\n\t};\n\tlet formatted;\n\ttry {\n\t\tformatted = format(contents, formatOptions);\n\t} catch (error) {\n\t\tif (isStructuredError(error) && error.code === \"PSL.PARSE_FAILED\") return notOk(errorRuntime(\"PSL.PARSE_FAILED\", \"Cannot format PSL with parse errors\", {\n\t\t\twhy: error.message,\n\t\t\tfix: \"Fix the parse errors in your schema and try again.\",\n\t\t\tmeta: { diagnostics: error.meta?.[\"diagnostics\"] },\n\t\t\tcause: error\n\t\t}));\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error)));\n\t}\n\ttry {\n\t\tawait writeFile(inputPath, formatted, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"CLI.FILE_WRITE_FAILED\", \"Failed to write formatted contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} is writable.`,\n\t\t\tcause: error\n\t\t}));\n\t}\n\treturn ok({\n\t\tformatted: true,\n\t\tpath: inputPath\n\t});\n}\n//#endregion\n//#region src/commands/format.ts\nfunction createFormatCommand() {\n\tconst command = new Command(\"format\");\n\tsetCommandDescriptions(command, \"Format your PSL contract source\", \"Formats the Prisma schema (PSL) contract source declared in your config\\n(contract.source.inputs[0]) in place. Only runs when contract.source.format\\nis 'psl'; a TypeScript or unset source is left untouched. Indent and newline are\\nread from the optional formatter config section, defaulting to two spaces and the\\nsystem newline.\");\n\tsetCommandExamples(command, [\"prisma-next format\", \"prisma-next format --config ./custom-config.ts\"]);\n\taddGlobalOptions(command).option(\"--config <path>\", \"Path to prisma-next.config.ts\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (!flags.json && !flags.quiet) {\n\t\t\tconst displayConfigPath = options.config ? relative(process.cwd(), resolve(options.config)) : \"prisma-next.config.ts\";\n\t\t\tui.stderr(formatStyledHeader({\n\t\t\t\tcommand: \"format\",\n\t\t\t\tdescription: \"Format your PSL contract source\",\n\t\t\t\tdetails: [{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: displayConfigPath\n\t\t\t\t}],\n\t\t\t\tflags\n\t\t\t}));\n\t\t}\n\t\tconst exitCode = handleResult(await executeFormat({ ...ifDefined(\"configPath\", options.config) }), flags, ui, (value) => {\n\t\t\tif (flags.json) {\n\t\t\t\tui.output(JSON.stringify(value));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (flags.quiet) return;\n\t\t\tif (value.formatted) ui.success(`Formatted ${relative(process.cwd(), value.path ?? \"\")}`);\n\t\t\telse ui.info(\"Nothing to format (contract source is not PSL).\");\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createFormatCommand as t };\n\n//# sourceMappingURL=format-Bw3LVJ1v.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,eAAe,kBAAkB,KAAK;CAC9C,IAAI,qBAAqB,KAAK,GAAG,OAAO;CACxC,OAAO,QAAQ,SAAS,SAAS;AAClC;AACA,eAAe,cAAc,SAAS;CACrC,MAAM,MAAM,QAAQ,OAAO;CAC3B,IAAI;CACJ,IAAI;EACH,SAAS,MAAM,WAAW,QAAQ,UAAU;CAC7C,SAAS,OAAO;EACf,IAAIA,qBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,OAAO,MAAM,gBAAgB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,CAAC;CACrF;CACA,MAAM,SAAS,OAAO,UAAU;CAChC,IAAI,QAAQ,WAAW,OAAO,OAAO,GAAG,EAAE,WAAW,MAAM,CAAC;CAC5D,MAAM,YAAY,OAAO,SAAS;CAClC,IAAI,cAAc,KAAK,GAAG,OAAO,GAAG,EAAE,WAAW,MAAM,CAAC;CACxD,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,SAAS,WAAW,OAAO;CAC7C,SAAS,OAAO;EACf,OAAO,MAAMC,eAAa,+BAA+B,uCAAuC;GAC/F,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;GAC1D,KAAK,cAAc,UAAU;GAC7B,OAAO;EACR,CAAC,CAAC;CACH;CACA,MAAM,gBAAgB;EACrB,QAAQ,OAAO,WAAW,UAAU;EACpC,SAAS,eAAe,OAAO,WAAW,SAAS,GAAG;CACvD;CACA,IAAI;CACJ,IAAI;EACH,YAAY,OAAO,UAAU,aAAa;CAC3C,SAAS,OAAO;EACf,IAAI,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AM;IACf,GAAG,OAAO,KAAK,UAAU,KAAK,CAAC;IAC/B;GACD;GACA,IAAI,MAAM,OAAO;GACjB,IAAI,MAAM,WAAW,GAAG,QAAQ,aAAa,SAAS,QAAQ,IAAI,GAAG,MAAM,QAAQ,EAAE,GAAG;QACnF,GAAG,KAAK,iDAAiD;EAC/D,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
@@ -1,6 +1,6 @@
1
- import { l as errorConfigValidation } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
1
+ import { l as errorConfigValidation } from "./command-helpers-C4WpR-QE-CK2gkj6l.mjs";
2
2
  import "@prisma/orm-framework/components/components";
3
- //#region ../../../1-framework/3-tooling/cli/dist/framework-components-CjshQKHA.mjs
3
+ //#region ../../../1-framework/3-tooling/cli/dist/framework-components-3DdB31mk.mjs
4
4
  /**
5
5
  * Asserts that all framework components are compatible with the expected family and target.
6
6
  *
@@ -55,4 +55,4 @@ function assertFrameworkComponentsCompatible(expectedFamilyId, expectedTargetId,
55
55
  //#endregion
56
56
  export { assertFrameworkComponentsCompatible as t };
57
57
 
58
- //# sourceMappingURL=framework-components-CjshQKHA-Dlp6Leo5.mjs.map
58
+ //# sourceMappingURL=framework-components-3DdB31mk-BPGSuOyZ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"framework-components-CjshQKHA-Dlp6Leo5.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/framework-components-CjshQKHA.mjs"],"sourcesContent":["import { R as errorConfigValidation } from \"./command-helpers-CAoXqAY9.mjs\";\nimport \"@internal/framework-components/components\";\n//#region src/utils/framework-components.ts\n/**\n* Asserts that all framework components are compatible with the expected family and target.\n*\n* This function validates that each component in the framework components array:\n* - Has kind 'target', 'adapter', 'extension', or 'driver'\n* - Has familyId matching expectedFamilyId\n* - Has targetId matching expectedTargetId\n*\n* This validation happens at the CLI composition boundary, before passing components\n* to typed planner/runner instances. It fills the gap between runtime validation\n* (via `validateConfig()`) and compile-time type enforcement.\n*\n* @param expectedFamilyId - The expected family ID (e.g., 'sql')\n* @param expectedTargetId - The expected target ID (e.g., 'postgres')\n* @param frameworkComponents - Array of framework components to validate\n* @returns The same array typed as TargetBoundComponentDescriptor\n* @throws CliStructuredError if any component is incompatible\n*\n* @example\n* ```ts\n* const config = await loadConfig();\n* const frameworkComponents = [config.target, config.adapter, ...(config.extensions ?? [])];\n*\n* // Validate and type-narrow components before passing to planner\n* const typedComponents = assertFrameworkComponentsCompatible(\n* config.family.familyId,\n* config.target.targetId,\n* frameworkComponents\n* );\n*\n* const planner = target.migrations.createPlanner(familyInstance);\n* planner.plan({ contract, schema, policy, frameworkComponents: typedComponents });\n* ```\n*/\nfunction assertFrameworkComponentsCompatible(expectedFamilyId, expectedTargetId, frameworkComponents) {\n\tfor (let i = 0; i < frameworkComponents.length; i++) {\n\t\tconst component = frameworkComponents[i];\n\t\tif (typeof component !== \"object\" || component === null) throw errorConfigValidation(\"frameworkComponents[]\", { why: `Framework component at index ${i} must be an object` });\n\t\tconst record = component;\n\t\tif (!Object.hasOwn(record, \"kind\")) throw errorConfigValidation(\"frameworkComponents[].kind\", { why: `Framework component at index ${i} must have 'kind' property` });\n\t\tconst kind = record[\"kind\"];\n\t\tif (kind !== \"target\" && kind !== \"adapter\" && kind !== \"extension\" && kind !== \"driver\") throw errorConfigValidation(\"frameworkComponents[].kind\", { why: `Framework component at index ${i} has invalid kind '${String(kind)}' (must be 'target', 'adapter', 'extension', or 'driver')` });\n\t\tif (!Object.hasOwn(record, \"familyId\")) throw errorConfigValidation(\"frameworkComponents[].familyId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) must have 'familyId' property` });\n\t\tconst familyId = record[\"familyId\"];\n\t\tif (familyId !== expectedFamilyId) throw errorConfigValidation(\"frameworkComponents[].familyId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) has familyId '${String(familyId)}' but expected '${expectedFamilyId}'` });\n\t\tif (!Object.hasOwn(record, \"targetId\")) throw errorConfigValidation(\"frameworkComponents[].targetId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) must have 'targetId' property` });\n\t\tconst targetId = record[\"targetId\"];\n\t\tif (targetId !== expectedTargetId) throw errorConfigValidation(\"frameworkComponents[].targetId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) has targetId '${String(targetId)}' but expected '${expectedTargetId}'` });\n\t}\n\treturn frameworkComponents;\n}\n//#endregion\nexport { assertFrameworkComponentsCompatible as t };\n\n//# sourceMappingURL=framework-components-CjshQKHA.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAS,oCAAoC,kBAAkB,kBAAkB,qBAAqB;CACrG,KAAK,IAAI,IAAI,GAAG,IAAI,oBAAoB,QAAQ,KAAK;EACpD,MAAM,YAAY,oBAAoB;EACtC,IAAI,OAAO,cAAc,YAAY,cAAc,MAAM,MAAM,sBAAsB,yBAAyB,EAAE,KAAK,gCAAgC,EAAE,oBAAoB,CAAC;EAC5K,MAAM,SAAS;EACf,IAAI,CAAC,OAAO,OAAO,QAAQ,MAAM,GAAG,MAAM,sBAAsB,8BAA8B,EAAE,KAAK,gCAAgC,EAAE,4BAA4B,CAAC;EACpK,MAAM,OAAO,OAAO;EACpB,IAAI,SAAS,YAAY,SAAS,aAAa,SAAS,eAAe,SAAS,UAAU,MAAM,sBAAsB,8BAA8B,EAAE,KAAK,gCAAgC,EAAE,qBAAqB,OAAO,IAAI,EAAE,2DAA2D,CAAC;EAC3R,IAAI,CAAC,OAAO,OAAO,QAAQ,UAAU,GAAG,MAAM,sBAAsB,kCAAkC,EAAE,KAAK,gCAAgC,EAAE,UAAU,OAAO,IAAI,EAAE,iCAAiC,CAAC;EACxM,MAAM,WAAW,OAAO;EACxB,IAAI,aAAa,kBAAkB,MAAM,sBAAsB,kCAAkC,EAAE,KAAK,gCAAgC,EAAE,UAAU,OAAO,IAAI,EAAE,kBAAkB,OAAO,QAAQ,EAAE,kBAAkB,iBAAiB,GAAG,CAAC;EAC3O,IAAI,CAAC,OAAO,OAAO,QAAQ,UAAU,GAAG,MAAM,sBAAsB,kCAAkC,EAAE,KAAK,gCAAgC,EAAE,UAAU,OAAO,IAAI,EAAE,iCAAiC,CAAC;EACxM,MAAM,WAAW,OAAO;EACxB,IAAI,aAAa,kBAAkB,MAAM,sBAAsB,kCAAkC,EAAE,KAAK,gCAAgC,EAAE,UAAU,OAAO,IAAI,EAAE,kBAAkB,OAAO,QAAQ,EAAE,kBAAkB,iBAAiB,GAAG,CAAC;CAC5O;CACA,OAAO;AACR"}
1
+ {"version":3,"file":"framework-components-3DdB31mk-BPGSuOyZ.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/framework-components-3DdB31mk.mjs"],"sourcesContent":["import { R as errorConfigValidation } from \"./command-helpers-C4WpR-QE.mjs\";\nimport \"@internal/framework-components/components\";\n//#region src/utils/framework-components.ts\n/**\n* Asserts that all framework components are compatible with the expected family and target.\n*\n* This function validates that each component in the framework components array:\n* - Has kind 'target', 'adapter', 'extension', or 'driver'\n* - Has familyId matching expectedFamilyId\n* - Has targetId matching expectedTargetId\n*\n* This validation happens at the CLI composition boundary, before passing components\n* to typed planner/runner instances. It fills the gap between runtime validation\n* (via `validateConfig()`) and compile-time type enforcement.\n*\n* @param expectedFamilyId - The expected family ID (e.g., 'sql')\n* @param expectedTargetId - The expected target ID (e.g., 'postgres')\n* @param frameworkComponents - Array of framework components to validate\n* @returns The same array typed as TargetBoundComponentDescriptor\n* @throws CliStructuredError if any component is incompatible\n*\n* @example\n* ```ts\n* const config = await loadConfig();\n* const frameworkComponents = [config.target, config.adapter, ...(config.extensions ?? [])];\n*\n* // Validate and type-narrow components before passing to planner\n* const typedComponents = assertFrameworkComponentsCompatible(\n* config.family.familyId,\n* config.target.targetId,\n* frameworkComponents\n* );\n*\n* const planner = target.migrations.createPlanner(familyInstance);\n* planner.plan({ contract, schema, policy, frameworkComponents: typedComponents });\n* ```\n*/\nfunction assertFrameworkComponentsCompatible(expectedFamilyId, expectedTargetId, frameworkComponents) {\n\tfor (let i = 0; i < frameworkComponents.length; i++) {\n\t\tconst component = frameworkComponents[i];\n\t\tif (typeof component !== \"object\" || component === null) throw errorConfigValidation(\"frameworkComponents[]\", { why: `Framework component at index ${i} must be an object` });\n\t\tconst record = component;\n\t\tif (!Object.hasOwn(record, \"kind\")) throw errorConfigValidation(\"frameworkComponents[].kind\", { why: `Framework component at index ${i} must have 'kind' property` });\n\t\tconst kind = record[\"kind\"];\n\t\tif (kind !== \"target\" && kind !== \"adapter\" && kind !== \"extension\" && kind !== \"driver\") throw errorConfigValidation(\"frameworkComponents[].kind\", { why: `Framework component at index ${i} has invalid kind '${String(kind)}' (must be 'target', 'adapter', 'extension', or 'driver')` });\n\t\tif (!Object.hasOwn(record, \"familyId\")) throw errorConfigValidation(\"frameworkComponents[].familyId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) must have 'familyId' property` });\n\t\tconst familyId = record[\"familyId\"];\n\t\tif (familyId !== expectedFamilyId) throw errorConfigValidation(\"frameworkComponents[].familyId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) has familyId '${String(familyId)}' but expected '${expectedFamilyId}'` });\n\t\tif (!Object.hasOwn(record, \"targetId\")) throw errorConfigValidation(\"frameworkComponents[].targetId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) must have 'targetId' property` });\n\t\tconst targetId = record[\"targetId\"];\n\t\tif (targetId !== expectedTargetId) throw errorConfigValidation(\"frameworkComponents[].targetId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) has targetId '${String(targetId)}' but expected '${expectedTargetId}'` });\n\t}\n\treturn frameworkComponents;\n}\n//#endregion\nexport { assertFrameworkComponentsCompatible as t };\n\n//# sourceMappingURL=framework-components-3DdB31mk.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAS,oCAAoC,kBAAkB,kBAAkB,qBAAqB;CACrG,KAAK,IAAI,IAA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ooling/migration/dist/graph-membership-DW6nnbyQ.mjs
1
+ import { p as errorHashNotInGraph } from "./errors-BwusfLIN-BXM7K-ww.mjs";
2
+ //#region ../../../1-framework/3-tooling/migration/dist/graph-membership-h9ejuZla.mjs
3
3
  function isGraphNode(hash, graph) {
4
4
  if (hash === "empty") return true;
5
5
  return graph.nodes.has(hash);
@@ -11,4 +11,4 @@ function assertHashIsGraphNode(hash, graph) {
11
11
  //#endregion
12
12
  export { isGraphNode as n, assertHashIsGraphNode as t };
13
13
 
14
- //# sourceMappingURL=graph-membership-DW6nnbyQ-Bp2KcVwR.mjs.map
14
+ //# sourceMappingURL=graph-membership-h9ejuZla-ewjYM5wz.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph-membership-DW6nnbyQ-Bp2KcVwR.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/graph-membership-DW6nnbyQ.mjs"],"sourcesContent":["import { p as errorHashNotInGraph } from \"./errors-IpZm1Skp.mjs\";\nimport \"./constants-CM-w38DQ.mjs\";\n//#region src/graph-membership.ts\nfunction isGraphNode(hash, graph) {\n\tif (hash === \"empty\") return true;\n\treturn graph.nodes.has(hash);\n}\nfunction assertHashIsGraphNode(hash, graph) {\n\tif (isGraphNode(hash, graph)) return;\n\tthrow errorHashNotInGraph(hash, graph);\n}\n//#endregion\nexport { isGraphNode as n, assertHashIsGraphNode as t };\n\n//# sourceMappingURL=graph-membership-DW6nnbyQ.mjs.map"],"mappings":";;AAGA,SAAS,YAAY,MAAM,OAAO;CACjC,IAAI,SAAS,SAAS,OAAO;CAC7B,OAAO,MAAM,MAAM,IAAI,IAAI;AAC5B;AACA,SAAS,sBAAsB,MAAM,OAAO;CAC3C,IAAI,YAAY,MAAM,KAAK,GAAG;CAC9B,MAAM,oBAAoB,MAAM,KAAK;AACtC"}
1
+ {"version":3,"file":"graph-membership-h9ejuZla-ewjYM5wz.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/graph-membership-h9ejuZla.mjs"],"sourcesContent":["import { p as errorHashNotInGraph } from \"./errors-BwusfLIN.mjs\";\nimport \"./constants-CM-w38DQ.mjs\";\n//#region src/graph-membership.ts\nfunction isGraphNode(hash, graph) {\n\tif (hash === \"empty\") return true;\n\treturn graph.nodes.has(hash);\n}\nfunction assertHashIsGraphNode(hash, graph) {\n\tif (isGraphNode(hash, graph)) return;\n\tthrow errorHashNotInGraph(hash, graph);\n}\n//#endregion\nexport { isGraphNode as n, assertHashIsGraphNode as t };\n\n//# sourceMappingURL=graph-membership-h9ejuZla.mjs.map"],"mappings":";;AAGA,SAAS,YAAY,MAAM,OAAO;CACjC,IAAI,SAAS,SAAS,OAAO;CAC7B,OAAO,MAAM,MAAM,IAAI,IAAI;AAC5B;AACA,SAAS,sBAAsB,MAAM,OAAO;CAC3C,IAAI,YAAY,MAAM,KAAK,GAAG;CAC9B,MAAM,oBAAoB,MAAM,KAAK;AACtC"}
@@ -1,4 +1,4 @@
1
- import { I as formatErrorJson, L as formatErrorOutput, o as createTerminalUI, t as CliStructuredError$1 } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
1
+ import { I as formatErrorJson, L as formatErrorOutput, o as createTerminalUI, t as CliStructuredError$1 } from "./command-helpers-C4WpR-QE-CK2gkj6l.mjs";
2
2
  import { i as renderInitOutro, n as buildNextSteps, r as formatInitJson, t as InitOutputSchema } from "./output-DWNYqZGc-D2sRgLAm.mjs";
3
3
  import { a as schemaSample, c as targetLabel, i as scaffoldSpecifierResolverFor, l as targetPackageName, n as dbFile, o as starterSchema, r as defaultSchemaPath, s as targetEntrypoint, t as configFile, u as version } from "./bin__prisma-next.mjs";
4
4
  import { createRequire } from "node:module";
@@ -14,7 +14,7 @@ import { execFile } from "node:child_process";
14
14
  import { promisify } from "node:util";
15
15
  import { detect, getUserAgent } from "package-manager-detector/detect";
16
16
  import { applyEdits, modify, parse, printParseErrorCode } from "jsonc-parser";
17
- //#region ../../../1-framework/3-tooling/cli/dist/init-BGm77aWc.mjs
17
+ //#region ../../../1-framework/3-tooling/cli/dist/init-CPB89WK2.mjs
18
18
  const KNOWN = /* @__PURE__ */ new Set([
19
19
  "pnpm",
20
20
  "npm",
@@ -2181,7 +2181,7 @@ async function runEmit(ctx) {
2181
2181
  const spinner = ctx.ui.spinner();
2182
2182
  spinner.start("Emitting contract...");
2183
2183
  try {
2184
- const { executeContractEmit } = await import("./contract-emit-B6odMoem-C87PBvmo.mjs").then((n) => n.t).then((n) => n.t);
2184
+ const { executeContractEmit } = await import("./contract-emit-CTm2zfuG-8mtkxW8M.mjs").then((n) => n.t).then((n) => n.t);
2185
2185
  await executeContractEmit({ configPath: join(ctx.baseDir, "prisma-next.config.ts") });
2186
2186
  spinner.stop("Contract emitted");
2187
2187
  } catch (err) {
@@ -2234,4 +2234,4 @@ function sanitisePackageName(raw) {
2234
2234
  //#endregion
2235
2235
  export { runInit };
2236
2236
 
2237
- //# sourceMappingURL=init-BGm77aWc-jHVUn63W.mjs.map
2237
+ //# sourceMappingURL=init-CPB89WK2-Di4kgP6B.mjs.map