🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@prisma-next/migration-tools

Package Overview
Dependencies
Maintainers
4
Versions
600
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prisma-next/migration-tools - npm Package Compare versions

Comparing version
0.15.0-dev.16
to
0.15.0-dev.22
+123
dist/io-DaQ5HRD7.d.mts
import { n as OnDiskMigrationPackage, t as MigrationOps } from "./package-CCIHXr9Z.mjs";
import { MigrationMetadata, MigrationPackage } from "@prisma-next/framework-components/control";
//#region src/io.d.ts
declare function writeMigrationPackage(dir: string, metadata: MigrationMetadata, ops: MigrationOps): Promise<void>;
/**
* Materialise an in-memory {@link MigrationPackage} to a per-space
* directory on disk.
*
* Writes two files under `<targetDir>/<pkg.dirName>/`:
*
* - `migration.json` — the manifest (pretty-printed, matches
* {@link writeMigrationPackage}'s output for byte-for-byte parity with
* app-space migrations).
* - `ops.json` — the operation list (pretty-printed).
*
* Distinct verb from the lower-level {@link writeMigrationPackage}
* (which takes constituent `(metadata, ops)`): callers reading
* `materialise…` know they are persisting a struct-typed package.
*
* Overwrite-idempotent: the per-package directory is cleared before
* each emit, so re-running against the same `targetDir` produces
* byte-identical contents and never leaves stale files behind. The
* lower-level {@link writeMigrationPackage} stays strict because the
* CLI authoring path (`migration plan` / `migration new`) deliberately
* refuses to clobber an existing authored migration; this helper is
* the re-emit path that is supposed to converge on a single canonical
* on-disk shape.
*
* The per-space head contract lives at
* `<projectMigrationsDir>/<spaceId>/contract.json` (written by
* {@link import('./emit-contract-space-artefacts').emitContractSpaceArtefacts}),
* not inside the per-package directory. The runner reads only
* `migration.json` + `ops.json` from each package.
*/
declare function materialiseMigrationPackage(targetDir: string, pkg: MigrationPackage): Promise<void>;
/**
* Idempotent variant of {@link materialiseMigrationPackage}: writes the
* package only if `<targetDir>/<pkg.dirName>/` does not already exist on
* disk as a directory; returns `{ written: false }` when the package
* directory is present (no rewrite, no comparison — by-existence skip).
*
* Concretely:
* - existing directory → skip silently, return `{ written: false }`.
* - missing path → write three files via {@link materialiseMigrationPackage},
* return `{ written: true }`.
* - path exists but is not a directory (file/symlink) → treated as
* missing; {@link materialiseMigrationPackage} will attempt creation
* and fail with an appropriate OS error.
* - any other I/O error from `stat` → propagated unchanged.
*
* Used by the CLI's `runContractSpaceExtensionMigrationsPass` to
* materialise extension migration packages into a project's
* `migrations/<spaceId>/` directory, and by extension-package tests
* that mirror the same idempotent-rematerialise property locally
* without taking a CLI dependency.
*/
declare function materialiseExtensionMigrationPackageIfMissing(targetDir: string, pkg: MigrationPackage): Promise<{
readonly written: boolean;
}>;
/**
* Copy a list of files into `destDir`, optionally renaming each one.
*
* The destination directory is created (with `recursive: true`) if it
* does not already exist. Each source path is copied byte-for-byte into
* `destDir/<destName>`; missing sources throw `ENOENT`. The helper is
* intentionally generic: callers own the list of files (e.g. a contract
* emitter's emitted output) and the naming convention (e.g. renaming
* the destination contract to `end-contract.*` and the source contract
* to `start-contract.*`).
*/
declare function copyFilesWithRename(destDir: string, files: readonly {
readonly sourcePath: string;
readonly destName: string;
}[]): Promise<void>;
declare function writeMigrationMetadata(dir: string, metadata: MigrationMetadata): Promise<void>;
declare function writeMigrationOps(dir: string, ops: MigrationOps): Promise<void>;
declare function readMigrationPackage(dir: string): Promise<OnDiskMigrationPackage>;
/**
* A per-package load-time problem returned by {@link readMigrationsDir}.
*
* Three variants, matching the relocated throws from the load path:
*
* - `hashMismatch` — stored `migrationHash` differs from the recomputed value.
* The package is **retained** in the returned `packages` array.
* - `providedInvariantsMismatch` — `migration.json` declares different
* `providedInvariants` than `ops.json` implies. The package is **retained**.
* - `packageUnloadable` — the manifest is missing, unparseable, or schema-
* invalid. The package is **omitted** from `packages`.
*
* Callers that need the `spaceId` context (e.g. the aggregate loader) attach
* it when converting to {@link import('./integrity-violation').IntegrityViolation}.
*/
type PackageLoadProblem = {
readonly kind: 'hashMismatch';
readonly dirName: string;
readonly stored: string;
readonly computed: string;
} | {
readonly kind: 'providedInvariantsMismatch';
readonly dirName: string;
} | {
readonly kind: 'packageUnloadable';
readonly dirName: string;
readonly detail: string;
};
/**
* Result returned by {@link readMigrationsDir}.
*
* - `packages` — every package that could be read; hash-mismatched and
* invariants-mismatched packages are included here (the problem is
* represented rather than fatal).
* - `problems` — one entry per package that had a load-time issue.
* `packageUnloadable` entries are **not** in `packages`.
*/
interface ReadMigrationsDirResult {
readonly packages: readonly OnDiskMigrationPackage[];
readonly problems: readonly PackageLoadProblem[];
}
declare function readMigrationsDir(migrationsRoot: string): Promise<ReadMigrationsDirResult>;
declare function formatMigrationDirName(timestamp: Date, slug: string): string;
//#endregion
export { materialiseExtensionMigrationPackageIfMissing as a, readMigrationsDir as c, writeMigrationPackage as d, formatMigrationDirName as i, writeMigrationMetadata as l, ReadMigrationsDirResult as n, materialiseMigrationPackage as o, copyFilesWithRename as r, readMigrationPackage as s, PackageLoadProblem as t, writeMigrationOps as u };
//# sourceMappingURL=io-DaQ5HRD7.d.mts.map
{"version":3,"file":"io-DaQ5HRD7.d.mts","names":[],"sources":["../src/io.ts"],"mappings":";;;iBA0CsB,sBACpB,aACA,UAAU,mBACV,KAAK,eACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgDmB,4BACpB,mBACA,KAAK,mBACJ;;;;;;;;;;;;;;;;;;;;;;iBA2BmB,8CACpB,mBACA,KAAK,mBACJ;WAAmB;;;;;;;;;;;;;iBA6BA,oBACpB,iBACA;WAA2B;WAA6B;MACvD;iBAUmB,uBACpB,aACA,UAAU,oBACT;iBAImB,kBAAkB,aAAa,KAAK,eAAe;iBA8BnD,qBAAqB,cAAc,QAAQ;;;;;;;;;;;;;;;;KA2KrD;WAEG;WACA;WACA;WACA;;WAEA;WAA6C;;WAC7C;WAAoC;WAA0B;;;;;;;;;;;UAW5D;WACN,mBAAmB;WACnB,mBAAmB;;iBASR,kBAAkB,yBAAyB,QAAQ;iBAkEzD,uBAAuB,WAAW,MAAM"}
import { n as OnDiskMigrationPackage } from "./package-CCIHXr9Z.mjs";
import { n as MigrationGraph, t as MigrationEdge } from "./graph-bDjJ4GL9.mjs";
//#region src/migration-graph.d.ts
declare function reconstructGraph(packages: readonly OnDiskMigrationPackage[]): MigrationGraph;
/**
* Find the shortest path from `fromHash` to `toHash` using BFS over the
* contract-hash graph. Returns the ordered list of edges, or null if no path
* exists. Returns an empty array when `fromHash === toHash` (no-op).
*
* Neighbor ordering is deterministic via the tie-break sort key:
* createdAt → to → migrationHash.
*/
declare function findPath(graph: MigrationGraph, fromHash: string, toHash: string): readonly MigrationEdge[] | null;
/**
* Find the shortest path from `fromHash` to `toHash` whose edges collectively
* cover every invariant in `required`. Returns `null` when no such path exists
* (either `fromHash`→`toHash` is structurally unreachable, or every reachable
* path leaves at least one required invariant uncovered). When `required` is
* empty, delegates to `findPath` so the result is byte-identical for that case.
*
* Algorithm: BFS over `(node, coveredSubset)` states with state-level dedup.
* The covered subset is a `Set<string>` of invariant ids; the state's dedup
* key is `${node}\0${[...covered].sort().join('\0')}`. State keys distinguish
* distinct `(node, covered)` tuples regardless of node-name length because
* `\0` cannot appear in any invariant id (validation rejects whitespace and
* control chars at authoring time).
*
* Neighbour ordering when `required ≠ ∅`: edges covering ≥1 still-needed
* invariant come first, with `createdAt → to → migrationHash` as the
* secondary key. The heuristic steers BFS toward the satisfying path;
* correctness (shortest, deterministic) does not depend on it.
*/
declare function findPathWithInvariants(graph: MigrationGraph, fromHash: string, toHash: string, required: ReadonlySet<string>): readonly MigrationEdge[] | null;
interface PathDecision {
readonly selectedPath: readonly MigrationEdge[];
readonly fromHash: string;
readonly toHash: string;
readonly alternativeCount: number;
readonly tieBreakReasons: readonly string[];
readonly refName?: string;
/** The caller-supplied required invariant set, sorted ascending. */
readonly requiredInvariants: readonly string[];
/**
* The subset of `requiredInvariants` actually covered by edges on
* `selectedPath`. Always a subset of `requiredInvariants` (when the path
* is satisfying, equal to it); always derived from `selectedPath`.
*/
readonly satisfiedInvariants: readonly string[];
}
/**
* Outcome of {@link findPathWithDecision}. The pathfinder distinguishes
* three cases up front so callers don't re-derive structural reachability:
*
* - `ok` — a path covering `required` exists; `decision` carries the
* selection metadata and per-edge invariants.
* - `unreachable` — `from`→`to` has no structural path. Mapped by callers
* to the existing no-path / `NO_TARGET` diagnostic.
* - `unsatisfiable` — `from`→`to` is structurally reachable but no path
* covers every required invariant. `structuralPath` is the
* `findPath(graph, from, to)` result, included so callers don't have to
* recompute it when raising `MIGRATION.NO_INVARIANT_PATH`. `missing` is
* the subset of `required` that the structural path does *not* cover —
* correctly accounts for partial coverage when some required invariants
* are met by the fallback path. Only emitted when `required` is
* non-empty.
*/
type FindPathOutcome = {
readonly kind: 'ok';
readonly decision: PathDecision;
} | {
readonly kind: 'unreachable';
} | {
readonly kind: 'unsatisfiable';
readonly structuralPath: readonly MigrationEdge[];
readonly missing: readonly string[];
};
/**
* Routing context for {@link findPathWithDecision}. Both fields are optional;
* `refName` is only used to decorate the resulting `PathDecision` for the
* JSON envelope, and `required` defaults to an empty set (purely structural
* routing). They are passed via a single options object so the call sites
* cannot silently swap two adjacent string parameters.
*/
interface FindPathWithDecisionOptions {
readonly refName?: string;
readonly required?: ReadonlySet<string>;
}
/**
* Find the shortest path from `fromHash` to `toHash` and return structured
* path-decision metadata for machine-readable output. When `required` is
* non-empty, the returned path is the shortest one whose edges collectively
* cover every required invariant.
*
* The discriminated return type tells the caller *why* a path could not be
* found, so the CLI can pick the right structured error without re-running
* a structural BFS.
*/
declare function findPathWithDecision(graph: MigrationGraph, fromHash: string, toHash: string, options?: FindPathWithDecisionOptions): FindPathOutcome;
/**
* Find all branch tips (nodes with no outgoing edges) reachable from
* `fromHash` via forward edges.
*/
declare function findReachableLeaves(graph: MigrationGraph, fromHash: string): readonly string[];
/**
* Find the target contract hash of the migration graph reachable from
* EMPTY_CONTRACT_HASH. Returns `null` for a graph that has no target
* state (either empty, or containing only the root with no outgoing
* edges). Throws NO_INITIAL_MIGRATION if the graph has nodes but none
* originate from the empty hash, and AMBIGUOUS_TARGET if multiple
* branch tips exist.
*/
declare function findLeaf(graph: MigrationGraph): string | null;
/**
* Find the latest migration entry by traversing from EMPTY_CONTRACT_HASH
* to the single target. Returns null for an empty graph.
* Throws AMBIGUOUS_TARGET if the graph has multiple branch tips.
*/
declare function findLatestMigration(graph: MigrationGraph): MigrationEdge | null;
declare function detectCycles(graph: MigrationGraph): readonly string[][];
declare function detectOrphans(graph: MigrationGraph): readonly MigrationEdge[];
//#endregion
export { findLeaf as a, findPathWithInvariants as c, findLatestMigration as i, findReachableLeaves as l, detectCycles as n, findPath as o, detectOrphans as r, findPathWithDecision as s, PathDecision as t, reconstructGraph as u };
//# sourceMappingURL=migration-graph-DGZeXzav.d.mts.map
{"version":3,"file":"migration-graph-DGZeXzav.d.mts","names":[],"sources":["../src/migration-graph.ts"],"mappings":";;;iBAgCgB,iBAAiB,mBAAmB,2BAA2B;;;;;;;;;iBA+D/D,SACd,OAAO,gBACP,kBACA,0BACU;;;;;;;;;;;;;;;;;;;;iBA4CI,uBACd,OAAO,gBACP,kBACA,gBACA,UAAU,+BACA;UAsFK;WACN,uBAAuB;WACvB;WACA;WACA;WACA;WACA;;WAEA;;;;;;WAMA;;;;;;;;;;;;;;;;;;;KAoBC;WACG;WAAqB,UAAU;;WAC/B;;WAEA;WACA,yBAAyB;WACzB;;;;;;;;;UAUE;WACN;WACA,WAAW;;;;;;;;;;;;iBAaN,qBACd,OAAO,gBACP,kBACA,gBACA,UAAS,8BACR;;;;;iBAqLa,oBAAoB,OAAO,gBAAgB;;;;;;;;;iBAkB3C,SAAS,OAAO;;;;;;iBAwChB,oBAAoB,OAAO,iBAAiB;iBAQ5C,aAAa,OAAO;iBA8DpB,cAAc,OAAO,0BAA0B"}
import { MigrationPackage, MigrationPlanOperation } from "@prisma-next/framework-components/control";
//#region src/package.d.ts
type MigrationOps = readonly MigrationPlanOperation[];
/**
* Augmented form of the canonical {@link MigrationPackage} returned by
* the on-disk readers (`readMigrationPackage`, `readMigrationsDir`).
* Adds `dirPath` — the absolute path the package was loaded from — so
* downstream diagnostics can point operators at a concrete directory.
*
* Holding an `OnDiskMigrationPackage` value implies the loader verified
* the package's integrity (hash recomputation against the stored
* `migrationHash`); the canonical structural shape carries no such
* guarantee on its own.
*/
interface OnDiskMigrationPackage extends MigrationPackage {
readonly dirPath: string;
}
//#endregion
export { OnDiskMigrationPackage as n, MigrationOps as t };
//# sourceMappingURL=package-CCIHXr9Z.d.mts.map
{"version":3,"file":"package-CCIHXr9Z.d.mts","names":[],"sources":["../src/package.ts"],"mappings":";;KAKY,wBAAwB;;;;;;;;;;;;UAanB,+BAA+B;WACrC"}
+3
-4

