@prisma/orm-toolchain 8.0.0-rc.1-dev.46 → 8.0.0-rc.10-dev.1

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 (123) hide show
  1. package/README.md +1 -5
  2. package/dist/{aggregate-CPZB020V.mjs → aggregate-B4HKshLQ.mjs} +10 -10
  3. package/dist/aggregate-B4HKshLQ.mjs.map +1 -0
  4. package/dist/{aggregate-DLUJLq5Y.d.mts → aggregate-D_eX4zoo.d.mts} +3 -3
  5. package/dist/{aggregate-DLUJLq5Y.d.mts.map → aggregate-D_eX4zoo.d.mts.map} +1 -1
  6. package/dist/cli-telemetry.d.mts +8 -7
  7. package/dist/cli-telemetry.d.mts.map +1 -1
  8. package/dist/cli-telemetry.mjs +22 -24
  9. package/dist/cli-telemetry.mjs.map +1 -1
  10. package/dist/cli.d.mts +2 -6
  11. package/dist/cli.d.mts.map +1 -1
  12. package/dist/cli.mjs +447 -430
  13. package/dist/cli.mjs.map +1 -1
  14. package/dist/cli__control-api.d.mts +20 -11
  15. package/dist/cli__control-api.d.mts.map +1 -1
  16. package/dist/cli__control-api.mjs +1 -1
  17. package/dist/cli__control-api__testing.d.mts +1 -1
  18. package/dist/cli__init-output.mjs +1 -1
  19. package/dist/cli__migration-cli.mjs +6 -6
  20. package/dist/cli__migration-cli.mjs.map +1 -1
  21. package/dist/config-loader.d.mts +1 -1
  22. package/dist/config-loader.mjs +1 -1
  23. package/dist/{contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs → contract-snapshot-store-qGrwlGmt-Cf2NFzRL.mjs} +3 -3
  24. package/dist/{contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs.map → contract-snapshot-store-qGrwlGmt-Cf2NFzRL.mjs.map} +1 -1
  25. package/dist/{db-verify-BwgNK50T-DGvKgFCK.d.mts → db-verify-Yih5kWtB-B1kv76ec.d.mts} +5 -5
  26. package/dist/{db-verify-BwgNK50T-DGvKgFCK.d.mts.map → db-verify-Yih5kWtB-B1kv76ec.d.mts.map} +1 -1
  27. package/dist/{domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs → domain-type-generation-CR9ECUau-DOlKbcaE.mjs} +20 -6
  28. package/dist/domain-type-generation-CR9ECUau-DOlKbcaE.mjs.map +1 -0
  29. package/dist/{domain-type-generation-PkAb39ob-Ct8AGqow.d.mts → domain-type-generation-X6-AaL1U-DHEoRf_y.d.mts} +14 -3
  30. package/dist/domain-type-generation-X6-AaL1U-DHEoRf_y.d.mts.map +1 -0
  31. package/dist/emitter.d.mts +2 -2
  32. package/dist/emitter.mjs +2 -2
  33. package/dist/emitter__domain-type-generation.d.mts +2 -2
  34. package/dist/emitter__domain-type-generation.mjs +2 -2
  35. package/dist/{errors-CXbGUWGu-CstQHPh6.mjs → errors-SoLLYLtw-DMxVbVs9.mjs} +9 -9
  36. package/dist/errors-SoLLYLtw-DMxVbVs9.mjs.map +1 -0
  37. package/dist/{exports-BZaG8_w_.mjs → exports-BXXeNWlj.mjs} +25 -47
  38. package/dist/exports-BXXeNWlj.mjs.map +1 -0
  39. package/dist/exports-CE6OD63o-4Qpqr2W7.mjs +398 -0
  40. package/dist/exports-CE6OD63o-4Qpqr2W7.mjs.map +1 -0
  41. package/dist/{exports-8ZUN43ve.mjs → exports-CYa2di3d.mjs} +382 -22
  42. package/dist/exports-CYa2di3d.mjs.map +1 -0
  43. package/dist/{graph-membership-BViWUMpP-C4lYYJdU.mjs → graph-membership-DY1Onbc3-CwBd6wuB.mjs} +3 -3
  44. package/dist/{graph-membership-BViWUMpP-C4lYYJdU.mjs.map → graph-membership-DY1Onbc3-CwBd6wuB.mjs.map} +1 -1
  45. package/dist/{import-roots-CfoYgejL.d.mts → import-roots-ARK1wjzc.d.mts} +3 -3
  46. package/dist/{import-roots-CfoYgejL.d.mts.map → import-roots-ARK1wjzc.d.mts.map} +1 -1
  47. package/dist/{import-roots-CNFBPAT1.mjs → import-roots-BHOrDJbI.mjs} +5 -5
  48. package/dist/import-roots-BHOrDJbI.mjs.map +1 -0
  49. package/dist/{index-Dgwl8Tzs.d.mts → index-D217lbiW.d.mts} +7 -3
  50. package/dist/index-D217lbiW.d.mts.map +1 -0
  51. package/dist/{index-DRs7L6N0.d.mts → index-u5RdrumF.d.mts} +2 -19
  52. package/dist/index-u5RdrumF.d.mts.map +1 -0
  53. package/dist/{invariants-CTHy88OP-CYI2a8IO.mjs → invariants-Cww4bv0v-BEiFxmbX.mjs} +3 -3
  54. package/dist/{invariants-CTHy88OP-CYI2a8IO.mjs.map → invariants-Cww4bv0v-BEiFxmbX.mjs.map} +1 -1
  55. package/dist/{io-635GlNx1-D3zrw2qu.mjs → io-BmWQNxRP-DQqbcPsS.mjs} +5 -5
  56. package/dist/{io-635GlNx1-D3zrw2qu.mjs.map → io-BmWQNxRP-DQqbcPsS.mjs.map} +1 -1
  57. package/dist/{migration-hspPIEeV.mjs → migration-B9w-7dKe.mjs} +4 -4
  58. package/dist/{migration-hspPIEeV.mjs.map → migration-B9w-7dKe.mjs.map} +1 -1
  59. package/dist/{migration-graph-_SJImD5V-BURyY1KM.mjs → migration-graph-CW4bMmTz-B5xFtFVB.mjs} +3 -3
  60. package/dist/{migration-graph-_SJImD5V-BURyY1KM.mjs.map → migration-graph-CW4bMmTz-B5xFtFVB.mjs.map} +1 -1
  61. package/dist/migration-tools.d.mts +3 -3
  62. package/dist/migration-tools.mjs +12 -12
  63. package/dist/migration-tools__aggregate.d.mts +1 -1
  64. package/dist/migration-tools__aggregate.mjs +1 -1
  65. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  66. package/dist/migration-tools__errors.mjs +1 -1
  67. package/dist/migration-tools__invariants.mjs +1 -1
  68. package/dist/migration-tools__io.mjs +1 -1
  69. package/dist/migration-tools__migration-graph.mjs +2 -2
  70. package/dist/migration-tools__migration.mjs +1 -1
  71. package/dist/migration-tools__ref-resolution.d.mts +1 -1
  72. package/dist/migration-tools__ref-resolution.mjs +1 -1
  73. package/dist/migration-tools__refs.mjs +1 -1
  74. package/dist/migration-tools__spaces.d.mts +1 -1
  75. package/dist/migration-tools__spaces.mjs +2 -2
  76. package/dist/{output-CovTDY14-CUoAqLML.mjs → output-D83nTTpC-XlvN30yS.mjs} +4 -4
  77. package/dist/{output-CovTDY14-CUoAqLML.mjs.map → output-D83nTTpC-XlvN30yS.mjs.map} +1 -1
  78. package/dist/publish-surface.d.mts +1 -1
  79. package/dist/publish-surface.mjs +2 -2
  80. package/dist/publish-surface__import-roots.d.mts +1 -1
  81. package/dist/publish-surface__import-roots.mjs +1 -1
  82. package/dist/publish-surface__shells.mjs +1 -1
  83. package/dist/quick-reference-mongo.md +11 -11
  84. package/dist/quick-reference-postgres.md +10 -10
  85. package/dist/readme-mongo.md +6 -6
  86. package/dist/readme-postgres.md +6 -6
  87. package/dist/{ref-h6InR6dO-rGfl18Jv.mjs → ref-DcqFmceq-QaUjgZeM.mjs} +190 -87
  88. package/dist/ref-DcqFmceq-QaUjgZeM.mjs.map +1 -0
  89. package/dist/{ref-resolution-HeNBXW53.mjs → ref-resolution-BWpwb8_b.mjs} +9 -2
  90. package/dist/ref-resolution-BWpwb8_b.mjs.map +1 -0
  91. package/dist/{ref-resolution-COGOSL57.d.mts → ref-resolution-CaHQJXE0.d.mts} +11 -1
  92. package/dist/ref-resolution-CaHQJXE0.d.mts.map +1 -0
  93. package/dist/{refs-WK86uYYp-gM8tvWQP.mjs → refs-BpSpzdYB-BcDelHGt.mjs} +9 -9
  94. package/dist/refs-BpSpzdYB-BcDelHGt.mjs.map +1 -0
  95. package/dist/{shells-C4HbRAr5.mjs → shells-BIdFZwUY.mjs} +1 -6
  96. package/dist/shells-BIdFZwUY.mjs.map +1 -0
  97. package/dist/{spaces-Dj65JrwZ.d.mts → spaces-B20bgxF9.d.mts} +2 -2
  98. package/dist/{spaces-Dj65JrwZ.d.mts.map → spaces-B20bgxF9.d.mts.map} +1 -1
  99. package/dist/{spaces-4qMOAYE9.mjs → spaces-BCZiAZQn.mjs} +7 -7
  100. package/dist/spaces-BCZiAZQn.mjs.map +1 -0
  101. package/dist/{verify-contract-spaces-DhJTb0zM-B62maCfE.mjs → verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs} +7 -7
  102. package/dist/{verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map → verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs.map} +1 -1
  103. package/dist/vite-plugin-contract-emit.d.mts +1 -1
  104. package/dist/vite-plugin-contract-emit.mjs +7 -7
  105. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  106. package/package.json +16 -16
  107. package/dist/aggregate-CPZB020V.mjs.map +0 -1
  108. package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts.map +0 -1
  109. package/dist/domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs.map +0 -1
  110. package/dist/errors-CXbGUWGu-CstQHPh6.mjs.map +0 -1
  111. package/dist/exports-8ZUN43ve.mjs.map +0 -1
  112. package/dist/exports-BCLg4CiV-05kuwcb0.mjs +0 -160
  113. package/dist/exports-BCLg4CiV-05kuwcb0.mjs.map +0 -1
  114. package/dist/exports-BZaG8_w_.mjs.map +0 -1
  115. package/dist/import-roots-CNFBPAT1.mjs.map +0 -1
  116. package/dist/index-DRs7L6N0.d.mts.map +0 -1
  117. package/dist/index-Dgwl8Tzs.d.mts.map +0 -1
  118. package/dist/ref-h6InR6dO-rGfl18Jv.mjs.map +0 -1
  119. package/dist/ref-resolution-COGOSL57.d.mts.map +0 -1
  120. package/dist/ref-resolution-HeNBXW53.mjs.map +0 -1
  121. package/dist/refs-WK86uYYp-gM8tvWQP.mjs.map +0 -1
  122. package/dist/shells-C4HbRAr5.mjs.map +0 -1
  123. package/dist/spaces-4qMOAYE9.mjs.map +0 -1
@@ -1,4 +1,5 @@
1
- import { l as validateRefName } from "./refs-WK86uYYp-gM8tvWQP.mjs";
1
+ import { t as EMPTY_CONTRACT_HASH } from "./constants-CM-w38DQ-Cz_EXbOc.mjs";
2
+ import { l as validateRefName } from "./refs-BpSpzdYB-BcDelHGt.mjs";
2
3
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
3
4
  //#region ../../../1-framework/3-tooling/migration/dist/exports/ref-resolution.mjs
4
5
  const FULL_HASH_PATTERN = /^([0-9a-f]{64}|empty)$/;
@@ -22,6 +23,8 @@ function findEdgeByDirName(graph, dirName) {
22
23
  * - `@db` — the live database marker (connection-required); callers MUST
23
24
  * check `result.value.provenance.kind === 'reserved-db'` and resolve the
24
25
  * actual hash via `readAllMarkers()` before using `result.value.hash`
26
+ * - `@empty` — the empty contract (offline; resolves to
27
+ * `EMPTY_CONTRACT_HASH`, the origin with no prior storage state)
25
28
  * - Full storage hash (64 hex chars or `empty`)
26
29
  * - Hex prefix (6+ hex chars, must uniquely identify one contract)
27
30
  * - Ref name (looked up in the refs index)
@@ -49,6 +52,10 @@ function parseContractRef(input, ctx) {
49
52
  hash: "",
50
53
  provenance: { kind: "reserved-db" }
51
54
  });
