@prisma/orm-toolchain 8.0.0-rc.11-dev.38 → 8.0.0-rc.11-dev.40

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.
@@ -704,6 +704,25 @@ interface MigrationPlanOptions {
704
704
  readonly to?: string;
705
705
  /** Renders the declarations of the destination snapshot from its `contract.json`. */
706
706
  readonly client: Pick<ControlClient, 'renderContractDts'>;
707
+ /**
708
+ * Consent to the auto-baseline plan a prior `MIGRATION.DESTRUCTIVE_CHANGES`
709
+ * refusal named by its `planHash`. The consented run recomputes the baseline
710
+ * plan and refuses with `MIGRATION.CONSENT_PLAN_MISMATCH` when it differs.
711
+ */
712
+ readonly consent?: {
713
+ readonly planHash: string;
714
+ };
715
+ /**
716
+ * Extension-space migration packages a refused first run of this same
717
+ * invocation already materialised. The consented re-run finds them on disk
718
+ * (its seed phase reports `unchanged`), so the caller threads them back in
719
+ * to keep `emittedExtensionDirs` and the summary describing the whole
720
+ * invocation, not just the second run.
721
+ */
722
+ readonly carryEmittedExtensionDirs?: readonly {
723
+ readonly spaceId: string;
724
+ readonly dirName: string;
725
+ }[];
707
726
  }