@@ -1,7 +0,7 @@

import { n as OnDiskMigrationPackage } from "../package-CWicKzNs.mjs";
import { n as OnDiskMigrationPackage } from "../package-CCIHXr9Z.mjs";
import { i as Refs, r as RefLoadProblem } from "../refs-BNCUu58Y.mjs";
import { t as ContractSpaceHeadRecord } from "../verify-contract-spaces-zYlAhXOK.mjs";
import { n as MigrationGraph } from "../graph-bDjJ4GL9.mjs";
import { t as PackageLoadProblem } from "../io-q04IrTcd.mjs";
import { t as PathDecision } from "../migration-graph-BJpeTOuY.mjs";
import { t as PackageLoadProblem } from "../io-DaQ5HRD7.mjs";
import { t as PathDecision } from "../migration-graph-DGZeXzav.mjs";
import { Result } from "@prisma-next/utils/result";

@@ -11,3 +11,2 @@ import { ControlAdapterInstance, ControlFamilyInstance, DiffSubjectGranularity, MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlannerConflict, SchemaDiffIssue, SchemaEntityCoordinate, SchemaOwnership, TargetMigrationsCapability, VerifyDatabaseSchemaResult } from "@prisma-next/framework-components/control";

import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
//#region src/integrity-violation.d.ts