55
+ if (input === "@empty") return ok({
56
+ hash: EMPTY_CONTRACT_HASH,
57
+ provenance: { kind: "reserved-empty" }
58
+ });
52
59
  if (isFullHash(input)) {
53
60
  if (ctx.graph.nodes.has(input)) return ok({
54
61
  hash: input,
@@ -247,4 +254,4 @@ function parseMigrationRef(input, ctx) {
247
254
  //#endregion
248
255
  export { parseContractRef as n, parseMigrationRef as r, findEdgeByDirName as t };
249
256
 
250
- //# sourceMappingURL=ref-resolution-HeNBXW53.mjs.map
257
+ //# sourceMappingURL=ref-resolution-BWpwb8_b.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref-resolution-BWpwb8_b.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/ref-resolution.mjs"],"sourcesContent":["import { t as EMPTY_CONTRACT_HASH } from \"../constants-CM-w38DQ.mjs\";\nimport { l as validateRefName } from \"../refs-BpSpzdYB.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/refs/types.ts\nconst FULL_HASH_PATTERN = /^([0-9a-f]{64}|empty)$/;\nconst HEX_PREFIX_PATTERN = /^[0-9a-f]{6,}$/;\nfunction isFullHash(input) {\n\treturn FULL_HASH_PATTERN.test(input);\n}\nfunction isHexPrefix(input) {\n\treturn HEX_PREFIX_PATTERN.test(input);\n}\nfunction findEdgeByDirName(graph, dirName) {\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) if (edge.dirName === dirName) return edge;\n}\n//#endregion\n//#region src/refs/contract-ref.ts\n/**\n* Resolve a user-supplied string to a contract hash using the unified\n* contract-reference grammar.\n*\n* Accepted forms:\n* - `@contract` — the on-disk working contract hash (offline; requires\n* `ctx.contractHash` to be set)\n* - `@db` — the live database marker (connection-required); callers MUST\n* check `result.value.provenance.kind === 'reserved-db'` and resolve the\n* actual hash via `readAllMarkers()` before using `result.value.hash`\n* - `@empty` — the empty contract (offline; resolves to\n* `EMPTY_CONTRACT_HASH`, the origin with no prior storage state)\n* - Full storage hash (64 hex chars or `empty`)\n* - Hex prefix (6+ hex chars, must uniquely identify one contract)\n* - Ref name (looked up in the refs index)\n* - Migration directory name (resolves to the migration's `to`-contract)\n* - `<dir>^` (resolves to the migration's `from`-contract)\n*/\nfunction parseContractRef(input, ctx) {\n\tif (!input) return notOk({\n\t\tkind: \"invalid-format\",\n\t\tinput,\n\t\treason: \"Reference cannot be empty\"\n\t});\n\tif (input === \"@contract\") {\n\t\tif (ctx.contractHash === void 0) return notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t\treturn ok({\n\t\t\thash: ctx.contractHash,\n\t\t\tprovenance: { kind: \"reserved-contract\" }\n\t\t});\n\t}\n\tif (input === \"@db\") return ok({\n\t\thash: \"\",\n\t\tprovenance: { kind: \"reserved-db\" }\n\t});\n\tif (input === \"@empty\") return ok({\n\t\thash: EMPTY_CONTRACT_HASH,\n\t\tprovenance: { kind: \"reserved-empty\" }\n\t});\n\tif (isFullHash(input)) {\n\t\tif (ctx.graph.nodes.has(input)) return ok({\n\t\t\thash: input,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"hash\",\n\t\t\t\tinput\n\t\t\t}\n\t\t});\n\t\treturn notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t}\n\tif (input.endsWith(\"^\")) {\n\t\tconst dirName = input.slice(0, -1);\n\t\tif (!dirName) return notOk({\n\t\t\tkind: \"invalid-format\",\n\t\t\tinput,\n\t\t\treason: \"Missing directory name before ^\"\n\t\t});\n\t\tconst edge = findEdgeByDirName(ctx.graph, dirName);\n\t\tif (edge) return ok({\n\t\t\thash: edge.from,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"migration-from\",\n\t\t\t\tdirName\n\t\t\t}\n\t\t});\n\t\treturn notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t}\n\tconst candidates = [];\n\tif (validateRefName(input) && Object.hasOwn(ctx.refs, input)) {\n\t\tconst ref = ctx.refs[input];\n\t\tif (ref) candidates.push({\n\t\t\thash: ref.hash,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"ref\",\n\t\t\t\trefName: input\n\t\t\t},\n\t\t\tlabel: `ref \"${input}\"`\n\t\t});\n\t}\n\tconst edge = findEdgeByDirName(ctx.graph, input);\n\tif (edge) candidates.push({\n\t\thash: edge.to,\n\t\tprovenance: {\n\t\t\tkind: \"migration-to\",\n\t\t\tdirName: input\n\t\t},\n\t\tlabel: `migration directory \"${input}\"`\n\t});\n\tif (isHexPrefix(input)) {\n\t\tconst matches = [...ctx.graph.nodes].filter((n) => n.startsWith(input));\n\t\tconst [firstMatch] = matches;\n\t\tif (matches.length === 1 && firstMatch !== void 0) candidates.push({\n\t\t\thash: firstMatch,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"hash\",\n\t\t\t\tinput\n\t\t\t},\n\t\t\tlabel: `hash prefix \"${input}\"`\n\t\t});\n\t\telse if (matches.length > 1) return notOk({\n\t\t\tkind: \"ambiguous\",\n\t\t\tinput,\n\t\t\tcandidates: matches,\n\t\t\tgrammar: \"contract\"\n\t\t});\n\t}\n\tconst [firstCandidate] = candidates;\n\tif (candidates.length === 1 && firstCandidate !== void 0) return ok({\n\t\thash: firstCandidate.hash,\n\t\tprovenance: firstCandidate.provenance\n\t});\n\tif (candidates.length > 1) return notOk({\n\t\tkind: \"ambiguous\",\n\t\tinput,\n\t\tcandidates: candidates.map((c) => c.label),\n\t\tgrammar: \"contract\"\n\t});\n\treturn notOk({\n\t\tkind: \"not-found\",\n\t\tinput,\n\t\tgrammar: \"contract\"\n\t});\n}\n//#endregion\n//#region src/refs/migration-ref.ts\n/**\n* Resolve a user-supplied string to a migration using the migration-reference\n* grammar.\n*\n* Accepted forms:\n* - Migration directory name (e.g. `20260101-add-users`)\n* - Migration hash (full or 6+ hex prefix)\n*\n* Wrong-grammar diagnostics are produced when the input matches a\n* contract-grammar form (ref name, `<dir>^`, contract-only hash) so the\n* user gets a targeted hint rather than a generic \"not found\".\n*/\nfunction parseMigrationRef(input, ctx) {\n\tif (!input) return notOk({\n\t\tkind: \"invalid-format\",\n\t\tinput,\n\t\treason: \"Reference cannot be empty\"\n\t});\n\tif (input.endsWith(\"^\")) return notOk({\n\t\tkind: \"wrong-grammar\",\n\t\tinput,\n\t\texpectedGrammar: \"migration\",\n\t\tmessage: \"`^` syntax addresses contracts, not migrations\",\n\t\tfix: \"Pass the migration directory name without `^`, or use a contract-accepting flag like `--to` or `--from`.\"\n\t});\n\tif (validateRefName(input) && Object.hasOwn(ctx.refs, input)) return notOk({\n\t\tkind: \"wrong-grammar\",\n\t\tinput,\n\t\texpectedGrammar: \"migration\",\n\t\tmessage: `\"${input}\" is a ref name, not a migration`,\n\t\tfix: \"Refs point at contracts, not migrations. Use a migration directory name or migration hash.\"\n\t});\n\tconst edge = findEdgeByDirName(ctx.graph, input);\n\tif (edge) return ok({\n\t\tdirName: edge.dirName,\n\t\tmigrationHash: edge.migrationHash,\n\t\tfrom: edge.from,\n\t\tto: edge.to,\n\t\tprovenance: {\n\t\t\tkind: \"dir-name\",\n\t\t\tdirName: input\n\t\t}\n\t});\n\tif (isFullHash(input)) {\n\t\tconst migEdge = ctx.graph.migrationByHash.get(input);\n\t\tif (migEdge) return ok({\n\t\t\tdirName: migEdge.dirName,\n\t\t\tmigrationHash: migEdge.migrationHash,\n\t\t\tfrom: migEdge.from,\n\t\t\tto: migEdge.to,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"hash\",\n\t\t\t\tinput\n\t\t\t}\n\t\t});\n\t\tif (ctx.graph.nodes.has(input)) return notOk({\n\t\t\tkind: \"wrong-grammar\",\n\t\t\tinput,\n\t\t\texpectedGrammar: \"migration\",\n\t\t\tmessage: \"Hash matched a contract but not a migration\",\n\t\t\tfix: \"Use a contract-accepting flag like `--to` or `--from` to reference contracts by hash. Pass `migration show <dir>` for a specific migration.\"\n\t\t});\n\t\treturn notOk({\n\t\t\tkind: \"not-found\",\n\t\t\tinput,\n\t\t\tgrammar: \"migration\"\n\t\t});\n\t}\n\tif (isHexPrefix(input)) {\n\t\tconst migMatches = [...ctx.graph.migrationByHash.entries()].filter(([hash]) => hash.startsWith(input));\n\t\tconst [firstMigMatch] = migMatches;\n\t\tif (migMatches.length === 1 && firstMigMatch !== void 0) {\n\t\t\tconst [, matchedEdge] = firstMigMatch;\n\t\t\treturn ok({\n\t\t\t\tdirName: matchedEdge.dirName,\n\t\t\t\tmigrationHash: matchedEdge.migrationHash,\n\t\t\t\tfrom: matchedEdge.from,\n\t\t\t\tto: matchedEdge.to,\n\t\t\t\tprovenance: {\n\t\t\t\t\tkind: \"hash\",\n\t\t\t\t\tinput\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (migMatches.length > 1) return notOk({\n\t\t\tkind: \"ambiguous\",\n\t\t\tinput,\n\t\t\tcandidates: migMatches.map(([hash]) => hash),\n\t\t\tgrammar: \"migration\"\n\t\t});\n\t\tif ([...ctx.graph.nodes].filter((n) => n.startsWith(input)).length > 0) return notOk({\n\t\t\tkind: \"wrong-grammar\",\n\t\t\tinput,\n\t\t\texpectedGrammar: \"migration\",\n\t\t\tmessage: \"Hash matched a contract but not a migration\",\n\t\t\tfix: \"Use a contract-accepting flag like `--to` or `--from` to reference contracts by hash. Pass `migration show <dir>` for a specific migration.\"\n\t\t});\n\t}\n\treturn notOk({\n\t\tkind: \"not-found\",\n\t\tinput,\n\t\tgrammar: \"migration\"\n\t});\n}\n//#endregion\nexport { findEdgeByDirName, parseContractRef, parseMigrationRef };\n\n//# sourceMappingURL=ref-resolution.mjs.map"],"mappings":";;;;AAIA,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAC3B,SAAS,WAAW,OAAO;CAC1B,OAAO,kBAAkB,KAAK,KAAK;AACpC;AACA,SAAS,YAAY,OAAO;CAC3B,OAAO,mBAAmB,KAAK,KAAK;AACrC;AACA,SAAS,kBAAkB,OAAO,SAAS;CAC1C,KAAK,MAAM,SAAS,MAAM,aAAa,OAAO,GAAG,KAAK,MAAM,QAAQ,OAAO,IAAI,KAAK,YAAY,SAAS,OAAO;AACjH;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,iBAAiB,OAAO,KAAK;CACrC,IAAI,CAAC,OAAO,OAAO,MAAM;EACxB,MAAM;EACN;EACA,QAAQ;CACT,CAAC;CACD,IAAI,UAAU,aAAa;EAC1B,IAAI,IAAI,iBAAiB,KAAK,GAAG,OAAO,MAAM;GAC7C,MAAM;GACN;GACA,SAAS;EACV,CAAC;EACD,OAAO,GAAG;GACT,MAAM,IAAI;GACV,YAAY,EAAE,MAAM,oBAAoB;EACzC,CAAC;CACF;CACA,IAAI,UAAU,OAAO,OAAO,GAAG;EAC9B,MAAM;EACN,YAAY,EAAE,MAAM,cAAc;CACnC,CAAC;CACD,IAAI,UAAU,UAAU,OAAO,GAAG;EACjC,MAAM;EACN,YAAY,EAAE,MAAM,iBAAiB;CACtC,CAAC;CACD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;IACN;GACD;EACD,CAAC;EACD,IAAI,IAAI,MAAM,MAAM,IAAI,KAAK,GAAG,OAAO,MAAM;GAC5C,MAAM;GACN;GACA,iBAAiB;GACjB,SAAS;GACT,KAAK;EACN,CAAC;EACD,OAAO,MAAM;GACZ,MAAM;GACN;GACA,SAAS;EACV,CAAC;CACF;CACA,IAAI,YAAY,KAAK,GAAG;EACvB,MAAM,aAAa,CAAC,GAAG,IAAI,MAAM,gBAAgB,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,KAAK,WAAW,KAAK,CAAC;EACrG,MAAM,CAAC,iBAAiB;EACxB,IAAI,WAAW,WAAW,KAAK,kBAAkB,KAAK,GAAG;GACxD,MAAM,GAAG,eAAe;GACxB,OAAO,GAAG;IACT,SAAS,YAAY;IACrB,eAAe,YAAY;IAC3B,MAAM,YAAY;IAClB,IAAI,YAAY;IAChB,YAAY;KACX,MAAM;KACN;IACD;GACD,CAAC;EACF;EACA,IAAI,WAAW,SAAS,GAAG,OAAO,MAAM;GACvC,MAAM;GACN;GACA,YAAY,WAAW,KAAK,CAAC,UAAU,IAAI;GAC3C,SAAS;EACV,CAAC;EACD,IAAI,CAAC,GAAG,IAAI,MAAM,KAAK,CAAC,CAAC,QAAQ,MAAM,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,OAAO,MAAM;GACpF,MAAM;GACN;GACA,iBAAiB;GACjB,SAAS;GACT,KAAK;EACN,CAAC;CACF;CACA,OAAO,MAAM;EACZ,MAAM;EACN;EACA,SAAS;CACV,CAAC;AACF"}
@@ -42,6 +42,14 @@ type ContractRefProvenance = {
42
42
  */
43
43
  {
44
44
  readonly kind: 'reserved-db';
45
+ } |
46
+ /**
47
+ * Resolved from the `@empty` reserved token — the empty contract
48
+ * (`EMPTY_CONTRACT_HASH`), the origin with no prior storage state.
49
+ * Offline-resolvable.
50
+ */
51
+ {
52
+ readonly kind: 'reserved-empty';
45
53
  };
46
54
  /** A resolved contract reference: the target hash and how it was derived. */
47
55
  interface ContractRef {
@@ -100,6 +108,8 @@ declare function findEdgeByDirName(graph: MigrationGraph, dirName: string): Migr
100
108
  * - `@db` — the live database marker (connection-required); callers MUST
101
109
  * check `result.value.provenance.kind === 'reserved-db'` and resolve the
102
110
  * actual hash via `readAllMarkers()` before using `result.value.hash`
111
+ * - `@empty` — the empty contract (offline; resolves to
112
+ * `EMPTY_CONTRACT_HASH`, the origin with no prior storage state)
103
113
  * - Full storage hash (64 hex chars or `empty`)
104
114
  * - Hex prefix (6+ hex chars, must uniquely identify one contract)
105
115
  * - Ref name (looked up in the refs index)
@@ -124,4 +134,4 @@ declare function parseContractRef(input: string, ctx: RefResolutionContext): Res
124
134
  declare function parseMigrationRef(input: string, ctx: RefResolutionContext): Result<MigrationRef, RefResolutionError>;
125
135
  //#endregion
126
136
  export { RefResolutionAmbiguous as a, RefResolutionInvalidFormat as c, findEdgeByDirName as d, parseContractRef as f, MigrationRefProvenance as i, RefResolutionNotFound as l, ContractRefProvenance as n, RefResolutionContext as o, parseMigrationRef as p, MigrationRef as r, RefResolutionError as s, ContractRef as t, RefResolutionWrongGrammar as u };
127
- //# sourceMappingURL=ref-resolution-COGOSL57.d.mts.map
137
+ //# sourceMappingURL=ref-resolution-CaHQJXE0.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref-resolution-CaHQJXE0.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/ref-resolution.d.mts"],"mappings":";;;;;;UAKU;WACC,OAAO;WACP,MAAM;;;;;;WAMN;;KAEN;WACM;WACA;;WAEA;WACA;;WAEA;WACA;;WAEA;WACA;;;;;;;WAOA;;;;;;;;;WASA;;;;;;;;WAQA;;;UAGD;WACC;WACA,YAAY;;KAElB;WACM;WACA;;WAEA;WACA;;;UAGD;WACC;WACA;WACA;WACA;WACA,YAAY;;UAEb;WACC;WACA;WACA;;UAED;WACC;WACA;WACA;WACA;;UAED;WACC;WACA;WACA;WACA;WACA;;UAED;WACC;WACA;WACA;;KAEN,qBAAqB,wBAAwB,yBAAyB,4BAA4B;iBACtF,kBAAkB,OAAO,gBAAgB,kBAAkB;;;;;;;;;;;;;;;;;;;;;iBAqB3D,iBAAiB,eAAe,KAAK,uBAAuB,OAAO,aAAa;;;;;;;;;;;;;;;iBAehF,kBAAkB,eAAe,KAAK,uBAAuB,OAAO,cAAc"}
@@ -1,8 +1,8 @@
1
- import { b as errorInvalidRefName, t as MigrationToolsError, x as errorInvalidRefValue, y as errorInvalidRefFile } from "./errors-CXbGUWGu-CstQHPh6.mjs";
1
+ import { b as errorInvalidRefName, t as MigrationToolsError, x as errorInvalidRefValue, y as errorInvalidRefFile } from "./errors-SoLLYLtw-DMxVbVs9.mjs";
2
2
  import { dirname, join, relative } from "pathe";
3
3
  import { mkdir, readFile, readdir, rename, rmdir, unlink, writeFile } from "node:fs/promises";
4
4
  import { type } from "arktype";
5
- //#region ../../../1-framework/3-tooling/migration/dist/refs-WK86uYYp.mjs
5
+ //#region ../../../1-framework/3-tooling/migration/dist/refs-BpSpzdYB.mjs
6
6
  /**
7
7
  * The system head ref lives at `refs/head.json`. It is read (and its
8
8
  * corruption judged) through `readContractSpaceHeadRef`, not as a
@@ -43,11 +43,11 @@ async function readRef(refsDir, name) {
43
43
  } catch (error) {
44
44
  if (error instanceof Error && error.code === "ENOENT") throw new MigrationToolsError("MIGRATION.UNKNOWN_REF", `Unknown ref "${name}"`, {
45
45
  why: `No ref file found at "${filePath}".`,
46
- fix: `Create the ref with: prisma-next ref set ${name} <hash>`,
46
+ fix: `Create the ref with: {bin} migration ref set ${name} <hash>`,
47
47
  nextActions: [{
48
48
  kind: "run-command",
49
49
  label: `Create the ref "${name}"`,
50
- command: `{bin} ref set ${name} <hash>`
50
+ command: `{bin} migration ref set ${name} <hash>`
51
51
  }],
52
52
  meta: {
53
53
  refName: name,
@@ -189,11 +189,11 @@ async function deleteRef(refsDir, name) {
189
189
  } catch (error) {
190
190
  if (error instanceof Error && error.code === "ENOENT") throw new MigrationToolsError("MIGRATION.UNKNOWN_REF", `Unknown ref "${name}"`, {
191
191
  why: `No ref file found at "${filePath}".`,
192
- fix: "Run `prisma-next ref list` to see available refs.",
192
+ fix: "Run `{bin} migration ref list` to see available refs.",
193
193
  nextActions: [{
194
194
  kind: "run-command",
195
195
  label: "List the available refs",
196
- command: "{bin} ref list"
196
+ command: "{bin} migration ref list"
197
197
  }],
198
198
  meta: {
199
199
  refName: name,
@@ -237,11 +237,11 @@ function resolveRef(refs, name) {
237
237
  if (!validateRefName(name)) throw errorInvalidRefName(name);
238
238
  if (!Object.hasOwn(refs, name)) throw new MigrationToolsError("MIGRATION.UNKNOWN_REF", `Unknown ref "${name}"`, {
239
239
  why: `No ref named "${name}" exists.`,
240
- fix: `Available refs: ${Object.keys(refs).join(", ") || "(none)"}. Create a ref with: prisma-next ref set ${name} <hash>`,
240
+ fix: `Available refs: ${Object.keys(refs).join(", ") || "(none)"}. Create a ref with: {bin} migration ref set ${name} <hash>`,
241
241
  nextActions: [{
242
242
  kind: "run-command",
243
243
  label: `Create the ref "${name}"`,
244
- command: `{bin} ref set ${name} <hash>`,
244
+ command: `{bin} migration ref set ${name} <hash>`,
245
245
  reason: `Available refs: ${Object.keys(refs).join(", ") || "(none)"}.`
246
246
  }],
247
247
  meta: {
@@ -254,4 +254,4 @@ function resolveRef(refs, name) {
254
254
  //#endregion
255
255
  export { readRefsTolerant as a, resolveRefsByContractHash as c, writeRef as d, readRefs as i, validateRefName as l, deleteRef as n, refsByContractHash as o, readRef as r, resolveRef as s, HEAD_REF_NAME as t, validateRefValue as u };
256
256
 
257
- //# sourceMappingURL=refs-WK86uYYp-gM8tvWQP.mjs.map
257
+ //# sourceMappingURL=refs-BpSpzdYB-BcDelHGt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refs-BpSpzdYB-BcDelHGt.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/refs-BpSpzdYB.mjs"],"sourcesContent":["import { b as errorInvalidRefName, t as MigrationToolsError, x as errorInvalidRefValue, y as errorInvalidRefFile } from \"./errors-SoLLYLtw.mjs\";\nimport { dirname, join, relative } from \"pathe\";\nimport { mkdir, readFile, readdir, rename, rmdir, unlink, writeFile } from \"node:fs/promises\";\nimport { type } from \"arktype\";\n//#region src/refs.ts\n/**\n* The system head ref lives at `refs/head.json`. It is read (and its\n* corruption judged) through `readContractSpaceHeadRef`, not as a\n* user-authored ref, so {@link readRefsTolerant} excludes it.\n*/\nconst HEAD_REF_NAME = \"head\";\nconst REF_NAME_PATTERN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\/[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/;\nconst REF_VALUE_PATTERN = /^(empty|[0-9a-f]{64})$/;\nfunction validateRefName(name) {\n\tif (name.length === 0) return false;\n\tif (name.includes(\"..\")) return false;\n\tif (name.includes(\"//\")) return false;\n\tif (name.startsWith(\".\")) return false;\n\treturn REF_NAME_PATTERN.test(name);\n}\nfunction validateRefValue(value) {\n\treturn REF_VALUE_PATTERN.test(value);\n}\nconst RefEntrySchema = type({\n\thash: \"string\",\n\tinvariants: \"string[]\"\n}).narrow((entry, ctx) => {\n\tif (!validateRefValue(entry.hash)) return ctx.mustBe(`a valid contract hash (got \"${entry.hash}\")`);\n\treturn true;\n});\nfunction refFilePath(refsDir, name) {\n\treturn join(refsDir, `${name}.json`);\n}\nfunction refNameFromPath(refsDir, filePath) {\n\treturn relative(refsDir, filePath).replace(/\\.json$/, \"\");\n}\nasync function readRef(refsDir, name) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tconst filePath = refFilePath(refsDir, name);\n\tlet raw;\n\ttry {\n\t\traw = await readFile(filePath, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") throw new MigrationToolsError(\"MIGRATION.UNKNOWN_REF\", `Unknown ref \"${name}\"`, {\n\t\t\twhy: `No ref file found at \"${filePath}\".`,\n\t\t\tfix: `Create the ref with: {bin} migration ref set ${name} <hash>`,\n\t\t\tnextActions: [{\n\t\t\t\tkind: \"run-command\",\n\t\t\t\tlabel: `Create the ref \"${name}\"`,\n\t\t\t\tcommand: `{bin} migration ref set ${name} <hash>`\n\t\t\t}],\n\t\t\tmeta: {\n\t\t\t\trefName: name,\n\t\t\t\tfilePath\n\t\t\t}\n\t\t});\n\t\tthrow error;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\tthrow errorInvalidRefFile(filePath, \"Failed to parse as JSON\");\n\t}\n\tconst result = RefEntrySchema(parsed);\n\tif (result instanceof type.errors) throw errorInvalidRefFile(filePath, result.summary);\n\treturn result;\n}\nasync function readRefs(refsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(refsDir, {\n\t\t\trecursive: true,\n\t\t\tencoding: \"utf-8\"\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return {};\n\t\tthrow error;\n\t}\n\tconst jsonFiles = entries.filter((entry) => entry.endsWith(\".json\") && !entry.endsWith(\".contract.json\"));\n\tconst refs = {};\n\tfor (const jsonFile of jsonFiles) {\n\t\tconst filePath = join(refsDir, jsonFile);\n\t\tconst name = refNameFromPath(refsDir, filePath);\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = await readFile(filePath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tconst code = error instanceof Error ? error.code : void 0;\n\t\t\tif (code === \"ENOENT\" || code === \"EISDIR\") continue;\n\t\t\tthrow error;\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = JSON.parse(raw);\n\t\t} catch {\n\t\t\tthrow errorInvalidRefFile(filePath, \"Failed to parse as JSON\");\n\t\t}\n\t\tconst result = RefEntrySchema(parsed);\n\t\tif (result instanceof type.errors) throw errorInvalidRefFile(filePath, result.summary);\n\t\trefs[name] = result;\n\t}\n\treturn refs;\n}\n/**\n* Read a space's user-authored refs without ever throwing on disk\n* content. A ref whose JSON is unparseable or whose shape fails\n* {@link RefEntrySchema} is omitted from `refs` and reported as a\n* {@link RefLoadProblem}; the remaining well-formed refs are still\n* returned. A missing `refs/` directory yields no refs and no problems.\n*\n* `refs/head.json` is deliberately skipped here: the system head ref is\n* read through `readContractSpaceHeadRef` (which validates head-ref\n* shape, distinct from the strict user-ref hash grammar), so it is judged\n* there and never doubles as a user ref. Genuine I/O faults (EACCES, EIO,\n* …) still propagate — only parse / schema problems are made tolerant.\n*/\nasync function readRefsTolerant(refsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(refsDir, {\n\t\t\trecursive: true,\n\t\t\tencoding: \"utf-8\"\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return {\n\t\t\trefs: {},\n\t\t\tproblems: []\n\t\t};\n\t\tthrow error;\n\t}\n\tconst jsonFiles = entries.filter((entry) => entry.endsWith(\".json\") && !entry.endsWith(\".contract.json\") && entry !== `head.json`);\n\tconst refs = {};\n\tconst problems = [];\n\tfor (const jsonFile of jsonFiles) {\n\t\tconst filePath = join(refsDir, jsonFile);\n\t\tconst name = refNameFromPath(refsDir, filePath);\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = await readFile(filePath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tconst code = error instanceof Error ? error.code : void 0;\n\t\t\tif (code === \"ENOENT\" || code === \"EISDIR\") continue;\n\t\t\tthrow error;\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = JSON.parse(raw);\n\t\t} catch (e) {\n\t\t\tproblems.push({\n\t\t\t\trefName: name,\n\t\t\t\tdetail: e instanceof Error ? e.message : String(e)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst result = RefEntrySchema(parsed);\n\t\tif (result instanceof type.errors) {\n\t\t\tproblems.push({\n\t\t\t\trefName: name,\n\t\t\t\tdetail: result.summary\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\trefs[name] = result;\n\t}\n\treturn {\n\t\trefs,\n\t\tproblems\n\t};\n}\nasync function writeRef(refsDir, name, entry) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tif (!validateRefValue(entry.hash)) throw errorInvalidRefValue(entry.hash);\n\tconst filePath = refFilePath(refsDir, name);\n\tconst dir = dirname(filePath);\n\tawait mkdir(dir, { recursive: true });\n\tconst tmpPath = join(dir, `.${name.split(\"/\").pop()}.json.${Date.now()}.tmp`);\n\tawait writeFile(tmpPath, `${JSON.stringify({\n\t\thash: entry.hash,\n\t\tinvariants: [...entry.invariants]\n\t}, null, 2)}\\n`);\n\tawait rename(tmpPath, filePath);\n}\nasync function deleteRef(refsDir, name) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tconst filePath = refFilePath(refsDir, name);\n\ttry {\n\t\tawait unlink(filePath);\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") throw new MigrationToolsError(\"MIGRATION.UNKNOWN_REF\", `Unknown ref \"${name}\"`, {\n\t\t\twhy: `No ref file found at \"${filePath}\".`,\n\t\t\tfix: \"Run `{bin} migration ref list` to see available refs.\",\n\t\t\tnextActions: [{\n\t\t\t\tkind: \"run-command\",\n\t\t\t\tlabel: \"List the available refs\",\n\t\t\t\tcommand: \"{bin} migration ref list\"\n\t\t\t}],\n\t\t\tmeta: {\n\t\t\t\trefName: name,\n\t\t\t\tfilePath\n\t\t\t}\n\t\t});\n\t\tthrow error;\n\t}\n\tlet dir = dirname(filePath);\n\twhile (dir !== refsDir && dir.startsWith(refsDir)) try {\n\t\tawait rmdir(dir);\n\t\tdir = dirname(dir);\n\t} catch (error) {\n\t\tconst code = error instanceof Error ? error.code : void 0;\n\t\tif (code === \"ENOTEMPTY\" || code === \"EEXIST\" || code === \"ENOENT\") break;\n\t\tthrow error;\n\t}\n}\n/**\n* Index user-authored refs by the contract hash each ref points at.\n* Each bucket is sorted lex-asc for deterministic output.\n*/\nfunction refsByContractHash(refs) {\n\tconst byHash = /* @__PURE__ */ new Map();\n\tfor (const [name, entry] of Object.entries(refs)) {\n\t\tconst bucket = byHash.get(entry.hash);\n\t\tif (bucket) bucket.push(name);\n\t\telse byHash.set(entry.hash, [name]);\n\t}\n\tfor (const bucket of byHash.values()) bucket.sort();\n\treturn byHash;\n}\n/**\n* Read `migrations/<space>/refs/*.json` and index by destination hash.\n* Returns an empty map when the refs directory does not exist.\n*/\nasync function resolveRefsByContractHash(refsDir) {\n\treturn refsByContractHash(await readRefs(refsDir));\n}\nfunction resolveRef(refs, name) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tif (!Object.hasOwn(refs, name)) throw new MigrationToolsError(\"MIGRATION.UNKNOWN_REF\", `Unknown ref \"${name}\"`, {\n\t\twhy: `No ref named \"${name}\" exists.`,\n\t\tfix: `Available refs: ${Object.keys(refs).join(\", \") || \"(none)\"}. Create a ref with: {bin} migration ref set ${name} <hash>`,\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: `Create the ref \"${name}\"`,\n\t\t\tcommand: `{bin} migration ref set ${name} <hash>`,\n\t\t\treason: `Available refs: ${Object.keys(refs).join(\", \") || \"(none)\"}.`\n\t\t}],\n\t\tmeta: {\n\t\t\trefName: name,\n\t\t\tavailableRefs: Object.keys(refs)\n\t\t}\n\t});\n\treturn refs[name];\n}\n//#endregion\nexport { readRefsTolerant as a, resolveRefsByContractHash as c, writeRef as d, readRefs as i, validateRefName as l, deleteRef as n, refsByContractHash as o, readRef as r, resolveRef as s, HEAD_REF_NAME as t, validateRefValue as u };\n\n//# sourceMappingURL=refs-BpSpzdYB.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,gBAAgB;AACtB,MAAM,mBAAmB;AACzB,MAAM,oBAAoB;AAC1B,SAAS,gBAAgB,MAAM;CAC9B,IAAI,KAAK,WAAW,GAAG,OAAO;CAC9B,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO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AI,CAAC,OAAO,OAAO,MAAM,IAAI,GAAG,MAAM,IAAI,oBAAoB,yBAAyB,gBAAgB,KAAK,IAAI;EAC/G,KAAK,iBAAiB,KAAK;EAC3B,KAAK,mBAAmB,OAAO,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,SAAS,+CAA+C,KAAK;EACrH,aAAa,CAAC;GACb,MAAM;GACN,OAAO,mBAAmB,KAAK;GAC/B,SAAS,2BAA2B,KAAK;GACzC,QAAQ,mBAAmB,OAAO,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,SAAS;EACrE,CAAC;EACD,MAAM;GACL,SAAS;GACT,eAAe,OAAO,KAAK,IAAI;EAChC;CACD,CAAC;CACD,OAAO,KAAK;AACb"}
@@ -291,11 +291,6 @@ const publicShells = /* @__PURE__ */ new Map([
291
291
  name: "@internal/sql-contract-emitter",
292
292
  entry: "contract-emitter"
293
293
  },
294
- {
295
- dir: "packages/2-sql/4-lanes/query-builder",
296
- name: "@internal/sql-lane-query-builder",
297
- entry: "lane-query-builder"
298
- },
299
294
  {
300
295
  dir: "packages/2-sql/4-lanes/relational-core",
301
296
  name: "@internal/sql-relational-core",
@@ -598,4 +593,4 @@ const excludedSubpaths = [/^\.\/test(\/|$)/];
598
593
  //#endregion
599
594
  export { publicShells as n, excludedSubpaths as t };
600
595
 
601
- //# sourceMappingURL=shells-C4HbRAr5.mjs.map
596
+ //# sourceMappingURL=shells-BIdFZwUY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shells-BIdFZwUY.mjs","names":[],"sources":["../../../../0-shared/publish-surface/dist/shells.mjs"],"sourcesContent":["//#region src/shells.ts\n/**\n* Surfaces every facade republishes regardless of family.\n*\n* An application depends on one facade and nothing else (ADR 242), so\n* everything it reaches — hand-written and generated alike — has to have a\n* name under the facade. These are the target-agnostic ones: the contract and\n* component surfaces emitted files import, the shared helpers, and the Vite\n* plugin.\n*\n* Entry names follow the name the platform shell gives the same package, so\n* one internal package reads the same way wherever it is reached from.\n*\n* A republished package brings its whole subpath surface with it unless the\n* entry lists `subpaths`, so the cost of an entry is its export count, not\n* one. Nothing goes in here that no application reaches.\n*\n* `migration-tools` is listed by subpath rather than whole. An application\n* does reach it — a project that checks its own migrations are intact, or\n* that stages an extension's pinned contract-space artifacts before `db\n* init`, reads and writes the on-disk migration format, and under a\n* facade-only install there is no other published name for it. But it is a\n* 17-subpath tooling package whose remaining surface (the graph, the\n* pathfinder, ref resolution, the ledger) is the CLI's own working material,\n* and publishing that would freeze it. The five listed here are what the\n* repository's own consumers reach.\n*/\nconst COMMON_FACADE_REEXPORTS = [\n\t{\n\t\tpackage: \"@internal/contract\",\n\t\tentry: \"contract\"\n\t},\n\t{\n\t\tpackage: \"@internal/framework-components\",\n\t\tentry: \"components\"\n\t},\n\t{\n\t\tpackage: \"@internal/utils\",\n\t\tentry: \"utils\"\n\t},\n\t{\n\t\tpackage: \"@internal/vite-plugin-contract-emit\",\n\t\tentry: \"vite-plugin-contract-emit\"\n\t},\n\t{\n\t\tpackage: \"@internal/migration-tools\",\n\t\tentry: \"migration-tools\",\n\t\tsubpaths: [\n\t\t\t\"aggregate\",\n\t\t\t\"contract-snapshot-store\",\n\t\t\t\"hash\",\n\t\t\t\"io\",\n\t\t\t\"spaces\"\n\t\t]\n\t}\n];\n/**\n* The per-database part of a facade's republished surface.\n*\n* `family` is the family's contract package (`@internal/sql-contract` or\n* `@internal/mongo-contract`) and `familyPack` its control-plane and IR\n* pack; `target` and `adapter` carry the codec and operation types emitted\n* contracts reference; `runtime` is the family runtime an application drives\n* queries through.\n*\n* `family-contract` and `family-runtime` take a qualified name because the\n* facade's own `contract` and `runtime` are different modules. `target` and\n* `familyPack` forward subpaths only, so that a facade which publishes its own\n* `./target` or `./family` pack keeps that name for its own module; where a\n* facade publishes neither, the plain name simply stays free.\n*\n* `driver` is carried by every facade. A facade wires its own driver, so the\n* only code that names one is code driving the migration planner or runner\n* itself — which the SQL facades were assumed not to have, until the SQL\n* migration-planner harnesses turned out to need the driver's control\n* descriptor to build a control stack by hand. Two subpaths per facade.\n*/\nfunction facadeReexports(options) {\n\treturn [\n\t\t...COMMON_FACADE_REEXPORTS,\n\t\t{\n\t\t\tpackage: options.family,\n\t\t\tentry: \"family-contract\"\n\t\t},\n\t\t{\n\t\t\tpackage: options.familyPack,\n\t\t\tentry: \"family\",\n\t\t\troot: false\n\t\t},\n\t\t{\n\t\t\tpackage: options.runtime,\n\t\t\tentry: \"family-runtime\"\n\t\t},\n\t\t{\n\t\t\tpackage: options.target,\n\t\t\tentry: \"target\",\n\t\t\troot: false\n\t\t},\n\t\t{\n\t\t\tpackage: options.adapter,\n\t\t\tentry: \"adapter\"\n\t\t},\n\t\t{\n\t\t\tpackage: options.driver,\n\t\t\tentry: \"driver\"\n\t\t},\n\t\t...options.queryBuilders\n\t];\n}\n/**\n* The SQL family's query surfaces, republished by both SQL facades.\n*\n* `schema-ir` carries one subpath. Code that authors a migration by hand, or\n* drives the planner itself, names `SqlSchemaIR` — it is the schema shape the\n* planner takes and returns. The package's other two subpaths are the IR's\n* construction and naming internals, which publishing would freeze.\n*/\nconst SQL_QUERY_REEXPORTS = [\n\t{\n\t\tpackage: \"@internal/sql-orm-client\",\n\t\tentry: \"orm-client\"\n\t},\n\t{\n\t\tpackage: \"@internal/sql-builder\",\n\t\tentry: \"builder\"\n\t},\n\t{\n\t\tpackage: \"@internal/sql-relational-core\",\n\t\tentry: \"relational-core\"\n\t},\n\t{\n\t\tpackage: \"@internal/sql-schema-ir\",\n\t\tentry: \"schema-ir\",\n\t\tsubpaths: [\"types\"]\n\t}\n];\nconst publicShells = /* @__PURE__ */ new Map([\n\t[\"@prisma/orm-framework\", {\n\t\tdir: \"packages/9-public/@prisma/orm-framework\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/0-foundation/contract\",\n\t\t\t\tname: \"@internal/contract\",\n\t\t\t\tentry: \"contract\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/0-foundation/utils\",\n\t\t\t\tname: \"@internal/utils\",\n\t\t\t\tentry: \"utils\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/config\",\n\t\t\t\tname: \"@internal/config\",\n\t\t\t\tentry: \"config\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/errors\",\n\t\t\t\tname: \"@internal/errors\",\n\t\t\t\tentry: \"errors\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/framework-components\",\n\t\t\t\tname: \"@internal/framework-components\",\n\t\t\t\tentry: \"components\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/operations\",\n\t\t\t\tname: \"@internal/operations\",\n\t\t\t\tentry: \"operations\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/1-core/ts-render\",\n\t\t\t\tname: \"@internal/ts-render\",\n\t\t\t\tentry: \"ts-render\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/2-authoring/contract\",\n\t\t\t\tname: \"@internal/contract-authoring\",\n\t\t\t\tentry: \"contract-authoring\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/2-authoring/ids\",\n\t\t\t\tname: \"@internal/ids\",\n\t\t\t\tentry: \"ids\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/2-authoring/psl-parser\",\n\t\t\t\tname: \"@internal/psl-parser\",\n\t\t\t\tentry: \"psl-parser\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/2-authoring/psl-printer\",\n\t\t\t\tname: \"@internal/psl-printer\",\n\t\t\t\tentry: \"psl-printer\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-toolchain\", {\n\t\tdir: \"packages/9-public/@prisma/orm-toolchain\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/cli\",\n\t\t\t\tname: \"@internal/cli\",\n\t\t\t\tentry: \"cli\",\n\t\t\t\tsubpaths: [\n\t\t\t\t\t\".\",\n\t\t\t\t\t\"migration-cli\",\n\t\t\t\t\t\"control-api\",\n\t\t\t\t\t\"control-api/testing\",\n\t\t\t\t\t\"config-types\",\n\t\t\t\t\t\"init-output\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/cli-telemetry\",\n\t\t\t\tname: \"@internal/cli-telemetry\",\n\t\t\t\tentry: \"cli-telemetry\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/config-loader\",\n\t\t\t\tname: \"@internal/config-loader\",\n\t\t\t\tentry: \"config-loader\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/emitter\",\n\t\t\t\tname: \"@internal/emitter\",\n\t\t\t\tentry: \"emitter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/language-server\",\n\t\t\t\tname: \"@internal/language-server\",\n\t\t\t\tentry: \"language-server\",\n\t\t\t\tpublished: false\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/migration\",\n\t\t\t\tname: \"@internal/migration-tools\",\n\t\t\t\tentry: \"migration-tools\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/1-framework/3-tooling/vite-plugin-contract-emit\",\n\t\t\t\tname: \"@internal/vite-plugin-contract-emit\",\n\t\t\t\tentry: \"vite-plugin-contract-emit\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/0-shared/publish-surface\",\n\t\t\t\tname: \"@internal/publish-surface\",\n\t\t\t\tentry: \"publish-surface\"\n\t\t\t}\n\t\t],\n\t\tcopy: [\"packages/1-framework/3-tooling/cli/dist/*.md\"]\n\t}],\n\t[\"@prisma/orm-family-sql\", {\n\t\tdir: \"packages/9-public/@prisma/orm-family-sql\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/1-core/contract\",\n\t\t\t\tname: \"@internal/sql-contract\",\n\t\t\t\tentry: \"contract\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/1-core/errors\",\n\t\t\t\tname: \"@internal/sql-errors\",\n\t\t\t\tentry: \"errors\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/1-core/operations\",\n\t\t\t\tname: \"@internal/sql-operations\",\n\t\t\t\tentry: \"operations\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/1-core/schema-ir\",\n\t\t\t\tname: \"@internal/sql-schema-ir\",\n\t\t\t\tentry: \"schema-ir\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/2-authoring/contract-psl\",\n\t\t\t\tname: \"@internal/sql-contract-psl\",\n\t\t\t\tentry: \"contract-psl\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/2-authoring/contract-ts\",\n\t\t\t\tname: \"@internal/sql-contract-ts\",\n\t\t\t\tentry: \"contract-ts\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/3-tooling/emitter\",\n\t\t\t\tname: \"@internal/sql-contract-emitter\",\n\t\t\t\tentry: \"contract-emitter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/4-lanes/relational-core\",\n\t\t\t\tname: \"@internal/sql-relational-core\",\n\t\t\t\tentry: \"relational-core\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/4-lanes/sql-builder\",\n\t\t\t\tname: \"@internal/sql-builder\",\n\t\t\t\tentry: \"builder\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/5-runtime\",\n\t\t\t\tname: \"@internal/sql-runtime\",\n\t\t\t\tentry: \"runtime\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-sql/9-family\",\n\t\t\t\tname: \"@internal/family-sql\",\n\t\t\t\tentry: \"family\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-extensions/sql-orm-client\",\n\t\t\t\tname: \"@internal/sql-orm-client\",\n\t\t\t\tentry: \"orm-client\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-family-mongo\", {\n\t\tdir: \"packages/9-public/@prisma/orm-family-mongo\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/1-foundation/mongo-codec\",\n\t\t\t\tname: \"@internal/mongo-codec\",\n\t\t\t\tentry: \"codec\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/1-foundation/mongo-contract\",\n\t\t\t\tname: \"@internal/mongo-contract\",\n\t\t\t\tentry: \"contract\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/1-foundation/mongo-value\",\n\t\t\t\tname: \"@internal/mongo-value\",\n\t\t\t\tentry: \"value\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/2-authoring/contract-psl\",\n\t\t\t\tname: \"@internal/mongo-contract-psl\",\n\t\t\t\tentry: \"contract-psl\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/2-authoring/contract-ts\",\n\t\t\t\tname: \"@internal/mongo-contract-ts\",\n\t\t\t\tentry: \"contract-ts\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/3-tooling/emitter\",\n\t\t\t\tname: \"@internal/mongo-emitter\",\n\t\t\t\tentry: \"emitter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/3-tooling/mongo-schema-ir\",\n\t\t\t\tname: \"@internal/mongo-schema-ir\",\n\t\t\t\tentry: \"schema-ir\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/4-query/query-ast\",\n\t\t\t\tname: \"@internal/mongo-query-ast\",\n\t\t\t\tentry: \"query-ast\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/5-query-builders/orm\",\n\t\t\t\tname: \"@internal/mongo-orm\",\n\t\t\t\tentry: \"orm\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/5-query-builders/query-builder\",\n\t\t\t\tname: \"@internal/mongo-query-builder\",\n\t\t\t\tentry: \"query-builder\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/6-transport/mongo-lowering\",\n\t\t\t\tname: \"@internal/mongo-lowering\",\n\t\t\t\tentry: \"lowering\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/6-transport/mongo-wire\",\n\t\t\t\tname: \"@internal/mongo-wire\",\n\t\t\t\tentry: \"wire\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/7-runtime\",\n\t\t\t\tname: \"@internal/mongo-runtime\",\n\t\t\t\tentry: \"runtime\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/2-mongo-family/9-family\",\n\t\t\t\tname: \"@internal/family-mongo\",\n\t\t\t\tentry: \"family\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-target-postgres\", {\n\t\tdir: \"packages/9-public/@prisma/orm-target-postgres\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/3-targets/postgres\",\n\t\t\t\tname: \"@internal/target-postgres\",\n\t\t\t\tentry: \"target\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/6-adapters/postgres\",\n\t\t\t\tname: \"@internal/adapter-postgres\",\n\t\t\t\tentry: \"adapter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/7-drivers/postgres\",\n\t\t\t\tname: \"@internal/driver-postgres\",\n\t\t\t\tentry: \"driver\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-target-sqlite\", {\n\t\tdir: \"packages/9-public/@prisma/orm-target-sqlite\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/3-targets/sqlite\",\n\t\t\t\tname: \"@internal/target-sqlite\",\n\t\t\t\tentry: \"target\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/6-adapters/sqlite\",\n\t\t\t\tname: \"@internal/adapter-sqlite\",\n\t\t\t\tentry: \"adapter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-targets/7-drivers/sqlite\",\n\t\t\t\tname: \"@internal/driver-sqlite\",\n\t\t\t\tentry: \"driver\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-target-mongo\", {\n\t\tdir: \"packages/9-public/@prisma/orm-target-mongo\",\n\t\tkind: \"platform\",\n\t\tpackages: [\n\t\t\t{\n\t\t\t\tdir: \"packages/3-mongo-target/1-mongo-target\",\n\t\t\t\tname: \"@internal/target-mongo\",\n\t\t\t\tentry: \"target\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-mongo-target/2-mongo-adapter\",\n\t\t\t\tname: \"@internal/adapter-mongo\",\n\t\t\t\tentry: \"adapter\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tdir: \"packages/3-mongo-target/3-mongo-driver\",\n\t\t\t\tname: \"@internal/driver-mongo\",\n\t\t\t\tentry: \"driver\"\n\t\t\t}\n\t\t]\n\t}],\n\t[\"@prisma/orm-postgres\", {\n\t\tdir: \"packages/9-public/@prisma/orm-postgres\",\n\t\tkind: \"facade\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/postgres\",\n\t\t\tname: \"@internal/postgres\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\treexports: facadeReexports({\n\t\t\tfamily: \"@internal/sql-contract\",\n\t\t\tfamilyPack: \"@internal/family-sql\",\n\t\t\truntime: \"@internal/sql-runtime\",\n\t\t\ttarget: \"@internal/target-postgres\",\n\t\t\tadapter: \"@internal/adapter-postgres\",\n\t\t\tdriver: \"@internal/driver-postgres\",\n\t\t\tqueryBuilders: SQL_QUERY_REEXPORTS\n\t\t})\n\t}],\n\t[\"@prisma/orm-sqlite\", {\n\t\tdir: \"packages/9-public/@prisma/orm-sqlite\",\n\t\tkind: \"facade\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/sqlite\",\n\t\t\tname: \"@internal/sqlite\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\treexports: facadeReexports({\n\t\t\tfamily: \"@internal/sql-contract\",\n\t\t\tfamilyPack: \"@internal/family-sql\",\n\t\t\truntime: \"@internal/sql-runtime\",\n\t\t\ttarget: \"@internal/target-sqlite\",\n\t\t\tadapter: \"@internal/adapter-sqlite\",\n\t\t\tdriver: \"@internal/driver-sqlite\",\n\t\t\tqueryBuilders: SQL_QUERY_REEXPORTS\n\t\t})\n\t}],\n\t[\"@prisma/orm-mongo\", {\n\t\tdir: \"packages/9-public/@prisma/orm-mongo\",\n\t\tkind: \"facade\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/mongo\",\n\t\t\tname: \"@internal/mongo\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\treexports: facadeReexports({\n\t\t\tfamily: \"@internal/mongo-contract\",\n\t\t\tfamilyPack: \"@internal/family-mongo\",\n\t\t\truntime: \"@internal/mongo-runtime\",\n\t\t\ttarget: \"@internal/target-mongo\",\n\t\t\tadapter: \"@internal/adapter-mongo\",\n\t\t\tdriver: \"@internal/driver-mongo\",\n\t\t\tqueryBuilders: [\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/mongo-orm\",\n\t\t\t\t\tentry: \"orm\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/mongo-query-builder\",\n\t\t\t\t\tentry: \"query-builder\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/mongo-query-ast\",\n\t\t\t\t\tentry: \"query-ast\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/mongo-value\",\n\t\t\t\t\tentry: \"value\"\n\t\t\t\t}\n\t\t\t]\n\t\t})\n\t}],\n\t[\"@prisma/orm-extension-postgis\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-postgis\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/postgis\",\n\t\t\tname: \"@internal/extension-postgis\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-pgvector\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-pgvector\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/pgvector\",\n\t\t\tname: \"@internal/extension-pgvector\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-paradedb\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-paradedb\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/paradedb\",\n\t\t\tname: \"@internal/extension-paradedb\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-supabase\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-supabase\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/supabase\",\n\t\t\tname: \"@internal/extension-supabase\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-arktype-json\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-arktype-json\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/arktype-json\",\n\t\t\tname: \"@internal/extension-arktype-json\",\n\t\t\tentry: \"\"\n\t\t}],\n\t\tpeerShells: [\"@prisma/orm-target-postgres\"]\n\t}],\n\t[\"@prisma/orm-extension-middleware-cache\", {\n\t\tdir: \"packages/9-public/@prisma/orm-extension-middleware-cache\",\n\t\tkind: \"extension\",\n\t\tpackages: [{\n\t\t\tdir: \"packages/3-extensions/middleware-cache\",\n\t\t\tname: \"@internal/middleware-cache\",\n\t\t\tentry: \"\"\n\t\t}]\n\t}]\n]);\n/** Export subpaths that never ship in a shell (test-only surfaces). */\nconst excludedSubpaths = [/^\\.\\/test(\\/|$)/];\n//#endregion\nexport { excludedSubpaths, publicShells };\n\n//# sourceMappingURL=shells.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,0BAA0B;CAC/B;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;EACP,UAAU;GACT;GACA;GACA;GACA;GACA;EACD;CACD;AACD;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,SAAS;CACjC,OAAO;EACN,GAAG;EACH;GACC,SAAS,QAAQ;GACjB,OAAO;EACR;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;GACP,MAAM;EACP;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;EACR;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;GACP,MAAM;EACP;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;EACR;EACA;GACC,SAAS,QAAQ;GACjB,OAAO;EACR;EACA,GAAG,QAAQ;CACZ;AACD;;;;;;;;;AASA,MAAM,sBAAsB;CAC3B;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;CACR;CACA;EACC,SAAS;EACT,OAAO;EACP,UAAU,CAAC,OAAO;CACnB;AACD;AACA,MAAM,+BAA+B,IAAI,IAAI;CAC5C,CAAC,yBAAyB;EACzB,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;EACD;CACD,CAAC;CACD,CAAC,yBAAyB;EACzB,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;IACP,UAAU;KACT;KACA;KACA;KACA;KACA;KACA;IACD;GACD;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;IACP,WAAW;GACZ;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;EACD;EACA,MAAM,CAAC,8CAA8C;CACtD,CAAC;CACD,CAAC,0BAA0B;EAC1B,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;EACD;CACD,CAAC;CACD,CAAC,4BAA4B;EAC5B,KAAK;EACL,MAAM;EACN,UAAU;GACT;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACA;IACC,KAAK;IACL,MAAM;IACN,OAAO;G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;GACR,SAAS;GACT,QAAQ;GACR,eAAe;IACd;KACC,SAAS;KACT,OAAO;IACR;IACA;KACC,SAAS;KACT,OAAO;IACR;IACA;KACC,SAAS;KACT,OAAO;IACR;IACA;KACC,SAAS;KACT,OAAO;IACR;GACD;EACD,CAAC;CACF,CAAC;CACD,CAAC,iCAAiC;EACjC,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;EACD,YAAY,CAAC,6BAA6B;CAC3C,CAAC;CACD,CAAC,kCAAkC;EAClC,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;EACD,YAAY,CAAC,6BAA6B;CAC3C,CAAC;CACD,CAAC,kCAAkC;EAClC,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;EACD,YAAY,CAAC,6BAA6B;CAC3C,CAAC;CACD,CAAC,kCAAkC;EAClC,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;EACD,YAAY,CAAC,6BAA6B;CAC3C,CAAC;CACD,CAAC,sCAAsC;EACtC,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;EACD,YAAY,CAAC,6BAA6B;CAC3C,CAAC;CACD,CAAC,0CAA0C;EAC1C,KAAK;EACL,MAAM;EACN,UAAU,CAAC;GACV,KAAK;GACL,MAAM;GACN,OAAO;EACR,CAAC;CACF,CAAC;AACF,CAAC;;AAED,MAAM,mBAAmB,CAAC,iBAAiB"}
@@ -192,7 +192,7 @@ interface SpaceApplyInput<TOp> {
192
192
  * documentation explaining why it is safe.
193
193
  *
194
194
  * Safety: the JSON files passed here are produced by the framework's own
195
- * emit pipeline (`prisma-next contract emit` and `MigrationCLI.run`)
195
+ * emit pipeline (`prisma contract emit` and `MigrationCLI.run`)
196
196
  * and re-validated downstream by the runner / verifier. The descriptor
197
197
  * is a pass-through wiring layer — no descriptor consumer treats the
198
198
  * narrowed types as a stronger guarantee than "these came from the
@@ -412,4 +412,4 @@ declare const RESERVED_SPACE_SUBDIR_NAMES: ReadonlySet<string>;
412
412
  declare function spaceRefsDirectory(spaceMigrationsDir: string): string;
413
413
  //#endregion
414
414
  export { spaceMigrationDirectory as C, readContractSpaceHeadRef as S, contractSpaceFromJson as _, DescriptorSelfConsistencyInputs as a, isValidSpaceId as b, RESERVED_SPACE_SUBDIR_NAMES as c, SpacePlanInput as d, SpacePlanOutput as f, computeExtensionSpaceApplyPath as g, assertValidSpaceId as h, ContractSpaceHeadRef$1 as i, SPACE_REFS_DIRNAME as l, assertDescriptorSelfConsistency as m, ComputeExtensionSpaceApplyPathInputs as n, DiskContractSpaceState as o, ValidSpaceId as p, ContractSpaceArtifactInputs as r, ExtensionSpaceApplyPathOutcome as s, APP_SPACE_ID$1 as t, SpaceApplyInput as u, emitContractSpaceArtifacts as v, spaceRefsDirectory as w, planAllSpaces as x, gatherDiskContractSpaceState as y };
415
- //# sourceMappingURL=spaces-Dj65JrwZ.d.mts.map
415
+ //# sourceMappingURL=spaces-B20bgxF9.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spaces-Dj65JrwZ.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/spaces.d.mts"],"mappings":";;;;;;;;;;;;;UAYU;WACC;WACA;WACA;;;;;;;;WAQA;WACA;WACA,sBAAsB;WACtB,cAAc;;;;;;;;;;;;;;;;;;;;;iBAqBR,gCAAgC,QAAQ;;;;;;;;;;;;;;;;iBAgBxC,yBAAyB,8BAA8B,kBAAkB,QAAQ;;;;;;;;;KAS7F;WACM;WACA,sBAAsB;;;;;;WAMtB;;;;;WAKA,SAAS;;;;;;WAMT;;WAEA;WACA,sBAAsB;;WAEtB;WACA,sBAAsB;WACtB;WACA;aACE;aACA;;;WAGF;;;;;;;;;;;;;UAaD;WACC;WACA;WACA;WACA;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBM,+BAA+B,QAAQ,uCAAuC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;UAuB7F,gBAAgB;WACf;WACA;WACA;WACA;WACA,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCT,sBAAsB,kBAAkB,WAAW,UAAU;WACnE;WACA,YAAY;aACV;aACA;aACA;;WAEF,SAAS;IAChB,cAAc;;;;;;;;;;;;;;;;;;;;;;;UAuBR;WACC;WACA;WACA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBH,2BAA2B,8BAA8B,iBAAiB,QAAQ,8BAA8B;;;;;;;;;UASvH;;WAEC;;WAEA,iBAAiB,oBAAoB;;;;;;;;;;;;;;;;;;;;iBAoB/B,6BAA6B;WACnC;;;;;;WAMA,gBAAgB;IACvB,QAAQ;;;;;;;;;;;;;;;;UAgBF,eAAe;WACd;WACA,eAAe;WACf,aAAa;;UAEd,gBAAgB;WACf;WACA,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BtB,cAAc,WAAW,UAAU,iBAAiB,eAAe,cAAc,YAAY,OAAO,eAAe,wBAAwB,sBAAsB,gBAAgB;;;;;;;;;;KAU7L;WACM;;iBAEM,eAAe,kBAAkB,WAAW;iBAC5C,mBAAmB,0BAA0B,WAAW;;;;;;;;;;;;;iBAaxD,wBAAwB,8BAA8B;;;;;;;;;cASzD;;;;;;;;cAQA,6BAA6B;;;;;;;iBAO1B,mBAAmB"}
1
+ {"version":3,"file":"spaces-B20bgxF9.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/spaces.d.mts"],"mappings":";;;;;;;;;;;;;UAYU;WACC;WACA;WACA;;;;;;;;WAQA;WACA;WACA,sBAAsB;WACtB,cAAc;;;;;;;;;;;;;;;;;;;;;iBAqBR,gCAAgC,QAAQ;;;;;;;;;;;;;;;;iBAgBxC,yBAAyB,8BA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stQHPh6.mjs";
2
- import { o as writeContractSnapshot } from "./contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs";
3
- import { s as readMigrationsDir } from "./io-635GlNx1-D3zrw2qu.mjs";
4
- import { l as reconstructGraph, o as findPathWithDecision } from "./migration-graph-_SJImD5V-BURyY1KM.mjs";
5
- import { c as spaceMigrationDirectory, i as assertValidSpaceId, l as spaceRefsDirectory, o as listContractSpaceDirectories, s as readContractSpaceHeadRef, t as APP_SPACE_ID } from "./verify-contract-spaces-DhJTb0zM-B62maCfE.mjs";
1
+ import { f as errorDuplicateSpaceId, l as errorDescriptorHeadHashMismatch } from "./errors-SoLLYLtw-DMxVbVs9.mjs";
2
+ import { o as writeContractSnapshot } from "./contract-snapshot-store-qGrwlGmt-Cf2NFzRL.mjs";
3
+ import { s as readMigrationsDir } from "./io-BmWQNxRP-DQqbcPsS.mjs";
4
+ import { l as reconstructGraph, o as findPathWithDecision } from "./migration-graph-CW4bMmTz-B5xFtFVB.mjs";
5
+ import { c as spaceMigrationDirectory, i as assertValidSpaceId, l as spaceRefsDirectory, o as listContractSpaceDirectories, s as readContractSpaceHeadRef, t as APP_SPACE_ID } from "./verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs";
6
6
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
7
7
  import { computeStorageHash } from "@prisma/orm-framework/contract/hashing";
8
8
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
@@ -123,7 +123,7 @@ async function computeExtensionSpaceApplyPath(inputs) {
123
123
  * documentation explaining why it is safe.
124
124
  *
125
125
  * Safety: the JSON files passed here are produced by the framework's own
126
- * emit pipeline (`prisma-next contract emit` and `MigrationCLI.run`)
126
+ * emit pipeline (`prisma contract emit` and `MigrationCLI.run`)
127
127
  * and re-validated downstream by the runner / verifier. The descriptor
128
128
  * is a pass-through wiring layer — no descriptor consumer treats the
129
129
  * narrowed types as a stronger guarantee than "these came from the
@@ -264,4 +264,4 @@ function planAllSpaces(inputs, planSpace) {
264
264
  //#endregion
265
265
  export { gatherDiskContractSpaceState as a, emitContractSpaceArtifacts as i, computeExtensionSpaceApplyPath as n, planAllSpaces as o, contractSpaceFromJson as r, assertDescriptorSelfConsistency as t };
266
266
 
267
- //# sourceMappingURL=spaces-4qMOAYE9.mjs.map
267
+ //# sourceMappingURL=spaces-BCZiAZQn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spaces-BCZiAZQn.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/spaces.mjs"],"sourcesContent":["import { f as errorDuplicateSpaceId, l as errorDescriptorHeadHashMismatch } from \"../errors-SoLLYLtw.mjs\";\nimport { o as writeContractSnapshot } from \"../contract-snapshot-store-qGrwlGmt.mjs\";\nimport { s as readMigrationsDir } from \"../io-BmWQNxRP.mjs\";\nimport \"../constants-CM-w38DQ.mjs\";\nimport { l as reconstructGraph, o as findPathWithDecision } from \"../migration-graph-CW4bMmTz.mjs\";\nimport { a as RESERVED_SPACE_SUBDIR_NAMES, c as isValidSpaceId, i as APP_SPACE_ID, l as spaceMigrationDirectory, n as verifyContractSpaces, o as SPACE_REFS_DIRNAME, r as readContractSpaceHeadRef, s as assertValidSpaceId, t as listContractSpaceDirectories, u as spaceRefsDirectory } from \"../verify-contract-spaces-CrxvgpwD.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { join } from \"pathe\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { computeStorageHash } from \"@internal/contract/hashing\";\n//#region src/assert-descriptor-self-consistency.ts\n/**\n* Assert that an extension descriptor is self-consistent: the\n* `headRef.hash` it publishes must match the canonical hash recomputed\n* from its `contractSpace.contractJson`.\n*\n* Recomputes via {@link computeStorageHash} — the same canonical-JSON\n* pipeline the descriptor's own emit pipeline produced the hash with —\n* over `(target, targetFamily, storage)`. Mismatch indicates the\n* extension author bumped `contractJson` without rerunning emit, leaving\n* the descriptor's `headRef.hash` stale; the consumer-side helpers\n* (drift detection, on-disk artefact emission, runner marker writes) all\n* trust `headRef.hash` as the canonical identity, so a stale value would\n* silently corrupt every downstream boundary.\n*\n* Synchronous, pure, no I/O. Throws\n* `MIGRATION.DESCRIPTOR_HEAD_HASH_MISMATCH` on failure with both the\n* recomputed and published hashes in `meta` so callers can surface a\n* clear remediation hint without re-deriving them.\n*/\nfunction assertDescriptorSelfConsistency(inputs) {\n\tconst { storageHash: _stripped, ...storageWithoutHash } = inputs.storage;\n\tconst recomputed = computeStorageHash({\n\t\ttarget: inputs.target,\n\t\ttargetFamily: inputs.targetFamily,\n\t\tstorage: storageWithoutHash,\n\t\t...ifDefined(\"shouldPreserveEmpty\", inputs.shouldPreserveEmpty),\n\t\t...ifDefined(\"sortStorage\", inputs.sortStorage)\n\t});\n\tif (recomputed !== inputs.headRefHash) throw errorDescriptorHeadHashMismatch({\n\t\textensionId: inputs.extensionId,\n\t\trecomputedHash: recomputed,\n\t\theadRefHash: inputs.headRefHash\n\t});\n}\n//#endregion\n//#region src/compute-extension-space-apply-path.ts\n/**\n* Compute the apply path for an extension contract space — the shortest\n* sequence of on-disk migration packages that walks the live marker\n* forward to the on-disk head ref hash, covering every required\n* invariant.\n*\n* Reads only on-disk artifacts (`migrations/<spaceId>/refs/head.json`\n* and the per-space migration packages). **Does not import any\n* extension descriptor module** — `db init` / `db update` must remain\n* runnable without the descriptor source on disk.\n*\n* Behaviour:\n* - Returns `{ kind: 'ok', pathOps: [], … }` when the marker is already\n* at the recorded head and no required invariants are missing.\n* - Returns `{ kind: 'unreachable' }` when the marker hash is not\n* structurally connected to the recorded head in the graph.\n* - Returns `{ kind: 'unsatisfiable', missing, … }` when the marker is\n* reachable but no path covers the required invariants.\n* - Returns `{ kind: 'contractSpaceHeadRefMissing' }` when the per-space\n* `refs/head.json` is absent — the precheck verifier should already\n* have rejected this case, but the helper is defensive so callers can\n* surface a coherent error rather than throw.\n*/\nasync function computeExtensionSpaceApplyPath(inputs) {\n\tconst { projectMigrationsDir, spaceId, currentMarkerHash, currentMarkerInvariants } = inputs;\n\tconst contractSpaceHeadRef = await readContractSpaceHeadRef(projectMigrationsDir, spaceId);\n\tif (contractSpaceHeadRef === null) return { kind: \"contractSpaceHeadRefMissing\" };\n\tconst { packages } = await readMigrationsDir(spaceMigrationDirectory(projectMigrationsDir, spaceId), { migrationsDir: projectMigrationsDir });\n\tconst graph = reconstructGraph(packages);\n\tconst fromHash = currentMarkerHash ?? \"empty\";\n\tconst required = new Set(contractSpaceHeadRef.invariants.filter((id) => !currentMarkerInvariants.includes(id)));\n\tconst outcome = findPathWithDecision(graph, fromHash, contractSpaceHeadRef.hash, { required });\n\tif (outcome.kind === \"unreachable\") return {\n\t\tkind: \"unreachable\",\n\t\tcontractSpaceHeadRef\n\t};\n\tif (outcome.kind === \"unsatisfiable\") return {\n\t\tkind: \"unsatisfiable\",\n\t\tcontractSpaceHeadRef,\n\t\tmissing: outcome.missing,\n\t\tstructuralPath: outcome.structuralPath.map(({ dirName, to }) => ({\n\t\t\tdirName,\n\t\t\tto\n\t\t}))\n\t};\n\tconst packagesByHash = new Map(packages.map((pkg) => [pkg.metadata.migrationHash, pkg]));\n\tconst pathOps = [];\n\tconst walkedMigrationDirs = [];\n\tconst providedInvariantsSet = /* @__PURE__ */ new Set();\n\tfor (const edge of outcome.decision.selectedPath) {\n\t\tconst pkg = packagesByHash.get(edge.migrationHash);\n\t\tif (!pkg) throw new InternalError(`Migration package missing for edge ${edge.migrationHash} in space \"${spaceId}\"`);\n\t\twalkedMigrationDirs.push(pkg.dirName);\n\t\tfor (const op of pkg.ops) pathOps.push(op);\n\t\tfor (const invariant of pkg.metadata.providedInvariants) providedInvariantsSet.add(invariant);\n\t}\n\treturn {\n\t\tkind: \"ok\",\n\t\tcontractSpaceHeadRef,\n\t\tprovidedInvariants: [...providedInvariantsSet].sort(),\n\t\tpathOps,\n\t\twalkedMigrationDirs\n\t};\n}\n//#endregion\n//#region src/contract-space-from-json.ts\n/**\n* Materialise a typed {@link ContractSpace} from the JSON artefacts a\n* contract-space extension package emits to disk.\n*\n* Extension descriptors wire `contract.json`, per-migration\n* `migration.json` / `ops.json`, and `refs/head.json` to the framework's\n* typed surfaces. TypeScript widens JSON imports to a structural record\n* that does not preserve readonly modifiers or branded scalars (e.g.\n* `StorageHashBase<'abc123...'>`), so authoring the descriptor inline\n* forces every wiring site to cast through `unknown`. This helper\n* encapsulates the single narrowing point: descriptor sources stay\n* cast-free, and the (necessary) coercion is colocated with the\n* documentation explaining why it is safe.\n*\n* Safety: the JSON files passed here are produced by the framework's own\n* emit pipeline (`prisma contract emit` and `MigrationCLI.run`)\n* and re-validated downstream by the runner / verifier. The descriptor\n* is a pass-through wiring layer — no descriptor consumer treats the\n* narrowed types as a stronger guarantee than \"these came from the\n* canonical emit pipeline\".\n*\n* The helper does not introspect or schema-validate the inputs; runtime\n* validation is the responsibility of `family.deserializeContract`\n* (codec-aware, invoked at control-stack construction) and the\n* per-migration `readMigrationPackage` reader used when loading\n* from disk. JSON-imported packages flow through the descriptor without\n* a disk read, so the equivalent runtime guarantee comes from the emit\n* pipeline that produced the JSON in the first place.\n*/\nfunction contractSpaceFromJson(inputs) {\n\tconst migrations = inputs.migrations.map((m) => ({\n\t\tdirName: m.dirName,\n\t\tmetadata: m.metadata,\n\t\tops: m.ops\n\t}));\n\treturn {\n\t\tcontractJson: inputs.contractJson,\n\t\tmigrations,\n\t\theadRef: inputs.headRef\n\t};\n}\n//#endregion\n//#region src/emit-contract-space-artifacts.ts\n/**\n* Emit the per-space artifacts — the head contract snapshot (written into\n* the migrations-root-wide `snapshots/` store, keyed by `headRef.hash`) and\n* `refs/head.json` — under `<projectMigrationsDir>/<spaceId>/`.\n*\n* The head contract snapshot is write-if-absent (see\n* {@link writeContractSnapshot}): a changed extension contract has a new\n* hash, so it lands as a new store entry; an unchanged hash means identical\n* canonical content already sits there. `refs/head.json` stays\n* always-overwrite: the framework owns it, so running `migrate` twice with\n* the same inputs is a no-op observably (idempotent), but the helper does\n* not check pre-existing contents — re-emit always wins.\n*\n* Path layout matches the convention in\n* [`spaceMigrationDirectory`](./space-layout.ts). The space id is\n* validated against `[a-z][a-z0-9_-]{0,63}` via\n* {@link assertValidSpaceId} for filesystem-safety reasons; the helper\n* accepts every space uniformly (including the app space, default\n* `'app'`).\n*\n* The migrations directory and space subdirectory are created if they\n* do not yet exist (`mkdir { recursive: true }`).\n*/\nasync function emitContractSpaceArtifacts(projectMigrationsDir, spaceId, inputs) {\n\tassertValidSpaceId(spaceId);\n\tconst refsDir = spaceRefsDirectory(join(projectMigrationsDir, spaceId));\n\tawait mkdir(refsDir, { recursive: true });\n\tawait writeContractSnapshot(projectMigrationsDir, inputs.headRef.hash, {\n\t\tcontractJson: inputs.contract,\n\t\tcontractDts: inputs.contractDts\n\t});\n\tconst sortedInvariants = [...inputs.headRef.invariants].sort();\n\tconst headJson = canonicalizeJson({\n\t\thash: inputs.headRef.hash,\n\t\tinvariants: sortedInvariants\n\t});\n\tawait writeFile(join(refsDir, \"head.json\"), `${headJson}\\n`);\n}\n//#endregion\n//#region src/gather-disk-contract-space-state.ts\n/**\n* Read the on-disk state the per-space verifier needs:\n*\n* - The list of contract-space directories under\n* `<projectMigrationsDir>/` (via\n* {@link import('./verify-contract-spaces').listContractSpaceDirectories}).\n* - The on-disk head ref `(hash, invariants)` for each declared extension space\n* (via {@link readContractSpaceHeadRef}; missing on-disk artefacts are simply\n* omitted — the verifier reports them as `declaredButUnmigrated`).\n*\n* Synchronous in spirit but async due to filesystem reads. Reads only\n* the user's repo. **Does not import any extension descriptor module.**\n*\n* Composition convention: pure target-agnostic primitive in\n* `1-framework`; the SQL family (and any future target family) wires\n* it into its `dbInit` / `verify` flows alongside its own marker-row\n* read before invoking `verifyContractSpaces`.\n*/\nasync function gatherDiskContractSpaceState(args) {\n\tconst { projectMigrationsDir, loadedSpaceIds } = args;\n\tconst spaceDirsOnDisk = await listContractSpaceDirectories(projectMigrationsDir);\n\tconst headRefsBySpace = /* @__PURE__ */ new Map();\n\tfor (const spaceId of loadedSpaceIds) {\n\t\tif (spaceId === APP_SPACE_ID) continue;\n\t\tconst head = await readContractSpaceHeadRef(projectMigrationsDir, spaceId);\n\t\tif (head !== null) headRefsBySpace.set(spaceId, head);\n\t}\n\treturn {\n\t\tspaceDirsOnDisk,\n\t\theadRefsBySpace\n\t};\n}\n//#endregion\n//#region src/plan-all-spaces.ts\n/**\n* Iterate the per-space planner across a set of loaded contract spaces\n* and return a deterministic shape regardless of declaration order.\n*\n* Behaviour:\n*\n* - The output is sorted alphabetically by `spaceId`. Two callers\n* passing the same set of inputs in different orders observe\n* byte-identical outputs.\n* - The per-space planner (`planSpace`) is called exactly once per\n* input, in alphabetical-by-spaceId order. Its return value is\n* attached to the corresponding output entry verbatim.\n* - Duplicate `spaceId`s in the input array throw\n* `MIGRATION.DUPLICATE_SPACE_ID` before any `planSpace` call runs,\n* keeping the planner pure when the input is malformed.\n*\n* The signature is generic over `TContract` and `TPackage` because the\n* shape is framework-neutral (SQL family today, Mongo family\n* eventually). Callers wire in whatever contract value and migration\n* package shape their family already speaks.\n*\n* Synchronous: the underlying per-space planner (target's\n* `MigrationPlanner.plan(...)`) is synchronous; callers that need to\n* resolve async I/O (e.g. reading on-disk `contract.json` from disk)\n* resolve it before calling `planAllSpaces` and pass the materialised\n* inputs through.\n*/\nfunction planAllSpaces(inputs, planSpace) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const input of inputs) {\n\t\tif (seen.has(input.spaceId)) throw errorDuplicateSpaceId(input.spaceId);\n\t\tseen.add(input.spaceId);\n\t}\n\treturn [...inputs].sort((a, b) => {\n\t\tif (a.spaceId < b.spaceId) return -1;\n\t\tif (a.spaceId > b.spaceId) return 1;\n\t\treturn 0;\n\t}).map((input) => ({\n\t\tspaceId: input.spaceId,\n\t\tmigrationPackages: planSpace(input)\n\t}));\n}\n//#endregion\nexport { APP_SPACE_ID, RESERVED_SPACE_SUBDIR_NAMES, SPACE_REFS_DIRNAME, assertDescriptorSelfConsistency, assertValidSpaceId, computeExtensionSpaceApplyPath, contractSpaceFromJson, emitContractSpaceArtifacts, gatherDiskContractSpaceState, isValidSpaceId, listContractSpaceDirectories, planAllSpaces, readContractSpaceHeadRef, spaceMigrationDirectory, spaceRefsDirectory, verifyContractSpaces };\n\n//# sourceMappingURL=spaces.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,gCAAgC,QAAQ;CAChD,MAAM,EAAE,aAAa,WAAW,GAAG,uBAAuB,OAAO;CACjE,MAAM,aAAa,mBAAmB;EACrC,QAAQ,OAAO;EACf,cAAc,OAAO;EACrB,SAAS;EACT,GAAG,UAAU,uBAAuB,OAAO,mBAAmB;EAC9D,GAAG,UAAU,eAAe,OAAO,WAAW;CAC/C,CAAC;CACD,IAAI,eAAe,OAAO,aAAa,MAAM,gCAAgC;EAC5E,aAAa,OAAO;EACpB,gBAAgB;EAChB,aAAa,OAAO;CACrB,CAAC;AACF;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,eAAe,+BAA+B,QAAQ;CACrD,MAAM,EAAE,sBAAsB,SAAS,mBAAmB,4BAA4B;CACtF,MAAM,uBAAuB,MAAM,yBAAyB,sBAAsB,OAAO;CACzF,IAAI,yBAAyB,MAAM,OAAO,EAAE,MAAM,8BAA8B;CAChF,MAAM,EAAE,aAAa,MAAM,kBAAkB,wBAAwB,sBAAsB,OAAO,GAAG,EAAE,eAAe,qBAAqB,CAAC;CAC5I,MAAM,QAAQ,iBAAiB,QAAQ;CACvC,MAAM,WAAW,qBAAqB;CACtC,MAAM,WAAW,IAAI,IAAI,qBAAqB,WAAW,QAAQ,OAAO,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;CAC9G,MAAM,UAAU,qBAAqB,OAAO,UAAU,qBAAqB,MAAM,EAAE,SAAS,CAAC;CAC7F,IAAI,QAAQ,SAAS,eAAe,OAAO;EAC1C,MAA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E } from "./io-635GlNx1-D3zrw2qu.mjs";
1
+ import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from "./errors-SoLLYLtw-DMxVbVs9.mjs";
2
+ import { t as MANIFEST_FILE } from "./io-BmWQNxRP-DQqbcPsS.mjs";
3
3
  import { APP_SPACE_ID as APP_SPACE_ID$1, CONTRACT_SNAPSHOTS_DIRNAME } from "@prisma/orm-framework/components/control";
4
4
  import { join } from "pathe";
5
5
  import { readFile, readdir, stat } from "node:fs/promises";
6
- //#region ../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-DhJTb0zM.mjs
6
+ //#region ../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-CrxvgpwD.mjs
7
7
  /**
8
8
  * Pattern a contract-space identifier must match. The constraint is
9
9
  * filesystem-friendly: lowercase letters / digits / hyphen / underscore,
@@ -188,7 +188,7 @@ function verifyContractSpaces(inputs) {
188
188
  violations.push({
189
189
  kind: "declaredButUnmigrated",
190
190
  spaceId,
191
- remediation: `Extension '${spaceId}' is declared in extensions but has not been emitted; run \`prisma-next migrate\`.`
191
+ remediation: `Extension '${spaceId}' is declared in extensions but has not been emitted; run \`{bin} db migrate\`.`
192
192
  });
193
193
  continue;
194
194
  }
@@ -201,7 +201,7 @@ function verifyContractSpaces(inputs) {
201
201
  spaceId,
202
202
  priorHeadHash: head.hash,
203
203
  markerHash: marker.hash,
204
- remediation: `Marker row for space '${spaceId}' is keyed at ${marker.hash}, but the on-disk ${join("migrations", spaceId, "contract.json")} resolves to ${head.hash}. Run \`prisma-next db update\` to advance the database, or \`prisma-next migrate\` if the descriptor was bumped without re-emitting.`
204
+ remediation: `Marker row for space '${spaceId}' is keyed at ${marker.hash}, but the on-disk ${join("migrations", spaceId, "contract.json")} resolves to ${head.hash}. Run \`{bin} db update\` to advance the database, or \`{bin} db migrate\` if the descriptor was bumped without re-emitting.`
205
205
  });
206
206
  continue;
207
207
  }
@@ -213,7 +213,7 @@ function verifyContractSpaces(inputs) {
213
213
  spaceId,
214
214
  onDiskInvariants,
215
215
  markerInvariants: [...marker.invariants].sort(),
216
- remediation: `Marker row for space '${spaceId}' is missing invariants [${missing.map((s) => JSON.stringify(s)).join(", ")}]. Run \`prisma-next db update\` to apply the corresponding data-transform migrations.`
216
+ remediation: `Marker row for space '${spaceId}' is missing invariants [${missing.map((s) => JSON.stringify(s)).join(", ")}]. Run \`{bin} db update\` to apply the corresponding data-transform migrations.`
217
217
  });
218
218
  }
219
219
  for (const dir of [...inputs.spaceDirsOnDisk].sort()) if (!inputs.loadedSpaces.has(dir)) violations.push({
@@ -249,4 +249,4 @@ function verifyContractSpaces(inputs) {
249
249
  //#endregion
250
250
  export { isValidSpaceId as a, spaceMigrationDirectory as c, assertValidSpaceId as i, spaceRefsDirectory as l, RESERVED_SPACE_SUBDIR_NAMES as n, listContractSpaceDirectories as o, SPACE_REFS_DIRNAME as r, readContractSpaceHeadRef as s, APP_SPACE_ID$1 as t, verifyContractSpaces as u };
251
251
 
252
- //# sourceMappingURL=verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map
252
+ //# sourceMappingURL=verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify-contract-spaces-DhJTb0zM-B62maCfE.mjs","names":["APP_SPACE_ID"],"sources":["../../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-DhJTb0zM.mjs"],"sourcesContent":["import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from \"./errors-CXbGUWGu.mjs\";\nimport { t as MANIFEST_FILE } from \"./io-635GlNx1.mjs\";\nimport { join } from \"pathe\";\nimport { readFile, readdir, stat } from \"node:fs/promises\";\nimport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME } from \"@internal/framework-components/control\";\n//#region src/space-layout.ts\n/**\n* Pattern a contract-space identifier must match. The constraint is\n* filesystem-friendly: lowercase letters / digits / hyphen / underscore,\n* starts with a letter, max 64 characters.\n*/\nconst SPACE_ID_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;\nfunction isValidSpaceId(spaceId) {\n\treturn SPACE_ID_PATTERN.test(spaceId);\n}\nfunction assertValidSpaceId(spaceId) {\n\tif (!isValidSpaceId(spaceId)) throw errorInvalidSpaceId(spaceId);\n}\n/**\n* Resolve the migrations subdirectory for a given contract space.\n*\n* Every contract space — including the app space (default `'app'`) —\n* lands under `<projectMigrationsDir>/<spaceId>/`. The space id is\n* validated against {@link SPACE_ID_PATTERN} because it becomes a\n* filesystem directory name verbatim.\n*\n* `projectMigrationsDir` is the project's top-level `migrations/`\n* directory; the helper does not assume anything about its absolute /\n* relative shape and is symmetric with `pathe.join`.\n*/\nfunction spaceMigrationDirectory(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\treturn join(projectMigrationsDir, spaceId);\n}\n/**\n* Per-space subdirectory name reserved for the ref store\n* (`migrations/<space>/<SPACE_REFS_DIRNAME>/*.json`). Single source of\n* truth: every helper that composes a per-space refs path imports this\n* constant, and the enumerator uses it (via\n* {@link RESERVED_SPACE_SUBDIR_NAMES}) to exclude reserved names from\n* the contract-space candidate list.\n*/\nconst SPACE_REFS_DIRNAME = \"refs\";\n/**\n* Names reserved under `migrations/` that must never be enumerated as a\n* phantom contract space: `SPACE_REFS_DIRNAME` (e.g. a top-level\n* `migrations/refs/` left in the wrong place) and\n* `CONTRACT_SNAPSHOTS_DIRNAME` (the migrations-root-wide contract\n* snapshot store, `migrations/snapshots/`).\n*/\nconst RESERVED_SPACE_SUBDIR_NAMES = /* @__PURE__ */ new Set([SPACE_REFS_DIRNAME, CONTRACT_SNAPSHOTS_DIRNAME]);\n/**\n* Resolve the per-space refs directory for `spaceMigrationsDir`\n* (typically the value returned by {@link spaceMigrationDirectory}).\n* Composes the canonical {@link SPACE_REFS_DIRNAME} so callers do not\n* hard-code the literal.\n*/\nfunction spaceRefsDirectory(spaceMigrationsDir) {\n\treturn join(spaceMigrationsDir, SPACE_REFS_DIRNAME);\n}\n//#endregion\n//#region src/read-contract-space-head-ref.ts\nfunction hasErrnoCode$1(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* Read the head ref (`hash` + `invariants`) for a contract space from\n* `<projectMigrationsDir>/<spaceId>/refs/head.json`.\n*\n* Returns `null` when the file does not exist (first emit). Surfaces\n* `MIGRATION.INVALID_JSON` / `MIGRATION.INVALID_REF_FILE` on a corrupt\n* `refs/head.json` so callers can distinguish \"no head ref on disk\"\n* (returns `null`) from \"head ref present but unreadable\" (throws).\n*\n* Validates the space id against `[a-z][a-z0-9_-]{0,63}` for the same\n* filesystem-safety reasons as the rest of the per-space helpers. The\n* helper is uniform across the app and extension spaces.\n*/\nasync function readContractSpaceHeadRef(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\tconst filePath = join(spaceRefsDirectory(spaceMigrationDirectory(projectMigrationsDir, spaceId)), \"head.json\");\n\tlet raw;\n\ttry {\n\t\traw = await readFile(filePath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode$1(error, \"ENOENT\")) return null;\n\t\tthrow error;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(filePath, e instanceof Error ? e.message : String(e));\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null) throw errorInvalidRefFile(filePath, \"expected an object\");\n\tconst obj = parsed;\n\tif (typeof obj.hash !== \"string\") throw errorInvalidRefFile(filePath, \"expected an object with a string `hash` field\");\n\tif (!Array.isArray(obj.invariants) || obj.invariants.some((value) => typeof value !== \"string\")) throw errorInvalidRefFile(filePath, \"expected an object with an `invariants` array of strings\");\n\treturn {\n\t\thash: obj.hash,\n\t\tinvariants: obj.invariants\n\t};\n}\n//#endregion\n//#region src/verify-contract-spaces.ts\nfunction hasErrnoCode(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* List the per-space subdirectories under\n* `<projectRoot>/migrations/`. Returns space-id directory names (sorted\n* alphabetically) — i.e. any non-dot-prefixed, non-reserved\n* ({@link RESERVED_SPACE_SUBDIR_NAMES}) subdirectory whose root does\n* **not** contain a `migration.json` manifest. The manifest is the\n* structural marker of a user-authored migration directory (see\n* `readMigrationsDir` in `./io`); directory names themselves belong to\n* the user and are not part of the contract. The reserved-name filter\n* keeps `migrations/snapshots/` (the contract snapshot store) from ever\n* being enumerated as a phantom contract space.\n*\n* Returns `[]` if the migrations directory does not exist (greenfield\n* project).\n*\n* Reads only the user's repo. **No descriptor import.** The caller\n* (verifier) feeds the result into {@link verifyContractSpaces} alongside\n* the loaded-space set and the marker rows.\n*/\nasync function listContractSpaceDirectories(projectMigrationsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = (await readdir(projectMigrationsDir, { withFileTypes: true })).map((d) => ({\n\t\t\tname: d.name,\n\t\t\tisDirectory: d.isDirectory()\n\t\t}));\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return [];\n\t\tthrow error;\n\t}\n\tconst namedCandidates = entries.filter((e) => e.isDirectory).map((e) => e.name).filter((name) => !name.startsWith(\".\")).filter((name) => !RESERVED_SPACE_SUBDIR_NAMES.has(name)).sort();\n\treturn (await Promise.all(namedCandidates.map(async (name) => {\n\t\ttry {\n\t\t\tawait stat(join(projectMigrationsDir, name, MANIFEST_FILE));\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: true\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (hasErrnoCode(error, \"ENOENT\")) return {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: false\n\t\t\t};\n\t\t\tthrow error;\n\t\t}\n\t}))).filter((c) => !c.isMigrationDir).map((c) => c.name);\n}\n/**\n* Pure structural verifier for the per-space mechanism. Aggregates the\n* three orphan / missing checks plus per-space hash and invariant\n* comparison.\n*\n* Algorithm:\n*\n* - For every extension space declared in `loadedSpaces` (`'app'`\n* excluded — the per-space verifier is scoped to extension spaces;\n* the app is verified through the aggregate path):\n* - If no contract-space dir on disk → `declaredButUnmigrated`.\n* - Else if `markerRowsBySpace` lacks an entry → no violation here;\n* the live-DB compare done outside this helper is where the\n* absence shows up.\n* - Else compare marker hash / invariants vs. on-disk head hash /\n* invariants → `hashMismatch` / `invariantsMismatch` on drift.\n* - For every contract-space dir on disk that is not in `loadedSpaces` →\n* `orphanSpaceDir`.\n* - For every marker row whose `space` is not in `loadedSpaces` →\n* `orphanMarker`. The app-space marker is always loaded (`'app'` is\n* in `loadedSpaces` by definition).\n*\n* Output is deterministic: violations are sorted first by `kind`\n* (`declaredButUnmigrated` → `orphanMarker` → `orphanSpaceDir` →\n* `hashMismatch` → `invariantsMismatch`) then by `spaceId`. Two callers\n* passing equivalent inputs see byte-identical violation lists.\n*\n* Synchronous, pure, no I/O. **Does not import the extension descriptor**\n* (the inputs are pre-resolved by the caller); the verifier reads only\n* the user repo, not `node_modules`.\n*/\nfunction verifyContractSpaces(inputs) {\n\tconst violations = [];\n\tfor (const spaceId of [...inputs.loadedSpaces].sort()) {\n\t\tif (spaceId === APP_SPACE_ID) continue;\n\t\tif (!inputs.spaceDirsOnDisk.includes(spaceId)) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"declaredButUnmigrated\",\n\t\t\t\tspaceId,\n\t\t\t\tremediation: `Extension '${spaceId}' is declared in extensions but has not been emitted; run \\`prisma-next migrate\\`.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst head = inputs.headRefsBySpace.get(spaceId);\n\t\tconst marker = inputs.markerRowsBySpace.get(spaceId);\n\t\tif (!head || !marker) continue;\n\t\tif (head.hash !== marker.hash) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\tspaceId,\n\t\t\t\tpriorHeadHash: head.hash,\n\t\t\t\tmarkerHash: marker.hash,\n\t\t\t\tremediation: `Marker row for space '${spaceId}' is keyed at ${marker.hash}, but the on-disk ${join(\"migrations\", spaceId, \"contract.json\")} resolves to ${head.hash}. Run \\`prisma-next db update\\` to advance the database, or \\`prisma-next migrate\\` if the descriptor was bumped without re-emitting.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst onDiskInvariants = [...head.invariants].sort();\n\t\tconst markerInvariants = new Set(marker.invariants);\n\t\tconst missing = onDiskInvariants.filter((id) => !markerInvariants.has(id));\n\t\tif (missing.length > 0) violations.push({\n\t\t\tkind: \"invariantsMismatch\",\n\t\t\tspaceId,\n\t\t\tonDiskInvariants,\n\t\t\tmarkerInvariants: [...marker.invariants].sort(),\n\t\t\tremediation: `Marker row for space '${spaceId}' is missing invariants [${missing.map((s) => JSON.stringify(s)).join(\", \")}]. Run \\`prisma-next db update\\` to apply the corresponding data-transform migrations.`\n\t\t});\n\t}\n\tfor (const dir of [...inputs.spaceDirsOnDisk].sort()) if (!inputs.loadedSpaces.has(dir)) violations.push({\n\t\tkind: \"orphanSpaceDir\",\n\t\tspaceId: dir,\n\t\tremediation: `Orphan contract-space directory \\`${join(\"migrations\", dir)}/\\` for an extension not in extensions; remove the directory or re-add the extension.`\n\t});\n\tfor (const space of [...inputs.markerRowsBySpace.keys()].sort()) if (!inputs.loadedSpaces.has(space)) violations.push({\n\t\tkind: \"orphanMarker\",\n\t\tspaceId: space,\n\t\tremediation: `Orphan marker row for space '${space}' (no longer in extensions); remediation: manually delete the row from \\`prisma_contract.marker\\`.`\n\t});\n\tif (violations.length === 0) return { ok: true };\n\tconst kindOrder = {\n\t\tdeclaredButUnmigrated: 0,\n\t\torphanMarker: 1,\n\t\torphanSpaceDir: 2,\n\t\thashMismatch: 3,\n\t\tinvariantsMismatch: 4\n\t};\n\tviolations.sort((a, b) => {\n\t\tconst k = kindOrder[a.kind] - kindOrder[b.kind];\n\t\tif (k !== 0) return k;\n\t\tif (a.spaceId < b.spaceId) return -1;\n\t\tif (a.spaceId > b.spaceId) return 1;\n\t\treturn 0;\n\t});\n\treturn {\n\t\tok: false,\n\t\tviolations\n\t};\n}\n//#endregion\nexport { RESERVED_SPACE_SUBDIR_NAMES as a, isValidSpaceId as c, APP_SPACE_ID as i, spaceMigrationDirectory as l, verifyContractSpaces as n, SPACE_REFS_DIRNAME as o, readContractSpaceHeadRef as r, assertValidSpaceId as s, listContractSpaceDirectories as t, spaceRefsDirectory as u };\n\n//# sourceMappingURL=verify-contract-spaces-DhJTb0zM.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,mBAAmB;AACzB,SAAS,eAAe,SAAS;CAChC,OAAO,iBAAiB,KAAK,OAAO;AACrC;AACA,SAAS,mBAAmB,SAAS;CACpC,IAAI,CAAC,eAAe,OAAO,GAAG,MAAM,oBAAoB,OAAO;AAChE;;;;;;;;;;;;;AAaA,SAAS,wBAAwB,sBAAsB,SAAS;CAC/D,mBAAmB,OAAO;CAC1B,OAAO,KAAK,sBAAsB,OAAO;AAC1C;;;;;;;;;AASA,MAAM,qBAAqB;;;;;;;;AAQ3B,MAAM,8CAA8C,IAAI,IAAI,CAAC,oBAAoB,0BAA0B,CAAC;;;;;;;AAO5G,SAAS,mBAAmB,oBAAoB;CAC/C,OAAO,KAAK,oBAAoB,kBAAkB;AACnD;AAGA,SAAS,eAAe,OAAO,MAAM;CACpC,OAAO,iBAAiB,SAAS,MAAM,SAAS;AACjD;;;;;;;;;;;;;;AAcA,eAAe,yBAAyB,sBAAsB,SAAS;CACtE,mBAAmB,OAAO;CAC1B,MAAM,WAAW,KAAK,mBAAmB,wBAAwB,sBAAsB,OAAO,CAAC,GAAG,WAAW;CAC7G,IAAI;CACJ,IAAI;EACH,MAAM,MAAM,SAAS,UAAU,OAAO;CACvC,SAAS,OAAO;EACf,IAAI,eAAe,OAAO,QAAQ,GAAG,OAAO;EAC5C,MAAM;CACP;CACA,IAAI;CACJ,IAAI;EACH,SAAS,KAAK,MAAM,GAAG;CACxB,SAAS,GAAG;EACX,MAAM,iBAAiB,UAAU,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,CAAC;CAC5E;CACA,IAAI,OAAO,WAAW,YAAY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IAAI,GAAG,GAAG,WAAW,KAAK;EACxG,MAAM;EACN,SAAS;EACT,aAAa,qCAAqC,KAAK,cAAc,GAAG,EAAE;CAC3E,CAAC;CACD,KAAK,MAAM,SAAS,CAAC,GAAG,OAAO,kBAAkB,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,aAAa,IAAI,KAAK,GAAG,WAAW,KAAK;EACrH,MAAM;EACN,SAAS;EACT,aAAa,gCAAgC,MAAM;CACpD,CAAC;CACD,IAAI,WAAW,WAAW,GAAG,OAAO,EAAE,IAAI,KAAK;CAC/C,MAAM,YAAY;EACjB,uBAAuB;EACvB,cAAc;EACd,gBAAgB;EAChB,cAAc;EACd,oBAAoB;CACrB;CACA,WAAW,MAAM,GAAG,MAAM;EACzB,MAAM,IAAI,UAAU,EAAE,QAAQ,UAAU,EAAE;EAC1C,IAAI,MAAM,GAAG,OAAO;EACpB,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,OAAO;CACR,CAAC;CACD,OAAO;EACN,IAAI;EACJ;CACD;AACD"}
1
+ {"version":3,"file":"verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs","names":["APP_SPACE_ID"],"sources":["../../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-CrxvgpwD.mjs"],"sourcesContent":["import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from \"./errors-SoLLYLtw.mjs\";\nimport { t as MANIFEST_FILE } from \"./io-BmWQNxRP.mjs\";\nimport { join } from \"pathe\";\nimport { readFile, readdir, stat } from \"node:fs/promises\";\nimport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME } from \"@internal/framework-components/control\";\n//#region src/space-layout.ts\n/**\n* Pattern a contract-space identifier must match. The constraint is\n* filesystem-friendly: lowercase letters / digits / hyphen / underscore,\n* starts with a letter, max 64 characters.\n*/\nconst SPACE_ID_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;\nfunction isValidSpaceId(spaceId) {\n\treturn SPACE_ID_PATTERN.test(spaceId);\n}\nfunction assertValidSpaceId(spaceId) {\n\tif (!isValidSpaceId(spaceId)) throw errorInvalidSpaceId(spaceId);\n}\n/**\n* Resolve the migrations subdirectory for a given contract space.\n*\n* Every contract space — including the app space (default `'app'`) —\n* lands under `<projectMigrationsDir>/<spaceId>/`. The space id is\n* validated against {@link SPACE_ID_PATTERN} because it becomes a\n* filesystem directory name verbatim.\n*\n* `projectMigrationsDir` is the project's top-level `migrations/`\n* directory; the helper does not assume anything about its absolute /\n* relative shape and is symmetric with `pathe.join`.\n*/\nfunction spaceMigrationDirectory(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\treturn join(projectMigrationsDir, spaceId);\n}\n/**\n* Per-space subdirectory name reserved for the ref store\n* (`migrations/<space>/<SPACE_REFS_DIRNAME>/*.json`). Single source of\n* truth: every helper that composes a per-space refs path imports this\n* constant, and the enumerator uses it (via\n* {@link RESERVED_SPACE_SUBDIR_NAMES}) to exclude reserved names from\n* the contract-space candidate list.\n*/\nconst SPACE_REFS_DIRNAME = \"refs\";\n/**\n* Names reserved under `migrations/` that must never be enumerated as a\n* phantom contract space: `SPACE_REFS_DIRNAME` (e.g. a top-level\n* `migrations/refs/` left in the wrong place) and\n* `CONTRACT_SNAPSHOTS_DIRNAME` (the migrations-root-wide contract\n* snapshot store, `migrations/snapshots/`).\n*/\nconst RESERVED_SPACE_SUBDIR_NAMES = /* @__PURE__ */ new Set([SPACE_REFS_DIRNAME, CONTRACT_SNAPSHOTS_DIRNAME]);\n/**\n* Resolve the per-space refs directory for `spaceMigrationsDir`\n* (typically the value returned by {@link spaceMigrationDirectory}).\n* Composes the canonical {@link SPACE_REFS_DIRNAME} so callers do not\n* hard-code the literal.\n*/\nfunction spaceRefsDirectory(spaceMigrationsDir) {\n\treturn join(spaceMigrationsDir, SPACE_REFS_DIRNAME);\n}\n//#endregion\n//#region src/read-contract-space-head-ref.ts\nfunction hasErrnoCode$1(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* Read the head ref (`hash` + `invariants`) for a contract space from\n* `<projectMigrationsDir>/<spaceId>/refs/head.json`.\n*\n* Returns `null` when the file does not exist (first emit). Surfaces\n* `MIGRATION.INVALID_JSON` / `MIGRATION.INVALID_REF_FILE` on a corrupt\n* `refs/head.json` so callers can distinguish \"no head ref on disk\"\n* (returns `null`) from \"head ref present but unreadable\" (throws).\n*\n* Validates the space id against `[a-z][a-z0-9_-]{0,63}` for the same\n* filesystem-safety reasons as the rest of the per-space helpers. The\n* helper is uniform across the app and extension spaces.\n*/\nasync function readContractSpaceHeadRef(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\tconst filePath = join(spaceRefsDirectory(spaceMigrationDirectory(projectMigrationsDir, spaceId)), \"head.json\");\n\tlet raw;\n\ttry {\n\t\traw = await readFile(filePath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode$1(error, \"ENOENT\")) return null;\n\t\tthrow error;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(filePath, e instanceof Error ? e.message : String(e));\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null) throw errorInvalidRefFile(filePath, \"expected an object\");\n\tconst obj = parsed;\n\tif (typeof obj.hash !== \"string\") throw errorInvalidRefFile(filePath, \"expected an object with a string `hash` field\");\n\tif (!Array.isArray(obj.invariants) || obj.invariants.some((value) => typeof value !== \"string\")) throw errorInvalidRefFile(filePath, \"expected an object with an `invariants` array of strings\");\n\treturn {\n\t\thash: obj.hash,\n\t\tinvariants: obj.invariants\n\t};\n}\n//#endregion\n//#region src/verify-contract-spaces.ts\nfunction hasErrnoCode(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* List the per-space subdirectories under\n* `<projectRoot>/migrations/`. Returns space-id directory names (sorted\n* alphabetically) — i.e. any non-dot-prefixed, non-reserved\n* ({@link RESERVED_SPACE_SUBDIR_NAMES}) subdirectory whose root does\n* **not** contain a `migration.json` manifest. The manifest is the\n* structural marker of a user-authored migration directory (see\n* `readMigrationsDir` in `./io`); directory names themselves belong to\n* the user and are not part of the contract. The reserved-name filter\n* keeps `migrations/snapshots/` (the contract snapshot store) from ever\n* being enumerated as a phantom contract space.\n*\n* Returns `[]` if the migrations directory does not exist (greenfield\n* project).\n*\n* Reads only the user's repo. **No descriptor import.** The caller\n* (verifier) feeds the result into {@link verifyContractSpaces} alongside\n* the loaded-space set and the marker rows.\n*/\nasync function listContractSpaceDirectories(projectMigrationsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = (await readdir(projectMigrationsDir, { withFileTypes: true })).map((d) => ({\n\t\t\tname: d.name,\n\t\t\tisDirectory: d.isDirectory()\n\t\t}));\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return [];\n\t\tthrow error;\n\t}\n\tconst namedCandidates = entries.filter((e) => e.isDirectory).map((e) => e.name).filter((name) => !name.startsWith(\".\")).filter((name) => !RESERVED_SPACE_SUBDIR_NAMES.has(name)).sort();\n\treturn (await Promise.all(namedCandidates.map(async (name) => {\n\t\ttry {\n\t\t\tawait stat(join(projectMigrationsDir, name, MANIFEST_FILE));\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: true\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (hasErrnoCode(error, \"ENOENT\")) return {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: false\n\t\t\t};\n\t\t\tthrow error;\n\t\t}\n\t}))).filter((c) => !c.isMigrationDir).map((c) => c.name);\n}\n/**\n* Pure structural verifier for the per-space mechanism. Aggregates the\n* three orphan / missing checks plus per-space hash and invariant\n* comparison.\n*\n* Algorithm:\n*\n* - For every extension space declared in `loadedSpaces` (`'app'`\n* excluded — the per-space verifier is scoped to extension spaces;\n* the app is verified through the aggregate path):\n* - If no contract-space dir on disk → `declaredButUnmigrated`.\n* - Else if `markerRowsBySpace` lacks an entry → no violation here;\n* the live-DB compare done outside this helper is where the\n* absence shows up.\n* - Else compare marker hash / invariants vs. on-disk head hash /\n* invariants → `hashMismatch` / `invariantsMismatch` on drift.\n* - For every contract-space dir on disk that is not in `loadedSpaces` →\n* `orphanSpaceDir`.\n* - For every marker row whose `space` is not in `loadedSpaces` →\n* `orphanMarker`. The app-space marker is always loaded (`'app'` is\n* in `loadedSpaces` by definition).\n*\n* Output is deterministic: violations are sorted first by `kind`\n* (`declaredButUnmigrated` → `orphanMarker` → `orphanSpaceDir` →\n* `hashMismatch` → `invariantsMismatch`) then by `spaceId`. Two callers\n* passing equivalent inputs see byte-identical violation lists.\n*\n* Synchronous, pure, no I/O. **Does not import the extension descriptor**\n* (the inputs are pre-resolved by the caller); the verifier reads only\n* the user repo, not `node_modules`.\n*/\nfunction verifyContractSpaces(inputs) {\n\tconst violations = [];\n\tfor (const spaceId of [...inputs.loadedSpaces].sort()) {\n\t\tif (spaceId === APP_SPACE_ID) continue;\n\t\tif (!inputs.spaceDirsOnDisk.includes(spaceId)) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"declaredButUnmigrated\",\n\t\t\t\tspaceId,\n\t\t\t\tremediation: `Extension '${spaceId}' is declared in extensions but has not been emitted; run \\`{bin} db migrate\\`.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst head = inputs.headRefsBySpace.get(spaceId);\n\t\tconst marker = inputs.markerRowsBySpace.get(spaceId);\n\t\tif (!head || !marker) continue;\n\t\tif (head.hash !== marker.hash) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\tspaceId,\n\t\t\t\tpriorHeadHash: head.hash,\n\t\t\t\tmarkerHash: marker.hash,\n\t\t\t\tremediation: `Marker row for space '${spaceId}' is keyed at ${marker.hash}, but the on-disk ${join(\"migrations\", spaceId, \"contract.json\")} resolves to ${head.hash}. Run \\`{bin} db update\\` to advance the database, or \\`{bin} db migrate\\` if the descriptor was bumped without re-emitting.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst onDiskInvariants = [...head.invariants].sort();\n\t\tconst markerInvariants = new Set(marker.invariants);\n\t\tconst missing = onDiskInvariants.filter((id) => !markerInvariants.has(id));\n\t\tif (missing.length > 0) violations.push({\n\t\t\tkind: \"invariantsMismatch\",\n\t\t\tspaceId,\n\t\t\tonDiskInvariants,\n\t\t\tmarkerInvariants: [...marker.invariants].sort(),\n\t\t\tremediation: `Marker row for space '${spaceId}' is missing invariants [${missing.map((s) => JSON.stringify(s)).join(\", \")}]. Run \\`{bin} db update\\` to apply the corresponding data-transform migrations.`\n\t\t});\n\t}\n\tfor (const dir of [...inputs.spaceDirsOnDisk].sort()) if (!inputs.loadedSpaces.has(dir)) violations.push({\n\t\tkind: \"orphanSpaceDir\",\n\t\tspaceId: dir,\n\t\tremediation: `Orphan contract-space directory \\`${join(\"migrations\", dir)}/\\` for an extension not in extensions; remove the directory or re-add the extension.`\n\t});\n\tfor (const space of [...inputs.markerRowsBySpace.keys()].sort()) if (!inputs.loadedSpaces.has(space)) violations.push({\n\t\tkind: \"orphanMarker\",\n\t\tspaceId: space,\n\t\tremediation: `Orphan marker row for space '${space}' (no longer in extensions); remediation: manually delete the row from \\`prisma_contract.marker\\`.`\n\t});\n\tif (violations.length === 0) return { ok: true };\n\tconst kindOrder = {\n\t\tdeclaredButUnmigrated: 0,\n\t\torphanMarker: 1,\n\t\torphanSpaceDir: 2,\n\t\thashMismatch: 3,\n\t\tinvariantsMismatch: 4\n\t};\n\tviolations.sort((a, b) => {\n\t\tconst k = kindOrder[a.kind] - kindOrder[b.kind];\n\t\tif (k !== 0) return k;\n\t\tif (a.spaceId < b.spaceId) return -1;\n\t\tif (a.spaceId > b.spaceId) return 1;\n\t\treturn 0;\n\t});\n\treturn {\n\t\tok: false,\n\t\tviolations\n\t};\n}\n//#endregion\nexport { RESERVED_SPACE_SUBDIR_NAMES as a, isValidSpaceId as c, APP_SPACE_ID as i, spaceMigrationDirectory as l, verifyContractSpaces as n, SPACE_REFS_DIRNAME as o, readContractSpaceHeadRef as r, assertValidSpaceId as s, listContractSpaceDirectories as t, spaceRefsDirectory as u };\n\n//# sourceMappingURL=verify-contract-spaces-CrxvgpwD.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,mBAAmB;AACzB,SAAS,eAAe,SAAS;CAChC,OAAO,iBAAiB,KAAK,OAAO;AACrC;AACA,SAAS,mBAAmB,SAAS;CACpC,IAAI,CAAC,eAAe,OAAO,GAAG,MAAM,oBAAoB,OAAO;AAChE;;;;;;;;;;;;;AAaA,SAAS,wBAAwB,sBAAsB,SAAS;CAC/D,mBAAmB,OAAO;CAC1B,OAAO,KAAK,sBAAsB,OAAO;AAC1C;;;;;;;;;AASA,MAAM,qBAAqB;;;;;;;;AAQ3B,MAAM,8CAA8C,IAAI,IAAI,CAAC,oBAAoB,0BAA0B,CAAC;;;;;;;AAO5G,SAAS,mBAAmB,oBAAoB;CAC/C,OAAO,KAAK,oBAAoB,kBAAkB;AACnD;AAGA,SAAS,eAAe,OAAO,MAAM;CACpC,OAAO,iBAAiB,SAAS,MAAM,SAAS;AACjD;;;;;;;;;;;;;;AAcA,eAAe,yBAAyB,sBAAsB,SAAS;CACtE,mBAAmB,OAAO;CAC1B,MAAM,WAAW,KAAK,mBAAmB,wBAAwB,sBAAsB,OAAO,CAAC,GAAG,WAAW;CAC7G,IAAI;CACJ,IAAI;EACH,MAAM,MAAM,SAAS,UAAU,OAAO;CACvC,SAAS,OAAO;EACf,IAAI,eAAe,OAAO,QAAQ,GAAG,OAAO;EAC5C,MAAM;CACP;CACA,IAAI;CACJ,IAAI;EACH,SAAS,KAAK,MAAM,GAAG;CACxB,SAAS,GAAG;EACX,MAAM,iBAAiB,UAAU,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,CAAC;CAC5E;CACA,IAAI,OAAO,WAAW,YAAY,WAAW,MAAM,MAAM,oBAAoB,U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;EACxG,MAAM;EACN,SAAS;EACT,aAAa,qCAAqC,KAAK,cAAc,GAAG,EAAE;CAC3E,CAAC;CACD,KAAK,MAAM,SAAS,CAAC,GAAG,OAAO,kBAAkB,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,aAAa,IAAI,KAAK,GAAG,WAAW,KAAK;EACrH,MAAM;EACN,SAAS;EACT,aAAa,gCAAgC,MAAM;CACpD,CAAC;CACD,IAAI,WAAW,WAAW,GAAG,OAAO,EAAE,IAAI,KAAK;CAC/C,MAAM,YAAY;EACjB,uBAAuB;EACvB,cAAc;EACd,gBAAgB;EAChB,cAAc;EACd,oBAAoB;CACrB;CACA,WAAW,MAAM,GAAG,MAAM;EACzB,MAAM,IAAI,UAAU,EAAE,QAAQ,UAAU,EAAE;EAC1C,IAAI,MAAM,GAAG,OAAO;EACpB,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,OAAO;CACR,CAAC;CACD,OAAO;EACN,IAAI;EACJ;CACD;AACD"}
@@ -22,7 +22,7 @@ interface PrismaVitePluginOptions {
22
22
  //#endregion
23
23
  //#region src/plugin.d.ts
24
24
  /**
25
- * Creates a Vite plugin that automatically emits Prisma Next contract artifacts.
25
+ * Creates a Vite plugin that automatically emits Prisma 8 contract artifacts.
26
26
  *
27
27
  * The plugin resolves watched files from contract source provider metadata,
28
28
  * re-emitting contract artifacts on changes with debounce while serializing
@@ -1,6 +1,6 @@
1
- import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
2
- import { R as executeContractEmit, h as disposeEmitQueue } from "./ref-h6InR6dO-rGfl18Jv.mjs";
3
- import { a as loadConfigForSections } from "./exports-BZaG8_w_.mjs";
1
+ import { r as getEmittedArtifactPaths } from "./exports-CE6OD63o-4Qpqr2W7.mjs";
2
+ import { h as disposeEmitQueue, z as executeContractEmit } from "./ref-DcqFmceq-QaUjgZeM.mjs";
3
+ import { a as loadConfigForSections } from "./exports-BXXeNWlj.mjs";
4
4
  import { extname, resolve } from "pathe";
5
5
  //#region ../../../1-framework/3-tooling/vite-plugin-contract-emit/dist/index.mjs
6
6
  const PLUGIN_NAME = "prisma-vite-plugin-contract-emit";
@@ -17,7 +17,7 @@ const MODULE_GRAPH_EXTENSIONS = /* @__PURE__ */ new Set([
17
17
  ".cts"
18
18
  ]);
19
19
  /**
20
- * Creates a Vite plugin that automatically emits Prisma Next contract artifacts.
20
+ * Creates a Vite plugin that automatically emits Prisma 8 contract artifacts.
21
21
  *
22
22
  * The plugin resolves watched files from contract source provider metadata,
23
23
  * re-emitting contract artifacts on changes with debounce while serializing
@@ -123,7 +123,7 @@ function prismaVitePlugin(configPath = DEFAULT_CONFIG_PATH, options) {
123
123
  server.ws.send({
124
124
  type: "error",
125
125
  err: {
126
- message: `[prisma-next] ${errorMessage}`,
126
+ message: `[prisma] ${errorMessage}`,
127
127
  stack: errorStack ?? "",
128
128
  plugin: PLUGIN_NAME
129
129
  }
@@ -224,7 +224,7 @@ function prismaVitePlugin(configPath = DEFAULT_CONFIG_PATH, options) {
224
224
  if (!didWarnConfigWatchFallback) {
225
225
  didWarnConfigWatchFallback = true;
226
226
  const reason = error instanceof Error ? ` ${error.message}` : "";
227
- logWarning(`${previousWatchedFiles.size > 0 ? `Watching the previous dependency set plus ${absoluteConfigPath}` : `Watching only ${absoluteConfigPath}`} because Prisma Next config inputs could not be resolved.${reason} Contract watch coverage is partial.`);
227
+ logWarning(`${previousWatchedFiles.size > 0 ? `Watching the previous dependency set plus ${absoluteConfigPath}` : `Watching only ${absoluteConfigPath}`} because Prisma 8 config inputs could not be resolved.${reason} Contract watch coverage is partial.`);
228
228
  }
229
229
  if (previousWatchedFiles.size > 0) {
230
230
  previousWatchedFiles.add(absoluteConfigPath);
@@ -293,7 +293,7 @@ function prismaVitePlugin(configPath = DEFAULT_CONFIG_PATH, options) {
293
293
  viteServer.ws.send({
294
294
  type: "error",
295
295
  err: {
296
- message: `[prisma-next] ${errorMessage}`,
296
+ message: `[prisma] ${errorMessage}`,
297
297
  stack: "",
298
298
  plugin: PLUGIN_NAME
299
299
  }