708
727
  interface MigrationPlanResult {
709
728
  readonly ok: boolean;
@@ -733,6 +752,18 @@ interface MigrationPlanResult {
733
752
  readonly label: string;
734
753
  readonly operationClass: string;
735
754
  }[];
755
+ /**
756
+ * Operations of the auto-baseline package when this run wrote two packages
757
+ * (`baselineDir` + `dir`). Kept separate from `operations` (the app-space
758
+ * delta) so consumers keep reading `operations` as "the change", while
759
+ * renderers and the destructive warn-summary still cover everything the
760
+ * run wrote.
761
+ */
762
+ readonly baselineOperations?: readonly {
763
+ readonly id: string;
764
+ readonly label: string;
765
+ readonly operationClass: string;
766
+ }[];
736
767
  /**
737
768
  * Family-agnostic textual preview of the migration plan operations.
738
769
  * Replaces the previous `sql?: readonly string[]` field; consumers should
@@ -740,6 +771,12 @@ interface MigrationPlanResult {
740
771
  */
741
772
  readonly preview?: OperationPreview;
742
773
  readonly summary: string;
774
+ /**
775
+ * Origin-resolution caveats the user must see, e.g. the default `db` ref
776
+ * sitting behind the graph tip. Rendered as warn summaries by the human
777
+ * presentation and carried verbatim for JSON consumers.
778
+ */
779
+ readonly warnings?: readonly string[];
743
780
  /**
744
781
  * When true, `migration.ts` was written but contains unfilled
745
782
  * `placeholder(...)` calls. The user must edit the file and then run
@@ -794,6 +831,16 @@ declare function appliedHashesFromLedger(ledgerEntries: ReadonlyArray<{
794
831
  declare function statusForMigrationHash(migrationHash: string, annotations: ReadonlyMap<string, MigrationEdgeAnnotation>): 'applied' | 'pending' | null;
795
832
  //#endregion
796
833
  //#region src/control-api/operations/plan-resolution.d.ts
834
+ /**
835
+ * Set when the origin was derived from the `db` ref by default (no `--from`)
836
+ * and that ref sits on an in-graph node that is not the graph tip. Planning
837
+ * from it forks the graph, so the caller must surface it to the user.
838
+ */
839
+ interface DefaultOriginBehindTip {
840
+ readonly refName: string;
841
+ readonly refHash: string;
842
+ readonly tipHash: string;
843
+ }
797
844
  type FromResolution = {
798
845
  kind: 'greenfield';
799
846
  fromHash: null;
@@ -803,10 +850,12 @@ type FromResolution = {
803
850
  kind: 'graph-node';
804
851
  fromHash: string;
805
852
  fromContract: Contract;
853
+ defaultOriginBehindTip?: DefaultOriginBehindTip;
806
854
  } | {
807
855
  kind: 'ref';
808
856
  fromHash: string;
809
857
  fromContract: Contract;
858
+ defaultOriginBehindTip?: DefaultOriginBehindTip;
810
859
  } | {
811
860
  kind: 'auto-baseline';
812
861
  fromHash: string;
@@ -1 +1 @@
1
- {"version":3,"file":"cli__control-api.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/control-api.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBiB,oBAAoB,SAAS,uBAAuB;;;;;;iBAMpD,eAAe,IAAI,UAAU,YAAY,cAAc,kDAAkD;;;;iBAIzG,wBAAwB,iBAAiB;;;iBAGzC,mBAAmB,gBAA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,wBAAwB;WAC9B;WACA,cAAc;WACd;WACA;WACA,QAAQ,KAAK;IACpB,QAAQ,OAAO,YAAY;iBACd,sBAAsB,iBAAiB,uBAAuB,cAAc,cAAc,YAAY,aAAa;EAClI;EACA;;;;;;;iBAOe,0BAA0B;WAChC;WACA;WACA;WACA,YAAY;WACZ;WACA;IACP,QAAQ,OAAO,sBAAsB;;;;;iBAKxB,iBAAiB;WACvB;WACA;WACA;WACA;WACA,YAAY;IACnB,QAAQ;WACD;WACA;GACR;;;UAGO;WACC,OAAO;WACP,MAAM;WACN;;iBAEM,mBAAmB,eAAe,SAAS,uBAAuB,OAAO,aAAa;iBACtF,oBAAoB,eAAe;WACzC,OAAO;WACP,MAAM;IACb,OAAO,cAAc;;;;iBAIR,kBAAkB,kBAAkB,QAAQ,OAAO,MAAM;;;iBAGzD,iBAAiB"}
1
+ {"version":3,"file":"cli__control-api.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/control-api.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBiB,oBAAoB,SAAS,uBAAuB;;;;;;iBAMpD,eAAe,IAAI,UAAU,YAAY,cAAc,kDAAkD;;;;iBAIzG,wBAAwB,iBAAiB;;;iBAGzC,mBAAmB,gBAAgB;WACzC;IACP,cAAc;;;KAGb;WACM,aAAa;;;;;;;;;;;;;;;;;;;;;;iBAsBP,oBAAoB,SAAS,qBAAqB,eAAe,2BAA2B,QAAQ;;;UAG3G;WACC,QAAQ;WACR;;WAEA;;WAEA;;;;;;;;;;KAUN,sCAAsC;WAChC;WACA;;WAEA;WACA;;UAED;WACC;WACA,cAAc;;WAEd;WACA;;iBAEM,6BAA6B,SAAS,sCAAsC,QAAQ,OAAO,qCAAqC;;;;;;;;;;;;;;;;iBAgBhI,uBAAuB,qBAAqB,sBAAsB,wBAAwB;;;;;;;;UAQjG,qBAAqB,0BAA0B;WAC9C,UAAU;WACV;WACA,aAAa;WACb,YAAY,cAAc,2BAA2B,W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;WACA;GACR;;;UAGO;WACC,OAAO;WACP,MAAM;WACN;;iBAEM,mBAAmB,eAAe,SAAS,uBAAuB,OAAO,aAAa;iBACtF,oBAAoB,eAAe;WACzC,OAAO;WACP,MAAM;IACb,OAAO,cAAc;;;;iBAIR,kBAAkB,kBAAkB,QAAQ,OAAO,MAAM;;;iBAGzD,iBAAiB"}
@@ -1,2 +1,2 @@
1
- import { $ as listRefsByContractHash, B as executeContractEmit, Ct as resolveFromForPlan, Dt as runContractSpaceSeedPhase, G as executeMigrationNewCommand, H as executeDbUpdate, J as executeRefDeleteCommand, K as executeMigrationPlanCommand, Ot as runMigrationCheck, Q as hasMigrationPath, St as resolveContractRefToSnapshot, Tt as resolveToForPlan, U as executeDbVerify, V as executeDbInit, W as executeMigrateShowPlan, X as executeRefSetCommand, Y as executeRefListCommand, _ as enrichContract, _t as refusePackageCorruptionOnAggregate, a as appliedHashesFromLedger, at as mapContractAtError, c as buildReadAggregate, ct as migrationSpaceListEntriesFromAggregate, et as loadAggregateIntegrityViolations, ft as readMigrationRefs, g as disposeEmitQueue, gt as refuseMissingInvariantPath, h as deriveStatusEdgeAnnotations, ht as refuseMarkerOutsideGraph, i as appContractStandInFromIdentity, it as mapCaughtMigrationError, jt as statusForMigrationHash, kt as runMigrationList, l as buildRefAdvancementFields, lt as originHashForStatus, m as createControlClient, mt as refuseDeclaredExtensionTargetMismatch, n as NO_REF_ADVANCEMENT, nt as loadContractSpaceAggregateForCli, o as buildContractSpaceAggregate, ot as mapIntegrityViolations, p as computeRefAdvancementName, pt as refuseContractSpaceIntegrity, q as executeRefAdvancement, r as advanceRefSafely, s as buildMigrationSpaceGraphEntries, tt as loadContractRawSafely, u as checkSingleTarget, ut as preflightRefAdvancement, v as enumerateCheckSpaces, vt as refuseUnknownInvariants, wt as resolveMigrationRef, xt as resolveContractRef$1 } from "./ref-DlKsxbtg-DlwrVT2q.mjs";
1
+ import { $ as hasMigrationPath, At as runMigrationList, Ct as resolveContractRefToSnapshot, Et as resolveToForPlan, G as executeMigrateShowPlan, H as executeDbInit, J as executeRefAdvancement, K as executeMigrationNewCommand, Mt as statusForMigrationHash, Ot as runContractSpaceSeedPhase, St as resolveContractRef$1, Tt as resolveMigrationRef, U as executeDbUpdate, V as executeContractEmit, W as executeDbVerify, X as executeRefListCommand, Y as executeRefDeleteCommand, Z as executeRefSetCommand, _ as disposeEmitQueue, _t as refuseMissingInvariantPath, a as appContractStandInFromIdentity, at as mapCaughtMigrationError, c as buildMigrationSpaceGraphEntries, d as checkSingleTarget, dt as preflightRefAdvancement, et as listRefsByContractHash, g as deriveStatusEdgeAnnotations, gt as refuseMarkerOutsideGraph, h as createControlClient, ht as refuseDeclaredExtensionTargetMismatch, i as advanceRefSafely, kt as runMigrationCheck, l as buildReadAggregate, lt as migrationSpaceListEntriesFromAggregate, m as computeRefAdvancementName, mt as refuseContractSpaceIntegrity, nt as loadContractRawSafely, o as appliedHashesFromLedger, ot as mapContractAtError, pt as readMigrationRefs, q as executeMigrationPlanCommand, r as NO_REF_ADVANCEMENT, rt as loadContractSpaceAggregateForCli, s as buildContractSpaceAggregate, st as mapIntegrityViolations, tt as loadAggregateIntegrityViolations, u as buildRefAdvancementFields, ut as originHashForStatus, v as enrichContract, vt as refusePackageCorruptionOnAggregate, wt as resolveFromForPlan, y as enumerateCheckSpaces, yt as refuseUnknownInvariants } from "./ref-CGE8q4jD-DNPh6Yqe.mjs";
2
2
  export { NO_REF_ADVANCEMENT, advanceRefSafely, appContractStandInFromIdentity, appliedHashesFromLedger, buildContractSpaceAggregate, buildMigrationSpaceGraphEntries, buildReadAggregate, buildRefAdvancementFields, checkSingleTarget, computeRefAdvancementName, createControlClient, deriveStatusEdgeAnnotations, disposeEmitQueue, enrichContract, enumerateCheckSpaces, executeContractEmit, executeDbInit, executeDbUpdate, executeDbVerify, executeMigrateShowPlan, executeMigrationNewCommand, executeMigrationPlanCommand, executeRefAdvancement, executeRefDeleteCommand, executeRefListCommand, executeRefSetCommand, hasMigrationPath, listRefsByContractHash, loadAggregateIntegrityViolations, loadContractRawSafely, loadContractSpaceAggregateForCli, mapCaughtMigrationError, mapContractAtError, mapIntegrityViolations, migrationSpaceListEntriesFromAggregate, originHashForStatus, preflightRefAdvancement, readMigrationRefs, refuseContractSpaceIntegrity, refuseDeclaredExtensionTargetMismatch, refuseMarkerOutsideGraph, refuseMissingInvariantPath, refusePackageCorruptionOnAggregate, refuseUnknownInvariants, resolveContractRef$1 as resolveContractRef, resolveContractRefToSnapshot, resolveFromForPlan, resolveMigrationRef, resolveToForPlan, runContractSpaceSeedPhase, runMigrationCheck, runMigrationList, statusForMigrationHash };
@@ -1,4 +1,4 @@
1
- import { n as publicShells } from "./shells-BafZvOhr.mjs";
1
+ import { n as publicShells } from "./shells-BbMvvvf8.mjs";
2
2
  //#region ../../../0-shared/publish-surface/dist/import-roots.mjs
3
3
  /**
4
4
  * Import-root resolution: the one place that turns an internal workspace
@@ -221,4 +221,4 @@ const EXTERNAL_DIRECT_DEPENDENCIES = /* @__PURE__ */ new Set(["@prisma/cli-engin
221
221
  //#endregion
222
222
  export { directDependencyShells as a, internalImportRoot as c, transitiveImports as d, createScaffoldSpecifierResolver as i, platformEntrypointOf as l, buildOwnerIndex as n, importRootForDependencies as o, createImportSpecifierResolver as r, importedSpecifiers as s, ImportRootError as t, resolveImportSpecifier as u };
223
223
 
224
- //# sourceMappingURL=import-roots-BgbD211J.mjs.map
224
+ //# sourceMappingURL=import-roots-CCyOuQxb.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"import-roots-BgbD211J.mjs","names":[],"sources":["../../../../0-shared/publish-surface/dist/import-roots.mjs"],"sourcesContent":["import { publicShells } from \"./shells.mjs\";\n//#region src/import-roots.ts\n/**\n* Import-root resolution: the one place that turns an internal workspace\n* specifier into the name generated code should carry.\n*\n* Emission writes package names into files the user keeps — generated\n* contract types, scaffolded migrations, `prisma orm init` output. Which\n* name is correct depends on how the application installed Prisma 8, so\n* every emitter resolves through an {@link ImportRoot} rather than hardcoding\n* a specifier. The mapping itself is `./shells`; nothing here duplicates it.\n*/\nconst INTERNAL_SCOPE = \"@internal/\";\nconst PUBLISHED_SCOPE = \"@prisma/\";\n/** An import root that emitted code cannot express. */\nvar ImportRootError = class extends Error {};\nconst internalImportRoot = { mode: \"internal\" };\n/**\n* The import root an application's own dependency list expresses.\n*\n* Emission has to name packages the application can actually resolve, and the\n* application already states which those are. Reading its manifest keeps the\n* two from drifting and lets consumers move to published names one project at\n* a time instead of behind a repository-wide switch.\n*\n* A project that names exactly one facade is on the facade root; one that\n* names platform shells without a facade is a decomposed install; anything\n* else — including a project with no `@prisma/orm-*` dependency at all — is on\n* the internal root, which emits workspace names unchanged.\n*\n* @throws {ImportRootError} when the project depends on two facades, which no\n* single generated file can be emitted for.\n*/\nfunction importRootForDependencies(dependencies) {\n\tconst named = new Set(dependencies);\n\tconst facades = [];\n\tlet hasPlatform = false;\n\tfor (const [shell, definition] of publicShells) {\n\t\tif (!named.has(shell)) continue;\n\t\tif (definition.kind === \"facade\") facades.push(shell);\n\t\tif (definition.kind === \"platform\") hasPlatform = true;\n\t}\n\tif (facades.length > 1) throw new ImportRootError(`an application may depend on only one database facade, but this one depends on ${facades.join(\" and \")}`);\n\tconst [facade] = facades;\n\tif (facade !== void 0) return {\n\t\tmode: \"facade\",\n\t\tfacade\n\t};\n\treturn hasPlatform ? { mode: \"platform\" } : internalImportRoot;\n}\nconst owners = buildOwnerIndex(publicShells);\n/**\n* Takes the shell map as an argument rather than closing over `publicShells`\n* so the duplicate-owner guard is reachable from a test: the real map is\n* valid by construction, and a guard nothing can exercise is a guard nobody\n* knows still works.\n*/\nfunction buildOwnerIndex(shells) {\n\tconst index = /* @__PURE__ */ new Map();\n\tfor (const [shell, definition] of shells) for (const pkg of definition.packages) {\n\t\tconst existing = index.get(pkg.name);\n\t\tif (existing !== void 0) throw new ImportRootError(`${pkg.name} is mapped to both ${existing.shell} and ${shell}; one module may live in only one published package (ADR 242)`);\n\t\tindex.set(pkg.name, {\n\t\t\tshell,\n\t\t\tentry: pkg.entry\n\t\t});\n\t}\n\treturn index;\n}\nfunction splitSpecifier(specifier) {\n\tconst [scope, pkg, ...rest] = specifier.split(\"/\");\n\treturn {\n\t\tname: `${scope}/${pkg}`,\n\t\tsubpath: rest.join(\"/\")\n\t};\n}\nfunction joinEntrypoint(shell, entry, subpath) {\n\tconst tail = [entry, subpath].filter(Boolean).join(\"/\");\n\treturn tail === \"\" ? shell : `${shell}/${tail}`;\n}\n/**\n* The shells an application installs directly under this root. Emitted code\n* may name only these: a package manager puts a package's own dependencies in\n* its own `node_modules`, so importing a transitively installed package fails\n* to resolve at run time even though the files are on disk.\n*/\nfunction directDependencyShells(root) {\n\tconst direct = /* @__PURE__ */ new Set();\n\tif (root.mode === \"internal\") return direct;\n\tfor (const [shell, definition] of publicShells) {\n\t\tif (definition.kind === \"extension\") direct.add(shell);\n\t\tif (root.mode === \"platform\" && definition.kind === \"platform\") direct.add(shell);\n\t}\n\tif (root.mode === \"facade\") direct.add(root.facade);\n\treturn direct;\n}\nfunction owningShell(specifier, name) {\n\tconst owner = owners.get(name);\n\tif (owner === void 0) throw new ImportRootError(`${specifier} is not mapped to any published shell`);\n\treturn owner;\n}\n/**\n* The platform-install name for an internal specifier, with the shell that\n* owns it. The shell build needs both: an import that stays inside the shell\n* being built is bundled rather than externalized.\n*/\nfunction platformEntrypointOf(specifier) {\n\tconst { name, subpath } = splitSpecifier(specifier);\n\tconst owner = owningShell(specifier, name);\n\treturn {\n\t\tshell: owner.shell,\n\t\tid: joinEntrypoint(owner.shell, owner.entry, subpath)\n\t};\n}\n/**\n* The facade's own name for an internal specifier it republishes, or\n* `undefined` when the facade does not carry that surface.\n*/\nfunction facadeEntrypoint(facade, name, subpath) {\n\tconst definition = publicShells.get(facade);\n\t/* v8 ignore next -- @preserve: every ShellName is a key of publicShells */\n\tif (definition === void 0) throw new ImportRootError(`unknown shell ${facade}`);\n\tif (definition.kind !== \"facade\") throw new ImportRootError(`${facade} is a ${definition.kind} shell, not a facade`);\n\tfor (const reexport of definition.reexports ?? []) {\n\t\tif (reexport.package !== name) continue;\n\t\tif (subpath === \"\" && reexport.root === false) return void 0;\n\t\tif (reexport.subpaths !== void 0 && !reexport.subpaths.includes(subpath)) return void 0;\n\t\treturn joinEntrypoint(facade, reexport.entry, subpath);\n\t}\n}\nfunction describe(root) {\n\treturn root.mode === \"facade\" ? `${root.mode} (${root.facade})` : root.mode;\n}\nfunction resolveImportSpecifier(specifier, root) {\n\tif (root.mode === \"internal\") return specifier;\n\tif (!specifier.startsWith(INTERNAL_SCOPE)) return specifier;\n\tconst { name, subpath } = splitSpecifier(specifier);\n\tif (root.mode === \"facade\") {\n\t\tconst republished = facadeEntrypoint(root.facade, name, subpath);\n\t\tif (republished !== void 0) return republished;\n\t}\n\tconst owner = owningShell(specifier, name);\n\tconst published = joinEntrypoint(owner.shell, owner.entry, subpath);\n\tif (!directDependencyShells(root).has(owner.shell)) throw new ImportRootError(unreachableUnder(specifier, published, root));\n\treturn published;\n}\n/**\n* Why a specifier has no name under `root`.\n*\n* The facade wording deliberately does not say \"not a direct dependency\":\n* under ADR 242 the answer to that is never \"install the platform package\n* too\", it is that the facade has to republish the surface.\n*/\nfunction unreachableUnder(specifier, published, root) {\n\tif (root.mode === \"facade\") return `${specifier} has no name under ${root.facade}: the facade does not republish ${published}. An application installs one facade and nothing else, so every surface it reaches has to be one of that facade’s own entrypoints (ADR 242).`;\n\treturn `${specifier} resolves to ${published}, which an application on the ${describe(root)} import root does not depend on directly. Emitted code may name only direct dependencies (ADR 242).`;\n}\nfunction createImportSpecifierResolver(root) {\n\tif (root.mode === \"internal\") return (specifier) => specifier;\n\treturn (specifier) => resolveImportSpecifier(specifier, root);\n}\n/**\n* Builds the resolver `prisma orm init` scaffolds with. Identical to\n* {@link createImportSpecifierResolver} except that it will not accept a root\n* a scaffold cannot express, so the impossible case is rejected where the\n* resolver is made rather than when a template happens to hit a name.\n*/\nfunction createScaffoldSpecifierResolver(root) {\n\treturn createImportSpecifierResolver(root);\n}\nconst MODULE_SPECIFIER = /\\b(?:from|import)\\s*\\(?\\s*(['\"])([^'\"\\n]+)\\1/g;\n/**\n* True when `source` contains module syntax that must carry a quoted\n* specifier: `import '<s>'`, `import('<s>')`, or an import/export clause\n* followed by `from '<s>'`.\n*\n* Deliberately independent of {@link MODULE_SPECIFIER} — it exists to notice\n* when that scanner has stopped matching, so it accepts any quote character,\n* including the backtick a renderer must never emit. It does still require a\n* quote: the word \"import\" on its own appears in prose and comments all the\n* time, and treating that as module syntax made the check below fire on files\n* that have no imports at all.\n*/\nconst HAS_IMPORT_SYNTAX = /(?:^|[\\s(;}])import\\s*[('\"`]|(?:^|[\\s;}])(?:import|export)\\b[\\w$*,{}\\s]*?\\bfrom\\s*['\"`]/;\n/** The module specifiers a generated source file names. */\nfunction importedSpecifiers(source) {\n\treturn [...source.matchAll(MODULE_SPECIFIER)].map(([, , specifier]) => specifier ?? \"\");\n}\n/**\n* The specifiers in a generated file that the application would not have as a\n* direct dependency under `root` — the thing no emitted file may contain.\n*\n* Under the `internal` root nothing is reported: those names are the\n* repository's own, and every in-repo consumer resolves them through the\n* workspace.\n*\n* Throws rather than returning `[]` when the source plainly has imports but\n* the scan found none. An audit whose scanner has stopped matching would\n* otherwise report every file as clean, which is the one failure mode that\n* makes the audit worse than not having it.\n*/\nfunction transitiveImports(source, root) {\n\tconst specifiers = importedSpecifiers(source);\n\tif (specifiers.length === 0 && HAS_IMPORT_SYNTAX.test(source)) throw new ImportRootError(\"source contains import syntax but no specifier was recognised; the audit would pass vacuously\");\n\tif (root.mode === \"internal\") return [];\n\tconst direct = new Set(directDependencyShells(root));\n\treturn specifiers.filter((specifier) => {\n\t\tif (specifier.startsWith(INTERNAL_SCOPE)) return true;\n\t\tif (!specifier.startsWith(PUBLISHED_SCOPE)) return false;\n\t\tconst [scope, shell] = specifier.split(\"/\");\n\t\tconst name = `${scope}/${shell}`;\n\t\treturn !direct.has(name) && !EXTERNAL_DIRECT_DEPENDENCIES.has(name);\n\t});\n}\n/**\n* Published packages this workspace does not own but `init` installs into a\n* scaffolded application directly, so its files may import them:\n* `@prisma/cli-engine` is the config file's `defineConfig` import.\n*/\nconst EXTERNAL_DIRECT_DEPENDENCIES = /* @__PURE__ */ new Set([\"@prisma/cli-engine\"]);\n//#endregion\nexport { ImportRootError, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, resolveImportSpecifier, transitiveImports };\n\n//# sourceMappingURL=import-roots.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;;AAExB,IAAI,kBAAkB,cAAc,MAAM,CAAC;AAC3C,MAAM,qBAAqB,EAAE,MAAM,WAAW;;;;;;;;;;;;;;;;;AAiB9C,SAAS,0BAA0B,cAAc;CAChD,MAAM,QAAQ,IAAI,IAAI,YAAY;CAClC,MAAM,UAAU,CAAC;CACjB,IAAI,cAAc;CAClB,KAAK,MAAM,CAAC,OAAO,eAAe,cAAc;EAC/C,IAAI,CAAC,MAAM,IAAI,KAAK,GAAG;EACvB,IAAI,WAAW,SAAS,UAAU,QAAQ,KAAK,KAAK;EACpD,IAAI,WAAW,SAAS,YAAY,cAAc;CACnD;CACA,IAAI,QAAQ,SAAS,GAAG,MAAM,IAAI,gBAAgB,kFAAkF,QAAQ,KAAK,OAAO,GAAG;CAC3J,MAAM,CAAC,UAAU;CACjB,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,MAAM;EACN;CACD;CACA,OAAO,cAAc,EAAE,MAAM,WAAW,IAAI;AAC7C;AACA,MAAM,SAAS,gBAAgB,YAAY;;;;;;;AAO3C,SAAS,gBAAgB,QAAQ;CAChC,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,MAAM,CAAC,OAAO,eAAe,QAAQ,KAAK,MAAM,OAAO,WAAW,UAAU;EAChF,MAAM,WAAW,MAAM,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O,GAAG,UAAU,qBAAqB,KAAK,OAAO,kCAAkC,UAAU;CAC7H,OAAO,GAAG,UAAU,eAAe,UAAU,gCAAgC,SAAS,IAAI,EAAE;AAC7F;AACA,SAAS,8BAA8B,MAAM;CAC5C,IAAI,KAAK,SAAS,YAAY,QAAQ,cAAc;CACpD,QAAQ,cAAc,uBAAuB,WAAW,IAAI;AAC7D;;;;;;;AAOA,SAAS,gCAAgC,MAAM;CAC9C,OAAO,8BAA8B,IAAI;AAC1C;AACA,MAAM,mBAAmB;;;;;;;;;;;;;AAazB,MAAM,oBAAoB;;AAE1B,SAAS,mBAAmB,QAAQ;CACnC,OAAO,CAAC,GAAG,OAAO,SAAS,gBAAgB,CAAC,CAAC,CAAC,KAAK,KAAK,eAAe,aAAa,EAAE;AACvF;;;;;;;;;;;;;;AAcA,SAAS,kBAAkB,QAAQ,MAAM;CACxC,MAAM,aAAa,mBAAmB,MAAM;CAC5C,IAAI,WAAW,WAAW,KAAK,kBAAkB,KAAK,MAAM,GAAG,MAAM,IAAI,gBAAgB,+FAA+F;CACxL,IAAI,KAAK,SAAS,YAAY,OAAO,CAAC;CACtC,MAAM,SAAS,IAAI,IAAI,uBAAuB,IAAI,CAAC;CACnD,OAAO,WAAW,QAAQ,cAAc;EACvC,IAAI,UAAU,WAAW,cAAc,GAAG,OAAO;EACjD,IAAI,CAAC,UAAU,WAAW,eAAe,GAAG,OAAO;EACnD,MAAM,CAAC,OAAO,SAAS,UAAU,MAAM,GAAG;EAC1C,MAAM,OAAO,GAAG,MAAM,GAAG;EACzB,OAAO,CAAC,OAAO,IAAI,IAAI,KAAK,CAAC,6BAA6B,IAAI,IAAI;CACnE,CAAC;AACF;;;;;;AAMA,MAAM,+CAA+C,IAAI,IAAI,CAAC,oBAAoB,CAAC"}
1
+ {"version":3,"file":"import-roots-CCyOuQxb.mjs","names":[],"sources":["../../../../0-shared/publish-surface/dist/import-roots.mjs"],"sourcesContent":["import { publicShells } from \"./shells.mjs\";\n//#region src/import-roots.ts\n/**\n* Import-root resolution: the one place that turns an internal workspace\n* specifier into the name generated code should carry.\n*\n* Emission writes package names into files the user keeps — generated\n* contract types, scaffolded migrations, `prisma orm init` output. Which\n* name is correct depends on how the application installed Prisma 8, so\n* every emitter resolves through an {@link ImportRoot} rather than hardcoding\n* a specifier. The mapping itself is `./shells`; nothing here duplicates it.\n*/\nconst INTERNAL_SCOPE = \"@internal/\";\nconst PUBLISHED_SCOPE = \"@prisma/\";\n/** An import root that emitted code cannot express. */\nvar ImportRootError = class extends Error {};\nconst internalImportRoot = { mode: \"internal\" };\n/**\n* The import root an application's own dependency list expresses.\n*\n* Emission has to name packages the application can actually resolve, and the\n* application already states which those are. Reading its manifest keeps the\n* two from drifting and lets consumers move to published names one project at\n* a time instead of behind a repository-wide switch.\n*\n* A project that names exactly one facade is on the facade root; one that\n* names platform shells without a facade is a decomposed install; anything\n* else — including a project with no `@prisma/orm-*` dependency at all — is on\n* the internal root, which emits workspace names unchanged.\n*\n* @throws {ImportRootError} when the project depends on two facades, which no\n* single generated file can be emitted for.\n*/\nfunction importRootForDependencies(dependencies) {\n\tconst named = new Set(dependencies);\n\tconst facades = [];\n\tlet hasPlatform = false;\n\tfor (const [shell, definition] of publicShells) {\n\t\tif (!named.has(shell)) continue;\n\t\tif (definition.kind === \"facade\") facades.push(shell);\n\t\tif (definition.kind === \"platform\") hasPlatform = true;\n\t}\n\tif (facades.length > 1) throw new ImportRootError(`an application may depend on only one database facade, but this one depends on ${facades.join(\" and \")}`);\n\tconst [facade] = facades;\n\tif (facade !== void 0) return {\n\t\tmode: \"facade\",\n\t\tfacade\n\t};\n\treturn hasPlatform ? { mode: \"platform\" } : internalImportRoot;\n}\nconst owners = buildOwnerIndex(publicShells);\n/**\n* Takes the shell map as an argument rather than closing over `publicShells`\n* so the duplicate-owner guard is reachable from a test: the real map is\n* valid by construction, and a guard nothing can exercise is a guard nobody\n* knows still works.\n*/\nfunction buildOwnerIndex(shells) {\n\tconst index = /* @__PURE__ */ new Map();\n\tfor (const [shell, definition] of shells) for (const pkg of definition.packages) {\n\t\tconst existing = index.get(pkg.name);\n\t\tif (existing !== void 0) throw new ImportRootError(`${pkg.name} is mapped to both ${existing.shell} and ${shell}; one module may live in only one published package (ADR 242)`);\n\t\tindex.set(pkg.name, {\n\t\t\tshell,\n\t\t\tentry: pkg.entry\n\t\t});\n\t}\n\treturn index;\n}\nfunction splitSpecifier(specifier) {\n\tconst [scope, pkg, ...rest] = specifier.split(\"/\");\n\treturn {\n\t\tname: `${scope}/${pkg}`,\n\t\tsubpath: rest.join(\"/\")\n\t};\n}\nfunction joinEntrypoint(shell, entry, subpath) {\n\tconst tail = [entry, subpath].filter(Boolean).join(\"/\");\n\treturn tail === \"\" ? shell : `${shell}/${tail}`;\n}\n/**\n* The shells an application installs directly under this root. Emitted code\n* may name only these: a package manager puts a package's own dependencies in\n* its own `node_modules`, so importing a transitively installed package fails\n* to resolve at run time even though the files are on disk.\n*/\nfunction directDependencyShells(root) {\n\tconst direct = /* @__PURE__ */ new Set();\n\tif (root.mode === \"internal\") return direct;\n\tfor (const [shell, definition] of publicShells) {\n\t\tif (definition.kind === \"extension\") direct.add(shell);\n\t\tif (root.mode === \"platform\" && definition.kind === \"platform\") direct.add(shell);\n\t}\n\tif (root.mode === \"facade\") direct.add(root.facade);\n\treturn direct;\n}\nfunction owningShell(specifier, name) {\n\tconst owner = owners.get(name);\n\tif (owner === void 0) throw new ImportRootError(`${specifier} is not mapped to any published shell`);\n\treturn owner;\n}\n/**\n* The platform-install name for an internal specifier, with the shell that\n* owns it. The shell build needs both: an import that stays inside the shell\n* being built is bundled rather than externalized.\n*/\nfunction platformEntrypointOf(specifier) {\n\tconst { name, subpath } = splitSpecifier(specifier);\n\tconst owner = owningShell(specifier, name);\n\treturn {\n\t\tshell: owner.shell,\n\t\tid: joinEntrypoint(owner.shell, owner.entry, subpath)\n\t};\n}\n/**\n* The facade's own name for an internal specifier it republishes, or\n* `undefined` when the facade does not carry that surface.\n*/\nfunction facadeEntrypoint(facade, name, subpath) {\n\tconst definition = publicShells.get(facade);\n\t/* v8 ignore next -- @preserve: every ShellName is a key of publicShells */\n\tif (definition === void 0) throw new ImportRootError(`unknown shell ${facade}`);\n\tif (definition.kind !== \"facade\") throw new ImportRootError(`${facade} is a ${definition.kind} shell, not a facade`);\n\tfor (const reexport of definition.reexports ?? []) {\n\t\tif (reexport.package !== name) continue;\n\t\tif (subpath === \"\" && reexport.root === false) return void 0;\n\t\tif (reexport.subpaths !== void 0 && !reexport.subpaths.includes(subpath)) return void 0;\n\t\treturn joinEntrypoint(facade, reexport.entry, subpath);\n\t}\n}\nfunction describe(root) {\n\treturn root.mode === \"facade\" ? `${root.mode} (${root.facade})` : root.mode;\n}\nfunction resolveImportSpecifier(specifier, root) {\n\tif (root.mode === \"internal\") return specifier;\n\tif (!specifier.startsWith(INTERNAL_SCOPE)) return specifier;\n\tconst { name, subpath } = splitSpecifier(specifier);\n\tif (root.mode === \"facade\") {\n\t\tconst republished = facadeEntrypoint(root.facade, name, subpath);\n\t\tif (republished !== void 0) return republished;\n\t}\n\tconst owner = owningShell(specifier, name);\n\tconst published = joinEntrypoint(owner.shell, owner.entry, subpath);\n\tif (!directDependencyShells(root).has(owner.shell)) throw new ImportRootError(unreachableUnder(specifier, published, root));\n\treturn published;\n}\n/**\n* Why a specifier has no name under `root`.\n*\n* The facade wording deliberately does not say \"not a direct dependency\":\n* under ADR 242 the answer to that is never \"install the platform package\n* too\", it is that the facade has to republish the surface.\n*/\nfunction unreachableUnder(specifier, published, root) {\n\tif (root.mode === \"facade\") return `${specifier} has no name under ${root.facade}: the facade does not republish ${published}. An application installs one facade and nothing else, so every surface it reaches has to be one of that facade’s own entrypoints (ADR 242).`;\n\treturn `${specifier} resolves to ${published}, which an application on the ${describe(root)} import root does not depend on directly. Emitted code may name only direct dependencies (ADR 242).`;\n}\nfunction createImportSpecifierResolver(root) {\n\tif (root.mode === \"internal\") return (specifier) => specifier;\n\treturn (specifier) => resolveImportSpecifier(specifier, root);\n}\n/**\n* Builds the resolver `prisma orm init` scaffolds with. Identical to\n* {@link createImportSpecifierResolver} except that it will not accept a root\n* a scaffold cannot express, so the impossible case is rejected where the\n* resolver is made rather than when a template happens to hit a name.\n*/\nfunction createScaffoldSpecifierResolver(root) {\n\treturn createImportSpecifierResolver(root);\n}\nconst MODULE_SPECIFIER = /\\b(?:from|import)\\s*\\(?\\s*(['\"])([^'\"\\n]+)\\1/g;\n/**\n* True when `source` contains module syntax that must carry a quoted\n* specifier: `import '<s>'`, `import('<s>')`, or an import/export clause\n* followed by `from '<s>'`.\n*\n* Deliberately independent of {@link MODULE_SPECIFIER} — it exists to notice\n* when that scanner has stopped matching, so it accepts any quote character,\n* including the backtick a renderer must never emit. It does still require a\n* quote: the word \"import\" on its own appears in prose and comments all the\n* time, and treating that as module syntax made the check below fire on files\n* that have no imports at all.\n*/\nconst HAS_IMPORT_SYNTAX = /(?:^|[\\s(;}])import\\s*[('\"`]|(?:^|[\\s;}])(?:import|export)\\b[\\w$*,{}\\s]*?\\bfrom\\s*['\"`]/;\n/** The module specifiers a generated source file names. */\nfunction importedSpecifiers(source) {\n\treturn [...source.matchAll(MODULE_SPECIFIER)].map(([, , specifier]) => specifier ?? \"\");\n}\n/**\n* The specifiers in a generated file that the application would not have as a\n* direct dependency under `root` — the thing no emitted file may contain.\n*\n* Under the `internal` root nothing is reported: those names are the\n* repository's own, and every in-repo consumer resolves them through the\n* workspace.\n*\n* Throws rather than returning `[]` when the source plainly has imports but\n* the scan found none. An audit whose scanner has stopped matching would\n* otherwise report every file as clean, which is the one failure mode that\n* makes the audit worse than not having it.\n*/\nfunction transitiveImports(source, root) {\n\tconst specifiers = importedSpecifiers(source);\n\tif (specifiers.length === 0 && HAS_IMPORT_SYNTAX.test(source)) throw new ImportRootError(\"source contains import syntax but no specifier was recognised; the audit would pass vacuously\");\n\tif (root.mode === \"internal\") return [];\n\tconst direct = new Set(directDependencyShells(root));\n\treturn specifiers.filter((specifier) => {\n\t\tif (specifier.startsWith(INTERNAL_SCOPE)) return true;\n\t\tif (!specifier.startsWith(PUBLISHED_SCOPE)) return false;\n\t\tconst [scope, shell] = specifier.split(\"/\");\n\t\tconst name = `${scope}/${shell}`;\n\t\treturn !direct.has(name) && !EXTERNAL_DIRECT_DEPENDENCIES.has(name);\n\t});\n}\n/**\n* Published packages this workspace does not own but `init` installs into a\n* scaffolded application directly, so its files may import them:\n* `@prisma/cli-engine` is the config file's `defineConfig` import.\n*/\nconst EXTERNAL_DIRECT_DEPENDENCIES = /* @__PURE__ */ new Set([\"@prisma/cli-engine\"]);\n//#endregion\nexport { ImportRootError, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, resolveImportSpecifier, transitiveImports };\n\n//# sourceMappingURL=import-roots.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;;AAExB,IAAI,kBAAkB,cAAc,MAAM,CAAC;AAC3C,MAAM,qBAAqB,EAAE,MAAM,WAAW;;;;;;;;;;;;;;;;;AAiB9C,SAAS,0BAA0B,cAAc;CAChD,MAAM,QAAQ,IAAI,IAAI,YAAY;CAClC,MAAM,UAAU,CAAC;CACjB,IAAI,cAAc;CAClB,KAAK,MAAM,CAAC,OAAO,eAAe,cAAc;EAC/C,IAAI,CAAC,MAAM,IAAI,KAAK,GAAG;EACvB,IAAI,WAAW,SAAS,UAAU,QAAQ,KAAK,KAAK;EACpD,IAAI,WAAW,SAAS,YAAY,cAAc;CACnD;CACA,IAAI,QAAQ,SAAS,GAAG,MAAM,IAAI,gBAAgB,kFAAkF,QAAQ,KAAK,OAAO,GAAG;CAC3J,MAAM,CAAC,UAAU;CACjB,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,MAAM;EACN;CACD;CACA,OAAO,cAAc,EAAE,MAAM,WAAW,IAAI;AAC7C;AACA,MAAM,SAAS,gBAAg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M,+CAA+C,IAAI,IAAI,CAAC,oBAAoB,CAAC"}
@@ -1,3 +1,3 @@
1
- import { n as publicShells, t as excludedSubpaths } from "./shells-BafZvOhr.mjs";
2
- import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-BgbD211J.mjs";
1
+ import { n as publicShells, t as excludedSubpaths } from "./shells-BbMvvvf8.mjs";
2
+ import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-CCyOuQxb.mjs";
3
3
  export { ImportRootError, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, excludedSubpaths, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, publicShells, resolveImportSpecifier, transitiveImports };
@@ -1,2 +1,2 @@
1
- import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-BgbD211J.mjs";
1
+ import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-CCyOuQxb.mjs";
2
2
  export { ImportRootError, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, resolveImportSpecifier, transitiveImports };
@@ -1,2 +1,2 @@
1
- import { n as publicShells, t as excludedSubpaths } from "./shells-BafZvOhr.mjs";
1
+ import { n as publicShells, t as excludedSubpaths } from "./shells-BbMvvvf8.mjs";
2
2
  export { excludedSubpaths, publicShells };
@@ -11,7 +11,7 @@ import { d as writeRef, i as readRefs, l as validateRefName, n as deleteRef, o a
11
11
  import { a as isValidSpaceId, c as spaceMigrationDirectory, l as spaceRefsDirectory, o as listContractSpaceDirectories, s as readContractSpaceHeadRef, t as APP_SPACE_ID$1 } from "./verify-contract-spaces-_vwt5LT0-BQAf8Q4T.mjs";
12
12
  import { d as resolveRecordedPath, f as verifyMigration, l as planMigration, n as buildFabricatedMigrationEdge, r as collectAggregateNamespaces, s as loadContractSpaceAggregate, t as allStorageElementsExternal, u as requireHeadRef } from "./aggregate-DI9VS7yL.mjs";
13
13
  import { i as emitContractSpaceArtifacts, o as planAllSpaces } from "./spaces-DzFtKEl3.mjs";
14
- import { c as internalImportRoot, o as importRootForDependencies, r as createImportSpecifierResolver, t as ImportRootError } from "./import-roots-BgbD211J.mjs";
14
+ import { c as internalImportRoot, o as importRootForDependencies, r as createImportSpecifierResolver, t as ImportRootError } from "./import-roots-CCyOuQxb.mjs";
15
15
  import { n as parseContractRef, r as parseMigrationRef } from "./ref-resolution-BWpwb8_b.mjs";
16
16
  import { i as writeMigrationTs } from "./migration-ts-DdVm0rws.mjs";
17
17
  import { createRequire } from "node:module";
@@ -25,7 +25,7 @@ import { CliStructuredError, CliStructuredError as CliStructuredError$1, errorCo
25
25
  import { APP_SPACE_ID, createControlStack, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView } from "@prisma/orm-framework/components/control";
26
26
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
27
27
  import { mergeCapabilityMatrices } from "@prisma/orm-framework/components/components";
28
- import { errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorRunnerFailed, errorRuntime, errorTargetMismatch } from "@prisma/orm-framework/errors/execution";
28
+ import { ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorRunnerFailed, errorRuntime, errorTargetMismatch } from "@prisma/orm-framework/errors/execution";
29
29
  import "@prisma/orm-framework/errors/migration";
30
30
  import { basename, dirname, isAbsolute, join, relative, resolve } from "pathe";
31
31
  import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
@@ -33,7 +33,7 @@ import { createHash } from "node:crypto";
33
33
  import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
34
34
  import { abortable } from "@prisma/orm-framework/utils/abortable";
35
35
  import { resolve as resolve$1 } from "node:path";
36
- //#region ../../../1-framework/3-tooling/cli/dist/ref-DlKsxbtg.mjs
36
+ //#region ../../../1-framework/3-tooling/cli/dist/ref-CGE8q4jD.mjs
37
37
  /**
38
38
  * The typed remediation the CLI attaches to its own errors and findings.
39
39
  * Constructors live here rather than in any library the CLI calls: naming a
@@ -4078,14 +4078,26 @@ async function executeMigrationNewCommand(options) {
4078
4078
  const packages = aggregate.app.packages;
4079
4079
  const graph = aggregate.app.graph();
4080
4080
  let fromHash = null;
4081
- if (packages.length > 0) if (options.from) {
4082
- const match = packages.find((p) => p.metadata.to.startsWith(options.from));
4083
- if (!match) return notOk(errorRuntime("MIGRATION.HASH_NOT_IN_GRAPH", "Starting contract not found", {
4081
+ if (options.from !== void 0) {
4082
+ if (packages.length === 0) return notOk(errorRuntime("MIGRATION.HASH_NOT_IN_GRAPH", "--from has no meaning on an empty graph", {
4083
+ why: `--from "${options.from}" was passed, but ${appMigrationsRelative} contains no migrations, so there is no migration target hash it could name.`,
4084
+ fix: "Omit --from to scaffold the first migration (it records a baseline origin). `migration new --from` accepts the full 64-hex target hash of an existing migration, or a unique prefix of one."
4085
+ }));
4086
+ const matchedHashes = [...new Set(packages.filter((p) => p.metadata.to.startsWith(options.from ?? "")).map((p) => p.metadata.to))].sort();
4087
+ if (matchedHashes.length === 0) return notOk(errorRuntime("MIGRATION.HASH_NOT_IN_GRAPH", "Starting contract not found", {
4084
4088
  why: `No migration with to hash matching "${options.from}" exists in ${appMigrationsRelative}`,
4085
- fix: "Check that the --from hash matches a known migration target hash."
4089
+ fix: "Check that the --from hash matches a known migration target hash. `migration new --from` accepts the full 64-hex target hash of an existing migration, or a unique prefix of one."
4086
4090
  }));
4087
- fromHash = match.metadata.to;
4088
- } else {
4091
+ if (matchedHashes.length > 1) return notOk(errorRuntime("MIGRATION.REF_AMBIGUOUS", `Ambiguous --from prefix: "${options.from}"`, {
4092
+ why: `"${options.from}" is a prefix of ${matchedHashes.length} migration target hashes in ${appMigrationsRelative}: ${matchedHashes.join(", ")}`,
4093
+ fix: "Provide a longer prefix or the full 64-hex target hash to disambiguate.",
4094
+ meta: {
4095
+ input: options.from,
4096
+ candidates: matchedHashes
4097
+ }
4098
+ }));
4099
+ fromHash = matchedHashes[0] ?? null;
4100
+ } else if (packages.length > 0) {
4089
4101
  const latestMigration = findLatestMigration(graph);
4090
4102
  if (latestMigration) fromHash = latestMigration.to;
4091
4103
  }
@@ -4242,6 +4254,18 @@ function looksLikeFullHash(input) {
4242
4254
  function graphIsEmpty(space) {
4243
4255
  return space.packages.length === 0;
4244
4256
  }
4257
+ /**
4258
+ * The graph tip, or `null` when the graph is empty or already forked —
4259
+ * a forked graph has no single tip to compare the default ref against.
4260
+ */
4261
+ function findUnambiguousTip(graph) {
4262
+ try {
4263
+ return findLatestMigration(graph)?.to ?? null;
4264
+ } catch (error) {
4265
+ if (MigrationToolsError.is(error)) return null;
4266
+ throw error;
4267
+ }
4268
+ }
4245
4269
  function getReachableRefs(refs, graph) {
4246
4270
  return Object.entries(refs).flatMap(([name, entry]) => entry && isGraphNode(entry.hash, graph) ? [{
4247
4271
  name,
@@ -4321,13 +4345,27 @@ async function resolveFromForPlan(input) {
4321
4345
  });
4322
4346
  return notOk(errorPlanOriginUnknown(getReachableRefs(refs, graph), findLatestMigration(graph)?.to ?? null));
4323
4347
  }
4324
- return resolveFromPolicy({
4348
+ const resolved = await resolveFromPolicy({
4325
4349
  hash: dbRef.hash,
4326
4350
  provenance: {
4327
4351
  kind: "ref",
4328
4352
  refName: "db"
4329
4353
  }
4330
4354
  }, input, refs);
4355
+ if (!resolved.ok) return resolved;
4356
+ const value = resolved.value;
4357
+ if (value.kind === "ref" || value.kind === "graph-node") {
4358
+ const tipHash = findUnambiguousTip(graph);
4359
+ if (tipHash !== null && tipHash !== value.fromHash) return ok({
4360
+ ...value,
4361
+ defaultOriginBehindTip: {
4362
+ refName: "db",
4363
+ refHash: value.fromHash,
4364
+ tipHash
4365
+ }
4366
+ });
4367
+ }
4368
+ return resolved;
4331
4369
  }
4332
4370
  const refResult = parseContractRef(optionsFrom, {
4333
4371
  graph,
@@ -4410,8 +4448,14 @@ async function runPlannerLeg(planner, migrations, frameworkComponents, contract,
4410
4448
  summary: "Contract changed but planner produced no operations. This indicates unsupported or ignored changes."
4411
4449
  }] }));
4412
4450
  } catch (e) {
4413
- if (CliStructuredError$1.is(e) && e.code === "MIGRATION.UNFILLED_PLACEHOLDER") hasPlaceholders = true;
4414
- else throw e;
4451
+ if (CliStructuredError$1.is(e) && e.code === "MIGRATION.UNFILLED_PLACEHOLDER") {
4452
+ hasPlaceholders = true;
4453
+ try {
4454
+ plannedOps = (await Promise.allSettled(plannerResult.plan.operations)).flatMap((entry) => entry.status === "fulfilled" ? [entry.value] : []);
4455
+ } catch {
4456
+ plannedOps = [];
4457
+ }
4458
+ } else throw e;
4415
4459
  }
4416
4460
  return ok({
4417
4461
  plannedOps,
@@ -4433,6 +4477,48 @@ async function writePlannedMigrationPackage(packageDir, fromHash, toHash, create
4433
4477
  }, opsForWrite);
4434
4478
  await writeMigrationTs(packageDir, leg.migrationTsContent);
4435
4479
  }
4480
+ /**
4481
+ * The consent check for an auto-baseline write, mirroring `db update`'s
4482
+ * destructive-changes refusal: a baseline leg carrying destructive operations
4483
+ * is only written when the caller consents to that exact plan by its hash.
4484
+ * Runs before the baseline and delta packages are written, so a refusal
4485
+ * leaves the app-space migrations directory untouched (the extension seed
4486
+ * phase runs earlier and unconditionally, as it does for no-op runs).
4487
+ * A leg with unfilled placeholders is still checked over the operations
4488
+ * that did resolve. Returns `null` when the write may proceed.
4489
+ */
4490
+ function refuseUnconsentedDestructiveBaseline(leg, baselineToHash, consent) {
4491
+ const ops = leg.plannedOps;
4492
+ const destructiveOps = ops.filter((op) => op.operationClass === "destructive");
4493
+ if (destructiveOps.length === 0) return null;
4494
+ const planHash = computePlanHash({
4495
+ operations: ops.map((op) => ({
4496
+ id: op.id,
4497
+ label: op.label,
4498
+ operationClass: op.operationClass
4499
+ })),
4500
+ destination: { storageHash: baselineToHash }
4501
+ });
4502
+ if (consent === void 0) {
4503
+ const verdict = {
4504
+ destructiveOperations: destructiveOps.map((op) => ({
4505
+ id: op.id,
4506
+ label: op.label
4507
+ })),
4508
+ planHash
4509
+ };
4510
+ return errorDestructiveChanges(`The baseline migration contains ${destructiveOps.length} destructive operation(s) that require confirmation`, {
4511
+ why: "The migrations directory is empty, so planning writes a baseline derived from the `db` ref — and that baseline contains operations that would remove data when the migration is applied.",
4512
+ fix: "Re-run `prisma migration plan` and type the project directory name when asked, or pass `--no-interactive --confirm <directory>` where there is nobody to ask.",
4513
+ meta: { ...verdict }
4514
+ });
4515
+ }
4516
+ if (consent.planHash !== planHash) return errorConsentPlanMismatch({
4517
+ consentedPlanHash: consent.planHash,
4518
+ planHash
4519
+ });
4520
+ return null;
4521
+ }
4436
4522
  async function executeMigrationPlanCommand(options, startTime, callbacks) {
4437
4523
  try {
4438
4524
  return await executeMigrationPlanCommandInner(options, startTime, callbacks);
@@ -4497,6 +4583,10 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4497
4583
  space: resolutionSpace
4498
4584
  });
4499
4585
  if (!resolutionResult.ok) return notOk(resolutionResult.failure);
4586
+ const warnings = [];
4587
+ const warnBehindTip = (behind) => {
4588
+ warnings.push(`The default origin ref '${behind.refName}' points at ${behind.refHash}, which is not the latest migration (${behind.tipHash}). Planning from it forks the migration graph; pass --from to choose the origin explicitly.`);
4589
+ };
4500
4590
  switch (resolutionResult.value.kind) {
4501
4591
  case "greenfield":
4502
4592
  fromDefaulted = resolutionResult.value.defaulted;
@@ -4504,11 +4594,13 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4504
4594
  case "graph-node":
4505
4595
  fromHash = resolutionResult.value.fromHash;
4506
4596
  fromContract = resolutionResult.value.fromContract;
4597
+ if (resolutionResult.value.defaultOriginBehindTip !== void 0) warnBehindTip(resolutionResult.value.defaultOriginBehindTip);
4507
4598
  break;
4508
4599
  case "ref":
4509
4600
  fromHash = resolutionResult.value.fromHash;
4510
4601
  fromContract = resolutionResult.value.fromContract;
4511
4602
  fromContractInStore = true;
4603
+ if (resolutionResult.value.defaultOriginBehindTip !== void 0) warnBehindTip(resolutionResult.value.defaultOriginBehindTip);
4512
4604
  break;
4513
4605
  case "auto-baseline":
4514
4606
  fromHash = resolutionResult.value.fromHash;
@@ -4541,10 +4633,12 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4541
4633
  extensions: toExtensionInputs(config.extensions ?? [])
4542
4634
  });
4543
4635
  for (const record of seedResult.seeded) callbacks?.onSeeded?.(record);
4544
- const emittedExtensionDirs = seedResult.seeded.flatMap((r) => r.newMigrationDirs.map((dirName) => ({
4636
+ const seededThisRun = seedResult.seeded.flatMap((r) => r.newMigrationDirs.map((dirName) => ({
4545
4637
  spaceId: r.spaceId,
4546
4638
  dirName
4547
4639
  })));
4640
+ const carried = options.carryEmittedExtensionDirs ?? [];
4641
+ const emittedExtensionDirs = [...carried, ...seededThisRun.filter((entry) => !carried.some((prior) => prior.spaceId === entry.spaceId && prior.dirName === entry.dirName))];
4548
4642
  if (fromHash === toStorageHash && !isAutoBaseline) return ok({
4549
4643
  ok: true,
4550
4644
  noOp: true,
@@ -4552,6 +4646,7 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4552
4646
  to: toStorageHash,
4553
4647
  operations: [],
4554
4648
  emittedExtensionDirs,
4649
+ ...warnings.length > 0 ? { warnings } : {},
4555
4650
  summary: "No changes detected between contracts",
4556
4651
  timings: { total: Date.now() - startTime }
4557
4652
  });
@@ -4589,6 +4684,8 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4589
4684
  const deltaPackageDir = join(appMigrationsDir, deltaDirName);
4590
4685
  const baselineLeg = await runPlannerLeg(planner, migrations, frameworkComponents, fromContract, null, aggregate.app.spaceId, aggregate, snapshotsImportPathFrom(baselinePackageDir, migrationsDir), resolveImportSpecifier);
4591
4686
  if (!baselineLeg.ok) return notOk(baselineLeg.failure);
4687
+ const consentFailure = refuseUnconsentedDestructiveBaseline(baselineLeg.value, fromHash, options.consent);
4688
+ if (consentFailure !== null) return notOk(consentFailure);
4592
4689
  await writePlannedMigrationPackage(baselinePackageDir, null, fromHash, baselineTimestamp, baselineLeg.value);
4593
4690
  if (fromHash === toStorageHash) {
4594
4691
  const baselineOps = baselineLeg.value.hasPlaceholders ? [] : baselineLeg.value.plannedOps;
@@ -4603,6 +4700,7 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4603
4700
  baselineDir,
4604
4701
  operations: [],
4605
4702
  emittedExtensionDirs,
4703
+ ...warnings.length > 0 ? { warnings } : {},
4606
4704
  pendingPlaceholders: true,
4607
4705
  summary: "Planned baseline with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit",
4608
4706
  timings: { total: Date.now() - startTime }
@@ -4622,7 +4720,8 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4622
4720
  })),
4623
4721
  emittedExtensionDirs,
4624
4722
  ...preview !== void 0 ? { preview } : {},
4625
- summary: buildAutoBaselinePlanSummary(0, emittedExtensionDirs.length),
4723
+ ...warnings.length > 0 ? { warnings } : {},
4724
+ summary: buildAutoBaselinePlanSummary(baselineOps.length, 0, emittedExtensionDirs.length),
4626
4725
  timings: { total: Date.now() - startTime }
4627
4726
  });
4628
4727
  }
@@ -4630,8 +4729,9 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4630
4729
  if (!deltaLeg.ok) return notOk(deltaLeg.failure);
4631
4730
  await writePlannedMigrationPackage(deltaPackageDir, fromHash, toStorageHash, deltaTimestamp, deltaLeg.value);
4632
4731
  await writeDestinationSnapshot(toStorageHash);
4732
+ const baselineOps = baselineLeg.value.hasPlaceholders ? [] : baselineLeg.value.plannedOps;
4633
4733
  const deltaOps = deltaLeg.value.hasPlaceholders ? [] : deltaLeg.value.plannedOps;
4634
- if (deltaLeg.value.hasPlaceholders) return ok({
4734
+ if (baselineLeg.value.hasPlaceholders || deltaLeg.value.hasPlaceholders) return ok({
4635
4735
  ok: true,
4636
4736
  noOp: false,
4637
4737
  from: fromHash,
@@ -4640,11 +4740,12 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4640
4740
  baselineDir: relative(cwd, baselinePackageDir),
4641
4741
  operations: [],
4642
4742
  emittedExtensionDirs,
4743
+ ...warnings.length > 0 ? { warnings } : {},
4643
4744
  pendingPlaceholders: true,
4644
4745
  summary: "Planned baseline + migration with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit",
4645
4746
  timings: { total: Date.now() - startTime }
4646
4747
  });
4647
- const preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(deltaOps) : void 0;
4748
+ const preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview([...baselineOps, ...deltaOps]) : void 0;
4648
4749
  return ok({
4649
4750
  ok: true,
4650
4751
  noOp: false,
@@ -4657,9 +4758,15 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4657
4758
  label: op.label,
4658
4759
  operationClass: op.operationClass
4659
4760
  })),
4761
+ baselineOperations: baselineOps.map((op) => ({
4762
+ id: op.id,
4763
+ label: op.label,
4764
+ operationClass: op.operationClass
4765
+ })),
4660
4766
  emittedExtensionDirs,
4661
4767
  ...preview !== void 0 ? { preview } : {},
4662
- summary: buildAutoBaselinePlanSummary(deltaOps.length, emittedExtensionDirs.length),
4768
+ ...warnings.length > 0 ? { warnings } : {},
4769
+ summary: buildAutoBaselinePlanSummary(baselineOps.length, deltaOps.length, emittedExtensionDirs.length),
4663
4770
  timings: { total: Date.now() - startTime }
4664
4771
  });
4665
4772
  }
@@ -4677,6 +4784,7 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4677
4784
  dir: relative(cwd, packageDir),
4678
4785
  operations: [],
4679
4786
  emittedExtensionDirs,
4787
+ ...warnings.length > 0 ? { warnings } : {},
4680
4788
  pendingPlaceholders: true,
4681
4789
  ...fromDefaulted ? { fromDefaulted } : {},
4682
4790
  summary: "Planned migration with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit",
@@ -4698,6 +4806,7 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4698
4806
  emittedExtensionDirs,
4699
4807
  ...preview !== void 0 ? { preview } : {},
4700
4808
  ...fromDefaulted ? { fromDefaulted } : {},
4809
+ ...warnings.length > 0 ? { warnings } : {},
4701
4810
  summary: buildPlanSummary(plannedOps.length, emittedExtensionDirs.length),
4702
4811
  timings: { total: Date.now() - startTime }
4703
4812
  });
@@ -4727,8 +4836,8 @@ function buildPlanSummary(plannedOpsCount, emittedExtensionDirsCount) {
4727
4836
  if (emittedExtensionDirsCount === 0) return base;
4728
4837
  return `${base}; materialised ${emittedExtensionDirsCount} ${emittedExtensionDirsCount === 1 ? "extension-space migration" : "extension-space migrations"}`;
4729
4838
  }
4730
- function buildAutoBaselinePlanSummary(deltaOpsCount, emittedExtensionDirsCount) {
4731
- const base = `Planned baseline + ${deltaOpsCount} operation(s)`;
4839
+ function buildAutoBaselinePlanSummary(baselineOpsCount, deltaOpsCount, emittedExtensionDirsCount) {
4840
+ const base = `Planned baseline (${baselineOpsCount} operation(s)) + ${deltaOpsCount} operation(s)`;
4732
4841
  if (emittedExtensionDirsCount === 0) return base;
4733
4842
  return `${base}; materialised ${emittedExtensionDirsCount} ${emittedExtensionDirsCount === 1 ? "extension-space migration" : "extension-space migrations"}`;
4734
4843
  }
@@ -4857,6 +4966,6 @@ async function executeRefListCommand(options) {
4857
4966
  }
4858
4967
  }
4859
4968
  //#endregion
4860
- export { listRefsByContractHash as $, errorMarkerMissing as A, sanitizeErrorMessage as At, executeContractEmit as B, errorContractValidationFailed as C, resolveFromForPlan as Ct, errorFileNotFound as D, runContractSpaceSeedPhase as Dt, errorDriverRequired as E, runCommandAction as Et, errorRunnerFailed as F, executeMigrationNewCommand as G, executeDbUpdate as H, errorRuntime as I, executeRefDeleteCommand as J, executeMigrationPlanCommand as K, errorTargetMigrationNotSupported as L, errorMigrationPlanningFailed as M, targetSupportsMigrations as Mt, errorNoMigrations as N, toDeclaredExtensionsFromRaw as Nt, errorHashMismatch as O, runMigrationCheck as Ot, errorPathUnreachable as P, hasMigrationPath as Q, errorTargetMismatch as R, errorContractArgConflict as S, resolveContractRefToSnapshot as St, errorDestructiveChanges as T, resolveToForPlan as Tt, executeDbVerify as U, executeDbInit as V, executeMigrateShowPlan as W, executeRefSetCommand as X, executeRefListCommand as Y, findPackageByDirPath as Z, enrichContract as _, refusePackageCorruptionOnAggregate as _t, appliedHashesFromLedger as a, mapContractAtError as at, errorConfigValidation$1 as b, resolveAppTargetPath as bt, buildReadAggregate as c, migrationSpaceListEntriesFromAggregate as ct, chooseAction as d, readContractEnvelope as dt, loadAggregateIntegrityViolations as et, closeQuietly as f, readMigrationRefs as ft, disposeEmitQueue as g, refuseMissingInvariantPath as gt, deriveStatusEdgeAnnotations as h, refuseMarkerOutsideGraph as ht, appContractStandInFromIdentity as i, mapCaughtMigrationError as it, errorMigrationPackageNotFound as j, statusForMigrationHash as jt, errorLegendHumanOnly as k, runMigrationList as kt, buildRefAdvancementFields as l, originHashForStatus as lt, createControlClient as m, refuseDeclaredExtensionTargetMismatch as mt, NO_REF_ADVANCEMENT as n, loadContractSpaceAggregateForCli as nt, buildContractSpaceAggregate as o, mapIntegrityViolations as ot, computeRefAdvancementName as p, refuseContractSpaceIntegrity as pt, executeRefAdvancement as q, advanceRefSafely as r, looksLikePath as rt, buildMigrationSpaceGraphEntries as s, maskConnectionUrl as st, CliStructuredError$1 as t, loadContractRawSafely as tt, checkSingleTarget as u, preflightRefAdvancement as ut, enumerateCheckSpaces as v, refuseUnknownInvariants as vt, errorDatabaseConnectionRequired as w, resolveMigrationRef as wt, errorConsentPlanMismatch as x, resolveContractRef$1 as xt, errorAdvanceRefArgConflict as y, requireLiveDatabase as yt, errorUnexpected as z };
4969
+ export { hasMigrationPath as $, errorLegendHumanOnly as A, runMigrationList as At, errorUnexpected as B, errorContractArgConflict as C, resolveContractRefToSnapshot as Ct, errorDriverRequired as D, runCommandAction as Dt, errorDestructiveChanges as E, resolveToForPlan as Et, errorPathUnreachable as F, executeMigrateShowPlan as G, executeDbInit as H, errorRunnerFailed as I, executeRefAdvancement as J, executeMigrationNewCommand as K, errorRuntime as L, errorMigrationPackageNotFound as M, statusForMigrationHash as Mt, errorMigrationPlanningFailed as N, targetSupportsMigrations as Nt, errorFileNotFound as O, runContractSpaceSeedPhase as Ot, errorNoMigrations as P, toDeclaredExtensionsFromRaw as Pt, findPackageByDirPath as Q, errorTargetMigrationNotSupported as R, errorConsentPlanMismatch as S, resolveContractRef$1 as St, errorDatabaseConnectionRequired as T, resolveMigrationRef as Tt, executeDbUpdate as U, executeContractEmit as V, executeDbVerify as W, executeRefListCommand as X, executeRefDeleteCommand as Y, executeRefSetCommand as Z, disposeEmitQueue as _, refuseMissingInvariantPath as _t, appContractStandInFromIdentity as a, mapCaughtMigrationError as at, errorAdvanceRefArgConflict as b, requireLiveDatabase as bt, buildMigrationSpaceGraphEntries as c, maskConnectionUrl as ct, checkSingleTarget as d, preflightRefAdvancement as dt, listRefsByContractHash as et, chooseAction as f, readContractEnvelope as ft, deriveStatusEdgeAnnotations as g, refuseMarkerOutsideGraph as gt, createControlClient as h, refuseDeclaredExtensionTargetMismatch as ht, advanceRefSafely as i, looksLikePath as it, errorMarkerMissing as j, sanitizeErrorMessage as jt, errorHashMismatch as k, runMigrationCheck as kt, buildReadAggregate as l, migrationSpaceListEntriesFromAggregate as lt, computeRefAdvancementName as m, refuseContractSpaceIntegrity as mt, ERROR_CODE_DESTRUCTIVE_CHANGES as n, loadContractRawSafely as nt, appliedHashesFromLedger as o, mapContractAtError as ot, closeQuietly as p, readMigrationRefs as pt, executeMigrationPlanCommand as q, NO_REF_ADVANCEMENT as r, loadContractSpaceAggregateForCli as rt, buildContractSpaceAggregate as s, mapIntegrityViolations as st, CliStructuredError$1 as t, loadAggregateIntegrityViolations as tt, buildRefAdvancementFields as u, originHashForStatus as ut, enrichContract as v, refusePackageCorruptionOnAggregate as vt, errorContractValidationFailed as w, resolveFromForPlan as wt, errorConfigValidation$1 as x, resolveAppTargetPath as xt, enumerateCheckSpaces as y, refuseUnknownInvariants as yt, errorTargetMismatch as z };
4861
4970
 
4862
- //# sourceMappingURL=ref-DlKsxbtg-DlwrVT2q.mjs.map
4971
+ //# sourceMappingURL=ref-CGE8q4jD-DNPh6Yqe.mjs.map