@@ -14,0 +13,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"aggregate.d.mts","names":[],"sources":["../../src/integrity-violation.ts","../../src/aggregate/types.ts","../../src/aggregate/aggregate.ts","../../src/aggregate/all-external.ts","../../src/aggregate/check-integrity.ts","../../src/aggregate/marker-types.ts","../../src/aggregate/planner-types.ts","../../src/aggregate/fabricated-migration-edge.ts","../../src/aggregate/loader.ts","../../src/aggregate/planner.ts","../../src/aggregate/strategies/resolve-recorded-path.ts","../../src/aggregate/unclaimed-elements.ts","../../src/aggregate/verifier.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkBA;;;;;;KAAY,kBAAA;EAAA,SAGG,IAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;EAAA,SACA,IAAA;AAAA;EAAA,SAGA,IAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;EAAA,SACA,MAAA;EAAA,SACA,QAAA;AAAA;EAAA,SAGA,IAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;AAAA;EAAA,SAEA,IAAA;EAAA,SAAiC,OAAA;AAAA;EAAA,SACjC,IAAA;EAAA,SAAoC,OAAA;EAAA,SAA0B,IAAA;AAAA;EAAA,SAE9D,IAAA;EAAA,SACA,OAAA;EAAA,SACA,aAAA;EAAA,SACA,QAAA;AAAA;EAAA,SAGA,IAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;EAAA,SACA,MAAA;AAAA;EAAA,SAGA,IAAA;EAAA,SAAiC,OAAA;AAAA;EAAA,SACjC,IAAA;EAAA,SAAwC,OAAA;AAAA;EAAA,SAExC,IAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;EAAA,SACA,MAAA;AAAA;EAAA,SAGA,IAAA;EAAA,SACA,OAAA;EAAA,SACA,SAAA;AAAA;EAAA,SAEA,IAAA;EAAA,SAAqC,OAAA;EAAA,SAA0B,MAAA;AAAA;EAAA,SAG/D,IAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;EAAA,SACA,MAAA;AAAA;;;;AC7Df;;;;AACkB;AAGlB;;;;UDwEiB,sBAAA;EAAA,SACN,EAAA;EAAA,SACA,QAAQ;AAAA;;;;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SACA,IAAA;EZNI;;;;;;;EAAA,SYcJ,oBAAA,GACP,MAAA,WACA,KAAA,EAAO,sBAAA,EACP,IAAA,2BACG,0BAAA;EZRQ;;;;;;;EAAA,SYgBJ,0BAAA,GAA6B,uBAAA;EZRqC;;;;;;;EAAA,SYgBlE,kBAAA,GAAqB,0BAAA;AAAA;;;;;;;KASpB,iBAAA;EAAA,SACG,IAAA;AAAA;EAAA,SACA,IAAA;AAAA;EAAA,SAEA,IAAA;EAAA,SACA,UAAA;EAAA,SACA,QAAA;AAAA;EAAA,SAEA,IAAA;EAAA,SAAoC,OAAA;AAAA;AAAA,UAElC,kBAAA;EAAA,SACN,QAAA,EAAU,WAAA,SAAoB,iBAAA;EAAA,SAC9B,aAAA;IAAA,SACE,OAAA;IAAA,SACA,GAAA,EAAK,wBAAA;EAAA;AAAA;AAAA,UAID,kBAAA;EZmBqB;;;;;;EAAA,SYZ3B,QAAA,EAAU,WAAW,SAAS,0BAAA;EZuBhB;;;;ACrGzB;;;EDqGyB,SYfd,SAAA;AAAA;AAAA,UAGM,eAAA;EAAA,SACN,WAAA,EAAa,kBAAA;EAAA,SACb,WAAA,EAAa,kBAAkB;AAAA;AAAA,KAG9B,aAAA;EAAA,SACD,IAAA;EAAA,SACA,MAAM;AAAA;AAAA,KAGL,cAAA,GAAiB,MAAA,CAAO,eAAA,EAAiB,aAAA;;;;;;;;;;AXjFpB;AAuCjC;;;;;;;;;;;;;;iBWoEgB,eAAA,CAAgB,KAAA,EAAO,aAAA,GAAgB,cAAc"}
{"version":3,"file":"aggregate.d.mts","names":[],"sources":["../../src/integrity-violation.ts","../../src/aggregate/types.ts","../../src/aggregate/aggregate.ts","../../src/aggregate/all-external.ts","../../src/aggregate/check-integrity.ts","../../src/aggregate/marker-types.ts","../../src/aggregate/planner-types.ts","../../src/aggregate/fabricated-migration-edge.ts","../../src/aggregate/loader.ts","../../src/aggregate/planner.ts","../../src/aggregate/strategies/resolve-recorded-path.ts","../../src/aggregate/unclaimed-el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ACN;WACA,OAAO;WACP,eAAe;;;;;;;WAOf;;;;;;;;;;;;;;;;;iBAkBK,oBAAoB,OAAO,4BAA4B;;;;;;;;;;KCnC3D,2BACV,OAAO,oBACJ;;;;;;;;KASO,8BAA8B,OAAO;;;;;;;;;UCJhC;WACN,WAAW;WACX,kBAAkB,oBAAoB;WACtC;WACA;;;;;;;;WAQA,uBACP,iBACA,OAAO,wBACP,+BACG;;;;;;;;WAQI,6BAA6B;;;;;;;;WAQ7B,qBAAqB;;;;;;;;KASpB;WACG;;WACA;;WAEA;WACA;WACA;;WAEA;WAAoC;;UAElC;WACN,UAAU,oBAAoB;WAC9B;aACE;aACA,KAAK;;;UAID;;;;;;;WAON,UAAU,oBAAoB;;;;;;;;WAQ9B;;UAGM;WACN,aAAa;WACb,aAAa;;KAGZ;WACD;WACA;;KAGC,iBAAiB,OAAO,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BrC,gBAAgB,OAAO,gBAAgB"}

@@ -1,1 +0,1 @@

{"version":3,"file":"constants.d.mts","names":[],"sources":["../../src/constants.ts"],"mappings":";;AAIA;;;cAAa,mBAAA"}
{"version":3,"file":"constants.d.mts","names":[],"sources":["../../src/constants.ts"],"mappings":";;;;;cAIa"}

@@ -1,1 +0,1 @@

{"version":3,"file":"errors.d.mts","names":[],"sources":["../../src/errors.ts"],"mappings":";AAoCA;;;;;;;;;;;;;;;;AAAA,cAAa,mBAAA,SAA4B,KAAA;EAAA,SAC9B,IAAA;EAAA,SACA,QAAA;EAAA,SACA,GAAA;EAAA,SACA,GAAA;EAAA,SACA,OAAA,EAAS,MAAA;cAGhB,IAAA,UACA,OAAA,UACA,OAAA;IAAA,SACW,GAAA;IAAA,SACA,GAAA;IAAA,SACA,OAAA,GAAU,MAAA;EAAA;EAAA,OAWhB,EAAA,CAAG,KAAA,YAAiB,KAAA,IAAS,mBAAA;AAAA;AAAA,iBA0BtB,gBAAA,CAAiB,QAAA,UAAkB,UAAA,WAAqB,mBAAmB;AAAA,iBAwD3E,+BAAA,CAAgC,IAAA;EAAA,SACrC,WAAA;EAAA,SACA,cAAA;EAAA,SACA,WAAA;AAAA,IACP,mBAAmB;;;;;;;;;AAqMA;AAqBvB;;UAlCiB,6BAAA;EAAA,SACN,OAAA;EAAA,SACA,aAAA;EAAA,SACA,IAAA;EAAA,SACA,EAAA;EAAA,SACA,UAAA;AAAA;AAAA,iBAGK,oBAAA,CAAqB,IAAA;EAAA,SAC1B,OAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA;EAAA,SACA,cAAA,WAAyB,6BAAA;AAAA,IAChC,mBAAmB;AAAA,iBAqBP,qBAAA,CAAsB,IAAA;EAAA,SAC3B,OAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;AAAA,IACP,mBAAmB"}
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../src/errors.ts"],"mappings":";;;;;;;;;;;;;;;;;cAoCa,4BAA4B;WAC9B;WACA;WACA;WACA;WACA,SAAS;cAGhB,cACA,iBACA;aACW;aACA;aACA,UAAU;;SAWhB,GAAG,iBAAiB,SAAS;;iBA0BtB,iBAAiB,kBAAkB,qBAAqB;iBAwDxD,gCAAgC;WACrC;WACA;WACA;IACP;;;;;;;;;;;;UAwLa;WACN;WACA;WACA;WACA;WACA;;iBAGK,qBAAqB;WAC1B;WACA;WACA;WACA,yBAAyB;IAChC;iBAqBY,sBAAsB;WAC3B;WACA;WACA;IACP"}

@@ -1,4 +0,3 @@

import { n as OnDiskMigrationPackage, t as MigrationOps } from "../package-CWicKzNs.mjs";
import { n as OnDiskMigrationPackage, t as MigrationOps } from "../package-CCIHXr9Z.mjs";
import { t as MigrationMetadata } from "../metadata-DtStFLKa.mjs";
//#region src/hash.d.ts

@@ -5,0 +4,0 @@ interface VerifyResult {

@@ -1,1 +0,1 @@

{"version":3,"file":"hash.d.mts","names":[],"sources":["../../src/hash.ts"],"mappings":";;;;UAKiB,YAAA;EAAA,SACN,EAAA;EAAA,SACA,MAAA;EAAA,SACA,UAAA;EAAA,SACA,YAAA;AAAA;;;;;;AAAY;AAkCvB;;;;;;;;;;;;;;;AAEmB;AAsBnB;;;;;iBAxBgB,oBAAA,CACd,QAAA,EAAU,IAAA,CAAK,iBAAA;EAAA,SAAiD,aAAA;AAAA,GAChE,GAAA,EAAK,YAAA;AAsBuE;;;;;;;;;AAAA,iBAA9D,mBAAA,CAAoB,GAAA,EAAK,sBAAA,GAAyB,YAAY"}
{"version":3,"file":"hash.d.mts","names":[],"sources":["../../src/hash.ts"],"mappings":";;;UAKiB;WACN;WACA;WACA;WACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCK,qBACd,UAAU,KAAK;WAAiD;GAChE,KAAK;;;;;;;;;;iBAsBS,oBAAoB,KAAK,yBAAyB"}

@@ -1,3 +0,2 @@

import { t as MigrationOps } from "../package-CWicKzNs.mjs";
import { t as MigrationOps } from "../package-CCIHXr9Z.mjs";
//#region src/invariants.d.ts

@@ -4,0 +3,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"invariants.d.mts","names":[],"sources":["../../src/invariants.ts"],"mappings":";;;;;AAUA;;;;iBAAgB,mBAAA,CAAoB,WAAmB;AA8BvD;;;;AAA0D;;;;;;;;;;;;;;;;;;;;;AAA1D,iBAAgB,wBAAA,CAAyB,GAAiB,EAAZ,YAAY"}
{"version":3,"file":"invariants.d.mts","names":[],"sources":["../../src/invariants.ts"],"mappings":";;;;;;;;iBAUgB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BpB,yBAAyB,KAAK"}

@@ -1,2 +0,2 @@

import { a as materialiseExtensionMigrationPackageIfMissing, c as readMigrationsDir, d as writeMigrationPackage, i as formatMigrationDirName, l as writeMigrationMetadata, n as ReadMigrationsDirResult, o as materialiseMigrationPackage, r as copyFilesWithRename, s as readMigrationPackage, t as PackageLoadProblem, u as writeMigrationOps } from "../io-q04IrTcd.mjs";
import { a as materialiseExtensionMigrationPackageIfMissing, c as readMigrationsDir, d as writeMigrationPackage, i as formatMigrationDirName, l as writeMigrationMetadata, n as ReadMigrationsDirResult, o as materialiseMigrationPackage, r as copyFilesWithRename, s as readMigrationPackage, t as PackageLoadProblem, u as writeMigrationOps } from "../io-DaQ5HRD7.mjs";
export { type PackageLoadProblem, type ReadMigrationsDirResult, copyFilesWithRename, formatMigrationDirName, materialiseExtensionMigrationPackageIfMissing, materialiseMigrationPackage, readMigrationPackage, readMigrationsDir, writeMigrationMetadata, writeMigrationOps, writeMigrationPackage };

@@ -1,1 +0,1 @@

{"version":3,"file":"ledger-origin.d.mts","names":[],"sources":["../../src/ledger-origin.ts"],"mappings":";iBAEgB,sBAAA,CAAuB,cAA6B"}
{"version":3,"file":"ledger-origin.d.mts","names":[],"sources":["../../src/ledger-origin.ts"],"mappings":";iBAEgB,uBAAuB"}
import { n as MigrationGraph } from "../graph-bDjJ4GL9.mjs";
import { a as findLeaf, c as findPathWithInvariants, i as findLatestMigration, l as findReachableLeaves, n as detectCycles, o as findPath, r as detectOrphans, s as findPathWithDecision, t as PathDecision, u as reconstructGraph } from "../migration-graph-BJpeTOuY.mjs";
import { a as findLeaf, c as findPathWithInvariants, i as findLatestMigration, l as findReachableLeaves, n as detectCycles, o as findPath, r as detectOrphans, s as findPathWithDecision, t as PathDecision, u as reconstructGraph } from "../migration-graph-DGZeXzav.mjs";
//#region src/graph-membership.d.ts

@@ -5,0 +4,0 @@ declare function isGraphNode(hash: string, graph: MigrationGraph): boolean;

@@ -1,1 +0,1 @@

{"version":3,"file":"migration-graph.d.mts","names":[],"sources":["../../src/graph-membership.ts"],"mappings":";;;;iBAIgB,WAAA,CAAY,IAAA,UAAc,KAAA,EAAO,cAAc;AAAA,iBAO/C,qBAAA,CAAsB,IAAA,UAAc,KAAA,EAAO,cAAc,WAAW,IAAA"}
{"version":3,"file":"migration-graph.d.mts","names":[],"sources":["../../src/graph-membership.ts"],"mappings":";;;iBAIgB,YAAY,cAAc,OAAO;iBAOjC,sBAAsB,cAAc,OAAO,yBAAyB"}

@@ -1,1 +0,1 @@

{"version":3,"file":"migration-ts.d.mts","names":[],"sources":["../../src/migration-ts.ts","../../src/runtime-detection.ts"],"mappings":";;AA8BA;;;;;;;;AAAoF;AAsBpF;;;;AAAiE;;;;ACpDjE;;;;AAA2B;iBD8BL,gBAAA,CAAiB,UAAA,UAAoB,OAAA,WAAkB,OAAO;;;;iBAsB9D,cAAA,CAAe,UAAA,WAAqB,OAAO;;;KCpDrD,eAAA;AAAA,iBAEI,qBAAA,IAAyB,eAAe;AAAA,iBAMxC,cAAA,CAAe,OAAwB,EAAf,eAAe"}
{"version":3,"file":"migration-ts.d.mts","names":[],"sources":["../../src/migration-ts.ts","../../src/runtime-detection.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;iBA8BsB,iBAAiB,oBAAoB,kBAAkB;;;;iBAsBvD,eAAe,qBAAqB;;;KCpD9C;iBAEI,yBAAyB;iBAMzB,eAAe,SAAS"}
import { t as MigrationMetadata$1 } from "../metadata-DtStFLKa.mjs";
import { ControlStack, MigrationPlan, MigrationPlanOperation } from "@prisma-next/framework-components/control";
import { Contract } from "@prisma-next/contract/types";
//#region src/migration-base.d.ts

@@ -6,0 +5,0 @@ interface MigrationMeta {

@@ -1,1 +0,1 @@

{"version":3,"file":"migration.d.mts","names":[],"sources":["../../src/migration-base.ts"],"mappings":";;;;;UAgBiB,aAAA;EAAA,SACN,IAAA;EAAA,SACA,EAAE;AAAA;;;AAAA;AAiCb;;;;;;;;;;;;;;;;;uBAAsB,SAAA,qBACA,sBAAA,GAAyB,sBAAA,uFAG9B,QAAA,GAAW,QAAA,eACb,QAAA,GAAW,QAAA,aACb,aAAA;EAAA,kBAEO,QAAA;EAFP;;;;;;;;;;;;EAAA,SAgBF,eAAA;IAAA,SAA6B,OAAA;MAAA,SAAoB,WAAA;IAAA;EAAA;EAApB;;;;;;EAAA,SAQ7B,iBAAA;IAAA,SAA+B,OAAA;MAAA,SAAoB,WAAA;IAAA;EAAA;EAa3B;;;;;;;;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;;;;EAWtE,YAAY;MAaR;aAAqB;;MAKrB;aAA0B;;;;;;;;;;;;;;;;cAkBnB,uBAAuB;;mBAKf;mBACA;mBACA;cAFA,WAAW,WACX,mBACA,WAAW,kBAAkB;MAG5C,eAAe;MAWf,iBAAiB;;;;;;;;;iBAgBP,mBAAmB;;;;;;;;;;;;UAsBlB;WACN;WACA,UAAU;WACV;;;;;;;;;;;iBA4CW,wBACpB,UAAU,WACV,UAAU,QAAQ,8BACjB,QAAQ"}

@@ -1,3 +0,3 @@

import { n as OnDiskMigrationPackage, t as MigrationOps } from "../package-CWicKzNs.mjs";
import { n as OnDiskMigrationPackage, t as MigrationOps } from "../package-CCIHXr9Z.mjs";
import { MigrationPackage } from "@prisma-next/framework-components/control";
export type { MigrationOps, MigrationPackage, OnDiskMigrationPackage };
import { i as Refs } from "../refs-BNCUu58Y.mjs";
import { n as MigrationGraph, t as MigrationEdge } from "../graph-bDjJ4GL9.mjs";
import { Result } from "@prisma-next/utils/result";
//#region src/refs/types.d.ts

@@ -29,3 +28,3 @@ /** Context required to resolve a contract or migration reference. */

readonly dirName: string;
}
} |
/**

@@ -35,5 +34,5 @@ * Resolved from the `@contract` reserved token — the hash of the on-disk

*/
| {
{
readonly kind: 'reserved-contract';
}
} |
/**

@@ -45,3 +44,3 @@ * Resolved from the `@db` reserved token — the live database marker.

*/
| {
{
readonly kind: 'reserved-db';

@@ -48,0 +47,0 @@ };

@@ -1,1 +0,1 @@

{"version":3,"file":"ref-resolution.d.mts","names":[],"sources":["../../src/refs/types.ts","../../src/refs/contract-ref.ts","../../src/refs/migration-ref.ts"],"mappings":";;;;;;UAIiB,oBAAA;EAAA,SACN,KAAA,EAAO,cAAA;EAAA,SACP,IAAA,EAAM,IAAI;EAFgB;;;;;EAAA,SAQ1B,YAAA;AAAA;AAAA,KAGC,qBAAA;EAAA,SACG,IAAA;EAAA,SAAuB,KAAA;AAAA;EAAA,SACvB,IAAA;EAAA,SAAsB,OAAA;AAAA;EAAA,SACtB,IAAA;EAAA,SAA+B,OAAA;AAAA;EAAA,SAC/B,IAAA;EAAA,SAAiC,OAAA;AAAA;;;;;;WAKjC,IAAA;AAAA;;;;;;;;WAOA,IAAA;AAAA;;UAGE,WAAA;EAAA,SACN,IAAA;EAAA,SACA,UAAA,EAAY,qBAAqB;AAAA;AAAA,KAGhC,sBAAA;EAAA,SACG,IAAA;EAAA,SAA2B,OAAA;AAAA;EAAA,SAC3B,IAAA;EAAA,SAAuB,KAAA;AAAA;;UAGrB,YAAA;EAAA,SACN,OAAA;EAAA,SACA,aAAA;EAAA,SACA,IAAA;EAAA,SACA,EAAA;EAAA,SACA,UAAA,EAAY,sBAAsB;AAAA;AAAA,UAG5B,qBAAA;EAAA,SACN,IAAA;EAAA,SACA,KAAA;EAAA,SACA,OAAA;AAAA;AAAA,UAGM,sBAAA;EAAA,SACN,IAAA;EAAA,SACA,KAAA;EAAA,SACA,UAAA;EAAA,SACA,OAAA;AAAA;AAAA,UAGM,yBAAA;EAAA,SACN,IAAA;EAAA,SACA,KAAA;EAAA,SACA,eAAA;EAAA,SACA,OAAA;EAAA,SACA,GAAA;AAAA;AAAA,UAGM,0BAAA;EAAA,SACN,IAAA;EAAA,SACA,KAAA;EAAA,SACA,MAAA;AAAA;AAAA,KAGC,kBAAA,GACR,qBAAA,GACA,sBAAA,GACA,yBAAA,GACA,0BAAA;AAAA,iBAiBY,iBAAA,CACd,KAAA,EAAO,cAAA,EACP,OAAA,WACC,aAAa;;;;;;AAnGhB;;;;;;;;;;AAQuB;AAGvB;;iBCYgB,gBAAA,CACd,KAAA,UACA,GAAA,EAAK,oBAAA,GACJ,MAAA,CAAO,WAAA,EAAa,kBAAA;;;;;;AD1BvB;;;;;;;;;iBEcgB,iBAAA,CACd,KAAA,UACA,GAAA,EAAK,oBAAA,GACJ,MAAA,CAAO,YAAA,EAAc,kBAAA"}
{"version":3,"file":"ref-resolution.d.mts","names":[],"sources":["../../src/refs/types.ts","../../src/refs/contract-ref.ts","../../src/refs/migration-ref.ts"],"mappings":";;;;;UAIiB;WACN,OAAO;WACP,MAAM;;;;;;WAMN;;KAGC;WACG;WAAuB;;WACvB;WAAsB;;WACtB;WAA+B;;WAC/B;WAAiC;;;;;;;WAKjC;;;;;;;;;WAOA;;;UAGE;WACN;WACA,YAAY;;KAGX;WACG;WAA2B;;WAC3B;WAAuB;;;UAGrB;WACN;WACA;WACA;WACA;WACA,YAAY;;UAGN;WACN;WACA;WACA;;UAGM;WACN;WACA;WACA;WACA;;UAGM;WACN;WACA;WACA;WACA;WACA;;UAGM;WACN;WACA;WACA;;KAGC,qBACR,wBACA,yBACA,4BACA;iBAiBY,kBACd,OAAO,gBACP,kBACC;;;;;;;;;;;;;;;;;;;iBC5Ea,iBACd,eACA,KAAK,uBACJ,OAAO,aAAa;;;;;;;;;;;;;;;iBCZP,kBACd,eACA,KAAK,uBACJ,OAAO,cAAc"}
import { a as deleteRef, c as refsByContractHash, d as validateRefName, f as validateRefValue, i as Refs, l as resolveRef, n as RefEntry, o as readRef, p as writeRef, s as readRefs, t as HEAD_REF_NAME, u as resolveRefsByContractHash } from "../refs-BNCUu58Y.mjs";
//#region src/refs/snapshot.d.ts

@@ -4,0 +3,0 @@ interface ContractIR {

@@ -1,1 +0,1 @@

{"version":3,"file":"refs.d.mts","names":[],"sources":["../../src/refs/snapshot.ts"],"mappings":";;;UAQiB,UAAA;EAAA,SACN,QAAA;EAAA,SACA,WAAW;AAAA;AAAA,iBAkEA,gBAAA,CACpB,OAAA,UACA,IAAA,UACA,QAAA,EAAU,UAAA,GACT,OAAO;AAAA,iBA4BY,eAAA,CAAgB,OAAA,UAAiB,IAAA,WAAe,OAAO,CAAC,UAAA;AAAA,iBAiCxD,iBAAA,CAAkB,OAAA,UAAiB,IAAA,WAAe,OAAO;AAAA,iBASzD,cAAA,CACpB,OAAA,UACA,IAAA,UACA,KAAA,EAAO,QAAA,EACP,QAAA,EAAU,UAAA,GACT,OAAA;AAAA,iBA4BmB,eAAA,CAAgB,OAAA,UAAiB,IAAA,WAAe,OAAO"}
{"version":3,"file":"refs.d.mts","names":[],"sources":["../../src/refs/snapshot.ts"],"mappings":";;UAQiB;WACN;WACA;;iBAkEW,iBACpB,iBACA,cACA,UAAU,aACT;iBA4BmB,gBAAgB,iBAAiB,eAAe,QAAQ;iBAiCxD,kBAAkB,iBAAiB,eAAe;iBASlD,eACpB,iBACA,cACA,OAAO,UACP,UAAU,aACT;iBA4BmB,gBAAgB,iBAAiB,eAAe"}

@@ -1,2 +0,2 @@

import { t as MigrationOps } from "../package-CWicKzNs.mjs";
import { t as MigrationOps } from "../package-CCIHXr9Z.mjs";
import { a as VerifyContractSpacesResult, i as VerifyContractSpacesInputs, n as SpaceMarkerRecord, o as listContractSpaceDirectories, r as SpaceVerifierViolation, s as verifyContractSpaces, t as ContractSpaceHeadRecord } from "../verify-contract-spaces-zYlAhXOK.mjs";

@@ -6,3 +6,2 @@ import { PreserveEmptyPredicate, StorageSort } from "@prisma-next/contract/hashing";

import { Contract } from "@prisma-next/contract/types";
//#region src/assert-descriptor-self-consistency.d.ts

@@ -9,0 +8,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"spaces.d.mts","names":[],"sources":["../../src/assert-descriptor-self-consistency.ts","../../src/read-contract-space-head-ref.ts","../../src/compute-extension-space-apply-path.ts","../../src/concatenate-space-apply-inputs.ts","../../src/contract-space-from-json.ts","../../src/emit-contract-space-artefacts.ts","../../src/gather-disk-contract-space-state.ts","../../src/plan-all-spaces.ts","../../src/read-contract-space-contract.ts","../../src/space-layout.ts"],"mappings":";;;;;;;;;;;;;UAWiB,+BAAA;EAAA,SACN,WAAA;EAAA,SACA,MAAA;EAAA,SACA,YAAA;EAFA;;;;;;;EAAA,SAUA,OAAA;EAAA,SACA,WAAA;EAAA,SACA,mBAAA,GAAsB,sBAAA;EAAA,SACtB,WAAA,GAAc,WAAW;AAAA;;;;AAsBmD;;;;ACtBvF;;;;;;;;;AAG+B;;;iBDmBf,+BAAA,CAAgC,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;cQgCa,kBAAA;;;;AR7BkB;;;;ACZ/B;cOmDa,2BAAA,EAA6B,WAAW;;;;;;;iBAQrC,kBAAA,CAAmB,kBAA0B"}
{"version":3,"file":"spaces.d.mts","names":[],"sources":["../../src/assert-descriptor-self-consistency.ts","../../src/read-contract-space-head-ref.ts","../../src/compute-extension-space-apply-path.ts","../../src/concatenate-space-apply-inputs.ts","../../src/contract-space-from-json.ts","../../src/emit-contract-space-artefacts.ts","../../src/gather-disk-contract-space-state.ts","../../src/plan-all-spaces.ts","../../src/read-contract-space-contract.ts","../../src/space-layout.ts"],"mappings":";;;;;;;;;;;;UAWiB;WACN;WACA;WACA;;;;;;;;WAQA;WACA;WACA,sBAAsB;WACtB,cAAc;;;;;;;;;;;;;;;;;;;;;iBAsBT,gCAAgC,QAAQ;;;;;;;;;;;;;;;;iBCtBlC,yBACpB,8BACA,kBACC,QAAQ;;;;;;;;;KCZC;WAEG;WACA,sBAAsB;;;;;;WAMtB;;;;;WAKA,SAAS;;;;;;WAMT;;WAEA;WAA8B,sBAAsB;;WAEpD;WACA,sBAAsB;WACtB;WACA;aAAoC;aAA0B;;;WAE9D;;;;;;;;;;;;;UAaE;WACN;WACA;WACA;WACA;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BW,+BACpB,QAAQ,uCACP,QAAQ;;;;;;;;;;;;;;;;;;;;;;;UCnEM,gBAAgB;WACtB;WACA;WACA;WACA;WACA,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCUV,sBAAsB,kBAAkB,WAAW,UAAU;WAClE;WACA,YAAY;aACV;aACA;aACA;;WAEF,SAAS;IAChB,cAAc;;;;;;;;;;;;;;;;;;;;;;;UCpBD;WACN;WACA;WACA,SAAS;;;;;;;;;;;;;;;;;;;;iBAqBE,2BACpB,8BACA,iBACA,QAAQ,8BACP;;;;;;;;;UCzCc;;WAEN;;WAEA,iBAAiB,oBAAoB;;;;;;;;;;;;;;;;;;;;iBAqB1B,6BAA6B;WACxC;;;;;;WAMA,gBAAgB;IACvB,QAAQ;;;;;;;;;;;;;;;;UC/BK,eAAe;WACrB;WACA,eAAe;WACf,aAAa;;UAGP,gBAAgB;WACtB;WACA,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BvB,cAAc,WAAW,UACvC,iBAAiB,eAAe,cAChC,YAAY,OAAO,eAAe,wBAAwB,sBAChD,gBAAgB;;;;;;;;;;;;;;iBCpCN,0BACpB,8BACA,kBACC;;;;;;;;;;KCVS;WAAmC;;iBAS/B,eAAe,kBAAkB,WAAW;iBAI5C,mBAAmB,0BAA0B,WAAW;;;;;;;;;;;;;iBAkBxD,wBAAwB,8BAA8B;;;;;;;;;cAazD;;;;;;;;;cAUA,6BAA6B;;;;;;;iBAQ1B,mBAAmB"}

@@ -1,1 +0,1 @@

{"version":3,"file":"graph-bDjJ4GL9.d.mts","names":[],"sources":["../src/graph.ts"],"mappings":";;AAIA;;;UAAiB,aAAA;EAAA,SACN,IAAA;EAAA,SACA,EAAA;EAAA,SACA,aAAA;EAAA,SACA,OAAA;EAAA,SACA,SAAA;EAMA;;AAAU;AAGrB;;EAHW,SAAA,UAAA;AAAA;AAAA,UAGM,cAAA;EAAA,SACN,KAAA,EAAO,WAAA;EAAA,SACP,YAAA,EAAc,WAAA,kBAA6B,aAAA;EAAA,SAC3C,YAAA,EAAc,WAAA,kBAA6B,aAAA;EAAA,SAC3C,eAAA,EAAiB,WAAA,SAAoB,aAAA;AAAA"}
{"version":3,"file":"graph-bDjJ4GL9.d.mts","names":[],"sources":["../src/graph.ts"],"mappings":";;;;;UAIiB;WACN;WACA;WACA;WACA;WACA;;;;;;WAMA;;UAGM;WACN,OAAO;WACP,cAAc,6BAA6B;WAC3C,cAAc,6BAA6B;WAC3C,iBAAiB,oBAAoB"}

@@ -1,1 +0,1 @@

{"version":3,"file":"refs-BNCUu58Y.d.mts","names":[],"sources":["../src/refs.ts"],"mappings":";UAUiB,QAAA;EAAA,SACN,IAAA;EAAA,SACA,UAAU;AAAA;AAAA,KAGT,IAAA,GAAO,QAAA,CAAS,MAAA,SAAe,QAAA;AAHtB;AAGrB;;;;AAHqB,cAUR,aAAA;;;;;;;UAQI,cAAA;EAAA,SACN,OAAA;EAAA,SACA,MAAM;AAAA;AAAA,iBAWD,eAAA,CAAgB,IAAY;AAAA,iBAQ5B,gBAAA,CAAiB,KAAa;AAAA,iBAsBxB,OAAA,CAAQ,OAAA,UAAiB,IAAA,WAAe,OAAO,CAAC,QAAA;AAAA,iBAmChD,QAAA,CAAS,OAAA,WAAkB,OAAO,CAAC,IAAA;AAAA,iBA4HnC,QAAA,CAAS,OAAA,UAAiB,IAAA,UAAc,KAAA,EAAO,QAAA,GAAW,OAAO;AAAA,iBAoBjE,SAAA,CAAU,OAAA,UAAiB,IAAA,WAAe,OAAO;;;;AAnLO;iBA6N9D,kBAAA,CAAmB,IAAA,EAAM,IAAA,GAAO,WAAW;;;;;iBAiBrC,yBAAA,CACpB,OAAA,WACC,OAAO,CAAC,WAAA;AAAA,iBAIK,UAAA,CAAW,IAAA,EAAM,IAAA,EAAM,IAAA,WAAe,QAAQ"}
{"version":3,"file":"refs-BNCUu58Y.d.mts","names":[],"sources":["../src/refs.ts"],"mappings":";UAUiB;WACN;WACA;;KAGC,OAAO,SAAS,eAAe;;;;;;cAO9B;;;;;;;UAQI;WACN;WACA;;iBAWK,gBAAgB;iBAQhB,iBAAiB;iBAsBX,QAAQ,iBAAiB,eAAe,QAAQ;iBAmChD,SAAS,kBAAkB,QAAQ;iBA4HnC,SAAS,iBAAiB,cAAc,OAAO,WAAW;iBAoB1D,UAAU,iBAAiB,eAAe;;;;;iBA0ChD,mBAAmB,MAAM,OAAO;;;;;iBAiB1B,0BACpB,kBACC,QAAQ;iBAIK,WAAW,MAAM,MAAM,eAAe"}

@@ -1,1 +0,1 @@

{"version":3,"file":"verify-contract-spaces-zYlAhXOK.d.mts","names":[],"sources":["../src/verify-contract-spaces.ts"],"mappings":";;AAyBA;;;;AAEU;AA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AAiB,oBAAoB;;;;;WAMrC,mBAAmB,oBAAoB;;KAGtC;WAEG;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;WACA;WACA;;WAGA;WACA;WACA;WACA;WACA;;KAGH;WACG;;WACA;WAAoB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCxC,qBACd,QAAQ,6BACP"}
{
"name": "@prisma-next/migration-tools",
"version": "0.15.0-dev.16",
"version": "0.15.0-dev.22",
"license": "Apache-2.0",

@@ -9,14 +9,14 @@ "type": "module",

"dependencies": {
"@prisma-next/contract": "0.15.0-dev.16",
"@prisma-next/framework-components": "0.15.0-dev.16",
"@prisma-next/utils": "0.15.0-dev.16",
"@prisma-next/contract": "0.15.0-dev.22",
"@prisma-next/framework-components": "0.15.0-dev.22",
"@prisma-next/utils": "0.15.0-dev.22",
"arktype": "^2.2.2",
"pathe": "^2.0.3",
"prettier": "^3.9.4"
"prettier": "^3.9.5"
},
"devDependencies": {
"@prisma-next/test-utils": "0.15.0-dev.16",
"@prisma-next/tsconfig": "0.15.0-dev.16",
"@prisma-next/tsdown": "0.15.0-dev.16",
"tsdown": "0.22.3",
"@prisma-next/test-utils": "0.15.0-dev.22",
"@prisma-next/tsconfig": "0.15.0-dev.22",
"@prisma-next/tsdown": "0.15.0-dev.22",
"tsdown": "0.22.8",
"typescript": "5.9.3",

@@ -23,0 +23,0 @@ "vitest": "4.1.10"

import { n as OnDiskMigrationPackage, t as MigrationOps } from "./package-CWicKzNs.mjs";
import { MigrationMetadata, MigrationPackage } from "@prisma-next/framework-components/control";
//#region src/io.d.ts
declare function writeMigrationPackage(dir: string, metadata: MigrationMetadata, ops: MigrationOps): Promise<void>;
/**
* Materialise an in-memory {@link MigrationPackage} to a per-space
* directory on disk.
*
* Writes two files under `<targetDir>/<pkg.dirName>/`:
*
* - `migration.json` — the manifest (pretty-printed, matches
* {@link writeMigrationPackage}'s output for byte-for-byte parity with
* app-space migrations).
* - `ops.json` — the operation list (pretty-printed).
*
* Distinct verb from the lower-level {@link writeMigrationPackage}
* (which takes constituent `(metadata, ops)`): callers reading
* `materialise…` know they are persisting a struct-typed package.
*
* Overwrite-idempotent: the per-package directory is cleared before
* each emit, so re-running against the same `targetDir` produces
* byte-identical contents and never leaves stale files behind. The
* lower-level {@link writeMigrationPackage} stays strict because the
* CLI authoring path (`migration plan` / `migration new`) deliberately
* refuses to clobber an existing authored migration; this helper is
* the re-emit path that is supposed to converge on a single canonical
* on-disk shape.
*
* The per-space head contract lives at
* `<projectMigrationsDir>/<spaceId>/contract.json` (written by
* {@link import('./emit-contract-space-artefacts').emitContractSpaceArtefacts}),
* not inside the per-package directory. The runner reads only
* `migration.json` + `ops.json` from each package.
*/
declare function materialiseMigrationPackage(targetDir: string, pkg: MigrationPackage): Promise<void>;
/**
* Idempotent variant of {@link materialiseMigrationPackage}: writes the
* package only if `<targetDir>/<pkg.dirName>/` does not already exist on
* disk as a directory; returns `{ written: false }` when the package
* directory is present (no rewrite, no comparison — by-existence skip).
*
* Concretely:
* - existing directory → skip silently, return `{ written: false }`.
* - missing path → write three files via {@link materialiseMigrationPackage},
* return `{ written: true }`.
* - path exists but is not a directory (file/symlink) → treated as
* missing; {@link materialiseMigrationPackage} will attempt creation
* and fail with an appropriate OS error.
* - any other I/O error from `stat` → propagated unchanged.
*
* Used by the CLI's `runContractSpaceExtensionMigrationsPass` to
* materialise extension migration packages into a project's
* `migrations/<spaceId>/` directory, and by extension-package tests
* that mirror the same idempotent-rematerialise property locally
* without taking a CLI dependency.
*/
declare function materialiseExtensionMigrationPackageIfMissing(targetDir: string, pkg: MigrationPackage): Promise<{
readonly written: boolean;
}>;
/**
* Copy a list of files into `destDir`, optionally renaming each one.
*
* The destination directory is created (with `recursive: true`) if it
* does not already exist. Each source path is copied byte-for-byte into
* `destDir/<destName>`; missing sources throw `ENOENT`. The helper is
* intentionally generic: callers own the list of files (e.g. a contract
* emitter's emitted output) and the naming convention (e.g. renaming
* the destination contract to `end-contract.*` and the source contract
* to `start-contract.*`).
*/
declare function copyFilesWithRename(destDir: string, files: readonly {
readonly sourcePath: string;
readonly destName: string;
}[]): Promise<void>;
declare function writeMigrationMetadata(dir: string, metadata: MigrationMetadata): Promise<void>;
declare function writeMigrationOps(dir: string, ops: MigrationOps): Promise<void>;
declare function readMigrationPackage(dir: string): Promise<OnDiskMigrationPackage>;
/**
* A per-package load-time problem returned by {@link readMigrationsDir}.
*
* Three variants, matching the relocated throws from the load path:
*
* - `hashMismatch` — stored `migrationHash` differs from the recomputed value.
* The package is **retained** in the returned `packages` array.
* - `providedInvariantsMismatch` — `migration.json` declares different
* `providedInvariants` than `ops.json` implies. The package is **retained**.
* - `packageUnloadable` — the manifest is missing, unparseable, or schema-
* invalid. The package is **omitted** from `packages`.
*
* Callers that need the `spaceId` context (e.g. the aggregate loader) attach
* it when converting to {@link import('./integrity-violation').IntegrityViolation}.
*/
type PackageLoadProblem = {
readonly kind: 'hashMismatch';
readonly dirName: string;
readonly stored: string;
readonly computed: string;
} | {
readonly kind: 'providedInvariantsMismatch';
readonly dirName: string;
} | {
readonly kind: 'packageUnloadable';
readonly dirName: string;
readonly detail: string;
};
/**
* Result returned by {@link readMigrationsDir}.
*
* - `packages` — every package that could be read; hash-mismatched and
* invariants-mismatched packages are included here (the problem is
* represented rather than fatal).
* - `problems` — one entry per package that had a load-time issue.
* `packageUnloadable` entries are **not** in `packages`.
*/
interface ReadMigrationsDirResult {
readonly packages: readonly OnDiskMigrationPackage[];
readonly problems: readonly PackageLoadProblem[];
}
declare function readMigrationsDir(migrationsRoot: string): Promise<ReadMigrationsDirResult>;
declare function formatMigrationDirName(timestamp: Date, slug: string): string;
//#endregion
export { materialiseExtensionMigrationPackageIfMissing as a, readMigrationsDir as c, writeMigrationPackage as d, formatMigrationDirName as i, writeMigrationMetadata as l, ReadMigrationsDirResult as n, materialiseMigrationPackage as o, copyFilesWithRename as r, readMigrationPackage as s, PackageLoadProblem as t, writeMigr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,EAAE,IAAA"}
import { n as OnDiskMigrationPackage } from "./package-CWicKzNs.mjs";
import { n as MigrationGraph, t as MigrationEdge } from "./graph-bDjJ4GL9.mjs";
//#region src/migration-graph.d.ts
declare function reconstructGraph(packages: readonly OnDiskMigrationPackage[]): MigrationGraph;
/**
* Find the shortest path from `fromHash` to `toHash` using BFS over the
* contract-hash graph. Returns the ordered list of edges, or null if no path
* exists. Returns an empty array when `fromHash === toHash` (no-op).
*
* Neighbor ordering is deterministic via the tie-break sort key:
* createdAt → to → migrationHash.
*/
declare function findPath(graph: MigrationGraph, fromHash: string, toHash: string): readonly MigrationEdge[] | null;
/**
* Find the shortest path from `fromHash` to `toHash` whose edges collectively
* cover every invariant in `required`. Returns `null` when no such path exists
* (either `fromHash`→`toHash` is structurally unreachable, or every reachable
* path leaves at least one required invariant uncovered). When `required` is
* empty, delegates to `findPath` so the result is byte-identical for that case.
*
* Algorithm: BFS over `(node, coveredSubset)` states with state-level dedup.
* The covered subset is a `Set<string>` of invariant ids; the state's dedup
* key is `${node}\0${[...covered].sort().join('\0')}`. State keys distinguish
* distinct `(node, covered)` tuples regardless of node-name length because
* `\0` cannot appear in any invariant id (validation rejects whitespace and
* control chars at authoring time).
*
* Neighbour ordering when `required ≠ ∅`: edges covering ≥1 still-needed
* invariant come first, with `createdAt → to → migrationHash` as the
* secondary key. The heuristic steers BFS toward the satisfying path;
* correctness (shortest, deterministic) does not depend on it.
*/
declare function findPathWithInvariants(graph: MigrationGraph, fromHash: string, toHash: string, required: ReadonlySet<string>): readonly MigrationEdge[] | null;
interface PathDecision {
readonly selectedPath: readonly MigrationEdge[];
readonly fromHash: string;
readonly toHash: string;
readonly alternativeCount: number;
readonly tieBreakReasons: readonly string[];
readonly refName?: string;
/** The caller-supplied required invariant set, sorted ascending. */
readonly requiredInvariants: readonly string[];
/**
* The subset of `requiredInvariants` actually covered by edges on
* `selectedPath`. Always a subset of `requiredInvariants` (when the path
* is satisfying, equal to it); always derived from `selectedPath`.
*/
readonly satisfiedInvariants: readonly string[];
}
/**
* Outcome of {@link findPathWithDecision}. The pathfinder distinguishes
* three cases up front so callers don't re-derive structural reachability:
*
* - `ok` — a path covering `required` exists; `decision` carries the
* selection metadata and per-edge invariants.
* - `unreachable` — `from`→`to` has no structural path. Mapped by callers
* to the existing no-path / `NO_TARGET` diagnostic.
* - `unsatisfiable` — `from`→`to` is structurally reachable but no path
* covers every required invariant. `structuralPath` is the
* `findPath(graph, from, to)` result, included so callers don't have to
* recompute it when raising `MIGRATION.NO_INVARIANT_PATH`. `missing` is
* the subset of `required` that the structural path does *not* cover —
* correctly accounts for partial coverage when some required invariants
* are met by the fallback path. Only emitted when `required` is
* non-empty.
*/
type FindPathOutcome = {
readonly kind: 'ok';
readonly decision: PathDecision;
} | {
readonly kind: 'unreachable';
} | {
readonly kind: 'unsatisfiable';
readonly structuralPath: readonly MigrationEdge[];
readonly missing: readonly string[];
};
/**
* Routing context for {@link findPathWithDecision}. Both fields are optional;
* `refName` is only used to decorate the resulting `PathDecision` for the
* JSON envelope, and `required` defaults to an empty set (purely structural
* routing). They are passed via a single options object so the call sites
* cannot silently swap two adjacent string parameters.
*/
interface FindPathWithDecisionOptions {
readonly refName?: string;
readonly required?: ReadonlySet<string>;
}
/**
* Find the shortest path from `fromHash` to `toHash` and return structured
* path-decision metadata for machine-readable output. When `required` is
* non-empty, the returned path is the shortest one whose edges collectively
* cover every required invariant.
*
* The discriminated return type tells the caller *why* a path could not be
* found, so the CLI can pick the right structured error without re-running
* a structural BFS.
*/
declare function findPathWithDecision(graph: MigrationGraph, fromHash: string, toHash: string, options?: FindPathWithDecisionOptions): FindPathOutcome;
/**
* Find all branch tips (nodes with no outgoing edges) reachable from
* `fromHash` via forward edges.
*/
declare function findReachableLeaves(graph: MigrationGraph, fromHash: string): readonly string[];
/**
* Find the target contract hash of the migration graph reachable from
* EMPTY_CONTRACT_HASH. Returns `null` for a graph that has no target
* state (either empty, or containing only the root with no outgoing
* edges). Throws NO_INITIAL_MIGRATION if the graph has nodes but none
* originate from the empty hash, and AMBIGUOUS_TARGET if multiple
* branch tips exist.
*/
declare function findLeaf(graph: MigrationGraph): string | null;
/**
* Find the latest migration entry by traversing from EMPTY_CONTRACT_HASH
* to the single target. Returns null for an empty graph.
* Throws AMBIGUOUS_TARGET if the graph has multiple branch tips.
*/
declare function findLatestMigration(graph: MigrationGraph): MigrationEdge | null;
declare function detectCycles(graph: MigrationGraph): readonly string[][];
declare function detectOrphans(graph: MigrationGraph): readonly MigrationEdge[];
//#endregion
export { findLeaf as a, findPathWithInvariants as c, findLatestMigration as i, findReachableLeaves as l, detectCycles as n, findPath as o, detectOrphans as r, findPathWithDecision as s, PathDecision as t, reconstructGraph as u };
//# sourceMappingURL=migration-graph-BJpeTOuY.d.mts.map
{"version":3,"file":"migration-graph-BJpeTOuY.d.mts","names":[],"sources":["../src/migration-graph.ts"],"mappings":";;;;iBAgCgB,gBAAA,CAAiB,QAAA,WAAmB,sBAAA,KAA2B,cAAc;;AAA7F;;;;;;;iBA+DgB,QAAA,CACd,KAAA,EAAO,cAAA,EACP,QAAA,UACA,MAAA,oBACU,aAAa;AAnEoE;AA+D7F;;;;;;;;;;AAIyB;AA4CzB;;;;;;;AA/G6F,iBA+G7E,sBAAA,CACd,KAAA,EAAO,cAAA,EACP,QAAA,UACA,MAAA,UACA,QAAA,EAAU,WAAA,oBACA,aAAA;AAAA,UAsFK,YAAA;EAAA,SACN,YAAA,WAAuB,aAAa;EAAA,SACpC,QAAA;EAAA,SACA,MAAA;EAAA,SACA,gBAAA;EAAA,SACA,eAAA;EAAA,SACA,OAAA;EA5Fc;EAAA,SA8Fd,kBAAA;EARM;;;;;EAAA,SAcN,mBAAA;AAAA;;;;;;;;AAAmB;AAoB9B;;;;;;;;;KAAY,eAAA;EAAA,SACG,IAAA;EAAA,SAAqB,QAAA,EAAU,YAAA;AAAA;EAAA,SAC/B,IAAA;AAAA;EAAA,SAEA,IAAA;EAAA,SACA,cAAA,WAAyB,aAAa;EAAA,SACtC,OAAA;AAAA;;;;AAYkB;AAajC;;;UAfiB,2BAAA;EAAA,SACN,OAAA;EAAA,SACA,QAAA,GAAW,WAAW;AAAA;;;;;;;;;;AAkBf;iBALF,oBAAA,CACd,KAAA,EAAO,cAAA,EACP,QAAA,UACA,MAAA,UACA,OAAA,GAAS,2BAAA,GACR,eAAA;;;;;iBAqLa,mBAAA,CAAoB,KAAA,EAAO,cAAc,EAAE,QAAA;;;AAAgB;AAkB3E;;;;AAA8C;iBAA9B,QAAA,CAAS,KAAqB,EAAd,cAAc;;;;;;iBAwC9B,mBAAA,CAAoB,KAAA,EAAO,cAAA,GAAiB,aAAa;AAAA,iBAQzD,YAAA,CAAa,KAAqB,EAAd,cAAc;AAAA,iBA8DlC,aAAA,CAAc,KAAA,EAAO,cAAA,YAA0B,aAAa"}
import { MigrationPackage, MigrationPlanOperation } from "@prisma-next/framework-components/control";
//#region src/package.d.ts
type MigrationOps = readonly MigrationPlanOperation[];
/**
* Augmented form of the canonical {@link MigrationPackage} returned by
* the on-disk readers (`readMigrationPackage`, `readMigrationsDir`).
* Adds `dirPath` — the absolute path the package was loaded from — so
* downstream diagnostics can point operators at a concrete directory.
*
* Holding an `OnDiskMigrationPackage` value implies the loader verified
* the package's integrity (hash recomputation against the stored
* `migrationHash`); the canonical structural shape carries no such
* guarantee on its own.
*/
interface OnDiskMigrationPackage extends MigrationPackage {
readonly dirPath: string;
}
//#endregion
export { OnDiskMigrationPackage as n, MigrationOps as t };
//# sourceMappingURL=package-CWicKzNs.d.mts.map
{"version":3,"file":"package-CWicKzNs.d.mts","names":[],"sources":["../src/package.ts"],"mappings":";;;KAKY,YAAA,YAAwB,sBAAsB;;AAA1D;;;;AAA0D;AAa1D;;;;AACkB;UADD,sBAAA,SAA+B,gBAAgB;EAAA,SACrD,OAAO;AAAA"}