@prisma/orm-toolchain 8.0.0-rc.4-dev.13 → 8.0.0-rc.4-dev.15

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.
package/dist/cli.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":["CliStructuredError$2","errorConfigValidation","resolveContractRef"],"sources":["../../../../1-framework/3-tooling/cli/dist/load-config-ChYX98p-.mjs","../../../../1-framework/3-tooling/cli/dist/exports/index.mjs"],"sourcesContent":["import { $ as refuseContractSpaceIntegrity, A as hasMigrationPath, At as requireLiveDatabase, B as resolveRefAdvancementFields, C as migrationSpaceListEntriesFromAggregate, Ct as errorNoMigrations, D as executeMigrateShowPlan, Dt as errorTargetMigrationNotSupported, E as resolveMigrationRef, Et as errorRuntime, F as advanceRefSafely, M as mapContractAtError, Mt as runCommandAction, N as mapCaughtMigrationError, O as refuseMissingInvariantPath, Ot as errorTargetMismatch, P as resolveContractRefToSnapshot, S as listRefsByContractHash, St as errorMigrationPlanningFailed, T as resolveContractRef, Tt as errorRunnerFailed, U as createControlClient, V as executeContractEmit, X as loadContractRawSafely, Y as buildReadAggregate, Z as loadContractSpaceAggregateForCli, _ as loadAggregateIntegrityViolations, _t as errorFileNotFound, a as appliedHashesFromLedger, at as readContractEnvelope, b as looksLikePath, bt as errorMarkerMissing, c as statusForMigrationHash, dt as errorConsentPlanMismatch, ft as errorContractArgConflict, g as enumerateCheckSpaces, gt as errorDriverRequired, h as checkSingleTarget, ht as errorDestructiveChanges, i as readMigrationRefs, it as maskConnectionUrl, j as refuseMarkerOutsideGraph, jt as chooseAction, k as refuseUnknownInvariants, kt as errorUnexpected, l as executeMigrationPlanCommand, lt as CliStructuredError$2, m as buildMigrationSpaceGraphEntries, mt as errorDatabaseConnectionRequired, n as executeRefListCommand, nt as toDeclaredExtensionsFromRaw, o as deriveStatusEdgeAnnotations, ot as sanitizeErrorMessage, p as executeMigrationNewCommand, pt as errorContractValidationFailed, r as executeRefSetCommand, rt as closeQuietly, s as originHashForStatus, st as targetSupportsMigrations, t as executeRefDeleteCommand, tt as refusePackageCorruptionOnAggregate, ut as errorConfigValidation, v as runMigrationCheck, vt as errorHashMismatch, w as runMigrationList, wt as errorPathUnreachable, x as resolveAppTargetPath, xt as errorMigrationPackageNotFound, y as findPackageByDirPath, yt as errorLegendHumanOnly, z as readContractIR } from \"./ref-DJkSkzAt.mjs\";\nimport { n as buildNextSteps, t as InitOutputSchema } from \"./output-CovTDY14.mjs\";\nimport { createRequire } from \"node:module\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, defineServerCommand, flag, positional } from \"@prisma/cli-engine\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { APP_SPACE_ID, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, createControlStack, issueOutcome } from \"@internal/framework-components/control\";\nimport { InternalError, assertNever, isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { DOCS_BASE, docsUrlFor, isStructuredError, isStructuredErrorCode } from \"@internal/utils/structured-error\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { mkdir, readFile, rename, rm, writeFile } from \"node:fs/promises\";\nimport { EMPTY_CONTRACT_HASH } from \"@internal/migration-tools/constants\";\nimport { spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\nimport { basename, dirname, extname, isAbsolute, join, normalize, relative, resolve } from \"pathe\";\nimport { CliStructuredError as CliStructuredError$1, notOk as notOk$1, ok as ok$1 } from \"@prisma/cli-engine/protocol\";\nimport { createScaffoldSpecifierResolver } from \"@internal/publish-surface/import-roots\";\nimport { collectConfigIssues } from \"@internal/config/config-validation\";\nimport { finalizeConfig, loadConfig } from \"@internal/config-loader\";\nimport { printPsl } from \"@internal/psl-printer\";\nimport { EOL } from \"node:os\";\nimport { format } from \"@internal/psl-parser/format\";\nimport { type } from \"arktype\";\nimport { suppressIdleConnectionErrors } from \"@internal/utils/suppress-idle-connection-errors\";\nimport { DEFAULT_CONTRACT_SOURCE_DIR } from \"@internal/config/config-types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { spawn } from \"node:child_process\";\nimport { detect } from \"package-manager-detector/detect\";\nimport { applyEdits, modify, parse, printParseErrorCode } from \"jsonc-parser\";\nimport stringWidth from \"string-width\";\nimport { bold, createColors, cyan, cyanBright, dim, green, yellow } from \"colorette\";\n//#region package.json\nvar version = \"8.0.0-rc.4-dev.13\";\nconst MISSING_CONFIG_ACTION = {\n\tkind: \"run-command\",\n\tlabel: \"Create a config file\",\n\tcommand: \"prisma-cli init\"\n};\nfunction editConfigAction(field) {\n\treturn {\n\t\tkind: \"edit-file\",\n\t\tlabel: `Correct ${field} in prisma.config.ts`\n\t};\n}\nfunction issueDiagnostic(issue) {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: issue.message,\n\t\twhy: issue.message,\n\t\tnextActions: [editConfigAction(issue.field)],\n\t\tmeta: {\n\t\t\tfield: issue.field,\n\t\t\tsection: issue.section\n\t\t}\n\t};\n}\nfunction sectionAbsentDiagnostic() {\n\treturn {\n\t\tcode: \"CONFIG.FILE_NOT_FOUND\",\n\t\tseverity: \"error\",\n\t\tsummary: \"No Prisma Next configuration was loaded\",\n\t\twhy: `The orm config section is absent, so prisma.config.ts was never evaluated.`,\n\t\tnextActions: [MISSING_CONFIG_ACTION]\n\t};\n}\nfunction notAnObjectDiagnostic() {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: \"Prisma Next configuration must be an object\",\n\t\twhy: `The orm config section is not an object, so no section can be read from it.`,\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Export a configuration object from prisma.config.ts\"\n\t\t}]\n\t};\n}\nfunction unreadableDiagnostic(error) {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: \"Prisma Next configuration could not be inspected\",\n\t\twhy: error instanceof Error ? error.message : String(error),\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Export a plain configuration object from prisma.config.ts\"\n\t\t}]\n\t};\n}\nfunction isRecord$1(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/**\n* An emitted artifact listed as its own contract input makes every emit\n* consume its previous output. Structural, filesystem-free, and therefore the\n* section validator's business rather than the loader's.\n*/\nfunction collectArtifactCollisionIssues(raw) {\n\tconst contract = raw[\"contract\"];\n\tif (!isRecord$1(contract)) return [];\n\tconst source = contract[\"source\"];\n\tconst output = contract[\"output\"];\n\tif (!isRecord$1(source) || typeof output !== \"string\") return [];\n\tconst inputs = source[\"inputs\"];\n\tif (!Array.isArray(inputs)) return [];\n\tlet emitted;\n\ttry {\n\t\temitted = getEmittedArtifactPaths(output);\n\t} catch (error) {\n\t\treturn [{\n\t\t\tsection: \"contract\",\n\t\t\tfield: \"contract.output\",\n\t\t\tmessage: error instanceof Error ? error.message : String(error)\n\t\t}];\n\t}\n\tconst emittedPaths = /* @__PURE__ */ new Set([normalize(emitted.jsonPath), normalize(emitted.dtsPath)]);\n\tif (!inputs.some((input) => typeof input === \"string\" && emittedPaths.has(normalize(input)))) return [];\n\treturn [{\n\t\tsection: \"contract\",\n\t\tfield: \"contract.source.inputs[]\",\n\t\tmessage: \"Config.contract.source.inputs must not include emitted artifact paths derived from contract.output\"\n\t}];\n}\nfunction validate(raw) {\n\tif (raw === void 0) return {\n\t\tok: false,\n\t\tdiagnostics: [sectionAbsentDiagnostic()]\n\t};\n\tif (!isRecord$1(raw)) return {\n\t\tok: false,\n\t\tdiagnostics: [notAnObjectDiagnostic()]\n\t};\n\tlet issues;\n\ttry {\n\t\tissues = [...collectConfigIssues(raw), ...collectArtifactCollisionIssues(raw)];\n\t} catch (error) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tdiagnostics: [unreadableDiagnostic(error)]\n\t\t};\n\t}\n\tif (issues.length > 0) return {\n\t\tok: false,\n\t\tdiagnostics: issues.map(issueDiagnostic)\n\t};\n\treturn {\n\t\tok: true,\n\t\tvalue: blindCast(raw),\n\t\tdiagnostics: []\n\t};\n}\nconst ormConfigSection = defineConfigSection({\n\tname: \"orm\",\n\tvalidate\n});\n//#endregion\n//#region src/orm/normalize-error.ts\n/**\n* `isStructuredError` is the repo's own check, and it is the one that matters here: it holds the\n* regular expression for a dotted `NAMESPACE.SUBCODE`, so only a code the protocol accepts\n* reaches `Diagnostic['code']`.\n*/\nfunction isRaisedError(error) {\n\treturn error instanceof Error && isStructuredError(error);\n}\n/**\n* The fallback for anything that is not a structured error: a bare throw, and also an error whose\n* `code` is not a dotted one — a Node `ENOENT`, say. The rejected code survives in `meta` rather\n* than in `code`, where it would produce a docs link to a page that does not exist.\n*/\nfunction toUnexpected(error) {\n\tconst summary = error instanceof Error ? error.message : String(error);\n\tconst rejectedCode = error instanceof Error ? Reflect.get(error, \"code\") : void 0;\n\treturn new CliStructuredError$1(\"CLI.UNEXPECTED\", summary, {\n\t\t...ifDefined(\"meta\", typeof rejectedCode === \"string\" ? { code: rejectedCode } : void 0),\n\t\tcause: error\n\t});\n}\n/**\n* Both classes name themselves `CliStructuredError`, so the engine's duck test\n* accepts prisma/prisma's too, and a CLI factory carrying typed actions looks\n* conformant without being one — its `toEnvelope` still writes `fix` and no\n* `nextActions`. Only an error the engine itself built is already in protocol\n* shape, and `@prisma/cli-engine` is an exact-pinned, unbundled dependency, so\n* there is one module instance and identity holds.\n*/\nfunction conformsToProtocol(error) {\n\treturn error instanceof CliStructuredError$1;\n}\n/**\n* Turns the transitional `fix` prose into typed actions. A multi-line fix is\n* several pieces of advice, so it becomes one action per line.\n*/\nfunction actionsFromFix(fix) {\n\tif (fix === void 0) return [];\n\treturn fix.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0).map((label) => ({\n\t\tkind: \"user-choice\",\n\t\tlabel\n\t}));\n}\n/**\n* Projects a prisma/prisma-raised error onto the engine's diagnostic shape.\n*/\nfunction toEngineDiagnostic(error) {\n\treturn {\n\t\tcode: error.code,\n\t\tseverity: error.severity ?? \"error\",\n\t\tsummary: error.message,\n\t\t...ifDefined(\"why\", error.why),\n\t\tnextActions: error.nextActions ?? actionsFromFix(error.fix),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\t...ifDefined(\"docsUrl\", error.docsUrl)\n\t};\n}\n/**\n* The handler boundary's single conversion. Handlers pass every error they\n* return through `notOk` — and every error a top-of-handler catch sees —\n* through this, so a settled envelope always carries `nextActions` and never\n* the non-protocol `fix` field.\n*/\nfunction normalizeError(error) {\n\tif (conformsToProtocol(error)) return error;\n\tif (!isRaisedError(error)) return toUnexpected(error);\n\tconst diagnostic = toEngineDiagnostic(error);\n\treturn new CliStructuredError$1(diagnostic.code, diagnostic.summary, {\n\t\tseverity: diagnostic.severity,\n\t\tnextActions: diagnostic.nextActions,\n\t\t...ifDefined(\"why\", diagnostic.why),\n\t\t...ifDefined(\"where\", diagnostic.where),\n\t\t...ifDefined(\"meta\", diagnostic.meta),\n\t\t...ifDefined(\"docsUrl\", diagnostic.docsUrl),\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/orm/define-command.ts\n/**\n* `defineCommand` with the ORM's error boundary already attached. Every ORM command is defined\n* through this rather than through `defineCommand` directly.\n*\n* Without it, an error a handler throws reaches the engine, whose duck test accepts\n* prisma/prisma's `CliStructuredError` — both classes carry that name — and then settles it\n* through fields the engine's own class has and this one does not. The envelope that results is\n* off-protocol. Catching here means every handler settles through the single conversion instead.\n*\n* An `InternalError` is the one thing this boundary does not convert. Its own contract says never\n* to catch it outside the outermost boundary: it means an invariant broke, which is a bug in\n* Prisma Next rather than something the user did. Re-throwing lets the engine settle it as a bug\n* at exit 1, where converting it would report the same number as a bad connection string.\n*/\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/**\n* Hands the handler a config whose paths are absolute. The engine's own\n* loader evaluates `prisma.config.ts` without touching the paths inside it, so\n* a command mounted in the unified host receives `contract.output` and\n* `migrations.dir` exactly as authored — usually relative — while this repo's\n* bin finalizes them in its loader. Anchoring here, on the section every ORM\n* command reads, makes both hosts hand handlers the same absolute paths.\n*\n* The anchor is the working directory: the engine discovers the config in the\n* working directory only, so that is the file's own directory. (A `--config`\n* pointing into another directory is not visible from a command context; a\n* relative path inside such a file resolves against the invocation directory,\n* which is also what the file's author sees the command run from.)\n* Finalization is idempotent — an already-absolute path resolves to itself —\n* so a config that arrived finalized passes through unchanged.\n*/\nfunction finalizedConfigContext(ctx) {\n\tif (!isRecord(ctx.config)) return ctx;\n\tconst config = blindCast(ctx.config);\n\treturn {\n\t\t...ctx,\n\t\tconfig: finalizeConfig(config, ctx.cwd)\n\t};\n}\nfunction defineOrmCommand(def) {\n\treturn defineCommand({\n\t\t...def,\n\t\thandler: async (args, ctx) => {\n\t\t\ttry {\n\t\t\t\treturn await def.handler(args, finalizedConfigContext(ctx));\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn notOk$1(normalizeError(error));\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\n//#region src/orm/progress.ts\nconst OUTCOMES = {\n\tok: \"ok\",\n\tskipped: \"skipped\",\n\terror: \"failed\"\n};\n/**\n* The control API's spans as engine events. A span's label is remembered when\n* it starts so the finishing event names the step with the same words.\n*/\nfunction controlProgressReporter(report) {\n\tconst labels = /* @__PURE__ */ new Map();\n\treturn (event) => {\n\t\tif (event.kind === \"spanStart\") {\n\t\t\tlabels.set(event.spanId, event.label);\n\t\t\treport({\n\t\t\t\tkind: \"step-started\",\n\t\t\t\tstep: event.label,\n\t\t\t\tid: event.spanId,\n\t\t\t\t...ifDefined(\"parentId\", event.parentSpanId)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst step = labels.get(event.spanId) ?? event.spanId;\n\t\tlabels.delete(event.spanId);\n\t\treport({\n\t\t\tkind: \"step-finished\",\n\t\t\tstep,\n\t\t\tid: event.spanId,\n\t\t\toutcome: OUTCOMES[event.outcome]\n\t\t});\n\t};\n}\n//#endregion\n//#region src/orm/contract/emit.ts\nfunction hashRows(document) {\n\treturn {\n\t\tkind: \"fields\",\n\t\trows: [\n\t\t\t{\n\t\t\t\tlabel: \"storageHash\",\n\t\t\t\tvalue: [{\n\t\t\t\t\ttext: document.storageHash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t},\n\t\t\t...document.executionHash === void 0 ? [] : [{\n\t\t\t\tlabel: \"executionHash\",\n\t\t\t\tvalue: [{\n\t\t\t\t\ttext: document.executionHash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t}],\n\t\t\t{\n\t\t\t\tlabel: \"profileHash\",\n\t\t\t\tvalue: [{\n\t\t\t\t\ttext: document.profileHash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t}\n\t\t]\n\t};\n}\nfunction emitPresentations(inputs) {\n\tconst { document, cwd } = inputs;\n\treturn {\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: relative(cwd, document.files.json)\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"types\",\n\t\t\t\t\tvalue: relative(cwd, document.files.dts)\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Emitted contract.json and contract.d.ts\"\n\t\t\t},\n\t\t\thashRows(document)\n\t\t],\n\t\tstdout: () => [document.files.json, document.files.dts],\n\t\tjson: () => document\n\t};\n}\nfunction createContractEmitCommand({ executeContractEmit }) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Emit your contract artifacts\",\n\t\t\tdescription: \"Reads your contract source (TypeScript or Prisma schema) and emits\\ncontract.json and contract.d.ts. The contract.json contains the canonical\\ncontract structure, and contract.d.ts provides TypeScript types for\\ntype-safe query building. Offline — does not consult the database.\",\n\t\t\texamples: [\n\t\t\t\t\"contract emit\",\n\t\t\t\t\"contract emit --output-path ./generated\",\n\t\t\t\t\"contract emit --json\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: { outputPath: flag.string({\n\t\t\tbrief: \"Directory to write contract.json and contract.d.ts into\",\n\t\t\tplaceholder: \"dir\"\n\t\t}) } },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst outputPath = args.flags.outputPath === void 0 ? void 0 : resolve(ctx.cwd, args.flags.outputPath);\n\t\t\tconst result = await executeContractEmit({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tonProgress: controlProgressReporter(ctx.report),\n\t\t\t\tsignal: ctx.signal,\n\t\t\t\t...ifDefined(\"outputPath\", outputPath)\n\t\t\t});\n\t\t\tif (result.validationWarning !== void 0) ctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: result.validationWarning\n\t\t\t});\n\t\t\tconst document = {\n\t\t\t\tok: true,\n\t\t\t\tstorageHash: result.storageHash,\n\t\t\t\t...ifDefined(\"executionHash\", result.executionHash),\n\t\t\t\tprofileHash: result.profileHash,\n\t\t\t\toutDir: dirname(result.files.json),\n\t\t\t\tfiles: result.files,\n\t\t\t\ttimings: { total: Date.now() - startedAt }\n\t\t\t};\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"verbose\",\n\t\t\t\ttext: `Total time: ${document.timings.total}ms`\n\t\t\t});\n\t\t\treturn ok$1(ctx.present({ data: document }, emitPresentations({\n\t\t\t\tdocument,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t})));\n\t\t}\n\t});\n}\nconst contractEmitCommand = createContractEmitCommand({ executeContractEmit });\n//#endregion\n//#region src/utils/publish-text-artifact.ts\n/**\n* Writes a generated file the way `contract emit` publishes its pair: the\n* bytes land in a temporary file beside the target and are renamed over it, so\n* a run interrupted mid-write leaves the previous file intact rather than a\n* truncated one.\n*/\nasync function publishTextArtifact(inputs) {\n\tconst directory = dirname(inputs.path);\n\tconst tempPath = join(directory, `.${basename(inputs.path)}.${process.pid}.${inputs.publicationToken}.next.tmp`);\n\tawait mkdir(directory, { recursive: true });\n\ttry {\n\t\tawait writeFile(tempPath, inputs.content, \"utf-8\");\n\t\tawait rename(tempPath, inputs.path);\n\t} finally {\n\t\tawait rm(tempPath, { force: true });\n\t}\n}\n//#endregion\n//#region src/orm/flags.ts\n/**\n* The database connection override, declared from here by every command that\n* accepts one so its brief and placeholder cannot drift apart. Resolution\n* order is the flag, then `config.db.connection`, then\n* `CONFIG.DB_CONNECTION_REQUIRED`.\n*/\nconst dbFlag = flag.string({\n\tbrief: \"Database connection string\",\n\tplaceholder: \"url\"\n});\n//#endregion\n//#region src/orm/contract/paths.ts\n/** The file `contract infer` writes when nothing names another. */\nconst INFERRED_CONTRACT_FILENAME = \"contract.prisma\";\n/**\n* Where `contract infer` writes the PSL it inferred: `--output`, else\n* `contract.prisma` beside the emitted contract, else `contract.prisma` in the\n* invocation directory.\n*/\nfunction inferredContractPathFor(inputs) {\n\tif (inputs.output !== void 0) return resolve(inputs.cwd, inputs.output);\n\tconst contractOutput = inputs.config.contract?.output;\n\tif (contractOutput !== void 0) return join(dirname(resolve(inputs.cwd, contractOutput)), INFERRED_CONTRACT_FILENAME);\n\treturn join(inputs.cwd, INFERRED_CONTRACT_FILENAME);\n}\n//#endregion\n//#region src/orm/contract/infer.ts\nfunction inferPresentations(inputs) {\n\tconst { document, database } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [...database === void 0 ? [] : [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: database\n\t\t\t}]\n\t\t}], {\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [{ text: \"Contract written to \" }, {\n\t\t\t\ttext: document.psl.path,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createContractInferCommand({ createControlClient, printPsl }) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Infer a PSL contract from the live database schema\",\n\t\t\tdescription: \"Reads the live database schema and writes an inferred PSL contract to\\ndisk. This command stops at contract.prisma; follow it with\\n`contract emit` and `db sign` as separate steps. An existing file at the\\noutput path is overwritten, with a warning.\",\n\t\t\texamples: [\n\t\t\t\t\"contract infer --db $DATABASE_URL\",\n\t\t\t\t\"contract infer --db $DATABASE_URL --output ./src/prisma/contract.prisma\",\n\t\t\t\t\"contract infer --json\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\toutput: flag.string({\n\t\t\t\tbrief: \"Write the inferred PSL contract to the specified path\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\t\tif (dbConnection === void 0) return notOk$1(normalizeError(errorDatabaseConnectionRequired({\n\t\t\t\twhy: \"Database connection is required for contract infer (set db.connection in prisma.config.ts, or pass --db <url>)\",\n\t\t\t\tcommandName: \"contract infer\",\n\t\t\t\tmissingFlags: [\"--db\"]\n\t\t\t})));\n\t\t\tif (ctx.config.driver === void 0) return notOk$1(normalizeError(errorDriverRequired({ why: \"Config.driver is required for contract infer\" })));\n\t\t\tconst client = createControlClient({\n\t\t\t\tfamily: ctx.config.family,\n\t\t\t\ttarget: ctx.config.target,\n\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\tdriver: ctx.config.driver,\n\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t});\n\t\t\tlet pslContent;\n\t\t\ttry {\n\t\t\t\tconst schema = await client.introspect({\n\t\t\t\t\tconnection: dbConnection,\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report)\n\t\t\t\t});\n\t\t\t\tconst pslContractAst = client.inferPslContract(schema);\n\t\t\t\tif (pslContractAst === void 0) return notOk$1(normalizeError(errorRuntime(\"CONTRACT.INFER_UNSUPPORTED\", \"contract infer is not supported for this family\", {\n\t\t\t\t\twhy: \"The configured family does not implement the PslContractInferCapable capability, so an inferred PSL contract cannot be produced from the live database schema.\",\n\t\t\t\t\tfix: \"Use a family that supports contract inference (e.g. SQL/Postgres).\"\n\t\t\t\t})));\n\t\t\t\tpslContent = printPsl(pslContractAst, { pslBlockDescriptors: client.getPslBlockDescriptors() });\n\t\t\t} catch (error) {\n\t\t\t\tif (CliStructuredError$2.is(error)) return notOk$1(normalizeError(error));\n\t\t\t\tconst safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === \"string\" ? dbConnection : void 0);\n\t\t\t\treturn notOk$1(normalizeError(errorUnexpected(safeMessage, { why: `Unexpected error during contract infer: ${safeMessage}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tconst outputPath = inferredContractPathFor({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\toutput: args.flags.output\n\t\t\t});\n\t\t\tconst displayPath = relative(ctx.cwd, outputPath);\n\t\t\tif (existsSync(outputPath)) ctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: `Overwriting existing file: ${displayPath}`\n\t\t\t});\n\t\t\tawait publishTextArtifact({\n\t\t\t\tpath: outputPath,\n\t\t\t\tcontent: pslContent,\n\t\t\t\tpublicationToken: String(process.hrtime.bigint())\n\t\t\t});\n\t\t\tconst database = typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0;\n\t\t\tconst document = {\n\t\t\t\tok: true,\n\t\t\t\tsummary: \"Contract inferred successfully\",\n\t\t\t\ttarget: {\n\t\t\t\t\tfamilyId: ctx.config.family.familyId,\n\t\t\t\t\tid: ctx.config.target.targetId\n\t\t\t\t},\n\t\t\t\tpsl: { path: displayPath },\n\t\t\t\tmeta: { ...ifDefined(\"dbUrl\", database) },\n\t\t\t\ttimings: { total: Date.now() - startedAt }\n\t\t\t};\n\t\t\treturn ok$1(ctx.present({ data: document }, inferPresentations({\n\t\t\t\tdocument,\n\t\t\t\tdatabase\n\t\t\t})));\n\t\t}\n\t});\n}\nconst contractInferCommand = createContractInferCommand({\n\tcreateControlClient,\n\tprintPsl\n});\n//#endregion\n//#region src/utils/db-init-failure.ts\nfunction markerMismatchDetail(failure) {\n\tconst parts = [];\n\tif (failure.marker?.storageHash !== failure.destination?.storageHash && failure.marker?.storageHash && failure.destination?.storageHash) parts.push(`storageHash (marker: ${failure.marker.storageHash}, destination: ${failure.destination.storageHash})`);\n\tif (failure.marker?.profileHash !== failure.destination?.profileHash && failure.marker?.profileHash && failure.destination?.profileHash) parts.push(`profileHash (marker: ${failure.marker.profileHash}, destination: ${failure.destination.profileHash})`);\n\treturn parts.length > 0 ? ` Mismatch in ${parts.join(\" and \")}.` : \"\";\n}\n/**\n* A `db init` failure as the CLI's structured error.\n*\n* The `assertNever` is deliberate: a control-API failure code this does not\n* handle must stop the command rather than degrade into a generic message.\n*/\nfunction mapDbInitFailure(failure) {\n\tif (failure.code === \"PLANNING_FAILED\") return errorMigrationPlanningFailed({ conflicts: failure.conflicts ?? [] });\n\tif (failure.code === \"MIGRATION.MARKER_ORIGIN_MISMATCH\") return errorRuntime(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing database signature does not match plan destination.${markerMismatchDetail(failure)}`, {\n\t\twhy: \"Database has an existing signature (marker) that does not match the target contract\",\n\t\tfix: \"If bootstrapping, drop/reset the database then re-run `prisma-cli db init`; otherwise reconcile schema/marker using your migration workflow\",\n\t\tmeta: {\n\t\t\t...ifDefined(\"markerStorageHash\", failure.marker?.storageHash),\n\t\t\t...ifDefined(\"destinationStorageHash\", failure.destination?.storageHash),\n\t\t\t...ifDefined(\"markerProfileHash\", failure.marker?.profileHash),\n\t\t\t...ifDefined(\"destinationProfileHash\", failure.destination?.profileHash)\n\t\t}\n\t});\n\tif (failure.code === \"RUNNER_FAILED\") {\n\t\tconst fix = (typeof failure.meta?.[\"runnerErrorCode\"] === \"string\" ? failure.meta[\"runnerErrorCode\"] : void 0) === \"MIGRATION.LEGACY_MARKER_SHAPE\" ? \"Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma-cli db init` to recreate it with the current per-space schema.\" : \"Fix the schema mismatch (db init is additive-only), or drop/reset the database and re-run `prisma-cli db init`\";\n\t\treturn errorRunnerFailed(failure.summary, {\n\t\t\twhy: failure.why ?? \"Migration runner failed\",\n\t\t\tfix,\n\t\t\t...ifDefined(\"meta\", failure.meta),\n\t\t\t...ifDefined(\"cause\", failure.cause)\n\t\t});\n\t}\n\tconst exhaustive = failure.code;\n\treturn assertNever(exhaustive, `Unhandled DbInitFailure code: ${String(exhaustive)}`);\n}\n//#endregion\n//#region src/utils/formatters/migrations.ts\n/**\n* Render a single statement of an `OperationPreview` for the human-readable\n* preview block. SQL statements get a trailing `;` if missing so the rendered\n* preview is byte-identical to the legacy `string[]`-based renderer for SQL\n* targets. Other languages (`'mongodb-shell'`) render verbatim.\n*/\nfunction renderPreviewStatement(text, language) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return void 0;\n\tif (language === \"sql\") return trimmed.endsWith(\";\") ? trimmed : `${trimmed};`;\n\treturn trimmed;\n}\n/**\n* Choose the header label for a preview block. SQL-only previews keep the\n* legacy `DDL preview` label so the rendered output is byte-identical to the\n* pre-aggregate SQL CLI; previews from any other family — or a mix that\n* includes any non-SQL language — use the family-agnostic `Operation preview`\n* label.\n*\n* An empty `statements` array deliberately renders as `Operation preview`\n* rather than `DDL preview`: `Array.prototype.every` is vacuously true for\n* empty arrays, but we have no evidence the preview is SQL-only when no\n* statements are present, so the family-agnostic label is the safer default.\n*/\nfunction previewBlockHeader(preview) {\n\treturn preview.statements.length > 0 && preview.statements.every((s) => s.language === \"sql\") ? \"DDL preview\" : \"Operation preview\";\n}\n//#endregion\n//#region src/orm/db/migration-blocks.ts\nfunction operationNode(operation) {\n\treturn operation.operationClass === \"destructive\" ? {\n\t\tlabel: operation.label,\n\t\tstatus: \"warn\"\n\t} : { label: operation.label };\n}\nfunction spaceLabel(space) {\n\treturn space.kind === \"app\" ? \"App space\" : `Extension space: ${space.spaceId}`;\n}\n/**\n* One root per contract space, in the schedule order the runner used. A\n* space's post-apply marker is the last child of its own space, so the engine\n* draws it under the operations it signs.\n*/\nfunction spaceNodes(perSpace, mode) {\n\treturn perSpace.map((space) => ({\n\t\tlabel: [{\n\t\t\ttext: spaceLabel(space),\n\t\t\ttone: \"identifier\"\n\t\t}],\n\t\tchildren: [...space.operations.length === 0 ? [{ label: [{\n\t\t\ttext: \"(no operations)\",\n\t\t\ttone: \"muted\"\n\t\t}] }] : space.operations.map(operationNode), ...mode === \"apply\" && space.marker !== void 0 ? [{ label: [{\n\t\t\ttext: \"marker \",\n\t\t\ttone: \"muted\"\n\t\t}, {\n\t\t\ttext: space.marker.storageHash,\n\t\t\ttone: \"identifier\"\n\t\t}] }] : []]\n\t}));\n}\nfunction destructiveWarningBlocks(hasDestructive) {\n\treturn hasDestructive ? [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"This migration contains destructive operations that may cause data loss.\"\n\t}] : [];\n}\n/**\n* The planned or executed operations. The per-space breakdown is the shape the\n* aggregate flow produces; the flat tree is the fallback for a result that\n* carries no breakdown.\n*/\nfunction perSpaceBlocks(perSpace, mode) {\n\tconst hasDestructive = perSpace.some((space) => space.operations.some((operation) => operation.operationClass === \"destructive\"));\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: spaceNodes(perSpace, mode)\n\t}, ...destructiveWarningBlocks(hasDestructive)];\n}\nfunction operationBlocks$2(result) {\n\tconst perSpace = result.perSpace;\n\tif (perSpace !== void 0 && perSpace.length > 0) return perSpaceBlocks(perSpace, result.mode);\n\tif (result.plan.operations.length === 0) return [];\n\tconst hasDestructive = result.plan.operations.some((operation) => operation.operationClass === \"destructive\");\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: result.plan.operations.map(operationNode)\n\t}, ...destructiveWarningBlocks(hasDestructive)];\n}\n/** The statements a database would run, printed verbatim rather than laid out. */\nfunction previewBlocks$2(preview) {\n\tif (preview === void 0) return [];\n\tconst header = {\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: previewBlockHeader(preview)\n\t};\n\tconst statements = preview.statements.map((statement) => renderPreviewStatement(statement.text, statement.language)).filter((text) => text !== void 0);\n\treturn statements.length === 0 ? [header, {\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: \"No operations.\"\n\t}] : [header, {\n\t\tkind: \"drawing\",\n\t\tlines: statements\n\t}];\n}\n/**\n* What the planner flagged without refusing to plan it. Only `db update`\n* produces these — the additive-only policies cannot reach the branch.\n*/\nfunction plannerWarningBlocks(result) {\n\tconst warnings = result.warnings ?? [];\n\tif (warnings.length === 0) return [];\n\treturn [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"Planner warnings\"\n\t}, {\n\t\tkind: \"list\",\n\t\titems: warnings.map((warning) => warning.summary)\n\t}];\n}\nfunction planSummaryText(result) {\n\tconst operations = result.plan.operations.length;\n\tconst spaces = result.perSpace?.length ?? 0;\n\treturn spaces > 0 ? `Planned ${operations} operation(s) across ${spaces} contract space${spaces === 1 ? \"\" : \"s\"}` : `Planned ${operations} operation(s)`;\n}\nfunction applySummaryText(result) {\n\tconst executed = result.execution?.operationsExecuted ?? 0;\n\tconst spaces = result.perSpace?.length ?? 0;\n\tconst across = spaces > 0 ? ` across ${spaces} contract space${spaces === 1 ? \"\" : \"s\"}` : \"\";\n\tif (executed === 0) return `Database already matches contract${across}`;\n\treturn `Applied ${executed} operation(s)${across}`;\n}\nfunction planBlocks$1(result) {\n\tconst planned = result.plannedAdvanceRef;\n\treturn [\n\t\t{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: planSummaryText(result)\n\t\t},\n\t\t...plannerWarningBlocks(result),\n\t\t...operationBlocks$2(result),\n\t\t{\n\t\t\tkind: \"fields\",\n\t\t\trows: [{\n\t\t\t\tlabel: \"destination\",\n\t\t\t\tvalue: [{\n\t\t\t\t\ttext: result.plan.destination.storageHash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t}]\n\t\t},\n\t\t...planned === null || planned === void 0 ? [] : [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: [{ text: `Would advance ref \"${planned.name}\" → ` }, {\n\t\t\t\ttext: planned.hash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}],\n\t\t...previewBlocks$2(result.plan.preview),\n\t\t{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttone: \"muted\",\n\t\t\ttext: \"This is a dry run. No changes were applied.\"\n\t\t}\n\t];\n}\n/**\n* The app-space marker, for a result that carried no per-space breakdown. The\n* label names what the marker covers rather than calling it \"the\" signature.\n*/\nfunction fallbackMarkerBlocks(result) {\n\tconst marker = result.marker;\n\tif (marker === void 0 || result.perSpace !== void 0 && result.perSpace.length > 0) return [];\n\treturn [{\n\t\tkind: \"fields\",\n\t\trows: [{\n\t\t\tlabel: \"App-space marker\",\n\t\t\tvalue: [{\n\t\t\t\ttext: marker.storageHash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}, ...marker.profileHash === void 0 ? [] : [{\n\t\t\tlabel: \"Profile hash\",\n\t\t\tvalue: [{\n\t\t\t\ttext: marker.profileHash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}]]\n\t}];\n}\nfunction applyBlocks(result) {\n\tconst advanced = result.advancedRef;\n\treturn [\n\t\t{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: applySummaryText(result)\n\t\t},\n\t\t...plannerWarningBlocks(result),\n\t\t...operationBlocks$2(result),\n\t\t...fallbackMarkerBlocks(result),\n\t\t...advanced === null || advanced === void 0 ? [] : [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [{ text: `Advanced ref \"${advanced.name}\" → ` }, {\n\t\t\t\ttext: advanced.hash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}]\n\t];\n}\n/** What a `db init` / `db update` result looks like in human mode. */\nfunction migrationResultBlocks(result) {\n\treturn result.mode === \"plan\" ? planBlocks$1(result) : applyBlocks(result);\n}\n/** Where the user goes next, as typed actions rather than trailing prose. */\nfunction migrationResultNextActions(result, applyCommand) {\n\treturn result.mode === \"plan\" ? [runCommandAction(\"Apply the planned operations\", applyCommand)] : [runCommandAction(result.perSpace !== void 0 && result.perSpace.length === 1 ? \"Confirm the space is up to date\" : \"Confirm every space is up to date\", \"prisma-cli migration status\")];\n}\n//#endregion\n//#region src/orm/migration/paths.ts\n/**\n* Where migrations live for this project. Resolved against the invocation\n* directory, which is also the config file's directory for every default\n* invocation.\n*/\nfunction migrationsDirFor(config, cwd) {\n\treturn resolve(cwd, config.migrations?.dir ?? \"migrations\");\n}\n/** The app subspace under {@link migrationsDirFor}. */\nfunction appMigrationsDirFor(config, cwd) {\n\treturn spaceMigrationDirectory(migrationsDirFor(config, cwd), APP_SPACE_ID);\n}\n/**\n* The config file an operation should anchor its project paths on. The engine\n* loads the config and hands a handler the value but not the path, and\n* `--config` is an engine flag the handler never sees, so a handler names the\n* invocation directory's file. That equals the loaded file for every\n* invocation whose config sits in the invocation directory.\n*/\nfunction projectConfigPathFor(cwd) {\n\treturn resolve(cwd, \"prisma.config.ts\");\n}\n/**\n* Where refs live. The framework keeps them under the app subspace rather than\n* at the migrations root.\n*/\nfunction appRefsDirFor(config, cwd) {\n\treturn resolve(appMigrationsDirFor(config, cwd), \"refs\");\n}\n/**\n* The emitted contract. The config loader has already resolved\n* `contract.output` against the config file's directory, so this only has an\n* effect for a config handed in raw, as tests do.\n*/\nfunction contractPathFor(config, cwd) {\n\tconst output = config.contract?.output;\n\treturn output === void 0 ? void 0 : resolve(cwd, output);\n}\n/**\n* The header's rendering of a path: relative to where the user invoked the\n* CLI, as the commander shell rendered it against the config file.\n*/\nfunction displayPath(path, cwd) {\n\treturn relative(cwd, path);\n}\n//#endregion\n//#region src/orm/db/prepare.ts\n/** Reads the emitted contract as the raw document the control API validates. */\nasync function readContractDocument(contractPath) {\n\tlet content;\n\ttry {\n\t\tcontent = await readFile(contractPath, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(Reflect.get(Object(error), \"code\") === \"ENOENT\" ? errorFileNotFound(contractPath, {\n\t\t\twhy: `Contract file not found at ${contractPath}`,\n\t\t\tfix: \"Run `prisma-cli contract emit` to generate contract.json, or update `contract.output` in prisma.config.ts\"\n\t\t}) : errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}` })));\n\t}\n\ttry {\n\t\treturn ok$1(castAs(JSON.parse(content)));\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(errorContractValidationFailed(`Contract JSON is invalid: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPath } })));\n\t}\n}\nasync function prepareMigrationRun(inputs) {\n\tconst { config, cwd, commandName } = inputs;\n\tconst contractPath = contractPathFor(config, cwd);\n\tif (contractPath === void 0) return notOk$1(normalizeError(errorConfigValidation(\"contract.output\", {\n\t\twhy: `${commandName} reads the emitted contract from config.contract.output; the config has no value to read.`,\n\t\tsection: \"contract\"\n\t})));\n\tconst contract = await readContractDocument(contractPath);\n\tif (!contract.ok) return notOk$1(contract.failure);\n\tconst dbConnection = inputs.db ?? config.db?.connection;\n\tif (dbConnection === void 0) return notOk$1(normalizeError(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${commandName} (set db.connection in prisma.config.ts, or pass --db <url>)`,\n\t\tcommandName,\n\t\tmissingFlags: [\"--db\"]\n\t})));\n\tif (config.driver === void 0) return notOk$1(normalizeError(errorDriverRequired({ why: `Config.driver is required for ${commandName}` })));\n\tif (!targetSupportsMigrations(config.target)) return notOk$1(normalizeError(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` })));\n\treturn ok$1({\n\t\tclient: inputs.createClient({\n\t\t\tfamily: config.family,\n\t\t\ttarget: config.target,\n\t\t\tadapter: config.adapter,\n\t\t\tdriver: config.driver,\n\t\t\textensions: config.extensions ?? []\n\t\t}),\n\t\tcontractJson: contract.value,\n\t\tcontractPath,\n\t\tcontractDisplayPath: displayPath(contractPath, cwd),\n\t\tdbConnection,\n\t\tdatabase: typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0,\n\t\tmigrationsDir: migrationsDirFor(config, cwd),\n\t\trefsDir: appRefsDirFor(config, cwd)\n\t});\n}\n//#endregion\n//#region src/orm/db/init.ts\nfunction initPresentations$1(inputs) {\n\tconst { document, database, dryRun } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t},\n\t\t\t\t...database === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\tvalue: database\n\t\t\t\t}],\n\t\t\t\t...dryRun ? [{\n\t\t\t\t\tlabel: \"mode\",\n\t\t\t\t\tvalue: \"dry run\"\n\t\t\t\t}] : []\n\t\t\t]\n\t\t}, ...migrationResultBlocks(document)],\n\t\tjson: () => document,\n\t\tnext: () => migrationResultNextActions(document, \"prisma-cli db init\")\n\t};\n}\nfunction initDocument(inputs) {\n\tconst { value } = inputs;\n\treturn {\n\t\tok: true,\n\t\tmode: value.mode,\n\t\tplan: {\n\t\t\ttargetId: inputs.targetId,\n\t\t\tdestination: {\n\t\t\t\tstorageHash: value.destination.storageHash,\n\t\t\t\t...ifDefined(\"profileHash\", value.destination.profileHash)\n\t\t\t},\n\t\t\toperations: value.plan.operations.map((operation) => ({\n\t\t\t\tid: operation.id,\n\t\t\t\tlabel: operation.label,\n\t\t\t\toperationClass: operation.operationClass\n\t\t\t})),\n\t\t\t...ifDefined(\"preview\", value.plan.preview)\n\t\t},\n\t\t...value.execution === void 0 ? {} : { execution: {\n\t\t\toperationsPlanned: value.execution.operationsPlanned,\n\t\t\toperationsExecuted: value.execution.operationsExecuted\n\t\t} },\n\t\t...value.marker === void 0 ? {} : { marker: {\n\t\t\tstorageHash: value.marker.storageHash,\n\t\t\t...ifDefined(\"profileHash\", value.marker.profileHash)\n\t\t} },\n\t\t...ifDefined(\"perSpace\", value.perSpace),\n\t\tadvancedRef: inputs.advancedRef,\n\t\tplannedAdvanceRef: inputs.plannedAdvanceRef,\n\t\tsummary: value.summary,\n\t\ttimings: { total: Date.now() - inputs.startedAt }\n\t};\n}\nfunction createDbInitCommand(createClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Bootstrap a database to match the current contract and sign it\",\n\t\t\tdescription: \"Creates everything the emitted contract declares and the database does not\\nhave yet, using additive operations only. Structures already in place and\\ncompatible are left alone, a conflict that would need a destructive change\\nstops the run, and the database is signed with the contract it now matches.\\nUse --dry-run to see the operations without applying them.\",\n\t\t\texamples: [\n\t\t\t\t\"db init\",\n\t\t\t\t\"db init --db $DATABASE_URL\",\n\t\t\t\t\"db init --dry-run\",\n\t\t\t\t\"db init --advance-ref production\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\tdryRun: flag.boolean({ brief: \"Preview the planned operations without applying them\" }),\n\t\t\tadvanceRef: flag.string({\n\t\t\t\tbrief: \"Advance the named ref to the post-command contract hash\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst prepared = await prepareMigrationRun({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tcommandName: \"db init\",\n\t\t\t\tcreateClient\n\t\t\t});\n\t\t\tif (!prepared.ok) return notOk$1(prepared.failure);\n\t\t\tconst { client, contractJson, contractPath, dbConnection, migrationsDir, refsDir } = prepared.value;\n\t\t\tlet document;\n\t\t\ttry {\n\t\t\t\tawait client.connect(dbConnection);\n\t\t\t\tconst result = await client.dbInit({\n\t\t\t\t\tcontract: contractJson,\n\t\t\t\t\tmode: args.flags.dryRun ? \"plan\" : \"apply\",\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report)\n\t\t\t\t});\n\t\t\t\tif (!result.ok) return notOk$1(normalizeError(mapDbInitFailure(result.failure)));\n\t\t\t\tconst advancementHash = result.value.mode === \"apply\" ? result.value.marker?.storageHash ?? result.value.destination.storageHash : result.value.destination.storageHash;\n\t\t\t\tconst advancement = await resolveRefAdvancementFields({\n\t\t\t\t\t...ifDefined(\"advanceRef\", args.flags.advanceRef),\n\t\t\t\t\t...ifDefined(\"db\", args.flags.db),\n\t\t\t\t\trefsDir,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tcontractJson,\n\t\t\t\t\tcontractJsonPath: contractPath,\n\t\t\t\t\tmode: result.value.mode,\n\t\t\t\t\thash: advancementHash\n\t\t\t\t});\n\t\t\t\tif (!advancement.ok) return notOk$1(normalizeError(advancement.failure));\n\t\t\t\tdocument = initDocument({\n\t\t\t\t\tvalue: result.value,\n\t\t\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\t\t\tadvancedRef: advancement.value.advancedRef,\n\t\t\t\t\tplannedAdvanceRef: advancement.value.plannedAdvanceRef,\n\t\t\t\t\tstartedAt\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (CliStructuredError$2.is(error)) return notOk$1(normalizeError(error));\n\t\t\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk$1(normalizeError(errorContractValidationFailed(`Contract validation failed: ${error.message}`, { where: { path: contractPath } })));\n\t\t\t\tconst safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === \"string\" ? dbConnection : void 0);\n\t\t\t\treturn notOk$1(normalizeError(errorUnexpected(safeMessage, { why: `Unexpected error during db init: ${safeMessage}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"verbose\",\n\t\t\t\ttext: `Total time: ${document.timings.total}ms`\n\t\t\t});\n\t\t\treturn ok$1(ctx.present({ data: document }, initPresentations$1({\n\t\t\t\tdocument,\n\t\t\t\tcontractPath: prepared.value.contractDisplayPath,\n\t\t\t\tdatabase: prepared.value.database,\n\t\t\t\tdryRun: args.flags.dryRun\n\t\t\t})));\n\t\t}\n\t});\n}\nconst dbInitCommand = createDbInitCommand(createControlClient);\n//#endregion\n//#region src/orm/db/schema.ts\nconst SUMMARY = \"Schema read successfully\";\n/**\n* A leading keyword and the name it introduces: `<keyword> <name>`, or\n* `<keyword>: <name>`. The keyword recedes and the name is the identifier.\n*/\nfunction keywordThenName(label) {\n\tconst colon = label.match(/^(.+?):\\s*(\\S.*)$/);\n\tif (colon?.[1] !== void 0 && colon[2] !== void 0) return [\n\t\t{\n\t\t\ttext: colon[1],\n\t\t\ttone: \"muted\"\n\t\t},\n\t\t{ text: \": \" },\n\t\t{\n\t\t\ttext: colon[2],\n\t\t\ttone: \"identifier\"\n\t\t}\n\t];\n\tconst spaced = label.match(/^(\\S.*\\S|\\S+)\\s+(\\S+)$/);\n\tif (spaced?.[1] !== void 0 && spaced[2] !== void 0) return [\n\t\t{\n\t\t\ttext: spaced[1],\n\t\t\ttone: \"muted\"\n\t\t},\n\t\t{ text: \" \" },\n\t\t{\n\t\t\ttext: spaced[2],\n\t\t\ttone: \"identifier\"\n\t\t}\n\t];\n}\n/** `<name>: <detail> (<qualifier>)` — the name leads and the qualifier recedes. */\nfunction namedDetail(label) {\n\tconst parts = label.match(/^([^:]+):\\s*(.+)$/);\n\tif (parts?.[1] === void 0 || parts[2] === void 0) return;\n\tconst [, name, rest] = parts;\n\tconst qualified = rest.match(/^([^\\s(]+)\\s*(\\([^)]+\\))$/);\n\tif (qualified?.[1] !== void 0 && qualified[2] !== void 0) return [\n\t\t{\n\t\t\ttext: name,\n\t\t\ttone: \"identifier\"\n\t\t},\n\t\t{ text: `: ${qualified[1]} ` },\n\t\t{\n\t\t\ttext: qualified[2],\n\t\t\ttone: \"muted\"\n\t\t}\n\t];\n\treturn [{\n\t\ttext: name,\n\t\ttone: \"identifier\"\n\t}, { text: `: ${rest}` }];\n}\n/** `<name> <rest>` — the name leads and the prose behind it recedes. */\nfunction nameThenProse(label) {\n\tconst parts = label.match(/^(\\S+)\\s+(\\S.*)$/);\n\tif (parts?.[1] === void 0 || parts[2] === void 0) return;\n\treturn [\n\t\t{\n\t\t\ttext: parts[1],\n\t\t\ttone: \"identifier\"\n\t\t},\n\t\t{ text: \" \" },\n\t\t{\n\t\t\ttext: parts[2],\n\t\t\ttone: \"muted\"\n\t\t}\n\t];\n}\n/**\n* What a schema node's label means, said in tones.\n*\n* The families phrase these labels themselves, so the shapes recognised here\n* are positional (`<keyword> <name>`, `<name>: <detail>`) rather than a list of\n* words: a family that renames a keyword keeps its colouring, and no family's\n* vocabulary is written down in the framework layer.\n*/\nfunction labelSpans(node) {\n\tswitch (node.kind) {\n\t\tcase \"root\": return [{\n\t\t\ttext: node.label,\n\t\t\ttone: \"emphasis\"\n\t\t}];\n\t\tcase \"collection\": return [{\n\t\t\ttext: node.label,\n\t\t\ttone: \"muted\"\n\t\t}];\n\t\tcase \"entity\":\n\t\tcase \"index\": return keywordThenName(node.label) ?? [{\n\t\t\ttext: node.label,\n\t\t\ttone: \"identifier\"\n\t\t}];\n\t\tcase \"field\": return namedDetail(node.label) ?? [{ text: node.label }];\n\t\tcase \"dependency\": return nameThenProse(node.label) ?? [{\n\t\t\ttext: node.label,\n\t\t\ttone: \"identifier\"\n\t\t}];\n\t\tdefault: return [{ text: node.label }];\n\t}\n}\nfunction treeNode(node) {\n\treturn {\n\t\tlabel: labelSpans(node),\n\t\t...ifDefined(\"children\", node.children === void 0 || node.children.length === 0 ? void 0 : node.children.map(treeNode))\n\t};\n}\nfunction schemaPresentations$1(inputs) {\n\tconst { document, schemaView, database } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [...database === void 0 ? [] : [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: database\n\t\t\t}]\n\t\t}], schemaView === void 0 ? {\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: document.summary\n\t\t} : {\n\t\t\tkind: \"tree\",\n\t\t\troots: [treeNode(schemaView.root)]\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createDbSchemaCommand(createClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Inspect the live database schema\",\n\t\t\tdescription: \"Reads the live database schema and prints it as a tree, or as the result\\ndocument with --json. Always read-only: it never writes a file and never\\nchanges the database.\",\n\t\t\texamples: [\n\t\t\t\t\"db schema\",\n\t\t\t\t\"db schema --db $DATABASE_URL\",\n\t\t\t\t\"db schema --json\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: { db: dbFlag } },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\t\tif (dbConnection === void 0) return notOk$1(normalizeError(errorDatabaseConnectionRequired({\n\t\t\t\twhy: \"Database connection is required for db schema (set db.connection in prisma.config.ts, or pass --db <url>)\",\n\t\t\t\tcommandName: \"db schema\",\n\t\t\t\tmissingFlags: [\"--db\"]\n\t\t\t})));\n\t\t\tif (ctx.config.driver === void 0) return notOk$1(normalizeError(errorDriverRequired({ why: \"Config.driver is required for db schema\" })));\n\t\t\tconst client = createClient({\n\t\t\t\tfamily: ctx.config.family,\n\t\t\t\ttarget: ctx.config.target,\n\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\tdriver: ctx.config.driver,\n\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t});\n\t\t\tlet schema;\n\t\t\tlet schemaView;\n\t\t\ttry {\n\t\t\t\tschema = await client.introspect({\n\t\t\t\t\tconnection: dbConnection,\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report)\n\t\t\t\t});\n\t\t\t\tschemaView = client.toSchemaView(schema);\n\t\t\t} catch (error) {\n\t\t\t\tif (CliStructuredError$2.is(error)) return notOk$1(normalizeError(error));\n\t\t\t\tconst safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === \"string\" ? dbConnection : void 0);\n\t\t\t\treturn notOk$1(normalizeError(errorUnexpected(safeMessage, { why: `Unexpected error during db schema: ${safeMessage}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tconst database = typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0;\n\t\t\tconst document = {\n\t\t\t\tok: true,\n\t\t\t\tsummary: SUMMARY,\n\t\t\t\ttarget: {\n\t\t\t\t\tfamilyId: ctx.config.family.familyId,\n\t\t\t\t\tid: ctx.config.target.targetId\n\t\t\t\t},\n\t\t\t\tschema,\n\t\t\t\tmeta: { ...ifDefined(\"dbUrl\", database) },\n\t\t\t\ttimings: { total: Date.now() - startedAt }\n\t\t\t};\n\t\t\treturn ok$1(ctx.present({ data: document }, schemaPresentations$1({\n\t\t\t\tdocument,\n\t\t\t\tschemaView,\n\t\t\t\tdatabase\n\t\t\t})));\n\t\t}\n\t});\n}\nconst dbSchemaCommand = createDbSchemaCommand(createControlClient);\n//#endregion\n//#region src/orm/db/verification.ts\n/**\n* Reads the emitted contract and hydrates it through the family's\n* `deserializeContract` seam, which is where every other on-disk contract read\n* in this CLI crosses into family types.\n*/\nasync function readEmittedContract(inputs) {\n\tconst path = contractPathFor(inputs.config, inputs.cwd);\n\tif (path === void 0) return notOk$1(normalizeError(errorConfigValidation(\"contract.output\", {\n\t\twhy: `${inputs.commandName} reads the emitted contract from config.contract.output; the config has no value to read.`,\n\t\tsection: \"contract\"\n\t})));\n\tconst relativePath = displayPath(path, inputs.cwd);\n\tlet content;\n\ttry {\n\t\tcontent = await readFile(path, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(Reflect.get(Object(error), \"code\") === \"ENOENT\" ? errorFileNotFound(path, {\n\t\t\twhy: `Contract file not found at ${path}`,\n\t\t\tfix: `Run \\`prisma-cli contract emit\\` to generate ${relativePath}, or update \\`contract.output\\` in prisma.config.ts`\n\t\t}) : errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}` })));\n\t}\n\tconst familyInstance = inputs.config.family.create(createControlStack(inputs.config));\n\ttry {\n\t\treturn ok$1({\n\t\t\tcontract: familyInstance.deserializeContract(castAs(JSON.parse(content))),\n\t\t\tpath,\n\t\t\tdisplayPath: relativePath\n\t\t});\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(errorContractValidationFailed(`Contract JSON is invalid: ${error instanceof Error ? error.message : String(error)}`, { where: { path } })));\n\t}\n}\n/**\n* The connection and driver both verification commands need. Returns the\n* resolved connection or the precondition failure that stopped the run.\n*/\nfunction requireVerifyConnection(inputs) {\n\tconst dbConnection = inputs.db ?? inputs.config.db?.connection;\n\tif (typeof dbConnection !== \"string\" || dbConnection.length === 0) return notOk$1(normalizeError(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${inputs.invocation} (set db.connection in prisma.config.ts, or pass --db <url>)`,\n\t\tmissingFlags: [\"--db\"],\n\t\tretryCommand: `prisma-cli ${inputs.invocation} --db <url>`\n\t})));\n\tif (inputs.config.driver === void 0) return notOk$1(normalizeError(errorDriverRequired({ why: `Config.driver is required for ${inputs.invocation}` })));\n\treturn ok$1(dbConnection);\n}\n/**\n* A failure the verification could not recover from — a dropped connection, a\n* driver throw — as a settlement the user can act on. Connection strings are\n* stripped from the prose whichever path the value took. A driver error\n* carrying `ECONNREFUSED`, `ENOTFOUND` or a SQLSTATE has a `code` and takes\n* the first path, and its message is exactly the one likely to quote the URL.\n*/\nfunction verificationThrow(inputs) {\n\tconst { error } = inputs;\n\tconst message = error instanceof Error ? error.message : String(error);\n\treturn withoutConnectionString(typeof error === \"object\" && error !== null && \"code\" in error ? normalizeError(error) : normalizeError(errorUnexpected(message, { why: `Unexpected error during ${inputs.invocation}: ${message}` })), inputs.connection);\n}\n/**\n* The same envelope with the connection string stripped from every field the\n* settlement serializes: the prose, each next action's strings, and every\n* string reachable through `meta`. A driver error quotes the URL wherever it\n* pleases, so nothing user-facing passes through unstripped.\n*/\nfunction withoutConnectionString(error, connection) {\n\tconst clean = (text) => sanitizeErrorMessage(text, connection);\n\treturn new CliStructuredError$1(error.code, clean(error.message), {\n\t\tseverity: error.severity,\n\t\tnextActions: error.nextActions.map((action) => cleanNextAction(action, clean)),\n\t\t...ifDefined(\"why\", error.why === void 0 ? void 0 : clean(error.why)),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta === void 0 ? void 0 : cleanMetaRecord(error.meta, clean)),\n\t\t...ifDefined(\"docsUrl\", error.docsUrl),\n\t\tcause: error.cause\n\t});\n}\nfunction cleanNextAction(action, clean) {\n\treturn {\n\t\tkind: action.kind,\n\t\tlabel: clean(action.label),\n\t\t...ifDefined(\"command\", action.command === void 0 ? void 0 : clean(action.command)),\n\t\t...ifDefined(\"commands\", action.commands?.map(clean)),\n\t\t...ifDefined(\"url\", action.url === void 0 ? void 0 : clean(action.url)),\n\t\t...ifDefined(\"reason\", action.reason === void 0 ? void 0 : clean(action.reason))\n\t};\n}\nfunction cleanMetaValue(value, clean) {\n\tif (typeof value === \"string\") return clean(value);\n\tif (Array.isArray(value)) return value.map((entry) => cleanMetaValue(entry, clean));\n\tif (typeof value === \"object\" && value !== null) return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, cleanMetaValue(entry, clean)]));\n\treturn value;\n}\nfunction cleanMetaRecord(meta, clean) {\n\treturn Object.fromEntries(Object.entries(meta).map(([key, value]) => [key, cleanMetaValue(value, clean)]));\n}\nconst OUTCOME_LABEL = {\n\t\"not-found\": \"missing\",\n\t\"not-expected\": \"extra\",\n\t\"not-equal\": \"mismatch\"\n};\n/** What a diff issue says, in the words the commander shell used. */\nfunction issueLabel(issue) {\n\treturn `${OUTCOME_LABEL[issueOutcome(issue)]}: ${issue.path.join(\"/\")}`;\n}\nfunction issueNodes(issues, status) {\n\treturn issues.map((issue) => ({\n\t\tlabel: issueLabel(issue),\n\t\tstatus\n\t}));\n}\n/**\n* The drift, laid out as a tree the engine draws: one root per finding family,\n* one child per element. The engine owns the connectors and the status glyphs,\n* so nothing here carries an escape sequence.\n*/\nfunction schemaFindingBlocks(inputs) {\n\tconst roots = [];\n\tconst issues = inputs.result.schema.issues;\n\tif (issues.length > 0) roots.push({\n\t\tlabel: \"Schema issues\",\n\t\tstatus: \"error\",\n\t\tchildren: issueNodes(issues, \"error\")\n\t});\n\tconst warnings = inputs.result.schema.warnings?.issues ?? [];\n\tif (warnings.length > 0) roots.push({\n\t\tlabel: \"Schema warnings\",\n\t\tstatus: \"warn\",\n\t\tchildren: issueNodes(warnings, \"warn\")\n\t});\n\tif (inputs.unclaimed.length > 0) {\n\t\tconst status = inputs.strict ? \"error\" : \"warn\";\n\t\troots.push({\n\t\t\tlabel: \"Unclaimed elements (declared by no contract)\",\n\t\t\tstatus,\n\t\t\tchildren: inputs.unclaimed.map((name) => ({\n\t\t\t\tlabel: name,\n\t\t\t\tstatus\n\t\t\t}))\n\t\t});\n\t}\n\treturn roots.length === 0 ? [] : [{\n\t\tkind: \"tree\",\n\t\troots\n\t}];\n}\n/**\n* A failed schema-verification verdict as one envelope diagnostic. `error` is\n* the honest severity: the database does not satisfy the contract. It is legal\n* because both commands settle at exit 4 — the engine refuses a\n* severity-`error` diagnostic only on a run that exits 0.\n*/\nfunction schemaVerdictDiagnostic(inputs) {\n\tconst code = inputs.result.code;\n\tconst dotted = code !== void 0 && isStructuredErrorCode(code);\n\tconst issues = inputs.result.schema.issues.map(issueLabel);\n\treturn {\n\t\tcode: dotted ? code : \"CONTRACT.VERIFY_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: inputs.result.summary,\n\t\t...issues.length === 0 ? {} : { why: `The live schema differs: ${issues.join(\"; \")}.` },\n\t\tnextActions: inputs.nextActions,\n\t\tmeta: {\n\t\t\t...inputs.space === void 0 ? {} : { space: inputs.space },\n\t\t\tissues,\n\t\t\t...dotted || code === void 0 ? {} : { code }\n\t\t}\n\t};\n}\n//#endregion\n//#region src/orm/db/sign.ts\n/**\n* Verification ran and refused the signature. The command completed — it\n* answered the question \"may this database be signed?\" — so the refusal is a\n* diagnostic on a completed envelope rather than an error.\n*/\nconst FINDINGS_EXIT_CODE$2 = 4;\n/** The config file this bin reads; the handler is not told which one was loaded. */\nconst CONFIG_DISPLAY_PATH = \"prisma.config.ts\";\nfunction headerBlock$1(inputs) {\n\treturn {\n\t\tkind: \"fields\",\n\t\trail: true,\n\t\trows: [{\n\t\t\tlabel: \"contract\",\n\t\t\tvalue: inputs.contract\n\t\t}, {\n\t\t\tlabel: \"database\",\n\t\t\tvalue: inputs.database\n\t\t}]\n\t};\n}\nfunction signPresentations(inputs) {\n\tconst marker = inputs.document.marker;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\tinputs.header,\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Database signed\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: marker.previous?.storageHash === void 0 ? [{\n\t\t\t\t\t\ttext: \"none\",\n\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t}] : [{\n\t\t\t\t\t\ttext: marker.previous.storageHash,\n\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t}]\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: [{\n\t\t\t\t\t\ttext: inputs.document.contract.storageHash,\n\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t}]\n\t\t\t\t}]\n\t\t\t}\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\nfunction refusedPresentations(inputs) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\tinputs.header,\n\t\t\t...schemaFindingBlocks({\n\t\t\t\tresult: inputs.document,\n\t\t\t\tunclaimed: [],\n\t\t\t\tstrict: false\n\t\t\t}),\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"error\",\n\t\t\t\ttext: inputs.document.summary\n\t\t\t}\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\n/**\n* Builds the command with its control-client factory injected, so tests mount\n* the same tree over a fake client instead of mocking the client module.\n*/\nfunction createDbSignCommand(createClient = createControlClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Sign the database with your contract so you can safely run queries\",\n\t\t\tdescription: \"Verifies that your database schema satisfies the emitted contract, and if\\nso, writes or updates the database signature. Idempotent and safe to run\\nin CI or a deployment pipeline. The signature records that this database\\ninstance is aligned with a specific contract version.\\nExit codes: 0 = signed, 2 = the command could not run (unresolvable\\ncontract reference, no emitted contract, unreachable database),\\n4 = schema verification failed and no signature was written.\",\n\t\t\texamples: [\n\t\t\t\t\"db sign\",\n\t\t\t\t\"db sign --db $DATABASE_URL\",\n\t\t\t\t\"db sign production --db $DATABASE_URL\",\n\t\t\t\t\"db sign --contract production --db $DATABASE_URL\"\n\t\t\t]\n\t\t},\n\t\targs: {\n\t\t\tpositionals: { contract: positional.optionalString({\n\t\t\t\tbrief: \"Contract reference (hash, prefix, ref name, or migration dir name)\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t}) },\n\t\t\tflags: {\n\t\t\t\tdb: dbFlag,\n\t\t\t\tcontract: flag.string({\n\t\t\t\t\tbrief: \"Contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\",\n\t\t\t\t\tplaceholder: \"contract\"\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tneeds: { config: ormConfigSection },\n\t\texitCodes: { 4: \"schema verification failed; no signature was written\" },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst positionalContract = args.positionals.contract;\n\t\t\tconst flagContract = args.flags.contract;\n\t\t\tif (positionalContract !== void 0 && flagContract !== void 0) return notOk$1(normalizeError(errorContractArgConflict({\n\t\t\t\tpositional: positionalContract,\n\t\t\t\tflag: flagContract\n\t\t\t})));\n\t\t\tconst contractRef = positionalContract ?? flagContract;\n\t\t\tconst emitted = await readEmittedContract({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tcommandName: \"db sign\"\n\t\t\t});\n\t\t\tif (!emitted.ok) return notOk$1(emitted.failure);\n\t\t\tlet contractInput = emitted.value.contract;\n\t\t\tif (contractRef !== void 0) {\n\t\t\t\tconst resolvedRef = await resolveContractRefToSnapshot({\n\t\t\t\t\tconfig: ctx.config,\n\t\t\t\t\tmigrationsDir: migrationsDirFor(ctx.config, ctx.cwd),\n\t\t\t\t\trefInput: contractRef,\n\t\t\t\t\tcontractPathAbsolute: emitted.value.path,\n\t\t\t\t\tfallbackToEmitted: true\n\t\t\t\t});\n\t\t\t\tif (!resolvedRef.ok) return notOk$1(normalizeError(resolvedRef.failure));\n\t\t\t\tcontractInput = resolvedRef.value.contractJson;\n\t\t\t}\n\t\t\tconst connection = requireVerifyConnection({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tinvocation: \"db sign\"\n\t\t\t});\n\t\t\tif (!connection.ok) return notOk$1(connection.failure);\n\t\t\tconst dbConnection = connection.value;\n\t\t\tconst header = headerBlock$1({\n\t\t\t\tcontract: contractRef ?? emitted.value.displayPath,\n\t\t\t\tdatabase: maskConnectionUrl(dbConnection)\n\t\t\t});\n\t\t\tconst client = createClient({\n\t\t\t\tfamily: ctx.config.family,\n\t\t\t\ttarget: ctx.config.target,\n\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t});\n\t\t\tconst onProgress = controlProgressReporter(ctx.report);\n\t\t\ttry {\n\t\t\t\tconst verified = await client.schemaVerify({\n\t\t\t\t\tcontract: contractInput,\n\t\t\t\t\tstrict: false,\n\t\t\t\t\tconnection: dbConnection,\n\t\t\t\t\tonProgress\n\t\t\t\t});\n\t\t\t\tif (!verified.ok) {\n\t\t\t\t\tconst document = verified;\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: FINDINGS_EXIT_CODE$2,\n\t\t\t\t\t\tdiagnostics: [schemaVerdictDiagnostic({\n\t\t\t\t\t\t\tresult: verified,\n\t\t\t\t\t\t\tspace: void 0,\n\t\t\t\t\t\t\tnextActions: [runCommandAction(\"Bring the database up to the contract, then sign again\", \"prisma-cli db update\")]\n\t\t\t\t\t\t})]\n\t\t\t\t\t}, refusedPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst signed = await client.sign({\n\t\t\t\t\tcontract: contractInput,\n\t\t\t\t\tcontractPath: displayPath(emitted.value.path, ctx.cwd),\n\t\t\t\t\tconfigPath: CONFIG_DISPLAY_PATH,\n\t\t\t\t\tonProgress\n\t\t\t\t});\n\t\t\t\tif (!signed.ok) throw new InternalError(`The family returned a sign result that did not sign: ${signed.summary}`);\n\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\tdata: signed,\n\t\t\t\t\texitCode: 0\n\t\t\t\t}, signPresentations({\n\t\t\t\t\tdocument: signed,\n\t\t\t\t\theader\n\t\t\t\t})));\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn notOk$1(verificationThrow({\n\t\t\t\t\terror,\n\t\t\t\t\tinvocation: \"db sign\",\n\t\t\t\t\tconnection: dbConnection\n\t\t\t\t}));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t}\n\t});\n}\nconst dbSignCommand = createDbSignCommand();\n//#endregion\n//#region src/utils/db-update-failure.ts\n/**\n* A `db update` failure as the CLI's structured error.\n*\n* `DESTRUCTIVE_CHANGES` is handled by the command, which asks for consent and\n* calls again; it is mapped here for the case the control API returns it from a\n* call that already carried consent, which would otherwise degrade silently.\n*\n* The `assertNever` is deliberate: a control-API failure code this does not\n* handle must stop the command rather than degrade into a generic message.\n*/\nfunction mapDbUpdateFailure(failure) {\n\tif (failure.code === \"PLANNING_FAILED\") return errorMigrationPlanningFailed({ conflicts: failure.conflicts ?? [] });\n\tif (failure.code === \"RUNNER_FAILED\") {\n\t\tconst fix = (typeof failure.meta?.[\"runnerErrorCode\"] === \"string\" ? failure.meta[\"runnerErrorCode\"] : void 0) === \"MIGRATION.LEGACY_MARKER_SHAPE\" ? \"Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma-cli db init` to recreate it with the current per-space schema.\" : \"Inspect the reported conflict, reconcile schema drift if needed, then re-run `prisma-cli db update`\";\n\t\treturn errorRunnerFailed(failure.summary, {\n\t\t\twhy: failure.why ?? \"Migration runner failed\",\n\t\t\tfix,\n\t\t\tmeta: {\n\t\t\t\t...failure.meta,\n\t\t\t\t...failure.warnings && failure.warnings.length > 0 ? { plannerWarnings: failure.warnings } : {}\n\t\t\t},\n\t\t\t...ifDefined(\"cause\", failure.cause)\n\t\t});\n\t}\n\tif (failure.code === \"DESTRUCTIVE_CHANGES\") return errorDestructiveChanges(failure.summary, {\n\t\t...ifDefined(\"why\", failure.why),\n\t\tfix: \"Re-run `prisma-cli db update` and type the database name when asked, or pass `--no-interactive --confirm <database>` where there is nobody to ask. Use `--dry-run` to preview the operations first.\",\n\t\t...failure.destructiveChanges ? { meta: {\n\t\t\tdestructiveOperations: failure.destructiveChanges.destructiveOperations,\n\t\t\tdatabaseName: failure.destructiveChanges.databaseName,\n\t\t\tplanHash: failure.destructiveChanges.planHash\n\t\t} } : {}\n\t});\n\tif (failure.code === \"CONSENT_PLAN_MISMATCH\") return errorConsentPlanMismatch({\n\t\tconsentedPlanHash: failure.consentPlanMismatch?.consentedPlanHash ?? \"\",\n\t\tplanHash: failure.consentPlanMismatch?.planHash ?? \"\",\n\t\t...ifDefined(\"why\", failure.why)\n\t});\n\tconst exhaustive = failure.code;\n\treturn assertNever(exhaustive, `Unhandled DbUpdateFailure code: ${String(exhaustive)}`);\n}\n//#endregion\n//#region src/orm/db/consent.ts\n/**\n* A token nobody can type is not consent: an empty one makes the engine's\n* type-to-confirm accept a bare Enter, and `--confirm \"\"` grant outright.\n*/\nfunction errorConsentTokenUnresolved(targetId) {\n\treturn new CliStructuredError$1(\"CLI.CONSENT_TOKEN_UNRESOLVED\", \"The database this run would change has no name to confirm.\", {\n\t\twhy: `The connected database reports no name, and the target id \"${targetId}\" yields none either, so the consent prompt has nothing to ask you to type and the destructive operations cannot be authorised.`,\n\t\tnextActions: [{\n\t\t\tkind: \"user-choice\",\n\t\t\tlabel: \"Name the database in `db.connection` (or pass `--db <url>`) and run `prisma-cli db update` again.\"\n\t\t}]\n\t});\n}\n/** A prompt that names nothing cannot be consented to knowingly. */\nfunction errorConsentOperationsMissing() {\n\treturn new CliStructuredError$1(\"CLI.CONSENT_OPERATIONS_MISSING\", \"The plan was refused as destructive but named no operations to confirm.\", {\n\t\twhy: \"The consent prompt has to list what is about to be destroyed, and the refusal carried no operations to list.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Preview the plan\",\n\t\t\tcommand: \"prisma-cli db update --dry-run\"\n\t\t}]\n\t});\n}\n/** The question the user answers before anything is dropped. */\nfunction destructiveConsentQuestion(operations, token) {\n\tconst listed = operations.map((operation) => ` - ${operation.label}`).join(\"\\n\");\n\treturn [`Apply ${operations.length} destructive operation(s) to ${token}? Data they remove cannot be recovered:`, listed].join(\"\\n\");\n}\n//#endregion\n//#region src/orm/db/update.ts\nfunction updatePresentations(inputs) {\n\tconst { document, database, dryRun } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t},\n\t\t\t\t...database === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\tvalue: database\n\t\t\t\t}],\n\t\t\t\t...inputs.to === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: inputs.to\n\t\t\t\t}],\n\t\t\t\t...dryRun ? [{\n\t\t\t\t\tlabel: \"mode\",\n\t\t\t\t\tvalue: \"dry run\"\n\t\t\t\t}] : []\n\t\t\t]\n\t\t}, ...migrationResultBlocks(document)],\n\t\tjson: () => document,\n\t\tnext: () => migrationResultNextActions(document, \"prisma-cli db update\")\n\t};\n}\nfunction updateDocument(inputs) {\n\tconst { value } = inputs;\n\treturn {\n\t\tok: true,\n\t\tmode: value.mode,\n\t\tplan: {\n\t\t\ttargetId: inputs.targetId,\n\t\t\tdestination: {\n\t\t\t\tstorageHash: value.destination.storageHash,\n\t\t\t\t...ifDefined(\"profileHash\", value.destination.profileHash)\n\t\t\t},\n\t\t\toperations: value.plan.operations.map((operation) => ({\n\t\t\t\tid: operation.id,\n\t\t\t\tlabel: operation.label,\n\t\t\t\toperationClass: operation.operationClass\n\t\t\t})),\n\t\t\t...ifDefined(\"preview\", value.plan.preview)\n\t\t},\n\t\t...value.execution === void 0 ? {} : { execution: {\n\t\t\toperationsPlanned: value.execution.operationsPlanned,\n\t\t\toperationsExecuted: value.execution.operationsExecuted\n\t\t} },\n\t\t...value.marker === void 0 ? {} : { marker: {\n\t\t\tstorageHash: value.marker.storageHash,\n\t\t\t...ifDefined(\"profileHash\", value.marker.profileHash)\n\t\t} },\n\t\t...ifDefined(\"perSpace\", value.perSpace),\n\t\t...ifDefined(\"warnings\", value.warnings),\n\t\tadvancedRef: inputs.advancedRef,\n\t\tplannedAdvanceRef: inputs.plannedAdvanceRef,\n\t\tsummary: value.summary,\n\t\ttimings: { total: Date.now() - inputs.startedAt }\n\t};\n}\nfunction createDbUpdateCommand(createClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Update your database schema to match your contract\",\n\t\t\tdescription: \"Compares the database to the emitted contract and applies the changes that\\nclose the gap, whether or not the database was bootstrapped with `db init`.\\nAn operation that would destroy data is applied only with your consent: the\\ncommand asks you to type the database name. A run with nobody to ask — a CI\\njob, or `--no-interactive` — takes it from `--confirm <database>` instead.\\nUse --dry-run to see the operations without applying them.\",\n\t\t\texamples: [\n\t\t\t\t\"db update\",\n\t\t\t\t\"db update --dry-run\",\n\t\t\t\t\"db update --no-interactive --confirm appdb\",\n\t\t\t\t\"db update --to production\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\tdryRun: flag.boolean({ brief: \"Preview the planned operations without applying them\" }),\n\t\t\tto: flag.string({\n\t\t\t\tbrief: \"Contract to update to (hash, prefix, ref name, migration dir name, or ./path)\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t}),\n\t\t\tadvanceRef: flag.string({\n\t\t\t\tbrief: \"Advance the named ref to the post-command contract hash\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst prepared = await prepareMigrationRun({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tcommandName: \"db update\",\n\t\t\t\tcreateClient\n\t\t\t});\n\t\t\tif (!prepared.ok) return notOk$1(prepared.failure);\n\t\t\tconst { client, contractPath, dbConnection, migrationsDir, refsDir } = prepared.value;\n\t\t\tlet contractJson = prepared.value.contractJson;\n\t\t\tlet snapshotContractPath = contractPath;\n\t\t\tif (args.flags.to !== void 0) {\n\t\t\t\tconst resolved = await resolveContractRefToSnapshot({\n\t\t\t\t\tconfig: ctx.config,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\trefInput: args.flags.to,\n\t\t\t\t\tcontractPathAbsolute: contractPath,\n\t\t\t\t\tfallbackToEmitted: false,\n\t\t\t\t\tmissingBundleFlag: \"--to\"\n\t\t\t\t});\n\t\t\t\tif (!resolved.ok) return notOk$1(normalizeError(resolved.failure));\n\t\t\t\tcontractJson = resolved.value.contractJson;\n\t\t\t\tsnapshotContractPath = resolved.value.contractJsonPath;\n\t\t\t}\n\t\t\tconst mode = args.flags.dryRun ? \"plan\" : \"apply\";\n\t\t\tlet document;\n\t\t\ttry {\n\t\t\t\tawait client.connect(dbConnection);\n\t\t\t\tconst update = (consent) => client.dbUpdate({\n\t\t\t\t\tcontract: contractJson,\n\t\t\t\t\tmode,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\t...consent === void 0 ? {} : { consent },\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report)\n\t\t\t\t});\n\t\t\t\tconst reported = /* @__PURE__ */ new Set();\n\t\t\t\tconst reportPlannerWarnings = (warnings) => {\n\t\t\t\t\tfor (const warning of warnings) if (!reported.has(warning.summary)) {\n\t\t\t\t\t\treported.add(warning.summary);\n\t\t\t\t\t\tctx.report({\n\t\t\t\t\t\t\tkind: \"message\",\n\t\t\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\t\t\ttext: warning.summary\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tlet result = await update();\n\t\t\t\tif (mode === \"apply\" && !result.ok && result.failure.code === \"DESTRUCTIVE_CHANGES\") {\n\t\t\t\t\treportPlannerWarnings(result.failure.warnings ?? []);\n\t\t\t\t\tconst refusal = result.failure.destructiveChanges;\n\t\t\t\t\tif (refusal === void 0 || refusal.destructiveOperations.length === 0) return notOk$1(normalizeError(errorConsentOperationsMissing()));\n\t\t\t\t\tconst token = refusal.databaseName ?? \"\";\n\t\t\t\t\tif (token.trim().length === 0) return notOk$1(normalizeError(errorConsentTokenUnresolved(ctx.config.target.targetId)));\n\t\t\t\t\tif (!await ctx.prompt.consent(destructiveConsentQuestion(refusal.destructiveOperations, token), { token })) return notOk$1(normalizeError(mapDbUpdateFailure(result.failure)));\n\t\t\t\t\tresult = await update({ planHash: refusal.planHash });\n\t\t\t\t}\n\t\t\t\tif (!result.ok) {\n\t\t\t\t\treportPlannerWarnings(result.failure.warnings ?? []);\n\t\t\t\t\treturn notOk$1(normalizeError(mapDbUpdateFailure(result.failure)));\n\t\t\t\t}\n\t\t\t\tconst advancementHash = result.value.mode === \"apply\" ? result.value.marker?.storageHash ?? result.value.destination.storageHash : result.value.destination.storageHash;\n\t\t\t\tconst advancement = await resolveRefAdvancementFields({\n\t\t\t\t\t...ifDefined(\"advanceRef\", args.flags.advanceRef),\n\t\t\t\t\t...ifDefined(\"db\", args.flags.db),\n\t\t\t\t\trefsDir,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tcontractJson,\n\t\t\t\t\tcontractJsonPath: snapshotContractPath,\n\t\t\t\t\tmode: result.value.mode,\n\t\t\t\t\thash: advancementHash\n\t\t\t\t});\n\t\t\t\tif (!advancement.ok) return notOk$1(normalizeError(advancement.failure));\n\t\t\t\tdocument = updateDocument({\n\t\t\t\t\tvalue: result.value,\n\t\t\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\t\t\tadvancedRef: advancement.value.advancedRef,\n\t\t\t\t\tplannedAdvanceRef: advancement.value.plannedAdvanceRef,\n\t\t\t\t\tstartedAt\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof CliStructuredError$1) throw error;\n\t\t\t\tif (CliStructuredError$2.is(error)) return notOk$1(normalizeError(error));\n\t\t\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk$1(normalizeError(errorContractValidationFailed(`Contract validation failed: ${error.message}`, { where: { path: contractPath } })));\n\t\t\t\tconst safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === \"string\" ? dbConnection : void 0);\n\t\t\t\treturn notOk$1(normalizeError(errorUnexpected(safeMessage, { why: `Unexpected error during db update: ${safeMessage}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"verbose\",\n\t\t\t\ttext: `Total time: ${document.timings.total}ms`\n\t\t\t});\n\t\t\treturn ok$1(ctx.present({ data: document }, updatePresentations({\n\t\t\t\tdocument,\n\t\t\t\tcontractPath: prepared.value.contractDisplayPath,\n\t\t\t\tdatabase: prepared.value.database,\n\t\t\t\tto: args.flags.to,\n\t\t\t\tdryRun: args.flags.dryRun\n\t\t\t})));\n\t\t}\n\t});\n}\nconst dbUpdateCommand = createDbUpdateCommand(createControlClient);\n//#endregion\n//#region src/utils/combine-verify-results.ts\n/**\n* Collapse the aggregate verifier's per-space contract-satisfaction results\n* into a single {@link VerifyDatabaseSchemaResult} for the CLI display\n* surface, and carry the deduplicated unclaimed-elements list alongside it.\n* Concatenates the issue lists across spaces; uses the app space's result as\n* the structural envelope (storage hash, target). Extras are already\n* stripped from each per-space result, so nothing here duplicates an\n* unclaimed element per space.\n*\n* **Unclaimed disposition.** In strict mode a non-empty `unclaimed` list fails\n* the combined verdict (`ok: false`); in lenient mode it is carried for\n* informational rendering only. The list itself is returned unchanged for the\n* renderer.\n*\n* **Summary policy.** Preserve the per-family phrasing whenever the\n* combined `ok` flag agrees with the app space's `ok` flag — this is\n* the common case (single-family deployments, single-app deployments)\n* and the family's \"satisfies / does not satisfy contract\" phrasing\n* stays user-visible. When the app passes but an extension fails (or\n* vice versa) the app's summary contradicts the envelope, so fall back\n* to the first failing space's summary. This keeps family phrasing\n* intact and the envelope internally consistent (`ok: false` ↔ failure\n* summary).\n*/\nfunction combineVerifyResults(perSpace, appSpaceId, strict, unclaimed) {\n\tconst appResult = perSpace.get(appSpaceId) ?? perSpace.values().next().value;\n\tif (appResult === void 0) throw new InternalError(\"Aggregate verifier returned no per-space verify results — this is a wiring bug.\");\n\tlet okAll = true;\n\tlet firstFailure;\n\tlet issues = [];\n\tlet warningIssues = [];\n\tfor (const [, result] of perSpace) {\n\t\tif (!result.ok) {\n\t\t\tokAll = false;\n\t\t\tif (firstFailure === void 0) firstFailure = result;\n\t\t}\n\t\tissues = [...issues, ...result.schema.issues];\n\t\twarningIssues = [...warningIssues, ...result.schema.warnings?.issues ?? []];\n\t}\n\tconst unclaimedFails = strict && unclaimed.length > 0;\n\tconst ok = okAll && !unclaimedFails;\n\tconst summary = okAll ? unclaimedFails ? `Database schema has ${unclaimed.length} unclaimed element${unclaimed.length === 1 ? \"\" : \"s\"} (not in any contract)` : appResult.summary : appResult.ok ? firstFailure?.summary ?? appResult.summary : appResult.summary;\n\treturn {\n\t\tresult: {\n\t\t\tok,\n\t\t\t...ok ? {} : { code: appResult.code ?? \"CONTRACT.MARKER_REQUIRED\" },\n\t\t\tsummary,\n\t\t\tcontract: appResult.contract,\n\t\t\ttarget: appResult.target,\n\t\t\tschema: {\n\t\t\t\tissues,\n\t\t\t\twarnings: { issues: warningIssues }\n\t\t\t},\n\t\t\tmeta: { strict },\n\t\t\ttimings: { total: 0 }\n\t\t},\n\t\tunclaimed\n\t};\n}\n//#endregion\n//#region src/orm/db/verify.ts\n/**\n* Verification ran and the database does not match the contract. The run did\n* the job it was asked to do, so this is a completed settlement carrying\n* diagnostics rather than an error.\n*/\nconst FINDINGS_EXIT_CODE$1 = 4;\nconst PUSH_THE_CONTRACT = runCommandAction(\"Push the contract to the database\", \"prisma-cli db update\");\nconst RECONCILE_BY_HAND = {\n\tkind: \"user-choice\",\n\tlabel: \"Or reconcile the differences by hand and verify again\"\n};\nfunction errorInvalidVerifyMode(options) {\n\treturn new CliStructuredError$1(\"CLI.INVALID_VERIFY_MODE\", \"Invalid verify mode\", {\n\t\twhy: options.why,\n\t\tnextActions: [{\n\t\t\tkind: \"user-choice\",\n\t\t\tlabel: options.choose\n\t\t}],\n\t\tdocsUrl: \"https://pris.ly/db-verify\"\n\t});\n}\nfunction resolveMode(flags) {\n\tif (flags.markerOnly && flags.schemaOnly) return notOk$1(errorInvalidVerifyMode({\n\t\twhy: \"`--marker-only` and `--schema-only` cannot be used together\",\n\t\tchoose: \"Choose one mode: omit both to check the marker and schema, use `--marker-only` to check only the marker, or use `--schema-only` to check only the live schema.\"\n\t}));\n\tif (flags.markerOnly && flags.strict) return notOk$1(errorInvalidVerifyMode({\n\t\twhy: \"`--strict` requires schema verification, but `--marker-only` skips it\",\n\t\tchoose: \"Remove `--strict`, or use `db verify` / `db verify --schema-only` when you want to check the live schema in strict mode.\"\n\t}));\n\tif (flags.schemaOnly) return ok$1(\"schema-only\");\n\treturn ok$1(flags.markerOnly ? \"marker-only\" : \"full\");\n}\nfunction modeLabel(mode, strict) {\n\tif (mode === \"marker-only\") return \"marker only\";\n\tconst strictness = strict ? \"strict\" : \"tolerant\";\n\treturn mode === \"schema-only\" ? `schema only (${strictness})` : `full (marker + schema, ${strictness})`;\n}\nfunction invocation(mode, strict) {\n\treturn [\n\t\t\"db verify\",\n\t\t...mode === \"marker-only\" ? [\"--marker-only\"] : [],\n\t\t...mode === \"schema-only\" ? [\"--schema-only\"] : [],\n\t\t...strict ? [\"--strict\"] : []\n\t].join(\" \");\n}\n/** The marker verdict as a finding, keeping the code the commander raised. */\nfunction markerFindingDiagnostic(result) {\n\tconst { ok: _ok, ...diagnostic } = normalizeError(markerFindingError(result)).toEnvelope();\n\treturn diagnostic;\n}\n/**\n* The aggregate verifier's per-space marker drift as a finding on a completed\n* run, keeping the `MIGRATION.CONTRACT_SPACE_VIOLATION` envelope it was\n* raised with.\n*/\nfunction markerDriftDiagnostic(drift) {\n\tconst { ok: _ok, ...diagnostic } = normalizeError(drift).toEnvelope();\n\treturn diagnostic;\n}\nfunction markerFindingError(result) {\n\tif (result.code === VERIFY_CODE_MARKER_MISSING) return errorMarkerMissing();\n\tif (result.code === VERIFY_CODE_HASH_MISMATCH) {\n\t\tif (!(result.marker?.storageHash === result.contract.storageHash)) return errorHashMismatch({\n\t\t\twhy: \"Contract storageHash does not match database marker\",\n\t\t\texpected: result.contract.storageHash,\n\t\t\t...ifDefined(\"actual\", result.marker?.storageHash)\n\t\t});\n\t\treturn errorHashMismatch({\n\t\t\twhy: !result.contract.profileHash || result.marker?.profileHash === result.contract.profileHash ? \"Contract hash does not match database marker\" : \"Contract profileHash does not match database marker\",\n\t\t\t...ifDefined(\"expected\", result.contract.profileHash),\n\t\t\t...ifDefined(\"actual\", result.marker?.profileHash)\n\t\t});\n\t}\n\tif (result.code === VERIFY_CODE_TARGET_MISMATCH) return errorTargetMismatch(result.target.expected, result.target.actual ?? \"unknown\");\n\treturn errorRuntime(\"CONTRACT.VERIFY_FAILED\", result.summary, {\n\t\twhy: \"Verification failed\",\n\t\tfix: \"Check contract and database state\"\n\t});\n}\nfunction verifyDocument(inputs) {\n\treturn {\n\t\tok: inputs.ok,\n\t\tsummary: inputs.summary,\n\t\tmode: inputs.mode,\n\t\tcontract: inputs.verified.contract,\n\t\t...ifDefined(\"marker\", inputs.verified.marker),\n\t\ttarget: inputs.verified.target,\n\t\t...ifDefined(\"missingCodecs\", inputs.verified.missingCodecs),\n\t\t...ifDefined(\"codecCoverageSkipped\", inputs.verified.codecCoverageSkipped),\n\t\t...ifDefined(\"schema\", inputs.schema),\n\t\t...ifDefined(\"unclaimed\", inputs.unclaimed),\n\t\t...ifDefined(\"warning\", inputs.warning),\n\t\tmeta: {\n\t\t\t...inputs.verified.meta ?? {},\n\t\t\tschemaVerification: inputs.schemaVerification\n\t\t},\n\t\ttimings: { total: inputs.elapsed }\n\t};\n}\nfunction schemaSummary(combined) {\n\treturn {\n\t\tsummary: combined.result.summary,\n\t\tstrict: combined.result.meta?.strict ?? false,\n\t\twarnings: (combined.result.schema.warnings?.issues ?? []).map((issue) => issue.path.join(\"/\"))\n\t};\n}\nfunction headerBlock(inputs) {\n\treturn {\n\t\tkind: \"fields\",\n\t\trail: true,\n\t\trows: [\n\t\t\t{\n\t\t\t\tlabel: \"contract\",\n\t\t\t\tvalue: inputs.contractPath\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"mode\",\n\t\t\t\tvalue: modeLabel(inputs.mode, inputs.strict)\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: inputs.database\n\t\t\t}\n\t\t]\n\t};\n}\nfunction verifyPresentations(inputs) {\n\tconst document = inputs.document;\n\tconst warnings = document.schema?.warnings ?? [];\n\tconst unclaimed = document.unclaimed ?? [];\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\tinputs.header,\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: document.ok ? \"ok\" : \"error\",\n\t\t\t\ttext: document.summary\n\t\t\t},\n\t\t\t...document.ok ? [{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"storageHash\",\n\t\t\t\t\tvalue: document.contract.storageHash\n\t\t\t\t}, ...document.contract.profileHash === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"profileHash\",\n\t\t\t\t\tvalue: document.contract.profileHash\n\t\t\t\t}]]\n\t\t\t}] : [],\n\t\t\t...warnings.length === 0 && unclaimed.length === 0 ? [] : [{\n\t\t\t\tkind: \"tree\",\n\t\t\t\troots: [...warnings.length === 0 ? [] : [{\n\t\t\t\t\tlabel: \"Schema warnings\",\n\t\t\t\t\tstatus: \"warn\",\n\t\t\t\t\tchildren: warnings.map((message) => ({\n\t\t\t\t\t\tlabel: message,\n\t\t\t\t\t\tstatus: \"warn\"\n\t\t\t\t\t}))\n\t\t\t\t}], ...unclaimed.length === 0 ? [] : [{\n\t\t\t\t\tlabel: \"Unclaimed elements (declared by no contract)\",\n\t\t\t\t\tstatus: \"warn\",\n\t\t\t\t\tchildren: unclaimed.map((name) => ({\n\t\t\t\t\t\tlabel: name,\n\t\t\t\t\t\tstatus: \"warn\"\n\t\t\t\t\t}))\n\t\t\t\t}]]\n\t\t\t}],\n\t\t\t...document.warning === void 0 ? [] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\ttext: document.warning\n\t\t\t}]\n\t\t],\n\t\tjson: () => document\n\t};\n}\nfunction schemaPresentations(inputs) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\tinputs.header,\n\t\t\t...schemaFindingBlocks({\n\t\t\t\tresult: inputs.document,\n\t\t\t\tunclaimed: inputs.document.unclaimed,\n\t\t\t\tstrict: inputs.strict\n\t\t\t}),\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: inputs.document.ok ? \"ok\" : \"error\",\n\t\t\t\ttext: inputs.document.summary\n\t\t\t}\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\n/**\n* One diagnostic per contract space whose live schema does not satisfy its\n* contract, plus the combined verdict when only the unclaimed list failed it.\n*/\nfunction driftDiagnostics(inputs) {\n\tconst perSpace = [...inputs.perSpace].filter(([, result]) => !result.ok).map(([space, result]) => schemaVerdictDiagnostic({\n\t\tresult,\n\t\tspace,\n\t\tnextActions: [PUSH_THE_CONTRACT, RECONCILE_BY_HAND]\n\t}));\n\tif (perSpace.length > 0) return perSpace;\n\treturn [schemaVerdictDiagnostic({\n\t\tresult: inputs.combined.result,\n\t\tspace: void 0,\n\t\tnextActions: [{\n\t\t\tkind: \"user-choice\",\n\t\t\tlabel: \"Declare the unclaimed elements in a contract, or drop them from the database\"\n\t\t}]\n\t})];\n}\n/**\n* Builds the command with its control-client factory injected, so tests mount\n* the same tree over a fake client instead of mocking the client module.\n*/\nfunction createDbVerifyCommand(createClient = createControlClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Check whether the database marker and live schema match your contract\",\n\t\t\tdescription: \"Verifies the database marker first, then checks the database schema\\nmatches your contract. Use `--marker-only` for marker-only verification,\\n`--schema-only` to skip marker checks and inspect only the live schema,\\nand `--strict` to fail if the database includes elements not present in\\nthe contract.\\nExit codes: 0 = the database matches the contract, 2 = the check could\\nnot run (conflicting mode flags, no emitted contract, unreachable\\ndatabase), 4 = drift or a marker finding.\",\n\t\t\texamples: [\n\t\t\t\t\"db verify\",\n\t\t\t\t\"db verify --db $DATABASE_URL\",\n\t\t\t\t\"db verify --strict\",\n\t\t\t\t\"db verify --schema-only\",\n\t\t\t\t\"db verify --marker-only\",\n\t\t\t\t\"db verify --json\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\tmarkerOnly: flag.boolean({ brief: \"Skip schema verification and only check the database marker\" }),\n\t\t\tschemaOnly: flag.boolean({ brief: \"Skip marker verification and only check whether the live schema satisfies the contract\" }),\n\t\t\tstrict: flag.boolean({ brief: \"Treat schema elements not present in the contract as an error\" })\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\texitCodes: { 4: \"verification found drift or marker findings\" },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst strict = args.flags.strict;\n\t\t\tconst resolved = resolveMode({\n\t\t\t\tmarkerOnly: args.flags.markerOnly,\n\t\t\t\tschemaOnly: args.flags.schemaOnly,\n\t\t\t\tstrict\n\t\t\t});\n\t\t\tif (!resolved.ok) return notOk$1(resolved.failure);\n\t\t\tconst mode = resolved.value;\n\t\t\tconst commandInvocation = invocation(mode, strict);\n\t\t\tconst emitted = await readEmittedContract({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tcommandName: commandInvocation\n\t\t\t});\n\t\t\tif (!emitted.ok) return notOk$1(emitted.failure);\n\t\t\tconst connection = requireVerifyConnection({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tinvocation: commandInvocation\n\t\t\t});\n\t\t\tif (!connection.ok) return notOk$1(connection.failure);\n\t\t\tconst dbConnection = connection.value;\n\t\t\tconst header = headerBlock({\n\t\t\t\tcontractPath: emitted.value.displayPath,\n\t\t\t\tmode,\n\t\t\t\tstrict,\n\t\t\t\tdatabase: maskConnectionUrl(dbConnection)\n\t\t\t});\n\t\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\t\tconst client = createClient({\n\t\t\t\tfamily: ctx.config.family,\n\t\t\t\ttarget: ctx.config.target,\n\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t});\n\t\t\tconst onProgress = controlProgressReporter(ctx.report);\n\t\t\tconst startedAt = Date.now();\n\t\t\ttry {\n\t\t\t\tif (mode === \"schema-only\") {\n\t\t\t\t\tawait client.connect(dbConnection);\n\t\t\t\t\tconst aggregate = await client.dbVerify({\n\t\t\t\t\t\tcontract: emitted.value.contract,\n\t\t\t\t\t\tmigrationsDir,\n\t\t\t\t\t\tstrict,\n\t\t\t\t\t\tskipSchema: false,\n\t\t\t\t\t\tskipMarker: true,\n\t\t\t\t\t\tonProgress\n\t\t\t\t\t});\n\t\t\t\t\tif (!aggregate.ok) return notOk$1(normalizeError(aggregate.failure));\n\t\t\t\t\tconst combined = combineVerifyResults(aggregate.value.schemaResults, aggregate.value.appSpaceId, strict, aggregate.value.unclaimed);\n\t\t\t\t\tconst document = {\n\t\t\t\t\t\t...combined.result,\n\t\t\t\t\t\tunclaimed: combined.unclaimed\n\t\t\t\t\t};\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: combined.result.ok ? 0 : FINDINGS_EXIT_CODE$1,\n\t\t\t\t\t\tdiagnostics: combined.result.ok ? [] : driftDiagnostics({\n\t\t\t\t\t\t\tperSpace: aggregate.value.schemaResults,\n\t\t\t\t\t\t\tcombined\n\t\t\t\t\t\t})\n\t\t\t\t\t}, schemaPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader,\n\t\t\t\t\t\tstrict\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst verified = await client.verify({\n\t\t\t\t\tcontract: emitted.value.contract,\n\t\t\t\t\tconnection: dbConnection,\n\t\t\t\t\tonProgress\n\t\t\t\t});\n\t\t\t\tif (!verified.ok) {\n\t\t\t\t\tconst document = verifyDocument({\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\tmode,\n\t\t\t\t\t\tsummary: verified.summary,\n\t\t\t\t\t\tverified,\n\t\t\t\t\t\tschema: void 0,\n\t\t\t\t\t\tschemaVerification: \"skipped\",\n\t\t\t\t\t\tunclaimed: void 0,\n\t\t\t\t\t\twarning: void 0,\n\t\t\t\t\t\telapsed: Date.now() - startedAt\n\t\t\t\t\t});\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: FINDINGS_EXIT_CODE$1,\n\t\t\t\t\t\tdiagnostics: [markerFindingDiagnostic(verified)]\n\t\t\t\t\t}, verifyPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst aggregate = await client.dbVerify({\n\t\t\t\t\tcontract: emitted.value.contract,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tstrict,\n\t\t\t\t\tskipSchema: mode === \"marker-only\",\n\t\t\t\t\tskipMarker: false,\n\t\t\t\t\tonProgress\n\t\t\t\t});\n\t\t\t\tif (!aggregate.ok) return notOk$1(normalizeError(aggregate.failure));\n\t\t\t\tconst drift = aggregate.value.markerDrift;\n\t\t\t\tif (drift !== null) {\n\t\t\t\t\tconst driftCombined = mode === \"marker-only\" ? void 0 : combineVerifyResults(aggregate.value.schemaResults, aggregate.value.appSpaceId, strict, aggregate.value.unclaimed);\n\t\t\t\t\tconst document = verifyDocument({\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\tmode,\n\t\t\t\t\t\tsummary: normalizeError(drift).message,\n\t\t\t\t\t\tverified,\n\t\t\t\t\t\tschema: driftCombined === void 0 ? void 0 : schemaSummary(driftCombined),\n\t\t\t\t\t\tschemaVerification: driftCombined === void 0 ? \"skipped\" : \"performed\",\n\t\t\t\t\t\tunclaimed: driftCombined?.unclaimed,\n\t\t\t\t\t\twarning: void 0,\n\t\t\t\t\t\telapsed: Date.now() - startedAt\n\t\t\t\t\t});\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: FINDINGS_EXIT_CODE$1,\n\t\t\t\t\t\tdiagnostics: [markerDriftDiagnostic(drift), ...driftCombined !== void 0 && !driftCombined.result.ok ? driftDiagnostics({\n\t\t\t\t\t\t\tperSpace: aggregate.value.schemaResults,\n\t\t\t\t\t\t\tcombined: driftCombined\n\t\t\t\t\t\t}) : []]\n\t\t\t\t\t}, verifyPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tif (mode === \"marker-only\") {\n\t\t\t\t\tconst document = verifyDocument({\n\t\t\t\t\t\tok: true,\n\t\t\t\t\t\tmode,\n\t\t\t\t\t\tsummary: \"Database marker matches contract\",\n\t\t\t\t\t\tverified,\n\t\t\t\t\t\tschema: void 0,\n\t\t\t\t\t\tschemaVerification: \"skipped\",\n\t\t\t\t\t\tunclaimed: void 0,\n\t\t\t\t\t\twarning: \"Schema verification skipped because --marker-only was provided\",\n\t\t\t\t\t\telapsed: Date.now() - startedAt\n\t\t\t\t\t});\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: 0\n\t\t\t\t\t}, verifyPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst combined = combineVerifyResults(aggregate.value.schemaResults, aggregate.value.appSpaceId, strict, aggregate.value.unclaimed);\n\t\t\t\tif (!combined.result.ok) {\n\t\t\t\t\tconst document = {\n\t\t\t\t\t\t...combined.result,\n\t\t\t\t\t\tunclaimed: combined.unclaimed\n\t\t\t\t\t};\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: FINDINGS_EXIT_CODE$1,\n\t\t\t\t\t\tdiagnostics: driftDiagnostics({\n\t\t\t\t\t\t\tperSpace: aggregate.value.schemaResults,\n\t\t\t\t\t\t\tcombined\n\t\t\t\t\t\t})\n\t\t\t\t\t}, schemaPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader,\n\t\t\t\t\t\tstrict\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst document = verifyDocument({\n\t\t\t\t\tok: true,\n\t\t\t\t\tmode,\n\t\t\t\t\tsummary: \"Database marker and schema match contract\",\n\t\t\t\t\tverified,\n\t\t\t\t\tschema: schemaSummary(combined),\n\t\t\t\t\tschemaVerification: \"performed\",\n\t\t\t\t\tunclaimed: combined.unclaimed,\n\t\t\t\t\twarning: void 0,\n\t\t\t\t\telapsed: Date.now() - startedAt\n\t\t\t\t});\n\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\tdata: document,\n\t\t\t\t\texitCode: 0\n\t\t\t\t}, verifyPresentations({\n\t\t\t\t\tdocument,\n\t\t\t\t\theader\n\t\t\t\t})));\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn notOk$1(verificationThrow({\n\t\t\t\t\terror,\n\t\t\t\t\tinvocation: commandInvocation,\n\t\t\t\t\tconnection: dbConnection\n\t\t\t\t}));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t}\n\t});\n}\nconst dbVerifyCommand = createDbVerifyCommand();\n//#endregion\n//#region src/control-api/operations/format.ts\nfunction resolveNewline(formatterNewline, eol) {\n\tif (formatterNewline !== void 0) return formatterNewline;\n\treturn eol === \"\\r\\n\" ? \"CRLF\" : \"LF\";\n}\nasync function executeFormat(options) {\n\tconst eol = options.eol ?? EOL;\n\tconst config = options.config;\n\tconst source = config.contract?.source;\n\tif (source?.format !== \"psl\") return ok({ formatted: false });\n\tconst declaredPath = source.inputs?.[0];\n\tif (declaredPath === void 0) return ok({ formatted: false });\n\tconst inputPath = resolve(options.cwd, declaredPath);\n\tlet contents;\n\ttry {\n\t\tcontents = await readFile(inputPath, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"CONTRACT.SOURCE_LOAD_FAILED\", \"Failed to read contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} exists and is readable.`,\n\t\t\tcause: error\n\t\t}));\n\t}\n\tconst formatOptions = {\n\t\tindent: config.formatter?.indent ?? 2,\n\t\tnewline: resolveNewline(config.formatter?.newline, eol)\n\t};\n\tlet formatted;\n\ttry {\n\t\tformatted = format(contents, formatOptions);\n\t} catch (error) {\n\t\tif (isStructuredError(error) && error.code === \"PSL.PARSE_FAILED\") return notOk(errorRuntime(\"PSL.PARSE_FAILED\", \"Cannot format PSL with parse errors\", {\n\t\t\twhy: error.message,\n\t\t\tfix: \"Fix the parse errors in your schema and try again.\",\n\t\t\tmeta: { diagnostics: error.meta?.[\"diagnostics\"] },\n\t\t\tcause: error\n\t\t}));\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error)));\n\t}\n\ttry {\n\t\tawait writeFile(inputPath, formatted, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"CLI.FILE_WRITE_FAILED\", \"Failed to write formatted contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} is writable.`,\n\t\t\tcause: error\n\t\t}));\n\t}\n\treturn ok({\n\t\tformatted: true,\n\t\tpath: inputPath\n\t});\n}\n//#endregion\n//#region src/orm/format.ts\nconst NOTHING_TO_FORMAT = \"Nothing to format (contract source is not PSL).\";\nfunction formatPresentations(document, cwd) {\n\tconst path = document.path;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => document.formatted && path !== void 0 ? [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [{ text: \"Formatted \" }, {\n\t\t\t\ttext: relative(cwd, path),\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}] : [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: NOTHING_TO_FORMAT\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createFormatCommand(execute = executeFormat) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Format your PSL contract source\",\n\t\t\tdescription: \"Formats the Prisma schema (PSL) contract source declared in your config\\n(contract.source.inputs[0]) in place. Only runs when contract.source.format\\nis 'psl'; a TypeScript or unset source is left untouched. Indent and newline\\nare read from the optional formatter config section, defaulting to two\\nspaces and the system newline.\",\n\t\t\texamples: [\"format\", \"format --json\"]\n\t\t},\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (_args, ctx) => {\n\t\t\tconst result = await execute({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (!result.ok) return notOk$1(normalizeError(result.failure));\n\t\t\treturn ok$1(ctx.present({ data: result.value }, formatPresentations(result.value, ctx.cwd)));\n\t\t}\n\t});\n}\nconst formatCommand = createFormatCommand();\n//#endregion\n//#region src/commands/init/detect-pnpm-catalog.ts\n/**\n* Walks up from `baseDir` looking for `pnpm-workspace.yaml`, then scans\n* its top-level `catalog:` block for entries that match any of `packages`.\n*\n* Implements FR7.3 / Spec Decision 8 (honour-and-warn): when `init` runs\n* inside a pnpm workspace whose catalog overrides one of the packages it\n* installs, surface a structured warning so the user knows the catalog\n* version (not the published `latest`) is what ended up in their\n* `node_modules`. pnpm itself does this silently; the warning closes the\n* \"looks fine, must be wrong version six months later\" gap.\n*\n* Notes / scope:\n*\n* - We only inspect the unnamed top-level `catalog:` block. pnpm also\n* supports `catalogs:` (plural — *named* catalogs referenced via\n* `catalog:foo` specifiers); those don't apply to a vanilla\n* `pnpm add prisma-next` invocation, so we skip them.\n* - We don't validate YAML syntax exhaustively. The file format pnpm\n* ships is line-oriented and well-known; a minimal regex is more\n* robust than depending on a YAML parser for one warning.\n* - We don't compare against the registry's `latest` — pnpm uses the\n* catalog version regardless, so the warning fires whenever a match\n* exists. The user-facing copy explains how to opt out.\n*/\nfunction detectPnpmCatalogOverrides(baseDir, packages) {\n\tconst workspaceFile = findNearestPnpmWorkspaceFile(baseDir);\n\tif (workspaceFile === null) return null;\n\tconst catalog = extractCatalogBlock(readFileSync(workspaceFile, \"utf-8\"));\n\tif (catalog === null) return {\n\t\tworkspaceFile,\n\t\tentries: []\n\t};\n\tconst wanted = new Set(packages);\n\tconst entries = [];\n\tfor (const [name, version] of catalog) if (wanted.has(name)) entries.push({\n\t\tname,\n\t\tversion\n\t});\n\treturn {\n\t\tworkspaceFile,\n\t\tentries\n\t};\n}\nfunction findNearestPnpmWorkspaceFile(baseDir) {\n\tlet dir = baseDir;\n\tlet prev = \"\";\n\twhile (dir !== prev) {\n\t\tconst candidate = join(dir, \"pnpm-workspace.yaml\");\n\t\tif (existsSync(candidate)) return candidate;\n\t\tprev = dir;\n\t\tdir = dirname(dir);\n\t}\n\treturn null;\n}\n/**\n* Returns the entries inside the top-level `catalog:` block as `[name, version]`\n* pairs in document order, or `null` when no `catalog:` block exists.\n*\n* The parser is intentionally minimal: it reads line-by-line, locates the\n* top-level `catalog:` line (no leading whitespace), then collects every\n* subsequent indented line of the form `<key>: <value>` until the next\n* top-level key (or end of file). Quotes around `<key>` and `<value>`\n* are stripped; comments (`#…`) are ignored.\n*/\nfunction extractCatalogBlock(contents) {\n\tconst lines = contents.split(/\\r?\\n/);\n\tconst startIdx = lines.findIndex((line) => /^catalog\\s*:\\s*$/.test(line));\n\tif (startIdx === -1) return null;\n\tconst entries = [];\n\tfor (let i = startIdx + 1; i < lines.length; i++) {\n\t\tconst raw = lines[i] ?? \"\";\n\t\tif (raw.trim() === \"\" || /^\\s*#/.test(raw)) continue;\n\t\tif (!/^\\s/.test(raw)) break;\n\t\tconst match = raw.match(/^\\s+(?:'([^']+)'|\"([^\"]+)\"|([^:\\s'\"]+))\\s*:\\s*(.*?)\\s*(?:#.*)?$/);\n\t\tif (!match) continue;\n\t\tconst name = match[1] ?? match[2] ?? match[3];\n\t\tif (name === void 0) continue;\n\t\tconst version = stripQuotes((match[4] ?? \"\").trim());\n\t\tif (version === \"\") continue;\n\t\tentries.push([name, version]);\n\t}\n\treturn entries;\n}\nfunction stripQuotes(value) {\n\tif (value.length >= 2) {\n\t\tconst first = value[0];\n\t\tconst last = value[value.length - 1];\n\t\tif (first === \"\\\"\" && last === \"\\\"\" || first === \"'\" && last === \"'\") return value.slice(1, -1);\n\t}\n\treturn value;\n}\n//#endregion\n//#region src/commands/init/catalog-warnings.ts\nfunction formatCatalogWarning(workspaceFile, entries) {\n\treturn [\n\t\t\"pnpm workspace catalog overrides detected — pnpm will install these versions instead of `latest`:\",\n\t\tentries.map((entry) => ` • ${entry.name}: ${entry.version}`).join(\"\\n\"),\n\t\t`Catalog source: ${workspaceFile}`,\n\t\t\"To use the published `latest` instead, remove or update the catalog entry, then re-run `pnpm install`.\"\n\t].join(\"\\n\");\n}\n/**\n* Honour-and-warn: when the surrounding pnpm workspace pins one of the\n* packages `init` installs through its catalog, say so — the catalog version,\n* not the published `latest`, is what ends up in the project. Empty when there\n* is no workspace above the project or its catalog names none of them.\n*/\nfunction buildCatalogWarnings(baseDir, packages) {\n\tconst result = detectPnpmCatalogOverrides(baseDir, packages);\n\tif (result === null || result.entries.length === 0) return [];\n\treturn [formatCatalogWarning(result.workspaceFile, result.entries)];\n}\n//#endregion\n//#region src/commands/init/errors.ts\n/**\n* Non-interactive mode is missing one or more required inputs. Lists every\n* missing flag in the error so an agent / CI script can react without\n* needing to parse English.\n*\n* @param missing — kebab-case flag names without leading dashes\n* @param why — additional context (e.g. \"stdin is not a TTY\") that helps\n* the user understand why interactive fallback was skipped.\n*/\nfunction errorInitMissingFlags(options) {\n\tconst flagList = options.missing.map((flag) => `--${flag}`).join(\", \");\n\tconst fixList = options.missing.map((flag) => {\n\t\tswitch (flag) {\n\t\t\tcase \"target\": return \"--target postgres|mongodb\";\n\t\t\tcase \"authoring\": return \"--authoring psl|typescript\";\n\t\t\tcase \"schema-path\": return \"--schema-path <path>\";\n\t\t\tdefault: return `--${flag} <value>`;\n\t\t}\n\t}).join(\" \");\n\treturn new CliStructuredError$2(\"CLI.INIT_MISSING_FLAGS\", \"Missing required flags\", {\n\t\twhy: `${options.why} Missing required flag(s): ${flagList}.`,\n\t\tfix: `Re-run with the missing flag(s) supplied, e.g. \\`prisma-cli init --yes ${fixList}\\`. Use \\`prisma-cli init --help\\` to see every flag.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_MISSING_FLAGS\"),\n\t\tmeta: { missingFlags: options.missing }\n\t});\n}\n/**\n* A flag value was supplied but is not in the allowed set. Lists the\n* allowed values in `meta` for machine-readable consumption.\n*/\nfunction errorInitInvalidFlagValue(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_INVALID_FLAG_VALUE\", `Invalid value for --${options.flag}`, {\n\t\twhy: `\\`--${options.flag} ${options.value}\\` is not one of: ${options.allowed.join(\", \")}.`,\n\t\tfix: `Use one of: ${options.allowed.map((v) => `--${options.flag} ${v}`).join(\", \")}.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_FLAG_VALUE\"),\n\t\tmeta: {\n\t\t\tflag: options.flag,\n\t\t\tvalue: options.value,\n\t\t\tallowed: options.allowed\n\t\t}\n\t});\n}\n/**\n* `--authoring` and `--schema-path` disagree on file extension (e.g. PSL\n* authoring with a `.ts` path). Surfaces before any scaffold files are\n* written so the project tree stays untouched.\n*/\nfunction errorInitAuthoringSchemaPathMismatch(options) {\n\tconst expectedAuthoring = options.expectedExtension === \".ts\" ? \"typescript\" : \"psl\";\n\treturn new CliStructuredError$2(\"CLI.INIT_AUTHORING_SCHEMA_PATH_MISMATCH\", \"Authoring and schema path do not match\", {\n\t\twhy: `\\`--authoring ${options.authoring}\\` requires a schema file ending in ${options.expectedExtension}, but \\`--schema-path ${options.schemaPath}\\` ends in ${options.actualExtension}.`,\n\t\tfix: `Use a matching pair, for example \\`--authoring ${expectedAuthoring} --schema-path <path>${options.expectedExtension}\\`, or change \\`--authoring\\` to match the path you supplied. You can also omit \\`--schema-path\\` to use the default for the chosen authoring.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_AUTHORING_SCHEMA_PATH_MISMATCH\"),\n\t\tmeta: {\n\t\t\tauthoring: options.authoring,\n\t\t\tschemaPath: options.schemaPath,\n\t\t\tactualExtension: options.actualExtension,\n\t\t\texpectedExtension: options.expectedExtension\n\t\t}\n\t});\n}\n/**\n* The user cancelled an interactive prompt (Ctrl-C, escape, declined a\n* selection). Distinct from `errorInitReinitNeedsForce` because that path\n* applies to non-interactive mode where the user was never given the\n* choice; this one is the generic \"user said no\" path. Maps to exit code\n* 3 (USER_ABORTED).\n*/\nfunction errorInitUserAborted() {\n\treturn new CliStructuredError$2(\"CLI.INIT_USER_ABORTED\", \"Init cancelled\", {\n\t\twhy: \"The interactive prompt was cancelled before all required inputs were supplied. No files were modified.\",\n\t\tfix: \"Re-run `prisma-cli init` and complete the prompts, or pass the required inputs as flags (see `--help`) for a non-interactive run.\",\n\t\tseverity: \"info\"\n\t});\n}\n/**\n* `--strict-probe` was supplied without `--probe-db`. Per FR8.3 / NFR9\n* (offline-by-default), `--strict-probe` is a no-op without `--probe-db` —\n* but rather than silently ignoring it we tell the user what they probably\n* meant. Without this guard, the flag combination silently does nothing,\n* which is exactly the kind of \"looks like it worked\" trap that a strict\n* mode is supposed to prevent.\n*/\nfunction errorInitStrictProbeWithoutProbe() {\n\treturn new CliStructuredError$2(\"CLI.INIT_STRICT_PROBE_WITHOUT_PROBE\", \"`--strict-probe` requires `--probe-db`\", {\n\t\twhy: \"`--strict-probe` only changes how a *failed* probe is reported; without `--probe-db` no probe is attempted in the first place. (`init` is offline-by-default — it never opens a connection to your database without explicit consent.)\",\n\t\tfix: \"Add `--probe-db` to opt in to the probe, or drop `--strict-probe` if you do not need the version check.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_STRICT_PROBE_WITHOUT_PROBE\")\n\t});\n}\n/**\n* The user's project manifest (typically `package.json`) failed to parse\n* as JSON. Init reads the manifest to merge `scripts` (FR3.5) and to\n* skip `@types/node` when it is already declared (FR2.1); a malformed\n* file would otherwise surface as an `INTERNAL_ERROR` with a raw\n* `SyntaxError` stack, which violates the FR1.6 contract that every\n* documented failure mode maps to a stable exit code.\n*\n* Maps to exit code `2 = PRECONDITION` — the user can fix the manifest\n* and re-run.\n*/\nfunction errorInitInvalidManifest(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_INVALID_MANIFEST\", `Failed to parse ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` is not valid JSON: ${options.cause}`,\n\t\tfix: `Fix the JSON syntax in \\`${options.path}\\` (a missing comma or unbalanced brace is the most common cause), then re-run \\`prisma-cli init\\`.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_MANIFEST\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* The user's existing `tsconfig.json` could not be parsed even with JSONC\n* tolerance (comments + trailing commas) enabled. Init merges the\n* minimum compiler options the scaffolded files need (FR2.2), so an\n* unparseable tsconfig is a hard precondition failure: we cannot\n* faithfully edit a file we cannot read.\n*\n* Init must surface this **before** writing any scaffold file so the\n* user's working tree stays byte-identical (FR6.2 / NFR3) — see\n* `runInit` for the precondition gate.\n*\n* Maps to exit code `2 = PRECONDITION` — the user can fix the file and\n* re-run.\n*/\nfunction errorInitInvalidTsconfig(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_INVALID_TSCONFIG\", `Failed to parse ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` is not valid JSON or JSONC: ${options.cause}`,\n\t\tfix: `Fix the syntax in \\`${options.path}\\` and re-run \\`prisma-cli init\\`. \\`init\\` accepts JSONC (comments and trailing commas) but cannot recover from unbalanced braces or missing commas.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_TSCONFIG\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* `--probe-db` was supplied along with `--strict-probe` and the probe\n* could not complete (no `DATABASE_URL`, network/auth error, the target\n* driver was not installed, …). Without `--strict-probe` the probe\n* surfaces these as warnings; `--strict-probe` escalates them to\n* fatal so a CI gate can rely on \"init exit code 2 means something\n* about the runtime environment is wrong\" (FR8.3).\n*\n* Maps to exit code `2 = PRECONDITION`. The caller's project files\n* are already on disk by this point — the probe runs after the write\n* phase — but the install/emit steps may or may not have completed\n* depending on `--no-install` and the exact failure mode; `meta`\n* carries `filesWritten` so a follow-up agent can resume manually.\n*/\nfunction errorInitProbeFailed(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_PROBE_FAILED\", \"Database probe failed\", {\n\t\twhy: `\\`--probe-db\\` could not complete and \\`--strict-probe\\` was set: ${options.cause}`,\n\t\tfix: \"Confirm `DATABASE_URL` points at a reachable server, or drop `--strict-probe` to treat probe failures as warnings.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_PROBE_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* A scaffold file could not be written after earlier writes had already\n* landed. The directory is half-scaffolded, so this carries the list of what\n* did get written, the way every other post-write failure in `init` does.\n*\n* Maps to exit code `2 = PRECONDITION`: what stopped the write is something\n* about the directory the user can fix.\n*/\nfunction errorInitWriteFailed(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_WRITE_FAILED\", `Failed to write ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` could not be written: ${options.cause}`,\n\t\tfix: \"Fix what stopped the write — a directory sitting where the file goes, permissions, a full disk — then run `prisma-cli init` again. It will ask you to confirm replacing the files this run already wrote (listed in `meta.filesWritten`).\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_WRITE_FAILED\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause,\n\t\t\tfilesWritten: options.filesWritten\n\t\t}\n\t});\n}\n//#endregion\n//#region src/commands/init/probe-db.ts\n/**\n* Connects (when configured) to the user's database and returns a\n* structured outcome describing whether the server meets the declared\n* minimum (FR8.1). Pure with respect to its inputs: no I/O happens\n* unless `databaseUrl` is set.\n*\n* The outcome is shaped so that `--strict-probe` can branch on the\n* `kind`/`meetsMinimum` pair without re-stringifying the message:\n*\n* - `ok` — informational; `init` continues.\n* - `below-minimum` — warning; `init` continues regardless of\n* `--strict-probe` (the spec scopes strict-probe to \"probe\n* *failures*\", and a successful probe that finds an old server is\n* not a failure).\n* - `no-database-url` / `connection-failed` / `driver-missing` —\n* warning by default, fatal under `--strict-probe`.\n*/\nasync function probeServerVersion(ctx, overrides = {}) {\n\tconst { databaseUrl, minVersion, target } = ctx;\n\tif (databaseUrl === void 0 || databaseUrl.trim().length === 0) return {\n\t\tkind: \"no-database-url\",\n\t\tminVersion,\n\t\tmeetsMinimum: null,\n\t\tmessage: \"Skipped --probe-db: DATABASE_URL is not set in the current shell environment. (init does not read .env for the probe; export the variable or drop --probe-db.)\"\n\t};\n\tlet driverResult;\n\ttry {\n\t\tif (target === \"postgres\") driverResult = overrides.probePostgres !== void 0 ? await overrides.probePostgres(databaseUrl) : await defaultProbePostgres(databaseUrl, ctx.baseDir, overrides);\n\t\telse driverResult = overrides.probeMongo !== void 0 ? await overrides.probeMongo(databaseUrl) : await defaultProbeMongo(databaseUrl, ctx.baseDir, overrides);\n\t} catch (err) {\n\t\tif (err instanceof DriverMissingError) return {\n\t\t\tkind: \"driver-missing\",\n\t\t\tminVersion,\n\t\t\tmeetsMinimum: null,\n\t\t\tcause: err.message,\n\t\t\tmessage: `Skipped --probe-db: ${err.message}. (Run with install enabled, or install the driver yourself, then re-run \\`prisma-cli init --probe-db\\`.)`\n\t\t};\n\t\tconst cause = redactDatabaseUrlSecrets(causeMessage$2(err));\n\t\treturn {\n\t\t\tkind: \"connection-failed\",\n\t\t\tminVersion,\n\t\t\tmeetsMinimum: null,\n\t\t\tcause,\n\t\t\tmessage: `--probe-db could not connect: ${cause}.`\n\t\t};\n\t}\n\tif (compareVersionPrefix(driverResult.serverVersion, minVersion) < 0) return {\n\t\tkind: \"below-minimum\",\n\t\tserverVersion: driverResult.serverVersion,\n\t\tminVersion,\n\t\tmeetsMinimum: false,\n\t\tmessage: `--probe-db: server reports version ${driverResult.serverVersion}, below the declared minimum (${minVersion}). Some queries may fail until the server is upgraded.`\n\t};\n\treturn {\n\t\tkind: \"ok\",\n\t\tserverVersion: driverResult.serverVersion,\n\t\tminVersion,\n\t\tmeetsMinimum: true,\n\t\tmessage: `--probe-db: server reports version ${driverResult.serverVersion} (>= ${minVersion}).`\n\t};\n}\n/**\n* Compares two semver-prefix strings (\"14\", \"14.2\", \"6.0\", …) by\n* numeric components left-to-right. Returns a negative number when `a`\n* is older than `b`, zero when both versions agree on every numeric\n* component (treating missing trailing components as `0`), and a\n* positive number when `a` is newer.\n*\n* The loop runs over the **longer** of the two prefixes so that\n* `'14'` compares less than `'14.1'` — without that, the shorter\n* prefix would be silently accepted whenever the configured minimum\n* has a non-zero minor or patch.\n*\n* Exported for unit tests.\n*/\nfunction compareVersionPrefix(a, b) {\n\tconst aParts = parseNumericParts(a);\n\tconst bParts = parseNumericParts(b);\n\tconst len = Math.max(aParts.length, bParts.length);\n\tfor (let i = 0; i < len; i += 1) {\n\t\tconst aPart = aParts[i] ?? 0;\n\t\tconst bPart = bParts[i] ?? 0;\n\t\tif (aPart !== bPart) return aPart - bPart;\n\t}\n\treturn 0;\n}\nfunction parseNumericParts(version) {\n\tconst match = version.match(/^[^\\d]*(\\d+(?:\\.\\d+){0,3})/);\n\tif (match === null) return [];\n\treturn (match[1] ?? \"\").split(\".\").map((part) => Number.parseInt(part, 10));\n}\nvar DriverMissingError = class extends Error {};\nfunction causeMessage$2(err) {\n\tif (err instanceof Error) return err.message;\n\treturn String(err);\n}\n/**\n* Strips `user:password@` userinfo from any URL-shaped substring before\n* we surface the cause to the user. Mirrors `redactSecrets` in\n* `init.ts` — the probe path has its own redactor because the inputs\n* here include the raw connection string by construction (driver\n* errors echo the URL back).\n*\n* Exported for unit tests.\n*/\nfunction redactDatabaseUrlSecrets(text) {\n\tif (!text) return text;\n\treturn text.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/)([^/@\\s]+)@/g, \"$1***@\");\n}\nasync function defaultProbePostgres(databaseUrl, baseDir, overrides) {\n\tconst client = suppressIdleConnectionErrors(new (requirePeer(\"pg\", baseDir, overrides)).Client({ connectionString: databaseUrl }));\n\ttry {\n\t\tawait client.connect();\n\t\tconst result = await client.query(\"SELECT version() as version\");\n\t\treturn { serverVersion: parsePostgresVersion(String(result?.rows?.[0]?.version ?? \"\")) };\n\t} finally {\n\t\tawait client.end().catch(() => void 0);\n\t}\n}\n/**\n* Extracts the numeric prefix from a Postgres `version()` row, e.g.\n*\n* `PostgreSQL 14.10 on x86_64-pc-linux-gnu, ...` → `\"14.10\"`\n* `PostgreSQL 16beta1 on …` → `\"16\"` (we\n* conservatively drop the suffix; minimum-version comparisons\n* treat 16beta1 as 16, which is what every reasonable user\n* expects).\n*\n* Exported for unit tests.\n*/\nfunction parsePostgresVersion(versionString) {\n\tconst match = versionString.match(/PostgreSQL\\s+(\\d+(?:\\.\\d+)?)/i);\n\tif (match === null || match[1] === void 0) throw new CliStructuredError(\"CLI.INIT_PROBE_FAILED\", `Could not parse PostgreSQL version from \\`${versionString}\\``);\n\treturn match[1];\n}\nasync function defaultProbeMongo(databaseUrl, baseDir, overrides) {\n\tconst client = new (requirePeer(\"mongodb\", baseDir, overrides)).MongoClient(databaseUrl);\n\tawait client.connect();\n\ttry {\n\t\tconst buildInfo = await client.db().admin().command({ buildInfo: 1 });\n\t\tconst versionString = String(buildInfo.version ?? \"\");\n\t\tif (versionString.length === 0) throw new CliStructuredError(\"CLI.INIT_PROBE_FAILED\", \"buildInfo did not include a `version` field\");\n\t\treturn { serverVersion: versionString };\n\t} finally {\n\t\tawait client.close().catch(() => void 0);\n\t}\n}\n/**\n* Loads a peer driver (`pg` / `mongodb`) from the user's project\n* `node_modules`. We deliberately resolve from `baseDir` rather than\n* from the CLI bundle — the CLI does not depend on `pg` or `mongodb`\n* directly, but the user's `init`-generated `package.json` does (via\n* the target facade). Failure to resolve is folded into a typed\n* `DriverMissingError` so `probeServerVersion` can map it to a\n* `driver-missing` outcome rather than letting a `MODULE_NOT_FOUND`\n* leak as a generic connection failure.\n*/\nfunction requirePeer(moduleId, baseDir, overrides) {\n\ttry {\n\t\tif (overrides.requireFromBaseDir !== void 0) return overrides.requireFromBaseDir(baseDir, moduleId);\n\t\treturn createRequire(join(baseDir, \"package.json\"))(moduleId);\n\t} catch (err) {\n\t\tthrow new DriverMissingError(`\\`${moduleId}\\` is not installed in this project (resolved from ${baseDir}; cause: ${causeMessage$2(err)})`);\n\t}\n}\n//#endregion\n//#region src/commands/init/skill-sources.ts\n/**\n* Default base for the GitHub-URL form `<owner>/<repo>` consumed by\n* upstream `skills add`. Each `SkillSource` joins this base with its\n* own subpath (and optional `#ref` for version-pinned clusters).\n*/\nconst DEFAULT_SKILL_BASE = \"prisma/prisma\";\nconst DEFAULT_SKILL_SOURCES = [\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-8\",\n\t\tref: \"cli\",\n\t\tdescription: \"usage skill (version-locked to installed Prisma Next)\"\n\t},\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-next-upgrade\",\n\t\tref: null,\n\t\tdescription: \"upgrade skill (always tracks `main`)\"\n\t},\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-8-extension-upgrade\",\n\t\tref: null,\n\t\tdescription: \"extension-author upgrade skill (always tracks `main`)\"\n\t}\n];\n/**\n* Test-only escape hatch for pinning the install base to a local\n* checkout. Production runs leave this unset, so installs always use\n* `DEFAULT_SKILL_BASE`.\n*\n* When set to an absolute filesystem path (typical for tests), the\n* `#ref` fragment is dropped — local-path mode in upstream's CLI does\n* not accept refs, and the local clone has whatever content the test\n* checked into it anyway. When set to anything else (e.g. a fork name\n* `myuser/prisma-next`), the ref policy is preserved.\n*/\nfunction resolveAgentSkillBase(env) {\n\tconst override = env[\"PRISMA_NEXT_SKILLS_BASE\"]?.trim();\n\treturn override && override.length > 0 ? override : DEFAULT_SKILL_BASE;\n}\nfunction isLocalPath(base) {\n\treturn base.startsWith(\"/\") || /^[a-zA-Z]:[\\\\/]/.test(base);\n}\n/**\n* Agents passed to every project-level init install. Upstream `skills add`\n* is the source of truth for per-agent install behaviour; the CLI lists\n* every supported runtime on one invocation and delegates the rest.\n*/\nconst DEFAULT_SKILL_AGENTS = [\n\t\"cursor\",\n\t\"claude-code\",\n\t\"codex\",\n\t\"windsurf\"\n];\n/**\n* Build the `<base>/<subpath>[#ref]` URL the `skills` CLI will\n* resolve. Exported for unit tests so the per-source format can be\n* asserted without going through the full install loop.\n*/\nfunction formatSkillSourceUrl(source, env = process.env) {\n\tconst base = resolveAgentSkillBase(env);\n\tconst url = `${base}/${source.subpath}`;\n\tif (source.ref === null) return url;\n\tif (isLocalPath(base)) return url;\n\tif (source.ref === \"cli\") return `${url}#v${version}`;\n\treturn url;\n}\n/**\n* The skill-install command for one source, formatted for the\n* project's detected package manager. `npx`/`pnpm dlx`/`bunx` are\n* interchangeable to the user; we pick the variant that matches the\n* rest of the install step so a single project consistently uses one\n* runner.\n*\n* `--agent` takes space-separated slugs on one flag; the explicit\n* `--skill <name>` and `-y` skip the multi-select prompts a\n* non-interactive scaffold step cannot show.\n*\n* Exported for unit tests so the per-PM dispatch can be asserted\n* without a live subprocess.\n*/\nfunction formatSkillInstallCommand(args) {\n\tconst agents = args.agents ?? DEFAULT_SKILL_AGENTS;\n\tconst cliArgs = [\n\t\t\"skills@latest\",\n\t\t\"add\",\n\t\tformatSkillSourceUrl(args.source, args.env),\n\t\t\"--agent\",\n\t\t...agents,\n\t\t\"--skill\",\n\t\targs.source.skill,\n\t\t\"-y\"\n\t];\n\treturn formatPackageManagerCommand(args.pm, cliArgs);\n}\n/**\n* Ordered skill-install commands for one init run. This is both what the\n* commander shell runs and what either shell tells the user to run when the\n* install is skipped or fails — the commands need no scaffold and no `init`.\n*/\nfunction resolveProjectSkillInstallCommands(pm, env) {\n\treturn DEFAULT_SKILL_SOURCES.map((source) => formatSkillInstallCommand({\n\t\tpm,\n\t\tsource,\n\t\t...ifDefined(\"env\", env)\n\t}));\n}\nfunction formatPackageManagerCommand(pm, args) {\n\tswitch (pm) {\n\t\tcase \"pnpm\": return `pnpm dlx ${args.join(\" \")}`;\n\t\tcase \"yarn\": return `yarn dlx ${args.join(\" \")}`;\n\t\tcase \"bun\": return `bunx ${args.join(\" \")}`;\n\t\tcase \"deno\": return `deno run -A npm:${args.join(\" \")}`;\n\t\tcase \"npm\": return `npx ${args.join(\" \")}`;\n\t}\n}\n/**\n* Skill directories that predate the consolidated `prisma-8` skill:\n* the per-workflow usage cluster (including the renamed\n* `prisma-8-migration-review` spelling it briefly shipped under), the\n* pre-rename spellings of the consolidated skill and the\n* extension-author upgrade skill, and any hand-rolled `prisma-next`\n* stub. Projects initialised before the consolidation carry these as\n* sibling directories in each agent's install root; left in place\n* they compete with the current skills for activation, so init\n* removes them on every run.\n*/\nconst RETIRED_SKILL_NAMES = [\n\t\"prisma-next\",\n\t\"prisma-next-quickstart\",\n\t\"prisma-next-contract\",\n\t\"prisma-next-migrations\",\n\t\"prisma-next-migration-review\",\n\t\"prisma-8-migration-review\",\n\t\"prisma-next-queries\",\n\t\"prisma-next-runtime\",\n\t\"prisma-next-build\",\n\t\"prisma-next-supabase\",\n\t\"prisma-next-debug\",\n\t\"prisma-next-feedback\",\n\t\"prisma-next-extension-upgrade\"\n];\n/**\n* Project-level install roots the upstream `skills` CLI uses for the\n* agents in `DEFAULT_SKILL_AGENTS`: cursor and codex install into\n* `.agents/skills`, claude-code into `.claude/skills`, windsurf into\n* `.windsurf/skills`.\n*/\nconst AGENT_SKILL_ROOTS = [\n\t\".agents/skills\",\n\t\".claude/skills\",\n\t\".windsurf/skills\"\n];\n/**\n* Every directory a retired per-workflow skill may occupy in a\n* consumer project. Init deletes each (recursively) before running the\n* skill install.\n*/\nfunction legacySkillDirs() {\n\treturn AGENT_SKILL_ROOTS.flatMap((root) => RETIRED_SKILL_NAMES.map((name) => `${root}/${name}`));\n}\n//#endregion\n//#region src/commands/init/templates/code-templates.ts\n/**\n* The resolver a scaffold for `target` is written against.\n*\n* A scaffold is always on the facade root: `init` writes an application around\n* one database package, and the workspace names are not published, so a project\n* scaffolded against them could not install (ADR 242). Both the files `init`\n* writes and the dependency it adds go through this, so they cannot disagree.\n*/\nfunction scaffoldSpecifierResolverFor(target) {\n\treturn createScaffoldSpecifierResolver({\n\t\tmode: \"facade\",\n\t\tfacade: target === \"postgres\" ? \"@prisma/orm-postgres\" : \"@prisma/orm-mongo\"\n\t});\n}\n/**\n* The package name a scaffolded project depends on and imports from, for the\n* import root it is being scaffolded against.\n*\n* Every specifier the scaffold writes derives from this one, and `init` builds\n* a single resolver and hands it to both the file templates and the dependency\n* it installs — so the two cannot disagree. The one caller that deliberately\n* does not thread a resolver is the re-init cleanup in `inputs.ts`, which\n* inspects a manifest an earlier run wrote rather than writing one.\n*\n* Resolvers for scaffolding should come from `createScaffoldSpecifierResolver`\n* in the publish-surface package, which rejects the roots a facade-shaped\n* scaffold cannot express. (Named without its scope on purpose: JSDoc survives\n* into the published bundle, where an internal package name would trip the\n* shell tarball checks.)\n*/\nfunction targetPackageName(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\");\n}\n/** One entrypoint of the scaffolded project's target package. */\nfunction targetEntrypoint(target, subpath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(`${target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\"}/${subpath}`);\n}\nfunction targetLabel(target) {\n\treturn target === \"postgres\" ? \"PostgreSQL\" : \"MongoDB\";\n}\nfunction defaultSchemaPath(authoring) {\n\tif (authoring === \"typescript\") return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.ts`;\n\treturn `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.prisma`;\n}\nfunction starterSchema(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? starterSchemaTsMongo(builder) : starterSchemaTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? starterSchemaPslMongo() : starterSchemaPslPostgres();\n}\n/**\n* Renders a short authoring-appropriate schema sample (FR5.1) for embedding\n* in `prisma-next.md`. Returns a complete fenced markdown code block.\n*\n* The sample intentionally shows just one model: it's illustrative, not\n* a substitute for the full scaffolded contract file. The TS samples use\n* the same outer shape as `starterSchemaTs*` (FR5.3) so a user reading\n* the doc and the file side-by-side sees the same structure.\n*/\nfunction schemaSample(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? schemaSampleTsMongo(builder) : schemaSampleTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? schemaSamplePslMongo() : schemaSamplePslPostgres();\n}\nfunction schemaSamplePslPostgres() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n}\n\\`\\`\\``;\n}\nfunction schemaSamplePslMongo() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n @@map(\"users\")\n}\n\\`\\`\\``;\n}\nfunction schemaSampleTsPostgres(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction schemaSampleTsMongo(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction starterSchemaPslPostgres() {\n\treturn `// use prisma-next\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n posts Post[]\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId Int\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n`;\n}\nfunction starterSchemaPslMongo() {\n\treturn `// use prisma-next\n\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n posts Post[]\n @@map(\"users\")\n}\n\nmodel Post {\n id ObjectId @id @map(\"_id\")\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId ObjectId\n @@map(\"posts\")\n}\n`;\n}\nfunction starterSchemaTsPostgres(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract({}, ({ field, model, rel }) => {\n const User = model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n });\n\n const Post = model('Post', {\n fields: {\n id: field.id.uuidv7String(),\n title: field.text(),\n content: field.text().optional(),\n authorId: field.uuidString(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n });\n\n return {\n models: {\n User: User.relations({\n posts: rel.hasMany(Post, { by: 'authorId' }),\n }),\n Post: Post.relations({\n author: rel.belongsTo(User, { from: 'authorId', to: 'id' }),\n }),\n },\n };\n});\n`;\n}\nfunction starterSchemaTsMongo(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n relations: {\n posts: rel.hasMany('Post', { from: '_id', to: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n collection: 'posts',\n fields: {\n _id: field.objectId(),\n title: field.string(),\n content: field.string().optional(),\n authorId: field.objectId(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: '_id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction configFile(target, contractPath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn `import 'dotenv/config';\nimport { definePrismaConfig } from '@prisma/cli-engine';\nimport { defineConfig as ormConfig } from '${targetEntrypoint(target, \"config\", resolveImportSpecifier)}';\n\nexport default definePrismaConfig({\n orm: ormConfig({\n contract: ${JSON.stringify(contractPath)},\n db: {\n connection: process.env['DATABASE_URL']!,\n },\n }),\n});\n`;\n}\nfunction dbFile(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst runtime = targetEntrypoint(target, \"runtime\", resolveImportSpecifier);\n\tif (target === \"postgres\") return `import 'dotenv/config';\nimport postgres from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = postgres<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n\treturn `import 'dotenv/config';\nimport mongo from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = mongo<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n}\n//#endregion\n//#region src/commands/init/templates/env.ts\n/**\n* The minimum supported server version for each target. The\n* authoritative source of truth is each target package's\n* `package.json#prismaNext.minServerVersion` field — this module\n* mirrors those values and a workspace-level test asserts the two\n* never drift (`templates/tsconfig-env.test.ts`).\n*\n* Bumping a value here in isolation is **not** safe: edit the\n* corresponding target package's `package.json` first, then mirror\n* here. The scaffold's `.env.example` and the \"Requirements\" section\n* of `prisma-next.md` both read from this constant, so a stale value\n* lies to every freshly initialised user.\n*/\nconst MIN_SERVER_VERSION = {\n\tpostgres: \"15\",\n\tmongo: \"8.0\"\n};\nconst TARGET_LABEL = {\n\tpostgres: \"PostgreSQL\",\n\tmongo: \"MongoDB\"\n};\n/**\n* Renders the placeholder body shared by `.env` and `.env.example`:\n* the target-specific connection-string requirement comments and the\n* commented-shape `DATABASE_URL` line. The output is identical for both\n* authoring styles — the env file is orthogonal to PSL vs TS schema\n* authoring.\n*/\nfunction envPlaceholderBody(target) {\n\tconst label = TARGET_LABEL[target];\n\tconst minVersion = MIN_SERVER_VERSION[target];\n\tconst lines = [];\n\tlines.push(`# Connection string for ${label}.`);\n\tlines.push(`# Requires ${label} >= ${minVersion}.`);\n\tlines.push(\"\");\n\tif (target === \"postgres\") lines.push(\"DATABASE_URL=\\\"postgresql://user:password@localhost:5432/mydb\\\"\");\n\telse {\n\t\tlines.push(\"# Standalone local mongod / `docker run mongo:8` — no replica set required for first-run queries.\");\n\t\tlines.push(\"# Transactions and change streams need a replica set; add ?replicaSet=... only after initiating one.\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"DATABASE_URL=\\\"mongodb://user:password@localhost:27017/mydb\\\"\");\n\t}\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders the `.env.example` content for a given target:\n*\n* - Carries a \"Copy this file to `.env`…\" intro that only makes sense\n* for the example file (the real `.env` is the destination of that\n* copy and so does not get the same intro).\n* - Documents the `DATABASE_URL` placeholder in the target's native URL\n* shape (Postgres: standard `postgresql://`, Mongo: `mongodb://` plus\n* a `mydb` database segment so the lazy facade has a `dbName`).\n* - Carries a `# Requires <db> >= <version>` comment so a fresh user\n* knows the minimum supported server before they first try to connect.\n*/\nfunction envExampleContent(target) {\n\tconst lines = [];\n\tlines.push(\"# Copy this file to `.env` and replace the placeholder with your real connection string.\");\n\tlines.push(envPlaceholderBody(target));\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders the initial `.env` content for `--write-env` / interactive\n* opt-in. Same placeholder body as `.env.example`, **without** the\n* example file's \"Copy this file to `.env`…\" intro: the real `.env` is\n* the destination of that copy, so the line would lie. Writing this\n* file is gitignored (`.env` lands in `.gitignore` during init).\n*/\nfunction envFileContent(target) {\n\treturn envPlaceholderBody(target);\n}\n//#endregion\n//#region src/orm/init-diagnostics.ts\n/** The invocation that finishes what a failed `init` phase started. */\nconst EMIT_COMMAND = \"prisma-cli contract emit\";\n/**\n* The command's own record of a phase that failed after the scaffold was\n* written. The scaffold is on disk and the run has a result to report, so each\n* of these rides a completed envelope as a finding rather than replacing it.\n*/\nfunction initFinding(code, summary, parts) {\n\treturn {\n\t\tcode,\n\t\tseverity: \"error\",\n\t\tsummary,\n\t\twhy: parts.why,\n\t\tnextActions: parts.nextActions,\n\t\tmeta: parts.meta,\n\t\tdocsUrl: docsUrlFor(code)\n\t};\n}\n/**\n* The dependency install failed. The engine composed and announced the command\n* line, so its own next action — which carries the redacted spelling — is the\n* one that tells the user what to run; `init` adds the emit that was waiting\n* on it.\n*/\nfunction installFailedFinding(failure, filesWritten) {\n\treturn initFinding(\"CLI.INIT_INSTALL_FAILED\", \"Failed to install dependencies\", {\n\t\twhy: failure.why ?? failure.message,\n\t\tnextActions: [...failure.nextActions, runCommandAction(\"Emit the contract once the dependencies are installed\", EMIT_COMMAND)],\n\t\tmeta: {\n\t\t\tfilesWritten,\n\t\t\tinstall: failure.meta ?? {}\n\t\t}\n\t});\n}\n/** The first emit failed against the freshly written scaffold. */\nfunction emitFailedFinding(cause, filesWritten) {\n\treturn initFinding(\"CLI.INIT_EMIT_FAILED\", \"Failed to emit contract\", {\n\t\twhy: `\\`${EMIT_COMMAND}\\` failed: ${cause}`,\n\t\tnextActions: [chooseAction(\"Fix the problem the contract source reports, then emit again\"), runCommandAction(\"Emit the contract\", EMIT_COMMAND)],\n\t\tmeta: {\n\t\t\tfilesWritten,\n\t\t\tcause\n\t\t}\n\t});\n}\n/**\n* An agent-skill install failed; the project itself is complete without it.\n* The remedy is the skill-install commands themselves, which run against any\n* directory — advising a re-run of `init` would put the user's schema at risk\n* to fix something `init` no longer needs to be involved in.\n*/\nfunction skillInstallFailedFinding(failure, filesWritten, skillCommands) {\n\treturn initFinding(\"CLI.INIT_SKILL_INSTALL_FAILED\", \"Failed to install Prisma Next skills\", {\n\t\twhy: failure.why ?? failure.message,\n\t\tnextActions: [...failure.nextActions, ...skillCommands.map((command) => runCommandAction(\"Install the Prisma Next skills\", command))],\n\t\tmeta: {\n\t\t\tfilesWritten,\n\t\t\tskillInstall: failure.meta ?? {}\n\t\t}\n\t});\n}\n//#endregion\n//#region src/orm/init-blocks.ts\nfunction fileNodes(paths) {\n\treturn paths.map((path) => ({\n\t\tlabel: path,\n\t\ttone: \"identifier\"\n\t}));\n}\nfunction scaffoldTree(document) {\n\tconst roots = [{\n\t\tlabel: \"written\",\n\t\ttone: \"heading\",\n\t\tchildren: fileNodes(document.filesWritten)\n\t}];\n\tif (document.filesDeleted.length > 0) roots.push({\n\t\tlabel: \"removed (stale artifacts and retired skill directories)\",\n\t\ttone: \"heading\",\n\t\tchildren: fileNodes(document.filesDeleted)\n\t});\n\tconst installed = document.packagesInstalled;\n\tif (installed.status === \"installed\") roots.push({\n\t\tlabel: \"installed\",\n\t\ttone: \"heading\",\n\t\tchildren: [...fileNodes(installed.deps), ...installed.devDeps.map((dep) => ({\n\t\t\tlabel: `${dep} (dev)`,\n\t\t\ttone: \"identifier\"\n\t\t}))]\n\t});\n\treturn {\n\t\tkind: \"tree\",\n\t\troots\n\t};\n}\n/**\n* The scaffold's follow-up steps, typed. `nextSteps` in the result document\n* keeps its numbered prose for consumers that already read it; these are the\n* same advice in the shape an agent can act on.\n*/\nfunction buildInitNextActions(inputs) {\n\tconst actions = [chooseAction(\"Set DATABASE_URL in your environment (export it or add it to .env)\")];\n\tif (!inputs.contractEmitted) actions.push(runCommandAction(\"Emit the contract\", EMIT_COMMAND));\n\tactions.push({\n\t\tkind: \"edit-file\",\n\t\tlabel: `Edit your schema at ${inputs.schemaPath}, then emit again`\n\t});\n\tactions.push(chooseAction(\"Open prisma-next.md for a quick reference on writing your first typed query\"));\n\tif (inputs.skillRegistered) actions.push(chooseAction(\"Prisma Next skills are registered with your agent runtime — ask it to add a model, run a query, or plan a migration\"));\n\treturn actions;\n}\nconst DONE_TEXT = \"Done. Open prisma-next.md to get started.\";\nconst INCOMPLETE_TEXT = \"Scaffold written. Finish the steps above to complete setup.\";\n/**\n* `init` writes files rather than data another program reads, so it supplies\n* no `stdout` payload: human mode writes nothing to stdout.\n*/\nfunction initPresentations(inputs) {\n\tconst { document } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"target\",\n\t\t\t\t\t\tvalue: document.target\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"authoring\",\n\t\t\t\t\t\tvalue: document.authoring\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"schema\",\n\t\t\t\t\t\tvalue: document.schemaPath\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\tscaffoldTree(document),\n\t\t\tinputs.complete ? {\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: DONE_TEXT\n\t\t\t} : {\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\ttext: INCOMPLETE_TEXT\n\t\t\t}\n\t\t],\n\t\tjson: () => document,\n\t\tnext: () => inputs.nextActions\n\t};\n}\n//#endregion\n//#region src/commands/init/redact-secrets.ts\n/**\n* Strips credentials out of package-manager stderr before it reaches a warning,\n* an error's meta, or a log. Two shapes carry them: userinfo inside a registry\n* URL (`https://user:token@registry…`), and the npmrc settings npm and pnpm\n* echo back when authentication fails (`//registry.npmjs.org/:_authToken=…`,\n* or the top-level `_authToken=…` with no registry scope), which are not\n* URL-shaped and survive a userinfo-only pass.\n*\n* Both shells' `init` call this, and both call it on stderr they already\n* received from somewhere else: redaction is cheap and doubling it is harmless,\n* while trusting another layer to have done it is not.\n*/\nfunction redactSecrets(stderr) {\n\treturn stderr.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/)([^/@\\s]+)@/g, \"$1***@\").replace(/(\\b_(?:authToken|auth|password)=)\\S+/gi, \"$1***\");\n}\n//#endregion\n//#region src/orm/init-emit.ts\n/**\n* Emits the contract for the project `init` has just scaffolded, by spawning\n* the project-local `prisma-cli` binary the install step put into\n* `node_modules`. That binary and the installed `defineConfig` come from the\n* same registry release, so the config loader that evaluates\n* `prisma.config.ts` always matches the config format it was written\n* with — running the emit in-process would evaluate the project's config with\n* this (possibly newer) CLI's loader instead. Child output is captured, never\n* inherited, so `--json` envelopes on stdout stay parseable.\n*/\nasync function emitScaffoldedContract(ctx, overrides = {}) {\n\tconst binPath = resolveProjectBin(ctx.cwd, overrides);\n\tconst result = await runCaptured(process.execPath, [\n\t\tbinPath,\n\t\t\"contract\",\n\t\t\"emit\"\n\t], ctx.cwd);\n\tif (result.exitCode !== 0) {\n\t\tconst output = result.stderr.trim().length > 0 ? result.stderr : result.stdout;\n\t\tconst cause = result.exitCode === null ? `was killed by signal ${result.signal ?? \"unknown\"}` : `exited with code ${result.exitCode}`;\n\t\tthrow new Error(`\\`prisma-cli contract emit\\` ${cause}: ${redactSecrets(tail(output))}`);\n\t}\n}\nfunction resolveProjectBin(cwd, overrides) {\n\tconst resolveFromBaseDir = overrides.resolveFromBaseDir ?? ((baseDir, specifier) => createRequire(join(baseDir, \"package.json\")).resolve(specifier));\n\tlet manifestPath;\n\ttry {\n\t\tmanifestPath = resolveFromBaseDir(cwd, \"@prisma/cli/package.json\");\n\t} catch (error) {\n\t\tthrow new Error(`\\`@prisma/cli\\` is not installed in this project (resolved from ${cwd}; cause: ${causeMessage$1(error)})`);\n\t}\n\tlet manifest;\n\ttry {\n\t\tmanifest = JSON.parse(readFileSync(manifestPath, \"utf-8\"));\n\t} catch (error) {\n\t\tthrow new Error(`the installed @prisma/cli manifest at ${manifestPath} is not valid JSON: ${causeMessage$1(error)}`);\n\t}\n\tconst bin = manifest !== null && typeof manifest === \"object\" ? Reflect.get(manifest, \"bin\") : void 0;\n\tconst binEntry = typeof bin === \"string\" ? bin : bin !== null && typeof bin === \"object\" ? Reflect.get(bin, \"prisma-cli\") : void 0;\n\tif (typeof binEntry !== \"string\") throw new Error(`the installed @prisma/cli package at ${dirname(manifestPath)} declares no \\`prisma-cli\\` bin`);\n\treturn join(dirname(manifestPath), binEntry);\n}\nfunction runCaptured(file, args, cwd) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst child = spawn(file, args, {\n\t\t\tcwd,\n\t\t\tstdio: [\n\t\t\t\t\"ignore\",\n\t\t\t\t\"pipe\",\n\t\t\t\t\"pipe\"\n\t\t\t]\n\t\t});\n\t\tlet stdout = \"\";\n\t\tlet stderr = \"\";\n\t\tchild.stdout.on(\"data\", (chunk) => {\n\t\t\tstdout += chunk.toString(\"utf-8\");\n\t\t});\n\t\tchild.stderr.on(\"data\", (chunk) => {\n\t\t\tstderr += chunk.toString(\"utf-8\");\n\t\t});\n\t\tchild.on(\"error\", (error) => {\n\t\t\treject(/* @__PURE__ */ new Error(`could not run the project-local prisma-cli binary: ${error.message}`));\n\t\t});\n\t\tchild.on(\"close\", (code, signal) => {\n\t\t\tresolve({\n\t\t\t\texitCode: code,\n\t\t\t\tsignal,\n\t\t\t\tstdout,\n\t\t\t\tstderr\n\t\t\t});\n\t\t});\n\t});\n}\nfunction tail(text) {\n\treturn text.trim().split(\"\\n\").slice(-20).join(\"\\n\");\n}\nfunction causeMessage$1(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n//#endregion\n//#region src/commands/init/input-values.ts\nconst TARGET_ALIASES = /* @__PURE__ */ new Map([\n\t[\"postgres\", \"postgres\"],\n\t[\"postgresql\", \"postgres\"],\n\t[\"mongo\", \"mongo\"],\n\t[\"mongodb\", \"mongo\"]\n]);\nconst AUTHORING_VALUES = /* @__PURE__ */ new Map([\n\t[\"psl\", \"psl\"],\n\t[\"typescript\", \"typescript\"],\n\t[\"ts\", \"typescript\"]\n]);\nfunction resolveTarget(value) {\n\tif (value === void 0) return void 0;\n\tconst mapped = TARGET_ALIASES.get(value.toLowerCase());\n\tif (mapped === void 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"target\",\n\t\tvalue,\n\t\tallowed: [\"postgres\", \"mongodb\"]\n\t});\n\treturn mapped;\n}\nfunction resolveAuthoring(value) {\n\tif (value === void 0) return void 0;\n\tconst mapped = AUTHORING_VALUES.get(value.toLowerCase());\n\tif (mapped === void 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"authoring\",\n\t\tvalue,\n\t\tallowed: [\"psl\", \"typescript\"]\n\t});\n\treturn mapped;\n}\n/**\n* Validates `--schema-path` against the chosen `--authoring` style: PSL\n* authoring requires a `.prisma` file and TypeScript authoring requires a\n* `.ts` file. Mismatched combinations would silently scaffold PSL content\n* into a `.ts` file (or vice versa); this validator surfaces the mistake\n* as a precondition error naming both flags.\n*/\nfunction validateSchemaPath(value, authoring) {\n\tconst trimmed = value.trim();\n\tif (trimmed.length === 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"schema-path\",\n\t\tvalue,\n\t\tallowed: [\"<non-empty file path with .prisma or .ts extension>\"]\n\t});\n\tif (trimmed.endsWith(\"/\") || trimmed.endsWith(\"\\\\\")) throw errorInitInvalidFlagValue({\n\t\tflag: \"schema-path\",\n\t\tvalue,\n\t\tallowed: [\"<file path, not a directory>\"]\n\t});\n\tconst ext = extname(trimmed).toLowerCase();\n\tconst expected = authoring === \"typescript\" ? \".ts\" : \".prisma\";\n\tif (ext !== expected) throw errorInitAuthoringSchemaPathMismatch({\n\t\tauthoring,\n\t\tschemaPath: trimmed,\n\t\tactualExtension: ext.length > 0 ? ext : \"(none)\",\n\t\texpectedExtension: expected\n\t});\n\treturn normalize(trimmed);\n}\n//#endregion\n//#region src/commands/init/detect-package-manager.ts\nfunction formatRunCommand(pm, bin, args) {\n\tif (pm === \"npm\") return `npx ${bin} ${args}`;\n\tif (pm === \"deno\") return `deno run npm:${bin} ${args}`;\n\treturn `${pm} ${bin} ${args}`;\n}\nfunction formatRunScriptCommand(pm, scriptName) {\n\tswitch (pm) {\n\t\tcase \"deno\": return `deno task ${scriptName}`;\n\t\tcase \"bun\": return `bun run ${scriptName}`;\n\t\tcase \"pnpm\": return `pnpm run ${scriptName}`;\n\t\tcase \"yarn\": return `yarn run ${scriptName}`;\n\t\tdefault: return `npm run ${scriptName}`;\n\t}\n}\n//#endregion\n//#region src/commands/init/hygiene-gitattributes.ts\n/**\n* The `.gitattributes` entries written for a freshly initialised project\n* (FR3.4). Mirrors the relevant subset of the repo-root\n* [`.gitattributes`](../../../../../../../../.gitattributes):\n*\n* - **Today**: `contract.json`, `contract.d.ts` are emitted on every\n* `prisma-cli contract emit`. Marking them `linguist-generated`\n* keeps GitHub's diff stats honest and collapses the file in code\n* review by default.\n* - **Forward-looking**: `ops.json`, `migration.json` are not yet emitted\n* by `init` flows but will be produced by adjacent commands (lower /\n* migration tooling). Adding them now matches Decision 5\n* (forward-looking subset) so the file does not need to be amended\n* every time a new artifact lands.\n*\n* `ARTIFACT_FILENAMES` entries are written relative to the schema\n* directory so a user who runs `init --schema-path db/contract.prisma`\n* gets `db/contract.json linguist-generated` — not the workspace-glob\n* form `<glob>/contract.json` (which would over-match any unrelated\n* `contract.json` the user has elsewhere) and not the absolute\n* `DEFAULT_CONTRACT_SOURCE_DIR/contract.json` (which would silently\n* break for a non-default schema path).\n*\n* The migration contract snapshot store (`migrations/snapshots/<hex>/`)\n* is anchored to the migrations root instead, not the schema directory:\n* migration package depth under `migrations/` varies (`app/<pkg>`,\n* `<space>/<pkg>`, or a bare `<pkg>` in extension source repos), so no\n* single schema-dir-relative pattern can reach every snapshot. See\n* `STORE_GITATTRIBUTES_LINES` below.\n*/\nconst ARTIFACT_FILENAMES$1 = [\n\t\"contract.json\",\n\t\"contract.d.ts\",\n\t\"ops.json\",\n\t\"migration.json\"\n];\nconst ATTRIBUTE = \"linguist-generated\";\n/**\n* Full `.gitattributes` lines for the migration contract snapshot store,\n* already anchored to the migrations root — unlike `ARTIFACT_FILENAMES`,\n* these are not combined with the schema-relative prefix.\n*/\nconst STORE_GITATTRIBUTES_LINES = [`migrations/snapshots/**/contract.json ${ATTRIBUTE}`, `migrations/snapshots/**/contract.d.ts ${ATTRIBUTE}`];\n/**\n* Computes the `.gitattributes` lines this scaffold expects to own. Each\n* line has the shape `<path> linguist-generated`. The `target` parameter\n* is currently unused but accepted for symmetry with the other hygiene\n* helpers and to leave room for target-specific entries (e.g. a future\n* family-specific artifact) without a signature break.\n*/\nfunction requiredGitattributesLines(schemaDir, _target) {\n\tconst dir = schemaDir === \".\" ? \"\" : schemaDir.replace(/\\/+$/, \"\");\n\tconst prefix = dir === \"\" ? \"\" : `${dir}/`;\n\treturn [...ARTIFACT_FILENAMES$1.map((file) => `${prefix}${file} ${ATTRIBUTE}`), ...STORE_GITATTRIBUTES_LINES];\n}\n/**\n* Idempotent `.gitattributes` merge (FR3.4 / FR9.3). Returns the new file\n* content given the existing content (or `undefined` if the file does\n* not yet exist).\n*\n* Equivalence is exact-line: a user-customised line like\n* `prisma/*.json linguist-generated` is *not* recognised as covering\n* `DEFAULT_CONTRACT_SOURCE_DIR/contract.json linguist-generated`. We accept that\n* over-specification — preserving the user's broad pattern *and*\n* appending the narrow one — because the narrow lines are what the\n* acceptance criteria pin (FR3.4 AC).\n*\n* Returns `null` when no changes are required (file already contains\n* every required entry).\n*/\nfunction mergeGitattributes(existing, required) {\n\tif (existing === void 0) return `${required.join(\"\\n\")}\\n`;\n\tconst presentLines = new Set(existing.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith(\"#\")));\n\tconst missing = required.filter((line) => !presentLines.has(line));\n\tif (missing.length === 0) return null;\n\treturn `${existing}${existing.length === 0 || existing.endsWith(\"\\n\") ? \"\" : \"\\n\"}${missing.join(\"\\n\")}\\n`;\n}\n//#endregion\n//#region src/commands/init/hygiene-gitignore.ts\n/**\n* The minimal `.gitignore` lines a Prisma Next scaffold needs (FR3.3).\n* Order matches what Node tooling typically writes today.\n*\n* `node_modules/` first because it's the byte-largest miss; `dist/`\n* because the scaffolded `tsconfig.json` writes there; `.env` last so\n* the secret-bearing file is the one most-recently visible in any diff\n* (a paranoid-correct ordering — humans skim from the top).\n*/\nconst REQUIRED_GITIGNORE_ENTRIES = [\n\t\"node_modules/\",\n\t\"dist/\",\n\t\".env\"\n];\n/**\n* Idempotent `.gitignore` merge (FR3.3 / FR9.3). Returns the new file\n* content given the existing content (or `undefined` if the file does\n* not yet exist). Adds only entries that are not already present and\n* never duplicates a line. Existing comments and blank lines are\n* preserved verbatim — `.gitignore` is parsed by `git` without a tree,\n* so any line modification risks changing semantics.\n*\n* Pattern equivalence is line-literal: `node_modules/` and `node_modules`\n* are treated as different entries. This is intentional — `git` treats\n* them differently (the trailing slash restricts the match to\n* directories), and the AC pins the trailing-slash form.\n*\n* Returns `null` when no changes are required (file already contains\n* every required entry). The caller can use this to decide whether to\n* include `.gitignore` in `filesWritten`.\n*/\nfunction mergeGitignore(existing) {\n\tif (existing === void 0) return `${REQUIRED_GITIGNORE_ENTRIES.join(\"\\n\")}\\n`;\n\tconst present = new Set(existing.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith(\"#\")));\n\tconst missing = REQUIRED_GITIGNORE_ENTRIES.filter((entry) => !present.has(entry));\n\tif (missing.length === 0) return null;\n\treturn `${existing}${existing.length === 0 || existing.endsWith(\"\\n\") ? \"\" : \"\\n\"}${missing.join(\"\\n\")}\\n`;\n}\n//#endregion\n//#region src/commands/init/hygiene-package-scripts.ts\nconst REQUIRED_SCRIPTS = [{\n\tname: \"contract:emit\",\n\tcommand: \"prisma-cli contract emit\"\n}];\n/**\n* Idempotent `package.json#scripts` merge with collision detection\n* (FR3.5 / FR9.3):\n*\n* - If a required script is **missing**, append it.\n* - If a required script is **already present and identical**, leave\n* the file alone (idempotency).\n* - If a required script is **present but maps to a different command**,\n* skip the write for that script and surface a structured warning.\n* The user's override is sacred — `init` should never silently\n* overwrite a custom build pipeline.\n*\n* Preserves the existing key order (so a user who has alphabetised\n* their scripts does not see them reshuffled) and appends new entries\n* at the end.\n*\n* The `package.json` is parsed and re-stringified through `JSON` —\n* comments are not preserved (package.json does not support them per\n* spec). Trailing newline matches the original input's trailing\n* newline behaviour.\n*/\nfunction mergePackageScripts(existing, required = REQUIRED_SCRIPTS) {\n\tconst parsed = blindCast(JSON.parse(existing));\n\tconst scripts = typeof parsed[\"scripts\"] === \"object\" && parsed[\"scripts\"] !== null ? { ...blindCast(parsed[\"scripts\"]) } : {};\n\tconst warnings = [];\n\tlet mutated = false;\n\tfor (const { name, command } of required) {\n\t\tconst existingValue = scripts[name];\n\t\tif (existingValue === void 0) {\n\t\t\tscripts[name] = command;\n\t\t\tmutated = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (existingValue !== command) warnings.push(`package.json already has a \"${name}\" script with a different command — keeping yours.\\n existing: ${existingValue}\\n expected: ${command}\\nIf you want the default, remove your \"${name}\" script and re-run \\`init\\`.`);\n\t}\n\tif (!mutated) return {\n\t\tcontent: null,\n\t\twarnings\n\t};\n\tparsed[\"scripts\"] = scripts;\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn {\n\t\tcontent: `${JSON.stringify(parsed, null, 2)}${trailingNewline}`,\n\t\twarnings\n\t};\n}\n/**\n* Idempotently sets `\"type\": \"module\"` on a `package.json` so the\n* scaffolded `prisma/db.ts` — which uses the ESM-only `with { type: 'json' }`\n* import attribute — loads as ES module under Node's loader (TML-2494).\n*\n* Without this field Node either:\n*\n* - emits `MODULE_TYPELESS_PACKAGE_JSON` and reparses the file as ESM\n* with a perf penalty (Node 22+ with `--experimental-strip-types`), or\n* - hard-fails with `ERR_*` because the CJS loader cannot parse the\n* import-attribute syntax (older Node, or any tool that doesn't\n* reparse).\n*\n* Behaviour:\n*\n* - **Field missing** → set to `\"module\"`. New entry is inserted right\n* after `\"name\"` (when present) so the diff lands in a conventional\n* spot for human review; falls through to the natural append position\n* otherwise.\n* - **Field already `\"module\"`** → no-op (idempotent).\n* - **Field set to anything else** (e.g. `\"commonjs\"`) → leave it alone\n* and surface a structured warning. The user explicitly opted out of\n* ESM and we don't silently overwrite that.\n*/\nfunction ensureEsmModuleType(existing) {\n\tconst parsed = blindCast(JSON.parse(existing));\n\tconst currentType = parsed[\"type\"];\n\tif (currentType === \"module\") return {\n\t\tcontent: null,\n\t\twarning: null\n\t};\n\tif (typeof currentType === \"string\" && currentType !== \"module\") return {\n\t\tcontent: null,\n\t\twarning: `package.json declares \"type\": \"${currentType}\" — keeping yours, but the scaffolded prisma/db.ts uses an ESM-only import attribute (\\`with { type: 'json' }\\`) and will not load under that module type.\\nIf you want the default, set \"type\": \"module\" in package.json.`\n\t};\n\tconst next = {};\n\tlet inserted = false;\n\tfor (const [key, value] of Object.entries(parsed)) {\n\t\tif (key === \"type\") continue;\n\t\tnext[key] = value;\n\t\tif (!inserted && key === \"name\") {\n\t\t\tnext[\"type\"] = \"module\";\n\t\t\tinserted = true;\n\t\t}\n\t}\n\tif (!inserted) next[\"type\"] = \"module\";\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn {\n\t\tcontent: `${JSON.stringify(next, null, 2)}${trailingNewline}`,\n\t\twarning: null\n\t};\n}\n//#endregion\n//#region src/commands/init/reinit-cleanup.ts\n/**\n* Filenames the contract pipeline emits next to the user's schema source\n* (`<schemaDir>/contract.json`, `<schemaDir>/contract.d.ts`, …). Mirrors\n* the schema-dir-relative `ARTIFACT_FILENAMES` in `hygiene-gitattributes.ts`\n* (not that file's migrations-root-anchored store lines, which are outside\n* this command's scope — reinit only ever touches `schemaDir`); kept as a\n* separate constant here because the cleanup contract is target-agnostic\n* and we deliberately do not want a stale artifact from a previous target\n* lingering after a re-init.\n*\n* If a future emit pipeline produces an additional schema-dir artifact,\n* add it here **and** to `ARTIFACT_FILENAMES` in `hygiene-gitattributes.ts`\n* — the two stay in lockstep so the file `init` advertises as\n* `linguist-generated` is exactly the file `init` is willing to delete on\n* re-init.\n*/\nconst ARTIFACT_FILENAMES = [\n\t\"contract.json\",\n\t\"contract.d.ts\",\n\t\"ops.json\",\n\t\"migration.json\"\n];\n/**\n* Returns the schema-relative paths of stale contract artifacts the\n* previous `init` run (or a `contract emit`) left behind in `schemaDir`.\n* Paths are returned relative to `baseDir` so the caller can plumb them\n* into `filesWritten`-style logging without re-deriving the path.\n*\n* Pure function: no filesystem mutation. Used by `runInit`'s precondition\n* phase (FR6.2 / NFR3 atomicity) so a downstream parse failure leaves\n* the artifacts on disk and the project byte-identical to its pre-init\n* state.\n*/\nfunction findStaleArtifacts(baseDir, schemaDir) {\n\tconst result = [];\n\tfor (const filename of ARTIFACT_FILENAMES) {\n\t\tconst rel = join(schemaDir, filename);\n\t\tif (existsSync(join(baseDir, rel))) result.push(rel);\n\t}\n\treturn result;\n}\n/**\n* Drops a single key from `package.json#dependencies`, returning the new\n* file content. Returns `null` when the dependency was already absent —\n* the caller can skip the write to keep re-init idempotent (FR9.3).\n*\n* Used by `runInit` for the FR9.2 target-switch path: when the user\n* re-inits a project from `--target postgres` to `--target mongodb` (or\n* vice versa), the previous facade is removed from `dependencies` so the\n* resulting project depends only on the chosen target's facade.\n*\n* Devs/peers/optional dep groups are intentionally *not* touched — the\n* facades are only ever in `dependencies` (FR4 / FR7), and broadening\n* the search would risk clobbering an unrelated dep with the same name\n* in `peerDependencies`.\n*\n* Throws `SyntaxError` if `existing` is not parseable as JSON; the\n* caller (`runInit`) already guards on that with a structured 5010\n* error before this helper is reached.\n*/\nfunction removeDependency(existing, depName) {\n\tconst parsed = JSON.parse(existing);\n\tconst deps = parsed[\"dependencies\"];\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return null;\n\tif (!Object.hasOwn(deps, depName)) return null;\n\tconst next = { ...deps };\n\tdelete next[depName];\n\tparsed[\"dependencies\"] = next;\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn `${JSON.stringify(parsed, null, 2)}${trailingNewline}`;\n}\n//#endregion\n//#region src/commands/init/templates/render.ts\nfunction renderTemplate(templateFile, variableNames, vars) {\n\tlet result = readFileSync(join(import.meta.dirname, templateFile), \"utf-8\");\n\tfor (const key of variableNames) {\n\t\tconst value = vars[key];\n\t\tif (value === void 0) throw new InternalError(`Template variable '${key}' is not defined`);\n\t\tresult = result.replaceAll(`{{${key}}}`, value);\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/commands/init/templates/quick-reference.ts\nconst variables = [\n\t\"schemaPath\",\n\t\"schemaDir\",\n\t\"dbImportPath\",\n\t\"pkgRun\",\n\t\"pkg\",\n\t\"configEntrypoint\",\n\t\"schemaSample\",\n\t\"requirements\"\n];\nfunction quickReferenceMd(target, authoring, schemaPath, pkgRun, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst schemaDir = dirname(schemaPath);\n\tconst pkg = targetPackageName(target, resolveImportSpecifier);\n\tconst vars = {\n\t\tschemaPath,\n\t\tschemaDir,\n\t\tdbImportPath: `./${schemaDir}/db`,\n\t\tpkgRun,\n\t\tpkg,\n\t\tconfigEntrypoint: targetEntrypoint(target, \"config\", resolveImportSpecifier),\n\t\tschemaSample: schemaSample(target, authoring, resolveImportSpecifier),\n\t\trequirements: requirementsBlock(target)\n\t};\n\treturn renderTemplate(`quick-reference-${target}.md`, variables, vars);\n}\n/**\n* Renders the FR8.2 \"Requirements\" block injected into `prisma-next.md`\n* (the user-facing quick reference). Sources the minimum server\n* version from `MIN_SERVER_VERSION` — itself mirrored from each\n* target package's `package.json#prismaNext.minServerVersion`\n* (FR8.1).\n*\n* The verification command is target-specific — Postgres scaffolds\n* shouldn't ship Mongo's `db.runCommand` (and vice versa) just because\n* we couldn't be bothered to branch.\n*/\nfunction requirementsBlock(target) {\n\treturn [\n\t\t\"## Requirements\",\n\t\t\"\",\n\t\t`- **${TARGET_LABEL[target]} ${MIN_SERVER_VERSION[target]} or newer.** Older servers are not supported. Run ${target === \"postgres\" ? \"`SELECT version()`\" : \"`db.runCommand({ buildInfo: 1 })`\"} against your server to verify.`,\n\t\t\"- The CLI never connects to your database without explicit consent. Pass `--probe-db` to `prisma-cli init` if you want `init` to verify the server version itself.\"\n\t].join(\"\\n\");\n}\n//#endregion\n//#region src/commands/init/templates/readme.ts\nconst sharedVariables = [\n\t\"projectName\",\n\t\"contractPath\",\n\t\"runDev\",\n\t\"runContractEmit\"\n];\nconst postgresVariables = [\n\t...sharedVariables,\n\t\"runDbInit\",\n\t\"runDbUpdate\",\n\t\"runMigrationPlan\",\n\t\"runMigrate\",\n\t\"runDbSeed\"\n];\nconst mongoVariables = [\n\t...sharedVariables,\n\t\"runDbUp\",\n\t\"runDbDown\",\n\t\"runDbReset\",\n\t\"runMigrationPlan\",\n\t\"runMigrate\",\n\t\"runDbSeed\"\n];\nfunction minimalProjectReadmeMd(target, schemaPath, projectName, pm) {\n\tconst run = (script) => formatRunScriptCommand(pm, script);\n\tconst shared = {\n\t\tprojectName,\n\t\tcontractPath: schemaPath,\n\t\trunDev: run(\"dev\"),\n\t\trunContractEmit: run(\"contract:emit\"),\n\t\trunMigrationPlan: run(\"migration:plan\"),\n\t\trunMigrate: run(\"migrate\"),\n\t\trunDbSeed: run(\"db:seed\")\n\t};\n\tif (target === \"mongo\") {\n\t\tconst vars = {\n\t\t\t...shared,\n\t\t\trunDbUp: run(\"db:up\"),\n\t\t\trunDbDown: run(\"db:down\"),\n\t\t\trunDbReset: run(\"db:reset\")\n\t\t};\n\t\treturn renderTemplate(\"readme-mongo.md\", mongoVariables, vars);\n\t}\n\tconst vars = {\n\t\t...shared,\n\t\trunDbInit: run(\"db:init\"),\n\t\trunDbUpdate: run(\"db:update\")\n\t};\n\treturn renderTemplate(\"readme-postgres.md\", postgresVariables, vars);\n}\n//#endregion\n//#region src/commands/init/templates/tsconfig.ts\n/**\n* Compiler options the scaffolded `prisma.config.ts` and `db.ts` need\n* to typecheck:\n*\n* - `module: 'preserve'` + `moduleResolution: 'bundler'` align with how\n* modern bundlers (and `tsdown`) consume our facade packages.\n* - `resolveJsonModule` lets `db.ts` import `contract.json with { type:\n* 'json' }` — the runtime path the facades document (FR4).\n*\n* `types: ['node']` is FR2.2 territory and lives in\n* `REQUIRED_COMPILER_OPTIONS_TYPES` because TS only honours an _array_\n* here, and a string-keyed merge would clobber any user-specified entries.\n* Merge handling preserves any extra `types` the user added.\n*/\nconst REQUIRED_COMPILER_OPTIONS = {\n\tmodule: \"preserve\",\n\tmoduleResolution: \"bundler\",\n\tresolveJsonModule: true\n};\n/**\n* Types that must be present in `compilerOptions.types` for the scaffold\n* to typecheck. With `moduleResolution: 'bundler'`, TypeScript does not\n* implicitly include all `@types/*` packages — `process.env` only resolves\n* when `node` is in this array (or `types` is omitted, but then any other\n* type listed here would force the same behaviour). Listing `node`\n* explicitly is the documented escape hatch (FR2.2).\n*/\nconst REQUIRED_COMPILER_OPTIONS_TYPES = [\"node\"];\nfunction defaultTsConfig() {\n\treturn JSON.stringify({\n\t\tcompilerOptions: {\n\t\t\ttarget: \"ES2022\",\n\t\t\t...REQUIRED_COMPILER_OPTIONS,\n\t\t\ttypes: [...REQUIRED_COMPILER_OPTIONS_TYPES],\n\t\t\tstrict: true,\n\t\t\tskipLibCheck: true,\n\t\t\tesModuleInterop: true,\n\t\t\toutDir: \"dist\"\n\t\t},\n\t\tinclude: [\"**/*.ts\"]\n\t}, null, 2);\n}\n/**\n* Thrown by `mergeTsConfig` when the user's existing `tsconfig.json` is\n* not parseable as JSONC (TypeScript's actual configured dialect — see\n* FR6.1). Carries the raw parse errors so the caller can render an\n* actionable, location-aware message.\n*\n* `runInit` catches this exception during the precondition phase and\n* maps it to a `CliStructuredError(5011)` so the user's working tree\n* stays byte-identical when init bails (FR6.2 / NFR3).\n*/\nvar TsConfigParseError = class extends Error {\n\terrors;\n\tconstructor(errors) {\n\t\tsuper(formatTsConfigParseErrors(errors));\n\t\tthis.errors = errors;\n\t\tthis.name = \"TsConfigParseError\";\n\t}\n};\nfunction formatTsConfigParseErrors(errors) {\n\tif (errors.length === 0) return \"tsconfig.json is empty or not an object\";\n\treturn errors.map((e) => `${printParseErrorCode(e.error)} at offset ${e.offset}`).join(\"; \");\n}\n/**\n* Merges the required compiler options into an existing `tsconfig.json`.\n*\n* Parsing is delegated to `jsonc-parser` so JSONC inputs (comments,\n* trailing commas) — TypeScript's real configuration dialect — survive\n* unchanged: edits are applied as text patches via `modify` /\n* `applyEdits`, preserving the user's formatting, key ordering, and\n* comments wherever the touched paths permit (FR6.1, AC \"Hostile\n* inputs\").\n*\n* Throws `TsConfigParseError` when the input is not parseable as JSONC.\n* The caller must catch this and surface a structured error before\n* writing any scaffold files (FR6.2 atomicity).\n*/\nfunction mergeTsConfig(existing) {\n\tconst { config } = parseTsConfigText(existing);\n\tconst formattingOptions = {\n\t\ttabSize: detectIndent(existing),\n\t\tinsertSpaces: true,\n\t\teol: existing.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\"\n\t};\n\tlet result = existing;\n\tfor (const [key, value] of Object.entries(REQUIRED_COMPILER_OPTIONS)) {\n\t\tconst edits = modify(result, [\"compilerOptions\", key], value, { formattingOptions });\n\t\tresult = applyEdits(result, edits);\n\t}\n\tconst existingTypes = config[\"compilerOptions\"]?.[\"types\"];\n\tconst mergedTypes = mergeTypesArray(existingTypes);\n\tconst typesEdits = modify(result, [\"compilerOptions\", \"types\"], mergedTypes, { formattingOptions });\n\tresult = applyEdits(result, typesEdits);\n\treturn result;\n}\n/**\n* Parses an existing `tsconfig.json` (JSONC) and returns the structured\n* config alongside any non-fatal parse warnings. Throws\n* `TsConfigParseError` if the input cannot be parsed at all or does\n* not resolve to a JSON object — both cases mean we cannot safely\n* apply edits.\n*\n* Exposed independently so callers (notably `runInit`'s precondition\n* gate) can validate the file *before* any scaffold file is written.\n*/\nfunction parseTsConfigText(text) {\n\tconst errors = [];\n\tconst value = parse(text, errors, {\n\t\tallowTrailingComma: true,\n\t\tdisallowComments: false,\n\t\tallowEmptyContent: false\n\t});\n\tif (value === void 0 || value === null || typeof value !== \"object\" || Array.isArray(value)) throw new TsConfigParseError(errors);\n\tif (errors.length > 0) throw new TsConfigParseError(errors);\n\treturn { config: value };\n}\nfunction detectIndent(text) {\n\tconst match = text.match(/^([ \\t]+)\\S/m);\n\tif (match === null) return 2;\n\tconst indent = match[1] ?? \"\";\n\tif (indent.startsWith(\"\t\")) return 1;\n\treturn indent.length || 2;\n}\n/**\n* Merges `REQUIRED_COMPILER_OPTIONS_TYPES` into the user's existing\n* `compilerOptions.types` array. Preserves order and dedupes. If the\n* user has no `types` array (or has set it to a non-array), we replace\n* with the required minimum — overwriting a non-array `types` is the\n* correct fix because anything other than a string array is invalid TS\n* config.\n*/\nfunction mergeTypesArray(existing) {\n\tconst result = [];\n\tif (Array.isArray(existing)) {\n\t\tfor (const item of existing) if (typeof item === \"string\" && !result.includes(item)) result.push(item);\n\t}\n\tfor (const required of REQUIRED_COMPILER_OPTIONS_TYPES) if (!result.includes(required)) result.push(required);\n\treturn result;\n}\n//#endregion\n//#region src/orm/init-scaffold.ts\nconst CONFIG_FILE = \"prisma.config.ts\";\nconst QUICK_REFERENCE_FILE = \"prisma-next.md\";\nconst ENV_EXAMPLE_FILE = \".env.example\";\n/**\n* The generated files a run replaces outright, in the order it writes them.\n* Everything else the scaffold touches it merges (`tsconfig.json`,\n* `package.json`, the git files) or keeps (`.env`, `README.md`), so replacing\n* one of these is the destructive act consent is asked for.\n*\n* `.env.example` is written the same way but deliberately left out: it is a\n* conventional filename in projects that have never seen Prisma Next, and a\n* consent token demanded for it would fire on first runs. The scaffold warns\n* when it replaces one instead.\n*/\nfunction generatedFilesInitReplaces(schemaPath) {\n\treturn [\n\t\tschemaPath,\n\t\tCONFIG_FILE,\n\t\tjoin(dirname(schemaPath), \"db.ts\"),\n\t\tQUICK_REFERENCE_FILE\n\t];\n}\nconst MANAGERS = /* @__PURE__ */ new Set([\n\t\"pnpm\",\n\t\"npm\",\n\t\"yarn\",\n\t\"bun\",\n\t\"deno\"\n]);\nfunction isPackageManager(name) {\n\treturn MANAGERS.has(name);\n}\n/**\n* The manager the scaffolded quick reference and README name in their example\n* commands. It resolves the way the engine's package operations resolve theirs\n* — the project at `cwd` first, then the manager that invoked this process —\n* so the documentation `init` writes names the manager `init` drove. The\n* capability itself reports no manager back on success, which is why this is\n* worked out a second time here.\n*/\nasync function resolveScaffoldPackageManager(ctx) {\n\tconst detected = await detect({ cwd: ctx.cwd });\n\tif (detected !== null && isPackageManager(detected.name)) return detected.name;\n\tconst invoking = ctx.env[\"npm_config_user_agent\"]?.split(\"/\")[0];\n\treturn invoking !== void 0 && isPackageManager(invoking) ? invoking : \"npm\";\n}\n/**\n* True when the parsed manifest declares `name` directly in `dependencies` or\n* `devDependencies`. Transitive presence is deliberately ignored: detecting it\n* needs the lockfile, and the realistic risk is a direct pin being clobbered.\n*/\nfunction hasDirectDep(parsed, name) {\n\tfor (const field of [\"dependencies\", \"devDependencies\"]) {\n\t\tconst value = parsed[field];\n\t\tif (value !== null && typeof value === \"object\" && name in value) return true;\n\t}\n\treturn false;\n}\n/**\n* npm package names are lowercase and URL-safe; `basename(cwd)` happily\n* returns \"My Project\" or \".hidden\", both of which npm refuses to read.\n*/\nfunction sanitisePackageName(raw) {\n\tconst trimmed = raw.toLowerCase().replace(/[^a-z0-9._~-]/g, \"-\").replace(/^[._-]+/, \"\").replace(/-+/g, \"-\");\n\treturn trimmed.length > 0 ? trimmed : \"my-app\";\n}\n/**\n* The manifest `init` writes for a directory that has none. Private, so a\n* stray publish cannot leak the placeholder, and ESM so the scaffolded import\n* attributes load under Node's loader.\n*/\nfunction defaultPackageJsonContent(rawName) {\n\treturn `${JSON.stringify({\n\t\tname: sanitisePackageName(rawName),\n\t\tversion: \"0.0.0\",\n\t\tprivate: true,\n\t\ttype: \"module\"\n\t}, null, 2)}\\n`;\n}\nfunction hasProjectManifest(cwd) {\n\treturn existsSync(join(cwd, \"package.json\")) || existsSync(join(cwd, \"deno.json\")) || existsSync(join(cwd, \"deno.jsonc\"));\n}\n/**\n* Computes every write before touching disk: reads and parses each file the\n* scaffold merges with, so a malformed manifest or tsconfig fails with the\n* user's project byte-identical to how it started.\n*/\nfunction planScaffold(ctx) {\n\tconst { cwd, inputs, packageManager, resolveImportSpecifier } = ctx;\n\tconst warnings = [];\n\tconst schemaDir = dirname(inputs.schemaPath);\n\tconst configContractPath = isAbsolute(inputs.schemaPath) ? inputs.schemaPath : `./${inputs.schemaPath}`;\n\tconst runPrefix = formatRunCommand(packageManager, \"prisma-cli\", \"\").trimEnd();\n\tconst files = [\n\t\t{\n\t\t\tpath: inputs.schemaPath,\n\t\t\tcontent: starterSchema(inputs.target, inputs.authoring, resolveImportSpecifier)\n\t\t},\n\t\t{\n\t\t\tpath: CONFIG_FILE,\n\t\t\tcontent: configFile(inputs.target, configContractPath, resolveImportSpecifier)\n\t\t},\n\t\t{\n\t\t\tpath: join(schemaDir, \"db.ts\"),\n\t\t\tcontent: dbFile(inputs.target, resolveImportSpecifier)\n\t\t},\n\t\t{\n\t\t\tpath: QUICK_REFERENCE_FILE,\n\t\t\tcontent: quickReferenceMd(inputs.target, inputs.authoring, inputs.schemaPath, runPrefix, resolveImportSpecifier)\n\t\t},\n\t\t{\n\t\t\tpath: ENV_EXAMPLE_FILE,\n\t\t\tcontent: envExampleContent(inputs.target)\n\t\t}\n\t];\n\tif (existsSync(join(cwd, ENV_EXAMPLE_FILE))) warnings.push(`${ENV_EXAMPLE_FILE} already existed and was replaced with the Prisma Next template.`);\n\tconst filesToDelete = inputs.reinit ? [...findStaleArtifacts(cwd, schemaDir)] : [];\n\tconst dirsToDelete = legacySkillDirs().filter((rel) => existsSync(join(cwd, rel)));\n\tif (inputs.writeEnv) if (existsSync(join(cwd, \".env\"))) warnings.push(\".env already exists; leaving it untouched. Compare with .env.example for any new keys.\");\n\telse files.push({\n\t\tpath: \".env\",\n\t\tcontent: envFileContent(inputs.target)\n\t});\n\tconst tsconfigPath = join(cwd, \"tsconfig.json\");\n\tif (existsSync(tsconfigPath)) {\n\t\tconst existing = readFileSync(tsconfigPath, \"utf-8\");\n\t\tlet merged;\n\t\ttry {\n\t\t\tmerged = mergeTsConfig(existing);\n\t\t} catch (error) {\n\t\t\tif (error instanceof TsConfigParseError) throw errorInitInvalidTsconfig({\n\t\t\t\tpath: \"tsconfig.json\",\n\t\t\t\tcause: error.message\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\tfiles.push({\n\t\t\tpath: \"tsconfig.json\",\n\t\t\tcontent: merged,\n\t\t\tnote: \"Updated tsconfig.json with required compiler options.\"\n\t\t});\n\t} else files.push({\n\t\tpath: \"tsconfig.json\",\n\t\tcontent: defaultTsConfig()\n\t});\n\tconst gitignorePath = join(cwd, \".gitignore\");\n\tconst nextGitignore = mergeGitignore(existsSync(gitignorePath) ? readFileSync(gitignorePath, \"utf-8\") : void 0);\n\tif (nextGitignore !== null) files.push({\n\t\tpath: \".gitignore\",\n\t\tcontent: nextGitignore\n\t});\n\tconst gitattributesPath = join(cwd, \".gitattributes\");\n\tconst nextGitattributes = mergeGitattributes(existsSync(gitattributesPath) ? readFileSync(gitattributesPath, \"utf-8\") : void 0, requiredGitattributesLines(schemaDir, inputs.target));\n\tif (nextGitattributes !== null) files.push({\n\t\tpath: \".gitattributes\",\n\t\tcontent: nextGitattributes\n\t});\n\tconst manifestPath = join(cwd, \"package.json\");\n\tconst manifestExisted = existsSync(manifestPath);\n\tconst synthesiseManifest = !manifestExisted && !hasProjectManifest(cwd);\n\tlet parsedManifest = null;\n\tif (manifestExisted || synthesiseManifest) {\n\t\tconst raw = manifestExisted ? readFileSync(manifestPath, \"utf-8\") : defaultPackageJsonContent(basename(cwd));\n\t\ttry {\n\t\t\tparsedManifest = JSON.parse(raw);\n\t\t} catch (error) {\n\t\t\tif (error instanceof SyntaxError) throw errorInitInvalidManifest({\n\t\t\t\tpath: \"package.json\",\n\t\t\t\tcause: error.message\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\tlet working = raw;\n\t\tlet changed = synthesiseManifest;\n\t\tif (inputs.removePreviousFacade !== null) {\n\t\t\tconst next = removeDependency(working, inputs.removePreviousFacade);\n\t\t\tif (next !== null) {\n\t\t\t\tworking = next;\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}\n\t\tconst { content: withScripts, warnings: scriptWarnings } = mergePackageScripts(working, REQUIRED_SCRIPTS);\n\t\tif (withScripts !== null) {\n\t\t\tworking = withScripts;\n\t\t\tchanged = true;\n\t\t}\n\t\tconst { content: withType, warning: typeWarning } = ensureEsmModuleType(working);\n\t\tif (withType !== null) {\n\t\t\tworking = withType;\n\t\t\tchanged = true;\n\t\t}\n\t\tif (changed) files.push({\n\t\t\tpath: \"package.json\",\n\t\t\tcontent: working\n\t\t});\n\t\twarnings.push(...scriptWarnings);\n\t\tif (typeWarning !== null) warnings.push(typeWarning);\n\t\tif (synthesiseManifest) warnings.push(\"No package.json found in the target directory; created a minimal one. Edit `name` / `version` to taste.\");\n\t}\n\tif (existsSync(join(cwd, \"src/index.ts\"))) if (existsSync(join(cwd, \"README.md\"))) warnings.push(\"README.md already exists; leaving it untouched.\");\n\telse {\n\t\tconst declaredName = parsedManifest !== null && typeof parsedManifest[\"name\"] === \"string\" ? parsedManifest[\"name\"] : basename(cwd);\n\t\tfiles.push({\n\t\t\tpath: \"README.md\",\n\t\t\tcontent: minimalProjectReadmeMd(inputs.target, inputs.schemaPath, sanitisePackageName(declaredName), packageManager)\n\t\t});\n\t}\n\treturn {\n\t\tfiles,\n\t\tfilesToDelete,\n\t\tdirsToDelete,\n\t\twarnings,\n\t\thasTypesNode: parsedManifest !== null && hasDirectDep(parsedManifest, \"@types/node\")\n\t};\n}\n/**\n* Plans every write, then performs them. Everything that can fail on the\n* user's existing files fails during planning, so a failure leaves the project\n* as it was; after the first write, the scaffold is on disk to keep, and a\n* write that fails partway names the files that already landed.\n*/\nfunction scaffoldProject(ctx) {\n\tconst resolveImportSpecifier = scaffoldSpecifierResolverFor(ctx.inputs.target);\n\tconst plan = planScaffold({\n\t\t...ctx,\n\t\tresolveImportSpecifier\n\t});\n\tconst filesWritten = [];\n\tconst filesDeleted = [];\n\tconst notes = [];\n\tfor (const file of plan.files) {\n\t\tconst target = join(ctx.cwd, file.path);\n\t\ttry {\n\t\t\tmkdirSync(dirname(target), { recursive: true });\n\t\t\twriteFileSync(target, file.content, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tthrow errorInitWriteFailed({\n\t\t\t\tpath: file.path,\n\t\t\t\tcause: error instanceof Error ? error.message : String(error),\n\t\t\t\tfilesWritten\n\t\t\t});\n\t\t}\n\t\tfilesWritten.push(file.path);\n\t\tif (file.note !== void 0) notes.push(file.note);\n\t}\n\tfor (const rel of plan.filesToDelete) {\n\t\tconst target = join(ctx.cwd, rel);\n\t\tif (!existsSync(target)) continue;\n\t\ttry {\n\t\t\tunlinkSync(target);\n\t\t\tfilesDeleted.push(rel);\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof Error && Reflect.get(error, \"code\") === \"ENOENT\")) throw error;\n\t\t}\n\t}\n\tfor (const rel of plan.dirsToDelete) {\n\t\trmSync(join(ctx.cwd, rel), {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t\tfilesDeleted.push(rel);\n\t}\n\treturn {\n\t\tfilesWritten,\n\t\tfilesDeleted,\n\t\twarnings: plan.warnings,\n\t\tnotes,\n\t\thasTypesNode: plan.hasTypesNode,\n\t\tresolveImportSpecifier\n\t};\n}\n//#endregion\n//#region src/orm/init-inputs.ts\nconst REQUIRED_FLAG_PROMPTS = /* @__PURE__ */ new Set([\"target\", \"authoring\"]);\nfunction formatFileList(files) {\n\tconst last = files.at(-1) ?? \"\";\n\treturn files.length <= 1 ? last : `${files.slice(0, -1).join(\", \")} and ${last}`;\n}\n/**\n* Names the files at stake rather than the category they belong to: the user\n* knows `contract.prisma`, not \"every generated file\".\n*/\nfunction consentQuestion(replaced) {\n\tconst written = replaced.length === 1 ? \"it\" : \"them\";\n\treturn `Re-initializing replaces ${formatFileList(replaced)} with a fresh scaffold, losing anything you wrote in ${written}.`;\n}\n/**\n* The engine raises this when a prompt has no default and the session cannot\n* show it. For the two prompts that stand in for a required flag, that is the\n* same condition `init` has always reported as a missing flag.\n*/\nfunction isPromptRequired(error) {\n\treturn error instanceof Error && Reflect.get(error, \"code\") === \"CLI.PROMPT_REQUIRED\";\n}\n/**\n* `--confirm` matches a token, so the token has to be something the user can\n* see and type. The working directory's name is it; a directory with no name\n* of its own (the filesystem root) falls back to its path.\n*\n* Trimmed, because the engine compares the typed answer trimmed: an untrimmed\n* token from a directory named `my app ` is one no keystroke sequence matches.\n*/\nfunction consentToken(cwd) {\n\tconst name = basename(cwd).trim();\n\treturn name.length > 0 ? name : cwd.trim();\n}\nasync function askTarget(prompt) {\n\treturn prompt.select(\"What database are you using?\", [{\n\t\tvalue: \"postgres\",\n\t\tlabel: \"PostgreSQL\"\n\t}, {\n\t\tvalue: \"mongo\",\n\t\tlabel: \"MongoDB\"\n\t}]);\n}\nasync function askAuthoring(prompt) {\n\treturn prompt.select(\"How do you want to write your schema?\", [{\n\t\tvalue: \"psl\",\n\t\tlabel: \"Prisma Schema Language (.prisma)\"\n\t}, {\n\t\tvalue: \"typescript\",\n\t\tlabel: \"TypeScript (.ts)\"\n\t}]);\n}\n/**\n* The schema path the user typed goes through the same validator the flag\n* does, so an answer the engine accepted still has to agree with the authoring\n* style.\n*/\nasync function askSchemaPath(prompt, authoring) {\n\tconst fallback = defaultSchemaPath(authoring);\n\treturn validateSchemaPath(await prompt.text(\"Where should the schema file go?\", {\n\t\tplaceholder: fallback,\n\t\tdefault: fallback\n\t}), authoring);\n}\n/**\n* The facade a previous `init` installed for the other target, when this run\n* switches targets and one is still declared. Reads every name a previous run\n* could have written, because older versions scaffolded the workspace name.\n*/\nfunction previousFacade(cwd, target) {\n\tconst manifestPath = join(cwd, \"package.json\");\n\tif (!existsSync(manifestPath)) return;\n\tconst otherTarget = target === \"postgres\" ? \"mongo\" : \"postgres\";\n\tconst candidates = [targetPackageName(otherTarget, scaffoldSpecifierResolverFor(otherTarget)), targetPackageName(otherTarget)];\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(readFileSync(manifestPath, \"utf-8\"));\n\t} catch {\n\t\treturn;\n\t}\n\tconst deps = parsed[\"dependencies\"];\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return;\n\tconst declared = deps;\n\treturn candidates.find((name) => Object.hasOwn(declared, name));\n}\nasync function resolveRemovePreviousFacade(ctx) {\n\tif (!ctx.reinit || ctx.keepPreviousFacade) return null;\n\tconst facade = previousFacade(ctx.cwd, ctx.target);\n\tif (facade === void 0) return null;\n\tconst otherTarget = ctx.target === \"postgres\" ? \"mongo\" : \"postgres\";\n\treturn await ctx.prompt.confirm(`Switching from ${targetLabel(otherTarget)} to ${targetLabel(ctx.target)} — remove ${facade} from package.json dependencies?`, { default: true }) ? facade : null;\n}\n/**\n* Resolves every input from the flags and, where a flag is absent, from the\n* engine's prompt surface.\n*\n* Order matters twice. Every flag value is validated before anything is asked,\n* so a typo costs a typo rather than a typed consent token. And consent comes\n* as soon as the schema path is known, because that is the point at which the\n* question can name the files it is about — and before any question whose\n* answer only matters if the run proceeds.\n*/\nasync function resolveInitInputs(ctx) {\n\tconst { cwd, flags, prompt } = ctx;\n\tif (flags.strictProbe && !flags.probeDb) throw errorInitStrictProbeWithoutProbe();\n\tconst flagTarget = resolveTarget(flags.target);\n\tconst flagAuthoring = resolveAuthoring(flags.authoring);\n\tlet target;\n\tlet authoring;\n\ttry {\n\t\ttarget = flagTarget ?? await askTarget(prompt);\n\t\tauthoring = flagAuthoring ?? await askAuthoring(prompt);\n\t} catch (error) {\n\t\tif (!isPromptRequired(error)) throw error;\n\t\tthrow errorInitMissingFlags({\n\t\t\tmissing: [...flagTarget === void 0 ? [\"target\"] : [], ...flagAuthoring === void 0 ? [\"authoring\"] : []].filter((flag) => REQUIRED_FLAG_PROMPTS.has(flag)),\n\t\t\twhy: \"This session cannot prompt, so the answers have to arrive as flags.\"\n\t\t});\n\t}\n\tconst schemaPath = flags.schemaPath !== void 0 ? validateSchemaPath(flags.schemaPath, authoring) : await askSchemaPath(prompt, authoring);\n\tconst replaced = generatedFilesInitReplaces(schemaPath).filter((relative) => existsSync(join(cwd, relative)));\n\tconst reinit = replaced.length > 0;\n\tif (reinit) {\n\t\tif (!await prompt.consent(consentQuestion(replaced), { token: consentToken(cwd) })) throw errorInitUserAborted();\n\t}\n\tconst writeEnv = flags.writeEnv || await prompt.confirm(\"Also write a .env file from .env.example? (gitignored)\", { default: false });\n\tconst removePreviousFacade = await resolveRemovePreviousFacade({\n\t\tcwd,\n\t\ttarget,\n\t\treinit,\n\t\tkeepPreviousFacade: flags.keepPreviousFacade,\n\t\tprompt\n\t});\n\treturn {\n\t\ttarget,\n\t\tauthoring,\n\t\tschemaPath,\n\t\tinstall: !flags.skipInstall,\n\t\twriteEnv,\n\t\tprobeDb: flags.probeDb,\n\t\tstrictProbe: flags.strictProbe,\n\t\treinit,\n\t\tremovePreviousFacade,\n\t\tinstallProjectSkill: !flags.skipSkills\n\t};\n}\n//#endregion\n//#region src/commands/init/pnpm-fallback.ts\n/**\n* Recognised pnpm error signatures that justify a fallback to npm.\n*\n* These patterns indicate the published artifact itself is at fault\n* (a leaked `workspace:*` or `catalog:` specifier), not the user's\n* environment — pnpm is faithfully reporting \"I cannot resolve this\n* registry version\", and npm is willing to install it because npm\n* doesn't care about the protocol prefix when there's a fallback range.\n*\n* The predicate lives on its own so both shells' `init` share one list:\n* the commander command matches it against captured child stderr, the\n* engine command against the stderr the package-manager capability\n* returns on a failed install.\n*/\nfunction isRecognisedPnpmResolutionError(stderr) {\n\tif (!stderr) return false;\n\treturn stderr.includes(\"ERR_PNPM_WORKSPACE_PKG_NOT_FOUND\") || stderr.includes(\"ERR_PNPM_NO_MATCHING_VERSION\") || /No matching version found for .* in the catalog/i.test(stderr) || /workspace:[^\\s]+ is not a valid (version|spec)/i.test(stderr) || /catalog:[^\\s]* is not a valid (version|spec)/i.test(stderr);\n}\n//#endregion\n//#region src/orm/init-packages.ts\nfunction metaString(failure, key) {\n\tconst value = failure.meta?.[key];\n\treturn typeof value === \"string\" ? value : \"\";\n}\n/**\n* pnpm reported a specifier the published artifact leaked, which npm installs\n* happily. The engine redacts credentials out of the stderr it returns but\n* leaves error codes alone, which is what this reads.\n*/\nfunction pnpmLeakedASpecifier(failure) {\n\treturn metaString(failure, \"manager\") === \"pnpm\" && isRecognisedPnpmResolutionError(metaString(failure, \"stderrTail\"));\n}\n/**\n* The engine redacts the stderr it hands back, and this redacts it again\n* before quoting it: what the engine strips is its own business, and registry\n* auth material is not all URL-shaped.\n*/\nfunction fallbackWarning(failure) {\n\tconst firstLine = redactSecrets(metaString(failure, \"stderrTail\")).trim().split(\"\\n\")[0] ?? \"\";\n\treturn [\n\t\t\"pnpm could not install: a published Prisma Next dependency leaked a `workspace:*` or `catalog:` specifier.\",\n\t\t\"Falling back to npm so init can complete.\",\n\t\tfirstLine === \"\" ? \"\" : ` pnpm error: ${firstLine}`,\n\t\t\"Both installs ran under npm, which writes a package-lock.json beside the pnpm lockfile — delete whichever of the two you do not want to keep.\",\n\t\t\"Once the offending package republishes a clean version, re-run `pnpm install` to switch back.\"\n\t].filter((line) => line !== \"\").join(\"\\n\");\n}\n/** The pnpm failure the npm retry was meant to recover from, kept alongside the npm one. */\nfunction retriedWarning(failure) {\n\tconst firstLine = redactSecrets(metaString(failure, \"stderrTail\")).trim().split(\"\\n\")[0] ?? \"\";\n\treturn [\"pnpm failed first with a leaked `workspace:*` or `catalog:` specifier, so init retried with npm.\", firstLine === \"\" ? \"\" : ` pnpm error: ${firstLine}`].filter((line) => line !== \"\").join(\"\\n\");\n}\n/**\n* Adds the runtime and development dependencies through the engine's package\n* manager. The retry is `init`'s alone: the engine spells and runs the\n* command, and this decides — from the stderr it returned — that another\n* manager is worth a try.\n*/\n/**\n* The engine dependency spec a fresh scaffold installs. The scaffolded\n* `prisma.config.ts` imports `defineConfig` from `@prisma/cli-engine`, and the\n* installed `@prisma/cli` names the exact engine version it runs against — so\n* the spec is read from the manifest the install just placed, never guessed\n* from a dist-tag (whose `latest` has lagged that version before and broken\n* the very next command). A CLI without a readable engine entry falls back to\n* the `next` tag, the release train the CLI itself publishes under.\n*/\nfunction engineDevDependencySpec(cwd) {\n\ttry {\n\t\tconst manifest = JSON.parse(readFileSync(join(cwd, \"node_modules\", \"@prisma\", \"cli\", \"package.json\"), \"utf-8\"));\n\t\tif (typeof manifest === \"object\" && manifest !== null) for (const field of [\"dependencies\", \"peerDependencies\"]) {\n\t\t\tconst block = Reflect.get(manifest, field);\n\t\t\tif (typeof block === \"object\" && block !== null) {\n\t\t\t\tconst engine = Reflect.get(block, \"@prisma/cli-engine\");\n\t\t\t\tif (typeof engine === \"string\" && engine.length > 0) return `@prisma/cli-engine@${engine}`;\n\t\t\t}\n\t\t}\n\t} catch {}\n\treturn \"@prisma/cli-engine@next\";\n}\nasync function installProjectDependencies(ctx) {\n\tconst pair = async (manager) => {\n\t\tconst runtimeDeps = await ctx.packages.install({\n\t\t\tpackages: ctx.deps,\n\t\t\tcwd: ctx.cwd,\n\t\t\t...ifDefined(\"manager\", manager)\n\t\t});\n\t\tif (!runtimeDeps.ok) return runtimeDeps.failure;\n\t\tconst developmentDeps = await ctx.packages.install({\n\t\t\tpackages: ctx.devDeps,\n\t\t\tdev: true,\n\t\t\tcwd: ctx.cwd,\n\t\t\t...ifDefined(\"manager\", manager)\n\t\t});\n\t\treturn developmentDeps.ok ? void 0 : developmentDeps.failure;\n\t};\n\tconst failure = await pair();\n\tif (failure === void 0) return {\n\t\tfailure: void 0,\n\t\tmanager: void 0,\n\t\twarnings: ctx.catalogWarnings\n\t};\n\tif (!pnpmLeakedASpecifier(failure)) return {\n\t\tfailure,\n\t\tmanager: void 0,\n\t\twarnings: []\n\t};\n\tconst retryFailure = await pair(\"npm\");\n\tif (retryFailure !== void 0) return {\n\t\tfailure: retryFailure,\n\t\tmanager: void 0,\n\t\twarnings: [retriedWarning(failure)]\n\t};\n\treturn {\n\t\tfailure: void 0,\n\t\tmanager: \"npm\",\n\t\twarnings: [fallbackWarning(failure)]\n\t};\n}\nfunction skillArgs(url, skill) {\n\treturn [\n\t\t\"add\",\n\t\turl,\n\t\t\"--agent\",\n\t\t...DEFAULT_SKILL_AGENTS,\n\t\t\"--skill\",\n\t\tskill,\n\t\t\"-y\"\n\t];\n}\n/**\n* Registers every Prisma Next skill with the agent runtimes, in order. The\n* first failure stops the loop: the user opted into Prisma Next by running\n* `init`, and a half-installed skill set leaves the project ambiguous.\n*/\nasync function installAgentSkills(ctx) {\n\tfor (const source of DEFAULT_SKILL_SOURCES) {\n\t\tconst result = await ctx.packages.run({\n\t\t\tpackage: \"skills@latest\",\n\t\t\targs: skillArgs(formatSkillSourceUrl(source, ctx.env), source.skill),\n\t\t\tcwd: ctx.cwd,\n\t\t\t...ifDefined(\"manager\", ctx.manager)\n\t\t});\n\t\tif (!result.ok) return result.failure;\n\t}\n}\n//#endregion\n//#region src/orm/init.ts\n/** The scaffold is on disk from here on, so each of these is a finding. */\nconst INIT_EXIT_CODES = {\n\t4: \"scaffold written; dependency install failed\",\n\t5: \"scaffold written and installed; contract emit failed\",\n\t6: \"scaffold complete; agent-skill install failed\"\n};\nfunction probeWarning(outcome, strictProbe) {\n\tswitch (outcome.kind) {\n\t\tcase \"ok\": return {\n\t\t\twarning: void 0,\n\t\t\tfatal: void 0\n\t\t};\n\t\tcase \"below-minimum\": return {\n\t\t\twarning: outcome.message,\n\t\t\tfatal: void 0\n\t\t};\n\t\tcase \"no-database-url\":\n\t\tcase \"connection-failed\":\n\t\tcase \"driver-missing\": return strictProbe ? {\n\t\t\twarning: void 0,\n\t\t\tfatal: outcome.message\n\t\t} : {\n\t\t\twarning: outcome.message,\n\t\t\tfatal: void 0\n\t\t};\n\t}\n}\nfunction causeMessage(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\nconst createInitCommand = (injected) => defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Initialize a new Prisma Next project\",\n\t\tdescription: \"Scaffolds config, schema, and runtime files, installs dependencies,\\nand emits the contract. Gets you from zero to typed queries in one step.\\n\\nRun it interactively for a guided setup, or supply --target and --authoring\\nfor a fully scriptable run (CI, AI coding agents, automation).\",\n\t\texamples: [\n\t\t\t\"init\",\n\t\t\t\"init --target postgres --authoring psl\",\n\t\t\t\"init --target mongodb --authoring typescript --json\",\n\t\t\t\"init --skip-install\",\n\t\t\t\"init --skip-skills\",\n\t\t\t\"init --target postgres --keep-previous-facade\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\ttarget: flag.string({\n\t\t\tbrief: \"Database target: postgres or mongodb\",\n\t\t\tplaceholder: \"db\"\n\t\t}),\n\t\tauthoring: flag.string({\n\t\t\tbrief: \"Schema authoring style: psl or typescript\",\n\t\t\tplaceholder: \"style\"\n\t\t}),\n\t\tschemaPath: flag.string({\n\t\t\tbrief: \"Where to write the starter schema\",\n\t\t\tplaceholder: \"path\"\n\t\t}),\n\t\twriteEnv: flag.boolean({ brief: \"Write a .env file from .env.example (gitignored)\" }),\n\t\tprobeDb: flag.boolean({ brief: \"Connect to DATABASE_URL once and check the server version\" }),\n\t\tstrictProbe: flag.boolean({ brief: \"Treat a failed --probe-db as fatal\" }),\n\t\tskipInstall: flag.boolean({ brief: \"Skip dependency installation and contract emission\" }),\n\t\tskipSkills: flag.boolean({ brief: \"Skip the Prisma Next agent-skill install\" }),\n\t\tkeepPreviousFacade: flag.boolean({ brief: \"Keep the previous target package in package.json when switching targets\" })\n\t} },\n\texitCodes: INIT_EXIT_CODES,\n\tinstallsPackages: true,\n\thandler: async (args, ctx) => {\n\t\tconst warnings = [];\n\t\tconst warn = (text) => {\n\t\t\twarnings.push(text);\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext\n\t\t\t});\n\t\t};\n\t\tconst inputs = await resolveInitInputs({\n\t\t\tcwd: ctx.cwd,\n\t\t\tflags: args.flags,\n\t\t\tprompt: ctx.prompt\n\t\t});\n\t\tconst packageManager = await resolveScaffoldPackageManager({\n\t\t\tcwd: ctx.cwd,\n\t\t\tenv: ctx.env\n\t\t});\n\t\tconst scaffold = scaffoldProject({\n\t\t\tcwd: ctx.cwd,\n\t\t\tinputs,\n\t\t\tpackageManager\n\t\t});\n\t\tfor (const warning of scaffold.warnings) warn(warning);\n\t\tfor (const note of scaffold.notes) ctx.report({\n\t\t\tkind: \"message\",\n\t\t\tseverity: \"info\",\n\t\t\ttext: note\n\t\t});\n\t\tconst deps = [targetPackageName(inputs.target, scaffold.resolveImportSpecifier), \"dotenv\"];\n\t\tconst cliDevDeps = [\"@prisma/cli@next\"];\n\t\tconst devDeps = scaffold.hasTypesNode ? cliDevDeps : [...cliDevDeps, \"@types/node\"];\n\t\tconst findings = [];\n\t\tconst extraActions = [];\n\t\tlet installedManager;\n\t\tlet packagesInstalled = \"skipped\";\n\t\tlet contractEmitted = false;\n\t\tlet skillRegistered = false;\n\t\tconst settle = (exitCode) => {\n\t\t\tconst installed = packagesInstalled === \"installed\";\n\t\t\tconst document = {\n\t\t\t\tok: true,\n\t\t\t\ttarget: inputs.target === \"mongo\" ? \"mongodb\" : \"postgres\",\n\t\t\t\tauthoring: inputs.authoring,\n\t\t\t\tschemaPath: inputs.schemaPath,\n\t\t\t\tfilesWritten: scaffold.filesWritten,\n\t\t\t\tfilesDeleted: scaffold.filesDeleted,\n\t\t\t\tpackagesInstalled: {\n\t\t\t\t\tstatus: packagesInstalled,\n\t\t\t\t\tdeps: installed ? deps : [],\n\t\t\t\t\tdevDeps: installed ? devDeps : []\n\t\t\t\t},\n\t\t\t\tcontractEmitted,\n\t\t\t\tnextSteps: buildNextSteps({\n\t\t\t\t\ttarget: inputs.target === \"mongo\" ? \"mongodb\" : \"postgres\",\n\t\t\t\t\tpackagesInstalled,\n\t\t\t\t\tcontractEmitted,\n\t\t\t\t\temitCommand: EMIT_COMMAND,\n\t\t\t\t\tschemaPath: inputs.schemaPath,\n\t\t\t\t\tskillRegistered\n\t\t\t\t}),\n\t\t\t\twarnings\n\t\t\t};\n\t\t\tconst validated = InitOutputSchema(document);\n\t\t\tif (validated instanceof type.errors) return notOk$1(new CliStructuredError$1(\"CLI.INIT_INVALID_OUTPUT_DOCUMENT\", \"Init produced an invalid output document\", {\n\t\t\t\twhy: `The success document failed schema validation: ${String(validated)}`,\n\t\t\t\tnextActions: [chooseAction(\"This is a bug in Prisma Next. Please report it with `-v` output.\")],\n\t\t\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_OUTPUT_DOCUMENT\")\n\t\t\t}));\n\t\t\treturn ok$1(ctx.present({\n\t\t\t\tdata: document,\n\t\t\t\texitCode,\n\t\t\t\tdiagnostics: findings\n\t\t\t}, initPresentations({\n\t\t\t\tdocument,\n\t\t\t\tcomplete: exitCode === 0,\n\t\t\t\tnextActions: [...extraActions, ...buildInitNextActions({\n\t\t\t\t\tcontractEmitted,\n\t\t\t\t\tschemaPath: inputs.schemaPath,\n\t\t\t\t\tskillRegistered\n\t\t\t\t})]\n\t\t\t})));\n\t\t};\n\t\tif (inputs.install) {\n\t\t\tconst outcome = await installProjectDependencies({\n\t\t\t\tpackages: ctx.packages,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tdeps,\n\t\t\t\tdevDeps,\n\t\t\t\tcatalogWarnings: packageManager === \"pnpm\" ? buildCatalogWarnings(ctx.cwd, [...deps, ...devDeps]) : []\n\t\t\t});\n\t\t\tfor (const warning of outcome.warnings) warn(warning);\n\t\t\tif (outcome.failure !== void 0) {\n\t\t\t\tpackagesInstalled = \"failed\";\n\t\t\t\tfindings.push(installFailedFinding(outcome.failure, scaffold.filesWritten));\n\t\t\t\treturn settle(4);\n\t\t\t}\n\t\t\tconst engineSpec = engineDevDependencySpec(ctx.cwd);\n\t\t\tconst engineInstall = await ctx.packages.install({\n\t\t\t\tpackages: [engineSpec],\n\t\t\t\tdev: true,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\t...ifDefined(\"manager\", outcome.manager)\n\t\t\t});\n\t\t\tif (!engineInstall.ok) {\n\t\t\t\tpackagesInstalled = \"failed\";\n\t\t\t\tfindings.push(installFailedFinding(engineInstall.failure, scaffold.filesWritten));\n\t\t\t\treturn settle(4);\n\t\t\t}\n\t\t\tdevDeps.push(engineSpec);\n\t\t\tpackagesInstalled = \"installed\";\n\t\t\tinstalledManager = outcome.manager;\n\t\t\tconst emitStep = \"Emit the contract\";\n\t\t\tctx.report({\n\t\t\t\tkind: \"step-started\",\n\t\t\t\tstep: emitStep\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tawait injected.emitScaffoldedContract({ cwd: ctx.cwd });\n\t\t\t\tcontractEmitted = true;\n\t\t\t\tctx.report({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: emitStep,\n\t\t\t\t\toutcome: \"ok\"\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tctx.report({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: emitStep,\n\t\t\t\t\toutcome: \"failed\"\n\t\t\t\t});\n\t\t\t\tfindings.push(emitFailedFinding(causeMessage(error), scaffold.filesWritten));\n\t\t\t\treturn settle(5);\n\t\t\t}\n\t\t} else extraActions.push(chooseAction(`Install the project dependencies with your package manager: ${deps.join(\", \")} (and ${devDeps.join(\", \")} plus @prisma/cli-engine at the version @prisma/cli declares as its peer, as development dependencies)`));\n\t\tif (inputs.probeDb) {\n\t\t\tconst probe = probeWarning(await probeServerVersion({\n\t\t\t\tbaseDir: ctx.cwd,\n\t\t\t\ttarget: inputs.target,\n\t\t\t\tdatabaseUrl: ctx.env[\"DATABASE_URL\"],\n\t\t\t\tminVersion: MIN_SERVER_VERSION[inputs.target]\n\t\t\t}, {}), inputs.strictProbe);\n\t\t\tif (probe.warning !== void 0) warn(probe.warning);\n\t\t\tif (probe.fatal !== void 0) return notOk$1(normalizeError(errorInitProbeFailed({\n\t\t\t\tcause: probe.fatal,\n\t\t\t\tfilesWritten: scaffold.filesWritten\n\t\t\t})));\n\t\t}\n\t\tconst skillCommands = resolveProjectSkillInstallCommands(installedManager ?? packageManager, ctx.env);\n\t\tif (inputs.installProjectSkill) {\n\t\t\tconst failure = await installAgentSkills({\n\t\t\t\tpackages: ctx.packages,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tenv: ctx.env,\n\t\t\t\tmanager: installedManager\n\t\t\t});\n\t\t\tif (failure !== void 0) {\n\t\t\t\tfindings.push(skillInstallFailedFinding(failure, scaffold.filesWritten, skillCommands));\n\t\t\t\treturn settle(6);\n\t\t\t}\n\t\t\tskillRegistered = true;\n\t\t} else warn(`Skipped the Prisma Next agent-skill install (--skip-skills). To install them later, run: ${skillCommands.map((command) => `\\`${command}\\``).join(\" && \")}`);\n\t\treturn settle(0);\n\t}\n});\nconst initCommand = createInitCommand({ emitScaffoldedContract });\n//#endregion\n//#region src/orm/lsp.ts\n/**\n* R-S5-12 asks every command to end at 143 for SIGTERM and 130 otherwise, and\n* a server command is the one kind the engine leaves to do it: it settles the\n* handler's code verbatim, on the reasoning that a protocol conclusion was\n* never the CLI's to author. The two readings are in tension — this one wins\n* here, and the tension is recorded for the engine's owners, because it means\n* a SIGTERM landing after a clean `shutdown` reports 143 for a conversation\n* that ended correctly at 0.\n*/\nfunction signalExitCode(reason) {\n\treturn reason === \"SIGTERM\" ? 143 : 130;\n}\nconst lspCommand = defineServerCommand({\n\thelp: {\n\t\tsummary: \"Start the Prisma Next language server\",\n\t\tdescription: \"Launches a Language Server Protocol server that publishes PSL parse diagnostics\\nand handles whole-document PSL formatting for the schema inputs declared in\\nyour config (contract.source.inputs). Formatting uses the Prisma Next PSL\\nformatter and the formatter block from the project config.\\nCommunicates over stdio; intended to be spawned by an\\neditor, not run interactively. The server keeps running until the editor client\\ndisconnects.\",\n\t\texamples: [\"lsp\"]\n\t},\n\targs: { flags: {\n\t\tstdio: flag.boolean({ brief: \"Communicate with the editor over stdio (the default and only transport)\" }),\n\t\tclientProcessId: flag.number({\n\t\t\tbrief: \"Process id of the editor that spawned the server; the server ends when it dies\",\n\t\t\tplaceholder: \"pid\"\n\t\t})\n\t} },\n\thandler: async (args, io) => {\n\t\tconst exitCode = await withoutClientProcessIdInArgv(async () => {\n\t\t\tconst { startServer } = await import(\"@internal/language-server\");\n\t\t\treturn startServer({\n\t\t\t\tstdin: io.stdin,\n\t\t\t\tstdout: io.stdout,\n\t\t\t\tstderr: io.stderr,\n\t\t\t\tsignal: io.signal,\n\t\t\t\t...ifDefined(\"clientProcessId\", args.flags.clientProcessId)\n\t\t\t});\n\t\t});\n\t\treturn io.signal.aborted ? signalExitCode(io.signal.reason) : exitCode;\n\t}\n});\n/**\n* Importing `vscode-languageserver/node` reads `--clientProcessId` off\n* `process.argv` and arms a parent-watch interval that is never unref'd, so a\n* settled run would leave the process hanging. The server watches the client\n* process itself (from the parsed flag), so the argument is hidden for the\n* import and restored after.\n*/\nasync function withoutClientProcessIdInArgv(run) {\n\tconst original = process.argv;\n\tconst scrubbed = [];\n\tfor (let index = 0; index < original.length; index += 1) {\n\t\tconst token = original[index];\n\t\tif (token === \"--clientProcessId\") {\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (token === void 0 || token.startsWith(\"--clientProcessId=\")) continue;\n\t\tscrubbed.push(token);\n\t}\n\tprocess.argv = scrubbed;\n\ttry {\n\t\treturn await run();\n\t} finally {\n\t\tprocess.argv = original;\n\t}\n}\n//#endregion\n//#region src/utils/formatters/tone-markup.ts\n/**\n* The drawing formatters compose one string per line, measuring display widths\n* with `string-width` as they go. To carry colour through that pipeline without\n* disturbing a single width, a tone is marked with an SGR escape sequence:\n* `string-width` and `strip-ansi` already treat those as zero-width, so every\n* existing width calculation keeps its answer.\n*\n* The marks are a transport, not output. {@link toneDrawing} turns a marked\n* string into the engine's spans, and it drops every escape sequence it sees —\n* so no escape sequence can reach the engine, which does the painting itself.\n*/\nconst TONE_MARK_BASE = 900;\n/** The escape character every SGR sequence opens with. */\nconst ESCAPE = String.fromCharCode(27);\n/** Ends the innermost open mark. */\nconst TONE_MARK_END = `${ESCAPE}[${TONE_MARK_BASE}m`;\n/**\n* Every tone, in the order their marks are numbered. Exported so a test can\n* hold it against a compiler-checked list of the engine's tones: a tone\n* missing from here would silently lose its colour.\n*/\nconst TONE_ORDER = [\n\t\"ok\",\n\t\"warn\",\n\t\"error\",\n\t\"info\",\n\t\"heading\",\n\t\"identifier\",\n\t\"ref\",\n\t\"placeholder\",\n\t\"link\",\n\t\"emphasis\",\n\t\"muted\",\n\t\"structure\",\n\t\"highlight\",\n\t\"color-1\",\n\t\"color-2\",\n\t\"color-3\",\n\t\"color-4\",\n\t\"color-5\",\n\t\"color-6\"\n];\nconst MARK_BY_TONE = new Map(TONE_ORDER.map((tone, index) => [tone, TONE_MARK_BASE + index + 1]));\nconst TONE_BY_MARK = new Map(TONE_ORDER.map((tone, index) => [TONE_MARK_BASE + index + 1, tone]));\n/** Marks `text` as carrying `tone`. Marks nest; the innermost one wins. */\nfunction toned(tone, text) {\n\treturn `${ESCAPE}[${MARK_BY_TONE.get(tone)}m${text}${TONE_MARK_END}`;\n}\n/** The painter shape the formatters take, bound to one tone. */\nfunction tonePainter(tone) {\n\treturn (text) => toned(tone, text);\n}\nconst SGR_SEQUENCE = new RegExp(`${ESCAPE}\\\\[([\\\\d;]*)m`, \"g\");\nfunction pushSpan(spans, text, tone) {\n\tif (text.length === 0) return;\n\tconst previous = spans.at(-1);\n\tif (previous !== void 0 && previous.tone === tone) {\n\t\tspans[spans.length - 1] = {\n\t\t\ttext: previous.text + text,\n\t\t\t...tone === void 0 ? {} : { tone }\n\t\t};\n\t\treturn;\n\t}\n\tspans.push({\n\t\ttext,\n\t\t...tone === void 0 ? {} : { tone }\n\t});\n}\n/** One marked line as spans. Text carrying no mark becomes an untoned span. */\nfunction toneSpans(line) {\n\tconst spans = [];\n\tconst open = [];\n\tlet cursor = 0;\n\tSGR_SEQUENCE.lastIndex = 0;\n\tfor (let match = SGR_SEQUENCE.exec(line); match !== null; match = SGR_SEQUENCE.exec(line)) {\n\t\tpushSpan(spans, line.slice(cursor, match.index), open.at(-1));\n\t\tcursor = match.index + match[0].length;\n\t\tfor (const parameter of (match[1] ?? \"\").split(\";\")) {\n\t\t\tconst code = Number(parameter);\n\t\t\tif (code === TONE_MARK_BASE) {\n\t\t\t\topen.pop();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst tone = TONE_BY_MARK.get(code);\n\t\t\tif (tone !== void 0) open.push(tone);\n\t\t}\n\t}\n\tpushSpan(spans, line.slice(cursor), open.at(-1));\n\treturn spans;\n}\n/**\n* A marked block as the lines of a `drawing` block. A line with no marks stays\n* a plain string, which is what the engine's `Text` wants for untoned text.\n*/\nfunction toneDrawing(block) {\n\treturn block.split(\"\\n\").map((line) => {\n\t\tconst spans = toneSpans(line);\n\t\tif (spans.length === 0) return \"\";\n\t\tconst only = spans.length === 1 ? spans[0] : void 0;\n\t\treturn only !== void 0 && only.tone === void 0 ? only.text : spans;\n\t});\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-palette.ts\nconst LANE_COUNT = 6;\nconst forced = createColors({ useColor: true });\nconst ANSI_LANES = [\n\tforced.white,\n\tforced.cyan,\n\tforced.yellow,\n\tforced.blueBright,\n\tforced.magenta,\n\tforced.green\n];\n/** The palette the commander CLI paints with: ANSI SGR straight into the line. */\nconst ANSI_MIGRATION_GRAPH_PALETTE = {\n\tlane: (lane, text) => (ANSI_LANES[lane % LANE_COUNT] ?? ((value) => value))(text),\n\trole: (role, text) => role === \"on-path\" ? forced.greenBright(text) : forced.dim(text),\n\temphasis: (text) => bold(text),\n\tstatus: (status, text) => status === \"applied\" ? green(text) : yellow(text)\n};\nconst TONE_LANES = [\n\t\"color-1\",\n\t\"color-2\",\n\t\"color-3\",\n\t\"color-4\",\n\t\"color-5\",\n\t\"color-6\"\n];\n/**\n* The palette the engine shell marks with: each run of text carries the tone\n* it means, and the engine chooses the bytes. The lane series maps onto the\n* engine's indexed colours in order, which is the same rotation.\n*/\nconst TONE_MIGRATION_GRAPH_PALETTE = {\n\tlane: (lane, text) => tonePainter(TONE_LANES[lane % LANE_COUNT] ?? \"color-1\")(text),\n\trole: (role, text) => tonePainter(role === \"on-path\" ? \"highlight\" : \"muted\")(text),\n\temphasis: tonePainter(\"emphasis\"),\n\tstatus: (status, text) => tonePainter(status === \"applied\" ? \"ok\" : \"warn\")(text)\n};\n/** The palette a plain, uncoloured render uses: none of it. */\nconst PLAIN_MIGRATION_GRAPH_PALETTE = {\n\tlane: (_lane, text) => text,\n\trole: (_role, text) => text,\n\temphasis: (text) => text,\n\tstatus: (_status, text) => text\n};\nfunction migrationListForwardArrow(glyphMode) {\n\treturn glyphMode === \"ascii\" ? \"->\" : \"→\";\n}\nfunction migrationListEmptySource(glyphMode) {\n\treturn glyphMode === \"ascii\" ? \"-\" : \"∅\";\n}\nfunction abbreviateContractHash(hash) {\n\treturn hash.slice(0, 7);\n}\nfunction padFromHashColumn(text, width) {\n\tconst padding = Math.max(0, width - stringWidth(text));\n\treturn `${\" \".repeat(padding)}${text}`;\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-grid-layout.ts\n/**\n* Grid layout for the line/plane/occlusion migration-graph renderer.\n*\n* Produces a Grid (rows × cells) from a MigrationGraphRowModel. Each node\n* emits: fork connector, self-loop rows, node row, merge connector, and\n* inbound migration rows — in display order (tips first, then roots).\n*/\nfunction buildLaneAssignment(nodes, edges) {\n\tconst fwdEdges = edges.filter((e) => e.kind === \"forward\" && e.from !== e.to);\n\tconst outbound = /* @__PURE__ */ new Map();\n\tconst inbound = /* @__PURE__ */ new Map();\n\tfor (const edge of fwdEdges) {\n\t\tconst ob = outbound.get(edge.from);\n\t\tif (ob) ob.push(edge);\n\t\telse outbound.set(edge.from, [edge]);\n\t\tconst ib = inbound.get(edge.to);\n\t\tif (ib) ib.push(edge);\n\t\telse inbound.set(edge.to, [edge]);\n\t}\n\tfor (const list of outbound.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tfor (const list of inbound.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tconst components = [];\n\tlet current = [];\n\tfor (const n of nodes) if (n === null) {\n\t\tif (current.length > 0) components.push(current);\n\t\tcurrent = [];\n\t} else current.push(n);\n\tif (current.length > 0) components.push(current);\n\tconst allNodes = /* @__PURE__ */ new Set();\n\tfor (const n of nodes) if (n !== null) allNodes.add(n);\n\tconst nodeRank = /* @__PURE__ */ new Map();\n\tfor (const n of allNodes) nodeRank.set(n, 0);\n\tfor (let pass = 0; pass < allNodes.size; pass++) {\n\t\tlet changed = false;\n\t\tfor (const [from, es] of outbound) {\n\t\t\tconst base = nodeRank.get(from) ?? 0;\n\t\t\tfor (const e of es) {\n\t\t\t\tconst next = base + 1;\n\t\t\t\tif (next > (nodeRank.get(e.to) ?? 0)) {\n\t\t\t\t\tnodeRank.set(e.to, next);\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!changed) break;\n\t}\n\tconst nodeLane = /* @__PURE__ */ new Map();\n\tconst edgeLane = /* @__PURE__ */ new Map();\n\tlet totalLanes = 0;\n\tfor (const componentNodes of components) {\n\t\tconst componentSet = new Set(componentNodes);\n\t\tlet nextLane = 0;\n\t\tconst roots = [];\n\t\tfor (const n of componentNodes) if ((inbound.get(n) ?? []).length === 0) roots.push(n);\n\t\troots.sort((a, b) => {\n\t\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\t\treturn a.localeCompare(b);\n\t\t});\n\t\tconst bfsQueue = [];\n\t\tfor (const root of roots) if (!nodeLane.has(root)) {\n\t\t\tnodeLane.set(root, nextLane++);\n\t\t\tbfsQueue.push({\n\t\t\t\tnode: root,\n\t\t\t\tlane: nodeLane.get(root)\n\t\t\t});\n\t\t}\n\t\tlet head = 0;\n\t\twhile (head < bfsQueue.length) {\n\t\t\tconst { node, lane } = bfsQueue[head++];\n\t\t\tconst children = outbound.get(node) ?? [];\n\t\t\tlet first = true;\n\t\t\tfor (const childEdge of children) {\n\t\t\t\tconst child = childEdge.to;\n\t\t\t\tif (!componentSet.has(child)) continue;\n\t\t\t\tif (!nodeLane.has(child)) {\n\t\t\t\t\tconst childLane = first ? lane : nextLane++;\n\t\t\t\t\tnodeLane.set(child, childLane);\n\t\t\t\t\tbfsQueue.push({\n\t\t\t\t\t\tnode: child,\n\t\t\t\t\t\tlane: childLane\n\t\t\t\t\t});\n\t\t\t\t\tedgeLane.set(childEdge.migrationHash, childLane);\n\t\t\t\t} else edgeLane.set(childEdge.migrationHash, Math.max(lane, nodeLane.get(child)));\n\t\t\t\tfirst = false;\n\t\t\t}\n\t\t}\n\t\tfor (const n of componentNodes) if (!nodeLane.has(n)) nodeLane.set(n, nextLane++);\n\t\tfor (const n of componentNodes) {\n\t\t\tconst parents = inbound.get(n);\n\t\t\tif (!parents || parents.length <= 1) continue;\n\t\t\tlet trunkParent = parents[0].from;\n\t\t\tlet trunkRank = nodeRank.get(trunkParent) ?? 0;\n\t\t\tlet trunkLane = nodeLane.get(trunkParent) ?? 0;\n\t\t\tfor (let i = 1; i < parents.length; i++) {\n\t\t\t\tconst parent = parents[i].from;\n\t\t\t\tconst rank = nodeRank.get(parent) ?? 0;\n\t\t\t\tconst lane = nodeLane.get(parent) ?? 0;\n\t\t\t\tif (rank > trunkRank || rank === trunkRank && lane < trunkLane) {\n\t\t\t\t\ttrunkParent = parent;\n\t\t\t\t\ttrunkRank = rank;\n\t\t\t\t\ttrunkLane = lane;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst trunkParentLane = nodeLane.get(trunkParent) ?? 0;\n\t\t\tconst currentNodeLane = nodeLane.get(n) ?? 0;\n\t\t\tif (currentNodeLane === trunkParentLane) continue;\n\t\t\tnodeLane.set(n, trunkParentLane);\n\t\t\tfor (const parentEdge of parents) if (parentEdge.from === trunkParent) edgeLane.set(parentEdge.migrationHash, trunkParentLane);\n\t\t\tconst bfsDescendants = [n];\n\t\t\tlet descHead = 0;\n\t\t\twhile (descHead < bfsDescendants.length) {\n\t\t\t\tconst current = bfsDescendants[descHead++];\n\t\t\t\tconst children = outbound.get(current) ?? [];\n\t\t\t\tfor (const childEdge of children) {\n\t\t\t\t\tconst child = childEdge.to;\n\t\t\t\t\tif (!componentSet.has(child)) continue;\n\t\t\t\t\tif ((nodeLane.get(child) ?? 0) !== currentNodeLane) continue;\n\t\t\t\t\tnodeLane.set(child, trunkParentLane);\n\t\t\t\t\tconst existingEdgeLane = edgeLane.get(childEdge.migrationHash);\n\t\t\t\t\tif (existingEdgeLane !== void 0 && existingEdgeLane === currentNodeLane) edgeLane.set(childEdge.migrationHash, trunkParentLane);\n\t\t\t\t\tbfsDescendants.push(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (nextLane > totalLanes) totalLanes = nextLane;\n\t}\n\treturn {\n\t\tnodeLane,\n\t\tnodeRank,\n\t\tedgeLane,\n\t\tnumLanes: totalLanes\n\t};\n}\nfunction computeDisplayOrder(nodes, nodeLane, nodeRank) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst result = [];\n\tlet componentBuffer = [];\n\tfunction flushComponent() {\n\t\tcomponentBuffer.sort((a, b) => b.rank - a.rank || a.lane - b.lane);\n\t\tfor (const d of componentBuffer) result.push(d);\n\t\tcomponentBuffer = [];\n\t}\n\tfor (const n of nodes) {\n\t\tif (n === null) {\n\t\t\tflushComponent();\n\t\t\tresult.push(null);\n\t\t\tcontinue;\n\t\t}\n\t\tif (seen.has(n)) continue;\n\t\tseen.add(n);\n\t\tcomponentBuffer.push({\n\t\t\thash: n,\n\t\t\tlane: nodeLane.get(n) ?? 0,\n\t\t\trank: nodeRank.get(n) ?? 0\n\t\t});\n\t}\n\tflushComponent();\n\treturn result;\n}\n/** Create an empty cell. */\nfunction emptyCell() {\n\treturn { lines: [] };\n}\nfunction buildGrid(rowModel, opts = {}, highlight = {\n\tmode: \"flat\",\n\tonPath: /* @__PURE__ */ new Set()\n}) {\n\tconst colsPerLane = opts.colsPerLane ?? 2;\n\tconst isFocus = highlight.mode === \"focus\";\n\tconst { nodeLane, nodeRank, edgeLane, numLanes } = buildLaneAssignment(rowModel.nodes, rowModel.edges);\n\tconst displayOrder = computeDisplayOrder(rowModel.nodes, nodeLane, nodeRank);\n\tconst displayIndex = /* @__PURE__ */ new Map();\n\tlet nodeIdx = 0;\n\tfor (const d of displayOrder) if (d !== null) displayIndex.set(d.hash, nodeIdx++);\n\tconst rollbackEdges = rowModel.edges.filter((e) => e.kind === \"rollback\" && e.from !== e.to);\n\tconst adjacentRollbacks = [];\n\tconst skippingRollbacks = [];\n\tfor (const e of rollbackEdges) {\n\t\tconst si = displayIndex.get(e.from);\n\t\tconst ti = displayIndex.get(e.to);\n\t\tif (si === void 0 || ti === void 0) continue;\n\t\tif (ti === si + 1) adjacentRollbacks.push(e);\n\t\telse skippingRollbacks.push(e);\n\t}\n\tconst targetGroups = /* @__PURE__ */ new Map();\n\tfor (const e of skippingRollbacks) {\n\t\tconst group = targetGroups.get(e.to);\n\t\tif (group) group.push(e);\n\t\telse targetGroups.set(e.to, [e]);\n\t}\n\tconst sortedTargetKeys = [...targetGroups.keys()].sort((a, b) => {\n\t\tconst ta = displayIndex.get(a) ?? 0;\n\t\treturn (displayIndex.get(b) ?? 0) - ta;\n\t});\n\tconst numTargetGroups = sortedTargetKeys.length;\n\tconst geomLaneOf = /* @__PURE__ */ new Map();\n\tconst outermostGroup = numLanes + numTargetGroups - 1;\n\tsortedTargetKeys.forEach((targetHash, i) => {\n\t\tconst groupGeomLane = outermostGroup - i;\n\t\tfor (const e of targetGroups.get(targetHash)) geomLaneOf.set(e.migrationHash, groupGeomLane);\n\t});\n\tconst totalDisplayNodes = displayOrder.filter((d) => d !== null).length;\n\tconst planeLaneOf = /* @__PURE__ */ new Map();\n\tfor (const e of skippingRollbacks) {\n\t\tconst si = displayIndex.get(e.from) ?? 0;\n\t\tplaneLaneOf.set(e.migrationHash, totalDisplayNodes - si);\n\t}\n\tconst PALETTE_SIZE = 6;\n\tconst GREEN_PALETTE_IDX = 5;\n\tconst arcSourceIndex = /* @__PURE__ */ new Map();\n\tconst arcTargetIndex = /* @__PURE__ */ new Map();\n\tfor (const e of skippingRollbacks) {\n\t\tarcSourceIndex.set(e.migrationHash, displayIndex.get(e.from) ?? 0);\n\t\tarcTargetIndex.set(e.migrationHash, displayIndex.get(e.to) ?? 0);\n\t}\n\tconst arcsByTarget = /* @__PURE__ */ new Map();\n\tconst arcsBySource = /* @__PURE__ */ new Map();\n\tfor (const e of skippingRollbacks) {\n\t\tconst tb = arcsByTarget.get(e.to);\n\t\tif (tb) tb.push(e);\n\t\telse arcsByTarget.set(e.to, [e]);\n\t\tconst sb = arcsBySource.get(e.from);\n\t\tif (sb) sb.push(e);\n\t\telse arcsBySource.set(e.from, [e]);\n\t}\n\tconst colourLaneOf = /* @__PURE__ */ new Map();\n\tconst activeArcColours = /* @__PURE__ */ new Map();\n\tconst activeFwdLaneColours = /* @__PURE__ */ new Set();\n\tfor (let i = displayOrder.length - 1; i >= 0; i--) {\n\t\tconst nd = displayOrder[i];\n\t\tif (nd === null || nd === void 0) continue;\n\t\tconst { hash: nodeHash } = nd;\n\t\tconst nodeFwdLane = nodeLane.get(nodeHash) ?? 0;\n\t\tactiveFwdLaneColours.add(nodeFwdLane % PALETTE_SIZE);\n\t\tconst sortedIncoming = [...arcsByTarget.get(nodeHash) ?? []].sort((a, b) => a.dirName.localeCompare(b.dirName));\n\t\tfor (const arc of sortedIncoming) {\n\t\t\tconst originLaneColour = (nodeLane.get(arc.from) ?? 0) % PALETTE_SIZE;\n\t\t\tconst occupied = new Set(activeFwdLaneColours);\n\t\t\tfor (const c of activeArcColours.values()) occupied.add(c);\n\t\t\toccupied.add(GREEN_PALETTE_IDX);\n\t\t\toccupied.add(originLaneColour);\n\t\t\tlet chosen = -1;\n\t\t\tfor (let ci = 0; ci < PALETTE_SIZE; ci++) if (!occupied.has(ci)) {\n\t\t\t\tchosen = ci;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (chosen === -1) {\n\t\t\t\tfor (let ci = 0; ci < PALETTE_SIZE; ci++) if (ci !== GREEN_PALETTE_IDX) {\n\t\t\t\t\tchosen = ci;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcolourLaneOf.set(arc.migrationHash, chosen === -1 ? 0 : chosen);\n\t\t\tactiveArcColours.set(arc.migrationHash, chosen === -1 ? 0 : chosen);\n\t\t}\n\t\tfor (const arc of arcsBySource.get(nodeHash) ?? []) activeArcColours.delete(arc.migrationHash);\n\t}\n\tconst routedBackArcs = skippingRollbacks.map((e) => ({\n\t\tedge: e,\n\t\tsourceIndex: displayIndex.get(e.from) ?? 0,\n\t\ttargetIndex: displayIndex.get(e.to) ?? 0,\n\t\tgeomLane: geomLaneOf.get(e.migrationHash) ?? numLanes,\n\t\tcolourLane: colourLaneOf.get(e.migrationHash) ?? 0,\n\t\tplaneLane: planeLaneOf.get(e.migrationHash) ?? numLanes\n\t}));\n\tconst backArcsBySource = /* @__PURE__ */ new Map();\n\tconst backArcsByTarget = /* @__PURE__ */ new Map();\n\tfor (const arc of routedBackArcs) {\n\t\tconst sb = backArcsBySource.get(arc.edge.from);\n\t\tif (sb) sb.push(arc);\n\t\telse backArcsBySource.set(arc.edge.from, [arc]);\n\t\tconst tb = backArcsByTarget.get(arc.edge.to);\n\t\tif (tb) tb.push(arc);\n\t\telse backArcsByTarget.set(arc.edge.to, [arc]);\n\t}\n\tconst adjacentBySource = /* @__PURE__ */ new Map();\n\tconst adjacentByTarget = /* @__PURE__ */ new Map();\n\tfor (const e of adjacentRollbacks) {\n\t\tconst b = adjacentBySource.get(e.from);\n\t\tif (b) b.push(e);\n\t\telse adjacentBySource.set(e.from, [e]);\n\t\tconst t = adjacentByTarget.get(e.to);\n\t\tif (t) t.push(e);\n\t\telse adjacentByTarget.set(e.to, [e]);\n\t}\n\tfor (const list of adjacentBySource.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tconst totalCols = (numLanes + numTargetGroups) * colsPerLane;\n\tconst fwdEdges = rowModel.edges.filter((e) => e.kind === \"forward\" && e.from !== e.to);\n\tconst selfEdges = rowModel.edges.filter((e) => e.kind === \"self\");\n\tconst outboundFwd = /* @__PURE__ */ new Map();\n\tconst inboundFwd = /* @__PURE__ */ new Map();\n\tfor (const e of fwdEdges) {\n\t\tconst ob = outboundFwd.get(e.from);\n\t\tif (ob) ob.push(e);\n\t\telse outboundFwd.set(e.from, [e]);\n\t\tconst ib = inboundFwd.get(e.to);\n\t\tif (ib) ib.push(e);\n\t\telse inboundFwd.set(e.to, [e]);\n\t}\n\tfor (const list of outboundFwd.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tfor (const list of inboundFwd.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tconst selfEdgesByNode = /* @__PURE__ */ new Map();\n\tfor (const e of selfEdges) {\n\t\tconst bucket = selfEdgesByNode.get(e.from);\n\t\tif (bucket) bucket.push(e);\n\t\telse selfEdgesByNode.set(e.from, [e]);\n\t}\n\tfor (const list of selfEdgesByNode.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tfunction roleOf(migrationHash) {\n\t\tif (!isFocus) return void 0;\n\t\treturn highlight.onPath.has(migrationHash) ? \"on-path\" : \"off-path\";\n\t}\n\tconst onPathNodes = /* @__PURE__ */ new Set();\n\tif (isFocus) {\n\t\tfor (const e of [\n\t\t\t...fwdEdges,\n\t\t\t...selfEdges,\n\t\t\t...rollbackEdges\n\t\t]) if (highlight.onPath.has(e.migrationHash)) {\n\t\t\tonPathNodes.add(e.from);\n\t\t\tonPathNodes.add(e.to);\n\t\t}\n\t}\n\tfunction nodeRoleOf(hash) {\n\t\tif (!isFocus) return void 0;\n\t\treturn onPathNodes.has(hash) ? \"on-path\" : \"off-path\";\n\t}\n\tfunction planeOf(lane, role) {\n\t\tif (!isFocus) return lane;\n\t\treturn role === \"on-path\" ? 0 : lane + 1;\n\t}\n\tfunction lineRefFor(edge, lane) {\n\t\treturn {\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tdirName: edge.dirName,\n\t\t\tlane,\n\t\t\trole: roleOf(edge.migrationHash)\n\t\t};\n\t}\n\t/** Synthetic LineRef for a lane carrying a representative edge's role (pass-through). */\n\tfunction passLineRef(lane, dirName, migHash) {\n\t\treturn {\n\t\t\tmigrationHash: migHash,\n\t\t\tdirName,\n\t\t\tlane,\n\t\t\trole: roleOf(migHash)\n\t\t};\n\t}\n\tfunction vertCell(line) {\n\t\treturn { lines: [{\n\t\t\tline,\n\t\t\tdirections: /* @__PURE__ */ new Set([\"up\", \"down\"]),\n\t\t\tplane: planeOf(line.lane, line.role)\n\t\t}] };\n\t}\n\tfunction dirCell(line, dirs) {\n\t\treturn { lines: [{\n\t\t\tline,\n\t\t\tdirections: dirs,\n\t\t\tplane: planeOf(line.lane, line.role)\n\t\t}] };\n\t}\n\tfunction nodeCell(nodeRef) {\n\t\treturn {\n\t\t\tnode: nodeRef,\n\t\t\tlines: []\n\t\t};\n\t}\n\tconst laneCurrentEdge = /* @__PURE__ */ new Map();\n\tfunction getRepLine(lane) {\n\t\tconst e = laneCurrentEdge.get(lane);\n\t\tif (e) return lineRefFor(e, lane);\n\t\treturn passLineRef(lane, `lane${lane}`, `lane${lane}`);\n\t}\n\tconst activeLanes = /* @__PURE__ */ new Set();\n\tconst grid = [];\n\tfunction makeRow() {\n\t\treturn Array.from({ length: totalCols }, () => emptyCell());\n\t}\n\tfunction placeVerticals(row, skip) {\n\t\tfor (const lane of activeLanes) {\n\t\t\tif (skip.has(lane)) continue;\n\t\t\tconst railCol = lane * colsPerLane;\n\t\t\tconst cell = row[railCol];\n\t\t\tif (cell !== void 0 && cell.lines.length === 0 && !cell.node) row[railCol] = vertCell(getRepLine(lane));\n\t\t}\n\t}\n\tconst activeBackArcs = /* @__PURE__ */ new Set();\n\tfunction backArcLine(arc) {\n\t\treturn {\n\t\t\tmigrationHash: arc.edge.migrationHash,\n\t\t\tdirName: arc.edge.dirName,\n\t\t\tlane: arc.colourLane,\n\t\t\trole: roleOf(arc.edge.migrationHash)\n\t\t};\n\t}\n\tfunction backArcPlane(arc) {\n\t\tconst role = roleOf(arc.edge.migrationHash);\n\t\tif (!isFocus) return arc.planeLane;\n\t\treturn role === \"on-path\" ? 0 : arc.planeLane + 1;\n\t}\n\tfunction composeLine(row, col, line, dirs, plane, extra) {\n\t\tconst existing = row[col];\n\t\tconst cellLine = {\n\t\t\tline,\n\t\t\tdirections: dirs,\n\t\t\tplane,\n\t\t\t...extra?.landingArrow ? { landingArrow: true } : {}\n\t\t};\n\t\tif (existing && (existing.lines.length > 0 || existing.node)) row[col] = {\n\t\t\t...existing,\n\t\t\tlines: [...existing.lines, cellLine]\n\t\t};\n\t\telse row[col] = { lines: [cellLine] };\n\t}\n\tfunction placeBackVerticals(row) {\n\t\tfor (const arc of activeBackArcs) composeLine(row, arc.geomLane * colsPerLane, backArcLine(arc), /* @__PURE__ */ new Set([\"up\", \"down\"]), backArcPlane(arc));\n\t\tplaceAdjacentOverlays(row);\n\t}\n\tconst activeAdjacent = /* @__PURE__ */ new Set();\n\tfunction placeAdjacentOverlays(row) {\n\t\tfor (const adj of activeAdjacent) {\n\t\t\tconst railCol = adj.lane * colsPerLane;\n\t\t\tif (row[railCol]?.node) continue;\n\t\t\tconst line = lineRefFor(adj.edge, adj.lane);\n\t\t\tcomposeLine(row, railCol, line, /* @__PURE__ */ new Set([\"up\", \"down\"]), planeOf(adj.lane, line.role));\n\t\t}\n\t}\n\tfunction emitBackArcTee(row, nodeLaneNum, arc) {\n\t\tconst nodeRail = nodeLaneNum * colsPerLane;\n\t\tconst geomRail = arc.geomLane * colsPerLane;\n\t\tconst line = backArcLine(arc);\n\t\tconst plane = backArcPlane(arc);\n\t\tfor (let col = nodeRail + 1; col < geomRail; col++) composeLine(row, col, line, /* @__PURE__ */ new Set([\"left\", \"right\"]), plane);\n\t\tcomposeLine(row, geomRail, line, /* @__PURE__ */ new Set([\"down\", \"left\"]), plane);\n\t}\n\tfunction emitBackArcLanding(row, nodeLaneNum, arc) {\n\t\tconst nodeRail = nodeLaneNum * colsPerLane;\n\t\tconst geomRail = arc.geomLane * colsPerLane;\n\t\tconst line = backArcLine(arc);\n\t\tconst plane = backArcPlane(arc);\n\t\tcomposeLine(row, nodeRail + 1, line, /* @__PURE__ */ new Set([\"left\", \"right\"]), plane, { landingArrow: true });\n\t\tfor (let col = nodeRail + 2; col < geomRail; col++) composeLine(row, col, line, /* @__PURE__ */ new Set([\"left\", \"right\"]), plane);\n\t\tcomposeLine(row, geomRail, line, /* @__PURE__ */ new Set([\"up\", \"left\"]), plane);\n\t}\n\tfunction emitConnectorRow(trunkLane, branchEntries, connectorType, trunkEdge) {\n\t\tconst row = makeRow();\n\t\tconst sorted = [...branchEntries].sort((a, b) => a.lane - b.lane);\n\t\tif (sorted.length === 0) return row;\n\t\tconst branchByLane = /* @__PURE__ */ new Map();\n\t\tfor (const b of sorted) branchByLane.set(b.lane, b.edge);\n\t\tlet continuousLane = trunkLane;\n\t\tif (isFocus) if (trunkEdge && highlight.onPath.has(trunkEdge.migrationHash)) continuousLane = trunkLane;\n\t\telse {\n\t\t\tconst onPathBranch = sorted.find((b) => highlight.onPath.has(b.edge.migrationHash));\n\t\t\tif (onPathBranch) continuousLane = onPathBranch.lane;\n\t\t}\n\t\tconst trunkRailCol = trunkLane * colsPerLane;\n\t\tconst continuousRailCol = continuousLane * colsPerLane;\n\t\tfunction addLine(col, line, dirs) {\n\t\t\tconst existing = row[col];\n\t\t\tconst cellLine = {\n\t\t\t\tline,\n\t\t\t\tdirections: dirs,\n\t\t\t\tplane: planeOf(line.lane, line.role)\n\t\t\t};\n\t\t\trow[col] = existing && existing.lines.length > 0 ? {\n\t\t\t\t...existing,\n\t\t\t\tlines: [...existing.lines, cellLine]\n\t\t\t} : { lines: [cellLine] };\n\t\t}\n\t\tconst cornerLeftDown = connectorType === \"merge\" ? /* @__PURE__ */ new Set([\"left\", \"down\"]) : /* @__PURE__ */ new Set([\"left\", \"up\"]);\n\t\tfor (let i = 0; i < sorted.length; i++) {\n\t\t\tconst b = sorted[i];\n\t\t\tif (b.lane === continuousLane) continue;\n\t\t\tconst branchLine = lineRefFor(b.edge, b.lane);\n\t\t\tconst railCol = b.lane * colsPerLane;\n\t\t\taddLine(railCol, branchLine, cornerLeftDown);\n\t\t\tconst leftBound = i === 0 ? trunkRailCol + 1 : sorted[i - 1].lane * colsPerLane + 1;\n\t\t\tfor (let col = leftBound; col < railCol; col++) addLine(col, branchLine, /* @__PURE__ */ new Set([\"left\", \"right\"]));\n\t\t}\n\t\tconst continuousLine = continuousLane === trunkLane ? trunkEdge ? lineRefFor(trunkEdge, trunkLane) : getRepLine(trunkLane) : lineRefFor(branchByLane.get(continuousLane), continuousLane);\n\t\tif (continuousLane === trunkLane) addLine(trunkRailCol, continuousLine, /* @__PURE__ */ new Set([\"up\", \"down\"]));\n\t\telse {\n\t\t\taddLine(trunkRailCol, continuousLine, connectorType === \"merge\" ? /* @__PURE__ */ new Set([\"up\", \"right\"]) : /* @__PURE__ */ new Set([\"down\", \"right\"]));\n\t\t\tfor (let col = trunkRailCol + 1; col < continuousRailCol; col++) addLine(col, continuousLine, /* @__PURE__ */ new Set([\"left\", \"right\"]));\n\t\t\taddLine(continuousRailCol, continuousLine, cornerLeftDown);\n\t\t}\n\t\tplaceVerticals(row, /* @__PURE__ */ new Set([trunkLane, ...sorted.map((b) => b.lane)]));\n\t\tplaceBackVerticals(row);\n\t\treturn row;\n\t}\n\tfor (const nodeDisplay of displayOrder) {\n\t\tif (nodeDisplay === null) {\n\t\t\tconst sepRow = makeRow();\n\t\t\tsepRow[0] = {\n\t\t\t\tlines: [],\n\t\t\t\tseparator: true\n\t\t\t};\n\t\t\tgrid.push(sepRow);\n\t\t\tcontinue;\n\t\t}\n\t\tconst { hash: nodeHash } = nodeDisplay;\n\t\tconst nodeLaneNum = nodeLane.get(nodeHash) ?? 0;\n\t\tactiveLanes.add(nodeLaneNum);\n\t\tconst outEdges = outboundFwd.get(nodeHash) ?? [];\n\t\tif (outEdges.length > 1) {\n\t\t\tconst trunkEdgeForFork = outEdges[0];\n\t\t\tconst trunkChildLane = edgeLane.get(trunkEdgeForFork.migrationHash) ?? nodeLane.get(trunkEdgeForFork.to) ?? nodeLaneNum;\n\t\t\tconst branchEntries = outEdges.slice(1).map((e) => ({\n\t\t\t\tlane: edgeLane.get(e.migrationHash) ?? nodeLane.get(e.to) ?? 0,\n\t\t\t\tedge: e\n\t\t\t})).filter((b) => b.lane !== trunkChildLane && activeLanes.has(b.lane));\n\t\t\tif (branchEntries.length > 0) {\n\t\t\t\tconst trunkEdge = outEdges[0];\n\t\t\t\tconst connRow = emitConnectorRow(nodeLaneNum, branchEntries, \"fork\", trunkEdge);\n\t\t\t\tgrid.push(connRow);\n\t\t\t\tassertSingleOwner(connRow, isFocus);\n\t\t\t\tfor (const b of branchEntries) activeLanes.delete(b.lane);\n\t\t\t}\n\t\t}\n\t\tconst selfMigrations = selfEdgesByNode.get(nodeHash) ?? [];\n\t\tfor (const selfEdge of selfMigrations) {\n\t\t\tconst row = makeRow();\n\t\t\tconst railCol = nodeLaneNum * colsPerLane;\n\t\t\tconst connCol = nodeLaneNum * colsPerLane + 1;\n\t\t\tconst line = lineRefFor(selfEdge, nodeLaneNum);\n\t\t\trow[railCol] = vertCell(line);\n\t\t\trow[connCol] = { lines: [{\n\t\t\t\tline,\n\t\t\t\tdirections: /* @__PURE__ */ new Set(),\n\t\t\t\tplane: planeOf(nodeLaneNum, line.role),\n\t\t\t\tselfLoop: true\n\t\t\t}] };\n\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set([nodeLaneNum]));\n\t\t\tplaceBackVerticals(row);\n\t\t\tgrid.push(row);\n\t\t}\n\t\t{\n\t\t\tconst row = makeRow();\n\t\t\tconst railCol = nodeLaneNum * colsPerLane;\n\t\t\trow[railCol] = nodeCell({\n\t\t\t\tcontractHash: nodeHash,\n\t\t\t\tisEmpty: nodeHash === EMPTY_CONTRACT_HASH,\n\t\t\t\tlane: nodeLaneNum,\n\t\t\t\trole: nodeRoleOf(nodeHash)\n\t\t\t});\n\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set([nodeLaneNum]));\n\t\t\tconst landingArcs = backArcsByTarget.get(nodeHash) ?? [];\n\t\t\tfor (const arc of landingArcs) activeBackArcs.delete(arc);\n\t\t\tfor (const adj of [...activeAdjacent]) if (adj.edge.to === nodeHash) activeAdjacent.delete(adj);\n\t\t\tplaceBackVerticals(row);\n\t\t\tfor (const arc of landingArcs) emitBackArcLanding(row, nodeLaneNum, arc);\n\t\t\tconst teeArcs = backArcsBySource.get(nodeHash) ?? [];\n\t\t\tfor (const arc of teeArcs) emitBackArcTee(row, nodeLaneNum, arc);\n\t\t\tgrid.push(row);\n\t\t\tfor (const arc of teeArcs) activeBackArcs.add(arc);\n\t\t\tfor (const adj of adjacentBySource.get(nodeHash) ?? []) activeAdjacent.add({\n\t\t\t\tlane: nodeLaneNum,\n\t\t\t\tedge: adj\n\t\t\t});\n\t\t}\n\t\tfunction edgeLaneFor(edge) {\n\t\t\tconst override = edgeLane.get(edge.migrationHash);\n\t\t\tif (override !== void 0) return override;\n\t\t\treturn Math.max(nodeLane.get(edge.from) ?? 0, nodeLane.get(edge.to) ?? 0);\n\t\t}\n\t\tconst inEdges = inboundFwd.get(nodeHash) ?? [];\n\t\tinEdges.sort((a, b) => {\n\t\t\tconst aLane = edgeLaneFor(a);\n\t\t\tconst bLane = edgeLaneFor(b);\n\t\t\tif (aLane !== bLane) return aLane - bLane;\n\t\t\treturn a.dirName.localeCompare(b.dirName);\n\t\t});\n\t\tfor (const edge of inEdges) laneCurrentEdge.set(edgeLaneFor(edge), edge);\n\t\t{\n\t\t\tconst teeArcs = backArcsBySource.get(nodeHash) ?? [];\n\t\t\tfor (const arc of teeArcs) {\n\t\t\t\tconst row = makeRow();\n\t\t\t\tconst railCol = arc.geomLane * colsPerLane;\n\t\t\t\tconst connCol = railCol + 1;\n\t\t\t\tconst line = backArcLine(arc);\n\t\t\t\tconst plane = backArcPlane(arc);\n\t\t\t\tcomposeLine(row, railCol, line, /* @__PURE__ */ new Set([\"up\", \"down\"]), plane);\n\t\t\t\tcomposeLine(row, connCol, line, /* @__PURE__ */ new Set([\"down\"]), plane);\n\t\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set());\n\t\t\t\tplaceBackVerticals(row);\n\t\t\t\tgrid.push(row);\n\t\t\t}\n\t\t}\n\t\tif (inEdges.length > 1) {\n\t\t\tconst branchEntries = inEdges.slice(1).map((e) => ({\n\t\t\t\tlane: edgeLaneFor(e),\n\t\t\t\tedge: e\n\t\t\t}));\n\t\t\tconst trunkEdge = inEdges[0];\n\t\t\tconst connRow = emitConnectorRow(nodeLaneNum, branchEntries, \"merge\", trunkEdge);\n\t\t\tgrid.push(connRow);\n\t\t\tassertSingleOwner(connRow, isFocus);\n\t\t\tfor (const b of branchEntries) activeLanes.add(b.lane);\n\t\t}\n\t\tfor (const edge of inEdges) {\n\t\t\tconst eLane = edgeLaneFor(edge);\n\t\t\tconst row = makeRow();\n\t\t\tconst railCol = eLane * colsPerLane;\n\t\t\tconst connCol = eLane * colsPerLane + 1;\n\t\t\tconst line = lineRefFor(edge, eLane);\n\t\t\trow[railCol] = vertCell(line);\n\t\t\trow[connCol] = dirCell(line, /* @__PURE__ */ new Set([\"up\"]));\n\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set([eLane]));\n\t\t\tplaceBackVerticals(row);\n\t\t\tgrid.push(row);\n\t\t}\n\t\t{\n\t\t\tconst adjacents = adjacentBySource.get(nodeHash) ?? [];\n\t\t\tfor (const adj of adjacents) {\n\t\t\t\tconst row = makeRow();\n\t\t\t\tconst connCol = nodeLaneNum * colsPerLane + 1;\n\t\t\t\tconst line = lineRefFor(adj, nodeLaneNum);\n\t\t\t\tconst plane = planeOf(nodeLaneNum, line.role);\n\t\t\t\tcomposeLine(row, connCol, line, /* @__PURE__ */ new Set([\"down\"]), plane);\n\t\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set());\n\t\t\t\tplaceBackVerticals(row);\n\t\t\t\tgrid.push(row);\n\t\t\t}\n\t\t}\n\t\tif (inEdges.length === 0) activeLanes.delete(nodeLaneNum);\n\t}\n\treturn grid;\n}\nfunction assertSingleOwner(row, isFocus) {\n\tfor (const cell of row) {\n\t\tif (cell.lines.length <= 1) continue;\n\t\tlet topPlane = Number.POSITIVE_INFINITY;\n\t\tfor (const cl of cell.lines) if (cl.plane < topPlane) topPlane = cl.plane;\n\t\tconst top = cell.lines.filter((cl) => cl.plane === topPlane);\n\t\tif (top.length > 1) {\n\t\t\tif (isFocus) {\n\t\t\t\tif (new Set(top.map((cl) => cl.line.role)).size > 1) throw new InternalError(\"migration-graph layout: single-owner invariant violated — two differently-roled lines share the top plane in one cell\");\n\t\t\t}\n\t\t}\n\t}\n}\n//#endregion\n//#region src/utils/formatters/migration-list-graph-topology.ts\nfunction compareDirNameDesc(a, b) {\n\treturn b.dirName.localeCompare(a.dirName);\n}\nfunction bumpDegree(map, key) {\n\tmap.set(key, (map.get(key) ?? 0) + 1);\n}\nfunction compareNodesRootFirst(a, b) {\n\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\treturn a.localeCompare(b);\n}\n/**\n* Shortest-path distance of each node from the forward roots, over the given\n* candidate edges. Roots are the in-degree-0 nodes (baseline first, then lex);\n* a rooted component therefore distances every node by how many forward steps\n* it sits from a root. A component with no root (a pure cycle) is seeded from\n* its single lexically-smallest node so the cycle still gets a stable layering.\n*\n* Crucially this is *shortest* path, not longest: a backward (rollback) edge\n* `deep → shallow` never offers a shorter route to the already-shallower\n* target, so it is inert here. Distances are thus stable whether or not the\n* rollbacks are still in the candidate set — which is what lets the peel below\n* tell a genuine back-edge (target strictly shallower than source) apart from a\n* forward edge that merely happens to share the back-edge's cycle.\n*/\nfunction forwardDistances(nodes, candidates) {\n\tconst inDegree = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) inDegree.set(node, 0);\n\tfor (const edge of candidates) bumpDegree(inDegree, edge.to);\n\tconst roots = [...nodes].filter((node) => (inDegree.get(node) ?? 0) === 0);\n\troots.sort(compareNodesRootFirst);\n\tconst seeds = roots.length > 0 ? roots : [...nodes].sort(compareNodesRootFirst).slice(0, 1);\n\tconst dist = /* @__PURE__ */ new Map();\n\tfor (const seed of seeds) dist.set(seed, 0);\n\tconst maxPasses = nodes.size;\n\tfor (let pass = 0; pass < maxPasses; pass++) {\n\t\tlet changed = false;\n\t\tfor (const edge of candidates) {\n\t\t\tconst base = dist.get(edge.from);\n\t\t\tif (base === void 0) continue;\n\t\t\tconst next = base + 1;\n\t\t\tif (next < (dist.get(edge.to) ?? Number.POSITIVE_INFINITY)) {\n\t\t\t\tdist.set(edge.to, next);\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}\n\t\tif (!changed) break;\n\t}\n\tfor (const node of nodes) if (!dist.has(node)) dist.set(node, 0);\n\treturn dist;\n}\nfunction canReachForward(start, goal, candidates) {\n\tif (start === goal) return true;\n\tconst outgoing = /* @__PURE__ */ new Map();\n\tfor (const edge of candidates) {\n\t\tconst bucket = outgoing.get(edge.from);\n\t\tif (bucket) bucket.push(edge.to);\n\t\telse outgoing.set(edge.from, [edge.to]);\n\t}\n\tconst visited = /* @__PURE__ */ new Set([start]);\n\tconst queue = [start];\n\twhile (queue.length > 0) {\n\t\tconst node = queue.shift();\n\t\tif (node === void 0) continue;\n\t\tfor (const next of outgoing.get(node) ?? []) {\n\t\t\tif (next === goal) return true;\n\t\t\tif (!visited.has(next)) {\n\t\t\t\tvisited.add(next);\n\t\t\t\tqueue.push(next);\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n/**\n* Demote node-skipping rollbacks left forward by the DFS. An edge `from → to`\n* is a rollback exactly when both hold:\n* 1. `to` is a forward-ancestor of `from` — `to` can still reach `from` over\n* the other forward edges, so the edge closes a cycle; and\n* 2. `to` is strictly shallower than `from` (smaller forward distance) — the\n* edge points back toward the root rather than advancing history.\n*\n* Condition 2 is the discriminator: in a cycle created by a rollback every edge\n* satisfies condition 1, but only the rollback itself runs deep → shallow. The\n* forward chain edges run shallow → deep and are never peeled, however many\n* rollbacks converge on the same target. Tight back-edges whose source and\n* target sit at the same distance (mutual two-node cycles) are already resolved\n* by the DFS immediate-parent rule, so they never reach this pass. One edge is\n* peeled per iteration (dirName-descending tie-break) and distances/reachability\n* are recomputed, making the outcome independent of edge input order.\n*/\nfunction peelNodeSkippingRollbacks(nodes, kindByMigrationHash, nonSelf) {\n\tlet candidates = nonSelf.filter((edge) => kindByMigrationHash.get(edge.hash) === \"forward\");\n\twhile (candidates.length > 0) {\n\t\tconst dist = forwardDistances(nodes, candidates);\n\t\tconst backEdges = candidates.filter((edge) => {\n\t\t\tif ((dist.get(edge.to) ?? 0) >= (dist.get(edge.from) ?? 0)) return false;\n\t\t\tconst without = candidates.filter((candidate) => candidate !== edge);\n\t\t\treturn canReachForward(edge.to, edge.from, without);\n\t\t});\n\t\tif (backEdges.length === 0) break;\n\t\tbackEdges.sort(compareDirNameDesc);\n\t\tconst rollback = backEdges[0];\n\t\tif (rollback === void 0) break;\n\t\tkindByMigrationHash.set(rollback.hash, \"rollback\");\n\t\tcandidates = candidates.filter((edge) => edge !== rollback);\n\t}\n}\n/**\n* DFS with dirName-descending traversal. A GRAY target is a rollback only when it\n* is the immediate DFS parent of the source — cross-links to other GRAY nodes\n* stay forward. A follow-up peel pass demotes node-skipping rollbacks (target is\n* a forward-ancestor of the source and sits strictly shallower than it).\n*/\nfunction classifyNormalizedEdges(edges) {\n\tconst nodes = /* @__PURE__ */ new Set();\n\tconst kindByMigrationHash = /* @__PURE__ */ new Map();\n\tconst outgoingByFrom = /* @__PURE__ */ new Map();\n\tconst nonSelf = [];\n\tfor (const edge of edges) {\n\t\tnodes.add(edge.from);\n\t\tnodes.add(edge.to);\n\t\tif (edge.from === edge.to) {\n\t\t\tkindByMigrationHash.set(edge.hash, \"self\");\n\t\t\tcontinue;\n\t\t}\n\t\tnonSelf.push(edge);\n\t\tconst bucket = outgoingByFrom.get(edge.from);\n\t\tif (bucket) bucket.push(edge);\n\t\telse outgoingByFrom.set(edge.from, [edge]);\n\t}\n\tfor (const bucket of outgoingByFrom.values()) bucket.sort(compareDirNameDesc);\n\tconst nonSelfInDegree = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) nonSelfInDegree.set(node, 0);\n\tfor (const bucket of outgoingByFrom.values()) for (const edge of bucket) bumpDegree(nonSelfInDegree, edge.to);\n\tconst dfsRoots = [];\n\tfor (const node of nodes) if ((nonSelfInDegree.get(node) ?? 0) === 0) dfsRoots.push(node);\n\tdfsRoots.sort((a, b) => {\n\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\treturn a.localeCompare(b);\n\t});\n\tif (dfsRoots.length === 0) dfsRoots.push(...[...nodes].sort((a, b) => a.localeCompare(b)));\n\tconst WHITE = 0;\n\tconst GRAY = 1;\n\tconst BLACK = 2;\n\tconst color = /* @__PURE__ */ new Map();\n\tconst dfsParent = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) color.set(node, WHITE);\n\tconst stack = [];\n\tfunction isImmediateDfsParent(ancestor, node) {\n\t\treturn dfsParent.get(node) === ancestor;\n\t}\n\tfunction pushFrame(node, parent) {\n\t\tcolor.set(node, GRAY);\n\t\tdfsParent.set(node, parent);\n\t\tstack.push({\n\t\t\tnode,\n\t\t\toutgoing: outgoingByFrom.get(node) ?? [],\n\t\t\tindex: 0\n\t\t});\n\t}\n\tfunction runDfsFrom(root) {\n\t\tif (color.get(root) !== WHITE) return;\n\t\tpushFrame(root, void 0);\n\t\twhile (stack.length > 0) {\n\t\t\tconst frame = stack[stack.length - 1];\n\t\t\tif (frame === void 0) break;\n\t\t\tif (frame.index >= frame.outgoing.length) {\n\t\t\t\tcolor.set(frame.node, BLACK);\n\t\t\t\tstack.pop();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst edge = frame.outgoing[frame.index];\n\t\t\tframe.index += 1;\n\t\t\tif (edge === void 0) continue;\n\t\t\tconst v = edge.to;\n\t\t\tconst vColor = color.get(v);\n\t\t\tif (vColor === GRAY && isImmediateDfsParent(v, frame.node)) kindByMigrationHash.set(edge.hash, \"rollback\");\n\t\t\telse {\n\t\t\t\tkindByMigrationHash.set(edge.hash, \"forward\");\n\t\t\t\tif (vColor === WHITE) pushFrame(v, frame.node);\n\t\t\t}\n\t\t}\n\t}\n\tfor (const root of dfsRoots) runDfsFrom(root);\n\tconst remainingWhite = [...nodes].filter((node) => color.get(node) === WHITE);\n\tremainingWhite.sort((a, b) => a.localeCompare(b));\n\tfor (const root of remainingWhite) runDfsFrom(root);\n\tpeelNodeSkippingRollbacks(nodes, kindByMigrationHash, nonSelf);\n\tconst forwardInDegree = /* @__PURE__ */ new Map();\n\tconst forwardOutDegree = /* @__PURE__ */ new Map();\n\tfor (const edge of edges) {\n\t\tif (kindByMigrationHash.get(edge.hash) !== \"forward\") continue;\n\t\tbumpDegree(forwardOutDegree, edge.from);\n\t\tbumpDegree(forwardInDegree, edge.to);\n\t}\n\treturn {\n\t\tkindByMigrationHash,\n\t\tforwardInDegree,\n\t\tforwardOutDegree\n\t};\n}\n/**\n* Classify forward/rollback/self for a `MigrationGraph` edge set (Tier-3).\n*/\nfunction classifyMigrationGraphTopology(graph) {\n\tconst normalized = [];\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) normalized.push({\n\t\thash: edge.migrationHash,\n\t\tfrom: edge.from,\n\t\tto: edge.to,\n\t\tdirName: edge.dirName\n\t});\n\treturn classifyNormalizedEdges(normalized);\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-rows.ts\n/**\n* Return the weakly-connected components of `graph` as an array of node sets,\n* ordered so the component containing EMPTY_CONTRACT_HASH comes first (if\n* present), with remaining components sorted by their lex-smallest node hash.\n*/\nfunction weaklyConnectedComponents(graph) {\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst adjacency = /* @__PURE__ */ new Map();\n\tfunction addAdjacent(a, b) {\n\t\tconst aList = adjacency.get(a);\n\t\tif (aList) aList.push(b);\n\t\telse adjacency.set(a, [b]);\n\t\tconst bList = adjacency.get(b);\n\t\tif (bList) bList.push(a);\n\t\telse adjacency.set(b, [a]);\n\t}\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) if (edge.from !== edge.to) addAdjacent(edge.from, edge.to);\n\tfor (const node of graph.nodes) if (!adjacency.has(node)) adjacency.set(node, []);\n\tconst components = [];\n\tfunction bfsComponent(start) {\n\t\tconst component = /* @__PURE__ */ new Set();\n\t\tconst queue = [start];\n\t\twhile (queue.length > 0) {\n\t\t\tconst node = queue.shift();\n\t\t\tif (node === void 0 || visited.has(node)) continue;\n\t\t\tvisited.add(node);\n\t\t\tcomponent.add(node);\n\t\t\tfor (const neighbor of adjacency.get(node) ?? []) if (!visited.has(neighbor)) queue.push(neighbor);\n\t\t}\n\t\treturn component;\n\t}\n\tconst allNodes = [...graph.nodes].sort((a, b) => {\n\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\treturn a.localeCompare(b);\n\t});\n\tfor (const node of allNodes) if (!visited.has(node)) components.push(bfsComponent(node));\n\tcomponents.sort((a, b) => {\n\t\tconst aHasEmpty = a.has(EMPTY_CONTRACT_HASH);\n\t\tconst bHasEmpty = b.has(EMPTY_CONTRACT_HASH);\n\t\tif (aHasEmpty && !bHasEmpty) return -1;\n\t\tif (!aHasEmpty && bHasEmpty) return 1;\n\t\tconst aMin = [...a].sort((x, y) => x.localeCompare(y))[0] ?? \"\";\n\t\tconst bMin = [...b].sort((x, y) => x.localeCompare(y))[0] ?? \"\";\n\t\treturn aMin.localeCompare(bMin);\n\t});\n\treturn components;\n}\nfunction forwardRootsInComponent(componentNodes, topology) {\n\tconst roots = [];\n\tfor (const node of componentNodes) if ((topology.forwardInDegree.get(node) ?? 0) === 0) roots.push(node);\n\troots.sort((a, b) => {\n\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\treturn a.localeCompare(b);\n\t});\n\tif (roots.length > 0) return roots;\n\treturn [...componentNodes].sort((a, b) => {\n\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\treturn a.localeCompare(b);\n\t});\n}\nfunction compareNodesTipsFirst(a, b, rank) {\n\tconst rankA = rank.get(a) ?? 0;\n\tconst rankB = rank.get(b) ?? 0;\n\tif (rankA !== rankB) return rankB - rankA;\n\tif (a === EMPTY_CONTRACT_HASH) return 1;\n\tif (b === EMPTY_CONTRACT_HASH) return -1;\n\treturn a.localeCompare(b);\n}\n/**\n* Layer nodes by longest forward-path rank from forward roots within the\n* component. Rank 0 is the root (bottom row); the maximum rank is the tip\n* (top row). Emits rank-descending with lex-ascending tie-break among siblings\n* at the same rank — stable across edge-insertion order and correct under\n* diamonds, cross-links, and rollbacks.\n*/\nfunction maxRank(rank) {\n\tlet max = 0;\n\tfor (const value of rank.values()) if (value > max) max = value;\n\treturn max;\n}\nfunction layerNodesByLongestForwardPath(componentNodes, topology, graph, contractHash) {\n\tconst forwardOut = /* @__PURE__ */ new Map();\n\tfor (const node of componentNodes) forwardOut.set(node, []);\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) {\n\t\tif (!componentNodes.has(edge.from) || !componentNodes.has(edge.to)) continue;\n\t\tif (edge.from === edge.to) continue;\n\t\tif (topology.kindByMigrationHash.get(edge.migrationHash) !== \"forward\") continue;\n\t\tconst bucket = forwardOut.get(edge.from);\n\t\tif (bucket) bucket.push(edge.to);\n\t}\n\tconst roots = forwardRootsInComponent(componentNodes, topology);\n\tconst rank = /* @__PURE__ */ new Map();\n\tfor (const root of roots) rank.set(root, 0);\n\tconst maxPasses = componentNodes.size;\n\tfor (let pass = 0; pass < maxPasses; pass++) {\n\t\tlet changed = false;\n\t\tfor (const node of componentNodes) {\n\t\t\tconst base = rank.get(node);\n\t\t\tif (base === void 0) continue;\n\t\t\tfor (const to of forwardOut.get(node) ?? []) {\n\t\t\t\tconst next = base + 1;\n\t\t\t\tif (next > (rank.get(to) ?? -1)) {\n\t\t\t\t\trank.set(to, next);\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!changed) break;\n\t}\n\tfor (const node of componentNodes) if (!rank.has(node)) rank.set(node, 0);\n\tif (contractHash !== void 0 && contractHash !== EMPTY_CONTRACT_HASH && componentNodes.has(contractHash) && (forwardOut.get(contractHash) ?? []).length === 0) rank.set(contractHash, maxRank(rank) + 1);\n\treturn [...componentNodes].sort((a, b) => compareNodesTipsFirst(a, b, rank));\n}\n/**\n* Build the row model from a tolerant `MigrationGraph`.\n*\n* The row model is the first pure-data stage of the `migration graph` render\n* pipeline. It:\n* - classifies every edge as `forward`, `rollback`, or `self`;\n* - produces a deterministic vertical node ordering (tips at index 0, roots\n* at the end) within each weakly-connected component;\n* - separates disjoint components with `null` sentinels;\n* - optionally prepends a detached current contract as its own single-node\n* component when `contractHash` is not already in the graph.\n*\n* No columns, no lane allocation, no glyphs, no rendering.\n*/\n/**\n* Resolve the detached current contract, if any: a real contract (not the\n* empty baseline) that no migration on disk produces, so it is absent from\n* the graph. Such a contract renders as a floating node rather than\n* decorating an existing one. Returns the hash when detached, else undefined.\n*/\nfunction detachedContractHash(graph, contractHash) {\n\treturn contractHash !== void 0 && contractHash !== EMPTY_CONTRACT_HASH && !graph.nodes.has(contractHash) ? contractHash : void 0;\n}\nfunction isForwardLeaf(node, edges) {\n\treturn !edges.some((e) => e.kind === \"forward\" && e.from === node && e.from !== e.to);\n}\nfunction forwardReachableFrom(start, forwardTo) {\n\tconst reachable = /* @__PURE__ */ new Set([start]);\n\tconst queue = [start];\n\twhile (queue.length > 0) {\n\t\tconst node = queue.shift();\n\t\tif (node === void 0) continue;\n\t\tfor (const next of forwardTo.get(node) ?? []) if (!reachable.has(next)) {\n\t\t\treachable.add(next);\n\t\t\tqueue.push(next);\n\t\t}\n\t}\n\treturn reachable;\n}\nfunction buildForwardToMap(edges) {\n\tconst forwardTo = /* @__PURE__ */ new Map();\n\tfor (const edge of edges) {\n\t\tif (edge.kind !== \"forward\" || edge.from === edge.to) continue;\n\t\tconst bucket = forwardTo.get(edge.from);\n\t\tif (bucket) bucket.push(edge.to);\n\t\telse forwardTo.set(edge.from, [edge.to]);\n\t}\n\treturn forwardTo;\n}\nfunction sortEdgesForContractHashTrunk(edges, contractHash) {\n\tif (contractHash === void 0 || contractHash === EMPTY_CONTRACT_HASH || !isForwardLeaf(contractHash, edges)) return edges;\n\tconst preferredLeaf = contractHash;\n\tconst forwardTo = buildForwardToMap(edges);\n\tconst reachability = /* @__PURE__ */ new Map();\n\tfunction canReachContractHash(from) {\n\t\tlet cached = reachability.get(from);\n\t\tif (cached === void 0) {\n\t\t\tcached = forwardReachableFrom(from, forwardTo);\n\t\t\treachability.set(from, cached);\n\t\t}\n\t\treturn cached.has(preferredLeaf);\n\t}\n\tfunction trunkBias(edge) {\n\t\tif (edge.kind !== \"forward\" || edge.from === edge.to) return 0;\n\t\tif (edge.to === preferredLeaf) return 2;\n\t\tif (canReachContractHash(edge.to)) return 1;\n\t\treturn 0;\n\t}\n\treturn edges.map((edge, index) => ({\n\t\tedge,\n\t\tindex,\n\t\tbias: trunkBias(edge)\n\t})).sort((a, b) => {\n\t\tif (a.edge.from !== b.edge.from) return a.index - b.index;\n\t\tif (a.bias !== b.bias) return b.bias - a.bias;\n\t\treturn a.index - b.index;\n\t}).map(({ edge }) => edge);\n}\nfunction rebuildEdgeLookupMaps(edges) {\n\tconst edgesByFrom = /* @__PURE__ */ new Map();\n\tconst edgesByTo = /* @__PURE__ */ new Map();\n\tfor (const classified of edges) {\n\t\tconst fromBucket = edgesByFrom.get(classified.from);\n\t\tif (fromBucket) fromBucket.push(classified);\n\t\telse edgesByFrom.set(classified.from, [classified]);\n\t\tconst toBucket = edgesByTo.get(classified.to);\n\t\tif (toBucket) toBucket.push(classified);\n\t\telse edgesByTo.set(classified.to, [classified]);\n\t}\n\treturn {\n\t\tedgesByFrom,\n\t\tedgesByTo\n\t};\n}\nfunction buildMigrationGraphRows(graph, options = {}) {\n\tconst emptyModel = {\n\t\tnodes: [],\n\t\tedges: [],\n\t\tedgesByFrom: /* @__PURE__ */ new Map(),\n\t\tedgesByTo: /* @__PURE__ */ new Map()\n\t};\n\tif (graph.nodes.size === 0) {\n\t\tconst detached = detachedContractHash(graph, options.contractHash);\n\t\treturn detached !== void 0 ? {\n\t\t\t...emptyModel,\n\t\t\tnodes: [detached]\n\t\t} : emptyModel;\n\t}\n\tconst topology = classifyMigrationGraphTopology(graph);\n\tconst edges = [];\n\tfor (const edgeList of graph.forwardChain.values()) for (const edge of edgeList) {\n\t\tconst kind = topology.kindByMigrationHash.get(edge.migrationHash) ?? \"forward\";\n\t\tedges.push({\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tfrom: edge.from,\n\t\t\tto: edge.to,\n\t\t\tdirName: edge.dirName,\n\t\t\tkind\n\t\t});\n\t}\n\tconst sortedEdges = sortEdgesForContractHashTrunk(edges, options.contractHash);\n\tconst { edgesByFrom, edgesByTo } = rebuildEdgeLookupMaps(sortedEdges);\n\tconst components = weaklyConnectedComponents(graph);\n\tconst nodes = [];\n\tfor (let i = 0; i < components.length; i++) {\n\t\tif (i > 0) nodes.push(null);\n\t\tconst component = components[i];\n\t\tif (component === void 0) continue;\n\t\tconst ordered = layerNodesByLongestForwardPath(component, topology, graph, options.contractHash);\n\t\tfor (const node of ordered) nodes.push(node);\n\t}\n\tconst detached = detachedContractHash(graph, options.contractHash);\n\tif (detached !== void 0) {\n\t\tif (nodes.length > 0) nodes.unshift(null);\n\t\tnodes.unshift(detached);\n\t}\n\treturn {\n\t\tnodes,\n\t\tedges: sortedEdges,\n\t\tedgesByFrom,\n\t\tedgesByTo\n\t};\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-space-render.ts\nfunction mergeMigrationEdgeAnnotations(listOverlay, statusOverlay) {\n\tconst merged = /* @__PURE__ */ new Map();\n\tfor (const [migrationHash, listAnnotation] of listOverlay) {\n\t\tconst statusAnnotation = statusOverlay.get(migrationHash);\n\t\tmerged.set(migrationHash, {\n\t\t\t...listAnnotation,\n\t\t\t...statusAnnotation?.status !== void 0 ? { status: statusAnnotation.status } : {}\n\t\t});\n\t}\n\treturn merged;\n}\n/**\n* Translate `migrate --show` per-edge path-highlight annotations into a\n* {@link Highlight}. With any `pathHighlight` present the result is focus mode\n* (on-path lifted green, off-path dim); otherwise flat (lane-rotation colour).\n*/\nfunction highlightFromEdgeAnnotations(edgeAnnotationsByHash) {\n\tconst onPath = /* @__PURE__ */ new Set();\n\tlet anyPathHighlight = false;\n\tfor (const [migrationHash, annotation] of edgeAnnotationsByHash) {\n\t\tif (annotation.pathHighlight === void 0) continue;\n\t\tanyPathHighlight = true;\n\t\tif (annotation.pathHighlight === \"on-path\") onPath.add(migrationHash);\n\t}\n\treturn anyPathHighlight ? {\n\t\tmode: \"focus\",\n\t\tonPath\n\t} : {\n\t\tmode: \"flat\",\n\t\tonPath: /* @__PURE__ */ new Set()\n\t};\n}\nfunction buildGridForInput(input) {\n\tconst rowModel = buildMigrationGraphRows(input.graph, { contractHash: input.liveContractHash });\n\treturn {\n\t\tgrid: buildGrid(rowModel, {}, {\n\t\t\tmode: \"flat\",\n\t\t\tonPath: /* @__PURE__ */ new Set()\n\t\t}),\n\t\trowModel\n\t};\n}\n/**\n* The widest gutter→label column across the given space layouts. Cross-space\n* callers pass this back in so every section's labels share one column.\n*/\nfunction computeGlobalMaxEdgeTreePrefixWidth(inputs, glyphMode = \"unicode\") {\n\tlet globalMax = 0;\n\tfor (const input of inputs) {\n\t\tconst { grid } = buildGridForInput(input);\n\t\tglobalMax = Math.max(globalMax, computeLabelColumn(grid, glyphMode));\n\t}\n\treturn globalMax;\n}\nfunction computeGlobalMaxDirNameWidth(inputs) {\n\tlet globalMax = 0;\n\tfor (const input of inputs) {\n\t\tconst { rowModel } = buildGridForInput(input);\n\t\tglobalMax = Math.max(globalMax, computeMaxDirNameWidth(rowModel));\n\t}\n\treturn globalMax;\n}\nfunction renderMigrationGraphSpaceTreeInternal(input) {\n\tconst appSpace = input.isAppSpace !== false;\n\tconst rowModel = buildMigrationGraphRows(input.graph, { ...appSpace ? { contractHash: input.liveContractHash } : {} });\n\tconst listOverlay = buildEdgeAnnotationsByHashFromListEntries(input.migrations);\n\tconst edgeAnnotationsByHash = input.statusOverlayByHash === void 0 ? listOverlay : mergeMigrationEdgeAnnotations(listOverlay, input.statusOverlayByHash);\n\treturn renderMigrationGraphCommand({\n\t\tgrid: buildGrid(rowModel, {}, highlightFromEdgeAnnotations(edgeAnnotationsByHash)),\n\t\trowModel,\n\t\tcolorize: input.colorize,\n\t\tglyphMode: input.glyphMode,\n\t\tcontractHash: input.liveContractHash,\n\t\tisAppSpace: appSpace,\n\t\tedgeAnnotationsByHash,\n\t\trefsByHash: input.refsByHash ?? buildRefsByHashFromListEntries(input.migrations),\n\t\t...input.dbHash !== void 0 ? { dbHash: input.dbHash } : {},\n\t\t...input.styler !== void 0 ? { styler: input.styler } : {},\n\t\t...input.palette !== void 0 ? { palette: input.palette } : {},\n\t\t...input.globalMaxEdgeTreePrefixWidth !== void 0 ? { globalLabelColumn: input.globalMaxEdgeTreePrefixWidth } : {},\n\t\t...input.globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth: input.globalMaxDirNameWidth } : {}\n\t});\n}\nfunction renderMigrationGraphSpaceTree(input) {\n\treturn renderMigrationGraphSpaceTreeInternal(input);\n}\nfunction renderMigrationGraphSpaceTrees(inputs) {\n\tconst globalInputs = inputs.map((input) => ({\n\t\tgraph: input.graph,\n\t\tliveContractHash: input.liveContractHash\n\t}));\n\tconst glyphMode = inputs[0]?.glyphMode ?? \"unicode\";\n\tconst globalLabelColumn = inputs.length > 1 ? computeGlobalMaxEdgeTreePrefixWidth(globalInputs, glyphMode) : void 0;\n\tconst globalMaxDirName = inputs.length > 1 ? computeGlobalMaxDirNameWidth(globalInputs) : void 0;\n\treturn inputs.map((input) => renderMigrationGraphSpaceTreeInternal({\n\t\t...input,\n\t\t...globalLabelColumn !== void 0 ? { globalMaxEdgeTreePrefixWidth: globalLabelColumn } : {},\n\t\t...globalMaxDirName !== void 0 ? { globalMaxDirNameWidth: globalMaxDirName } : {}\n\t}));\n}\nfunction indentMigrationGraphTreeBlock(treeOutput, indent) {\n\tif (treeOutput.length === 0) return treeOutput;\n\treturn treeOutput.split(\"\\n\").map((line) => line.length === 0 ? line : `${indent}${line}`).join(\"\\n\");\n}\n//#endregion\n//#region src/utils/formatters/migration-list-render.ts\nconst IDENTITY_MIGRATION_LIST_STYLER = {\n\tkind: (text) => text,\n\tdirName: (text) => text,\n\tsourceHash: (text) => text,\n\tdestHash: (text) => text,\n\tglyph: (text) => text,\n\tlane: (text) => text,\n\tinvariants: (ids) => `{${ids.join(\", \")}}`,\n\trefs: (names) => `(${names.join(\", \")})`,\n\tspaceHeading: (text) => text,\n\tsummary: (text) => text,\n\temptyState: (text) => text\n};\nfunction canonicalFrom(from) {\n\treturn from ?? EMPTY_CONTRACT_HASH;\n}\nfunction migrationGraphFromListEntries(entries) {\n\tconst nodes = /* @__PURE__ */ new Set();\n\tconst forwardChain = /* @__PURE__ */ new Map();\n\tconst reverseChain = /* @__PURE__ */ new Map();\n\tconst migrationByHash = /* @__PURE__ */ new Map();\n\tfor (const entry of entries) {\n\t\tconst from = canonicalFrom(entry.fromContract);\n\t\tconst edge = {\n\t\t\tfrom,\n\t\t\tto: entry.toContract,\n\t\t\tmigrationHash: entry.hash,\n\t\t\tdirName: entry.name,\n\t\t\tcreatedAt: entry.createdAt,\n\t\t\tinvariants: entry.providedInvariants\n\t\t};\n\t\tnodes.add(from);\n\t\tnodes.add(entry.toContract);\n\t\tconst forward = forwardChain.get(from);\n\t\tif (forward) forward.push(edge);\n\t\telse forwardChain.set(from, [edge]);\n\t\tconst reverse = reverseChain.get(entry.toContract);\n\t\tif (reverse) reverse.push(edge);\n\t\telse reverseChain.set(entry.toContract, [edge]);\n\t\tmigrationByHash.set(entry.hash, edge);\n\t}\n\treturn {\n\t\tnodes,\n\t\tforwardChain,\n\t\treverseChain,\n\t\tmigrationByHash\n\t};\n}\nfunction buildEdgeAnnotationsByHashFromListEntries(entries) {\n\tconst annotations = /* @__PURE__ */ new Map();\n\tfor (const entry of entries) annotations.set(entry.hash, {\n\t\toperationCount: entry.operationCount,\n\t\tinvariants: entry.providedInvariants\n\t});\n\treturn annotations;\n}\nfunction buildRefsByHashFromListEntries(entries) {\n\tconst refsByHash = /* @__PURE__ */ new Map();\n\tfor (const entry of entries) if (entry.refs.length > 0) refsByHash.set(entry.toContract, entry.refs);\n\treturn refsByHash;\n}\nfunction formatEmptyStateLine(spaceId, style) {\n\treturn style.emptyState(`There are no migrations in migrations/${spaceId}/ yet`);\n}\nfunction renderSpaceTreeBlock(input) {\n\tconst { spaceId, migrations, multiSpace, glyphMode, style, colorize, liveContractHash, graphForSpace, appSpaceId, palette, globalMaxEdgeTreePrefixWidth, globalMaxDirNameWidth } = input;\n\tif (migrations.length === 0) {\n\t\tconst emptyLine = formatEmptyStateLine(spaceId, style);\n\t\tif (!multiSpace) return [emptyLine];\n\t\treturn [style.spaceHeading(`${spaceId}:`), ` ${emptyLine}`];\n\t}\n\tconst graph = graphForSpace(spaceId) ?? migrationGraphFromListEntries(migrations);\n\tconst isAppSpace = appSpaceId === void 0 ? void 0 : spaceId === appSpaceId;\n\tconst treeOutput = renderMigrationGraphSpaceTree({\n\t\tgraph,\n\t\tmigrations,\n\t\tliveContractHash,\n\t\tglyphMode,\n\t\tcolorize,\n\t\trefsByHash: buildRefsByHashFromListEntries(migrations),\n\t\tstyler: style,\n\t\t...palette !== void 0 ? { palette } : {},\n\t\t...isAppSpace !== void 0 ? { isAppSpace } : {},\n\t\t...globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth } : {},\n\t\t...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}\n\t});\n\tif (!multiSpace) return treeOutput.length === 0 ? [] : [treeOutput];\n\tconst indented = indentMigrationGraphTreeBlock(treeOutput, \" \");\n\treturn [style.spaceHeading(`${spaceId}:`), indented];\n}\n/**\n* Compose the styled `migration list` human output via the shared tree\n* renderer. Each on-disk migration is one edge row with package-fact\n* annotations; refs decorate destination contract nodes.\n*\n* `options.colorize` must match whether `style` emits ANSI (e.g. both true for\n* `createAnsiMigrationListStyler({ useColor: true })`).\n*/\nfunction renderMigrationListWithStyle(result, style, glyphMode = \"unicode\", options = {}) {\n\tconst multiSpace = result.spaces.length > 1;\n\tconst colorize = options.colorize ?? false;\n\tconst liveContractHash = options.liveContractHash ?? EMPTY_CONTRACT_HASH;\n\tconst graphForSpace = options.graphForSpace ?? (() => void 0);\n\tconst appSpaceId = options.appSpaceId;\n\tconst globalLayoutInputs = multiSpace ? result.spaces.filter((space) => space.migrations.length > 0).map((space) => ({\n\t\tgraph: graphForSpace(space.space) ?? migrationGraphFromListEntries(space.migrations),\n\t\tliveContractHash\n\t})) : [];\n\tconst globalMaxEdgeTreePrefixWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxEdgeTreePrefixWidth(globalLayoutInputs) : void 0;\n\tconst globalMaxDirNameWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxDirNameWidth(globalLayoutInputs) : void 0;\n\tconst lines = [];\n\tfor (let index = 0; index < result.spaces.length; index++) {\n\t\tconst space = result.spaces[index];\n\t\tif (index > 0) lines.push(\"\");\n\t\tlines.push(...renderSpaceTreeBlock({\n\t\t\tspaceId: space.space,\n\t\t\tmigrations: space.migrations,\n\t\t\tmultiSpace,\n\t\t\tglyphMode,\n\t\t\tstyle,\n\t\t\tcolorize,\n\t\t\tliveContractHash,\n\t\t\tgraphForSpace,\n\t\t\tappSpaceId,\n\t\t\tpalette: options.palette,\n\t\t\tglobalMaxEdgeTreePrefixWidth,\n\t\t\tglobalMaxDirNameWidth\n\t\t}));\n\t}\n\tif (result.spaces.reduce((count, space) => count + space.migrations.length, 0) > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(style.summary(result.summary));\n\t}\n\treturn lines.join(\"\\n\");\n}\n//#endregion\n//#region src/utils/formatters/migration-list-styler.ts\nfunction hasMarkersFormatter(styler) {\n\treturn \"markers\" in styler && typeof styler.markers === \"function\";\n}\nfunction styleMarkerName(name) {\n\treturn name === \"contract\" ? bold(green(name)) : green(name);\n}\nfunction plainMarkers(names) {\n\treturn names.map((name) => `@${name}`).join(\" \");\n}\nfunction formatContractNodeOverlays(styler, markers, refs) {\n\tconst parts = [];\n\tif (markers.length > 0) parts.push(hasMarkersFormatter(styler) ? styler.markers(markers) : plainMarkers(markers));\n\tif (refs.length > 0) parts.push(styler.refs(refs));\n\treturn parts.join(\" \");\n}\n/**\n* The current contract overlay marker. Unlike user refs, this names the user's\n* declared desired state — the implicit base/target for `plan` / `migrate` —\n* not a stored label. It is emphasized (bold) so it stands out from plain refs\n* (including the live-database `db` marker, which is just another ref).\n*/\nconst CONTRACT_MARKER_NAME = \"contract\";\nfunction styleRefName(name) {\n\treturn green(name);\n}\n/**\n* Build a {@link MigrationListStyler} that decorates `migration list`\n* tokens with ANSI SGR codes. When `useColor` is `false` (non-TTY,\n* `--no-color`, `NO_COLOR=1`, piped output) the function returns the\n* shared identity styler so callers get plain text with zero ANSI\n* bytes — pipe-friendly by construction.\n*\n* Palette:\n*\n* - `dirName`: bold\n* - `sourceHash`: dim cyan\n* - `destHash`: bright cyan\n* - `kind` (`*` / `↩` / `⟲`): bright — the signal; lanes and arrows dim\n* - `glyph` (`→` / `⟲` / `∅`): dim\n* - `lane` (graph gutter lines `│` and fan/join connectors `├─┐` / `├─┘`): dim\n* - `invariants` (`{...}`): yellow\n* - `markers` (`@contract @db`): green; the `contract` desired-state marker is\n* green-bold (`db` is plain green); the `@` sigil is applied to each name\n* - `refs` (`(...)`): green (the active ref is bolded separately by the tree styler)\n* - `spaceHeading` (`<spaceId>:`): bold\n* - `summary`: dim\n* - `emptyState`: dim\n*/\nfunction createAnsiMigrationListStyler(opts) {\n\tif (!opts.useColor) return {\n\t\t...IDENTITY_MIGRATION_LIST_STYLER,\n\t\tmarkers: plainMarkers\n\t};\n\treturn {\n\t\tkind: (text) => text,\n\t\tdirName: (text) => bold(text),\n\t\tsourceHash: (text) => dim(cyan(text)),\n\t\tdestHash: (text) => cyanBright(text),\n\t\tglyph: (text) => dim(text),\n\t\tlane: (text) => dim(text),\n\t\tinvariants: (ids) => yellow(`{${ids.join(\", \")}}`),\n\t\tmarkers: (names) => {\n\t\t\tconst sigil = green(\"@\");\n\t\t\treturn names.map((name) => sigil + styleMarkerName(name)).join(\" \");\n\t\t},\n\t\trefs: (names) => {\n\t\t\tconst open = green(\"(\");\n\t\t\tconst close = green(\")\");\n\t\t\tconst separator = green(\", \");\n\t\t\treturn open + names.map(styleRefName).join(separator) + close;\n\t\t},\n\t\tspaceHeading: (text) => bold(text),\n\t\tsummary: (text) => dim(text),\n\t\temptyState: (text) => dim(text)\n\t};\n}\n/**\n* The same vocabulary, said as meaning rather than as colour: each token is\n* marked with the tone it carries and the CLI engine chooses the bytes.\n*\n* Two distinctions the ANSI styler draws by shade do not survive, because a\n* span carries exactly one tone: the source and destination hashes are both\n* `identifier` (the ANSI styler dims the source and brightens the\n* destination), and the `contract` marker is `emphasis` rather than bold\n* green, which is what tells it apart from a plain marker such as `db`.\n*/\nfunction createToneMigrationListStyler() {\n\treturn {\n\t\tkind: (text) => text,\n\t\tdirName: (text) => toned(\"emphasis\", text),\n\t\tsourceHash: (text) => toned(\"identifier\", text),\n\t\tdestHash: (text) => toned(\"identifier\", text),\n\t\tglyph: (text) => toned(\"structure\", text),\n\t\tlane: (text) => toned(\"structure\", text),\n\t\tinvariants: (ids) => toned(\"warn\", `{${ids.join(\", \")}}`),\n\t\tmarkers: (names) => names.map((name) => toned(\"ref\", \"@\") + (name === \"contract\" ? toned(\"emphasis\", name) : toned(\"ref\", name))).join(\" \"),\n\t\trefs: (names) => toned(\"ref\", `(${names.join(\", \")})`),\n\t\tspaceHeading: (text) => toned(\"heading\", text),\n\t\tsummary: (text) => toned(\"muted\", text),\n\t\temptyState: (text) => toned(\"muted\", text)\n\t};\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-labels.ts\n/**\n* Per-row label formatting for the command graph renderer.\n*\n* The command graph renderer ({@link renderMigrationGraphCommand}) derives the\n* graph structure — rows, gutter, lane colours — from the grid pipeline. The\n* per-row LABEL (contract hash + markers + refs for node rows;\n* migration name + `from → to` + ops/status/will-run for migration rows) is\n* formatted here. This module owns ONLY label text + styling; it knows nothing\n* about lanes, gutters, or grid geometry.\n*\n* The label format (hash abbreviation, `from → to` arrow column, `@contract`/\n* `@db` markers, `(refs)`, ops/status/will-run suffix, the legend) is the same\n* as the previous renderer — that part was never the bug.\n*/\n/**\n* The live-database overlay marker. Just another ref as far as styling goes —\n* the only emphasized markers are the active ref and the `contract`\n* desired-state marker (see {@link CONTRACT_MARKER_NAME}).\n*/\nconst DB_MARKER_NAME = \"db\";\nfunction paletteFor(opts) {\n\treturn opts.palette ?? ANSI_MIGRATION_GRAPH_PALETTE;\n}\nconst identity = (text) => text;\n/** A palette painter bound to a path role, or a no-op when colour is off. */\nfunction rolePainter(palette, colorize, role) {\n\treturn colorize ? (text) => palette.role(role, text) : identity;\n}\n/**\n* The two label styles used in `migrate --show` path-highlight mode.\n*\n* - `onPath`: emphasized name, neutral hashes (the on-path lane glyphs are\n* coloured by the grid renderer, not here).\n* - `offPath`: the off-path role reaches the name and the whole hash field.\n*\n* To change the on-path / off-path label colour in future, edit this object.\n*/\nconst PATH_HIGHLIGHT_STYLES = {\n\tonPath: (_style, colorize, palette = ANSI_MIGRATION_GRAPH_PALETTE) => ({\n\t\tlane: rolePainter(palette, colorize, \"on-path\"),\n\t\tarrow: identity,\n\t\tdirName: colorize ? (text) => palette.emphasis(text) : identity,\n\t\thashOverride: void 0\n\t}),\n\toffPath: (colorize, palette = ANSI_MIGRATION_GRAPH_PALETTE) => ({\n\t\tlane: rolePainter(palette, colorize, \"off-path\"),\n\t\tarrow: rolePainter(palette, colorize, \"off-path\"),\n\t\tdirName: rolePainter(palette, colorize, \"off-path\"),\n\t\thashOverride: colorize ? rolePainter(palette, colorize, \"off-path\") : void 0\n\t})\n};\nfunction abbreviateHash(hash, hashLength, emptySource) {\n\tif (hash === EMPTY_CONTRACT_HASH) return emptySource;\n\treturn hash.slice(0, hashLength);\n}\nfunction overlayNamesForContract(contractHash, opts) {\n\tconst markers = [];\n\tconst refs = [];\n\tconst userRefs = opts.refsByHash?.get(contractHash);\n\tif (userRefs) refs.push(...[...userRefs].sort((a, b) => a.localeCompare(b)));\n\tif (opts.isAppSpace !== false && opts.contractHash === contractHash && contractHash !== EMPTY_CONTRACT_HASH) markers.push(CONTRACT_MARKER_NAME);\n\tif (opts.dbHash === contractHash) markers.push(DB_MARKER_NAME);\n\tmarkers.sort((a, b) => {\n\t\tif (a === \"contract\") return -1;\n\t\tif (b === \"contract\") return 1;\n\t\treturn a.localeCompare(b);\n\t});\n\treturn {\n\t\tmarkers,\n\t\trefs\n\t};\n}\nfunction createLabelStyler(opts) {\n\tconst base = opts.styler ?? createAnsiMigrationListStyler({ useColor: opts.colorize });\n\tconst activeRefName = opts.activeRefName;\n\tif (!opts.colorize || activeRefName === void 0) return base;\n\tconst palette = paletteFor(opts);\n\treturn {\n\t\t...base,\n\t\trefs: (names) => {\n\t\t\tconst styledNames = names.map((name) => name === activeRefName ? palette.emphasis(name) : name);\n\t\t\treturn base.refs(styledNames);\n\t\t}\n\t};\n}\nfunction overlayStatusGlyphs(mode) {\n\treturn mode === \"ascii\" ? {\n\t\tapplied: \"+\",\n\t\tpending: \">\"\n\t} : {\n\t\tapplied: \"✓\",\n\t\tpending: \"⧗\"\n\t};\n}\nfunction formatEdgeAnnotationSuffix(migrationHash, opts, style) {\n\tconst annotation = opts.edgeAnnotationsByHash?.get(migrationHash);\n\tif (annotation === void 0) return \"\";\n\tconst isOffPath = annotation.pathHighlight === \"off-path\";\n\tconst segments = [];\n\tif (annotation.operationCount !== void 0) segments.push(`${annotation.operationCount} ops`);\n\tif (annotation.invariants !== void 0 && annotation.invariants.length > 0) segments.push(style.invariants(annotation.invariants));\n\tconst status = annotation.status;\n\tif (status !== void 0) {\n\t\tconst glyphs = overlayStatusGlyphs(opts.glyphMode ?? \"unicode\");\n\t\tconst glyph = status === \"applied\" ? glyphs.applied : glyphs.pending;\n\t\tconst label = status === \"applied\" ? \"applied\" : \"pending\";\n\t\tif (!opts.colorize) segments.push(`${glyph} ${label}`);\n\t\telse segments.push(paletteFor(opts).status(status, `${glyph} ${label}`));\n\t}\n\tif (annotation.pathHighlight === \"on-path\") {\n\t\tconst glyph = opts.glyphMode === \"ascii\" ? \">\" : \"↑\";\n\t\tsegments.push(`${glyph} will run`);\n\t}\n\tif (segments.length === 0) return \"\";\n\tconst suffix = ` ${segments.join(\" \")}`;\n\treturn opts.colorize && isOffPath ? paletteFor(opts).role(\"off-path\", suffix) : suffix;\n}\n/**\n* Format the `from → to` hash data column for an edge row.\n*\n* When `hashOverride` is provided (off-path → `dim`), it replaces ALL sub-stylers\n* so dim reaches every character without inner ANSI codes overriding it.\n*/\nfunction formatEdgeHashColumn(edge, style, hashLength, glyphMode, hashOverride) {\n\tconst emptySource = migrationListEmptySource(glyphMode);\n\tconst forwardArrow = migrationListForwardArrow(glyphMode);\n\tconst src = hashOverride ?? style.sourceHash;\n\tconst dst = hashOverride ?? style.destHash;\n\tconst glyph = hashOverride ?? style.glyph;\n\tif (edge.kind === \"self\") {\n\t\tconst hash = abbreviateHash(edge.from, hashLength, emptySource);\n\t\treturn `${padFromHashColumn(src(hash), hashLength)} ${glyph(forwardArrow)} ${dst(hash)}`;\n\t}\n\treturn `${edge.from === EMPTY_CONTRACT_HASH ? padFromHashColumn(glyph(emptySource), hashLength) : padFromHashColumn(src(abbreviateHash(edge.from, hashLength, emptySource)), hashLength)} ${glyph(forwardArrow)} ${dst(abbreviateHash(edge.to, hashLength, emptySource))}`;\n}\n/**\n* The label text for a contract node row: the abbreviated hash (or the `∅`\n* empty-source token for the baseline) followed by its `@contract`/`@db` markers\n* and `(refs)`, with two spaces between the hash and the overlay block.\n*/\nfunction formatNodeLabel(contractHash, opts, nodeHighlight) {\n\tconst style = createLabelStyler(opts);\n\tconst hashLength = opts.hashLength ?? 7;\n\tconst emptySource = migrationListEmptySource(opts.glyphMode ?? \"unicode\");\n\tconst overlays = overlayNamesForContract(contractHash, opts);\n\tconst hasOverlays = overlays.markers.length > 0 || overlays.refs.length > 0;\n\tconst offPath = nodeHighlight === \"off-path\" && opts.colorize;\n\tconst dimmed = (text) => paletteFor(opts).role(\"off-path\", text);\n\tconst hashText = contractHash === EMPTY_CONTRACT_HASH ? (offPath ? dimmed : style.glyph)(emptySource) : (offPath ? dimmed : style.sourceHash)(abbreviateHash(contractHash, hashLength, emptySource));\n\tif (!hasOverlays) return hashText;\n\treturn `${hashText} ${formatContractNodeOverlays(style, overlays.markers, overlays.refs)}`;\n}\n/**\n* The label text for a migration row: the migration name (padded to\n* `dirNameWidth`) followed by the `from → to` hash column and the annotation\n* suffix (ops / status / will-run).\n*\n* In flat mode the name is tinted with its lane's hue (`lane` ≥ 0), so the node\n* `○`, the edges/arrows in the gutter, and the name all read in one colour. In\n* focus mode the on-path/off-path role overrides the lane hue (bold / dim).\n*/\nfunction formatMigrationLabel(edge, dirNameWidth, opts, lane) {\n\tconst style = createLabelStyler(opts);\n\tconst hashLength = opts.hashLength ?? 7;\n\tconst glyphMode = opts.glyphMode ?? \"unicode\";\n\tconst highlight = opts.edgeAnnotationsByHash?.get(edge.migrationHash)?.pathHighlight;\n\tconst palette = paletteFor(opts);\n\tlet dirNameStyler;\n\tlet hashOverride;\n\tif (highlight === \"on-path\") {\n\t\tdirNameStyler = rolePainter(palette, opts.colorize, \"on-path\");\n\t\thashOverride = void 0;\n\t} else if (highlight === \"off-path\") {\n\t\tdirNameStyler = opts.colorize ? rolePainter(palette, true, \"off-path\") : style.dirName;\n\t\thashOverride = opts.colorize ? rolePainter(palette, true, \"off-path\") : void 0;\n\t} else if (opts.colorize && lane !== void 0) {\n\t\tdirNameStyler = (text) => palette.lane(lane, text);\n\t\thashOverride = void 0;\n\t} else {\n\t\tdirNameStyler = style.dirName;\n\t\thashOverride = void 0;\n\t}\n\tconst dirNamePadding = \" \".repeat(Math.max(0, dirNameWidth - edge.dirName.length));\n\treturn `${`${dirNameStyler(edge.dirName)}${dirNamePadding}`}${formatEdgeHashColumn(edge, style, hashLength, glyphMode, hashOverride)}${formatEdgeAnnotationSuffix(edge.migrationHash, opts, style)}`;\n}\n/**\n* Format a single on-path migration row for the `migrate --show` run-list.\n* Shares PATH_HIGHLIGHT_STYLES.onPath with the graph tree so the run-list and\n* the graph are byte-for-byte identical in their name/hash columns.\n*/\nfunction formatOnPathMigrationRow(dirName, from, to, dirNameWidth, colorize, glyphMode, paint) {\n\tconst style = paint?.styler ?? createAnsiMigrationListStyler({ useColor: colorize });\n\tconst styledDirName = `${PATH_HIGHLIGHT_STYLES.onPath(style, colorize, paint?.palette).dirName(dirName)}${\" \".repeat(Math.max(0, dirNameWidth - dirName.length))}`;\n\tconst hashLength = 7;\n\tconst emptySource = migrationListEmptySource(glyphMode);\n\tconst forwardArrow = migrationListForwardArrow(glyphMode);\n\tconst fromAbbr = from === EMPTY_CONTRACT_HASH ? padFromHashColumn(style.glyph(emptySource), hashLength) : padFromHashColumn(style.sourceHash(abbreviateHash(from, hashLength, emptySource)), hashLength);\n\tconst toAbbr = to === EMPTY_CONTRACT_HASH ? style.glyph(emptySource) : style.destHash(abbreviateHash(to, hashLength, emptySource));\n\treturn `${styledDirName} ${fromAbbr} ${style.glyph(forwardArrow)} ${toAbbr}`;\n}\nfunction legendGlyphs(mode) {\n\treturn mode === \"ascii\" ? {\n\t\tnode: \"*\",\n\t\tforward: \"^\",\n\t\trollback: \"v\",\n\t\tself: \"@\"\n\t} : {\n\t\tnode: \"○\",\n\t\tforward: \"↑\",\n\t\trollback: \"↓\",\n\t\tself: \"⟲\"\n\t};\n}\n/**\n* A compact key for the tree visual language: the contract node glyph, the\n* in-lane direction arrows, the empty baseline, the system-marker `@…` and\n* user-ref `(…)` conventions, and a worked sample of the data-column hash arrow.\n*/\nfunction renderMigrationGraphLegend(opts) {\n\tconst glyphMode = opts.glyphMode ?? \"unicode\";\n\tconst style = opts.styler ?? createAnsiMigrationListStyler({ useColor: opts.colorize });\n\tconst palette = opts.palette ?? ANSI_MIGRATION_GRAPH_PALETTE;\n\tconst glyphs = legendGlyphs(glyphMode);\n\tconst emptySource = migrationListEmptySource(glyphMode);\n\tconst forwardArrow = migrationListForwardArrow(glyphMode);\n\tconst sampleArrow = `${style.sourceHash(\"aaaaaa\")} ${style.glyph(forwardArrow)} ${style.destHash(\"bbbbbb\")}`;\n\tconst statusGlyphs = overlayStatusGlyphs(glyphMode);\n\tconst appliedGlyph = opts.colorize ? palette.status(\"applied\", statusGlyphs.applied) : statusGlyphs.applied;\n\tconst pendingGlyph = opts.colorize ? palette.status(\"pending\", statusGlyphs.pending) : statusGlyphs.pending;\n\tconst appliedPending = ` ${appliedGlyph} ${style.summary(\"applied\")} ${pendingGlyph} ${style.summary(\"pending\")}`;\n\tconst exampleMarkers = style.markers([CONTRACT_MARKER_NAME, DB_MARKER_NAME]);\n\tconst exampleRefs = style.refs([\"prod\", \"staging\"]);\n\treturn [\n\t\t\"Legend:\",\n\t\t` ${style.kind(glyphs.node)} ${style.summary(\"contract\")} ${style.kind(glyphs.forward)} ${style.summary(\"forward\")} ${style.kind(glyphs.rollback)} ${style.summary(\"rollback\")}`,\n\t\t` ${style.kind(glyphs.self)} ${style.summary(\"migration without schema change\")}`,\n\t\tappliedPending,\n\t\t` ${style.kind(emptySource)} ${style.summary(\"empty database (baseline)\")}`,\n\t\t` ${exampleMarkers} ${style.summary(\"reserved markers — also typeable as --from/--to tokens\")}`,\n\t\t` ${exampleRefs} ${style.summary(\"user-defined refs\")}`,\n\t\t` ${sampleArrow} ${style.summary(\"migration from contract aaaaaa to bbbbbb\")}`\n\t].join(\"\\n\");\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-occlusion-render.ts\n/**\n* Occlusion renderer for the line/plane/occlusion migration-graph.\n*\n* Per cell: pick the topmost-plane line (lowest plane number = drawn on top),\n* look up its glyph, apply colour from the line's lane or role. Lower-plane\n* lines are occluded (not drawn).\n*\n* Colour comes from the palette the caller hands in; see migration-graph-palette.\n*/\nconst UNICODE_ALPHABET = {\n\tvertical: \"│\",\n\thorizontal: \"─\",\n\tcornerUpRight: \"╰\",\n\tcornerDownRight: \"╭\",\n\tcornerUpLeft: \"╯\",\n\tcornerDownLeft: \"╮\",\n\tarrowUp: \"↑\",\n\tarrowDown: \"↓\",\n\tnode: \"○\",\n\tselfLoop: \"⟲\",\n\tlandingArrow: \"◂\",\n\tfallback: \"?\"\n};\nconst ASCII_ALPHABET = {\n\tvertical: \"|\",\n\thorizontal: \"-\",\n\tcornerUpRight: \"\\\\\",\n\tcornerDownRight: \"/\",\n\tcornerUpLeft: \"/\",\n\tcornerDownLeft: \"\\\\\",\n\tarrowUp: \"^\",\n\tarrowDown: \"v\",\n\tnode: \"*\",\n\tselfLoop: \"@\",\n\tlandingArrow: \"<\",\n\tfallback: \"?\"\n};\nfunction alphabetFor(mode) {\n\treturn mode === \"ascii\" ? ASCII_ALPHABET : UNICODE_ALPHABET;\n}\nfunction glyphFor(dirs, alphabet) {\n\tconst has = (d) => dirs.has(d);\n\tif (has(\"up\") && has(\"down\") && !has(\"left\") && !has(\"right\")) return alphabet.vertical;\n\tif (has(\"left\") && has(\"right\") && !has(\"up\") && !has(\"down\")) return alphabet.horizontal;\n\tif (has(\"up\") && has(\"right\") && !has(\"down\") && !has(\"left\")) return alphabet.cornerUpRight;\n\tif (has(\"down\") && has(\"right\") && !has(\"up\") && !has(\"left\")) return alphabet.cornerDownRight;\n\tif (has(\"up\") && has(\"left\") && !has(\"down\") && !has(\"right\")) return alphabet.cornerUpLeft;\n\tif (has(\"down\") && has(\"left\") && !has(\"up\") && !has(\"right\")) return alphabet.cornerDownLeft;\n\tif (has(\"up\") && !has(\"down\") && !has(\"left\") && !has(\"right\")) return alphabet.arrowUp;\n\tif (has(\"down\") && !has(\"up\") && !has(\"left\") && !has(\"right\")) return alphabet.arrowDown;\n\treturn alphabet.fallback;\n}\n/** A line or node is painted by its path role when it has one, else by its lane. */\nfunction paintByRoleOrLane(palette, role, lane) {\n\treturn role === void 0 ? (text) => palette.lane(lane, text) : (text) => palette.role(role, text);\n}\nfunction renderCell(cell, palette, alphabet) {\n\tconst node = cell.node;\n\tif (node !== void 0) return paintByRoleOrLane(palette, node.role, node.lane)(alphabet.node);\n\tif (cell.lines.length === 0) return \" \";\n\tconst topLine = cell.lines.reduce((best, current) => {\n\t\tif (current.plane < best.plane) return current;\n\t\tif (current.plane > best.plane) return best;\n\t\tif (current.line.role === \"on-path\" && best.line.role !== \"on-path\") return current;\n\t\treturn best;\n\t}, cell.lines[0]);\n\tconst glyph = topLine.selfLoop === true ? alphabet.selfLoop : topLine.landingArrow === true ? alphabet.landingArrow : glyphFor(topLine.directions, alphabet);\n\treturn paintByRoleOrLane(palette, topLine.line.role, topLine.line.lane)(glyph);\n}\n/**\n* Render a single grid row to a coloured string. A completely empty row returns\n* the empty string (the row is NOT dropped) so callers that pair grid rows with\n* an external per-row label list keep a 1:1 index correspondence. `renderGrid`\n* itself drops empty rows for its standalone output (but preserves separator rows).\n*/\nfunction renderGridRow(row, opts = {}) {\n\tif (row[0]?.separator === true) return \"\";\n\tlet lastNonEmpty = -1;\n\tfor (let i = row.length - 1; i >= 0; i--) {\n\t\tconst cell = row[i];\n\t\tif (cell !== void 0 && (cell.lines.length > 0 || cell.node !== void 0)) {\n\t\t\tlastNonEmpty = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (lastNonEmpty < 0) return \"\";\n\tconst colsPerLane = opts.colsPerLane ?? 2;\n\tconst palette = opts.colorize ?? true ? opts.palette ?? ANSI_MIGRATION_GRAPH_PALETTE : PLAIN_MIGRATION_GRAPH_PALETTE;\n\tconst alphabet = alphabetFor(opts.glyphMode ?? \"unicode\");\n\tconst lastConnectorCol = Math.floor(lastNonEmpty / colsPerLane) * colsPerLane + (colsPerLane - 1);\n\tconst renderThrough = Math.max(lastNonEmpty, lastConnectorCol);\n\tlet line = \"\";\n\tfor (let col = 0; col <= Math.min(renderThrough, row.length - 1); col++) {\n\t\tconst cell = row[col];\n\t\tline += cell === void 0 ? \" \" : renderCell(cell, palette, alphabet);\n\t}\n\treturn line;\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-command-render.ts\n/**\n* Command graph renderer: composes the gutter (from the grid) with per-row labels.\n*\n* Pipeline: buildMigrationGraphRows → buildGrid → renderMigrationGraphCommand\n*\n* Each grid row is classified by its cells: a node row gets a contract label;\n* a migration arrow row gets a migration label; connector rows get no label.\n* Label format and styling live in `./migration-graph-labels`.\n*/\nconst LABEL_GAP$1 = 2;\nconst MIN_HASH_DATA_COLUMN$1 = 25;\n/**\n* Classify a grid row by its own cells:\n* - a cell carrying a NodeRef → node row (contract label);\n* - a cell whose top line is an arrow ({up}/{down}/self-loop) → migration row;\n* - otherwise → no label.\n*\n* A migration's arrow appears in exactly one grid row (the forward `↑` row, the\n* adjacent-rollback `↓` row, or the self-loop `⟲` row), so each migration gets\n* exactly one label, on the row that draws its arrow.\n*\n* Two distinct migrations with identical content (same from/to/ops) hash to the\n* SAME migration hash, so the arrow line is matched on BOTH its hash and its\n* `dirName` (which the LineRef carries per-row) — otherwise both rows would\n* resolve to one edge and the other migration's name would be lost.\n*/\nfunction classifyRow(row, edgesByHash) {\n\tfor (const cell of row) if (cell.node !== void 0) return {\n\t\tkind: \"node\",\n\t\tcontractHash: cell.node.contractHash\n\t};\n\tfor (const cell of row) {\n\t\tconst arrow = arrowLine(cell);\n\t\tif (arrow === void 0) continue;\n\t\tconst candidates = edgesByHash.get(arrow.line.migrationHash) ?? [];\n\t\tconst edge = candidates.find((e) => e.dirName === arrow.line.dirName) ?? candidates[0];\n\t\tif (edge !== void 0) return {\n\t\t\tkind: \"migration\",\n\t\t\tedge,\n\t\t\tlane: arrow.line.lane\n\t\t};\n\t}\n\treturn { kind: \"none\" };\n}\n/**\n* Return the cell's arrow line if it carries one — a self-loop, or a line whose\n* directions are exactly `{up}` or `{down}` (the migration-direction arrows).\n* Connector/corner/vertical lines are not arrows and yield `undefined`.\n*/\nfunction arrowLine(cell) {\n\tfor (const line of cell.lines) {\n\t\tif (line.selfLoop === true) return line;\n\t\tif (line.landingArrow === true) continue;\n\t\tconst dirs = line.directions;\n\t\tif (dirs.size !== 1) continue;\n\t\tif (dirs.has(\"up\") || dirs.has(\"down\")) return line;\n\t}\n}\n/**\n* Resolve each contract's path-highlight role from the edges incident on it.\n* On-path wins: a contract touched by any on-path edge is on-path. Empty unless\n* focus-mode annotations are present.\n*/\nfunction resolveNodeHighlights(rowModel, edgeAnnotationsByHash) {\n\tconst result = /* @__PURE__ */ new Map();\n\tif (edgeAnnotationsByHash === void 0) return result;\n\tfor (const edge of rowModel.edges) {\n\t\tconst highlight = edgeAnnotationsByHash.get(edge.migrationHash)?.pathHighlight;\n\t\tif (highlight === void 0) continue;\n\t\tfor (const hash of [edge.from, edge.to]) {\n\t\t\tif (hash === EMPTY_CONTRACT_HASH) continue;\n\t\t\tif (result.get(hash) !== \"on-path\") result.set(hash, highlight);\n\t\t}\n\t}\n\treturn result;\n}\nfunction maxDirNameLength(edges) {\n\tlet max = 0;\n\tfor (const edge of edges) max = Math.max(max, edge.dirName.length);\n\treturn max;\n}\n/**\n* The label column for a render: the widest gutter (visible width) across every\n* row, plus the label gap. Labels begin here so they line up regardless of how\n* deep the lane structure runs on any one row. A cross-space override widens it\n* so sibling space sections share one column.\n*/\nfunction computeLabelColumn(grid, glyphMode) {\n\tlet maxGutter = 0;\n\tfor (const row of grid) {\n\t\tconst gutter = renderGridRow(row, {\n\t\t\tcolorize: false,\n\t\t\tglyphMode\n\t\t});\n\t\tmaxGutter = Math.max(maxGutter, stringWidth(gutter));\n\t}\n\treturn maxGutter + LABEL_GAP$1;\n}\nfunction computeMaxDirNameWidth(rowModel) {\n\treturn maxDirNameLength(rowModel.edges);\n}\nfunction padVisible(text, targetWidth) {\n\tconst padding = Math.max(0, targetWidth - stringWidth(text));\n\treturn text + \" \".repeat(padding);\n}\nconst ANSI_ESCAPE = \"\\x1B\";\nfunction trimTrailingWhitespace(line) {\n\tconst trailingSpaceBeforeReset = new RegExp(`[\\\\t ]+((?:${ANSI_ESCAPE}\\\\[[0-9;]*m)+)$`);\n\treturn line.replace(trailingSpaceBeforeReset, \"$1\").replace(/\\s+$/, \"\");\n}\nfunction renderMigrationGraphCommand(input) {\n\tconst { grid, rowModel } = input;\n\tconst glyphMode = input.glyphMode;\n\tconst edgesByHash = /* @__PURE__ */ new Map();\n\tfor (const edge of rowModel.edges) {\n\t\tconst bucket = edgesByHash.get(edge.migrationHash);\n\t\tif (bucket) bucket.push(edge);\n\t\telse edgesByHash.set(edge.migrationHash, [edge]);\n\t}\n\tconst labelOpts = {\n\t\tcolorize: input.colorize,\n\t\tglyphMode,\n\t\t...ifDefined(\"refsByHash\", input.refsByHash),\n\t\t...ifDefined(\"edgeAnnotationsByHash\", input.edgeAnnotationsByHash),\n\t\t...ifDefined(\"dbHash\", input.dbHash),\n\t\t...ifDefined(\"contractHash\", input.contractHash),\n\t\t...ifDefined(\"isAppSpace\", input.isAppSpace),\n\t\t...ifDefined(\"activeRefName\", input.activeRefName),\n\t\t...ifDefined(\"styler\", input.styler),\n\t\t...ifDefined(\"palette\", input.palette)\n\t};\n\tconst nodeHighlights = resolveNodeHighlights(rowModel, input.edgeAnnotationsByHash);\n\tconst labelColumn = input.globalLabelColumn ?? computeLabelColumn(grid, glyphMode);\n\tconst maxDirNameLen = input.globalMaxDirNameWidth ?? maxDirNameLength(rowModel.edges);\n\tconst dirNameWidth = Math.max(maxDirNameLen + LABEL_GAP$1, MIN_HASH_DATA_COLUMN$1 - labelColumn);\n\tconst lines = [];\n\tfor (const row of grid) {\n\t\tconst gutter = renderGridRow(row, {\n\t\t\tcolorize: input.colorize,\n\t\t\tglyphMode,\n\t\t\t...ifDefined(\"palette\", input.palette)\n\t\t});\n\t\tconst identity = classifyRow(row, edgesByHash);\n\t\tif (identity.kind === \"none\") {\n\t\t\tlines.push(trimTrailingWhitespace(gutter));\n\t\t\tcontinue;\n\t\t}\n\t\tconst gutterPad = padVisible(gutter, labelColumn);\n\t\tif (identity.kind === \"node\") {\n\t\t\tconst label = formatNodeLabel(identity.contractHash, labelOpts, nodeHighlights.get(identity.contractHash));\n\t\t\tlines.push(trimTrailingWhitespace(label.length === 0 ? gutter : `${gutterPad}${label}`));\n\t\t\tcontinue;\n\t\t}\n\t\tconst label = formatMigrationLabel(identity.edge, dirNameWidth, labelOpts, identity.lane);\n\t\tlines.push(trimTrailingWhitespace(`${gutterPad}${label}`));\n\t}\n\treturn lines.join(\"\\n\");\n}\n//#endregion\n//#region src/utils/formatters/migrate-show-render.ts\nconst LABEL_GAP = 2;\nconst MIN_HASH_DATA_COLUMN = 25;\nconst LIST_INDENT = 2;\nfunction paintOverrides(options) {\n\treturn {\n\t\t...options.styler === void 0 ? {} : { styler: options.styler },\n\t\t...options.palette === void 0 ? {} : { palette: options.palette }\n\t};\n}\n/**\n* Every space, with the migrations on the chosen path lifted to focus mode and\n* everything else dimmed. Widths are computed across all spaces first so the\n* sections and the run-list below them share their columns.\n*/\nfunction renderMigrateShowGraph(plan, options) {\n\tconst { aggregate, contractHash } = plan;\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tconst onPathHashes = new Set(plan.migrations.map((migration) => migration.migrationHash));\n\tconst spaceLayouts = allSpaces.map((space) => {\n\t\tconst isApp = space.spaceId === aggregate.app.spaceId;\n\t\tconst spaceGraph = space.graph();\n\t\tconst rowModel = buildMigrationGraphRows(spaceGraph, isApp ? { contractHash } : {});\n\t\tconst edgeAnnotations = /* @__PURE__ */ new Map();\n\t\tfor (const edge of spaceGraph.migrationByHash.values()) edgeAnnotations.set(edge.migrationHash, { pathHighlight: onPathHashes.has(edge.migrationHash) ? \"on-path\" : \"off-path\" });\n\t\treturn {\n\t\t\tspace,\n\t\t\tisApp,\n\t\t\trowModel,\n\t\t\tgrid: buildGrid(rowModel, {}, highlightFromEdgeAnnotations(edgeAnnotations)),\n\t\t\tedgeAnnotations\n\t\t};\n\t});\n\tconst multiSpace = spaceLayouts.length > 1;\n\tconst globalLabelColumn = multiSpace ? Math.max(...spaceLayouts.map(({ grid }) => computeLabelColumn(grid, options.glyphMode))) : void 0;\n\tconst widestRunListName = plan.migrations.length > 0 ? Math.max(...plan.migrations.map((migration) => migration.dirName.length)) : 0;\n\tconst globalMaxDirNameWidth = multiSpace ? Math.max(Math.max(...spaceLayouts.map(({ rowModel }) => computeMaxDirNameWidth(rowModel))), widestRunListName) : void 0;\n\tconst sections = [];\n\tfor (const { space, isApp, rowModel, grid, edgeAnnotations } of spaceLayouts) {\n\t\tconst liveMarkerHash = plan.renderMarkerHashBySpace.get(space.spaceId);\n\t\tconst tree = renderMigrationGraphCommand({\n\t\t\tgrid,\n\t\t\trowModel,\n\t\t\tcontractHash,\n\t\t\tisAppSpace: isApp,\n\t\t\t...plan.usedLiveMarker && liveMarkerHash !== void 0 ? { dbHash: liveMarkerHash } : {},\n\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\tedgeAnnotationsByHash: edgeAnnotations,\n\t\t\tcolorize: options.colorize,\n\t\t\tglyphMode: options.glyphMode,\n\t\t\t...paintOverrides(options),\n\t\t\t...globalLabelColumn === void 0 ? {} : { globalLabelColumn },\n\t\t\t...globalMaxDirNameWidth === void 0 ? {} : { globalMaxDirNameWidth }\n\t\t});\n\t\tif (tree.length === 0) continue;\n\t\tsections.push(multiSpace ? `${space.spaceId}:\\n${indentMigrationGraphTreeBlock(tree, \" \")}` : tree);\n\t}\n\treturn {\n\t\tgraphOutput: sections.join(\"\\n\\n\"),\n\t\trunListDirNameWidth: globalMaxDirNameWidth ?? widestRunListName,\n\t\trunListLeftPad: globalLabelColumn\n\t};\n}\n/**\n* The ordered \"will run\" rows, aligned with the graph above them.\n*\n* The `→` arrow has to land in the same absolute column in a list row as in a\n* graph edge row. A graph edge row is `[gutter][name][hashes]`; a list row is\n* `[indent][name][indent][hashes]`, so the list's name column absorbs the\n* gutter width and the indent — twice over when a flat tree has no space\n* headings indenting it.\n*/\nfunction migrateShowRunListRows(migrations, rendering, options) {\n\tconst gutter = rendering.runListLeftPad ?? 0;\n\tconst multiSpace = rendering.runListLeftPad !== void 0;\n\tconst listDirNameWidth = gutter + Math.max(rendering.runListDirNameWidth + LABEL_GAP, MIN_HASH_DATA_COLUMN - gutter) - (multiSpace ? LIST_INDENT : LIST_INDENT * 2);\n\treturn migrations.map((migration) => ` ${formatOnPathMigrationRow(migration.dirName, migration.from, migration.to, listDirNameWidth, options.colorize, options.glyphMode, paintOverrides(options))}`);\n}\n//#endregion\n//#region src/utils/migrate-failure.ts\n/** A `migrate` apply failure as the CLI's structured error. */\nfunction mapMigrateFailure(failure) {\n\tif (failure.code === \"MIGRATION_PATH_NOT_FOUND\") return errorPathUnreachable(failure);\n\treturn errorRunnerFailed(failure.summary, {\n\t\twhy: failure.why ?? \"Migration runner failed\",\n\t\tfix: \"Fix the issue and re-run `prisma-cli migrate --to <contract>` — previously applied migrations are preserved.\",\n\t\tmeta: failure.meta ?? {},\n\t\t...ifDefined(\"cause\", failure.cause)\n\t});\n}\n//#endregion\n//#region src/orm/migrate.ts\nconst STATUS_ACTION = runCommandAction(\"Check every space against the database\", \"prisma-cli migration status\");\n/**\n* The route the migration will take. The graph is a drawing — the engine cannot\n* derive a lane gutter — and the ordered list under it is drawn with the same\n* widths so every arrow lands in one column.\n*/\nfunction showPresentations$1(inputs) {\n\tconst { document, graph, runList } = inputs;\n\tconst count = document.migrations.length;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t\t},\n\t\t\t\t\t...inputs.database === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\t\tvalue: inputs.database\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.from === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\t\tvalue: inputs.from\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.to === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\t\tvalue: inputs.to\n\t\t\t\t\t}]\n\t\t\t\t]\n\t\t\t},\n\t\t\t...graph.length === 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(graph)\n\t\t\t}],\n\t\t\t...count === 0 ? [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"info\",\n\t\t\t\ttext: document.summary\n\t\t\t}] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"info\",\n\t\t\t\ttext: `The following ${count} migration${count === 1 ? \"\" : \"s\"} will run:`\n\t\t\t}, {\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(runList.join(\"\\n\"))\n\t\t\t}]\n\t\t],\n\t\tjson: () => document\n\t};\n}\nfunction applyPresentations(inputs) {\n\tconst { document } = inputs;\n\tconst advanced = document.advancedRef;\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t\t},\n\t\t\t\t\t...inputs.database === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\t\tvalue: inputs.database\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.to === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\t\tvalue: inputs.to\n\t\t\t\t\t}]\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: document.summary\n\t\t\t},\n\t\t\t...document.perSpace.length === 0 ? [] : perSpaceBlocks(document.perSpace, \"apply\"),\n\t\t\t...advanced === null || advanced === void 0 ? [] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: [{ text: `Advanced ref \"${advanced.name}\" → ` }, {\n\t\t\t\t\ttext: advanced.hash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t}]\n\t\t],\n\t\tjson: () => document,\n\t\tnext: () => [STATUS_ACTION]\n\t};\n}\n/**\n* `--to` as a contract the app graph knows. A ref target keeps the invariants\n* the ref declares; a bare hash carries none. Omitting `--to` targets the\n* emitted contract, which needs no resolution at all.\n*/\nfunction resolveRequestedTarget(to, refs, graph) {\n\tif (to === void 0) return ok$1({\n\t\tentry: void 0,\n\t\trefName: void 0\n\t});\n\tconst resolved = resolveContractRef(to, {\n\t\tgraph,\n\t\trefs\n\t});\n\tif (!resolved.ok) return notOk$1(normalizeError(resolved.failure));\n\tif (resolved.value.provenance.kind !== \"ref\") return ok$1({\n\t\tentry: {\n\t\t\thash: resolved.value.hash,\n\t\t\tinvariants: []\n\t\t},\n\t\trefName: void 0\n\t});\n\tconst refName = resolved.value.provenance.refName;\n\treturn ok$1({\n\t\tentry: refs[refName],\n\t\trefName\n\t});\n}\nfunction createMigrateCommand(createClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Apply planned migrations to advance the database\",\n\t\t\tdescription: \"Walks every contract space (app + extensions) and applies pending on-disk\\nmigrations in canonical order (extensions alphabetically, then app). It\\nreplays the on-disk migration graph and never invents an edge. Use --to to\\ntarget a specific contract (hash, ref name, or migration directory) and\\n--show for a read-only preview of the route it would take.\",\n\t\t\texamples: [\n\t\t\t\t\"migrate\",\n\t\t\t\t\"migrate --db $DATABASE_URL\",\n\t\t\t\t\"migrate --to production\",\n\t\t\t\t\"migrate --show\",\n\t\t\t\t\"migrate --show --from @contract --to production\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\tto: flag.string({\n\t\t\t\tbrief: \"Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t}),\n\t\t\tadvanceRef: flag.string({\n\t\t\t\tbrief: \"Advance the named ref to the post-apply marker after success\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tshow: flag.boolean({ brief: \"Preview the migration route without applying (read-only)\" }),\n\t\t\tfrom: flag.string({\n\t\t\t\tbrief: \"From-state for the --show preview (@contract, @db, hash, ref name, or dir)\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst migrationsRelative = displayPath(migrationsDirFor(ctx.config, ctx.cwd), ctx.cwd);\n\t\t\tif (args.flags.show) {\n\t\t\t\tconst planned = await executeMigrateShowPlan({\n\t\t\t\t\tconfig: ctx.config,\n\t\t\t\t\tcwd: ctx.cwd,\n\t\t\t\t\tcreateClient,\n\t\t\t\t\t...ifDefined(\"db\", args.flags.db),\n\t\t\t\t\t...ifDefined(\"to\", args.flags.to),\n\t\t\t\t\t...ifDefined(\"from\", args.flags.from)\n\t\t\t\t});\n\t\t\t\tif (!planned.ok) return notOk$1(normalizeError(planned.failure));\n\t\t\t\tconst plan = planned.value;\n\t\t\t\tconst paint = {\n\t\t\t\t\tcolorize: true,\n\t\t\t\t\tglyphMode: \"unicode\",\n\t\t\t\t\tstyler: createToneMigrationListStyler(),\n\t\t\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t\t\t};\n\t\t\t\tconst rendering = renderMigrateShowGraph(plan, paint);\n\t\t\t\tconst document = {\n\t\t\t\t\tok: true,\n\t\t\t\t\tmigrations: plan.migrations,\n\t\t\t\t\tsummary: plan.summary\n\t\t\t\t};\n\t\t\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\t\t\treturn ok$1(ctx.present({ data: document }, showPresentations$1({\n\t\t\t\t\tdocument,\n\t\t\t\t\tgraph: rendering.graphOutput,\n\t\t\t\t\trunList: migrateShowRunListRows(plan.migrations, rendering, paint),\n\t\t\t\t\tmigrationsDir: migrationsRelative,\n\t\t\t\t\tdatabase: args.flags.from === void 0 && typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0,\n\t\t\t\t\tfrom: args.flags.from,\n\t\t\t\t\tto: args.flags.to\n\t\t\t\t})));\n\t\t\t}\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst prepared = await prepareMigrationRun({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tcommandName: \"migrate\",\n\t\t\t\tcreateClient\n\t\t\t});\n\t\t\tif (!prepared.ok) return notOk$1(prepared.failure);\n\t\t\tconst { client, contractJson, contractPath, dbConnection, migrationsDir, refsDir } = prepared.value;\n\t\t\tconst familyInstance = ctx.config.family.create(createControlStack(ctx.config));\n\t\t\tlet appContract;\n\t\t\ttry {\n\t\t\t\tappContract = familyInstance.deserializeContract(contractJson);\n\t\t\t} catch (error) {\n\t\t\t\treturn notOk$1(normalizeError(errorContractValidationFailed(`Contract at ${contractPath} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPath } })));\n\t\t\t}\n\t\t\tconst loaded = await loadContractSpaceAggregateForCli({\n\t\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\t\tmigrationsDir,\n\t\t\t\tappContract,\n\t\t\t\textensions: ctx.config.extensions ?? [],\n\t\t\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t\t\t});\n\t\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\t\tconst aggregate = loaded.value;\n\t\t\tconst integrityFailure = refuseContractSpaceIntegrity(aggregate, {\n\t\t\t\tdeclaredExtensions: toDeclaredExtensionsFromRaw(castAs(ctx.config.extensions ?? [])),\n\t\t\t\tcheckContracts: true\n\t\t\t}, migrationsDir);\n\t\t\tif (integrityFailure) return notOk$1(normalizeError(integrityFailure));\n\t\t\tconst target = resolveRequestedTarget(args.flags.to, aggregate.app.refs, aggregate.app.graph());\n\t\t\tif (!target.ok) return notOk$1(target.failure);\n\t\t\tlet document;\n\t\t\ttry {\n\t\t\t\tawait client.connect(dbConnection);\n\t\t\t\tconst appGraph = aggregate.app.graph();\n\t\t\t\tconst appMarker = (await client.readAllMarkers()).get(\"app\") ?? null;\n\t\t\t\tif (appMarker !== null) {\n\t\t\t\t\tconst markerRefusal = refuseMarkerOutsideGraph({\n\t\t\t\t\t\tmarkerHash: appMarker.storageHash,\n\t\t\t\t\t\tgraph: appGraph\n\t\t\t\t\t});\n\t\t\t\t\tif (markerRefusal) return notOk$1(normalizeError(markerRefusal));\n\t\t\t\t}\n\t\t\t\tconst refEntry = target.value.entry;\n\t\t\t\tif (refEntry !== void 0 && refEntry.invariants.length > 0) {\n\t\t\t\t\tconst invariantRefusal = refuseUnknownInvariants({\n\t\t\t\t\t\tgraph: appGraph,\n\t\t\t\t\t\tmarkerInvariants: appMarker?.invariants ?? [],\n\t\t\t\t\t\trefInvariants: refEntry.invariants,\n\t\t\t\t\t\t...ifDefined(\"refName\", args.flags.to)\n\t\t\t\t\t});\n\t\t\t\t\tif (invariantRefusal) return notOk$1(normalizeError(invariantRefusal));\n\t\t\t\t}\n\t\t\t\tlet applyContract = appContract;\n\t\t\t\tlet snapshotContractJson = contractJson;\n\t\t\t\tlet snapshotContractDts;\n\t\t\t\tif (args.flags.to !== void 0 && refEntry !== void 0) {\n\t\t\t\t\tif (aggregate.app.packages.find((p) => p.metadata.to === refEntry.hash) !== void 0) try {\n\t\t\t\t\t\tconst at = await aggregate.app.contractAt(refEntry.hash, target.value.refName === void 0 ? void 0 : { refName: target.value.refName });\n\t\t\t\t\t\tapplyContract = at.contract;\n\t\t\t\t\t\tsnapshotContractJson = blindCast(at.contractJson);\n\t\t\t\t\t\tsnapshotContractDts = at.contractDts;\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst mapped = mapContractAtError(error, { artifactRole: \"to\" });\n\t\t\t\t\t\tif (!mapped.ok) return notOk$1(normalizeError(mapped.failure));\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst applied = await client.migrate({\n\t\t\t\t\tcontract: applyContract,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report),\n\t\t\t\t\t...ifDefined(\"refHash\", refEntry?.hash),\n\t\t\t\t\t...refEntry?.invariants === void 0 ? {} : { refInvariants: refEntry.invariants },\n\t\t\t\t\t...refEntry === void 0 ? {} : ifDefined(\"refName\", args.flags.to)\n\t\t\t\t});\n\t\t\t\tif (!applied.ok) return notOk$1(normalizeError(mapMigrateFailure(applied.failure)));\n\t\t\t\tconst { value } = applied;\n\t\t\t\tlet advancedRef = null;\n\t\t\t\tif (args.flags.advanceRef !== void 0) {\n\t\t\t\t\tconst contractIR = snapshotContractDts === void 0 ? await readContractIR(snapshotContractJson, contractPath) : {\n\t\t\t\t\t\tcontract: snapshotContractJson,\n\t\t\t\t\t\tcontractDts: snapshotContractDts\n\t\t\t\t\t};\n\t\t\t\t\tconst advanced = await advanceRefSafely({\n\t\t\t\t\t\trefsDir,\n\t\t\t\t\t\tmigrationsDir,\n\t\t\t\t\t\tname: args.flags.advanceRef,\n\t\t\t\t\t\thash: value.markerHash,\n\t\t\t\t\t\tcontractIR\n\t\t\t\t\t});\n\t\t\t\t\tif (!advanced.ok) return notOk$1(normalizeError(advanced.failure));\n\t\t\t\t\tadvancedRef = {\n\t\t\t\t\t\tname: advanced.value.name,\n\t\t\t\t\t\thash: advanced.value.hash\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdocument = {\n\t\t\t\t\tok: true,\n\t\t\t\t\tmigrationsApplied: value.migrationsApplied,\n\t\t\t\t\tmigrationsTotal: value.applied.length,\n\t\t\t\t\tmarkerHash: value.markerHash,\n\t\t\t\t\tapplied: value.applied,\n\t\t\t\t\tsummary: value.summary,\n\t\t\t\t\tperSpace: value.perSpace,\n\t\t\t\t\t...ifDefined(\"pathDecision\", value.pathDecision),\n\t\t\t\t\ttimings: { total: Date.now() - startedAt },\n\t\t\t\t\tadvancedRef\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\treturn notOk$1(normalizeError(mapCaughtMigrationError(error) ?? errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during migrate: ${error instanceof Error ? error.message : String(error)}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"verbose\",\n\t\t\t\ttext: `Total time: ${document.timings.total}ms`\n\t\t\t});\n\t\t\treturn ok$1(ctx.present({ data: document }, applyPresentations({\n\t\t\t\tdocument,\n\t\t\t\tmigrationsDir: migrationsRelative,\n\t\t\t\tdatabase: prepared.value.database,\n\t\t\t\tto: args.flags.to\n\t\t\t})));\n\t\t}\n\t});\n}\nconst migrateCommand = createMigrateCommand(createControlClient);\n//#endregion\n//#region src/utils/integrity-violation-to-check-failure.ts\nfunction migrationPathRelative(dirPath) {\n\treturn relative(process.cwd(), dirPath);\n}\nfunction migrationFileRelative(dirPath, fileName) {\n\treturn join(migrationPathRelative(dirPath), fileName);\n}\n/**\n* Map one {@link IntegrityViolation} onto a `migration check` failure row.\n* Sole catalogue mapping from integrity violations to `MIGRATION.CHECK_*` codes.\n*/\nfunction integrityViolationToCheckFailure(violation, migrationsDir) {\n\tconst spaceRelative = (spaceId) => migrationPathRelative(join(migrationsDir, spaceId));\n\tconst packageRelative = (spaceId, dirName) => migrationPathRelative(join(migrationsDir, spaceId, dirName));\n\tconst refRelative = (spaceId, refName) => migrationPathRelative(join(migrationsDir, spaceId, \"refs\", `${refName}.json`));\n\tswitch (violation.kind) {\n\t\tcase \"hashMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HASH_MISMATCH\",\n\t\t\twhere: migrationFileRelative(join(migrationsDir, violation.spaceId, violation.dirName), \"migration.json\"),\n\t\t\twhy: `Stored hash ${violation.stored} does not match recomputed hash ${violation.computed}`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package, or restore it from version control\")]\n\t\t};\n\t\tcase \"providedInvariantsMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_PROVIDED_INVARIANTS_MISMATCH\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" providedInvariants in migration.json disagrees with ops.json.`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package so migration.json and ops.json agree\")]\n\t\t};\n\t\tcase \"packageUnloadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_PACKAGE_UNLOADABLE\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" could not be loaded: ${violation.detail}`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package, or restore it from version control\")]\n\t\t};\n\t\tcase \"sameSourceAndTarget\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_NOOP_SELF_EDGE\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" in space \"${violation.spaceId}\" has source equal to target (${violation.hash}) with no data invariant — a true no-op self-edge.`,\n\t\t\tnextActions: [chooseAction(\"Add a data operation if this self-edge was meant to carry a data invariant\"), chooseAction(\"Or delete the migration if it is a true no-op\")]\n\t\t};\n\t\tcase \"orphanSpaceDir\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_ORPHAN_SPACE_DIR\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Contract-space directory \"${violation.spaceId}\" exists on disk but no extension declares it.`,\n\t\t\tnextActions: [chooseAction(\"Remove the orphan directory\"), chooseAction(\"Or declare the extension in `extensions`\")]\n\t\t};\n\t\tcase \"declaredButUnmigrated\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_DECLARED_BUT_UNMIGRATED\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Extension \"${violation.spaceId}\" is declared in \\`extensions\\` but has no on-disk migrations directory.`,\n\t\t\tnextActions: [runCommandAction(\"Re-emit the extension contract-space artefacts, then plan its migrations\", \"prisma-cli contract emit\"), chooseAction(\"Or remove the extension from `extensions` if it is unused\")]\n\t\t};\n\t\tcase \"headRefMissing\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HEAD_REF_MISSING\",\n\t\t\twhere: refRelative(violation.spaceId, \"head\"),\n\t\t\twhy: `Head ref \\`refs/head.json\\` is missing for contract space \"${violation.spaceId}\".`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the contract-space migrations and head ref artefacts\"), chooseAction(\"Or restore `refs/head.json` from version control\")]\n\t\t};\n\t\tcase \"headRefNotInGraph\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HEAD_REF_NOT_IN_GRAPH\",\n\t\t\twhere: refRelative(violation.spaceId, \"head\"),\n\t\t\twhy: `Head ref ${violation.hash} for contract space \"${violation.spaceId}\" is not present in its migration graph.`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the contract-space migrations\"), chooseAction(\"Or restore the missing migration package\")]\n\t\t};\n\t\tcase \"refUnreadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_REF_UNREADABLE\",\n\t\t\twhere: refRelative(violation.spaceId, violation.refName),\n\t\t\twhy: `Ref \"${violation.refName}\" for contract space \"${violation.spaceId}\" is unreadable: ${violation.detail}`,\n\t\t\tnextActions: [chooseAction(\"Repair or remove the corrupt ref file\")]\n\t\t};\n\t\tcase \"targetMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_TARGET_MISMATCH\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Contract space \"${violation.spaceId}\" targets \"${violation.actual}\" but the project targets \"${violation.expected}\".`,\n\t\t\tnextActions: [chooseAction(\"Update the extension to target the configured database\"), chooseAction(\"Or change the project target\")]\n\t\t};\n\t\tcase \"disjointness\": return {\n\t\t\tspace: \"app\",\n\t\t\tcode: \"MIGRATION.CHECK_SPACE_DISJOINTNESS_VIOLATION\",\n\t\t\twhere: migrationPathRelative(migrationsDir),\n\t\t\twhy: `Storage element \"${violation.element}\" is claimed by multiple contract spaces: ${violation.claimedBy.join(\", \")}.`,\n\t\t\tnextActions: [chooseAction(\"Update the contracts so each storage element is owned by exactly one contract space\")]\n\t\t};\n\t\tcase \"contractUnreadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_CONTRACT_UNREADABLE\",\n\t\t\twhere: migrationFileRelative(join(migrationsDir, violation.spaceId), \"contract.json\"),\n\t\t\twhy: `Contract for space \"${violation.spaceId}\" is unreadable: ${violation.detail}`,\n\t\t\tnextActions: [runCommandAction(\"Re-emit the extension contract artefacts\", \"prisma-cli contract emit\"), chooseAction(\"Or fix the descriptor producing the invalid contract\")]\n\t\t};\n\t\tcase \"duplicateMigrationHash\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_DUPLICATE_MIGRATION_HASH\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Multiple migrations in space \"${violation.spaceId}\" share migrationHash \"${violation.migrationHash}\" (${violation.dirNames.join(\", \")}).`,\n\t\t\tnextActions: [chooseAction(\"Re-emit one of the conflicting packages so each migrationHash is unique\")]\n\t\t};\n\t}\n}\n//#endregion\n//#region src/orm/migration/check.ts\n/**\n* The check completed and the artifacts it read are not internally consistent.\n* The findings ride the envelope as diagnostics; the run itself did its job,\n* which is why this is not an errored settlement.\n*/\nconst FINDINGS_EXIT_CODE = 4;\n/**\n* One integrity failure as an envelope diagnostic. `error` is the honest\n* severity: nothing about the artifacts is merely worth a look, and exit 4\n* makes it legal — the engine refuses a severity-`error` diagnostic only on a\n* run that exits 0.\n*\n* The summary leads with the path because the engine's diagnostic renderer\n* prints `code`, `summary`, `why` and the next actions and never prints\n* `where`. Several failure texts name no package on their own — a hash\n* mismatch reads \"Stored hash X does not match recomputed hash Y\" — so\n* without the path a project with fifty migrations cannot be told which one\n* is broken. `where` still carries the path on its own for a `--json`\n* consumer.\n*/\nfunction failureDiagnostic(failure) {\n\tif (!isStructuredErrorCode(failure.code)) throw new InternalError(`migration check produced the failure code \"${failure.code}\", which is not a dotted NAMESPACE.SUBCODE.`);\n\treturn {\n\t\tcode: failure.code,\n\t\tseverity: \"error\",\n\t\tsummary: `${failure.where}: ${failure.why}`,\n\t\tnextActions: failure.nextActions,\n\t\twhere: { path: failure.where },\n\t\tmeta: { space: failure.space }\n\t};\n}\nfunction checkPresentations(inputs) {\n\tconst summary = inputs.resolvedSpaceId === void 0 ? inputs.document.summary : `${inputs.document.summary} (space: ${inputs.resolvedSpaceId})`;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsRelative\n\t\t\t\t},\n\t\t\t\t...inputs.target === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"target\",\n\t\t\t\t\tvalue: inputs.target\n\t\t\t\t}],\n\t\t\t\t...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]\n\t\t\t]\n\t\t}, {\n\t\t\tkind: \"summary\",\n\t\t\tstatus: inputs.document.ok ? \"ok\" : \"error\",\n\t\t\ttext: summary\n\t\t}],\n\t\tjson: () => inputs.document\n\t};\n}\nconst migrationCheckCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Verify artifact and graph integrity\",\n\t\tdescription: \"Validates that on-disk migration packages are internally consistent\\n(hashes match, manifests are complete) and that the graph is well-formed\\n(edges connect, refs point at valid nodes). The whole-graph check spans\\nevery contract space by default; pass --space <id> to narrow to one. A\\nmigration reference checks a single package, resolved across all contract\\nspaces (narrow with --space; an ambiguous reference cannot be checked).\\nOffline — does not consult the database.\\nExit codes: 0 = all checks passed, 2 = precondition failed (unresolved\\ntarget or unknown --space), 4 = integrity failure(s) found.\",\n\t\texamples: [\n\t\t\t\"migration check\",\n\t\t\t\"migration check --space app\",\n\t\t\t\"migration check 20260101-add-users\",\n\t\t\t\"migration check 20260101-add-users --space app\",\n\t\t\t\"migration check --json\"\n\t\t]\n\t},\n\targs: {\n\t\tpositionals: { target: positional.optionalString({\n\t\t\tbrief: \"Migration reference: directory name, hash/prefix, ref, or path\",\n\t\t\tplaceholder: \"target\"\n\t\t}) },\n\t\tflags: { space: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}) }\n\t},\n\tneeds: { config: ormConfigSection },\n\texitCodes: { 4: \"integrity check found failures\" },\n\thandler: async (args, ctx) => {\n\t\tconst { target } = args.positionals;\n\t\tconst spaceFilter = args.flags.space;\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsDir = appMigrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsRelative = displayPath(appMigrationsDir, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst spaces = await enumerateCheckSpaces(loaded.value.aggregate, migrationsDir, ctx.cwd);\n\t\tlet document;\n\t\tlet resolvedSpaceId;\n\t\tif (target !== void 0) {\n\t\t\tconst outcome = await checkSingleTarget(target, {\n\t\t\t\tspaces,\n\t\t\t\t...ifDefined(\"spaceFilter\", spaceFilter),\n\t\t\t\tappMigrationsDir,\n\t\t\t\tappMigrationsRelative,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (outcome.error !== void 0) return notOk$1(normalizeError(outcome.error));\n\t\t\tconst result = outcome.result;\n\t\t\tif (result === void 0 || outcome.exitCode === 2) return notOk$1(normalizeError(errorMigrationPackageNotFound(result?.summary ?? `Migration package for \"${target}\" not found on disk`)));\n\t\t\tdocument = result;\n\t\t\tresolvedSpaceId = outcome.resolvedSpaceId;\n\t\t} else {\n\t\t\tconst checked = await runMigrationCheck({\n\t\t\t\tspaces,\n\t\t\t\t...ifDefined(\"spaceFilter\", spaceFilter)\n\t\t\t});\n\t\t\tif (!checked.ok) return notOk$1(normalizeError(checked.failure));\n\t\t\tconst violations = await loadAggregateIntegrityViolations(ctx.config, migrationsDir);\n\t\t\tconst scoped = spaceFilter === void 0 ? violations : violations.filter((violation) => violation.kind !== \"disjointness\" && violation.spaceId === spaceFilter);\n\t\t\tconst failures = [...checked.value.failures, ...scoped.map((violation) => integrityViolationToCheckFailure(violation, migrationsDir))];\n\t\t\tdocument = failures.length === 0 ? {\n\t\t\t\tok: true,\n\t\t\t\tfailures: [],\n\t\t\t\tsummary: \"All checks passed\"\n\t\t\t} : {\n\t\t\t\tok: false,\n\t\t\t\tfailures: [...failures],\n\t\t\t\tsummary: `${failures.length} integrity failure(s)`\n\t\t\t};\n\t\t}\n\t\tconst diagnostics = document.failures.map(failureDiagnostic);\n\t\treturn ok$1(ctx.present({\n\t\t\tdata: document,\n\t\t\texitCode: diagnostics.length === 0 ? 0 : FINDINGS_EXIT_CODE,\n\t\t\tdiagnostics\n\t\t}, checkPresentations({\n\t\t\tdocument,\n\t\t\tmigrationsRelative: appMigrationsRelative,\n\t\t\ttarget,\n\t\t\tspace: spaceFilter,\n\t\t\tresolvedSpaceId\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/utils/formatters/migration-graph-sections.ts\n/**\n* One tree per in-scope contract space. Widths are computed across every space\n* first so multi-space sections align with each other.\n*/\nfunction buildMigrationGraphTreeSections(inputs) {\n\tconst { aggregate, scopedSpaces, liveContractHash, glyphMode, colorize } = inputs;\n\tconst showSpaceHeadings = scopedSpaces.length > 1;\n\tconst globalLayoutInputs = showSpaceHeadings ? scopedSpaces.filter((entry) => entry.migrations.length > 0).flatMap((entry) => {\n\t\tconst graph = aggregate.space(entry.space)?.graph();\n\t\treturn graph === void 0 ? [] : [{\n\t\t\tgraph,\n\t\t\tliveContractHash\n\t\t}];\n\t}) : [];\n\tconst globalMaxEdgeTreePrefixWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxEdgeTreePrefixWidth(globalLayoutInputs) : void 0;\n\tconst globalMaxDirNameWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxDirNameWidth(globalLayoutInputs) : void 0;\n\tconst sections = [];\n\tfor (const entry of scopedSpaces) {\n\t\tconst space = aggregate.space(entry.space);\n\t\tif (space === void 0) continue;\n\t\tconst tree = entry.migrations.length === 0 ? \"\" : renderMigrationGraphSpaceTree({\n\t\t\tgraph: space.graph(),\n\t\t\tmigrations: entry.migrations,\n\t\t\tliveContractHash,\n\t\t\tglyphMode,\n\t\t\tcolorize,\n\t\t\tisAppSpace: entry.space === aggregate.app.spaceId,\n\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\t...inputs.styler !== void 0 ? { styler: inputs.styler } : {},\n\t\t\t...inputs.palette !== void 0 ? { palette: inputs.palette } : {},\n\t\t\t...globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth } : {},\n\t\t\t...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}\n\t\t});\n\t\tsections.push({\n\t\t\tspace: entry.space,\n\t\t\ttree: showSpaceHeadings && tree.length > 0 ? indentMigrationGraphTreeBlock(tree, \" \") : tree,\n\t\t\tshowHeading: showSpaceHeadings\n\t\t});\n\t}\n\treturn sections;\n}\n/** The rendered tree, headings and summary as one block of lines. */\nfunction renderMigrationGraphSections(sections, summary) {\n\tconst lines = [];\n\tfor (const section of sections) {\n\t\tif (section.showHeading) lines.push(`${section.space}:`);\n\t\tlines.push(section.tree.length > 0 ? section.tree : \"(no migrations)\");\n\t\tlines.push(\"\");\n\t}\n\tlines.push(summary);\n\treturn lines.join(\"\\n\").trimEnd();\n}\n/**\n* Graphviz DOT for the app graph. Node ids are truncated to 12 characters,\n* which is a collision hazard recorded and preserved by the port.\n*/\nfunction renderMigrationGraphDot(graph) {\n\tconst lines = [\"digraph migrations {\"];\n\tfor (const edge of graph.migrationByHash.values()) lines.push(` \"${edge.from.slice(0, 12)}\" -> \"${edge.to.slice(0, 12)}\" [label=\"${edge.dirName}\"];`);\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\n//#endregion\n//#region src/orm/migration/graph.ts\n/**\n* The tree is a drawing for a reader; the DOT document is a graph description\n* for another program, so it is also the stdout payload. It appears in both\n* surfaces because the engine treats the payload as a mirror of the human\n* output: on one shared screen it suppresses the stdout copy, so the human\n* block is what keeps `--dot` visible there, while split sinks receive both.\n*/\nfunction graphPresentations(inputs) {\n\tconst { tree, dot, legend } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t}, ...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]]\n\t\t\t},\n\t\t\t...tree === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(tree)\n\t\t\t}],\n\t\t\t...dot === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: dot.split(\"\\n\")\n\t\t\t}],\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}]\n\t\t],\n\t\t...dot === void 0 ? {} : { stdout: () => dot.split(\"\\n\") },\n\t\tjson: () => inputs.document\n\t};\n}\nfunction graphSummary(spaces) {\n\tconst contracts = spaces.reduce((count, space) => count + space.contracts.length, 0);\n\tconst migrations = spaces.reduce((count, space) => count + space.migrations.length, 0);\n\treturn `${spaces.length} space(s), ${contracts} contract(s), ${migrations} migration(s)`;\n}\nconst migrationGraphCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show the migration graph topology\",\n\t\tdescription: \"Renders the migration graph topology. Offline — does not consult the\\ndatabase. --ascii swaps box-drawing for pipe-friendly ASCII glyphs.\\n--dot emits Graphviz DOT for the app graph instead of the tree, and\\nignores --space; in json mode the result carries the DOT text alongside\\nthe graph document.\",\n\t\texamples: [\n\t\t\t\"migration graph\",\n\t\t\t\"migration graph --json\",\n\t\t\t\"migration graph --dot\",\n\t\t\t\"migration graph --ascii\",\n\t\t\t\"migration graph --legend\",\n\t\t\t\"migration graph --space app\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tdot: flag.boolean({ brief: \"Emit Graphviz DOT for the app graph\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" }),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tif (args.flags.legend && args.flags.dot) return notOk$1(normalizeError(errorLegendHumanOnly(\"--dot\")));\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk$1(normalizeError(listed.failure));\n\t\tconst scopedSpaces = listed.value.spaces;\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst graphSpaces = [...buildMigrationSpaceGraphEntries({\n\t\t\taggregate,\n\t\t\tscopedSpaces\n\t\t})];\n\t\tconst summary = graphSummary(graphSpaces);\n\t\tconst graphDocument = {\n\t\t\tok: true,\n\t\t\tspaces: graphSpaces,\n\t\t\tsummary\n\t\t};\n\t\tconst dot = args.flags.dot ? renderMigrationGraphDot(aggregate.app.graph()) : void 0;\n\t\tconst document = dot === void 0 ? graphDocument : {\n\t\t\t...graphDocument,\n\t\t\tdot\n\t\t};\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst tree = dot === void 0 ? renderMigrationGraphSections(buildMigrationGraphTreeSections({\n\t\t\taggregate,\n\t\t\tscopedSpaces,\n\t\t\tliveContractHash,\n\t\t\tglyphMode,\n\t\t\tcolorize: true,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}), styler.summary(summary)) : void 0;\n\t\tconst legend = args.flags.legend ? renderMigrationGraphLegend({\n\t\t\tcolorize: true,\n\t\t\tglyphMode,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}) : void 0;\n\t\treturn ok$1(ctx.present({ data: document }, graphPresentations({\n\t\t\tdocument,\n\t\t\ttree,\n\t\t\tdot,\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tspace: args.flags.space,\n\t\t\tlegend\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/list.ts\nfunction listPresentations$1(inputs) {\n\tconst legend = inputs.legend;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t}, ...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(inputs.tree)\n\t\t\t},\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}]\n\t\t],\n\t\tjson: () => inputs.list\n\t};\n}\nconst migrationListCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"List on-disk migrations per contract space\",\n\t\tdescription: \"Enumerates every on-disk migration under migrations/<space>/ for every\\ncontract space found on disk. Offline — does not consult the database.\\nHuman output draws the shared migration graph tree with operation counts,\\ninvariants on each migration row, and refs on destination contract nodes.\\nPass --space <id> to narrow to one contract space. --ascii forces ASCII\\ntree glyphs.\",\n\t\texamples: [\n\t\t\t\"migration list\",\n\t\t\t\"migration list --space app\",\n\t\t\t\"migration list --ascii\",\n\t\t\t\"migration list --legend\",\n\t\t\t\"migration list --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tascii: flag.boolean({ brief: \"Use ASCII kind glyphs (pipe-friendly)\" }),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk$1(normalizeError(listed.failure));\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst tree = renderMigrationListWithStyle(listed.value, styler, glyphMode, {\n\t\t\tcolorize: true,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE,\n\t\t\tliveContractHash,\n\t\t\tgraphForSpace: (spaceId) => aggregate.space(spaceId)?.graph(),\n\t\t\tappSpaceId: aggregate.app.spaceId\n\t\t});\n\t\tconst legend = args.flags.legend ? renderMigrationGraphLegend({\n\t\t\tcolorize: true,\n\t\t\tglyphMode,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}) : void 0;\n\t\treturn ok$1(ctx.present({ data: listed.value }, listPresentations$1({\n\t\t\tlist: listed.value,\n\t\t\ttree,\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tspace: args.flags.space,\n\t\t\tlegend\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/utils/formatters/migration-log-table.ts\nfunction sortLedgerEntries(entries) {\n\treturn [...entries].sort((left, right) => {\n\t\tconst timeDiff = left.appliedAt.getTime() - right.appliedAt.getTime();\n\t\tif (timeDiff !== 0) return timeDiff;\n\t\tconst spaceDiff = left.space.localeCompare(right.space);\n\t\tif (spaceDiff !== 0) return spaceDiff;\n\t\treturn left.migrationName.localeCompare(right.migrationName);\n\t});\n}\nfunction pad2(value) {\n\treturn String(value).padStart(2, \"0\");\n}\nfunction formatLedgerAppliedAt(date, mode) {\n\tif (mode === \"iso\") return date.toISOString();\n\tif (mode === \"utc\") return `${date.getUTCFullYear()}-${pad2(date.getUTCMonth() + 1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}:${pad2(date.getUTCSeconds())}Z`;\n\tconst offsetMinutes = -date.getTimezoneOffset();\n\tconst sign = offsetMinutes >= 0 ? \"+\" : \"-\";\n\tconst absoluteOffset = Math.abs(offsetMinutes);\n\tconst offsetHours = pad2(Math.floor(absoluteOffset / 60));\n\tconst offsetMins = pad2(absoluteOffset % 60);\n\treturn `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())} ${pad2(date.getHours())}:${pad2(date.getMinutes())}:${pad2(date.getSeconds())} ${sign}${offsetHours}:${offsetMins}`;\n}\nfunction styleHashTransition(from, to, styler, glyphMode = \"unicode\") {\n\treturn `${from === null ? styler.glyph(migrationListEmptySource(glyphMode)) : styler.sourceHash(abbreviateContractHash(from))} ${styler.glyph(migrationListForwardArrow(glyphMode))} ${styler.destHash(abbreviateContractHash(to))}`;\n}\nfunction serializeLedgerEntriesForJson(entries) {\n\treturn sortLedgerEntries(entries).map((entry) => ({\n\t\tspace: entry.space,\n\t\tname: entry.migrationName,\n\t\thash: entry.migrationHash,\n\t\tfromContract: entry.from,\n\t\ttoContract: entry.to,\n\t\tappliedAt: formatLedgerAppliedAt(entry.appliedAt, \"iso\"),\n\t\toperationCount: entry.operationCount\n\t}));\n}\nconst MIGRATION_LOG_EMPTY_MESSAGE = \"No migrations have been applied to this database.\";\n//#endregion\n//#region src/orm/migration/log.ts\nconst HEADING_APPLIED_AT = \"Applied at\";\nconst HEADING_SPACE = \"Space\";\nconst HEADING_MIGRATION = \"Migration\";\nconst HEADING_CHANGE = \"Change\";\nconst HEADING_OPS = \"Ops\";\n/**\n* The ledger laid out for the engine to size. The Space heading appears only\n* when more than one contract space has run, as it does in the commander shell.\n*/\nfunction ledgerGrid(entries, options) {\n\tconst styler = createToneMigrationListStyler();\n\tconst sorted = sortLedgerEntries(entries);\n\tconst showSpace = new Set(sorted.map((entry) => entry.space)).size > 1;\n\tconst headings = [HEADING_APPLIED_AT];\n\tif (showSpace) headings.push(HEADING_SPACE);\n\theadings.push(HEADING_MIGRATION, HEADING_CHANGE, HEADING_OPS);\n\treturn {\n\t\theadings,\n\t\trows: sorted.map((entry) => {\n\t\t\tconst cells = [formatLedgerAppliedAt(entry.appliedAt, options.utc ? \"utc\" : \"local\")];\n\t\t\tif (showSpace) cells.push(entry.space);\n\t\t\tcells.push(toneSpans(styler.dirName(entry.migrationName)), toneSpans(styleHashTransition(entry.from, entry.to, styler, options.glyphMode)), `${entry.operationCount} ops`);\n\t\t\treturn cells;\n\t\t})\n\t};\n}\nfunction logPresentations(inputs) {\n\tconst grid = inputs.grid;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [...inputs.database === void 0 ? [] : [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: inputs.database\n\t\t\t}]\n\t\t}], ...grid === void 0 ? [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: MIGRATION_LOG_EMPTY_MESSAGE\n\t\t}] : [{\n\t\t\tkind: \"table\",\n\t\t\tcolumns: grid.headings,\n\t\t\trows: grid.rows\n\t\t}]],\n\t\tjson: () => inputs.document\n\t};\n}\nconst migrationLogCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show executed migration history\",\n\t\tdescription: \"Reads the database ledger and displays every applied migration edge in\\nchronological order, including rollbacks and re-applies, merged across\\nall contract spaces. Requires a database connection.\",\n\t\texamples: [\n\t\t\t\"migration log\",\n\t\t\t\"migration log --db $DATABASE_URL\",\n\t\t\t\"migration log --utc\",\n\t\t\t\"migration log --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tdb: dbFlag,\n\t\tutc: flag.boolean({ brief: \"Render human timestamps in UTC instead of local time\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\tconst missingDb = requireLiveDatabase({\n\t\t\tdbConnection,\n\t\t\thasDriver: ctx.config.driver !== void 0,\n\t\t\twhy: \"migration log needs a database connection and driver to read the ledger (set db.connection in prisma.config.ts, or pass --db <url>)\",\n\t\t\tcommandName: \"migration log\"\n\t\t});\n\t\tif (missingDb !== null) return notOk$1(normalizeError(missingDb));\n\t\tif (!targetSupportsMigrations(ctx.config.target)) return notOk$1(normalizeError(errorTargetMigrationNotSupported({ why: \"migration log reads the ledger a migration runner writes, and the configured target provides no runner.\" })));\n\t\tconst client = createControlClient({\n\t\t\tfamily: ctx.config.family,\n\t\t\ttarget: ctx.config.target,\n\t\t\tadapter: ctx.config.adapter,\n\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\textensions: ctx.config.extensions ?? []\n\t\t});\n\t\tlet entries;\n\t\ttry {\n\t\t\tawait client.connect(dbConnection);\n\t\t\tentries = await client.readLedger();\n\t\t} catch (error) {\n\t\t\treturn notOk$1(normalizeError(mapCaughtMigrationError(error) ?? errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read migration log: ${error instanceof Error ? error.message : String(error)}` })));\n\t\t} finally {\n\t\t\tawait closeQuietly(client);\n\t\t}\n\t\tconst records = serializeLedgerEntriesForJson(entries);\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\trecords,\n\t\t\tsummary: `${records.length} migration(s) applied`\n\t\t};\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\treturn ok$1(ctx.present({ data: document }, logPresentations({\n\t\t\tdocument,\n\t\t\tgrid: entries.length === 0 ? void 0 : ledgerGrid(entries, {\n\t\t\t\tutc: args.flags.utc,\n\t\t\t\tglyphMode\n\t\t\t}),\n\t\t\tdatabase: typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/new.ts\nfunction newPresentations(inputs) {\n\tconst { document } = inputs;\n\tconst migrationTs = join(document.dir, \"migration.ts\");\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.appMigrationsRelative\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: document.summary\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: document.from === null ? [{\n\t\t\t\t\t\ttext: \"(baseline)\",\n\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t}] : [{\n\t\t\t\t\t\ttext: document.from,\n\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t}]\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: [{\n\t\t\t\t\t\ttext: document.to,\n\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t}]\n\t\t\t\t}]\n\t\t\t}\n\t\t],\n\t\tjson: () => document,\n\t\tnext: () => [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: `Write the migration body in ${migrationTs}`\n\t\t}, runCommandAction(\"Run it to self-emit ops.json and attest the package\", `node \"${migrationTs}\"`)]\n\t};\n}\nconst migrationNewCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Scaffold a new migration for manual authoring\",\n\t\tdescription: \"Creates a migration package with a migration.ts file for manual authoring.\\nWrite the migration body in migration.ts, then run the file with Node\\n(`node migration.ts`) to self-emit ops.json and attest the package.\\nOffline — does not consult the database.\",\n\t\texamples: [\n\t\t\t\"migration new --name split-name\",\n\t\t\t\"migration new --name custom-fk --from abc123\",\n\t\t\t\"migration new --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tname: flag.string({\n\t\t\tbrief: \"Migration name (used in directory name)\",\n\t\t\tplaceholder: \"slug\"\n\t\t}),\n\t\tfrom: flag.string({\n\t\t\tbrief: \"Starting contract hash (default: latest migration target)\",\n\t\t\tplaceholder: \"hash\"\n\t\t})\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst scaffolded = await executeMigrationNewCommand({\n\t\t\tconfig: ctx.config,\n\t\t\tcwd: ctx.cwd,\n\t\t\tconfigPath: projectConfigPathFor(ctx.cwd),\n\t\t\t...ifDefined(\"name\", args.flags.name),\n\t\t\t...ifDefined(\"from\", args.flags.from)\n\t\t});\n\t\tif (!scaffolded.ok) return notOk$1(normalizeError(scaffolded.failure));\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\treturn ok$1(ctx.present({ data: scaffolded.value }, newPresentations({\n\t\t\tdocument: scaffolded.value,\n\t\t\tcontractPath: contractPath === void 0 ? \"(unset)\" : displayPath(contractPath, ctx.cwd),\n\t\t\tappMigrationsRelative: displayPath(appMigrationsDirFor(ctx.config, ctx.cwd), ctx.cwd)\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/plan.ts\nfunction hashRow(label, hash) {\n\treturn {\n\t\tlabel,\n\t\tvalue: hash === null ? [{\n\t\t\ttext: \"(baseline)\",\n\t\t\ttone: \"muted\"\n\t\t}] : [{\n\t\t\ttext: hash,\n\t\t\ttone: \"identifier\"\n\t\t}]\n\t};\n}\n/**\n* Where the run put things: the contract edge it planned, then every directory\n* it wrote — the app-space package, the auto-baseline package that precedes it,\n* and any extension-space package the seed phase materialised.\n*/\nfunction outcomeFields(result, migrationsRelative) {\n\treturn {\n\t\tkind: \"fields\",\n\t\trows: [\n\t\t\thashRow(\"from\", result.from),\n\t\t\thashRow(\"to\", result.to),\n\t\t\t...result.baselineDir === void 0 ? [] : [{\n\t\t\t\tlabel: \"baseline\",\n\t\t\t\tvalue: result.baselineDir\n\t\t\t}],\n\t\t\t...result.dir === void 0 ? [] : [{\n\t\t\t\tlabel: \"app space\",\n\t\t\t\tvalue: result.dir\n\t\t\t}],\n\t\t\t...result.emittedExtensionDirs.map((entry) => ({\n\t\t\t\tlabel: `space ${entry.spaceId}`,\n\t\t\t\tvalue: join(migrationsRelative, entry.spaceId, entry.dirName)\n\t\t\t}))\n\t\t]\n\t};\n}\nfunction operationNodes$1(result) {\n\treturn result.operations.map((operation) => operation.operationClass === \"destructive\" ? {\n\t\tlabel: operation.label,\n\t\tstatus: \"warn\"\n\t} : { label: operation.label });\n}\nfunction operationBlocks$1(result) {\n\tif (result.operations.length === 0) return [];\n\tconst destructive = result.operations.some((operation) => operation.operationClass === \"destructive\");\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: [{\n\t\t\tlabel: result.dir ?? \"operations\",\n\t\t\tchildren: operationNodes$1(result)\n\t\t}]\n\t}, ...destructive ? [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"This migration contains destructive operations that may cause data loss.\"\n\t}] : []];\n}\n/** Statements a database would run, printed verbatim rather than laid out. */\nfunction previewBlocks$1(result) {\n\tconst preview = result.preview;\n\tif (preview === void 0) return [];\n\tconst statements = preview.statements.map((statement) => statement.text.trim()).filter((text) => text.length > 0).map((text) => text.endsWith(\";\") ? text : `${text};`);\n\tif (statements.length === 0) return [];\n\treturn [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: previewBlockHeader(preview)\n\t}, {\n\t\tkind: \"drawing\",\n\t\tlines: statements\n\t}];\n}\nfunction planBlocks(result, migrationsRelative) {\n\tconst outcome = outcomeFields(result, migrationsRelative);\n\tif (result.noOp) return [{\n\t\tkind: \"summary\",\n\t\tstatus: \"ok\",\n\t\ttext: \"No changes detected\"\n\t}, outcome];\n\tif (result.pendingPlaceholders === true) return [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: result.summary\n\t}, outcome];\n\treturn [\n\t\t{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: result.summary\n\t\t},\n\t\t...operationBlocks$1(result),\n\t\toutcome,\n\t\t...previewBlocks$1(result)\n\t];\n}\nfunction planNextActions(result, migrationsRelative) {\n\tif (result.pendingPlaceholders === true) {\n\t\tconst migrationTs = join(result.dir ?? \"<dir>\", \"migration.ts\");\n\t\treturn [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: `Replace each placeholder(...) call in ${migrationTs} with your query`\n\t\t}, runCommandAction(\"Run it to self-emit ops.json and attest the package\", `node \"${migrationTs}\"`)];\n\t}\n\tconst written = [\n\t\t...result.baselineDir === void 0 ? [] : [result.baselineDir],\n\t\t...result.dir === void 0 ? [] : [result.dir],\n\t\t...result.emittedExtensionDirs.map((entry) => join(migrationsRelative, entry.spaceId, entry.dirName))\n\t];\n\tif (written.length === 0) return [];\n\treturn [{\n\t\tkind: \"edit-file\",\n\t\tlabel: `Review ${written.join(\" and \")}`\n\t}, runCommandAction(\"Apply the migration\", \"prisma-cli migrate\")];\n}\nfunction planPresentations(inputs) {\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.appMigrationsRelative\n\t\t\t\t},\n\t\t\t\t...inputs.from === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: inputs.from\n\t\t\t\t}],\n\t\t\t\t...inputs.to === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: inputs.to\n\t\t\t\t}],\n\t\t\t\t...inputs.name === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"name\",\n\t\t\t\t\tvalue: inputs.name\n\t\t\t\t}]\n\t\t\t]\n\t\t}, ...planBlocks(inputs.document, inputs.migrationsRelative)],\n\t\tjson: () => inputs.document,\n\t\tnext: () => planNextActions(inputs.document, inputs.migrationsRelative)\n\t};\n}\nconst migrationPlanCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Plan a migration from contract changes\",\n\t\tdescription: \"Compares the emitted contract against the latest on-disk migration state\\nand produces a new migration package with the required operations.\\nOffline — does not consult the database.\",\n\t\texamples: [\n\t\t\t\"migration plan\",\n\t\t\t\"migration plan --name add-users-table\",\n\t\t\t\"migration plan --to <migration-dir>^ --name rollback\",\n\t\t\t\"migration plan --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tname: flag.string({\n\t\t\tbrief: \"Name slug for the migration directory\",\n\t\t\tplaceholder: \"slug\"\n\t\t}),\n\t\tfrom: flag.string({\n\t\t\tbrief: \"Starting contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\",\n\t\t\tplaceholder: \"contract\"\n\t\t}),\n\t\tto: flag.string({\n\t\t\tbrief: \"Destination contract reference; defaults to the emitted contract. Same grammar as --from\",\n\t\t\tplaceholder: \"contract\"\n\t\t})\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst seeded = (record) => {\n\t\t\tif (record.action !== \"updated\") return;\n\t\t\tconst step = `Seed contract space ${record.spaceId}`;\n\t\t\tctx.report({\n\t\t\t\tkind: \"step-started\",\n\t\t\t\tstep,\n\t\t\t\tid: record.spaceId\n\t\t\t});\n\t\t\tctx.report({\n\t\t\t\tkind: \"step-finished\",\n\t\t\t\tstep,\n\t\t\t\tid: record.spaceId,\n\t\t\t\toutcome: \"ok\",\n\t\t\t\tdata: {\n\t\t\t\t\tnewHash: record.newHash,\n\t\t\t\t\tnewMigrationDirs: record.newMigrationDirs\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tconst planned = await executeMigrationPlanCommand({\n\t\t\tconfig: ctx.config,\n\t\t\tcwd: ctx.cwd,\n\t\t\tconfigPath: projectConfigPathFor(ctx.cwd),\n\t\t\t...ifDefined(\"name\", args.flags.name),\n\t\t\t...ifDefined(\"from\", args.flags.from),\n\t\t\t...ifDefined(\"to\", args.flags.to)\n\t\t}, Date.now(), { onSeeded: seeded });\n\t\tif (!planned.ok) return notOk$1(normalizeError(planned.failure));\n\t\tctx.report({\n\t\t\tkind: \"message\",\n\t\t\tseverity: \"verbose\",\n\t\t\ttext: `Total time: ${planned.value.timings.total}ms`\n\t\t});\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\treturn ok$1(ctx.present({ data: planned.value }, planPresentations({\n\t\t\tdocument: planned.value,\n\t\t\tcontractPath: contractPath === void 0 ? \"(unset)\" : displayPath(contractPath, ctx.cwd),\n\t\t\tappMigrationsRelative: displayPath(appMigrationsDirFor(ctx.config, ctx.cwd), ctx.cwd),\n\t\t\tmigrationsRelative: displayPath(migrationsDirFor(ctx.config, ctx.cwd), ctx.cwd),\n\t\t\tfrom: args.flags.from,\n\t\t\tto: args.flags.to,\n\t\t\tname: args.flags.name\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/show.ts\n/** One node per operation, the destructive ones carrying the warning glyph. */\nfunction operationNodes(migration) {\n\treturn migration.operations.map((operation) => operation.operationClass === \"destructive\" ? {\n\t\tlabel: operation.label,\n\t\tstatus: \"warn\"\n\t} : { label: operation.label });\n}\nfunction operationBlocks(migration) {\n\tif (migration.operations.length === 0) return [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttext: \"No operations.\"\n\t}];\n\tconst destructive = migration.operations.some((operation) => operation.operationClass === \"destructive\");\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: [{\n\t\t\tlabel: `${migration.operations.length} operation(s)`,\n\t\t\tchildren: operationNodes(migration)\n\t\t}]\n\t}, ...destructive ? [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"This migration contains destructive operations that may cause data loss.\"\n\t}] : []];\n}\n/**\n* The statement preview: text a database would run, printed verbatim rather\n* than laid out, so nothing is re-wrapped between here and the reader.\n*/\nfunction previewBlocks(migration) {\n\tconst statements = migration.preview.statements.map((statement) => renderPreviewStatement(statement.text, statement.language)).filter((text) => text !== void 0);\n\tif (statements.length === 0) return [];\n\treturn [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: previewBlockHeader(migration.preview)\n\t}, {\n\t\tkind: \"drawing\",\n\t\tlines: statements\n\t}];\n}\nfunction showPresentations(inputs) {\n\tconst migration = inputs.document.migration;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.appMigrationsRelative\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"target\",\n\t\t\t\t\t\tvalue: inputs.target\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: [{\n\t\t\t\t\ttext: migration.name,\n\t\t\t\t\ttone: \"emphasis\"\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\t\tvalue: migration.fromContract === null ? [{\n\t\t\t\t\t\t\ttext: \"(baseline)\",\n\t\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t\t}] : [{\n\t\t\t\t\t\t\ttext: migration.fromContract,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.toContract,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"hash\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.hash,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"created\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.createdAt,\n\t\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t...operationBlocks(migration),\n\t\t\t...previewBlocks(migration)\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\n/**\n* A path-looking target must land inside `migrations/app/`; anything else is a\n* migration reference resolved against the app graph and refs. Both routes are\n* app-space only, as they are today.\n*/\nfunction resolvePackage(inputs) {\n\tif (looksLikePath(inputs.target)) {\n\t\tconst path = resolveAppTargetPath(inputs.cwd, inputs.target, inputs.appMigrationsDir, inputs.appMigrationsRelative);\n\t\tif (!path.ok) return notOk$1(normalizeError(path.failure));\n\t\tconst matched = findPackageByDirPath(inputs.packages, path.value);\n\t\treturn matched === void 0 ? notOk$1(normalizeError(errorMigrationPackageNotFound(`No loaded migration package at ${relative(inputs.cwd, path.value)}`))) : ok$1(matched);\n\t}\n\tif (inputs.packages.length === 0) return notOk$1(normalizeError(errorNoMigrations(inputs.appMigrationsRelative)));\n\tconst ref = resolveMigrationRef(inputs.target, {\n\t\tgraph: inputs.graph,\n\t\trefs: inputs.refs\n\t});\n\tif (!ref.ok) return notOk$1(normalizeError(ref.failure));\n\tconst matched = inputs.packages.find((candidate) => candidate.metadata.migrationHash === ref.value.migrationHash);\n\treturn matched === void 0 ? notOk$1(normalizeError(errorMigrationPackageNotFound(`Resolved migration \"${ref.value.dirName}\" but the package was not loaded`))) : ok$1(matched);\n}\nconst migrationShowCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Display migration package contents\",\n\t\tdescription: \"Shows the operations, statement preview, and metadata for one app-space\\nmigration. Accepts a directory path, directory name, or hash prefix.\\nOffline — does not consult the database.\",\n\t\texamples: [\n\t\t\t\"migration show 20260101_100000_add_user\",\n\t\t\t\"migration show a1b2c3\",\n\t\t\t\"migration show migrations/app/20260101_100000_add_user\",\n\t\t\t\"migration show 20260101_100000_add_user --json\"\n\t\t]\n\t},\n\targs: { positionals: { target: positional.string({\n\t\tbrief: \"Migration reference: directory name, hash/prefix, ref, or path\",\n\t\tplaceholder: \"target\"\n\t}) } },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst { target } = args.positionals;\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\tif (contractPath === void 0) return notOk$1(normalizeError(errorConfigValidation(\"contract.output\", {\n\t\t\twhy: \"migration show reads the emitted contract from config.contract.output; the config has no value to read.\",\n\t\t\tsection: \"contract\"\n\t\t})));\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsDir = appMigrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsRelative = displayPath(appMigrationsDir, ctx.cwd);\n\t\tlet contractJson;\n\t\ttry {\n\t\t\tcontractJson = await readFile(contractPath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\treturn notOk$1(normalizeError(Reflect.get(Object(error), \"code\") === \"ENOENT\" ? errorFileNotFound(contractPath, {\n\t\t\t\twhy: `Contract file not found at ${contractPath}`,\n\t\t\t\tfix: `Run \\`prisma-cli contract emit\\` to generate ${relative(ctx.cwd, contractPath)}`\n\t\t\t}) : errorUnexpected(error instanceof Error ? error.message : String(error), { why: \"Failed to read contract file\" })));\n\t\t}\n\t\tconst familyInstance = ctx.config.family.create(createControlStack(ctx.config));\n\t\tlet appContract;\n\t\ttry {\n\t\t\tappContract = familyInstance.deserializeContract(castAs(JSON.parse(contractJson)));\n\t\t} catch (error) {\n\t\t\treturn notOk$1(normalizeError(errorContractValidationFailed(`Contract at ${contractPath} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPath } })));\n\t\t}\n\t\tconst loaded = await loadContractSpaceAggregateForCli({\n\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\tmigrationsDir,\n\t\t\tappContract,\n\t\t\textensions: [],\n\t\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t\t});\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst aggregate = loaded.value;\n\t\tconst resolved = resolvePackage({\n\t\t\ttarget,\n\t\t\tcwd: ctx.cwd,\n\t\t\tappMigrationsDir,\n\t\t\tappMigrationsRelative,\n\t\t\tpackages: aggregate.app.packages,\n\t\t\tgraph: aggregate.app.graph(),\n\t\t\trefs: aggregate.app.refs\n\t\t});\n\t\tif (!resolved.ok) return notOk$1(resolved.failure);\n\t\tconst pkg = resolved.value;\n\t\tconst client = createControlClient({\n\t\t\tfamily: ctx.config.family,\n\t\t\ttarget: ctx.config.target,\n\t\t\tadapter: ctx.config.adapter,\n\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\textensions: ctx.config.extensions ?? []\n\t\t});\n\t\tconst ops = castAs(pkg.ops);\n\t\tconst preview = client.toOperationPreview(ops) ?? { statements: [] };\n\t\tconst migration = {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tname: pkg.dirName,\n\t\t\thash: pkg.metadata.migrationHash,\n\t\t\tfromContract: pkg.metadata.from,\n\t\t\ttoContract: pkg.metadata.to,\n\t\t\tcreatedAt: pkg.metadata.createdAt,\n\t\t\toperations: ops.map((op) => ({\n\t\t\t\tid: op.id,\n\t\t\t\tlabel: op.label,\n\t\t\t\toperationClass: op.operationClass\n\t\t\t})),\n\t\t\tpreview: { statements: [...preview.statements] }\n\t\t};\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\tsummary: `Migration ${migration.name} in ${migration.space}: ${migration.operations.length} operation(s)`,\n\t\t\tmigration\n\t\t};\n\t\treturn ok$1(ctx.present({ data: document }, showPresentations({\n\t\t\tdocument,\n\t\t\tcontractPath: displayPath(contractPath, ctx.cwd),\n\t\t\tappMigrationsRelative,\n\t\t\ttarget\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/status-findings.ts\nconst EMIT_CONTRACT = runCommandAction(\"Regenerate the contract\", \"prisma-cli contract emit\");\nfunction contractUnreadableFinding(reason) {\n\tconst message = `Could not read contract: ${reason}`;\n\treturn {\n\t\tdocument: {\n\t\t\tcode: \"CONTRACT.UNREADABLE\",\n\t\t\tseverity: \"warn\",\n\t\t\tmessage,\n\t\t\thints: [\"Run 'prisma-cli contract emit' to generate a valid contract\"]\n\t\t},\n\t\tdiagnostic: {\n\t\t\tcode: \"CONTRACT.UNREADABLE\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: message,\n\t\t\twhy: \"The status tree falls back to the on-disk migration graph when the emitted contract cannot be read.\",\n\t\t\tnextActions: [EMIT_CONTRACT]\n\t\t}\n\t};\n}\nfunction markerNotInHistoryFinding(space) {\n\tconst message = `Database was updated outside the migration system (marker for space \"${space}\" does not match any migration)`;\n\treturn {\n\t\tdocument: {\n\t\t\tcode: \"MIGRATION.MARKER_NOT_IN_HISTORY\",\n\t\t\tseverity: \"warn\",\n\t\t\tmessage,\n\t\t\thints: [\"Run 'prisma-cli db sign' to overwrite the marker if the database already matches the contract\", \"Run 'prisma-cli db update' to push the current contract to the database\"]\n\t\t},\n\t\tdiagnostic: {\n\t\t\tcode: \"MIGRATION.MARKER_NOT_IN_HISTORY\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: message,\n\t\t\twhy: \"The marker the database carries names no contract in the on-disk migration graph.\",\n\t\t\tmeta: { space },\n\t\t\tnextActions: [runCommandAction(\"Overwrite the marker if the database already matches the contract\", \"prisma-cli db sign\"), runCommandAction(\"Or push the current contract to the database\", \"prisma-cli db update\")]\n\t\t}\n\t};\n}\nfunction missingInvariantsFinding(inputs) {\n\tconst message = `missing invariant(s): ${inputs.missing.join(\", \")}`;\n\treturn {\n\t\tdocument: {\n\t\t\tcode: \"MIGRATION.MISSING_INVARIANTS\",\n\t\t\tseverity: \"warn\",\n\t\t\t...ifDefined(\"ref\", inputs.refName),\n\t\t\tinvariants: [...inputs.missing],\n\t\t\tmessage\n\t\t},\n\t\tdiagnostic: {\n\t\t\tcode: \"MIGRATION.MISSING_INVARIANTS\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: message,\n\t\t\twhy: inputs.refName === void 0 ? \"The database marker does not carry every invariant the target requires.\" : `The database marker does not carry every invariant \\`${inputs.refName}\\` requires.`,\n\t\t\tnextActions: [runCommandAction(\"Apply the migrations that provide them\", \"prisma-cli migrate\")],\n\t\t\tmeta: {\n\t\t\t\tinvariants: [...inputs.missing],\n\t\t\t\t...ifDefined(\"ref\", inputs.refName)\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/orm/migration/status.ts\nconst SHORT_HASH_LENGTH = 12;\nfunction shortDisplayHash(hash) {\n\treturn hash.slice(0, SHORT_HASH_LENGTH);\n}\nconst NO_DATABASE_STATE = {\n\tmarkersBySpace: /* @__PURE__ */ new Map(),\n\tledgersBySpace: /* @__PURE__ */ new Map()\n};\nasync function readDatabaseState(inputs) {\n\tconst { client } = inputs;\n\ttry {\n\t\tawait client.connect(inputs.connection);\n\t\tconst markersBySpace = new Map(await client.readAllMarkers());\n\t\tconst ledgersBySpace = /* @__PURE__ */ new Map();\n\t\tfor (const spaceId of inputs.spaceIds) ledgersBySpace.set(spaceId, await client.readLedger(spaceId));\n\t\treturn ok$1({\n\t\t\tmarkersBySpace,\n\t\t\tledgersBySpace\n\t\t});\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(CliStructuredError$1.is(error) ? error : errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read database state: ${error instanceof Error ? error.message : String(error)}` })));\n\t} finally {\n\t\tawait closeQuietly(client);\n\t}\n}\nfunction buildNoPathSummary(args) {\n\tconst markerPart = args.markerHash !== void 0 ? `the database state (${shortDisplayHash(args.markerHash)})` : \"the database state\";\n\tconst targetShort = shortDisplayHash(args.targetHash);\n\tif (!args.explicitTarget) return `No migration path from ${markerPart} to the application's contract (${targetShort}). Run \\`prisma-cli migration plan --name <name>\\` to author one.`;\n\treturn `No migration path from ${markerPart} to ${args.refName !== void 0 ? `the target (${targetShort} via \\`${args.refName}\\`)` : `the target (${targetShort})`}. Run \\`prisma-cli migration plan --name <name>\\` to author one, or pass \\`--to <contract>\\` to pick a reachable target.`;\n}\nfunction buildStatusHeadline(args) {\n\tif (args.markerDiverged && args.markerHash !== void 0) return `Database marker ${shortDisplayHash(args.markerHash)} is not in the on-disk migration graph`;\n\tif (args.pendingCount === 0) return \"Up to date\";\n\treturn `${args.pendingCount} pending — run \\`prisma-cli migrate --to ${shortDisplayHash(args.targetHash)}\\``;\n}\n/**\n* One space's section: its heading, where more than one space is in scope, on\n* top of its tree. Heading and tree are one drawing so the heading stays a\n* bare label — a `summary` would put a status glyph in front of it.\n*/\nfunction sectionBlock(section) {\n\tconst heading = section.showHeading ? [[{\n\t\ttext: `${section.space}:`,\n\t\ttone: \"heading\"\n\t}]] : [];\n\tconst body = section.tree.length === 0 ? [[{\n\t\ttext: \"(no migrations)\",\n\t\ttone: \"muted\"\n\t}]] : toneDrawing(section.tree);\n\treturn {\n\t\tkind: \"drawing\",\n\t\tlines: [...heading, ...body]\n\t};\n}\nfunction statusPresentations(inputs) {\n\tconst legend = inputs.legend;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t\t},\n\t\t\t\t\t...inputs.database === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\t\tvalue: inputs.database\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.ref === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"ref\",\n\t\t\t\t\t\tvalue: inputs.ref\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.from === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\t\tvalue: inputs.from\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.space === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\t\tvalue: inputs.space\n\t\t\t\t\t}]\n\t\t\t\t]\n\t\t\t},\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}],\n\t\t\t...inputs.sections.map(sectionBlock),\n\t\t\tinputs.headline\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\nconst migrationStatusCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show migration path and pending status\",\n\t\tdescription: \"Shows which migrations are pending between the database marker and the\\ntarget contract. Requires a database connection. Pass --from for an\\noffline path preview without a database. Use `migration graph` for\\ntopology, `migration log` for history, and `migration list` for on-disk\\nenumeration.\",\n\t\texamples: [\n\t\t\t\"migration status\",\n\t\t\t\"migration status --db $DATABASE_URL\",\n\t\t\t\"migration status --to production\",\n\t\t\t\"migration status --from abc123 --to production\",\n\t\t\t\"migration status --ascii\",\n\t\t\t\"migration status --legend\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tdb: dbFlag,\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tto: flag.string({\n\t\t\tbrief: \"Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\",\n\t\t\tplaceholder: \"contract\"\n\t\t}),\n\t\tfrom: flag.string({\n\t\t\tbrief: \"Origin contract reference; same grammar as --to. Supplying it switches to offline path computation\",\n\t\t\tplaceholder: \"contract\"\n\t\t}),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\tconst hasDriver = ctx.config.driver !== void 0;\n\t\tconst usingFromOverride = args.flags.from !== void 0;\n\t\tif (!usingFromOverride) {\n\t\t\tconst missingDb = requireLiveDatabase({\n\t\t\t\tdbConnection,\n\t\t\t\thasDriver,\n\t\t\t\twhy: \"migration status needs a database connection to read the marker and ledger (or pass --from for an offline path preview)\",\n\t\t\t\tretryCommand: \"prisma-cli migration status --from <contract>\"\n\t\t\t});\n\t\t\tif (missingDb !== null) return notOk$1(normalizeError(missingDb));\n\t\t}\n\t\tconst refsResult = await readMigrationRefs(appRefsDirFor(ctx.config, ctx.cwd));\n\t\tif (!refsResult.ok) return notOk$1(normalizeError(refsResult.failure));\n\t\tconst refs = refsResult.value;\n\t\tconst findings = [];\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash } = loaded.value;\n\t\tconst contractConfig = { contract: ifDefined(\"output\", contractPathFor(ctx.config, ctx.cwd)) };\n\t\ttry {\n\t\t\tawait readContractEnvelope(contractConfig);\n\t\t} catch (error) {\n\t\t\tfindings.push(contractUnreadableFinding(error instanceof Error ? error.message : \"unknown error\"));\n\t\t}\n\t\tif (await loadContractRawSafely(contractConfig) !== null) {\n\t\t\tconst corruption = refusePackageCorruptionOnAggregate(aggregate, migrationsDir);\n\t\t\tif (corruption) return notOk$1(normalizeError(corruption));\n\t\t}\n\t\tconst appGraph = aggregate.app.graph();\n\t\tlet activeRefHash;\n\t\tlet activeRefName;\n\t\tlet activeRefEntry;\n\t\tif (args.flags.to !== void 0) {\n\t\t\tconst resolved = resolveContractRef(args.flags.to, {\n\t\t\t\tgraph: appGraph,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tif (!resolved.ok) return notOk$1(normalizeError(resolved.failure));\n\t\t\tactiveRefHash = resolved.value.hash;\n\t\t\tif (resolved.value.provenance.kind === \"ref\") {\n\t\t\t\tactiveRefName = resolved.value.provenance.refName;\n\t\t\t\tactiveRefEntry = refs[activeRefName];\n\t\t\t}\n\t\t}\n\t\tlet fromOverrideHash;\n\t\tif (args.flags.from !== void 0) {\n\t\t\tconst resolved = resolveContractRef(args.flags.from, {\n\t\t\t\tgraph: appGraph,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tif (!resolved.ok) return notOk$1(normalizeError(resolved.failure));\n\t\t\tfromOverrideHash = resolved.value.hash;\n\t\t}\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk$1(normalizeError(listed.failure));\n\t\tconst scopedSpaces = listed.value.spaces;\n\t\tconst connects = dbConnection !== void 0 && hasDriver && !usingFromOverride;\n\t\tlet database = NO_DATABASE_STATE;\n\t\tif (connects) {\n\t\t\tconst read = await readDatabaseState({\n\t\t\t\tclient: createControlClient({\n\t\t\t\t\tfamily: ctx.config.family,\n\t\t\t\t\ttarget: ctx.config.target,\n\t\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t\t}),\n\t\t\t\tconnection: dbConnection,\n\t\t\t\tspaceIds: scopedSpaces.map((entry) => entry.space)\n\t\t\t});\n\t\t\tif (!read.ok) return notOk$1(read.failure);\n\t\t\tdatabase = read.value;\n\t\t}\n\t\tconst appMarker = database.markersBySpace.get(aggregate.app.spaceId);\n\t\tif (activeRefEntry !== void 0 && activeRefEntry.invariants.length > 0 && connects) {\n\t\t\tconst unknown = refuseUnknownInvariants({\n\t\t\t\tgraph: appGraph,\n\t\t\t\tmarkerInvariants: appMarker?.invariants ?? [],\n\t\t\t\trefInvariants: activeRefEntry.invariants,\n\t\t\t\t...ifDefined(\"refName\", activeRefName)\n\t\t\t});\n\t\t\tif (unknown) return notOk$1(normalizeError(unknown));\n\t\t}\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst showSpaceHeadings = scopedSpaces.length > 1;\n\t\tconst statusSpaces = [];\n\t\tconst renderInputs = [];\n\t\tconst emptySpaces = [];\n\t\tlet divergedMarker;\n\t\tlet noPath;\n\t\tlet headlineTargetHash = activeRefHash ?? contractHash;\n\t\tlet totalPending = 0;\n\t\tfor (const entry of scopedSpaces) {\n\t\t\tconst space = aggregate.space(entry.space);\n\t\t\tif (space === void 0) continue;\n\t\t\tconst graph = space.graph();\n\t\t\tconst spaceContractHash = space.contract().storage.storageHash;\n\t\t\tconst targetHash = activeRefHash ?? spaceContractHash;\n\t\t\tif (entry.space === aggregate.app.spaceId) headlineTargetHash = targetHash;\n\t\t\tconst markerHash = usingFromOverride ? fromOverrideHash : database.markersBySpace.get(entry.space)?.storageHash;\n\t\t\tconst originHash = originHashForStatus(markerHash);\n\t\t\tconst markerInGraph = markerHash === void 0 || graph.nodes.has(markerHash) || markerHash === spaceContractHash;\n\t\t\tif (connects && markerInGraph && originHash !== targetHash && noPath === void 0 && !hasMigrationPath(graph, originHash, targetHash)) noPath = {\n\t\t\t\tmarkerHash,\n\t\t\t\ttargetHash\n\t\t\t};\n\t\t\tif (connects && markerHash !== void 0 && !markerInGraph) {\n\t\t\t\tdivergedMarker ??= {\n\t\t\t\t\tspace: entry.space,\n\t\t\t\t\tmarkerHash\n\t\t\t\t};\n\t\t\t\tfindings.push(markerNotInHistoryFinding(entry.space));\n\t\t\t}\n\t\t\tconst ledger = database.ledgersBySpace.get(entry.space) ?? [];\n\t\t\tconst annotations = deriveStatusEdgeAnnotations({\n\t\t\t\tgraph,\n\t\t\t\ttargetHash,\n\t\t\t\toriginHash,\n\t\t\t\tappliedMigrationHashes: connects ? appliedHashesFromLedger(ledger) : /* @__PURE__ */ new Set(),\n\t\t\t\tshowAppliedOverlay: connects\n\t\t\t});\n\t\t\tconst migrations = entry.migrations.map((migration) => ({\n\t\t\t\t...migration,\n\t\t\t\tstatus: statusForMigrationHash(migration.hash, annotations)\n\t\t\t}));\n\t\t\ttotalPending += migrations.filter((migration) => migration.status === \"pending\").length;\n\t\t\tstatusSpaces.push({\n\t\t\t\tspace: entry.space,\n\t\t\t\tcurrentContract: markerHash ?? null,\n\t\t\t\ttargetContract: targetHash,\n\t\t\t\tmigrations\n\t\t\t});\n\t\t\tif (graph.nodes.size === 0) {\n\t\t\t\temptySpaces.push(entry.space);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trenderInputs.push({\n\t\t\t\tspaceId: entry.space,\n\t\t\t\tgraph,\n\t\t\t\tmigrations: entry.migrations,\n\t\t\t\tliveContractHash: contractHash,\n\t\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\t\tstatusOverlayByHash: annotations,\n\t\t\t\tcolorize: true,\n\t\t\t\tglyphMode,\n\t\t\t\tstyler,\n\t\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE,\n\t\t\t\tisAppSpace: entry.space === aggregate.app.spaceId,\n\t\t\t\t...connects && markerHash !== void 0 ? { dbHash: markerHash } : {}\n\t\t\t});\n\t\t}\n\t\tconst requiredInvariants = [...activeRefEntry?.invariants ?? []].sort();\n\t\tif (connects && requiredInvariants.length > 0) {\n\t\t\tconst held = new Set(appMarker?.invariants ?? []);\n\t\t\tconst missing = requiredInvariants.filter((id) => !held.has(id));\n\t\t\tif (missing.length > 0) {\n\t\t\t\tfindings.push(missingInvariantsFinding({\n\t\t\t\t\tmissing,\n\t\t\t\t\trefName: activeRefName\n\t\t\t\t}));\n\t\t\t\tif (activeRefHash !== void 0) {\n\t\t\t\t\tconst unreachable = refuseMissingInvariantPath({\n\t\t\t\t\t\tgraph: appGraph,\n\t\t\t\t\t\toriginHash: originHashForStatus(appMarker?.storageHash),\n\t\t\t\t\t\ttargetHash: activeRefHash,\n\t\t\t\t\t\tmissing,\n\t\t\t\t\t\t...ifDefined(\"refName\", activeRefName)\n\t\t\t\t\t});\n\t\t\t\t\tif (unreachable) return notOk$1(normalizeError(unreachable));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst rendered = renderMigrationGraphSpaceTrees(renderInputs);\n\t\tconst treesBySpace = new Map(renderInputs.map((input, index) => [input.spaceId, rendered[index] ?? \"\"]));\n\t\tconst sections = scopedSpaces.map((entry) => {\n\t\t\tconst tree = treesBySpace.get(entry.space) ?? \"\";\n\t\t\treturn {\n\t\t\t\tspace: entry.space,\n\t\t\t\ttree: showSpaceHeadings && tree.length > 0 ? indentMigrationGraphTreeBlock(tree, \" \") : tree,\n\t\t\t\tshowHeading: showSpaceHeadings\n\t\t\t};\n\t\t});\n\t\tconst summary = scopedSpaces.every((entry) => entry.migrations.length === 0) ? \"No migrations found\" : noPath !== void 0 ? buildNoPathSummary({\n\t\t\tmarkerHash: noPath.markerHash,\n\t\t\ttargetHash: noPath.targetHash,\n\t\t\texplicitTarget: args.flags.to !== void 0,\n\t\t\trefName: activeRefName\n\t\t}) : buildStatusHeadline({\n\t\t\tpendingCount: totalPending,\n\t\t\ttargetHash: headlineTargetHash,\n\t\t\tmarkerDiverged: divergedMarker !== void 0,\n\t\t\tmarkerHash: divergedMarker?.markerHash\n\t\t});\n\t\tconst diagnostics = findings.map((finding) => finding.diagnostic);\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\tspaces: statusSpaces,\n\t\t\tsummary,\n\t\t\tdiagnostics: findings.map((finding) => finding.document)\n\t\t};\n\t\tconst alarming = divergedMarker !== void 0 || totalPending > 0 || noPath !== void 0;\n\t\treturn ok$1(ctx.present({\n\t\t\tdata: document,\n\t\t\tdiagnostics\n\t\t}, statusPresentations({\n\t\t\tdocument,\n\t\t\tsections,\n\t\t\theadline: {\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: alarming ? \"warn\" : \"ok\",\n\t\t\t\ttext: summary\n\t\t\t},\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tdatabase: connects && typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0,\n\t\t\tref: activeRefName,\n\t\t\tfrom: args.flags.from,\n\t\t\tspace: args.flags.space,\n\t\t\tlegend: args.flags.legend ? renderMigrationGraphLegend({\n\t\t\t\tcolorize: true,\n\t\t\t\tglyphMode,\n\t\t\t\tstyler,\n\t\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t\t}) : void 0\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/ref/delete.ts\nfunction deletePresentations(document) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [\n\t\t\t\t{ text: \"Deleted ref \\\"\" },\n\t\t\t\t{\n\t\t\t\t\ttext: document.ref,\n\t\t\t\t\ttone: \"ref\"\n\t\t\t\t},\n\t\t\t\t{ text: \"\\\"\" }\n\t\t\t]\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createRefDeleteCommand(execute = executeRefDeleteCommand) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Delete a ref\",\n\t\t\tdescription: \"Removes migrations/app/refs/<name>.json. The contract the ref pointed at\\nis untouched: a ref is a pointer, and its target survives the deletion.\",\n\t\t\texamples: [\"ref delete staging\", \"ref delete staging --json\"]\n\t\t},\n\t\targs: { positionals: { name: positional.string({\n\t\t\tbrief: \"Ref name to delete\",\n\t\t\tplaceholder: \"name\"\n\t\t}) } },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst result = await execute(args.positionals.name, {\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (!result.ok) return notOk$1(normalizeError(result.failure));\n\t\t\treturn ok$1(ctx.present({ data: result.value }, deletePresentations(result.value)));\n\t\t}\n\t});\n}\nconst refDeleteCommand = createRefDeleteCommand();\n//#endregion\n//#region src/orm/ref/list.ts\nconst HEADING_REF = \"Ref\";\nconst HEADING_CONTRACT = \"Contract\";\nconst HEADING_INVARIANTS = \"Invariants\";\nconst EMPTY_MESSAGE = \"No refs defined\";\n/**\n* The refs as a grid the engine sizes. The invariants heading appears only\n* when a ref carries any, as the commander shell appended them only then.\n*/\nfunction refsGrid(refs) {\n\tconst entries = Object.entries(refs);\n\tconst showInvariants = entries.some(([, entry]) => entry.invariants.length > 0);\n\treturn {\n\t\tkind: \"table\",\n\t\tcolumns: showInvariants ? [\n\t\t\tHEADING_REF,\n\t\t\tHEADING_CONTRACT,\n\t\t\tHEADING_INVARIANTS\n\t\t] : [HEADING_REF, HEADING_CONTRACT],\n\t\trows: entries.map(([name, entry]) => {\n\t\t\tconst cells = [[{\n\t\t\t\ttext: name,\n\t\t\t\ttone: \"ref\"\n\t\t\t}], [{\n\t\t\t\ttext: entry.hash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]];\n\t\t\tif (showInvariants) cells.push(entry.invariants.join(\", \"));\n\t\t\treturn cells;\n\t\t})\n\t};\n}\nfunction listPresentations(document) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => Object.keys(document.refs).length === 0 ? [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: EMPTY_MESSAGE\n\t\t}] : [refsGrid(document.refs)],\n\t\tjson: () => document\n\t};\n}\nfunction createRefListCommand(execute = executeRefListCommand) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"List every named ref\",\n\t\t\tdescription: \"Reads migrations/app/refs/ and reports each ref with the contract hash it\\npoints at and the invariants recorded against it. Offline — does not\\nconsult the database.\",\n\t\t\texamples: [\"ref list\", \"ref list --json\"]\n\t\t},\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (_args, ctx) => {\n\t\t\tconst result = await execute({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (!result.ok) return notOk$1(normalizeError(result.failure));\n\t\t\treturn ok$1(ctx.present({ data: result.value }, listPresentations(result.value)));\n\t\t}\n\t});\n}\nconst refListCommand = createRefListCommand();\n//#endregion\n//#region src/orm/ref/set.ts\nfunction setPresentations(document) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [\n\t\t\t\t{ text: \"Set ref \\\"\" },\n\t\t\t\t{\n\t\t\t\t\ttext: document.ref,\n\t\t\t\t\ttone: \"ref\"\n\t\t\t\t},\n\t\t\t\t{ text: \"\\\" → \" },\n\t\t\t\t{\n\t\t\t\t\ttext: document.hash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}\n\t\t\t]\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createRefSetCommand(execute = executeRefSetCommand) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Point a ref at a contract\",\n\t\t\tdescription: \"Writes migrations/app/refs/<name>.json so a logical environment name\\nresolves to a contract hash. The contract is given as a hash or prefix,\\nanother ref name, a migration directory name, or <dir>^ for that\\nmigration's source contract. Offline — the contract must already be a\\nnode of the on-disk migration graph, with its snapshot present.\",\n\t\t\texamples: [\n\t\t\t\t\"ref set staging 4cb4256\",\n\t\t\t\t\"ref set production 20260101T1000_add_user\",\n\t\t\t\t\"ref set staging production --json\"\n\t\t\t]\n\t\t},\n\t\targs: { positionals: {\n\t\t\tname: positional.string({\n\t\t\t\tbrief: \"Ref name (e.g. staging, production)\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tcontract: positional.string({\n\t\t\t\tbrief: \"Contract reference: hash, prefix, ref name, migration dir name, or <dir>^\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst result = await execute(args.positionals.name, args.positionals.contract, {\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (!result.ok) return notOk$1(normalizeError(result.failure));\n\t\t\treturn ok$1(ctx.present({ data: result.value }, setPresentations(result.value)));\n\t\t}\n\t});\n}\nconst refSetCommand = createRefSetCommand();\n//#endregion\n//#region src/orm/family.ts\n/**\n* The engine derives each diagnostic's docs link from this base plus the\n* dotted code.\n*/\nconst DOCS_BASE_URL = `${DOCS_BASE}/`;\n/**\n* The unit the ORM contributes to a CLI: its config section, its commands by\n* name, where its diagnostics are documented, and the invocations it retired.\n* The shell owns the command tree, so nothing here says where a command mounts.\n*/\nconst ormCommandFamily = defineCommandFamily({\n\tconfigSection: ormConfigSection,\n\tcommands: {\n\t\t\"contract emit\": contractEmitCommand,\n\t\t\"contract infer\": contractInferCommand,\n\t\t\"db init\": dbInitCommand,\n\t\t\"db schema\": dbSchemaCommand,\n\t\t\"db sign\": dbSignCommand,\n\t\t\"db update\": dbUpdateCommand,\n\t\t\"db verify\": dbVerifyCommand,\n\t\tformat: formatCommand,\n\t\tinit: initCommand,\n\t\tlsp: lspCommand,\n\t\tmigrate: migrateCommand,\n\t\t\"migration check\": migrationCheckCommand,\n\t\t\"migration graph\": migrationGraphCommand,\n\t\t\"migration list\": migrationListCommand,\n\t\t\"migration log\": migrationLogCommand,\n\t\t\"migration new\": migrationNewCommand,\n\t\t\"migration plan\": migrationPlanCommand,\n\t\t\"migration show\": migrationShowCommand,\n\t\t\"migration status\": migrationStatusCommand,\n\t\t\"ref delete\": refDeleteCommand,\n\t\t\"ref list\": refListCommand,\n\t\t\"ref set\": refSetCommand\n\t},\n\tdocsBaseUrl: DOCS_BASE_URL,\n\tredirects: [\n\t\t{\n\t\t\tfrom: \"migration apply\",\n\t\t\treplacement: \"{bin} migrate --to <contract>\",\n\t\t\treason: \"Applying a migration is a move to a target contract, not a verb of its own.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration ref\",\n\t\t\treplacement: \"{bin} ref set|list|delete\",\n\t\t\treason: \"Refs are managed by their own command, for every space rather than migrations alone.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration status\",\n\t\t\tflag: \"graph\",\n\t\t\treplacement: \"{bin} migration graph\",\n\t\t\treason: \"Topology is its own command rather than a mode of the status report.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration status\",\n\t\t\tflag: \"all\",\n\t\t\treplacement: \"{bin} migration log --db <url>\",\n\t\t\treason: \"Execution history is read from the database ledger, which is what migration log does.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration status\",\n\t\t\tflag: \"limit\",\n\t\t\treplacement: \"{bin} migration log --db <url>\",\n\t\t\treason: \"Execution history is read from the database ledger, which is what migration log does.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration status\",\n\t\t\tflag: \"ref\",\n\t\t\treplacement: \"{bin} migration status --to <contract>\",\n\t\t\treason: \"One flag names the target contract, whether it is a ref, a hash or a migration.\"\n\t\t}\n\t]\n});\n//#endregion\n//#region src/orm/load-config.ts\n/** The file the ORM's loader reads when `--config` names none. */\nconst ORM_CONFIG_FILENAME = \"prisma.config.ts\";\n/**\n* Builds the engine's `Runtime.config` from `prisma.config.ts`.\n*\n* The engine ships its own synchronous loader, but the bin owns the load: the\n* ORM's c12 loader evaluates the module asynchronously and finalizes paths\n* against the config file's own directory. It reads the same shape the engine\n* does — defineConfig from `@prisma/cli-engine` with the whole Prisma Next\n* configuration nested as the single `orm` section.\n*\n* Only failures that prevent evaluation entirely are diagnostics here, and\n* they carry `section: null` so they fail exactly the commands that read\n* config. Structural verdicts belong to the section validator.\n*/\nasync function loadOrmConfig(options) {\n\tconst path = resolve(options.cwd, options.configPath ?? ORM_CONFIG_FILENAME);\n\tconst loaded = await loadConfig(options.configPath, { cwd: options.cwd });\n\tif (!loaded.ok) return {\n\t\tpath,\n\t\tsections: {},\n\t\tdiagnostics: [{\n\t\t\tsection: null,\n\t\t\tdiagnostic: toEngineDiagnostic(loaded.failure)\n\t\t}]\n\t};\n\treturn {\n\t\tpath,\n\t\tsections: { [\"orm\"]: loaded.value.config },\n\t\tdiagnostics: []\n\t};\n}\n//#endregion\nexport { contractInferCommand as C, version as D, ormConfigSection as E, createDbInitCommand as S, normalizeError as T, formatCommand as _, refDeleteCommand as a, createDbSignCommand as b, migrationPlanCommand as c, migrationListCommand as d, migrationGraphCommand as f, initCommand as g, lspCommand as h, refListCommand as i, migrationNewCommand as l, createMigrateCommand as m, ormCommandFamily as n, migrationStatusCommand as o, migrationCheckCommand as p, refSetCommand as r, migrationShowCommand as s, loadOrmConfig as t, migrationLogCommand as u, createDbVerifyCommand as v, contractEmitCommand as w, createDbSchemaCommand as x, createDbUpdateCommand as y };\n\n//# sourceMappingURL=load-config-ChYX98p-.mjs.map","import { E as ormConfigSection, n as ormCommandFamily, t as loadOrmConfig } from \"../load-config-ChYX98p-.mjs\";\nimport { existsSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { join, resolve } from \"pathe\";\nimport { tmpdir } from \"node:os\";\nimport { pathToFileURL } from \"node:url\";\nimport { build } from \"esbuild\";\n//#region src/load-ts-contract.ts\nfunction contractSourceError(code, message, options) {\n\tconst error = new CliStructuredError(code, message, options?.meta !== void 0 ? { meta: options.meta } : void 0);\n\tif (options?.cause !== void 0) error.cause = options.cause;\n\treturn error;\n}\nconst DEFAULT_ALLOWLIST = [\n\t\"@internal/*\",\n\t\"@prisma/orm-*\",\n\t\"node:crypto\"\n];\nfunction isAllowedImport(importPath, allowlist) {\n\tfor (const pattern of allowlist) if (pattern.endsWith(\"/*\")) {\n\t\tconst prefix = pattern.slice(0, -2);\n\t\tif (importPath === prefix || importPath.startsWith(`${prefix}/`)) return true;\n\t} else if (pattern.endsWith(\"*\")) {\n\t\tconst prefix = pattern.slice(0, -1);\n\t\tif (importPath.startsWith(prefix)) return true;\n\t} else if (importPath === pattern) return true;\n\treturn false;\n}\nfunction validatePurity(value, entryPath) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tconst path = /* @__PURE__ */ new WeakSet();\n\tfunction check(value) {\n\t\tif (value === null || typeof value !== \"object\") return;\n\t\tif (path.has(value)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export contains circular references\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"circular\"\n\t\t} });\n\t\tpath.add(value);\n\t\ttry {\n\t\t\tfor (const key in value) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\t\t\tif (descriptor && (descriptor.get || descriptor.set)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains getter/setter at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"getter\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tif (descriptor && typeof descriptor.value === \"function\") throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains function at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"function\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tcheck(value[key]);\n\t\t\t}\n\t\t} finally {\n\t\t\tpath.delete(value);\n\t\t}\n\t}\n\ttry {\n\t\tcheck(value);\n\t\tJSON.stringify(value);\n\t} catch (error) {\n\t\tif (error instanceof Error) {\n\t\t\tif (error.message.includes(\"getter\") || error.message.includes(\"circular\")) throw error;\n\t\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export is not JSON-serializable: ${error.message}`, {\n\t\t\t\tmeta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"not-json-serializable\"\n\t\t\t\t},\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export is not JSON-serializable\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-json-serializable\"\n\t\t} });\n\t}\n}\nfunction createImportAllowlistPlugin(allowlist, entryPath, collected) {\n\tconst entryAbs = resolve(entryPath);\n\tfunction isFromEntry(importer) {\n\t\treturn importer === entryAbs || importer === entryPath || importer === \"<stdin>\";\n\t}\n\treturn {\n\t\tname: \"import-allowlist\",\n\t\tsetup(build) {\n\t\t\tbuild.onResolve({ filter: /.*/ }, (args) => {\n\t\t\t\tif (args.kind === \"entry-point\") return;\n\t\t\t\tif (args.path.startsWith(\".\") || args.path.startsWith(\"/\")) return;\n\t\t\t\tif (isFromEntry(args.importer) && !isAllowedImport(args.path, allowlist)) {\n\t\t\t\t\tcollected.add(args.path);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpath: args.path,\n\t\t\t\t\t\texternal: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n}\n/**\n* Loads a contract from a TypeScript file and returns it as Contract.\n*\n* **Responsibility: Parsing Only**\n* This function loads and parses a TypeScript contract file. It does NOT normalize the contract.\n* The contract should already be normalized if it was built using the contract builder.\n*\n* Normalization must happen in the contract builder when the contract is created.\n* This function only validates that the contract is JSON-serializable and returns it as-is.\n*\n* @param entryPath - Path to the TypeScript contract file\n* @param options - Optional configuration (import allowlist)\n* @returns The contract as Contract (should already be normalized)\n* @throws structured errors: `CLI.FILE_NOT_FOUND`, `CONTRACT.SOURCE_LOAD_FAILED`,\n* `CONTRACT.SOURCE_IMPORT_DISALLOWED`, `CONTRACT.MODULE_EXPORT_MISSING`, `CONTRACT.EXPORT_INVALID`\n*/\nasync function loadContractFromTs(entryPath, options) {\n\tconst allowlist = options?.allowlist ?? DEFAULT_ALLOWLIST;\n\tif (!existsSync(entryPath)) throw new CliStructuredError(\"CLI.FILE_NOT_FOUND\", `Contract file not found: ${entryPath}`, { where: { path: entryPath } });\n\tconst tempFile = join(tmpdir(), `prisma-next-contract-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);\n\tconst disallowedFromEntry = /* @__PURE__ */ new Set();\n\ttry {\n\t\tconst result = await build({\n\t\t\tentryPoints: [entryPath],\n\t\t\tbundle: true,\n\t\t\tformat: \"esm\",\n\t\t\tplatform: \"node\",\n\t\t\ttarget: \"es2022\",\n\t\t\toutfile: tempFile,\n\t\t\twrite: false,\n\t\t\tmetafile: true,\n\t\t\tplugins: [createImportAllowlistPlugin(allowlist, entryPath, disallowedFromEntry)],\n\t\t\tlogLevel: \"error\"\n\t\t});\n\t\tif (result.errors.length > 0) throw contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to bundle contract file: ${result.errors.map((e) => e.text).join(\"\\n\")}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\tstage: \"bundle\"\n\t\t} });\n\t\tif (!result.outputFiles || result.outputFiles.length === 0) throw new InternalError(\"No output files generated from bundling\");\n\t\tif (disallowedFromEntry.size > 0) throw contractSourceError(\"CONTRACT.SOURCE_IMPORT_DISALLOWED\", `Disallowed imports detected. Only imports matching the allowlist are permitted:\\n Allowlist: ${allowlist.join(\", \")}\\n Disallowed imports: ${[...disallowedFromEntry].join(\", \")}`, { meta: {\n\t\t\tallowlist: [...allowlist],\n\t\t\tdisallowed: [...disallowedFromEntry]\n\t\t} });\n\t\tconst bundleContent = result.outputFiles[0]?.text;\n\t\tif (bundleContent === void 0) throw new InternalError(\"Bundle content is undefined\");\n\t\twriteFileSync(tempFile, bundleContent, \"utf-8\");\n\t\tconst module = await import(\n\t\t\t/* @vite-ignore */\n\t\t\tpathToFileURL(tempFile).href\n);\n\t\tunlinkSync(tempFile);\n\t\tlet contract;\n\t\tif (module.default !== void 0) contract = module.default;\n\t\telse if (module.contract !== void 0) contract = module.contract;\n\t\telse throw new CliStructuredError(\"CONTRACT.MODULE_EXPORT_MISSING\", `Contract file must export a contract as default export or named export 'contract'. Found exports: ${Object.keys(module).join(\", \") || \"none\"}`, { where: { path: entryPath } });\n\t\tif (typeof contract !== \"object\" || contract === null) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export must be an object, got ${typeof contract}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-object\"\n\t\t} });\n\t\tvalidatePurity(contract, entryPath);\n\t\treturn contract;\n\t} catch (error) {\n\t\ttry {\n\t\t\tif (tempFile) unlinkSync(tempFile);\n\t\t} catch {}\n\t\tif (error instanceof Error) throw error;\n\t\tthrow contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to load contract from ${entryPath}: ${String(error)}`, {\n\t\t\tmeta: {\n\t\t\t\tpath: entryPath,\n\t\t\t\tstage: \"import\"\n\t\t\t},\n\t\t\tcause: error\n\t\t});\n\t}\n}\n//#endregion\nexport { loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAI,UAAU;AACd,MAAM,wBAAwB;CAC7B,MAAM;CACN,OAAO;CACP,SAAS;AACV;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO;EACN,MAAM;EACN,OA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GAAG,MAAM,oBAAoB,qCAAqC,iGAAiG,UAAU,KAAK,IAAI,EAAE,0BAA0B,CAAC,GAAG,mBAAmB,CAAC,CAAC,KAAK,IAAI,KAAK,EAAE,MAAM;GAC/R,WAAW,CAAC,GAAG,SAAS;GACxB,YAAY,CAAC,GAAG,mBAAmB;EACpC,EAAE,CAAC;EACH,MAAM,gBAAgB,OAAO,YAAY,EAAE,EAAE;EAC7C,IAAI,kBAAkB,KAAK,GAAG,MAAM,IAAI,cAAc,6BAA6B;EACnF,cAAc,UAAU,eAAe,OAAO;EAC9C,MAAM,SAAS,MAAM;;GAEpB,cAAc,QAAQ,CAAC,CAAC;;EAEzB,WAAW,QAAQ;EACnB,IAAI;EACJ,IAAI,OAAO,YAAY,KAAK,GAAG,WAAW,OAAO;OAC5C,IAAI,OAAO,aAAa,KAAK,GAAG,WAAW,OAAO;OAClD,MAAM,IAAI,mBAAmB,kCAAkC,qGAAqG,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,EAAE,CAAC;EACnP,IAAI,OAAO,aAAa,YAAY,aAAa,MAAM,MAAM,oBAAoB,2BAA2B,0CAA0C,OAAO,YAAY,EAAE,MAAM;GAChL,MAAM;GACN,QAAQ;EACT,EAAE,CAAC;EACH,eAAe,UAAU,SAAS;EAClC,OAAO;CACR,SAAS,OAAO;EACf,IAAI;GACH,IAAI,UAAU,WAAW,QAAQ;EAClC,QAAQ,CAAC;EACT,IAAI,iBAAiB,OAAO,MAAM;EAClC,MAAM,oBAAoB,+BAA+B,gCAAgC,UAAU,IAAI,OAAO,KAAK,KAAK;GACvH,MAAM;IACL,MAAM;IACN,OAAO;GACR;GACA,OAAO;EACR,CAAC;CACF;AACD"}
1
+ {"version":3,"file":"cli.mjs","names":["CliStructuredError$2","errorConfigValidation","resolveContractRef"],"sources":["../../../../1-framework/3-tooling/cli/dist/load-config-BmhVL82j.mjs","../../../../1-framework/3-tooling/cli/dist/exports/index.mjs"],"sourcesContent":["import { $ as refuseContractSpaceIntegrity, A as hasMigrationPath, At as requireLiveDatabase, B as resolveRefAdvancementFields, C as migrationSpaceListEntriesFromAggregate, Ct as errorNoMigrations, D as executeMigrateShowPlan, Dt as errorTargetMigrationNotSupported, E as resolveMigrationRef, Et as errorRuntime, F as advanceRefSafely, M as mapContractAtError, Mt as runCommandAction, N as mapCaughtMigrationError, O as refuseMissingInvariantPath, Ot as errorTargetMismatch, P as resolveContractRefToSnapshot, S as listRefsByContractHash, St as errorMigrationPlanningFailed, T as resolveContractRef, Tt as errorRunnerFailed, U as createControlClient, V as executeContractEmit, X as loadContractRawSafely, Y as buildReadAggregate, Z as loadContractSpaceAggregateForCli, _ as loadAggregateIntegrityViolations, _t as errorFileNotFound, a as appliedHashesFromLedger, at as readContractEnvelope, b as looksLikePath, bt as errorMarkerMissing, c as statusForMigrationHash, dt as errorConsentPlanMismatch, ft as errorContractArgConflict, g as enumerateCheckSpaces, gt as errorDriverRequired, h as checkSingleTarget, ht as errorDestructiveChanges, i as readMigrationRefs, it as maskConnectionUrl, j as refuseMarkerOutsideGraph, jt as chooseAction, k as refuseUnknownInvariants, kt as errorUnexpected, l as executeMigrationPlanCommand, lt as CliStructuredError$2, m as buildMigrationSpaceGraphEntries, mt as errorDatabaseConnectionRequired, n as executeRefListCommand, nt as toDeclaredExtensionsFromRaw, o as deriveStatusEdgeAnnotations, ot as sanitizeErrorMessage, p as executeMigrationNewCommand, pt as errorContractValidationFailed, r as executeRefSetCommand, rt as closeQuietly, s as originHashForStatus, st as targetSupportsMigrations, t as executeRefDeleteCommand, tt as refusePackageCorruptionOnAggregate, ut as errorConfigValidation, v as runMigrationCheck, vt as errorHashMismatch, w as runMigrationList, wt as errorPathUnreachable, x as resolveAppTargetPath, xt as errorMigrationPackageNotFound, y as findPackageByDirPath, yt as errorLegendHumanOnly, z as readContractIR } from \"./ref-DJkSkzAt.mjs\";\nimport { n as buildNextSteps, t as InitOutputSchema } from \"./output-CovTDY14.mjs\";\nimport { createRequire } from \"node:module\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, defineServerCommand, flag, positional } from \"@prisma/cli-engine\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { APP_SPACE_ID, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, createControlStack, issueOutcome } from \"@internal/framework-components/control\";\nimport { InternalError, assertNever, isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { DOCS_BASE, docsUrlFor, isStructuredError, isStructuredErrorCode } from \"@internal/utils/structured-error\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { mkdir, readFile, rename, rm, writeFile } from \"node:fs/promises\";\nimport { EMPTY_CONTRACT_HASH } from \"@internal/migration-tools/constants\";\nimport { spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\nimport { basename, dirname, extname, isAbsolute, join, normalize, relative, resolve } from \"pathe\";\nimport { CliStructuredError as CliStructuredError$1, notOk as notOk$1, ok as ok$1 } from \"@prisma/cli-engine/protocol\";\nimport { createScaffoldSpecifierResolver } from \"@internal/publish-surface/import-roots\";\nimport { collectConfigIssues } from \"@internal/config/config-validation\";\nimport { finalizeConfig, loadConfig } from \"@internal/config-loader\";\nimport { printPsl } from \"@internal/psl-printer\";\nimport { EOL } from \"node:os\";\nimport { format } from \"@internal/psl-parser/format\";\nimport { type } from \"arktype\";\nimport { suppressIdleConnectionErrors } from \"@internal/utils/suppress-idle-connection-errors\";\nimport { DEFAULT_CONTRACT_SOURCE_DIR } from \"@internal/config/config-types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { spawn } from \"node:child_process\";\nimport { detect } from \"package-manager-detector/detect\";\nimport { applyEdits, modify, parse, printParseErrorCode } from \"jsonc-parser\";\nimport stringWidth from \"string-width\";\nimport { bold, createColors, cyan, cyanBright, dim, green, yellow } from \"colorette\";\n//#region package.json\nvar version = \"8.0.0-rc.4-dev.15\";\nconst MISSING_CONFIG_ACTION = {\n\tkind: \"run-command\",\n\tlabel: \"Create a config file\",\n\tcommand: \"prisma orm init\"\n};\nfunction editConfigAction(field) {\n\treturn {\n\t\tkind: \"edit-file\",\n\t\tlabel: `Correct ${field} in prisma.config.ts`\n\t};\n}\nfunction issueDiagnostic(issue) {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: issue.message,\n\t\twhy: issue.message,\n\t\tnextActions: [editConfigAction(issue.field)],\n\t\tmeta: {\n\t\t\tfield: issue.field,\n\t\t\tsection: issue.section\n\t\t}\n\t};\n}\nfunction sectionAbsentDiagnostic() {\n\treturn {\n\t\tcode: \"CONFIG.FILE_NOT_FOUND\",\n\t\tseverity: \"error\",\n\t\tsummary: \"No Prisma Next configuration was loaded\",\n\t\twhy: `The orm config section is absent, so prisma.config.ts was never evaluated.`,\n\t\tnextActions: [MISSING_CONFIG_ACTION]\n\t};\n}\nfunction notAnObjectDiagnostic() {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: \"Prisma Next configuration must be an object\",\n\t\twhy: `The orm config section is not an object, so no section can be read from it.`,\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Export a configuration object from prisma.config.ts\"\n\t\t}]\n\t};\n}\nfunction unreadableDiagnostic(error) {\n\treturn {\n\t\tcode: \"CONFIG.VALIDATION_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: \"Prisma Next configuration could not be inspected\",\n\t\twhy: error instanceof Error ? error.message : String(error),\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Export a plain configuration object from prisma.config.ts\"\n\t\t}]\n\t};\n}\nfunction isRecord$1(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/**\n* An emitted artifact listed as its own contract input makes every emit\n* consume its previous output. Structural, filesystem-free, and therefore the\n* section validator's business rather than the loader's.\n*/\nfunction collectArtifactCollisionIssues(raw) {\n\tconst contract = raw[\"contract\"];\n\tif (!isRecord$1(contract)) return [];\n\tconst source = contract[\"source\"];\n\tconst output = contract[\"output\"];\n\tif (!isRecord$1(source) || typeof output !== \"string\") return [];\n\tconst inputs = source[\"inputs\"];\n\tif (!Array.isArray(inputs)) return [];\n\tlet emitted;\n\ttry {\n\t\temitted = getEmittedArtifactPaths(output);\n\t} catch (error) {\n\t\treturn [{\n\t\t\tsection: \"contract\",\n\t\t\tfield: \"contract.output\",\n\t\t\tmessage: error instanceof Error ? error.message : String(error)\n\t\t}];\n\t}\n\tconst emittedPaths = /* @__PURE__ */ new Set([normalize(emitted.jsonPath), normalize(emitted.dtsPath)]);\n\tif (!inputs.some((input) => typeof input === \"string\" && emittedPaths.has(normalize(input)))) return [];\n\treturn [{\n\t\tsection: \"contract\",\n\t\tfield: \"contract.source.inputs[]\",\n\t\tmessage: \"Config.contract.source.inputs must not include emitted artifact paths derived from contract.output\"\n\t}];\n}\nfunction validate(raw) {\n\tif (raw === void 0) return {\n\t\tok: false,\n\t\tdiagnostics: [sectionAbsentDiagnostic()]\n\t};\n\tif (!isRecord$1(raw)) return {\n\t\tok: false,\n\t\tdiagnostics: [notAnObjectDiagnostic()]\n\t};\n\tlet issues;\n\ttry {\n\t\tissues = [...collectConfigIssues(raw), ...collectArtifactCollisionIssues(raw)];\n\t} catch (error) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tdiagnostics: [unreadableDiagnostic(error)]\n\t\t};\n\t}\n\tif (issues.length > 0) return {\n\t\tok: false,\n\t\tdiagnostics: issues.map(issueDiagnostic)\n\t};\n\treturn {\n\t\tok: true,\n\t\tvalue: blindCast(raw),\n\t\tdiagnostics: []\n\t};\n}\nconst ormConfigSection = defineConfigSection({\n\tname: \"orm\",\n\tvalidate\n});\n//#endregion\n//#region src/orm/normalize-error.ts\n/**\n* `isStructuredError` is the repo's own check, and it is the one that matters here: it holds the\n* regular expression for a dotted `NAMESPACE.SUBCODE`, so only a code the protocol accepts\n* reaches `Diagnostic['code']`.\n*/\nfunction isRaisedError(error) {\n\treturn error instanceof Error && isStructuredError(error);\n}\n/**\n* The fallback for anything that is not a structured error: a bare throw, and also an error whose\n* `code` is not a dotted one — a Node `ENOENT`, say. The rejected code survives in `meta` rather\n* than in `code`, where it would produce a docs link to a page that does not exist.\n*/\nfunction toUnexpected(error) {\n\tconst summary = error instanceof Error ? error.message : String(error);\n\tconst rejectedCode = error instanceof Error ? Reflect.get(error, \"code\") : void 0;\n\treturn new CliStructuredError$1(\"CLI.UNEXPECTED\", summary, {\n\t\t...ifDefined(\"meta\", typeof rejectedCode === \"string\" ? { code: rejectedCode } : void 0),\n\t\tcause: error\n\t});\n}\n/**\n* Both classes name themselves `CliStructuredError`, so the engine's duck test\n* accepts prisma/prisma's too, and a CLI factory carrying typed actions looks\n* conformant without being one — its `toEnvelope` still writes `fix` and no\n* `nextActions`. Only an error the engine itself built is already in protocol\n* shape, and `@prisma/cli-engine` is an exact-pinned, unbundled dependency, so\n* there is one module instance and identity holds.\n*/\nfunction conformsToProtocol(error) {\n\treturn error instanceof CliStructuredError$1;\n}\n/**\n* Turns the transitional `fix` prose into typed actions. A multi-line fix is\n* several pieces of advice, so it becomes one action per line.\n*/\nfunction actionsFromFix(fix) {\n\tif (fix === void 0) return [];\n\treturn fix.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0).map((label) => ({\n\t\tkind: \"user-choice\",\n\t\tlabel\n\t}));\n}\n/**\n* Projects a prisma/prisma-raised error onto the engine's diagnostic shape.\n*/\nfunction toEngineDiagnostic(error) {\n\treturn {\n\t\tcode: error.code,\n\t\tseverity: error.severity ?? \"error\",\n\t\tsummary: error.message,\n\t\t...ifDefined(\"why\", error.why),\n\t\tnextActions: error.nextActions ?? actionsFromFix(error.fix),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\t...ifDefined(\"docsUrl\", error.docsUrl)\n\t};\n}\n/**\n* The handler boundary's single conversion. Handlers pass every error they\n* return through `notOk` — and every error a top-of-handler catch sees —\n* through this, so a settled envelope always carries `nextActions` and never\n* the non-protocol `fix` field.\n*/\nfunction normalizeError(error) {\n\tif (conformsToProtocol(error)) return error;\n\tif (!isRaisedError(error)) return toUnexpected(error);\n\tconst diagnostic = toEngineDiagnostic(error);\n\treturn new CliStructuredError$1(diagnostic.code, diagnostic.summary, {\n\t\tseverity: diagnostic.severity,\n\t\tnextActions: diagnostic.nextActions,\n\t\t...ifDefined(\"why\", diagnostic.why),\n\t\t...ifDefined(\"where\", diagnostic.where),\n\t\t...ifDefined(\"meta\", diagnostic.meta),\n\t\t...ifDefined(\"docsUrl\", diagnostic.docsUrl),\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/orm/define-command.ts\n/**\n* `defineCommand` with the ORM's error boundary already attached. Every ORM command is defined\n* through this rather than through `defineCommand` directly.\n*\n* Without it, an error a handler throws reaches the engine, whose duck test accepts\n* prisma/prisma's `CliStructuredError` — both classes carry that name — and then settles it\n* through fields the engine's own class has and this one does not. The envelope that results is\n* off-protocol. Catching here means every handler settles through the single conversion instead.\n*\n* An `InternalError` is the one thing this boundary does not convert. Its own contract says never\n* to catch it outside the outermost boundary: it means an invariant broke, which is a bug in\n* Prisma Next rather than something the user did. Re-throwing lets the engine settle it as a bug\n* at exit 1, where converting it would report the same number as a bad connection string.\n*/\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/**\n* Hands the handler a config whose paths are absolute. The engine's own\n* loader evaluates `prisma.config.ts` without touching the paths inside it, so\n* a command mounted in the unified host receives `contract.output` and\n* `migrations.dir` exactly as authored — usually relative — while this repo's\n* bin finalizes them in its loader. Anchoring here, on the section every ORM\n* command reads, makes both hosts hand handlers the same absolute paths.\n*\n* The anchor is the working directory: the engine discovers the config in the\n* working directory only, so that is the file's own directory. (A `--config`\n* pointing into another directory is not visible from a command context; a\n* relative path inside such a file resolves against the invocation directory,\n* which is also what the file's author sees the command run from.)\n* Finalization is idempotent — an already-absolute path resolves to itself —\n* so a config that arrived finalized passes through unchanged.\n*/\nfunction finalizedConfigContext(ctx) {\n\tif (!isRecord(ctx.config)) return ctx;\n\tconst config = blindCast(ctx.config);\n\treturn {\n\t\t...ctx,\n\t\tconfig: finalizeConfig(config, ctx.cwd)\n\t};\n}\nfunction defineOrmCommand(def) {\n\treturn defineCommand({\n\t\t...def,\n\t\thandler: async (args, ctx) => {\n\t\t\ttry {\n\t\t\t\treturn await def.handler(args, finalizedConfigContext(ctx));\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn notOk$1(normalizeError(error));\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\n//#region src/orm/progress.ts\nconst OUTCOMES = {\n\tok: \"ok\",\n\tskipped: \"skipped\",\n\terror: \"failed\"\n};\n/**\n* The control API's spans as engine events. A span's label is remembered when\n* it starts so the finishing event names the step with the same words.\n*/\nfunction controlProgressReporter(report) {\n\tconst labels = /* @__PURE__ */ new Map();\n\treturn (event) => {\n\t\tif (event.kind === \"spanStart\") {\n\t\t\tlabels.set(event.spanId, event.label);\n\t\t\treport({\n\t\t\t\tkind: \"step-started\",\n\t\t\t\tstep: event.label,\n\t\t\t\tid: event.spanId,\n\t\t\t\t...ifDefined(\"parentId\", event.parentSpanId)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst step = labels.get(event.spanId) ?? event.spanId;\n\t\tlabels.delete(event.spanId);\n\t\treport({\n\t\t\tkind: \"step-finished\",\n\t\t\tstep,\n\t\t\tid: event.spanId,\n\t\t\toutcome: OUTCOMES[event.outcome]\n\t\t});\n\t};\n}\n//#endregion\n//#region src/orm/contract/emit.ts\nfunction hashRows(document) {\n\treturn {\n\t\tkind: \"fields\",\n\t\trows: [\n\t\t\t{\n\t\t\t\tlabel: \"storageHash\",\n\t\t\t\tvalue: [{\n\t\t\t\t\ttext: document.storageHash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t},\n\t\t\t...document.executionHash === void 0 ? [] : [{\n\t\t\t\tlabel: \"executionHash\",\n\t\t\t\tvalue: [{\n\t\t\t\t\ttext: document.executionHash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t}],\n\t\t\t{\n\t\t\t\tlabel: \"profileHash\",\n\t\t\t\tvalue: [{\n\t\t\t\t\ttext: document.profileHash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t}\n\t\t]\n\t};\n}\nfunction emitPresentations(inputs) {\n\tconst { document, cwd } = inputs;\n\treturn {\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: relative(cwd, document.files.json)\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"types\",\n\t\t\t\t\tvalue: relative(cwd, document.files.dts)\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Emitted contract.json and contract.d.ts\"\n\t\t\t},\n\t\t\thashRows(document)\n\t\t],\n\t\tstdout: () => [document.files.json, document.files.dts],\n\t\tjson: () => document\n\t};\n}\nfunction createContractEmitCommand({ executeContractEmit }) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Emit your contract artifacts\",\n\t\t\tdescription: \"Reads your contract source (TypeScript or Prisma schema) and emits\\ncontract.json and contract.d.ts. The contract.json contains the canonical\\ncontract structure, and contract.d.ts provides TypeScript types for\\ntype-safe query building. Offline — does not consult the database.\",\n\t\t\texamples: [\n\t\t\t\t\"contract emit\",\n\t\t\t\t\"contract emit --output-path ./generated\",\n\t\t\t\t\"contract emit --json\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: { outputPath: flag.string({\n\t\t\tbrief: \"Directory to write contract.json and contract.d.ts into\",\n\t\t\tplaceholder: \"dir\"\n\t\t}) } },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst outputPath = args.flags.outputPath === void 0 ? void 0 : resolve(ctx.cwd, args.flags.outputPath);\n\t\t\tconst result = await executeContractEmit({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tonProgress: controlProgressReporter(ctx.report),\n\t\t\t\tsignal: ctx.signal,\n\t\t\t\t...ifDefined(\"outputPath\", outputPath)\n\t\t\t});\n\t\t\tif (result.validationWarning !== void 0) ctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: result.validationWarning\n\t\t\t});\n\t\t\tconst document = {\n\t\t\t\tok: true,\n\t\t\t\tstorageHash: result.storageHash,\n\t\t\t\t...ifDefined(\"executionHash\", result.executionHash),\n\t\t\t\tprofileHash: result.profileHash,\n\t\t\t\toutDir: dirname(result.files.json),\n\t\t\t\tfiles: result.files,\n\t\t\t\ttimings: { total: Date.now() - startedAt }\n\t\t\t};\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"verbose\",\n\t\t\t\ttext: `Total time: ${document.timings.total}ms`\n\t\t\t});\n\t\t\treturn ok$1(ctx.present({ data: document }, emitPresentations({\n\t\t\t\tdocument,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t})));\n\t\t}\n\t});\n}\nconst contractEmitCommand = createContractEmitCommand({ executeContractEmit });\n//#endregion\n//#region src/utils/publish-text-artifact.ts\n/**\n* Writes a generated file the way `contract emit` publishes its pair: the\n* bytes land in a temporary file beside the target and are renamed over it, so\n* a run interrupted mid-write leaves the previous file intact rather than a\n* truncated one.\n*/\nasync function publishTextArtifact(inputs) {\n\tconst directory = dirname(inputs.path);\n\tconst tempPath = join(directory, `.${basename(inputs.path)}.${process.pid}.${inputs.publicationToken}.next.tmp`);\n\tawait mkdir(directory, { recursive: true });\n\ttry {\n\t\tawait writeFile(tempPath, inputs.content, \"utf-8\");\n\t\tawait rename(tempPath, inputs.path);\n\t} finally {\n\t\tawait rm(tempPath, { force: true });\n\t}\n}\n//#endregion\n//#region src/orm/flags.ts\n/**\n* The database connection override, declared from here by every command that\n* accepts one so its brief and placeholder cannot drift apart. Resolution\n* order is the flag, then `config.db.connection`, then\n* `CONFIG.DB_CONNECTION_REQUIRED`.\n*/\nconst dbFlag = flag.string({\n\tbrief: \"Database connection string\",\n\tplaceholder: \"url\"\n});\n//#endregion\n//#region src/orm/contract/paths.ts\n/** The file `contract infer` writes when nothing names another. */\nconst INFERRED_CONTRACT_FILENAME = \"contract.prisma\";\n/**\n* Where `contract infer` writes the PSL it inferred: `--output`, else\n* `contract.prisma` beside the emitted contract, else `contract.prisma` in the\n* invocation directory.\n*/\nfunction inferredContractPathFor(inputs) {\n\tif (inputs.output !== void 0) return resolve(inputs.cwd, inputs.output);\n\tconst contractOutput = inputs.config.contract?.output;\n\tif (contractOutput !== void 0) return join(dirname(resolve(inputs.cwd, contractOutput)), INFERRED_CONTRACT_FILENAME);\n\treturn join(inputs.cwd, INFERRED_CONTRACT_FILENAME);\n}\n//#endregion\n//#region src/orm/contract/infer.ts\nfunction inferPresentations(inputs) {\n\tconst { document, database } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [...database === void 0 ? [] : [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: database\n\t\t\t}]\n\t\t}], {\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [{ text: \"Contract written to \" }, {\n\t\t\t\ttext: document.psl.path,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createContractInferCommand({ createControlClient, printPsl }) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Infer a PSL contract from the live database schema\",\n\t\t\tdescription: \"Reads the live database schema and writes an inferred PSL contract to\\ndisk. This command stops at contract.prisma; follow it with\\n`contract emit` and `db sign` as separate steps. An existing file at the\\noutput path is overwritten, with a warning.\",\n\t\t\texamples: [\n\t\t\t\t\"contract infer --db $DATABASE_URL\",\n\t\t\t\t\"contract infer --db $DATABASE_URL --output ./src/prisma/contract.prisma\",\n\t\t\t\t\"contract infer --json\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\toutput: flag.string({\n\t\t\t\tbrief: \"Write the inferred PSL contract to the specified path\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\t\tif (dbConnection === void 0) return notOk$1(normalizeError(errorDatabaseConnectionRequired({\n\t\t\t\twhy: \"Database connection is required for contract infer (set db.connection in prisma.config.ts, or pass --db <url>)\",\n\t\t\t\tcommandName: \"contract infer\",\n\t\t\t\tmissingFlags: [\"--db\"]\n\t\t\t})));\n\t\t\tif (ctx.config.driver === void 0) return notOk$1(normalizeError(errorDriverRequired({ why: \"Config.driver is required for contract infer\" })));\n\t\t\tconst client = createControlClient({\n\t\t\t\tfamily: ctx.config.family,\n\t\t\t\ttarget: ctx.config.target,\n\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\tdriver: ctx.config.driver,\n\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t});\n\t\t\tlet pslContent;\n\t\t\ttry {\n\t\t\t\tconst schema = await client.introspect({\n\t\t\t\t\tconnection: dbConnection,\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report)\n\t\t\t\t});\n\t\t\t\tconst pslContractAst = client.inferPslContract(schema);\n\t\t\t\tif (pslContractAst === void 0) return notOk$1(normalizeError(errorRuntime(\"CONTRACT.INFER_UNSUPPORTED\", \"contract infer is not supported for this family\", {\n\t\t\t\t\twhy: \"The configured family does not implement the PslContractInferCapable capability, so an inferred PSL contract cannot be produced from the live database schema.\",\n\t\t\t\t\tfix: \"Use a family that supports contract inference (e.g. SQL/Postgres).\"\n\t\t\t\t})));\n\t\t\t\tpslContent = printPsl(pslContractAst, { pslBlockDescriptors: client.getPslBlockDescriptors() });\n\t\t\t} catch (error) {\n\t\t\t\tif (CliStructuredError$2.is(error)) return notOk$1(normalizeError(error));\n\t\t\t\tconst safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === \"string\" ? dbConnection : void 0);\n\t\t\t\treturn notOk$1(normalizeError(errorUnexpected(safeMessage, { why: `Unexpected error during contract infer: ${safeMessage}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tconst outputPath = inferredContractPathFor({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\toutput: args.flags.output\n\t\t\t});\n\t\t\tconst displayPath = relative(ctx.cwd, outputPath);\n\t\t\tif (existsSync(outputPath)) ctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: `Overwriting existing file: ${displayPath}`\n\t\t\t});\n\t\t\tawait publishTextArtifact({\n\t\t\t\tpath: outputPath,\n\t\t\t\tcontent: pslContent,\n\t\t\t\tpublicationToken: String(process.hrtime.bigint())\n\t\t\t});\n\t\t\tconst database = typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0;\n\t\t\tconst document = {\n\t\t\t\tok: true,\n\t\t\t\tsummary: \"Contract inferred successfully\",\n\t\t\t\ttarget: {\n\t\t\t\t\tfamilyId: ctx.config.family.familyId,\n\t\t\t\t\tid: ctx.config.target.targetId\n\t\t\t\t},\n\t\t\t\tpsl: { path: displayPath },\n\t\t\t\tmeta: { ...ifDefined(\"dbUrl\", database) },\n\t\t\t\ttimings: { total: Date.now() - startedAt }\n\t\t\t};\n\t\t\treturn ok$1(ctx.present({ data: document }, inferPresentations({\n\t\t\t\tdocument,\n\t\t\t\tdatabase\n\t\t\t})));\n\t\t}\n\t});\n}\nconst contractInferCommand = createContractInferCommand({\n\tcreateControlClient,\n\tprintPsl\n});\n//#endregion\n//#region src/utils/db-init-failure.ts\nfunction markerMismatchDetail(failure) {\n\tconst parts = [];\n\tif (failure.marker?.storageHash !== failure.destination?.storageHash && failure.marker?.storageHash && failure.destination?.storageHash) parts.push(`storageHash (marker: ${failure.marker.storageHash}, destination: ${failure.destination.storageHash})`);\n\tif (failure.marker?.profileHash !== failure.destination?.profileHash && failure.marker?.profileHash && failure.destination?.profileHash) parts.push(`profileHash (marker: ${failure.marker.profileHash}, destination: ${failure.destination.profileHash})`);\n\treturn parts.length > 0 ? ` Mismatch in ${parts.join(\" and \")}.` : \"\";\n}\n/**\n* A `db init` failure as the CLI's structured error.\n*\n* The `assertNever` is deliberate: a control-API failure code this does not\n* handle must stop the command rather than degrade into a generic message.\n*/\nfunction mapDbInitFailure(failure) {\n\tif (failure.code === \"PLANNING_FAILED\") return errorMigrationPlanningFailed({ conflicts: failure.conflicts ?? [] });\n\tif (failure.code === \"MIGRATION.MARKER_ORIGIN_MISMATCH\") return errorRuntime(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing database signature does not match plan destination.${markerMismatchDetail(failure)}`, {\n\t\twhy: \"Database has an existing signature (marker) that does not match the target contract\",\n\t\tfix: \"If bootstrapping, drop/reset the database then re-run `prisma-cli db init`; otherwise reconcile schema/marker using your migration workflow\",\n\t\tmeta: {\n\t\t\t...ifDefined(\"markerStorageHash\", failure.marker?.storageHash),\n\t\t\t...ifDefined(\"destinationStorageHash\", failure.destination?.storageHash),\n\t\t\t...ifDefined(\"markerProfileHash\", failure.marker?.profileHash),\n\t\t\t...ifDefined(\"destinationProfileHash\", failure.destination?.profileHash)\n\t\t}\n\t});\n\tif (failure.code === \"RUNNER_FAILED\") {\n\t\tconst fix = (typeof failure.meta?.[\"runnerErrorCode\"] === \"string\" ? failure.meta[\"runnerErrorCode\"] : void 0) === \"MIGRATION.LEGACY_MARKER_SHAPE\" ? \"Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma-cli db init` to recreate it with the current per-space schema.\" : \"Fix the schema mismatch (db init is additive-only), or drop/reset the database and re-run `prisma-cli db init`\";\n\t\treturn errorRunnerFailed(failure.summary, {\n\t\t\twhy: failure.why ?? \"Migration runner failed\",\n\t\t\tfix,\n\t\t\t...ifDefined(\"meta\", failure.meta),\n\t\t\t...ifDefined(\"cause\", failure.cause)\n\t\t});\n\t}\n\tconst exhaustive = failure.code;\n\treturn assertNever(exhaustive, `Unhandled DbInitFailure code: ${String(exhaustive)}`);\n}\n//#endregion\n//#region src/utils/formatters/migrations.ts\n/**\n* Render a single statement of an `OperationPreview` for the human-readable\n* preview block. SQL statements get a trailing `;` if missing so the rendered\n* preview is byte-identical to the legacy `string[]`-based renderer for SQL\n* targets. Other languages (`'mongodb-shell'`) render verbatim.\n*/\nfunction renderPreviewStatement(text, language) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return void 0;\n\tif (language === \"sql\") return trimmed.endsWith(\";\") ? trimmed : `${trimmed};`;\n\treturn trimmed;\n}\n/**\n* Choose the header label for a preview block. SQL-only previews keep the\n* legacy `DDL preview` label so the rendered output is byte-identical to the\n* pre-aggregate SQL CLI; previews from any other family — or a mix that\n* includes any non-SQL language — use the family-agnostic `Operation preview`\n* label.\n*\n* An empty `statements` array deliberately renders as `Operation preview`\n* rather than `DDL preview`: `Array.prototype.every` is vacuously true for\n* empty arrays, but we have no evidence the preview is SQL-only when no\n* statements are present, so the family-agnostic label is the safer default.\n*/\nfunction previewBlockHeader(preview) {\n\treturn preview.statements.length > 0 && preview.statements.every((s) => s.language === \"sql\") ? \"DDL preview\" : \"Operation preview\";\n}\n//#endregion\n//#region src/orm/db/migration-blocks.ts\nfunction operationNode(operation) {\n\treturn operation.operationClass === \"destructive\" ? {\n\t\tlabel: operation.label,\n\t\tstatus: \"warn\"\n\t} : { label: operation.label };\n}\nfunction spaceLabel(space) {\n\treturn space.kind === \"app\" ? \"App space\" : `Extension space: ${space.spaceId}`;\n}\n/**\n* One root per contract space, in the schedule order the runner used. A\n* space's post-apply marker is the last child of its own space, so the engine\n* draws it under the operations it signs.\n*/\nfunction spaceNodes(perSpace, mode) {\n\treturn perSpace.map((space) => ({\n\t\tlabel: [{\n\t\t\ttext: spaceLabel(space),\n\t\t\ttone: \"identifier\"\n\t\t}],\n\t\tchildren: [...space.operations.length === 0 ? [{ label: [{\n\t\t\ttext: \"(no operations)\",\n\t\t\ttone: \"muted\"\n\t\t}] }] : space.operations.map(operationNode), ...mode === \"apply\" && space.marker !== void 0 ? [{ label: [{\n\t\t\ttext: \"marker \",\n\t\t\ttone: \"muted\"\n\t\t}, {\n\t\t\ttext: space.marker.storageHash,\n\t\t\ttone: \"identifier\"\n\t\t}] }] : []]\n\t}));\n}\nfunction destructiveWarningBlocks(hasDestructive) {\n\treturn hasDestructive ? [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"This migration contains destructive operations that may cause data loss.\"\n\t}] : [];\n}\n/**\n* The planned or executed operations. The per-space breakdown is the shape the\n* aggregate flow produces; the flat tree is the fallback for a result that\n* carries no breakdown.\n*/\nfunction perSpaceBlocks(perSpace, mode) {\n\tconst hasDestructive = perSpace.some((space) => space.operations.some((operation) => operation.operationClass === \"destructive\"));\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: spaceNodes(perSpace, mode)\n\t}, ...destructiveWarningBlocks(hasDestructive)];\n}\nfunction operationBlocks$2(result) {\n\tconst perSpace = result.perSpace;\n\tif (perSpace !== void 0 && perSpace.length > 0) return perSpaceBlocks(perSpace, result.mode);\n\tif (result.plan.operations.length === 0) return [];\n\tconst hasDestructive = result.plan.operations.some((operation) => operation.operationClass === \"destructive\");\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: result.plan.operations.map(operationNode)\n\t}, ...destructiveWarningBlocks(hasDestructive)];\n}\n/** The statements a database would run, printed verbatim rather than laid out. */\nfunction previewBlocks$2(preview) {\n\tif (preview === void 0) return [];\n\tconst header = {\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: previewBlockHeader(preview)\n\t};\n\tconst statements = preview.statements.map((statement) => renderPreviewStatement(statement.text, statement.language)).filter((text) => text !== void 0);\n\treturn statements.length === 0 ? [header, {\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: \"No operations.\"\n\t}] : [header, {\n\t\tkind: \"drawing\",\n\t\tlines: statements\n\t}];\n}\n/**\n* What the planner flagged without refusing to plan it. Only `db update`\n* produces these — the additive-only policies cannot reach the branch.\n*/\nfunction plannerWarningBlocks(result) {\n\tconst warnings = result.warnings ?? [];\n\tif (warnings.length === 0) return [];\n\treturn [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"Planner warnings\"\n\t}, {\n\t\tkind: \"list\",\n\t\titems: warnings.map((warning) => warning.summary)\n\t}];\n}\nfunction planSummaryText(result) {\n\tconst operations = result.plan.operations.length;\n\tconst spaces = result.perSpace?.length ?? 0;\n\treturn spaces > 0 ? `Planned ${operations} operation(s) across ${spaces} contract space${spaces === 1 ? \"\" : \"s\"}` : `Planned ${operations} operation(s)`;\n}\nfunction applySummaryText(result) {\n\tconst executed = result.execution?.operationsExecuted ?? 0;\n\tconst spaces = result.perSpace?.length ?? 0;\n\tconst across = spaces > 0 ? ` across ${spaces} contract space${spaces === 1 ? \"\" : \"s\"}` : \"\";\n\tif (executed === 0) return `Database already matches contract${across}`;\n\treturn `Applied ${executed} operation(s)${across}`;\n}\nfunction planBlocks$1(result) {\n\tconst planned = result.plannedAdvanceRef;\n\treturn [\n\t\t{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: planSummaryText(result)\n\t\t},\n\t\t...plannerWarningBlocks(result),\n\t\t...operationBlocks$2(result),\n\t\t{\n\t\t\tkind: \"fields\",\n\t\t\trows: [{\n\t\t\t\tlabel: \"destination\",\n\t\t\t\tvalue: [{\n\t\t\t\t\ttext: result.plan.destination.storageHash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t}]\n\t\t},\n\t\t...planned === null || planned === void 0 ? [] : [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: [{ text: `Would advance ref \"${planned.name}\" → ` }, {\n\t\t\t\ttext: planned.hash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}],\n\t\t...previewBlocks$2(result.plan.preview),\n\t\t{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttone: \"muted\",\n\t\t\ttext: \"This is a dry run. No changes were applied.\"\n\t\t}\n\t];\n}\n/**\n* The app-space marker, for a result that carried no per-space breakdown. The\n* label names what the marker covers rather than calling it \"the\" signature.\n*/\nfunction fallbackMarkerBlocks(result) {\n\tconst marker = result.marker;\n\tif (marker === void 0 || result.perSpace !== void 0 && result.perSpace.length > 0) return [];\n\treturn [{\n\t\tkind: \"fields\",\n\t\trows: [{\n\t\t\tlabel: \"App-space marker\",\n\t\t\tvalue: [{\n\t\t\t\ttext: marker.storageHash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}, ...marker.profileHash === void 0 ? [] : [{\n\t\t\tlabel: \"Profile hash\",\n\t\t\tvalue: [{\n\t\t\t\ttext: marker.profileHash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}]]\n\t}];\n}\nfunction applyBlocks(result) {\n\tconst advanced = result.advancedRef;\n\treturn [\n\t\t{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: applySummaryText(result)\n\t\t},\n\t\t...plannerWarningBlocks(result),\n\t\t...operationBlocks$2(result),\n\t\t...fallbackMarkerBlocks(result),\n\t\t...advanced === null || advanced === void 0 ? [] : [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [{ text: `Advanced ref \"${advanced.name}\" → ` }, {\n\t\t\t\ttext: advanced.hash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}]\n\t];\n}\n/** What a `db init` / `db update` result looks like in human mode. */\nfunction migrationResultBlocks(result) {\n\treturn result.mode === \"plan\" ? planBlocks$1(result) : applyBlocks(result);\n}\n/** Where the user goes next, as typed actions rather than trailing prose. */\nfunction migrationResultNextActions(result, applyCommand) {\n\treturn result.mode === \"plan\" ? [runCommandAction(\"Apply the planned operations\", applyCommand)] : [runCommandAction(result.perSpace !== void 0 && result.perSpace.length === 1 ? \"Confirm the space is up to date\" : \"Confirm every space is up to date\", \"prisma-cli migration status\")];\n}\n//#endregion\n//#region src/orm/migration/paths.ts\n/**\n* Where migrations live for this project. Resolved against the invocation\n* directory, which is also the config file's directory for every default\n* invocation.\n*/\nfunction migrationsDirFor(config, cwd) {\n\treturn resolve(cwd, config.migrations?.dir ?? \"migrations\");\n}\n/** The app subspace under {@link migrationsDirFor}. */\nfunction appMigrationsDirFor(config, cwd) {\n\treturn spaceMigrationDirectory(migrationsDirFor(config, cwd), APP_SPACE_ID);\n}\n/**\n* The config file an operation should anchor its project paths on. The engine\n* loads the config and hands a handler the value but not the path, and\n* `--config` is an engine flag the handler never sees, so a handler names the\n* invocation directory's file. That equals the loaded file for every\n* invocation whose config sits in the invocation directory.\n*/\nfunction projectConfigPathFor(cwd) {\n\treturn resolve(cwd, \"prisma.config.ts\");\n}\n/**\n* Where refs live. The framework keeps them under the app subspace rather than\n* at the migrations root.\n*/\nfunction appRefsDirFor(config, cwd) {\n\treturn resolve(appMigrationsDirFor(config, cwd), \"refs\");\n}\n/**\n* The emitted contract. The config loader has already resolved\n* `contract.output` against the config file's directory, so this only has an\n* effect for a config handed in raw, as tests do.\n*/\nfunction contractPathFor(config, cwd) {\n\tconst output = config.contract?.output;\n\treturn output === void 0 ? void 0 : resolve(cwd, output);\n}\n/**\n* The header's rendering of a path: relative to where the user invoked the\n* CLI, as the commander shell rendered it against the config file.\n*/\nfunction displayPath(path, cwd) {\n\treturn relative(cwd, path);\n}\n//#endregion\n//#region src/orm/db/prepare.ts\n/** Reads the emitted contract as the raw document the control API validates. */\nasync function readContractDocument(contractPath) {\n\tlet content;\n\ttry {\n\t\tcontent = await readFile(contractPath, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(Reflect.get(Object(error), \"code\") === \"ENOENT\" ? errorFileNotFound(contractPath, {\n\t\t\twhy: `Contract file not found at ${contractPath}`,\n\t\t\tfix: \"Run `prisma-cli contract emit` to generate contract.json, or update `contract.output` in prisma.config.ts\"\n\t\t}) : errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}` })));\n\t}\n\ttry {\n\t\treturn ok$1(castAs(JSON.parse(content)));\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(errorContractValidationFailed(`Contract JSON is invalid: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPath } })));\n\t}\n}\nasync function prepareMigrationRun(inputs) {\n\tconst { config, cwd, commandName } = inputs;\n\tconst contractPath = contractPathFor(config, cwd);\n\tif (contractPath === void 0) return notOk$1(normalizeError(errorConfigValidation(\"contract.output\", {\n\t\twhy: `${commandName} reads the emitted contract from config.contract.output; the config has no value to read.`,\n\t\tsection: \"contract\"\n\t})));\n\tconst contract = await readContractDocument(contractPath);\n\tif (!contract.ok) return notOk$1(contract.failure);\n\tconst dbConnection = inputs.db ?? config.db?.connection;\n\tif (dbConnection === void 0) return notOk$1(normalizeError(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${commandName} (set db.connection in prisma.config.ts, or pass --db <url>)`,\n\t\tcommandName,\n\t\tmissingFlags: [\"--db\"]\n\t})));\n\tif (config.driver === void 0) return notOk$1(normalizeError(errorDriverRequired({ why: `Config.driver is required for ${commandName}` })));\n\tif (!targetSupportsMigrations(config.target)) return notOk$1(normalizeError(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` })));\n\treturn ok$1({\n\t\tclient: inputs.createClient({\n\t\t\tfamily: config.family,\n\t\t\ttarget: config.target,\n\t\t\tadapter: config.adapter,\n\t\t\tdriver: config.driver,\n\t\t\textensions: config.extensions ?? []\n\t\t}),\n\t\tcontractJson: contract.value,\n\t\tcontractPath,\n\t\tcontractDisplayPath: displayPath(contractPath, cwd),\n\t\tdbConnection,\n\t\tdatabase: typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0,\n\t\tmigrationsDir: migrationsDirFor(config, cwd),\n\t\trefsDir: appRefsDirFor(config, cwd)\n\t});\n}\n//#endregion\n//#region src/orm/db/init.ts\nfunction initPresentations$1(inputs) {\n\tconst { document, database, dryRun } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t},\n\t\t\t\t...database === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\tvalue: database\n\t\t\t\t}],\n\t\t\t\t...dryRun ? [{\n\t\t\t\t\tlabel: \"mode\",\n\t\t\t\t\tvalue: \"dry run\"\n\t\t\t\t}] : []\n\t\t\t]\n\t\t}, ...migrationResultBlocks(document)],\n\t\tjson: () => document,\n\t\tnext: () => migrationResultNextActions(document, \"prisma-cli db init\")\n\t};\n}\nfunction initDocument(inputs) {\n\tconst { value } = inputs;\n\treturn {\n\t\tok: true,\n\t\tmode: value.mode,\n\t\tplan: {\n\t\t\ttargetId: inputs.targetId,\n\t\t\tdestination: {\n\t\t\t\tstorageHash: value.destination.storageHash,\n\t\t\t\t...ifDefined(\"profileHash\", value.destination.profileHash)\n\t\t\t},\n\t\t\toperations: value.plan.operations.map((operation) => ({\n\t\t\t\tid: operation.id,\n\t\t\t\tlabel: operation.label,\n\t\t\t\toperationClass: operation.operationClass\n\t\t\t})),\n\t\t\t...ifDefined(\"preview\", value.plan.preview)\n\t\t},\n\t\t...value.execution === void 0 ? {} : { execution: {\n\t\t\toperationsPlanned: value.execution.operationsPlanned,\n\t\t\toperationsExecuted: value.execution.operationsExecuted\n\t\t} },\n\t\t...value.marker === void 0 ? {} : { marker: {\n\t\t\tstorageHash: value.marker.storageHash,\n\t\t\t...ifDefined(\"profileHash\", value.marker.profileHash)\n\t\t} },\n\t\t...ifDefined(\"perSpace\", value.perSpace),\n\t\tadvancedRef: inputs.advancedRef,\n\t\tplannedAdvanceRef: inputs.plannedAdvanceRef,\n\t\tsummary: value.summary,\n\t\ttimings: { total: Date.now() - inputs.startedAt }\n\t};\n}\nfunction createDbInitCommand(createClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Bootstrap a database to match the current contract and sign it\",\n\t\t\tdescription: \"Creates everything the emitted contract declares and the database does not\\nhave yet, using additive operations only. Structures already in place and\\ncompatible are left alone, a conflict that would need a destructive change\\nstops the run, and the database is signed with the contract it now matches.\\nUse --dry-run to see the operations without applying them.\",\n\t\t\texamples: [\n\t\t\t\t\"db init\",\n\t\t\t\t\"db init --db $DATABASE_URL\",\n\t\t\t\t\"db init --dry-run\",\n\t\t\t\t\"db init --advance-ref production\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\tdryRun: flag.boolean({ brief: \"Preview the planned operations without applying them\" }),\n\t\t\tadvanceRef: flag.string({\n\t\t\t\tbrief: \"Advance the named ref to the post-command contract hash\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst prepared = await prepareMigrationRun({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tcommandName: \"db init\",\n\t\t\t\tcreateClient\n\t\t\t});\n\t\t\tif (!prepared.ok) return notOk$1(prepared.failure);\n\t\t\tconst { client, contractJson, contractPath, dbConnection, migrationsDir, refsDir } = prepared.value;\n\t\t\tlet document;\n\t\t\ttry {\n\t\t\t\tawait client.connect(dbConnection);\n\t\t\t\tconst result = await client.dbInit({\n\t\t\t\t\tcontract: contractJson,\n\t\t\t\t\tmode: args.flags.dryRun ? \"plan\" : \"apply\",\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report)\n\t\t\t\t});\n\t\t\t\tif (!result.ok) return notOk$1(normalizeError(mapDbInitFailure(result.failure)));\n\t\t\t\tconst advancementHash = result.value.mode === \"apply\" ? result.value.marker?.storageHash ?? result.value.destination.storageHash : result.value.destination.storageHash;\n\t\t\t\tconst advancement = await resolveRefAdvancementFields({\n\t\t\t\t\t...ifDefined(\"advanceRef\", args.flags.advanceRef),\n\t\t\t\t\t...ifDefined(\"db\", args.flags.db),\n\t\t\t\t\trefsDir,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tcontractJson,\n\t\t\t\t\tcontractJsonPath: contractPath,\n\t\t\t\t\tmode: result.value.mode,\n\t\t\t\t\thash: advancementHash\n\t\t\t\t});\n\t\t\t\tif (!advancement.ok) return notOk$1(normalizeError(advancement.failure));\n\t\t\t\tdocument = initDocument({\n\t\t\t\t\tvalue: result.value,\n\t\t\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\t\t\tadvancedRef: advancement.value.advancedRef,\n\t\t\t\t\tplannedAdvanceRef: advancement.value.plannedAdvanceRef,\n\t\t\t\t\tstartedAt\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (CliStructuredError$2.is(error)) return notOk$1(normalizeError(error));\n\t\t\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk$1(normalizeError(errorContractValidationFailed(`Contract validation failed: ${error.message}`, { where: { path: contractPath } })));\n\t\t\t\tconst safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === \"string\" ? dbConnection : void 0);\n\t\t\t\treturn notOk$1(normalizeError(errorUnexpected(safeMessage, { why: `Unexpected error during db init: ${safeMessage}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"verbose\",\n\t\t\t\ttext: `Total time: ${document.timings.total}ms`\n\t\t\t});\n\t\t\treturn ok$1(ctx.present({ data: document }, initPresentations$1({\n\t\t\t\tdocument,\n\t\t\t\tcontractPath: prepared.value.contractDisplayPath,\n\t\t\t\tdatabase: prepared.value.database,\n\t\t\t\tdryRun: args.flags.dryRun\n\t\t\t})));\n\t\t}\n\t});\n}\nconst dbInitCommand = createDbInitCommand(createControlClient);\n//#endregion\n//#region src/orm/db/schema.ts\nconst SUMMARY = \"Schema read successfully\";\n/**\n* A leading keyword and the name it introduces: `<keyword> <name>`, or\n* `<keyword>: <name>`. The keyword recedes and the name is the identifier.\n*/\nfunction keywordThenName(label) {\n\tconst colon = label.match(/^(.+?):\\s*(\\S.*)$/);\n\tif (colon?.[1] !== void 0 && colon[2] !== void 0) return [\n\t\t{\n\t\t\ttext: colon[1],\n\t\t\ttone: \"muted\"\n\t\t},\n\t\t{ text: \": \" },\n\t\t{\n\t\t\ttext: colon[2],\n\t\t\ttone: \"identifier\"\n\t\t}\n\t];\n\tconst spaced = label.match(/^(\\S.*\\S|\\S+)\\s+(\\S+)$/);\n\tif (spaced?.[1] !== void 0 && spaced[2] !== void 0) return [\n\t\t{\n\t\t\ttext: spaced[1],\n\t\t\ttone: \"muted\"\n\t\t},\n\t\t{ text: \" \" },\n\t\t{\n\t\t\ttext: spaced[2],\n\t\t\ttone: \"identifier\"\n\t\t}\n\t];\n}\n/** `<name>: <detail> (<qualifier>)` — the name leads and the qualifier recedes. */\nfunction namedDetail(label) {\n\tconst parts = label.match(/^([^:]+):\\s*(.+)$/);\n\tif (parts?.[1] === void 0 || parts[2] === void 0) return;\n\tconst [, name, rest] = parts;\n\tconst qualified = rest.match(/^([^\\s(]+)\\s*(\\([^)]+\\))$/);\n\tif (qualified?.[1] !== void 0 && qualified[2] !== void 0) return [\n\t\t{\n\t\t\ttext: name,\n\t\t\ttone: \"identifier\"\n\t\t},\n\t\t{ text: `: ${qualified[1]} ` },\n\t\t{\n\t\t\ttext: qualified[2],\n\t\t\ttone: \"muted\"\n\t\t}\n\t];\n\treturn [{\n\t\ttext: name,\n\t\ttone: \"identifier\"\n\t}, { text: `: ${rest}` }];\n}\n/** `<name> <rest>` — the name leads and the prose behind it recedes. */\nfunction nameThenProse(label) {\n\tconst parts = label.match(/^(\\S+)\\s+(\\S.*)$/);\n\tif (parts?.[1] === void 0 || parts[2] === void 0) return;\n\treturn [\n\t\t{\n\t\t\ttext: parts[1],\n\t\t\ttone: \"identifier\"\n\t\t},\n\t\t{ text: \" \" },\n\t\t{\n\t\t\ttext: parts[2],\n\t\t\ttone: \"muted\"\n\t\t}\n\t];\n}\n/**\n* What a schema node's label means, said in tones.\n*\n* The families phrase these labels themselves, so the shapes recognised here\n* are positional (`<keyword> <name>`, `<name>: <detail>`) rather than a list of\n* words: a family that renames a keyword keeps its colouring, and no family's\n* vocabulary is written down in the framework layer.\n*/\nfunction labelSpans(node) {\n\tswitch (node.kind) {\n\t\tcase \"root\": return [{\n\t\t\ttext: node.label,\n\t\t\ttone: \"emphasis\"\n\t\t}];\n\t\tcase \"collection\": return [{\n\t\t\ttext: node.label,\n\t\t\ttone: \"muted\"\n\t\t}];\n\t\tcase \"entity\":\n\t\tcase \"index\": return keywordThenName(node.label) ?? [{\n\t\t\ttext: node.label,\n\t\t\ttone: \"identifier\"\n\t\t}];\n\t\tcase \"field\": return namedDetail(node.label) ?? [{ text: node.label }];\n\t\tcase \"dependency\": return nameThenProse(node.label) ?? [{\n\t\t\ttext: node.label,\n\t\t\ttone: \"identifier\"\n\t\t}];\n\t\tdefault: return [{ text: node.label }];\n\t}\n}\nfunction treeNode(node) {\n\treturn {\n\t\tlabel: labelSpans(node),\n\t\t...ifDefined(\"children\", node.children === void 0 || node.children.length === 0 ? void 0 : node.children.map(treeNode))\n\t};\n}\nfunction schemaPresentations$1(inputs) {\n\tconst { document, schemaView, database } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [...database === void 0 ? [] : [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: database\n\t\t\t}]\n\t\t}], schemaView === void 0 ? {\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: document.summary\n\t\t} : {\n\t\t\tkind: \"tree\",\n\t\t\troots: [treeNode(schemaView.root)]\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createDbSchemaCommand(createClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Inspect the live database schema\",\n\t\t\tdescription: \"Reads the live database schema and prints it as a tree, or as the result\\ndocument with --json. Always read-only: it never writes a file and never\\nchanges the database.\",\n\t\t\texamples: [\n\t\t\t\t\"db schema\",\n\t\t\t\t\"db schema --db $DATABASE_URL\",\n\t\t\t\t\"db schema --json\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: { db: dbFlag } },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\t\tif (dbConnection === void 0) return notOk$1(normalizeError(errorDatabaseConnectionRequired({\n\t\t\t\twhy: \"Database connection is required for db schema (set db.connection in prisma.config.ts, or pass --db <url>)\",\n\t\t\t\tcommandName: \"db schema\",\n\t\t\t\tmissingFlags: [\"--db\"]\n\t\t\t})));\n\t\t\tif (ctx.config.driver === void 0) return notOk$1(normalizeError(errorDriverRequired({ why: \"Config.driver is required for db schema\" })));\n\t\t\tconst client = createClient({\n\t\t\t\tfamily: ctx.config.family,\n\t\t\t\ttarget: ctx.config.target,\n\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\tdriver: ctx.config.driver,\n\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t});\n\t\t\tlet schema;\n\t\t\tlet schemaView;\n\t\t\ttry {\n\t\t\t\tschema = await client.introspect({\n\t\t\t\t\tconnection: dbConnection,\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report)\n\t\t\t\t});\n\t\t\t\tschemaView = client.toSchemaView(schema);\n\t\t\t} catch (error) {\n\t\t\t\tif (CliStructuredError$2.is(error)) return notOk$1(normalizeError(error));\n\t\t\t\tconst safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === \"string\" ? dbConnection : void 0);\n\t\t\t\treturn notOk$1(normalizeError(errorUnexpected(safeMessage, { why: `Unexpected error during db schema: ${safeMessage}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tconst database = typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0;\n\t\t\tconst document = {\n\t\t\t\tok: true,\n\t\t\t\tsummary: SUMMARY,\n\t\t\t\ttarget: {\n\t\t\t\t\tfamilyId: ctx.config.family.familyId,\n\t\t\t\t\tid: ctx.config.target.targetId\n\t\t\t\t},\n\t\t\t\tschema,\n\t\t\t\tmeta: { ...ifDefined(\"dbUrl\", database) },\n\t\t\t\ttimings: { total: Date.now() - startedAt }\n\t\t\t};\n\t\t\treturn ok$1(ctx.present({ data: document }, schemaPresentations$1({\n\t\t\t\tdocument,\n\t\t\t\tschemaView,\n\t\t\t\tdatabase\n\t\t\t})));\n\t\t}\n\t});\n}\nconst dbSchemaCommand = createDbSchemaCommand(createControlClient);\n//#endregion\n//#region src/orm/db/verification.ts\n/**\n* Reads the emitted contract and hydrates it through the family's\n* `deserializeContract` seam, which is where every other on-disk contract read\n* in this CLI crosses into family types.\n*/\nasync function readEmittedContract(inputs) {\n\tconst path = contractPathFor(inputs.config, inputs.cwd);\n\tif (path === void 0) return notOk$1(normalizeError(errorConfigValidation(\"contract.output\", {\n\t\twhy: `${inputs.commandName} reads the emitted contract from config.contract.output; the config has no value to read.`,\n\t\tsection: \"contract\"\n\t})));\n\tconst relativePath = displayPath(path, inputs.cwd);\n\tlet content;\n\ttry {\n\t\tcontent = await readFile(path, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(Reflect.get(Object(error), \"code\") === \"ENOENT\" ? errorFileNotFound(path, {\n\t\t\twhy: `Contract file not found at ${path}`,\n\t\t\tfix: `Run \\`prisma-cli contract emit\\` to generate ${relativePath}, or update \\`contract.output\\` in prisma.config.ts`\n\t\t}) : errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}` })));\n\t}\n\tconst familyInstance = inputs.config.family.create(createControlStack(inputs.config));\n\ttry {\n\t\treturn ok$1({\n\t\t\tcontract: familyInstance.deserializeContract(castAs(JSON.parse(content))),\n\t\t\tpath,\n\t\t\tdisplayPath: relativePath\n\t\t});\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(errorContractValidationFailed(`Contract JSON is invalid: ${error instanceof Error ? error.message : String(error)}`, { where: { path } })));\n\t}\n}\n/**\n* The connection and driver both verification commands need. Returns the\n* resolved connection or the precondition failure that stopped the run.\n*/\nfunction requireVerifyConnection(inputs) {\n\tconst dbConnection = inputs.db ?? inputs.config.db?.connection;\n\tif (typeof dbConnection !== \"string\" || dbConnection.length === 0) return notOk$1(normalizeError(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${inputs.invocation} (set db.connection in prisma.config.ts, or pass --db <url>)`,\n\t\tmissingFlags: [\"--db\"],\n\t\tretryCommand: `prisma-cli ${inputs.invocation} --db <url>`\n\t})));\n\tif (inputs.config.driver === void 0) return notOk$1(normalizeError(errorDriverRequired({ why: `Config.driver is required for ${inputs.invocation}` })));\n\treturn ok$1(dbConnection);\n}\n/**\n* A failure the verification could not recover from — a dropped connection, a\n* driver throw — as a settlement the user can act on. Connection strings are\n* stripped from the prose whichever path the value took. A driver error\n* carrying `ECONNREFUSED`, `ENOTFOUND` or a SQLSTATE has a `code` and takes\n* the first path, and its message is exactly the one likely to quote the URL.\n*/\nfunction verificationThrow(inputs) {\n\tconst { error } = inputs;\n\tconst message = error instanceof Error ? error.message : String(error);\n\treturn withoutConnectionString(typeof error === \"object\" && error !== null && \"code\" in error ? normalizeError(error) : normalizeError(errorUnexpected(message, { why: `Unexpected error during ${inputs.invocation}: ${message}` })), inputs.connection);\n}\n/**\n* The same envelope with the connection string stripped from every field the\n* settlement serializes: the prose, each next action's strings, and every\n* string reachable through `meta`. A driver error quotes the URL wherever it\n* pleases, so nothing user-facing passes through unstripped.\n*/\nfunction withoutConnectionString(error, connection) {\n\tconst clean = (text) => sanitizeErrorMessage(text, connection);\n\treturn new CliStructuredError$1(error.code, clean(error.message), {\n\t\tseverity: error.severity,\n\t\tnextActions: error.nextActions.map((action) => cleanNextAction(action, clean)),\n\t\t...ifDefined(\"why\", error.why === void 0 ? void 0 : clean(error.why)),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta === void 0 ? void 0 : cleanMetaRecord(error.meta, clean)),\n\t\t...ifDefined(\"docsUrl\", error.docsUrl),\n\t\tcause: error.cause\n\t});\n}\nfunction cleanNextAction(action, clean) {\n\treturn {\n\t\tkind: action.kind,\n\t\tlabel: clean(action.label),\n\t\t...ifDefined(\"command\", action.command === void 0 ? void 0 : clean(action.command)),\n\t\t...ifDefined(\"commands\", action.commands?.map(clean)),\n\t\t...ifDefined(\"url\", action.url === void 0 ? void 0 : clean(action.url)),\n\t\t...ifDefined(\"reason\", action.reason === void 0 ? void 0 : clean(action.reason))\n\t};\n}\nfunction cleanMetaValue(value, clean) {\n\tif (typeof value === \"string\") return clean(value);\n\tif (Array.isArray(value)) return value.map((entry) => cleanMetaValue(entry, clean));\n\tif (typeof value === \"object\" && value !== null) return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, cleanMetaValue(entry, clean)]));\n\treturn value;\n}\nfunction cleanMetaRecord(meta, clean) {\n\treturn Object.fromEntries(Object.entries(meta).map(([key, value]) => [key, cleanMetaValue(value, clean)]));\n}\nconst OUTCOME_LABEL = {\n\t\"not-found\": \"missing\",\n\t\"not-expected\": \"extra\",\n\t\"not-equal\": \"mismatch\"\n};\n/** What a diff issue says, in the words the commander shell used. */\nfunction issueLabel(issue) {\n\treturn `${OUTCOME_LABEL[issueOutcome(issue)]}: ${issue.path.join(\"/\")}`;\n}\nfunction issueNodes(issues, status) {\n\treturn issues.map((issue) => ({\n\t\tlabel: issueLabel(issue),\n\t\tstatus\n\t}));\n}\n/**\n* The drift, laid out as a tree the engine draws: one root per finding family,\n* one child per element. The engine owns the connectors and the status glyphs,\n* so nothing here carries an escape sequence.\n*/\nfunction schemaFindingBlocks(inputs) {\n\tconst roots = [];\n\tconst issues = inputs.result.schema.issues;\n\tif (issues.length > 0) roots.push({\n\t\tlabel: \"Schema issues\",\n\t\tstatus: \"error\",\n\t\tchildren: issueNodes(issues, \"error\")\n\t});\n\tconst warnings = inputs.result.schema.warnings?.issues ?? [];\n\tif (warnings.length > 0) roots.push({\n\t\tlabel: \"Schema warnings\",\n\t\tstatus: \"warn\",\n\t\tchildren: issueNodes(warnings, \"warn\")\n\t});\n\tif (inputs.unclaimed.length > 0) {\n\t\tconst status = inputs.strict ? \"error\" : \"warn\";\n\t\troots.push({\n\t\t\tlabel: \"Unclaimed elements (declared by no contract)\",\n\t\t\tstatus,\n\t\t\tchildren: inputs.unclaimed.map((name) => ({\n\t\t\t\tlabel: name,\n\t\t\t\tstatus\n\t\t\t}))\n\t\t});\n\t}\n\treturn roots.length === 0 ? [] : [{\n\t\tkind: \"tree\",\n\t\troots\n\t}];\n}\n/**\n* A failed schema-verification verdict as one envelope diagnostic. `error` is\n* the honest severity: the database does not satisfy the contract. It is legal\n* because both commands settle at exit 4 — the engine refuses a\n* severity-`error` diagnostic only on a run that exits 0.\n*/\nfunction schemaVerdictDiagnostic(inputs) {\n\tconst code = inputs.result.code;\n\tconst dotted = code !== void 0 && isStructuredErrorCode(code);\n\tconst issues = inputs.result.schema.issues.map(issueLabel);\n\treturn {\n\t\tcode: dotted ? code : \"CONTRACT.VERIFY_FAILED\",\n\t\tseverity: \"error\",\n\t\tsummary: inputs.result.summary,\n\t\t...issues.length === 0 ? {} : { why: `The live schema differs: ${issues.join(\"; \")}.` },\n\t\tnextActions: inputs.nextActions,\n\t\tmeta: {\n\t\t\t...inputs.space === void 0 ? {} : { space: inputs.space },\n\t\t\tissues,\n\t\t\t...dotted || code === void 0 ? {} : { code }\n\t\t}\n\t};\n}\n//#endregion\n//#region src/orm/db/sign.ts\n/**\n* Verification ran and refused the signature. The command completed — it\n* answered the question \"may this database be signed?\" — so the refusal is a\n* diagnostic on a completed envelope rather than an error.\n*/\nconst FINDINGS_EXIT_CODE$2 = 4;\n/** The config file this bin reads; the handler is not told which one was loaded. */\nconst CONFIG_DISPLAY_PATH = \"prisma.config.ts\";\nfunction headerBlock$1(inputs) {\n\treturn {\n\t\tkind: \"fields\",\n\t\trail: true,\n\t\trows: [{\n\t\t\tlabel: \"contract\",\n\t\t\tvalue: inputs.contract\n\t\t}, {\n\t\t\tlabel: \"database\",\n\t\t\tvalue: inputs.database\n\t\t}]\n\t};\n}\nfunction signPresentations(inputs) {\n\tconst marker = inputs.document.marker;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\tinputs.header,\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Database signed\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: marker.previous?.storageHash === void 0 ? [{\n\t\t\t\t\t\ttext: \"none\",\n\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t}] : [{\n\t\t\t\t\t\ttext: marker.previous.storageHash,\n\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t}]\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: [{\n\t\t\t\t\t\ttext: inputs.document.contract.storageHash,\n\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t}]\n\t\t\t\t}]\n\t\t\t}\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\nfunction refusedPresentations(inputs) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\tinputs.header,\n\t\t\t...schemaFindingBlocks({\n\t\t\t\tresult: inputs.document,\n\t\t\t\tunclaimed: [],\n\t\t\t\tstrict: false\n\t\t\t}),\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"error\",\n\t\t\t\ttext: inputs.document.summary\n\t\t\t}\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\n/**\n* Builds the command with its control-client factory injected, so tests mount\n* the same tree over a fake client instead of mocking the client module.\n*/\nfunction createDbSignCommand(createClient = createControlClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Sign the database with your contract so you can safely run queries\",\n\t\t\tdescription: \"Verifies that your database schema satisfies the emitted contract, and if\\nso, writes or updates the database signature. Idempotent and safe to run\\nin CI or a deployment pipeline. The signature records that this database\\ninstance is aligned with a specific contract version.\\nExit codes: 0 = signed, 2 = the command could not run (unresolvable\\ncontract reference, no emitted contract, unreachable database),\\n4 = schema verification failed and no signature was written.\",\n\t\t\texamples: [\n\t\t\t\t\"db sign\",\n\t\t\t\t\"db sign --db $DATABASE_URL\",\n\t\t\t\t\"db sign production --db $DATABASE_URL\",\n\t\t\t\t\"db sign --contract production --db $DATABASE_URL\"\n\t\t\t]\n\t\t},\n\t\targs: {\n\t\t\tpositionals: { contract: positional.optionalString({\n\t\t\t\tbrief: \"Contract reference (hash, prefix, ref name, or migration dir name)\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t}) },\n\t\t\tflags: {\n\t\t\t\tdb: dbFlag,\n\t\t\t\tcontract: flag.string({\n\t\t\t\t\tbrief: \"Contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\",\n\t\t\t\t\tplaceholder: \"contract\"\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tneeds: { config: ormConfigSection },\n\t\texitCodes: { 4: \"schema verification failed; no signature was written\" },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst positionalContract = args.positionals.contract;\n\t\t\tconst flagContract = args.flags.contract;\n\t\t\tif (positionalContract !== void 0 && flagContract !== void 0) return notOk$1(normalizeError(errorContractArgConflict({\n\t\t\t\tpositional: positionalContract,\n\t\t\t\tflag: flagContract\n\t\t\t})));\n\t\t\tconst contractRef = positionalContract ?? flagContract;\n\t\t\tconst emitted = await readEmittedContract({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tcommandName: \"db sign\"\n\t\t\t});\n\t\t\tif (!emitted.ok) return notOk$1(emitted.failure);\n\t\t\tlet contractInput = emitted.value.contract;\n\t\t\tif (contractRef !== void 0) {\n\t\t\t\tconst resolvedRef = await resolveContractRefToSnapshot({\n\t\t\t\t\tconfig: ctx.config,\n\t\t\t\t\tmigrationsDir: migrationsDirFor(ctx.config, ctx.cwd),\n\t\t\t\t\trefInput: contractRef,\n\t\t\t\t\tcontractPathAbsolute: emitted.value.path,\n\t\t\t\t\tfallbackToEmitted: true\n\t\t\t\t});\n\t\t\t\tif (!resolvedRef.ok) return notOk$1(normalizeError(resolvedRef.failure));\n\t\t\t\tcontractInput = resolvedRef.value.contractJson;\n\t\t\t}\n\t\t\tconst connection = requireVerifyConnection({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tinvocation: \"db sign\"\n\t\t\t});\n\t\t\tif (!connection.ok) return notOk$1(connection.failure);\n\t\t\tconst dbConnection = connection.value;\n\t\t\tconst header = headerBlock$1({\n\t\t\t\tcontract: contractRef ?? emitted.value.displayPath,\n\t\t\t\tdatabase: maskConnectionUrl(dbConnection)\n\t\t\t});\n\t\t\tconst client = createClient({\n\t\t\t\tfamily: ctx.config.family,\n\t\t\t\ttarget: ctx.config.target,\n\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t});\n\t\t\tconst onProgress = controlProgressReporter(ctx.report);\n\t\t\ttry {\n\t\t\t\tconst verified = await client.schemaVerify({\n\t\t\t\t\tcontract: contractInput,\n\t\t\t\t\tstrict: false,\n\t\t\t\t\tconnection: dbConnection,\n\t\t\t\t\tonProgress\n\t\t\t\t});\n\t\t\t\tif (!verified.ok) {\n\t\t\t\t\tconst document = verified;\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: FINDINGS_EXIT_CODE$2,\n\t\t\t\t\t\tdiagnostics: [schemaVerdictDiagnostic({\n\t\t\t\t\t\t\tresult: verified,\n\t\t\t\t\t\t\tspace: void 0,\n\t\t\t\t\t\t\tnextActions: [runCommandAction(\"Bring the database up to the contract, then sign again\", \"prisma-cli db update\")]\n\t\t\t\t\t\t})]\n\t\t\t\t\t}, refusedPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst signed = await client.sign({\n\t\t\t\t\tcontract: contractInput,\n\t\t\t\t\tcontractPath: displayPath(emitted.value.path, ctx.cwd),\n\t\t\t\t\tconfigPath: CONFIG_DISPLAY_PATH,\n\t\t\t\t\tonProgress\n\t\t\t\t});\n\t\t\t\tif (!signed.ok) throw new InternalError(`The family returned a sign result that did not sign: ${signed.summary}`);\n\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\tdata: signed,\n\t\t\t\t\texitCode: 0\n\t\t\t\t}, signPresentations({\n\t\t\t\t\tdocument: signed,\n\t\t\t\t\theader\n\t\t\t\t})));\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn notOk$1(verificationThrow({\n\t\t\t\t\terror,\n\t\t\t\t\tinvocation: \"db sign\",\n\t\t\t\t\tconnection: dbConnection\n\t\t\t\t}));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t}\n\t});\n}\nconst dbSignCommand = createDbSignCommand();\n//#endregion\n//#region src/utils/db-update-failure.ts\n/**\n* A `db update` failure as the CLI's structured error.\n*\n* `DESTRUCTIVE_CHANGES` is handled by the command, which asks for consent and\n* calls again; it is mapped here for the case the control API returns it from a\n* call that already carried consent, which would otherwise degrade silently.\n*\n* The `assertNever` is deliberate: a control-API failure code this does not\n* handle must stop the command rather than degrade into a generic message.\n*/\nfunction mapDbUpdateFailure(failure) {\n\tif (failure.code === \"PLANNING_FAILED\") return errorMigrationPlanningFailed({ conflicts: failure.conflicts ?? [] });\n\tif (failure.code === \"RUNNER_FAILED\") {\n\t\tconst fix = (typeof failure.meta?.[\"runnerErrorCode\"] === \"string\" ? failure.meta[\"runnerErrorCode\"] : void 0) === \"MIGRATION.LEGACY_MARKER_SHAPE\" ? \"Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma-cli db init` to recreate it with the current per-space schema.\" : \"Inspect the reported conflict, reconcile schema drift if needed, then re-run `prisma-cli db update`\";\n\t\treturn errorRunnerFailed(failure.summary, {\n\t\t\twhy: failure.why ?? \"Migration runner failed\",\n\t\t\tfix,\n\t\t\tmeta: {\n\t\t\t\t...failure.meta,\n\t\t\t\t...failure.warnings && failure.warnings.length > 0 ? { plannerWarnings: failure.warnings } : {}\n\t\t\t},\n\t\t\t...ifDefined(\"cause\", failure.cause)\n\t\t});\n\t}\n\tif (failure.code === \"DESTRUCTIVE_CHANGES\") return errorDestructiveChanges(failure.summary, {\n\t\t...ifDefined(\"why\", failure.why),\n\t\tfix: \"Re-run `prisma-cli db update` and type the database name when asked, or pass `--no-interactive --confirm <database>` where there is nobody to ask. Use `--dry-run` to preview the operations first.\",\n\t\t...failure.destructiveChanges ? { meta: {\n\t\t\tdestructiveOperations: failure.destructiveChanges.destructiveOperations,\n\t\t\tdatabaseName: failure.destructiveChanges.databaseName,\n\t\t\tplanHash: failure.destructiveChanges.planHash\n\t\t} } : {}\n\t});\n\tif (failure.code === \"CONSENT_PLAN_MISMATCH\") return errorConsentPlanMismatch({\n\t\tconsentedPlanHash: failure.consentPlanMismatch?.consentedPlanHash ?? \"\",\n\t\tplanHash: failure.consentPlanMismatch?.planHash ?? \"\",\n\t\t...ifDefined(\"why\", failure.why)\n\t});\n\tconst exhaustive = failure.code;\n\treturn assertNever(exhaustive, `Unhandled DbUpdateFailure code: ${String(exhaustive)}`);\n}\n//#endregion\n//#region src/orm/db/consent.ts\n/**\n* A token nobody can type is not consent: an empty one makes the engine's\n* type-to-confirm accept a bare Enter, and `--confirm \"\"` grant outright.\n*/\nfunction errorConsentTokenUnresolved(targetId) {\n\treturn new CliStructuredError$1(\"CLI.CONSENT_TOKEN_UNRESOLVED\", \"The database this run would change has no name to confirm.\", {\n\t\twhy: `The connected database reports no name, and the target id \"${targetId}\" yields none either, so the consent prompt has nothing to ask you to type and the destructive operations cannot be authorised.`,\n\t\tnextActions: [{\n\t\t\tkind: \"user-choice\",\n\t\t\tlabel: \"Name the database in `db.connection` (or pass `--db <url>`) and run `prisma-cli db update` again.\"\n\t\t}]\n\t});\n}\n/** A prompt that names nothing cannot be consented to knowingly. */\nfunction errorConsentOperationsMissing() {\n\treturn new CliStructuredError$1(\"CLI.CONSENT_OPERATIONS_MISSING\", \"The plan was refused as destructive but named no operations to confirm.\", {\n\t\twhy: \"The consent prompt has to list what is about to be destroyed, and the refusal carried no operations to list.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Preview the plan\",\n\t\t\tcommand: \"prisma-cli db update --dry-run\"\n\t\t}]\n\t});\n}\n/** The question the user answers before anything is dropped. */\nfunction destructiveConsentQuestion(operations, token) {\n\tconst listed = operations.map((operation) => ` - ${operation.label}`).join(\"\\n\");\n\treturn [`Apply ${operations.length} destructive operation(s) to ${token}? Data they remove cannot be recovered:`, listed].join(\"\\n\");\n}\n//#endregion\n//#region src/orm/db/update.ts\nfunction updatePresentations(inputs) {\n\tconst { document, database, dryRun } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t},\n\t\t\t\t...database === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\tvalue: database\n\t\t\t\t}],\n\t\t\t\t...inputs.to === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: inputs.to\n\t\t\t\t}],\n\t\t\t\t...dryRun ? [{\n\t\t\t\t\tlabel: \"mode\",\n\t\t\t\t\tvalue: \"dry run\"\n\t\t\t\t}] : []\n\t\t\t]\n\t\t}, ...migrationResultBlocks(document)],\n\t\tjson: () => document,\n\t\tnext: () => migrationResultNextActions(document, \"prisma-cli db update\")\n\t};\n}\nfunction updateDocument(inputs) {\n\tconst { value } = inputs;\n\treturn {\n\t\tok: true,\n\t\tmode: value.mode,\n\t\tplan: {\n\t\t\ttargetId: inputs.targetId,\n\t\t\tdestination: {\n\t\t\t\tstorageHash: value.destination.storageHash,\n\t\t\t\t...ifDefined(\"profileHash\", value.destination.profileHash)\n\t\t\t},\n\t\t\toperations: value.plan.operations.map((operation) => ({\n\t\t\t\tid: operation.id,\n\t\t\t\tlabel: operation.label,\n\t\t\t\toperationClass: operation.operationClass\n\t\t\t})),\n\t\t\t...ifDefined(\"preview\", value.plan.preview)\n\t\t},\n\t\t...value.execution === void 0 ? {} : { execution: {\n\t\t\toperationsPlanned: value.execution.operationsPlanned,\n\t\t\toperationsExecuted: value.execution.operationsExecuted\n\t\t} },\n\t\t...value.marker === void 0 ? {} : { marker: {\n\t\t\tstorageHash: value.marker.storageHash,\n\t\t\t...ifDefined(\"profileHash\", value.marker.profileHash)\n\t\t} },\n\t\t...ifDefined(\"perSpace\", value.perSpace),\n\t\t...ifDefined(\"warnings\", value.warnings),\n\t\tadvancedRef: inputs.advancedRef,\n\t\tplannedAdvanceRef: inputs.plannedAdvanceRef,\n\t\tsummary: value.summary,\n\t\ttimings: { total: Date.now() - inputs.startedAt }\n\t};\n}\nfunction createDbUpdateCommand(createClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Update your database schema to match your contract\",\n\t\t\tdescription: \"Compares the database to the emitted contract and applies the changes that\\nclose the gap, whether or not the database was bootstrapped with `db init`.\\nAn operation that would destroy data is applied only with your consent: the\\ncommand asks you to type the database name. A run with nobody to ask — a CI\\njob, or `--no-interactive` — takes it from `--confirm <database>` instead.\\nUse --dry-run to see the operations without applying them.\",\n\t\t\texamples: [\n\t\t\t\t\"db update\",\n\t\t\t\t\"db update --dry-run\",\n\t\t\t\t\"db update --no-interactive --confirm appdb\",\n\t\t\t\t\"db update --to production\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\tdryRun: flag.boolean({ brief: \"Preview the planned operations without applying them\" }),\n\t\t\tto: flag.string({\n\t\t\t\tbrief: \"Contract to update to (hash, prefix, ref name, migration dir name, or ./path)\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t}),\n\t\t\tadvanceRef: flag.string({\n\t\t\t\tbrief: \"Advance the named ref to the post-command contract hash\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst prepared = await prepareMigrationRun({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tcommandName: \"db update\",\n\t\t\t\tcreateClient\n\t\t\t});\n\t\t\tif (!prepared.ok) return notOk$1(prepared.failure);\n\t\t\tconst { client, contractPath, dbConnection, migrationsDir, refsDir } = prepared.value;\n\t\t\tlet contractJson = prepared.value.contractJson;\n\t\t\tlet snapshotContractPath = contractPath;\n\t\t\tif (args.flags.to !== void 0) {\n\t\t\t\tconst resolved = await resolveContractRefToSnapshot({\n\t\t\t\t\tconfig: ctx.config,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\trefInput: args.flags.to,\n\t\t\t\t\tcontractPathAbsolute: contractPath,\n\t\t\t\t\tfallbackToEmitted: false,\n\t\t\t\t\tmissingBundleFlag: \"--to\"\n\t\t\t\t});\n\t\t\t\tif (!resolved.ok) return notOk$1(normalizeError(resolved.failure));\n\t\t\t\tcontractJson = resolved.value.contractJson;\n\t\t\t\tsnapshotContractPath = resolved.value.contractJsonPath;\n\t\t\t}\n\t\t\tconst mode = args.flags.dryRun ? \"plan\" : \"apply\";\n\t\t\tlet document;\n\t\t\ttry {\n\t\t\t\tawait client.connect(dbConnection);\n\t\t\t\tconst update = (consent) => client.dbUpdate({\n\t\t\t\t\tcontract: contractJson,\n\t\t\t\t\tmode,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\t...consent === void 0 ? {} : { consent },\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report)\n\t\t\t\t});\n\t\t\t\tconst reported = /* @__PURE__ */ new Set();\n\t\t\t\tconst reportPlannerWarnings = (warnings) => {\n\t\t\t\t\tfor (const warning of warnings) if (!reported.has(warning.summary)) {\n\t\t\t\t\t\treported.add(warning.summary);\n\t\t\t\t\t\tctx.report({\n\t\t\t\t\t\t\tkind: \"message\",\n\t\t\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\t\t\ttext: warning.summary\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tlet result = await update();\n\t\t\t\tif (mode === \"apply\" && !result.ok && result.failure.code === \"DESTRUCTIVE_CHANGES\") {\n\t\t\t\t\treportPlannerWarnings(result.failure.warnings ?? []);\n\t\t\t\t\tconst refusal = result.failure.destructiveChanges;\n\t\t\t\t\tif (refusal === void 0 || refusal.destructiveOperations.length === 0) return notOk$1(normalizeError(errorConsentOperationsMissing()));\n\t\t\t\t\tconst token = refusal.databaseName ?? \"\";\n\t\t\t\t\tif (token.trim().length === 0) return notOk$1(normalizeError(errorConsentTokenUnresolved(ctx.config.target.targetId)));\n\t\t\t\t\tif (!await ctx.prompt.consent(destructiveConsentQuestion(refusal.destructiveOperations, token), { token })) return notOk$1(normalizeError(mapDbUpdateFailure(result.failure)));\n\t\t\t\t\tresult = await update({ planHash: refusal.planHash });\n\t\t\t\t}\n\t\t\t\tif (!result.ok) {\n\t\t\t\t\treportPlannerWarnings(result.failure.warnings ?? []);\n\t\t\t\t\treturn notOk$1(normalizeError(mapDbUpdateFailure(result.failure)));\n\t\t\t\t}\n\t\t\t\tconst advancementHash = result.value.mode === \"apply\" ? result.value.marker?.storageHash ?? result.value.destination.storageHash : result.value.destination.storageHash;\n\t\t\t\tconst advancement = await resolveRefAdvancementFields({\n\t\t\t\t\t...ifDefined(\"advanceRef\", args.flags.advanceRef),\n\t\t\t\t\t...ifDefined(\"db\", args.flags.db),\n\t\t\t\t\trefsDir,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tcontractJson,\n\t\t\t\t\tcontractJsonPath: snapshotContractPath,\n\t\t\t\t\tmode: result.value.mode,\n\t\t\t\t\thash: advancementHash\n\t\t\t\t});\n\t\t\t\tif (!advancement.ok) return notOk$1(normalizeError(advancement.failure));\n\t\t\t\tdocument = updateDocument({\n\t\t\t\t\tvalue: result.value,\n\t\t\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\t\t\tadvancedRef: advancement.value.advancedRef,\n\t\t\t\t\tplannedAdvanceRef: advancement.value.plannedAdvanceRef,\n\t\t\t\t\tstartedAt\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof CliStructuredError$1) throw error;\n\t\t\t\tif (CliStructuredError$2.is(error)) return notOk$1(normalizeError(error));\n\t\t\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk$1(normalizeError(errorContractValidationFailed(`Contract validation failed: ${error.message}`, { where: { path: contractPath } })));\n\t\t\t\tconst safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === \"string\" ? dbConnection : void 0);\n\t\t\t\treturn notOk$1(normalizeError(errorUnexpected(safeMessage, { why: `Unexpected error during db update: ${safeMessage}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"verbose\",\n\t\t\t\ttext: `Total time: ${document.timings.total}ms`\n\t\t\t});\n\t\t\treturn ok$1(ctx.present({ data: document }, updatePresentations({\n\t\t\t\tdocument,\n\t\t\t\tcontractPath: prepared.value.contractDisplayPath,\n\t\t\t\tdatabase: prepared.value.database,\n\t\t\t\tto: args.flags.to,\n\t\t\t\tdryRun: args.flags.dryRun\n\t\t\t})));\n\t\t}\n\t});\n}\nconst dbUpdateCommand = createDbUpdateCommand(createControlClient);\n//#endregion\n//#region src/utils/combine-verify-results.ts\n/**\n* Collapse the aggregate verifier's per-space contract-satisfaction results\n* into a single {@link VerifyDatabaseSchemaResult} for the CLI display\n* surface, and carry the deduplicated unclaimed-elements list alongside it.\n* Concatenates the issue lists across spaces; uses the app space's result as\n* the structural envelope (storage hash, target). Extras are already\n* stripped from each per-space result, so nothing here duplicates an\n* unclaimed element per space.\n*\n* **Unclaimed disposition.** In strict mode a non-empty `unclaimed` list fails\n* the combined verdict (`ok: false`); in lenient mode it is carried for\n* informational rendering only. The list itself is returned unchanged for the\n* renderer.\n*\n* **Summary policy.** Preserve the per-family phrasing whenever the\n* combined `ok` flag agrees with the app space's `ok` flag — this is\n* the common case (single-family deployments, single-app deployments)\n* and the family's \"satisfies / does not satisfy contract\" phrasing\n* stays user-visible. When the app passes but an extension fails (or\n* vice versa) the app's summary contradicts the envelope, so fall back\n* to the first failing space's summary. This keeps family phrasing\n* intact and the envelope internally consistent (`ok: false` ↔ failure\n* summary).\n*/\nfunction combineVerifyResults(perSpace, appSpaceId, strict, unclaimed) {\n\tconst appResult = perSpace.get(appSpaceId) ?? perSpace.values().next().value;\n\tif (appResult === void 0) throw new InternalError(\"Aggregate verifier returned no per-space verify results — this is a wiring bug.\");\n\tlet okAll = true;\n\tlet firstFailure;\n\tlet issues = [];\n\tlet warningIssues = [];\n\tfor (const [, result] of perSpace) {\n\t\tif (!result.ok) {\n\t\t\tokAll = false;\n\t\t\tif (firstFailure === void 0) firstFailure = result;\n\t\t}\n\t\tissues = [...issues, ...result.schema.issues];\n\t\twarningIssues = [...warningIssues, ...result.schema.warnings?.issues ?? []];\n\t}\n\tconst unclaimedFails = strict && unclaimed.length > 0;\n\tconst ok = okAll && !unclaimedFails;\n\tconst summary = okAll ? unclaimedFails ? `Database schema has ${unclaimed.length} unclaimed element${unclaimed.length === 1 ? \"\" : \"s\"} (not in any contract)` : appResult.summary : appResult.ok ? firstFailure?.summary ?? appResult.summary : appResult.summary;\n\treturn {\n\t\tresult: {\n\t\t\tok,\n\t\t\t...ok ? {} : { code: appResult.code ?? \"CONTRACT.MARKER_REQUIRED\" },\n\t\t\tsummary,\n\t\t\tcontract: appResult.contract,\n\t\t\ttarget: appResult.target,\n\t\t\tschema: {\n\t\t\t\tissues,\n\t\t\t\twarnings: { issues: warningIssues }\n\t\t\t},\n\t\t\tmeta: { strict },\n\t\t\ttimings: { total: 0 }\n\t\t},\n\t\tunclaimed\n\t};\n}\n//#endregion\n//#region src/orm/db/verify.ts\n/**\n* Verification ran and the database does not match the contract. The run did\n* the job it was asked to do, so this is a completed settlement carrying\n* diagnostics rather than an error.\n*/\nconst FINDINGS_EXIT_CODE$1 = 4;\nconst PUSH_THE_CONTRACT = runCommandAction(\"Push the contract to the database\", \"prisma-cli db update\");\nconst RECONCILE_BY_HAND = {\n\tkind: \"user-choice\",\n\tlabel: \"Or reconcile the differences by hand and verify again\"\n};\nfunction errorInvalidVerifyMode(options) {\n\treturn new CliStructuredError$1(\"CLI.INVALID_VERIFY_MODE\", \"Invalid verify mode\", {\n\t\twhy: options.why,\n\t\tnextActions: [{\n\t\t\tkind: \"user-choice\",\n\t\t\tlabel: options.choose\n\t\t}],\n\t\tdocsUrl: \"https://pris.ly/db-verify\"\n\t});\n}\nfunction resolveMode(flags) {\n\tif (flags.markerOnly && flags.schemaOnly) return notOk$1(errorInvalidVerifyMode({\n\t\twhy: \"`--marker-only` and `--schema-only` cannot be used together\",\n\t\tchoose: \"Choose one mode: omit both to check the marker and schema, use `--marker-only` to check only the marker, or use `--schema-only` to check only the live schema.\"\n\t}));\n\tif (flags.markerOnly && flags.strict) return notOk$1(errorInvalidVerifyMode({\n\t\twhy: \"`--strict` requires schema verification, but `--marker-only` skips it\",\n\t\tchoose: \"Remove `--strict`, or use `db verify` / `db verify --schema-only` when you want to check the live schema in strict mode.\"\n\t}));\n\tif (flags.schemaOnly) return ok$1(\"schema-only\");\n\treturn ok$1(flags.markerOnly ? \"marker-only\" : \"full\");\n}\nfunction modeLabel(mode, strict) {\n\tif (mode === \"marker-only\") return \"marker only\";\n\tconst strictness = strict ? \"strict\" : \"tolerant\";\n\treturn mode === \"schema-only\" ? `schema only (${strictness})` : `full (marker + schema, ${strictness})`;\n}\nfunction invocation(mode, strict) {\n\treturn [\n\t\t\"db verify\",\n\t\t...mode === \"marker-only\" ? [\"--marker-only\"] : [],\n\t\t...mode === \"schema-only\" ? [\"--schema-only\"] : [],\n\t\t...strict ? [\"--strict\"] : []\n\t].join(\" \");\n}\n/** The marker verdict as a finding, keeping the code the commander raised. */\nfunction markerFindingDiagnostic(result) {\n\tconst { ok: _ok, ...diagnostic } = normalizeError(markerFindingError(result)).toEnvelope();\n\treturn diagnostic;\n}\n/**\n* The aggregate verifier's per-space marker drift as a finding on a completed\n* run, keeping the `MIGRATION.CONTRACT_SPACE_VIOLATION` envelope it was\n* raised with.\n*/\nfunction markerDriftDiagnostic(drift) {\n\tconst { ok: _ok, ...diagnostic } = normalizeError(drift).toEnvelope();\n\treturn diagnostic;\n}\nfunction markerFindingError(result) {\n\tif (result.code === VERIFY_CODE_MARKER_MISSING) return errorMarkerMissing();\n\tif (result.code === VERIFY_CODE_HASH_MISMATCH) {\n\t\tif (!(result.marker?.storageHash === result.contract.storageHash)) return errorHashMismatch({\n\t\t\twhy: \"Contract storageHash does not match database marker\",\n\t\t\texpected: result.contract.storageHash,\n\t\t\t...ifDefined(\"actual\", result.marker?.storageHash)\n\t\t});\n\t\treturn errorHashMismatch({\n\t\t\twhy: !result.contract.profileHash || result.marker?.profileHash === result.contract.profileHash ? \"Contract hash does not match database marker\" : \"Contract profileHash does not match database marker\",\n\t\t\t...ifDefined(\"expected\", result.contract.profileHash),\n\t\t\t...ifDefined(\"actual\", result.marker?.profileHash)\n\t\t});\n\t}\n\tif (result.code === VERIFY_CODE_TARGET_MISMATCH) return errorTargetMismatch(result.target.expected, result.target.actual ?? \"unknown\");\n\treturn errorRuntime(\"CONTRACT.VERIFY_FAILED\", result.summary, {\n\t\twhy: \"Verification failed\",\n\t\tfix: \"Check contract and database state\"\n\t});\n}\nfunction verifyDocument(inputs) {\n\treturn {\n\t\tok: inputs.ok,\n\t\tsummary: inputs.summary,\n\t\tmode: inputs.mode,\n\t\tcontract: inputs.verified.contract,\n\t\t...ifDefined(\"marker\", inputs.verified.marker),\n\t\ttarget: inputs.verified.target,\n\t\t...ifDefined(\"missingCodecs\", inputs.verified.missingCodecs),\n\t\t...ifDefined(\"codecCoverageSkipped\", inputs.verified.codecCoverageSkipped),\n\t\t...ifDefined(\"schema\", inputs.schema),\n\t\t...ifDefined(\"unclaimed\", inputs.unclaimed),\n\t\t...ifDefined(\"warning\", inputs.warning),\n\t\tmeta: {\n\t\t\t...inputs.verified.meta ?? {},\n\t\t\tschemaVerification: inputs.schemaVerification\n\t\t},\n\t\ttimings: { total: inputs.elapsed }\n\t};\n}\nfunction schemaSummary(combined) {\n\treturn {\n\t\tsummary: combined.result.summary,\n\t\tstrict: combined.result.meta?.strict ?? false,\n\t\twarnings: (combined.result.schema.warnings?.issues ?? []).map((issue) => issue.path.join(\"/\"))\n\t};\n}\nfunction headerBlock(inputs) {\n\treturn {\n\t\tkind: \"fields\",\n\t\trail: true,\n\t\trows: [\n\t\t\t{\n\t\t\t\tlabel: \"contract\",\n\t\t\t\tvalue: inputs.contractPath\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"mode\",\n\t\t\t\tvalue: modeLabel(inputs.mode, inputs.strict)\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: inputs.database\n\t\t\t}\n\t\t]\n\t};\n}\nfunction verifyPresentations(inputs) {\n\tconst document = inputs.document;\n\tconst warnings = document.schema?.warnings ?? [];\n\tconst unclaimed = document.unclaimed ?? [];\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\tinputs.header,\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: document.ok ? \"ok\" : \"error\",\n\t\t\t\ttext: document.summary\n\t\t\t},\n\t\t\t...document.ok ? [{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"storageHash\",\n\t\t\t\t\tvalue: document.contract.storageHash\n\t\t\t\t}, ...document.contract.profileHash === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"profileHash\",\n\t\t\t\t\tvalue: document.contract.profileHash\n\t\t\t\t}]]\n\t\t\t}] : [],\n\t\t\t...warnings.length === 0 && unclaimed.length === 0 ? [] : [{\n\t\t\t\tkind: \"tree\",\n\t\t\t\troots: [...warnings.length === 0 ? [] : [{\n\t\t\t\t\tlabel: \"Schema warnings\",\n\t\t\t\t\tstatus: \"warn\",\n\t\t\t\t\tchildren: warnings.map((message) => ({\n\t\t\t\t\t\tlabel: message,\n\t\t\t\t\t\tstatus: \"warn\"\n\t\t\t\t\t}))\n\t\t\t\t}], ...unclaimed.length === 0 ? [] : [{\n\t\t\t\t\tlabel: \"Unclaimed elements (declared by no contract)\",\n\t\t\t\t\tstatus: \"warn\",\n\t\t\t\t\tchildren: unclaimed.map((name) => ({\n\t\t\t\t\t\tlabel: name,\n\t\t\t\t\t\tstatus: \"warn\"\n\t\t\t\t\t}))\n\t\t\t\t}]]\n\t\t\t}],\n\t\t\t...document.warning === void 0 ? [] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\ttext: document.warning\n\t\t\t}]\n\t\t],\n\t\tjson: () => document\n\t};\n}\nfunction schemaPresentations(inputs) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\tinputs.header,\n\t\t\t...schemaFindingBlocks({\n\t\t\t\tresult: inputs.document,\n\t\t\t\tunclaimed: inputs.document.unclaimed,\n\t\t\t\tstrict: inputs.strict\n\t\t\t}),\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: inputs.document.ok ? \"ok\" : \"error\",\n\t\t\t\ttext: inputs.document.summary\n\t\t\t}\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\n/**\n* One diagnostic per contract space whose live schema does not satisfy its\n* contract, plus the combined verdict when only the unclaimed list failed it.\n*/\nfunction driftDiagnostics(inputs) {\n\tconst perSpace = [...inputs.perSpace].filter(([, result]) => !result.ok).map(([space, result]) => schemaVerdictDiagnostic({\n\t\tresult,\n\t\tspace,\n\t\tnextActions: [PUSH_THE_CONTRACT, RECONCILE_BY_HAND]\n\t}));\n\tif (perSpace.length > 0) return perSpace;\n\treturn [schemaVerdictDiagnostic({\n\t\tresult: inputs.combined.result,\n\t\tspace: void 0,\n\t\tnextActions: [{\n\t\t\tkind: \"user-choice\",\n\t\t\tlabel: \"Declare the unclaimed elements in a contract, or drop them from the database\"\n\t\t}]\n\t})];\n}\n/**\n* Builds the command with its control-client factory injected, so tests mount\n* the same tree over a fake client instead of mocking the client module.\n*/\nfunction createDbVerifyCommand(createClient = createControlClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Check whether the database marker and live schema match your contract\",\n\t\t\tdescription: \"Verifies the database marker first, then checks the database schema\\nmatches your contract. Use `--marker-only` for marker-only verification,\\n`--schema-only` to skip marker checks and inspect only the live schema,\\nand `--strict` to fail if the database includes elements not present in\\nthe contract.\\nExit codes: 0 = the database matches the contract, 2 = the check could\\nnot run (conflicting mode flags, no emitted contract, unreachable\\ndatabase), 4 = drift or a marker finding.\",\n\t\t\texamples: [\n\t\t\t\t\"db verify\",\n\t\t\t\t\"db verify --db $DATABASE_URL\",\n\t\t\t\t\"db verify --strict\",\n\t\t\t\t\"db verify --schema-only\",\n\t\t\t\t\"db verify --marker-only\",\n\t\t\t\t\"db verify --json\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\tmarkerOnly: flag.boolean({ brief: \"Skip schema verification and only check the database marker\" }),\n\t\t\tschemaOnly: flag.boolean({ brief: \"Skip marker verification and only check whether the live schema satisfies the contract\" }),\n\t\t\tstrict: flag.boolean({ brief: \"Treat schema elements not present in the contract as an error\" })\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\texitCodes: { 4: \"verification found drift or marker findings\" },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst strict = args.flags.strict;\n\t\t\tconst resolved = resolveMode({\n\t\t\t\tmarkerOnly: args.flags.markerOnly,\n\t\t\t\tschemaOnly: args.flags.schemaOnly,\n\t\t\t\tstrict\n\t\t\t});\n\t\t\tif (!resolved.ok) return notOk$1(resolved.failure);\n\t\t\tconst mode = resolved.value;\n\t\t\tconst commandInvocation = invocation(mode, strict);\n\t\t\tconst emitted = await readEmittedContract({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tcommandName: commandInvocation\n\t\t\t});\n\t\t\tif (!emitted.ok) return notOk$1(emitted.failure);\n\t\t\tconst connection = requireVerifyConnection({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tinvocation: commandInvocation\n\t\t\t});\n\t\t\tif (!connection.ok) return notOk$1(connection.failure);\n\t\t\tconst dbConnection = connection.value;\n\t\t\tconst header = headerBlock({\n\t\t\t\tcontractPath: emitted.value.displayPath,\n\t\t\t\tmode,\n\t\t\t\tstrict,\n\t\t\t\tdatabase: maskConnectionUrl(dbConnection)\n\t\t\t});\n\t\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\t\tconst client = createClient({\n\t\t\t\tfamily: ctx.config.family,\n\t\t\t\ttarget: ctx.config.target,\n\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t});\n\t\t\tconst onProgress = controlProgressReporter(ctx.report);\n\t\t\tconst startedAt = Date.now();\n\t\t\ttry {\n\t\t\t\tif (mode === \"schema-only\") {\n\t\t\t\t\tawait client.connect(dbConnection);\n\t\t\t\t\tconst aggregate = await client.dbVerify({\n\t\t\t\t\t\tcontract: emitted.value.contract,\n\t\t\t\t\t\tmigrationsDir,\n\t\t\t\t\t\tstrict,\n\t\t\t\t\t\tskipSchema: false,\n\t\t\t\t\t\tskipMarker: true,\n\t\t\t\t\t\tonProgress\n\t\t\t\t\t});\n\t\t\t\t\tif (!aggregate.ok) return notOk$1(normalizeError(aggregate.failure));\n\t\t\t\t\tconst combined = combineVerifyResults(aggregate.value.schemaResults, aggregate.value.appSpaceId, strict, aggregate.value.unclaimed);\n\t\t\t\t\tconst document = {\n\t\t\t\t\t\t...combined.result,\n\t\t\t\t\t\tunclaimed: combined.unclaimed\n\t\t\t\t\t};\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: combined.result.ok ? 0 : FINDINGS_EXIT_CODE$1,\n\t\t\t\t\t\tdiagnostics: combined.result.ok ? [] : driftDiagnostics({\n\t\t\t\t\t\t\tperSpace: aggregate.value.schemaResults,\n\t\t\t\t\t\t\tcombined\n\t\t\t\t\t\t})\n\t\t\t\t\t}, schemaPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader,\n\t\t\t\t\t\tstrict\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst verified = await client.verify({\n\t\t\t\t\tcontract: emitted.value.contract,\n\t\t\t\t\tconnection: dbConnection,\n\t\t\t\t\tonProgress\n\t\t\t\t});\n\t\t\t\tif (!verified.ok) {\n\t\t\t\t\tconst document = verifyDocument({\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\tmode,\n\t\t\t\t\t\tsummary: verified.summary,\n\t\t\t\t\t\tverified,\n\t\t\t\t\t\tschema: void 0,\n\t\t\t\t\t\tschemaVerification: \"skipped\",\n\t\t\t\t\t\tunclaimed: void 0,\n\t\t\t\t\t\twarning: void 0,\n\t\t\t\t\t\telapsed: Date.now() - startedAt\n\t\t\t\t\t});\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: FINDINGS_EXIT_CODE$1,\n\t\t\t\t\t\tdiagnostics: [markerFindingDiagnostic(verified)]\n\t\t\t\t\t}, verifyPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst aggregate = await client.dbVerify({\n\t\t\t\t\tcontract: emitted.value.contract,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tstrict,\n\t\t\t\t\tskipSchema: mode === \"marker-only\",\n\t\t\t\t\tskipMarker: false,\n\t\t\t\t\tonProgress\n\t\t\t\t});\n\t\t\t\tif (!aggregate.ok) return notOk$1(normalizeError(aggregate.failure));\n\t\t\t\tconst drift = aggregate.value.markerDrift;\n\t\t\t\tif (drift !== null) {\n\t\t\t\t\tconst driftCombined = mode === \"marker-only\" ? void 0 : combineVerifyResults(aggregate.value.schemaResults, aggregate.value.appSpaceId, strict, aggregate.value.unclaimed);\n\t\t\t\t\tconst document = verifyDocument({\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\tmode,\n\t\t\t\t\t\tsummary: normalizeError(drift).message,\n\t\t\t\t\t\tverified,\n\t\t\t\t\t\tschema: driftCombined === void 0 ? void 0 : schemaSummary(driftCombined),\n\t\t\t\t\t\tschemaVerification: driftCombined === void 0 ? \"skipped\" : \"performed\",\n\t\t\t\t\t\tunclaimed: driftCombined?.unclaimed,\n\t\t\t\t\t\twarning: void 0,\n\t\t\t\t\t\telapsed: Date.now() - startedAt\n\t\t\t\t\t});\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: FINDINGS_EXIT_CODE$1,\n\t\t\t\t\t\tdiagnostics: [markerDriftDiagnostic(drift), ...driftCombined !== void 0 && !driftCombined.result.ok ? driftDiagnostics({\n\t\t\t\t\t\t\tperSpace: aggregate.value.schemaResults,\n\t\t\t\t\t\t\tcombined: driftCombined\n\t\t\t\t\t\t}) : []]\n\t\t\t\t\t}, verifyPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tif (mode === \"marker-only\") {\n\t\t\t\t\tconst document = verifyDocument({\n\t\t\t\t\t\tok: true,\n\t\t\t\t\t\tmode,\n\t\t\t\t\t\tsummary: \"Database marker matches contract\",\n\t\t\t\t\t\tverified,\n\t\t\t\t\t\tschema: void 0,\n\t\t\t\t\t\tschemaVerification: \"skipped\",\n\t\t\t\t\t\tunclaimed: void 0,\n\t\t\t\t\t\twarning: \"Schema verification skipped because --marker-only was provided\",\n\t\t\t\t\t\telapsed: Date.now() - startedAt\n\t\t\t\t\t});\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: 0\n\t\t\t\t\t}, verifyPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst combined = combineVerifyResults(aggregate.value.schemaResults, aggregate.value.appSpaceId, strict, aggregate.value.unclaimed);\n\t\t\t\tif (!combined.result.ok) {\n\t\t\t\t\tconst document = {\n\t\t\t\t\t\t...combined.result,\n\t\t\t\t\t\tunclaimed: combined.unclaimed\n\t\t\t\t\t};\n\t\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\t\tdata: document,\n\t\t\t\t\t\texitCode: FINDINGS_EXIT_CODE$1,\n\t\t\t\t\t\tdiagnostics: driftDiagnostics({\n\t\t\t\t\t\t\tperSpace: aggregate.value.schemaResults,\n\t\t\t\t\t\t\tcombined\n\t\t\t\t\t\t})\n\t\t\t\t\t}, schemaPresentations({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\theader,\n\t\t\t\t\t\tstrict\n\t\t\t\t\t})));\n\t\t\t\t}\n\t\t\t\tconst document = verifyDocument({\n\t\t\t\t\tok: true,\n\t\t\t\t\tmode,\n\t\t\t\t\tsummary: \"Database marker and schema match contract\",\n\t\t\t\t\tverified,\n\t\t\t\t\tschema: schemaSummary(combined),\n\t\t\t\t\tschemaVerification: \"performed\",\n\t\t\t\t\tunclaimed: combined.unclaimed,\n\t\t\t\t\twarning: void 0,\n\t\t\t\t\telapsed: Date.now() - startedAt\n\t\t\t\t});\n\t\t\t\treturn ok$1(ctx.present({\n\t\t\t\t\tdata: document,\n\t\t\t\t\texitCode: 0\n\t\t\t\t}, verifyPresentations({\n\t\t\t\t\tdocument,\n\t\t\t\t\theader\n\t\t\t\t})));\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn notOk$1(verificationThrow({\n\t\t\t\t\terror,\n\t\t\t\t\tinvocation: commandInvocation,\n\t\t\t\t\tconnection: dbConnection\n\t\t\t\t}));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t}\n\t});\n}\nconst dbVerifyCommand = createDbVerifyCommand();\n//#endregion\n//#region src/control-api/operations/format.ts\nfunction resolveNewline(formatterNewline, eol) {\n\tif (formatterNewline !== void 0) return formatterNewline;\n\treturn eol === \"\\r\\n\" ? \"CRLF\" : \"LF\";\n}\nasync function executeFormat(options) {\n\tconst eol = options.eol ?? EOL;\n\tconst config = options.config;\n\tconst source = config.contract?.source;\n\tif (source?.format !== \"psl\") return ok({ formatted: false });\n\tconst declaredPath = source.inputs?.[0];\n\tif (declaredPath === void 0) return ok({ formatted: false });\n\tconst inputPath = resolve(options.cwd, declaredPath);\n\tlet contents;\n\ttry {\n\t\tcontents = await readFile(inputPath, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"CONTRACT.SOURCE_LOAD_FAILED\", \"Failed to read contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} exists and is readable.`,\n\t\t\tcause: error\n\t\t}));\n\t}\n\tconst formatOptions = {\n\t\tindent: config.formatter?.indent ?? 2,\n\t\tnewline: resolveNewline(config.formatter?.newline, eol)\n\t};\n\tlet formatted;\n\ttry {\n\t\tformatted = format(contents, formatOptions);\n\t} catch (error) {\n\t\tif (isStructuredError(error) && error.code === \"PSL.PARSE_FAILED\") return notOk(errorRuntime(\"PSL.PARSE_FAILED\", \"Cannot format PSL with parse errors\", {\n\t\t\twhy: error.message,\n\t\t\tfix: \"Fix the parse errors in your schema and try again.\",\n\t\t\tmeta: { diagnostics: error.meta?.[\"diagnostics\"] },\n\t\t\tcause: error\n\t\t}));\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error)));\n\t}\n\ttry {\n\t\tawait writeFile(inputPath, formatted, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"CLI.FILE_WRITE_FAILED\", \"Failed to write formatted contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} is writable.`,\n\t\t\tcause: error\n\t\t}));\n\t}\n\treturn ok({\n\t\tformatted: true,\n\t\tpath: inputPath\n\t});\n}\n//#endregion\n//#region src/orm/format.ts\nconst NOTHING_TO_FORMAT = \"Nothing to format (contract source is not PSL).\";\nfunction formatPresentations(document, cwd) {\n\tconst path = document.path;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => document.formatted && path !== void 0 ? [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [{ text: \"Formatted \" }, {\n\t\t\t\ttext: relative(cwd, path),\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]\n\t\t}] : [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: NOTHING_TO_FORMAT\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createFormatCommand(execute = executeFormat) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Format your PSL contract source\",\n\t\t\tdescription: \"Formats the Prisma schema (PSL) contract source declared in your config\\n(contract.source.inputs[0]) in place. Only runs when contract.source.format\\nis 'psl'; a TypeScript or unset source is left untouched. Indent and newline\\nare read from the optional formatter config section, defaulting to two\\nspaces and the system newline.\",\n\t\t\texamples: [\"format\", \"format --json\"]\n\t\t},\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (_args, ctx) => {\n\t\t\tconst result = await execute({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (!result.ok) return notOk$1(normalizeError(result.failure));\n\t\t\treturn ok$1(ctx.present({ data: result.value }, formatPresentations(result.value, ctx.cwd)));\n\t\t}\n\t});\n}\nconst formatCommand = createFormatCommand();\n//#endregion\n//#region src/commands/init/detect-pnpm-catalog.ts\n/**\n* Walks up from `baseDir` looking for `pnpm-workspace.yaml`, then scans\n* its top-level `catalog:` block for entries that match any of `packages`.\n*\n* Implements FR7.3 / Spec Decision 8 (honour-and-warn): when `init` runs\n* inside a pnpm workspace whose catalog overrides one of the packages it\n* installs, surface a structured warning so the user knows the catalog\n* version (not the published `latest`) is what ended up in their\n* `node_modules`. pnpm itself does this silently; the warning closes the\n* \"looks fine, must be wrong version six months later\" gap.\n*\n* Notes / scope:\n*\n* - We only inspect the unnamed top-level `catalog:` block. pnpm also\n* supports `catalogs:` (plural — *named* catalogs referenced via\n* `catalog:foo` specifiers); those don't apply to the vanilla\n* `pnpm add` invocations `init` runs, so we skip them.\n* - We don't validate YAML syntax exhaustively. The file format pnpm\n* ships is line-oriented and well-known; a minimal regex is more\n* robust than depending on a YAML parser for one warning.\n* - We don't compare against the registry's `latest` — pnpm uses the\n* catalog version regardless, so the warning fires whenever a match\n* exists. The user-facing copy explains how to opt out.\n*/\nfunction detectPnpmCatalogOverrides(baseDir, packages) {\n\tconst workspaceFile = findNearestPnpmWorkspaceFile(baseDir);\n\tif (workspaceFile === null) return null;\n\tconst catalog = extractCatalogBlock(readFileSync(workspaceFile, \"utf-8\"));\n\tif (catalog === null) return {\n\t\tworkspaceFile,\n\t\tentries: []\n\t};\n\tconst wanted = new Set(packages);\n\tconst entries = [];\n\tfor (const [name, version] of catalog) if (wanted.has(name)) entries.push({\n\t\tname,\n\t\tversion\n\t});\n\treturn {\n\t\tworkspaceFile,\n\t\tentries\n\t};\n}\nfunction findNearestPnpmWorkspaceFile(baseDir) {\n\tlet dir = baseDir;\n\tlet prev = \"\";\n\twhile (dir !== prev) {\n\t\tconst candidate = join(dir, \"pnpm-workspace.yaml\");\n\t\tif (existsSync(candidate)) return candidate;\n\t\tprev = dir;\n\t\tdir = dirname(dir);\n\t}\n\treturn null;\n}\n/**\n* Returns the entries inside the top-level `catalog:` block as `[name, version]`\n* pairs in document order, or `null` when no `catalog:` block exists.\n*\n* The parser is intentionally minimal: it reads line-by-line, locates the\n* top-level `catalog:` line (no leading whitespace), then collects every\n* subsequent indented line of the form `<key>: <value>` until the next\n* top-level key (or end of file). Quotes around `<key>` and `<value>`\n* are stripped; comments (`#…`) are ignored.\n*/\nfunction extractCatalogBlock(contents) {\n\tconst lines = contents.split(/\\r?\\n/);\n\tconst startIdx = lines.findIndex((line) => /^catalog\\s*:\\s*$/.test(line));\n\tif (startIdx === -1) return null;\n\tconst entries = [];\n\tfor (let i = startIdx + 1; i < lines.length; i++) {\n\t\tconst raw = lines[i] ?? \"\";\n\t\tif (raw.trim() === \"\" || /^\\s*#/.test(raw)) continue;\n\t\tif (!/^\\s/.test(raw)) break;\n\t\tconst match = raw.match(/^\\s+(?:'([^']+)'|\"([^\"]+)\"|([^:\\s'\"]+))\\s*:\\s*(.*?)\\s*(?:#.*)?$/);\n\t\tif (!match) continue;\n\t\tconst name = match[1] ?? match[2] ?? match[3];\n\t\tif (name === void 0) continue;\n\t\tconst version = stripQuotes((match[4] ?? \"\").trim());\n\t\tif (version === \"\") continue;\n\t\tentries.push([name, version]);\n\t}\n\treturn entries;\n}\nfunction stripQuotes(value) {\n\tif (value.length >= 2) {\n\t\tconst first = value[0];\n\t\tconst last = value[value.length - 1];\n\t\tif (first === \"\\\"\" && last === \"\\\"\" || first === \"'\" && last === \"'\") return value.slice(1, -1);\n\t}\n\treturn value;\n}\n//#endregion\n//#region src/commands/init/catalog-warnings.ts\nfunction formatCatalogWarning(workspaceFile, entries) {\n\treturn [\n\t\t\"pnpm workspace catalog overrides detected — pnpm will install these versions instead of `latest`:\",\n\t\tentries.map((entry) => ` • ${entry.name}: ${entry.version}`).join(\"\\n\"),\n\t\t`Catalog source: ${workspaceFile}`,\n\t\t\"To use the published `latest` instead, remove or update the catalog entry, then re-run `pnpm install`.\"\n\t].join(\"\\n\");\n}\n/**\n* Honour-and-warn: when the surrounding pnpm workspace pins one of the\n* packages `init` installs through its catalog, say so — the catalog version,\n* not the published `latest`, is what ends up in the project. Empty when there\n* is no workspace above the project or its catalog names none of them.\n*/\nfunction buildCatalogWarnings(baseDir, packages) {\n\tconst result = detectPnpmCatalogOverrides(baseDir, packages);\n\tif (result === null || result.entries.length === 0) return [];\n\treturn [formatCatalogWarning(result.workspaceFile, result.entries)];\n}\n//#endregion\n//#region src/commands/init/errors.ts\n/**\n* Non-interactive mode is missing one or more required inputs. Lists every\n* missing flag in the error so an agent / CI script can react without\n* needing to parse English.\n*\n* @param missing — kebab-case flag names without leading dashes\n* @param why — additional context (e.g. \"stdin is not a TTY\") that helps\n* the user understand why interactive fallback was skipped.\n*/\nfunction errorInitMissingFlags(options) {\n\tconst flagList = options.missing.map((flag) => `--${flag}`).join(\", \");\n\tconst fixList = options.missing.map((flag) => {\n\t\tswitch (flag) {\n\t\t\tcase \"target\": return \"--target postgres|mongodb\";\n\t\t\tcase \"authoring\": return \"--authoring psl|typescript\";\n\t\t\tcase \"schema-path\": return \"--schema-path <path>\";\n\t\t\tdefault: return `--${flag} <value>`;\n\t\t}\n\t}).join(\" \");\n\treturn new CliStructuredError$2(\"CLI.INIT_MISSING_FLAGS\", \"Missing required flags\", {\n\t\twhy: `${options.why} Missing required flag(s): ${flagList}.`,\n\t\tfix: `Re-run with the missing flag(s) supplied, e.g. \\`prisma orm init --yes ${fixList}\\`. Use \\`prisma orm init --help\\` to see every flag.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_MISSING_FLAGS\"),\n\t\tmeta: { missingFlags: options.missing }\n\t});\n}\n/**\n* A flag value was supplied but is not in the allowed set. Lists the\n* allowed values in `meta` for machine-readable consumption.\n*/\nfunction errorInitInvalidFlagValue(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_INVALID_FLAG_VALUE\", `Invalid value for --${options.flag}`, {\n\t\twhy: `\\`--${options.flag} ${options.value}\\` is not one of: ${options.allowed.join(\", \")}.`,\n\t\tfix: `Use one of: ${options.allowed.map((v) => `--${options.flag} ${v}`).join(\", \")}.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_FLAG_VALUE\"),\n\t\tmeta: {\n\t\t\tflag: options.flag,\n\t\t\tvalue: options.value,\n\t\t\tallowed: options.allowed\n\t\t}\n\t});\n}\n/**\n* `--authoring` and `--schema-path` disagree on file extension (e.g. PSL\n* authoring with a `.ts` path). Surfaces before any scaffold files are\n* written so the project tree stays untouched.\n*/\nfunction errorInitAuthoringSchemaPathMismatch(options) {\n\tconst expectedAuthoring = options.expectedExtension === \".ts\" ? \"typescript\" : \"psl\";\n\treturn new CliStructuredError$2(\"CLI.INIT_AUTHORING_SCHEMA_PATH_MISMATCH\", \"Authoring and schema path do not match\", {\n\t\twhy: `\\`--authoring ${options.authoring}\\` requires a schema file ending in ${options.expectedExtension}, but \\`--schema-path ${options.schemaPath}\\` ends in ${options.actualExtension}.`,\n\t\tfix: `Use a matching pair, for example \\`--authoring ${expectedAuthoring} --schema-path <path>${options.expectedExtension}\\`, or change \\`--authoring\\` to match the path you supplied. You can also omit \\`--schema-path\\` to use the default for the chosen authoring.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_AUTHORING_SCHEMA_PATH_MISMATCH\"),\n\t\tmeta: {\n\t\t\tauthoring: options.authoring,\n\t\t\tschemaPath: options.schemaPath,\n\t\t\tactualExtension: options.actualExtension,\n\t\t\texpectedExtension: options.expectedExtension\n\t\t}\n\t});\n}\n/**\n* The user cancelled an interactive prompt (Ctrl-C, escape, declined a\n* selection) — the generic \"user said no\" path. Maps to exit code\n* 3 (USER_ABORTED).\n*/\nfunction errorInitUserAborted() {\n\treturn new CliStructuredError$2(\"CLI.INIT_USER_ABORTED\", \"Init cancelled\", {\n\t\twhy: \"The interactive prompt was cancelled before all required inputs were supplied. No files were modified.\",\n\t\tfix: \"Re-run `prisma orm init` and complete the prompts, or pass the required inputs as flags (see `--help`) for a non-interactive run.\",\n\t\tseverity: \"info\"\n\t});\n}\n/**\n* `--strict-probe` was supplied without `--probe-db`. Per FR8.3 / NFR9\n* (offline-by-default), `--strict-probe` is a no-op without `--probe-db` —\n* but rather than silently ignoring it we tell the user what they probably\n* meant. Without this guard, the flag combination silently does nothing,\n* which is exactly the kind of \"looks like it worked\" trap that a strict\n* mode is supposed to prevent.\n*/\nfunction errorInitStrictProbeWithoutProbe() {\n\treturn new CliStructuredError$2(\"CLI.INIT_STRICT_PROBE_WITHOUT_PROBE\", \"`--strict-probe` requires `--probe-db`\", {\n\t\twhy: \"`--strict-probe` only changes how a *failed* probe is reported; without `--probe-db` no probe is attempted in the first place. (`init` is offline-by-default — it never opens a connection to your database without explicit consent.)\",\n\t\tfix: \"Add `--probe-db` to opt in to the probe, or drop `--strict-probe` if you do not need the version check.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_STRICT_PROBE_WITHOUT_PROBE\")\n\t});\n}\n/**\n* The user's project manifest (typically `package.json`) failed to parse\n* as JSON. Init reads the manifest to merge `scripts` (FR3.5) and to\n* skip `@types/node` when it is already declared (FR2.1); a malformed\n* file would otherwise surface as an `INTERNAL_ERROR` with a raw\n* `SyntaxError` stack, which violates the FR1.6 contract that every\n* documented failure mode maps to a stable exit code.\n*\n* Maps to exit code `2 = PRECONDITION` — the user can fix the manifest\n* and re-run.\n*/\nfunction errorInitInvalidManifest(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_INVALID_MANIFEST\", `Failed to parse ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` is not valid JSON: ${options.cause}`,\n\t\tfix: `Fix the JSON syntax in \\`${options.path}\\` (a missing comma or unbalanced brace is the most common cause), then re-run \\`prisma orm init\\`.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_MANIFEST\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* The user's existing `tsconfig.json` could not be parsed even with JSONC\n* tolerance (comments + trailing commas) enabled. Init merges the\n* minimum compiler options the scaffolded files need (FR2.2), so an\n* unparseable tsconfig is a hard precondition failure: we cannot\n* faithfully edit a file we cannot read.\n*\n* Init must surface this **before** writing any scaffold file so the\n* user's working tree stays byte-identical (FR6.2 / NFR3) — see\n* `runInit` for the precondition gate.\n*\n* Maps to exit code `2 = PRECONDITION` — the user can fix the file and\n* re-run.\n*/\nfunction errorInitInvalidTsconfig(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_INVALID_TSCONFIG\", `Failed to parse ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` is not valid JSON or JSONC: ${options.cause}`,\n\t\tfix: `Fix the syntax in \\`${options.path}\\` and re-run \\`prisma orm init\\`. \\`init\\` accepts JSONC (comments and trailing commas) but cannot recover from unbalanced braces or missing commas.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_TSCONFIG\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* `--probe-db` was supplied along with `--strict-probe` and the probe\n* could not complete (no `DATABASE_URL`, network/auth error, the target\n* driver was not installed, …). Without `--strict-probe` the probe\n* surfaces these as warnings; `--strict-probe` escalates them to\n* fatal so a CI gate can rely on \"init exit code 2 means something\n* about the runtime environment is wrong\" (FR8.3).\n*\n* Maps to exit code `2 = PRECONDITION`. The caller's project files\n* are already on disk by this point — the probe runs after the write\n* phase — but the install/emit steps may or may not have completed\n* depending on `--no-install` and the exact failure mode; `meta`\n* carries `filesWritten` so a follow-up agent can resume manually.\n*/\nfunction errorInitProbeFailed(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_PROBE_FAILED\", \"Database probe failed\", {\n\t\twhy: `\\`--probe-db\\` could not complete and \\`--strict-probe\\` was set: ${options.cause}`,\n\t\tfix: \"Confirm `DATABASE_URL` points at a reachable server, or drop `--strict-probe` to treat probe failures as warnings.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_PROBE_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* A scaffold file could not be written after earlier writes had already\n* landed. The directory is half-scaffolded, so this carries the list of what\n* did get written, the way every other post-write failure in `init` does.\n*\n* Maps to exit code `2 = PRECONDITION`: what stopped the write is something\n* about the directory the user can fix.\n*/\nfunction errorInitWriteFailed(options) {\n\treturn new CliStructuredError$2(\"CLI.INIT_WRITE_FAILED\", `Failed to write ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` could not be written: ${options.cause}`,\n\t\tfix: \"Fix what stopped the write — a directory sitting where the file goes, permissions, a full disk — then run `prisma orm init` again. Interactive runs ask before replacing the files this run already wrote (listed in `meta.filesWritten`); non-interactive runs grant that consent with `--confirm <directory name>`.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_WRITE_FAILED\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause,\n\t\t\tfilesWritten: options.filesWritten\n\t\t}\n\t});\n}\n//#endregion\n//#region src/commands/init/probe-db.ts\n/**\n* Connects (when configured) to the user's database and returns a\n* structured outcome describing whether the server meets the declared\n* minimum (FR8.1). Pure with respect to its inputs: no I/O happens\n* unless `databaseUrl` is set.\n*\n* The outcome is shaped so that `--strict-probe` can branch on the\n* `kind`/`meetsMinimum` pair without re-stringifying the message:\n*\n* - `ok` — informational; `init` continues.\n* - `below-minimum` — warning; `init` continues regardless of\n* `--strict-probe` (the spec scopes strict-probe to \"probe\n* *failures*\", and a successful probe that finds an old server is\n* not a failure).\n* - `no-database-url` / `connection-failed` / `driver-missing` —\n* warning by default, fatal under `--strict-probe`.\n*/\nasync function probeServerVersion(ctx, overrides = {}) {\n\tconst { databaseUrl, minVersion, target } = ctx;\n\tif (databaseUrl === void 0 || databaseUrl.trim().length === 0) return {\n\t\tkind: \"no-database-url\",\n\t\tminVersion,\n\t\tmeetsMinimum: null,\n\t\tmessage: \"Skipped --probe-db: DATABASE_URL is not set in the current shell environment. (init does not read .env for the probe; export the variable or drop --probe-db.)\"\n\t};\n\tlet driverResult;\n\ttry {\n\t\tif (target === \"postgres\") driverResult = overrides.probePostgres !== void 0 ? await overrides.probePostgres(databaseUrl) : await defaultProbePostgres(databaseUrl, ctx.baseDir, overrides);\n\t\telse driverResult = overrides.probeMongo !== void 0 ? await overrides.probeMongo(databaseUrl) : await defaultProbeMongo(databaseUrl, ctx.baseDir, overrides);\n\t} catch (err) {\n\t\tif (err instanceof DriverMissingError) return {\n\t\t\tkind: \"driver-missing\",\n\t\t\tminVersion,\n\t\t\tmeetsMinimum: null,\n\t\t\tcause: err.message,\n\t\t\tmessage: `Skipped --probe-db: ${err.message}. (Run with install enabled, or install the driver yourself, then re-run \\`prisma orm init --probe-db\\`.)`\n\t\t};\n\t\tconst cause = redactDatabaseUrlSecrets(causeMessage$2(err));\n\t\treturn {\n\t\t\tkind: \"connection-failed\",\n\t\t\tminVersion,\n\t\t\tmeetsMinimum: null,\n\t\t\tcause,\n\t\t\tmessage: `--probe-db could not connect: ${cause}.`\n\t\t};\n\t}\n\tif (compareVersionPrefix(driverResult.serverVersion, minVersion) < 0) return {\n\t\tkind: \"below-minimum\",\n\t\tserverVersion: driverResult.serverVersion,\n\t\tminVersion,\n\t\tmeetsMinimum: false,\n\t\tmessage: `--probe-db: server reports version ${driverResult.serverVersion}, below the declared minimum (${minVersion}). Some queries may fail until the server is upgraded.`\n\t};\n\treturn {\n\t\tkind: \"ok\",\n\t\tserverVersion: driverResult.serverVersion,\n\t\tminVersion,\n\t\tmeetsMinimum: true,\n\t\tmessage: `--probe-db: server reports version ${driverResult.serverVersion} (>= ${minVersion}).`\n\t};\n}\n/**\n* Compares two semver-prefix strings (\"14\", \"14.2\", \"6.0\", …) by\n* numeric components left-to-right. Returns a negative number when `a`\n* is older than `b`, zero when both versions agree on every numeric\n* component (treating missing trailing components as `0`), and a\n* positive number when `a` is newer.\n*\n* The loop runs over the **longer** of the two prefixes so that\n* `'14'` compares less than `'14.1'` — without that, the shorter\n* prefix would be silently accepted whenever the configured minimum\n* has a non-zero minor or patch.\n*\n* Exported for unit tests.\n*/\nfunction compareVersionPrefix(a, b) {\n\tconst aParts = parseNumericParts(a);\n\tconst bParts = parseNumericParts(b);\n\tconst len = Math.max(aParts.length, bParts.length);\n\tfor (let i = 0; i < len; i += 1) {\n\t\tconst aPart = aParts[i] ?? 0;\n\t\tconst bPart = bParts[i] ?? 0;\n\t\tif (aPart !== bPart) return aPart - bPart;\n\t}\n\treturn 0;\n}\nfunction parseNumericParts(version) {\n\tconst match = version.match(/^[^\\d]*(\\d+(?:\\.\\d+){0,3})/);\n\tif (match === null) return [];\n\treturn (match[1] ?? \"\").split(\".\").map((part) => Number.parseInt(part, 10));\n}\nvar DriverMissingError = class extends Error {};\nfunction causeMessage$2(err) {\n\tif (err instanceof Error) return err.message;\n\treturn String(err);\n}\n/**\n* Strips `user:password@` userinfo from any URL-shaped substring before\n* we surface the cause to the user. Mirrors `redactSecrets` in\n* `init.ts` — the probe path has its own redactor because the inputs\n* here include the raw connection string by construction (driver\n* errors echo the URL back).\n*\n* Exported for unit tests.\n*/\nfunction redactDatabaseUrlSecrets(text) {\n\tif (!text) return text;\n\treturn text.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/)([^/@\\s]+)@/g, \"$1***@\");\n}\nasync function defaultProbePostgres(databaseUrl, baseDir, overrides) {\n\tconst client = suppressIdleConnectionErrors(new (requirePeer(\"pg\", baseDir, overrides)).Client({ connectionString: databaseUrl }));\n\ttry {\n\t\tawait client.connect();\n\t\tconst result = await client.query(\"SELECT version() as version\");\n\t\treturn { serverVersion: parsePostgresVersion(String(result?.rows?.[0]?.version ?? \"\")) };\n\t} finally {\n\t\tawait client.end().catch(() => void 0);\n\t}\n}\n/**\n* Extracts the numeric prefix from a Postgres `version()` row, e.g.\n*\n* `PostgreSQL 14.10 on x86_64-pc-linux-gnu, ...` → `\"14.10\"`\n* `PostgreSQL 16beta1 on …` → `\"16\"` (we\n* conservatively drop the suffix; minimum-version comparisons\n* treat 16beta1 as 16, which is what every reasonable user\n* expects).\n*\n* Exported for unit tests.\n*/\nfunction parsePostgresVersion(versionString) {\n\tconst match = versionString.match(/PostgreSQL\\s+(\\d+(?:\\.\\d+)?)/i);\n\tif (match === null || match[1] === void 0) throw new CliStructuredError(\"CLI.INIT_PROBE_FAILED\", `Could not parse PostgreSQL version from \\`${versionString}\\``);\n\treturn match[1];\n}\nasync function defaultProbeMongo(databaseUrl, baseDir, overrides) {\n\tconst client = new (requirePeer(\"mongodb\", baseDir, overrides)).MongoClient(databaseUrl);\n\tawait client.connect();\n\ttry {\n\t\tconst buildInfo = await client.db().admin().command({ buildInfo: 1 });\n\t\tconst versionString = String(buildInfo.version ?? \"\");\n\t\tif (versionString.length === 0) throw new CliStructuredError(\"CLI.INIT_PROBE_FAILED\", \"buildInfo did not include a `version` field\");\n\t\treturn { serverVersion: versionString };\n\t} finally {\n\t\tawait client.close().catch(() => void 0);\n\t}\n}\n/**\n* Loads a peer driver (`pg` / `mongodb`) from the user's project\n* `node_modules`. We deliberately resolve from `baseDir` rather than\n* from the CLI bundle — the CLI does not depend on `pg` or `mongodb`\n* directly, but the user's `init`-generated `package.json` does (via\n* the target facade). Failure to resolve is folded into a typed\n* `DriverMissingError` so `probeServerVersion` can map it to a\n* `driver-missing` outcome rather than letting a `MODULE_NOT_FOUND`\n* leak as a generic connection failure.\n*/\nfunction requirePeer(moduleId, baseDir, overrides) {\n\ttry {\n\t\tif (overrides.requireFromBaseDir !== void 0) return overrides.requireFromBaseDir(baseDir, moduleId);\n\t\treturn createRequire(join(baseDir, \"package.json\"))(moduleId);\n\t} catch (err) {\n\t\tthrow new DriverMissingError(`\\`${moduleId}\\` is not installed in this project (resolved from ${baseDir}; cause: ${causeMessage$2(err)})`);\n\t}\n}\n//#endregion\n//#region src/commands/init/skill-sources.ts\n/**\n* Default base for the GitHub-URL form `<owner>/<repo>` consumed by\n* upstream `skills add`. Each `SkillSource` joins this base with its\n* own subpath (and optional `#ref` for version-pinned clusters).\n*/\nconst DEFAULT_SKILL_BASE = \"prisma/prisma\";\nconst DEFAULT_SKILL_SOURCES = [\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-8\",\n\t\tref: \"cli\",\n\t\tdescription: \"usage skill (version-locked to installed Prisma Next)\"\n\t},\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-next-upgrade\",\n\t\tref: null,\n\t\tdescription: \"upgrade skill (always tracks `main`)\"\n\t},\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-8-extension-upgrade\",\n\t\tref: null,\n\t\tdescription: \"extension-author upgrade skill (always tracks `main`)\"\n\t}\n];\n/**\n* Test-only escape hatch for pinning the install base to a local\n* checkout. Production runs leave this unset, so installs always use\n* `DEFAULT_SKILL_BASE`.\n*\n* When set to an absolute filesystem path (typical for tests), the\n* `#ref` fragment is dropped — local-path mode in upstream's CLI does\n* not accept refs, and the local clone has whatever content the test\n* checked into it anyway. When set to anything else (e.g. a fork name\n* `myuser/prisma`), the ref policy is preserved.\n*/\nfunction resolveAgentSkillBase(env) {\n\tconst override = env[\"PRISMA_NEXT_SKILLS_BASE\"]?.trim();\n\treturn override && override.length > 0 ? override : DEFAULT_SKILL_BASE;\n}\nfunction isLocalPath(base) {\n\treturn base.startsWith(\"/\") || /^[a-zA-Z]:[\\\\/]/.test(base);\n}\n/**\n* Agents passed to every project-level init install. Upstream `skills add`\n* is the source of truth for per-agent install behaviour; the CLI lists\n* every supported runtime on one invocation and delegates the rest.\n*/\nconst DEFAULT_SKILL_AGENTS = [\n\t\"cursor\",\n\t\"claude-code\",\n\t\"codex\",\n\t\"windsurf\"\n];\n/**\n* Build the `<base>/<subpath>[#ref]` URL the `skills` CLI will\n* resolve. Exported for unit tests so the per-source format can be\n* asserted without going through the full install loop.\n*/\nfunction formatSkillSourceUrl(source, env = process.env) {\n\tconst base = resolveAgentSkillBase(env);\n\tconst url = `${base}/${source.subpath}`;\n\tif (source.ref === null) return url;\n\tif (isLocalPath(base)) return url;\n\tif (source.ref === \"cli\") return `${url}#v${version}`;\n\treturn url;\n}\n/**\n* The skill-install command for one source, formatted for the\n* project's detected package manager. `npx`/`pnpm dlx`/`bunx` are\n* interchangeable to the user; we pick the variant that matches the\n* rest of the install step so a single project consistently uses one\n* runner.\n*\n* `--agent` takes space-separated slugs on one flag; the explicit\n* `--skill <name>` and `-y` skip the multi-select prompts a\n* non-interactive scaffold step cannot show.\n*\n* Exported for unit tests so the per-PM dispatch can be asserted\n* without a live subprocess.\n*/\nfunction formatSkillInstallCommand(args) {\n\tconst agents = args.agents ?? DEFAULT_SKILL_AGENTS;\n\tconst cliArgs = [\n\t\t\"skills@latest\",\n\t\t\"add\",\n\t\tformatSkillSourceUrl(args.source, args.env),\n\t\t\"--agent\",\n\t\t...agents,\n\t\t\"--skill\",\n\t\targs.source.skill,\n\t\t\"-y\"\n\t];\n\treturn formatPackageManagerCommand(args.pm, cliArgs);\n}\n/**\n* Ordered skill-install commands for one init run. This is both what the\n* commander shell runs and what either shell tells the user to run when the\n* install is skipped or fails — the commands need no scaffold and no `init`.\n*/\nfunction resolveProjectSkillInstallCommands(pm, env) {\n\treturn DEFAULT_SKILL_SOURCES.map((source) => formatSkillInstallCommand({\n\t\tpm,\n\t\tsource,\n\t\t...ifDefined(\"env\", env)\n\t}));\n}\nfunction formatPackageManagerCommand(pm, args) {\n\tswitch (pm) {\n\t\tcase \"pnpm\": return `pnpm dlx ${args.join(\" \")}`;\n\t\tcase \"yarn\": return `yarn dlx ${args.join(\" \")}`;\n\t\tcase \"bun\": return `bunx ${args.join(\" \")}`;\n\t\tcase \"deno\": return `deno run -A npm:${args.join(\" \")}`;\n\t\tcase \"npm\": return `npx ${args.join(\" \")}`;\n\t}\n}\n/**\n* Skill directories that predate the consolidated `prisma-8` skill:\n* the per-workflow usage cluster (including the renamed\n* `prisma-8-migration-review` spelling it briefly shipped under), the\n* pre-rename spellings of the consolidated skill and the\n* extension-author upgrade skill, and any hand-rolled `prisma-next`\n* stub. Projects initialised before the consolidation carry these as\n* sibling directories in each agent's install root; left in place\n* they compete with the current skills for activation, so init\n* removes them on every run.\n*/\nconst RETIRED_SKILL_NAMES = [\n\t\"prisma-next\",\n\t\"prisma-next-quickstart\",\n\t\"prisma-next-contract\",\n\t\"prisma-next-migrations\",\n\t\"prisma-next-migration-review\",\n\t\"prisma-8-migration-review\",\n\t\"prisma-next-queries\",\n\t\"prisma-next-runtime\",\n\t\"prisma-next-build\",\n\t\"prisma-next-supabase\",\n\t\"prisma-next-debug\",\n\t\"prisma-next-feedback\",\n\t\"prisma-next-extension-upgrade\"\n];\n/**\n* Project-level install roots the upstream `skills` CLI uses for the\n* agents in `DEFAULT_SKILL_AGENTS`: cursor and codex install into\n* `.agents/skills`, claude-code into `.claude/skills`, windsurf into\n* `.windsurf/skills`.\n*/\nconst AGENT_SKILL_ROOTS = [\n\t\".agents/skills\",\n\t\".claude/skills\",\n\t\".windsurf/skills\"\n];\n/**\n* Every directory a retired per-workflow skill may occupy in a\n* consumer project. Init deletes each (recursively) before running the\n* skill install. Names that are also in `DEFAULT_SKILL_SOURCES` are\n* excluded so a list mistake can never delete a skill init installs\n* (or one `--skip-skills` preserves) — see TML-2637.\n*/\nfunction legacySkillDirs(retired = RETIRED_SKILL_NAMES, sources = DEFAULT_SKILL_SOURCES) {\n\tconst installed = new Set(sources.map((source) => source.skill));\n\treturn AGENT_SKILL_ROOTS.flatMap((root) => retired.filter((name) => !installed.has(name)).map((name) => `${root}/${name}`));\n}\n//#endregion\n//#region src/commands/init/templates/code-templates.ts\n/**\n* The resolver a scaffold for `target` is written against.\n*\n* A scaffold is always on the facade root: `init` writes an application around\n* one database package, and the workspace names are not published, so a project\n* scaffolded against them could not install (ADR 242). Both the files `init`\n* writes and the dependency it adds go through this, so they cannot disagree.\n*/\nfunction scaffoldSpecifierResolverFor(target) {\n\treturn createScaffoldSpecifierResolver({\n\t\tmode: \"facade\",\n\t\tfacade: target === \"postgres\" ? \"@prisma/orm-postgres\" : \"@prisma/orm-mongo\"\n\t});\n}\n/**\n* The package name a scaffolded project depends on and imports from, for the\n* import root it is being scaffolded against.\n*\n* Every specifier the scaffold writes derives from this one, and `init` builds\n* a single resolver and hands it to both the file templates and the dependency\n* it installs — so the two cannot disagree. The one caller that deliberately\n* does not thread a resolver is the re-init cleanup in `inputs.ts`, which\n* inspects a manifest an earlier run wrote rather than writing one.\n*\n* Resolvers for scaffolding should come from `createScaffoldSpecifierResolver`\n* in the publish-surface package, which rejects the roots a facade-shaped\n* scaffold cannot express. (Named without its scope on purpose: JSDoc survives\n* into the published bundle, where an internal package name would trip the\n* shell tarball checks.)\n*/\nfunction targetPackageName(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\");\n}\n/** One entrypoint of the scaffolded project's target package. */\nfunction targetEntrypoint(target, subpath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(`${target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\"}/${subpath}`);\n}\nfunction targetLabel(target) {\n\treturn target === \"postgres\" ? \"PostgreSQL\" : \"MongoDB\";\n}\nfunction defaultSchemaPath(authoring) {\n\tif (authoring === \"typescript\") return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.ts`;\n\treturn `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.prisma`;\n}\nfunction starterSchema(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? starterSchemaTsMongo(builder) : starterSchemaTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? starterSchemaPslMongo() : starterSchemaPslPostgres();\n}\n/**\n* Renders a short authoring-appropriate schema sample (FR5.1) for embedding\n* in `prisma-next.md`. Returns a complete fenced markdown code block.\n*\n* The sample intentionally shows just one model: it's illustrative, not\n* a substitute for the full scaffolded contract file. The TS samples use\n* the same outer shape as `starterSchemaTs*` (FR5.3) so a user reading\n* the doc and the file side-by-side sees the same structure.\n*/\nfunction schemaSample(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? schemaSampleTsMongo(builder) : schemaSampleTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? schemaSamplePslMongo() : schemaSamplePslPostgres();\n}\nfunction schemaSamplePslPostgres() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n}\n\\`\\`\\``;\n}\nfunction schemaSamplePslMongo() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n @@map(\"users\")\n}\n\\`\\`\\``;\n}\nfunction schemaSampleTsPostgres(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction schemaSampleTsMongo(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction starterSchemaPslPostgres() {\n\treturn `// use prisma-next\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n posts Post[]\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId Int\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n`;\n}\nfunction starterSchemaPslMongo() {\n\treturn `// use prisma-next\n\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n posts Post[]\n @@map(\"users\")\n}\n\nmodel Post {\n id ObjectId @id @map(\"_id\")\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId ObjectId\n @@map(\"posts\")\n}\n`;\n}\nfunction starterSchemaTsPostgres(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract({}, ({ field, model, rel }) => {\n const User = model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n });\n\n const Post = model('Post', {\n fields: {\n id: field.id.uuidv7String(),\n title: field.text(),\n content: field.text().optional(),\n authorId: field.uuidString(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n });\n\n return {\n models: {\n User: User.relations({\n posts: rel.hasMany(Post, { by: 'authorId' }),\n }),\n Post: Post.relations({\n author: rel.belongsTo(User, { from: 'authorId', to: 'id' }),\n }),\n },\n };\n});\n`;\n}\nfunction starterSchemaTsMongo(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n relations: {\n posts: rel.hasMany('Post', { from: '_id', to: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n collection: 'posts',\n fields: {\n _id: field.objectId(),\n title: field.string(),\n content: field.string().optional(),\n authorId: field.objectId(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: '_id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction configFile(target, contractPath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn `import 'dotenv/config';\nimport { definePrismaConfig } from '@prisma/cli-engine';\nimport { defineConfig as ormConfig } from '${targetEntrypoint(target, \"config\", resolveImportSpecifier)}';\n\nexport default definePrismaConfig({\n orm: ormConfig({\n contract: ${JSON.stringify(contractPath)},\n db: {\n connection: process.env['DATABASE_URL']!,\n },\n }),\n});\n`;\n}\nfunction dbFile(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst runtime = targetEntrypoint(target, \"runtime\", resolveImportSpecifier);\n\tif (target === \"postgres\") return `import 'dotenv/config';\nimport postgres from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = postgres<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n\treturn `import 'dotenv/config';\nimport mongo from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = mongo<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n}\n//#endregion\n//#region src/commands/init/templates/env.ts\n/**\n* The minimum supported server version for each target. The\n* authoritative source of truth is each target package's\n* `package.json#prismaNext.minServerVersion` field — this module\n* mirrors those values and a workspace-level test asserts the two\n* never drift (`templates/tsconfig-env.test.ts`).\n*\n* Bumping a value here in isolation is **not** safe: edit the\n* corresponding target package's `package.json` first, then mirror\n* here. The scaffold's `.env.example` and the \"Requirements\" section\n* of `prisma-next.md` both read from this constant, so a stale value\n* lies to every freshly initialised user.\n*/\nconst MIN_SERVER_VERSION = {\n\tpostgres: \"15\",\n\tmongo: \"8.0\"\n};\nconst TARGET_LABEL = {\n\tpostgres: \"PostgreSQL\",\n\tmongo: \"MongoDB\"\n};\n/**\n* Renders the placeholder body shared by `.env` and `.env.example`:\n* the target-specific connection-string requirement comments and the\n* commented-shape `DATABASE_URL` line. The output is identical for both\n* authoring styles — the env file is orthogonal to PSL vs TS schema\n* authoring.\n*/\nfunction envPlaceholderBody(target) {\n\tconst label = TARGET_LABEL[target];\n\tconst minVersion = MIN_SERVER_VERSION[target];\n\tconst lines = [];\n\tlines.push(`# Connection string for ${label}.`);\n\tlines.push(`# Requires ${label} >= ${minVersion}.`);\n\tlines.push(\"\");\n\tif (target === \"postgres\") lines.push(\"DATABASE_URL=\\\"postgresql://user:password@localhost:5432/mydb\\\"\");\n\telse {\n\t\tlines.push(\"# Standalone local mongod / `docker run mongo:8` — no replica set required for first-run queries.\");\n\t\tlines.push(\"# Transactions and change streams need a replica set; add ?replicaSet=... only after initiating one.\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"DATABASE_URL=\\\"mongodb://user:password@localhost:27017/mydb\\\"\");\n\t}\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders the `.env.example` content for a given target:\n*\n* - Carries a \"Copy this file to `.env`…\" intro that only makes sense\n* for the example file (the real `.env` is the destination of that\n* copy and so does not get the same intro).\n* - Documents the `DATABASE_URL` placeholder in the target's native URL\n* shape (Postgres: standard `postgresql://`, Mongo: `mongodb://` plus\n* a `mydb` database segment so the lazy facade has a `dbName`).\n* - Carries a `# Requires <db> >= <version>` comment so a fresh user\n* knows the minimum supported server before they first try to connect.\n*/\nfunction envExampleContent(target) {\n\tconst lines = [];\n\tlines.push(\"# Copy this file to `.env` and replace the placeholder with your real connection string.\");\n\tlines.push(envPlaceholderBody(target));\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders the initial `.env` content for `--write-env` / interactive\n* opt-in. Same placeholder body as `.env.example`, **without** the\n* example file's \"Copy this file to `.env`…\" intro: the real `.env` is\n* the destination of that copy, so the line would lie. Writing this\n* file is gitignored (`.env` lands in `.gitignore` during init).\n*/\nfunction envFileContent(target) {\n\treturn envPlaceholderBody(target);\n}\n//#endregion\n//#region src/orm/init-diagnostics.ts\n/** The invocation that finishes what a failed `init` phase started. */\nconst EMIT_COMMAND = \"prisma-cli contract emit\";\n/**\n* The command's own record of a phase that failed after the scaffold was\n* written. The scaffold is on disk and the run has a result to report, so each\n* of these rides a completed envelope as a finding rather than replacing it.\n*/\nfunction initFinding(code, summary, parts) {\n\treturn {\n\t\tcode,\n\t\tseverity: \"error\",\n\t\tsummary,\n\t\twhy: parts.why,\n\t\tnextActions: parts.nextActions,\n\t\tmeta: parts.meta,\n\t\tdocsUrl: docsUrlFor(code)\n\t};\n}\n/**\n* The dependency install failed. The engine composed and announced the command\n* line, so its own next action — which carries the redacted spelling — is the\n* one that tells the user what to run; `init` adds the emit that was waiting\n* on it.\n*/\nfunction installFailedFinding(failure, filesWritten) {\n\treturn initFinding(\"CLI.INIT_INSTALL_FAILED\", \"Failed to install dependencies\", {\n\t\twhy: failure.why ?? failure.message,\n\t\tnextActions: [...failure.nextActions, runCommandAction(\"Emit the contract once the dependencies are installed\", EMIT_COMMAND)],\n\t\tmeta: {\n\t\t\tfilesWritten,\n\t\t\tinstall: failure.meta ?? {}\n\t\t}\n\t});\n}\n/** The first emit failed against the freshly written scaffold. */\nfunction emitFailedFinding(cause, filesWritten) {\n\treturn initFinding(\"CLI.INIT_EMIT_FAILED\", \"Failed to emit contract\", {\n\t\twhy: `\\`${EMIT_COMMAND}\\` failed: ${cause}`,\n\t\tnextActions: [chooseAction(\"Fix the problem the contract source reports, then emit again\"), runCommandAction(\"Emit the contract\", EMIT_COMMAND)],\n\t\tmeta: {\n\t\t\tfilesWritten,\n\t\t\tcause\n\t\t}\n\t});\n}\n/**\n* An agent-skill install failed; the project itself is complete without it.\n* The remedy is the skill-install commands themselves, which run against any\n* directory — advising a re-run of `init` would put the user's schema at risk\n* to fix something `init` no longer needs to be involved in.\n*/\nfunction skillInstallFailedFinding(failure, filesWritten, skillCommands) {\n\treturn initFinding(\"CLI.INIT_SKILL_INSTALL_FAILED\", \"Failed to install Prisma Next skills\", {\n\t\twhy: failure.why ?? failure.message,\n\t\tnextActions: [...failure.nextActions, ...skillCommands.map((command) => runCommandAction(\"Install the Prisma Next skills\", command))],\n\t\tmeta: {\n\t\t\tfilesWritten,\n\t\t\tskillInstall: failure.meta ?? {}\n\t\t}\n\t});\n}\n//#endregion\n//#region src/orm/init-blocks.ts\nfunction fileNodes(paths) {\n\treturn paths.map((path) => ({\n\t\tlabel: path,\n\t\ttone: \"identifier\"\n\t}));\n}\nfunction scaffoldTree(document) {\n\tconst roots = [{\n\t\tlabel: \"written\",\n\t\ttone: \"heading\",\n\t\tchildren: fileNodes(document.filesWritten)\n\t}];\n\tif (document.filesDeleted.length > 0) roots.push({\n\t\tlabel: \"removed (stale artifacts and retired skill directories)\",\n\t\ttone: \"heading\",\n\t\tchildren: fileNodes(document.filesDeleted)\n\t});\n\tconst installed = document.packagesInstalled;\n\tif (installed.status === \"installed\") roots.push({\n\t\tlabel: \"installed\",\n\t\ttone: \"heading\",\n\t\tchildren: [...fileNodes(installed.deps), ...installed.devDeps.map((dep) => ({\n\t\t\tlabel: `${dep} (dev)`,\n\t\t\ttone: \"identifier\"\n\t\t}))]\n\t});\n\treturn {\n\t\tkind: \"tree\",\n\t\troots\n\t};\n}\n/**\n* The scaffold's follow-up steps, typed. `nextSteps` in the result document\n* keeps its numbered prose for consumers that already read it; these are the\n* same advice in the shape an agent can act on.\n*/\nfunction buildInitNextActions(inputs) {\n\tconst actions = [chooseAction(\"Set DATABASE_URL in your environment (export it or add it to .env)\")];\n\tif (!inputs.contractEmitted) actions.push(runCommandAction(\"Emit the contract\", EMIT_COMMAND));\n\tactions.push({\n\t\tkind: \"edit-file\",\n\t\tlabel: `Edit your schema at ${inputs.schemaPath}, then emit again`\n\t});\n\tactions.push(chooseAction(\"Open prisma-next.md for a quick reference on writing your first typed query\"));\n\tif (inputs.skillRegistered) actions.push(chooseAction(\"Prisma Next skills are registered with your agent runtime — ask it to add a model, run a query, or plan a migration\"));\n\treturn actions;\n}\nconst DONE_TEXT = \"Done. Open prisma-next.md to get started.\";\nconst INCOMPLETE_TEXT = \"Scaffold written. Finish the steps above to complete setup.\";\n/**\n* `init` writes files rather than data another program reads, so it supplies\n* no `stdout` payload: human mode writes nothing to stdout.\n*/\nfunction initPresentations(inputs) {\n\tconst { document } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"target\",\n\t\t\t\t\t\tvalue: document.target\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"authoring\",\n\t\t\t\t\t\tvalue: document.authoring\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"schema\",\n\t\t\t\t\t\tvalue: document.schemaPath\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\tscaffoldTree(document),\n\t\t\tinputs.complete ? {\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: DONE_TEXT\n\t\t\t} : {\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\ttext: INCOMPLETE_TEXT\n\t\t\t}\n\t\t],\n\t\tjson: () => document,\n\t\tnext: () => inputs.nextActions\n\t};\n}\n//#endregion\n//#region src/commands/init/redact-secrets.ts\n/**\n* Strips credentials out of package-manager stderr before it reaches a warning,\n* an error's meta, or a log. Two shapes carry them: userinfo inside a registry\n* URL (`https://user:token@registry…`), and the npmrc settings npm and pnpm\n* echo back when authentication fails (`//registry.npmjs.org/:_authToken=…`,\n* or the top-level `_authToken=…` with no registry scope), which are not\n* URL-shaped and survive a userinfo-only pass.\n*\n* Both shells' `init` call this, and both call it on stderr they already\n* received from somewhere else: redaction is cheap and doubling it is harmless,\n* while trusting another layer to have done it is not.\n*/\nfunction redactSecrets(stderr) {\n\treturn stderr.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/)([^/@\\s]+)@/g, \"$1***@\").replace(/(\\b_(?:authToken|auth|password)=)\\S+/gi, \"$1***\");\n}\n//#endregion\n//#region src/orm/init-emit.ts\n/**\n* Emits the contract for the project `init` has just scaffolded, by spawning\n* the project-local `prisma-cli` binary the install step put into\n* `node_modules`. That binary and the installed `defineConfig` come from the\n* same registry release, so the config loader that evaluates\n* `prisma.config.ts` always matches the config format it was written\n* with — running the emit in-process would evaluate the project's config with\n* this (possibly newer) CLI's loader instead. Child output is captured, never\n* inherited, so `--json` envelopes on stdout stay parseable.\n*/\nasync function emitScaffoldedContract(ctx, overrides = {}) {\n\tconst binPath = resolveProjectBin(ctx.cwd, overrides);\n\tconst result = await runCaptured(process.execPath, [\n\t\tbinPath,\n\t\t\"contract\",\n\t\t\"emit\"\n\t], ctx.cwd);\n\tif (result.exitCode !== 0) {\n\t\tconst output = result.stderr.trim().length > 0 ? result.stderr : result.stdout;\n\t\tconst cause = result.exitCode === null ? `was killed by signal ${result.signal ?? \"unknown\"}` : `exited with code ${result.exitCode}`;\n\t\tthrow new Error(`\\`prisma-cli contract emit\\` ${cause}: ${redactSecrets(tail(output))}`);\n\t}\n}\nfunction resolveProjectBin(cwd, overrides) {\n\tconst resolveFromBaseDir = overrides.resolveFromBaseDir ?? ((baseDir, specifier) => createRequire(join(baseDir, \"package.json\")).resolve(specifier));\n\tlet manifestPath;\n\ttry {\n\t\tmanifestPath = resolveFromBaseDir(cwd, \"@prisma/cli/package.json\");\n\t} catch (error) {\n\t\tthrow new Error(`\\`@prisma/cli\\` is not installed in this project (resolved from ${cwd}; cause: ${causeMessage$1(error)})`);\n\t}\n\tlet manifest;\n\ttry {\n\t\tmanifest = JSON.parse(readFileSync(manifestPath, \"utf-8\"));\n\t} catch (error) {\n\t\tthrow new Error(`the installed @prisma/cli manifest at ${manifestPath} is not valid JSON: ${causeMessage$1(error)}`);\n\t}\n\tconst bin = manifest !== null && typeof manifest === \"object\" ? Reflect.get(manifest, \"bin\") : void 0;\n\tconst binEntry = typeof bin === \"string\" ? bin : bin !== null && typeof bin === \"object\" ? Reflect.get(bin, \"prisma-cli\") : void 0;\n\tif (typeof binEntry !== \"string\") throw new Error(`the installed @prisma/cli package at ${dirname(manifestPath)} declares no \\`prisma-cli\\` bin`);\n\treturn join(dirname(manifestPath), binEntry);\n}\nfunction runCaptured(file, args, cwd) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst child = spawn(file, args, {\n\t\t\tcwd,\n\t\t\tstdio: [\n\t\t\t\t\"ignore\",\n\t\t\t\t\"pipe\",\n\t\t\t\t\"pipe\"\n\t\t\t]\n\t\t});\n\t\tlet stdout = \"\";\n\t\tlet stderr = \"\";\n\t\tchild.stdout.on(\"data\", (chunk) => {\n\t\t\tstdout += chunk.toString(\"utf-8\");\n\t\t});\n\t\tchild.stderr.on(\"data\", (chunk) => {\n\t\t\tstderr += chunk.toString(\"utf-8\");\n\t\t});\n\t\tchild.on(\"error\", (error) => {\n\t\t\treject(/* @__PURE__ */ new Error(`could not run the project-local prisma-cli binary: ${error.message}`));\n\t\t});\n\t\tchild.on(\"close\", (code, signal) => {\n\t\t\tresolve({\n\t\t\t\texitCode: code,\n\t\t\t\tsignal,\n\t\t\t\tstdout,\n\t\t\t\tstderr\n\t\t\t});\n\t\t});\n\t});\n}\nfunction tail(text) {\n\treturn text.trim().split(\"\\n\").slice(-20).join(\"\\n\");\n}\nfunction causeMessage$1(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n//#endregion\n//#region src/commands/init/input-values.ts\nconst TARGET_ALIASES = /* @__PURE__ */ new Map([\n\t[\"postgres\", \"postgres\"],\n\t[\"postgresql\", \"postgres\"],\n\t[\"mongo\", \"mongo\"],\n\t[\"mongodb\", \"mongo\"]\n]);\nconst AUTHORING_VALUES = /* @__PURE__ */ new Map([\n\t[\"psl\", \"psl\"],\n\t[\"typescript\", \"typescript\"],\n\t[\"ts\", \"typescript\"]\n]);\nfunction resolveTarget(value) {\n\tif (value === void 0) return void 0;\n\tconst mapped = TARGET_ALIASES.get(value.toLowerCase());\n\tif (mapped === void 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"target\",\n\t\tvalue,\n\t\tallowed: [\"postgres\", \"mongodb\"]\n\t});\n\treturn mapped;\n}\nfunction resolveAuthoring(value) {\n\tif (value === void 0) return void 0;\n\tconst mapped = AUTHORING_VALUES.get(value.toLowerCase());\n\tif (mapped === void 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"authoring\",\n\t\tvalue,\n\t\tallowed: [\"psl\", \"typescript\"]\n\t});\n\treturn mapped;\n}\n/**\n* Validates `--schema-path` against the chosen `--authoring` style: PSL\n* authoring requires a `.prisma` file and TypeScript authoring requires a\n* `.ts` file. Mismatched combinations would silently scaffold PSL content\n* into a `.ts` file (or vice versa); this validator surfaces the mistake\n* as a precondition error naming both flags.\n*/\nfunction validateSchemaPath(value, authoring) {\n\tconst trimmed = value.trim();\n\tif (trimmed.length === 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"schema-path\",\n\t\tvalue,\n\t\tallowed: [\"<non-empty file path with .prisma or .ts extension>\"]\n\t});\n\tif (trimmed.endsWith(\"/\") || trimmed.endsWith(\"\\\\\")) throw errorInitInvalidFlagValue({\n\t\tflag: \"schema-path\",\n\t\tvalue,\n\t\tallowed: [\"<file path, not a directory>\"]\n\t});\n\tconst ext = extname(trimmed).toLowerCase();\n\tconst expected = authoring === \"typescript\" ? \".ts\" : \".prisma\";\n\tif (ext !== expected) throw errorInitAuthoringSchemaPathMismatch({\n\t\tauthoring,\n\t\tschemaPath: trimmed,\n\t\tactualExtension: ext.length > 0 ? ext : \"(none)\",\n\t\texpectedExtension: expected\n\t});\n\treturn normalize(trimmed);\n}\n//#endregion\n//#region src/commands/init/detect-package-manager.ts\nfunction formatRunCommand(pm, bin, args) {\n\tif (pm === \"npm\") return `npx ${bin} ${args}`;\n\tif (pm === \"deno\") return `deno run npm:${bin} ${args}`;\n\treturn `${pm} ${bin} ${args}`;\n}\nfunction formatRunScriptCommand(pm, scriptName) {\n\tswitch (pm) {\n\t\tcase \"deno\": return `deno task ${scriptName}`;\n\t\tcase \"bun\": return `bun run ${scriptName}`;\n\t\tcase \"pnpm\": return `pnpm run ${scriptName}`;\n\t\tcase \"yarn\": return `yarn run ${scriptName}`;\n\t\tdefault: return `npm run ${scriptName}`;\n\t}\n}\n//#endregion\n//#region src/commands/init/hygiene-gitattributes.ts\n/**\n* The `.gitattributes` entries written for a freshly initialised project\n* (FR3.4). Mirrors the relevant subset of the repo-root\n* [`.gitattributes`](../../../../../../../../.gitattributes):\n*\n* - **Today**: `contract.json`, `contract.d.ts` are emitted on every\n* `prisma-cli contract emit`. Marking them `linguist-generated`\n* keeps GitHub's diff stats honest and collapses the file in code\n* review by default.\n* - **Forward-looking**: `ops.json`, `migration.json` are not yet emitted\n* by `init` flows but will be produced by adjacent commands (lower /\n* migration tooling). Adding them now matches Decision 5\n* (forward-looking subset) so the file does not need to be amended\n* every time a new artifact lands.\n*\n* `ARTIFACT_FILENAMES` entries are written relative to the schema\n* directory so a user who runs `init --schema-path db/contract.prisma`\n* gets `db/contract.json linguist-generated` — not the workspace-glob\n* form `<glob>/contract.json` (which would over-match any unrelated\n* `contract.json` the user has elsewhere) and not the absolute\n* `DEFAULT_CONTRACT_SOURCE_DIR/contract.json` (which would silently\n* break for a non-default schema path).\n*\n* The migration contract snapshot store (`migrations/snapshots/<hex>/`)\n* is anchored to the migrations root instead, not the schema directory:\n* migration package depth under `migrations/` varies (`app/<pkg>`,\n* `<space>/<pkg>`, or a bare `<pkg>` in extension source repos), so no\n* single schema-dir-relative pattern can reach every snapshot. See\n* `STORE_GITATTRIBUTES_LINES` below.\n*/\nconst ARTIFACT_FILENAMES$1 = [\n\t\"contract.json\",\n\t\"contract.d.ts\",\n\t\"ops.json\",\n\t\"migration.json\"\n];\nconst ATTRIBUTE = \"linguist-generated\";\n/**\n* Full `.gitattributes` lines for the migration contract snapshot store,\n* already anchored to the migrations root — unlike `ARTIFACT_FILENAMES`,\n* these are not combined with the schema-relative prefix.\n*/\nconst STORE_GITATTRIBUTES_LINES = [`migrations/snapshots/**/contract.json ${ATTRIBUTE}`, `migrations/snapshots/**/contract.d.ts ${ATTRIBUTE}`];\n/**\n* Computes the `.gitattributes` lines this scaffold expects to own. Each\n* line has the shape `<path> linguist-generated`. The `target` parameter\n* is currently unused but accepted for symmetry with the other hygiene\n* helpers and to leave room for target-specific entries (e.g. a future\n* family-specific artifact) without a signature break.\n*/\nfunction requiredGitattributesLines(schemaDir, _target) {\n\tconst dir = schemaDir === \".\" ? \"\" : schemaDir.replace(/\\/+$/, \"\");\n\tconst prefix = dir === \"\" ? \"\" : `${dir}/`;\n\treturn [...ARTIFACT_FILENAMES$1.map((file) => `${prefix}${file} ${ATTRIBUTE}`), ...STORE_GITATTRIBUTES_LINES];\n}\n/**\n* Idempotent `.gitattributes` merge (FR3.4 / FR9.3). Returns the new file\n* content given the existing content (or `undefined` if the file does\n* not yet exist).\n*\n* Equivalence is exact-line: a user-customised line like\n* `prisma/*.json linguist-generated` is *not* recognised as covering\n* `DEFAULT_CONTRACT_SOURCE_DIR/contract.json linguist-generated`. We accept that\n* over-specification — preserving the user's broad pattern *and*\n* appending the narrow one — because the narrow lines are what the\n* acceptance criteria pin (FR3.4 AC).\n*\n* Returns `null` when no changes are required (file already contains\n* every required entry).\n*/\nfunction mergeGitattributes(existing, required) {\n\tif (existing === void 0) return `${required.join(\"\\n\")}\\n`;\n\tconst presentLines = new Set(existing.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith(\"#\")));\n\tconst missing = required.filter((line) => !presentLines.has(line));\n\tif (missing.length === 0) return null;\n\treturn `${existing}${existing.length === 0 || existing.endsWith(\"\\n\") ? \"\" : \"\\n\"}${missing.join(\"\\n\")}\\n`;\n}\n//#endregion\n//#region src/commands/init/hygiene-gitignore.ts\n/**\n* The minimal `.gitignore` lines a Prisma Next scaffold needs (FR3.3).\n* Order matches what Node tooling typically writes today.\n*\n* `node_modules/` first because it's the byte-largest miss; `dist/`\n* because the scaffolded `tsconfig.json` writes there; `.env` last so\n* the secret-bearing file is the one most-recently visible in any diff\n* (a paranoid-correct ordering — humans skim from the top).\n*/\nconst REQUIRED_GITIGNORE_ENTRIES = [\n\t\"node_modules/\",\n\t\"dist/\",\n\t\".env\"\n];\n/**\n* Idempotent `.gitignore` merge (FR3.3 / FR9.3). Returns the new file\n* content given the existing content (or `undefined` if the file does\n* not yet exist). Adds only entries that are not already present and\n* never duplicates a line. Existing comments and blank lines are\n* preserved verbatim — `.gitignore` is parsed by `git` without a tree,\n* so any line modification risks changing semantics.\n*\n* Pattern equivalence is line-literal: `node_modules/` and `node_modules`\n* are treated as different entries. This is intentional — `git` treats\n* them differently (the trailing slash restricts the match to\n* directories), and the AC pins the trailing-slash form.\n*\n* Returns `null` when no changes are required (file already contains\n* every required entry). The caller can use this to decide whether to\n* include `.gitignore` in `filesWritten`.\n*/\nfunction mergeGitignore(existing) {\n\tif (existing === void 0) return `${REQUIRED_GITIGNORE_ENTRIES.join(\"\\n\")}\\n`;\n\tconst present = new Set(existing.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith(\"#\")));\n\tconst missing = REQUIRED_GITIGNORE_ENTRIES.filter((entry) => !present.has(entry));\n\tif (missing.length === 0) return null;\n\treturn `${existing}${existing.length === 0 || existing.endsWith(\"\\n\") ? \"\" : \"\\n\"}${missing.join(\"\\n\")}\\n`;\n}\n//#endregion\n//#region src/commands/init/hygiene-package-scripts.ts\nconst REQUIRED_SCRIPTS = [{\n\tname: \"contract:emit\",\n\tcommand: \"prisma-cli contract emit\"\n}];\n/**\n* Idempotent `package.json#scripts` merge with collision detection\n* (FR3.5 / FR9.3):\n*\n* - If a required script is **missing**, append it.\n* - If a required script is **already present and identical**, leave\n* the file alone (idempotency).\n* - If a required script is **present but maps to a different command**,\n* skip the write for that script and surface a structured warning.\n* The user's override is sacred — `init` should never silently\n* overwrite a custom build pipeline.\n*\n* Preserves the existing key order (so a user who has alphabetised\n* their scripts does not see them reshuffled) and appends new entries\n* at the end.\n*\n* The `package.json` is parsed and re-stringified through `JSON` —\n* comments are not preserved (package.json does not support them per\n* spec). Trailing newline matches the original input's trailing\n* newline behaviour.\n*/\nfunction mergePackageScripts(existing, required = REQUIRED_SCRIPTS) {\n\tconst parsed = blindCast(JSON.parse(existing));\n\tconst scripts = typeof parsed[\"scripts\"] === \"object\" && parsed[\"scripts\"] !== null ? { ...blindCast(parsed[\"scripts\"]) } : {};\n\tconst warnings = [];\n\tlet mutated = false;\n\tfor (const { name, command } of required) {\n\t\tconst existingValue = scripts[name];\n\t\tif (existingValue === void 0) {\n\t\t\tscripts[name] = command;\n\t\t\tmutated = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (existingValue !== command) warnings.push(`package.json already has a \"${name}\" script with a different command — keeping yours.\\n existing: ${existingValue}\\n expected: ${command}\\nIf you want the default, remove your \"${name}\" script and re-run \\`init\\`.`);\n\t}\n\tif (!mutated) return {\n\t\tcontent: null,\n\t\twarnings\n\t};\n\tparsed[\"scripts\"] = scripts;\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn {\n\t\tcontent: `${JSON.stringify(parsed, null, 2)}${trailingNewline}`,\n\t\twarnings\n\t};\n}\n/**\n* Idempotently sets `\"type\": \"module\"` on a `package.json` so the\n* scaffolded `prisma/db.ts` — which uses the ESM-only `with { type: 'json' }`\n* import attribute — loads as ES module under Node's loader (TML-2494).\n*\n* Without this field Node either:\n*\n* - emits `MODULE_TYPELESS_PACKAGE_JSON` and reparses the file as ESM\n* with a perf penalty (Node 22+ with `--experimental-strip-types`), or\n* - hard-fails with `ERR_*` because the CJS loader cannot parse the\n* import-attribute syntax (older Node, or any tool that doesn't\n* reparse).\n*\n* Behaviour:\n*\n* - **Field missing** → set to `\"module\"`. New entry is inserted right\n* after `\"name\"` (when present) so the diff lands in a conventional\n* spot for human review; falls through to the natural append position\n* otherwise.\n* - **Field already `\"module\"`** → no-op (idempotent).\n* - **Field set to anything else** (e.g. `\"commonjs\"`) → leave it alone\n* and surface a structured warning. The user explicitly opted out of\n* ESM and we don't silently overwrite that.\n*/\nfunction ensureEsmModuleType(existing) {\n\tconst parsed = blindCast(JSON.parse(existing));\n\tconst currentType = parsed[\"type\"];\n\tif (currentType === \"module\") return {\n\t\tcontent: null,\n\t\twarning: null\n\t};\n\tif (typeof currentType === \"string\" && currentType !== \"module\") return {\n\t\tcontent: null,\n\t\twarning: `package.json declares \"type\": \"${currentType}\" — keeping yours, but the scaffolded prisma/db.ts uses an ESM-only import attribute (\\`with { type: 'json' }\\`) and will not load under that module type.\\nIf you want the default, set \"type\": \"module\" in package.json.`\n\t};\n\tconst next = {};\n\tlet inserted = false;\n\tfor (const [key, value] of Object.entries(parsed)) {\n\t\tif (key === \"type\") continue;\n\t\tnext[key] = value;\n\t\tif (!inserted && key === \"name\") {\n\t\t\tnext[\"type\"] = \"module\";\n\t\t\tinserted = true;\n\t\t}\n\t}\n\tif (!inserted) next[\"type\"] = \"module\";\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn {\n\t\tcontent: `${JSON.stringify(next, null, 2)}${trailingNewline}`,\n\t\twarning: null\n\t};\n}\n//#endregion\n//#region src/commands/init/reinit-cleanup.ts\n/**\n* Filenames the contract pipeline emits next to the user's schema source\n* (`<schemaDir>/contract.json`, `<schemaDir>/contract.d.ts`, …). Mirrors\n* the schema-dir-relative `ARTIFACT_FILENAMES` in `hygiene-gitattributes.ts`\n* (not that file's migrations-root-anchored store lines, which are outside\n* this command's scope — reinit only ever touches `schemaDir`); kept as a\n* separate constant here because the cleanup contract is target-agnostic\n* and we deliberately do not want a stale artifact from a previous target\n* lingering after a re-init.\n*\n* If a future emit pipeline produces an additional schema-dir artifact,\n* add it here **and** to `ARTIFACT_FILENAMES` in `hygiene-gitattributes.ts`\n* — the two stay in lockstep so the file `init` advertises as\n* `linguist-generated` is exactly the file `init` is willing to delete on\n* re-init.\n*/\nconst ARTIFACT_FILENAMES = [\n\t\"contract.json\",\n\t\"contract.d.ts\",\n\t\"ops.json\",\n\t\"migration.json\"\n];\n/**\n* Returns the schema-relative paths of stale contract artifacts the\n* previous `init` run (or a `contract emit`) left behind in `schemaDir`.\n* Paths are returned relative to `baseDir` so the caller can plumb them\n* into `filesWritten`-style logging without re-deriving the path.\n*\n* Pure function: no filesystem mutation. Used by `runInit`'s precondition\n* phase (FR6.2 / NFR3 atomicity) so a downstream parse failure leaves\n* the artifacts on disk and the project byte-identical to its pre-init\n* state.\n*/\nfunction findStaleArtifacts(baseDir, schemaDir) {\n\tconst result = [];\n\tfor (const filename of ARTIFACT_FILENAMES) {\n\t\tconst rel = join(schemaDir, filename);\n\t\tif (existsSync(join(baseDir, rel))) result.push(rel);\n\t}\n\treturn result;\n}\n/**\n* Drops a single key from `package.json#dependencies`, returning the new\n* file content. Returns `null` when the dependency was already absent —\n* the caller can skip the write to keep re-init idempotent (FR9.3).\n*\n* Used by `runInit` for the FR9.2 target-switch path: when the user\n* re-inits a project from `--target postgres` to `--target mongodb` (or\n* vice versa), the previous facade is removed from `dependencies` so the\n* resulting project depends only on the chosen target's facade.\n*\n* Devs/peers/optional dep groups are intentionally *not* touched — the\n* facades are only ever in `dependencies` (FR4 / FR7), and broadening\n* the search would risk clobbering an unrelated dep with the same name\n* in `peerDependencies`.\n*\n* Throws `SyntaxError` if `existing` is not parseable as JSON; the\n* caller (`runInit`) already guards on that with a structured 5010\n* error before this helper is reached.\n*/\nfunction removeDependency(existing, depName) {\n\tconst parsed = JSON.parse(existing);\n\tconst deps = parsed[\"dependencies\"];\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return null;\n\tif (!Object.hasOwn(deps, depName)) return null;\n\tconst next = { ...deps };\n\tdelete next[depName];\n\tparsed[\"dependencies\"] = next;\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn `${JSON.stringify(parsed, null, 2)}${trailingNewline}`;\n}\n//#endregion\n//#region src/commands/init/templates/render.ts\nfunction renderTemplate(templateFile, variableNames, vars) {\n\tlet result = readFileSync(join(import.meta.dirname, templateFile), \"utf-8\");\n\tfor (const key of variableNames) {\n\t\tconst value = vars[key];\n\t\tif (value === void 0) throw new InternalError(`Template variable '${key}' is not defined`);\n\t\tresult = result.replaceAll(`{{${key}}}`, value);\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/commands/init/templates/quick-reference.ts\nconst variables = [\n\t\"schemaPath\",\n\t\"schemaDir\",\n\t\"dbImportPath\",\n\t\"pkgRun\",\n\t\"pkg\",\n\t\"configEntrypoint\",\n\t\"schemaSample\",\n\t\"requirements\"\n];\nfunction quickReferenceMd(target, authoring, schemaPath, pkgRun, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst schemaDir = dirname(schemaPath);\n\tconst pkg = targetPackageName(target, resolveImportSpecifier);\n\tconst vars = {\n\t\tschemaPath,\n\t\tschemaDir,\n\t\tdbImportPath: `./${schemaDir}/db`,\n\t\tpkgRun,\n\t\tpkg,\n\t\tconfigEntrypoint: targetEntrypoint(target, \"config\", resolveImportSpecifier),\n\t\tschemaSample: schemaSample(target, authoring, resolveImportSpecifier),\n\t\trequirements: requirementsBlock(target)\n\t};\n\treturn renderTemplate(`quick-reference-${target}.md`, variables, vars);\n}\n/**\n* Renders the FR8.2 \"Requirements\" block injected into `prisma-next.md`\n* (the user-facing quick reference). Sources the minimum server\n* version from `MIN_SERVER_VERSION` — itself mirrored from each\n* target package's `package.json#prismaNext.minServerVersion`\n* (FR8.1).\n*\n* The verification command is target-specific — Postgres scaffolds\n* shouldn't ship Mongo's `db.runCommand` (and vice versa) just because\n* we couldn't be bothered to branch.\n*/\nfunction requirementsBlock(target) {\n\treturn [\n\t\t\"## Requirements\",\n\t\t\"\",\n\t\t`- **${TARGET_LABEL[target]} ${MIN_SERVER_VERSION[target]} or newer.** Older servers are not supported. Run ${target === \"postgres\" ? \"`SELECT version()`\" : \"`db.runCommand({ buildInfo: 1 })`\"} against your server to verify.`,\n\t\t\"- The CLI never connects to your database without explicit consent. Pass `--probe-db` to `prisma orm init` if you want `init` to verify the server version itself.\"\n\t].join(\"\\n\");\n}\n//#endregion\n//#region src/commands/init/templates/readme.ts\nconst sharedVariables = [\n\t\"projectName\",\n\t\"contractPath\",\n\t\"runDev\",\n\t\"runContractEmit\"\n];\nconst postgresVariables = [\n\t...sharedVariables,\n\t\"runDbInit\",\n\t\"runDbUpdate\",\n\t\"runMigrationPlan\",\n\t\"runMigrate\",\n\t\"runDbSeed\"\n];\nconst mongoVariables = [\n\t...sharedVariables,\n\t\"runDbUp\",\n\t\"runDbDown\",\n\t\"runDbReset\",\n\t\"runMigrationPlan\",\n\t\"runMigrate\",\n\t\"runDbSeed\"\n];\nfunction minimalProjectReadmeMd(target, schemaPath, projectName, pm) {\n\tconst run = (script) => formatRunScriptCommand(pm, script);\n\tconst shared = {\n\t\tprojectName,\n\t\tcontractPath: schemaPath,\n\t\trunDev: run(\"dev\"),\n\t\trunContractEmit: run(\"contract:emit\"),\n\t\trunMigrationPlan: run(\"migration:plan\"),\n\t\trunMigrate: run(\"migrate\"),\n\t\trunDbSeed: run(\"db:seed\")\n\t};\n\tif (target === \"mongo\") {\n\t\tconst vars = {\n\t\t\t...shared,\n\t\t\trunDbUp: run(\"db:up\"),\n\t\t\trunDbDown: run(\"db:down\"),\n\t\t\trunDbReset: run(\"db:reset\")\n\t\t};\n\t\treturn renderTemplate(\"readme-mongo.md\", mongoVariables, vars);\n\t}\n\tconst vars = {\n\t\t...shared,\n\t\trunDbInit: run(\"db:init\"),\n\t\trunDbUpdate: run(\"db:update\")\n\t};\n\treturn renderTemplate(\"readme-postgres.md\", postgresVariables, vars);\n}\n//#endregion\n//#region src/commands/init/templates/tsconfig.ts\n/**\n* Compiler options the scaffolded `prisma.config.ts` and `db.ts` need\n* to typecheck:\n*\n* - `module: 'preserve'` + `moduleResolution: 'bundler'` align with how\n* modern bundlers (and `tsdown`) consume our facade packages.\n* - `resolveJsonModule` lets `db.ts` import `contract.json with { type:\n* 'json' }` — the runtime path the facades document (FR4).\n*\n* `types: ['node']` is FR2.2 territory and lives in\n* `REQUIRED_COMPILER_OPTIONS_TYPES` because TS only honours an _array_\n* here, and a string-keyed merge would clobber any user-specified entries.\n* Merge handling preserves any extra `types` the user added.\n*/\nconst REQUIRED_COMPILER_OPTIONS = {\n\tmodule: \"preserve\",\n\tmoduleResolution: \"bundler\",\n\tresolveJsonModule: true\n};\n/**\n* Types that must be present in `compilerOptions.types` for the scaffold\n* to typecheck. With `moduleResolution: 'bundler'`, TypeScript does not\n* implicitly include all `@types/*` packages — `process.env` only resolves\n* when `node` is in this array (or `types` is omitted, but then any other\n* type listed here would force the same behaviour). Listing `node`\n* explicitly is the documented escape hatch (FR2.2).\n*/\nconst REQUIRED_COMPILER_OPTIONS_TYPES = [\"node\"];\nfunction defaultTsConfig() {\n\treturn JSON.stringify({\n\t\tcompilerOptions: {\n\t\t\ttarget: \"ES2022\",\n\t\t\t...REQUIRED_COMPILER_OPTIONS,\n\t\t\ttypes: [...REQUIRED_COMPILER_OPTIONS_TYPES],\n\t\t\tstrict: true,\n\t\t\tskipLibCheck: true,\n\t\t\tesModuleInterop: true,\n\t\t\toutDir: \"dist\"\n\t\t},\n\t\tinclude: [\"**/*.ts\"]\n\t}, null, 2);\n}\n/**\n* Thrown by `mergeTsConfig` when the user's existing `tsconfig.json` is\n* not parseable as JSONC (TypeScript's actual configured dialect — see\n* FR6.1). Carries the raw parse errors so the caller can render an\n* actionable, location-aware message.\n*\n* `runInit` catches this exception during the precondition phase and\n* maps it to a `CliStructuredError(5011)` so the user's working tree\n* stays byte-identical when init bails (FR6.2 / NFR3).\n*/\nvar TsConfigParseError = class extends Error {\n\terrors;\n\tconstructor(errors) {\n\t\tsuper(formatTsConfigParseErrors(errors));\n\t\tthis.errors = errors;\n\t\tthis.name = \"TsConfigParseError\";\n\t}\n};\nfunction formatTsConfigParseErrors(errors) {\n\tif (errors.length === 0) return \"tsconfig.json is empty or not an object\";\n\treturn errors.map((e) => `${printParseErrorCode(e.error)} at offset ${e.offset}`).join(\"; \");\n}\n/**\n* Merges the required compiler options into an existing `tsconfig.json`.\n*\n* Parsing is delegated to `jsonc-parser` so JSONC inputs (comments,\n* trailing commas) — TypeScript's real configuration dialect — survive\n* unchanged: edits are applied as text patches via `modify` /\n* `applyEdits`, preserving the user's formatting, key ordering, and\n* comments wherever the touched paths permit (FR6.1, AC \"Hostile\n* inputs\").\n*\n* Throws `TsConfigParseError` when the input is not parseable as JSONC.\n* The caller must catch this and surface a structured error before\n* writing any scaffold files (FR6.2 atomicity).\n*/\nfunction mergeTsConfig(existing) {\n\tconst { config } = parseTsConfigText(existing);\n\tconst formattingOptions = {\n\t\ttabSize: detectIndent(existing),\n\t\tinsertSpaces: true,\n\t\teol: existing.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\"\n\t};\n\tlet result = existing;\n\tfor (const [key, value] of Object.entries(REQUIRED_COMPILER_OPTIONS)) {\n\t\tconst edits = modify(result, [\"compilerOptions\", key], value, { formattingOptions });\n\t\tresult = applyEdits(result, edits);\n\t}\n\tconst existingTypes = config[\"compilerOptions\"]?.[\"types\"];\n\tconst mergedTypes = mergeTypesArray(existingTypes);\n\tconst typesEdits = modify(result, [\"compilerOptions\", \"types\"], mergedTypes, { formattingOptions });\n\tresult = applyEdits(result, typesEdits);\n\treturn result;\n}\n/**\n* Parses an existing `tsconfig.json` (JSONC) and returns the structured\n* config alongside any non-fatal parse warnings. Throws\n* `TsConfigParseError` if the input cannot be parsed at all or does\n* not resolve to a JSON object — both cases mean we cannot safely\n* apply edits.\n*\n* Exposed independently so callers (notably `runInit`'s precondition\n* gate) can validate the file *before* any scaffold file is written.\n*/\nfunction parseTsConfigText(text) {\n\tconst errors = [];\n\tconst value = parse(text, errors, {\n\t\tallowTrailingComma: true,\n\t\tdisallowComments: false,\n\t\tallowEmptyContent: false\n\t});\n\tif (value === void 0 || value === null || typeof value !== \"object\" || Array.isArray(value)) throw new TsConfigParseError(errors);\n\tif (errors.length > 0) throw new TsConfigParseError(errors);\n\treturn { config: value };\n}\nfunction detectIndent(text) {\n\tconst match = text.match(/^([ \\t]+)\\S/m);\n\tif (match === null) return 2;\n\tconst indent = match[1] ?? \"\";\n\tif (indent.startsWith(\"\t\")) return 1;\n\treturn indent.length || 2;\n}\n/**\n* Merges `REQUIRED_COMPILER_OPTIONS_TYPES` into the user's existing\n* `compilerOptions.types` array. Preserves order and dedupes. If the\n* user has no `types` array (or has set it to a non-array), we replace\n* with the required minimum — overwriting a non-array `types` is the\n* correct fix because anything other than a string array is invalid TS\n* config.\n*/\nfunction mergeTypesArray(existing) {\n\tconst result = [];\n\tif (Array.isArray(existing)) {\n\t\tfor (const item of existing) if (typeof item === \"string\" && !result.includes(item)) result.push(item);\n\t}\n\tfor (const required of REQUIRED_COMPILER_OPTIONS_TYPES) if (!result.includes(required)) result.push(required);\n\treturn result;\n}\n//#endregion\n//#region src/orm/init-scaffold.ts\nconst CONFIG_FILE = \"prisma.config.ts\";\nconst QUICK_REFERENCE_FILE = \"prisma-next.md\";\nconst ENV_EXAMPLE_FILE = \".env.example\";\n/**\n* The generated files a run replaces outright, in the order it writes them.\n* Everything else the scaffold touches it merges (`tsconfig.json`,\n* `package.json`, the git files) or keeps (`.env`, `README.md`), so replacing\n* one of these is the destructive act consent is asked for.\n*\n* `.env.example` is written the same way but deliberately left out: it is a\n* conventional filename in projects that have never seen Prisma Next, and a\n* consent token demanded for it would fire on first runs. The scaffold warns\n* when it replaces one instead.\n*/\nfunction generatedFilesInitReplaces(schemaPath) {\n\treturn [\n\t\tschemaPath,\n\t\tCONFIG_FILE,\n\t\tjoin(dirname(schemaPath), \"db.ts\"),\n\t\tQUICK_REFERENCE_FILE\n\t];\n}\nconst MANAGERS = /* @__PURE__ */ new Set([\n\t\"pnpm\",\n\t\"npm\",\n\t\"yarn\",\n\t\"bun\",\n\t\"deno\"\n]);\nfunction isPackageManager(name) {\n\treturn MANAGERS.has(name);\n}\n/**\n* The manager the scaffolded quick reference and README name in their example\n* commands. It resolves the way the engine's package operations resolve theirs\n* — the project at `cwd` first, then the manager that invoked this process —\n* so the documentation `init` writes names the manager `init` drove. The\n* capability itself reports no manager back on success, which is why this is\n* worked out a second time here.\n*/\nasync function resolveScaffoldPackageManager(ctx) {\n\tconst detected = await detect({ cwd: ctx.cwd });\n\tif (detected !== null && isPackageManager(detected.name)) return detected.name;\n\tconst invoking = ctx.env[\"npm_config_user_agent\"]?.split(\"/\")[0];\n\treturn invoking !== void 0 && isPackageManager(invoking) ? invoking : \"npm\";\n}\n/**\n* True when the parsed manifest declares `name` directly in `dependencies` or\n* `devDependencies`. Transitive presence is deliberately ignored: detecting it\n* needs the lockfile, and the realistic risk is a direct pin being clobbered.\n*/\nfunction hasDirectDep(parsed, name) {\n\tfor (const field of [\"dependencies\", \"devDependencies\"]) {\n\t\tconst value = parsed[field];\n\t\tif (value !== null && typeof value === \"object\" && name in value) return true;\n\t}\n\treturn false;\n}\n/**\n* npm package names are lowercase and URL-safe; `basename(cwd)` happily\n* returns \"My Project\" or \".hidden\", both of which npm refuses to read.\n*/\nfunction sanitisePackageName(raw) {\n\tconst trimmed = raw.toLowerCase().replace(/[^a-z0-9._~-]/g, \"-\").replace(/^[._-]+/, \"\").replace(/-+/g, \"-\");\n\treturn trimmed.length > 0 ? trimmed : \"my-app\";\n}\n/**\n* The manifest `init` writes for a directory that has none. Private, so a\n* stray publish cannot leak the placeholder, and ESM so the scaffolded import\n* attributes load under Node's loader.\n*/\nfunction defaultPackageJsonContent(rawName) {\n\treturn `${JSON.stringify({\n\t\tname: sanitisePackageName(rawName),\n\t\tversion: \"0.0.0\",\n\t\tprivate: true,\n\t\ttype: \"module\"\n\t}, null, 2)}\\n`;\n}\nfunction hasProjectManifest(cwd) {\n\treturn existsSync(join(cwd, \"package.json\")) || existsSync(join(cwd, \"deno.json\")) || existsSync(join(cwd, \"deno.jsonc\"));\n}\n/**\n* Computes every write before touching disk: reads and parses each file the\n* scaffold merges with, so a malformed manifest or tsconfig fails with the\n* user's project byte-identical to how it started.\n*/\nfunction planScaffold(ctx) {\n\tconst { cwd, inputs, packageManager, resolveImportSpecifier } = ctx;\n\tconst warnings = [];\n\tconst schemaDir = dirname(inputs.schemaPath);\n\tconst configContractPath = isAbsolute(inputs.schemaPath) ? inputs.schemaPath : `./${inputs.schemaPath}`;\n\tconst runPrefix = formatRunCommand(packageManager, \"prisma-cli\", \"\").trimEnd();\n\tconst files = [\n\t\t{\n\t\t\tpath: inputs.schemaPath,\n\t\t\tcontent: starterSchema(inputs.target, inputs.authoring, resolveImportSpecifier)\n\t\t},\n\t\t{\n\t\t\tpath: CONFIG_FILE,\n\t\t\tcontent: configFile(inputs.target, configContractPath, resolveImportSpecifier)\n\t\t},\n\t\t{\n\t\t\tpath: join(schemaDir, \"db.ts\"),\n\t\t\tcontent: dbFile(inputs.target, resolveImportSpecifier)\n\t\t},\n\t\t{\n\t\t\tpath: QUICK_REFERENCE_FILE,\n\t\t\tcontent: quickReferenceMd(inputs.target, inputs.authoring, inputs.schemaPath, runPrefix, resolveImportSpecifier)\n\t\t},\n\t\t{\n\t\t\tpath: ENV_EXAMPLE_FILE,\n\t\t\tcontent: envExampleContent(inputs.target)\n\t\t}\n\t];\n\tif (existsSync(join(cwd, ENV_EXAMPLE_FILE))) warnings.push(`${ENV_EXAMPLE_FILE} already existed and was replaced with the Prisma Next template.`);\n\tconst filesToDelete = inputs.reinit ? [...findStaleArtifacts(cwd, schemaDir)] : [];\n\tconst dirsToDelete = legacySkillDirs().filter((rel) => existsSync(join(cwd, rel)));\n\tif (inputs.writeEnv) if (existsSync(join(cwd, \".env\"))) warnings.push(\".env already exists; leaving it untouched. Compare with .env.example for any new keys.\");\n\telse files.push({\n\t\tpath: \".env\",\n\t\tcontent: envFileContent(inputs.target)\n\t});\n\tconst tsconfigPath = join(cwd, \"tsconfig.json\");\n\tif (existsSync(tsconfigPath)) {\n\t\tconst existing = readFileSync(tsconfigPath, \"utf-8\");\n\t\tlet merged;\n\t\ttry {\n\t\t\tmerged = mergeTsConfig(existing);\n\t\t} catch (error) {\n\t\t\tif (error instanceof TsConfigParseError) throw errorInitInvalidTsconfig({\n\t\t\t\tpath: \"tsconfig.json\",\n\t\t\t\tcause: error.message\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\tfiles.push({\n\t\t\tpath: \"tsconfig.json\",\n\t\t\tcontent: merged,\n\t\t\tnote: \"Updated tsconfig.json with required compiler options.\"\n\t\t});\n\t} else files.push({\n\t\tpath: \"tsconfig.json\",\n\t\tcontent: defaultTsConfig()\n\t});\n\tconst gitignorePath = join(cwd, \".gitignore\");\n\tconst nextGitignore = mergeGitignore(existsSync(gitignorePath) ? readFileSync(gitignorePath, \"utf-8\") : void 0);\n\tif (nextGitignore !== null) files.push({\n\t\tpath: \".gitignore\",\n\t\tcontent: nextGitignore\n\t});\n\tconst gitattributesPath = join(cwd, \".gitattributes\");\n\tconst nextGitattributes = mergeGitattributes(existsSync(gitattributesPath) ? readFileSync(gitattributesPath, \"utf-8\") : void 0, requiredGitattributesLines(schemaDir, inputs.target));\n\tif (nextGitattributes !== null) files.push({\n\t\tpath: \".gitattributes\",\n\t\tcontent: nextGitattributes\n\t});\n\tconst manifestPath = join(cwd, \"package.json\");\n\tconst manifestExisted = existsSync(manifestPath);\n\tconst synthesiseManifest = !manifestExisted && !hasProjectManifest(cwd);\n\tlet parsedManifest = null;\n\tif (manifestExisted || synthesiseManifest) {\n\t\tconst raw = manifestExisted ? readFileSync(manifestPath, \"utf-8\") : defaultPackageJsonContent(basename(cwd));\n\t\ttry {\n\t\t\tparsedManifest = JSON.parse(raw);\n\t\t} catch (error) {\n\t\t\tif (error instanceof SyntaxError) throw errorInitInvalidManifest({\n\t\t\t\tpath: \"package.json\",\n\t\t\t\tcause: error.message\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\tlet working = raw;\n\t\tlet changed = synthesiseManifest;\n\t\tif (inputs.removePreviousFacade !== null) {\n\t\t\tconst next = removeDependency(working, inputs.removePreviousFacade);\n\t\t\tif (next !== null) {\n\t\t\t\tworking = next;\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}\n\t\tconst { content: withScripts, warnings: scriptWarnings } = mergePackageScripts(working, REQUIRED_SCRIPTS);\n\t\tif (withScripts !== null) {\n\t\t\tworking = withScripts;\n\t\t\tchanged = true;\n\t\t}\n\t\tconst { content: withType, warning: typeWarning } = ensureEsmModuleType(working);\n\t\tif (withType !== null) {\n\t\t\tworking = withType;\n\t\t\tchanged = true;\n\t\t}\n\t\tif (changed) files.push({\n\t\t\tpath: \"package.json\",\n\t\t\tcontent: working\n\t\t});\n\t\twarnings.push(...scriptWarnings);\n\t\tif (typeWarning !== null) warnings.push(typeWarning);\n\t\tif (synthesiseManifest) warnings.push(\"No package.json found in the target directory; created a minimal one. Edit `name` / `version` to taste.\");\n\t}\n\tif (existsSync(join(cwd, \"src/index.ts\"))) if (existsSync(join(cwd, \"README.md\"))) warnings.push(\"README.md already exists; leaving it untouched.\");\n\telse {\n\t\tconst declaredName = parsedManifest !== null && typeof parsedManifest[\"name\"] === \"string\" ? parsedManifest[\"name\"] : basename(cwd);\n\t\tfiles.push({\n\t\t\tpath: \"README.md\",\n\t\t\tcontent: minimalProjectReadmeMd(inputs.target, inputs.schemaPath, sanitisePackageName(declaredName), packageManager)\n\t\t});\n\t}\n\treturn {\n\t\tfiles,\n\t\tfilesToDelete,\n\t\tdirsToDelete,\n\t\twarnings,\n\t\thasTypesNode: parsedManifest !== null && hasDirectDep(parsedManifest, \"@types/node\")\n\t};\n}\n/**\n* Plans every write, then performs them. Everything that can fail on the\n* user's existing files fails during planning, so a failure leaves the project\n* as it was; after the first write, the scaffold is on disk to keep, and a\n* write that fails partway names the files that already landed.\n*/\nfunction scaffoldProject(ctx) {\n\tconst resolveImportSpecifier = scaffoldSpecifierResolverFor(ctx.inputs.target);\n\tconst plan = planScaffold({\n\t\t...ctx,\n\t\tresolveImportSpecifier\n\t});\n\tconst filesWritten = [];\n\tconst filesDeleted = [];\n\tconst notes = [];\n\tfor (const file of plan.files) {\n\t\tconst target = join(ctx.cwd, file.path);\n\t\ttry {\n\t\t\tmkdirSync(dirname(target), { recursive: true });\n\t\t\twriteFileSync(target, file.content, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tthrow errorInitWriteFailed({\n\t\t\t\tpath: file.path,\n\t\t\t\tcause: error instanceof Error ? error.message : String(error),\n\t\t\t\tfilesWritten\n\t\t\t});\n\t\t}\n\t\tfilesWritten.push(file.path);\n\t\tif (file.note !== void 0) notes.push(file.note);\n\t}\n\tfor (const rel of plan.filesToDelete) {\n\t\tconst target = join(ctx.cwd, rel);\n\t\tif (!existsSync(target)) continue;\n\t\ttry {\n\t\t\tunlinkSync(target);\n\t\t\tfilesDeleted.push(rel);\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof Error && Reflect.get(error, \"code\") === \"ENOENT\")) throw error;\n\t\t}\n\t}\n\tfor (const rel of plan.dirsToDelete) {\n\t\trmSync(join(ctx.cwd, rel), {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t\tfilesDeleted.push(rel);\n\t}\n\treturn {\n\t\tfilesWritten,\n\t\tfilesDeleted,\n\t\twarnings: plan.warnings,\n\t\tnotes,\n\t\thasTypesNode: plan.hasTypesNode,\n\t\tresolveImportSpecifier\n\t};\n}\n//#endregion\n//#region src/orm/init-inputs.ts\nconst REQUIRED_FLAG_PROMPTS = /* @__PURE__ */ new Set([\"target\", \"authoring\"]);\nfunction formatFileList(files) {\n\tconst last = files.at(-1) ?? \"\";\n\treturn files.length <= 1 ? last : `${files.slice(0, -1).join(\", \")} and ${last}`;\n}\n/**\n* Names the files at stake rather than the category they belong to: the user\n* knows `contract.prisma`, not \"every generated file\".\n*/\nfunction consentQuestion(replaced) {\n\tconst written = replaced.length === 1 ? \"it\" : \"them\";\n\treturn `Re-initializing replaces ${formatFileList(replaced)} with a fresh scaffold, losing anything you wrote in ${written}.`;\n}\n/**\n* The engine raises this when a prompt has no default and the session cannot\n* show it. For the two prompts that stand in for a required flag, that is the\n* same condition `init` has always reported as a missing flag.\n*/\nfunction isPromptRequired(error) {\n\treturn error instanceof Error && Reflect.get(error, \"code\") === \"CLI.PROMPT_REQUIRED\";\n}\n/**\n* `--confirm` matches a token, so the token has to be something the user can\n* see and type. The working directory's name is it; a directory with no name\n* of its own (the filesystem root) falls back to its path.\n*\n* Trimmed, because the engine compares the typed answer trimmed: an untrimmed\n* token from a directory named `my app ` is one no keystroke sequence matches.\n*/\nfunction consentToken(cwd) {\n\tconst name = basename(cwd).trim();\n\treturn name.length > 0 ? name : cwd.trim();\n}\nasync function askTarget(prompt) {\n\treturn prompt.select(\"What database are you using?\", [{\n\t\tvalue: \"postgres\",\n\t\tlabel: \"PostgreSQL\"\n\t}, {\n\t\tvalue: \"mongo\",\n\t\tlabel: \"MongoDB\"\n\t}]);\n}\nasync function askAuthoring(prompt) {\n\treturn prompt.select(\"How do you want to write your schema?\", [{\n\t\tvalue: \"psl\",\n\t\tlabel: \"Prisma Schema Language (.prisma)\"\n\t}, {\n\t\tvalue: \"typescript\",\n\t\tlabel: \"TypeScript (.ts)\"\n\t}]);\n}\n/**\n* The schema path the user typed goes through the same validator the flag\n* does, so an answer the engine accepted still has to agree with the authoring\n* style.\n*/\nasync function askSchemaPath(prompt, authoring) {\n\tconst fallback = defaultSchemaPath(authoring);\n\treturn validateSchemaPath(await prompt.text(\"Where should the schema file go?\", {\n\t\tplaceholder: fallback,\n\t\tdefault: fallback\n\t}), authoring);\n}\n/**\n* The facade a previous `init` installed for the other target, when this run\n* switches targets and one is still declared. Reads every name a previous run\n* could have written, because older versions scaffolded the workspace name.\n*/\nfunction previousFacade(cwd, target) {\n\tconst manifestPath = join(cwd, \"package.json\");\n\tif (!existsSync(manifestPath)) return;\n\tconst otherTarget = target === \"postgres\" ? \"mongo\" : \"postgres\";\n\tconst candidates = [targetPackageName(otherTarget, scaffoldSpecifierResolverFor(otherTarget)), targetPackageName(otherTarget)];\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(readFileSync(manifestPath, \"utf-8\"));\n\t} catch {\n\t\treturn;\n\t}\n\tconst deps = parsed[\"dependencies\"];\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return;\n\tconst declared = deps;\n\treturn candidates.find((name) => Object.hasOwn(declared, name));\n}\nasync function resolveRemovePreviousFacade(ctx) {\n\tif (!ctx.reinit || ctx.keepPreviousFacade) return null;\n\tconst facade = previousFacade(ctx.cwd, ctx.target);\n\tif (facade === void 0) return null;\n\tconst otherTarget = ctx.target === \"postgres\" ? \"mongo\" : \"postgres\";\n\treturn await ctx.prompt.confirm(`Switching from ${targetLabel(otherTarget)} to ${targetLabel(ctx.target)} — remove ${facade} from package.json dependencies?`, { default: true }) ? facade : null;\n}\n/**\n* Resolves every input from the flags and, where a flag is absent, from the\n* engine's prompt surface.\n*\n* Order matters twice. Every flag value is validated before anything is asked,\n* so a typo costs a typo rather than a typed consent token. And consent comes\n* as soon as the schema path is known, because that is the point at which the\n* question can name the files it is about — and before any question whose\n* answer only matters if the run proceeds.\n*/\nasync function resolveInitInputs(ctx) {\n\tconst { cwd, flags, prompt } = ctx;\n\tif (flags.strictProbe && !flags.probeDb) throw errorInitStrictProbeWithoutProbe();\n\tconst flagTarget = resolveTarget(flags.target);\n\tconst flagAuthoring = resolveAuthoring(flags.authoring);\n\tlet target;\n\tlet authoring;\n\ttry {\n\t\ttarget = flagTarget ?? await askTarget(prompt);\n\t\tauthoring = flagAuthoring ?? await askAuthoring(prompt);\n\t} catch (error) {\n\t\tif (!isPromptRequired(error)) throw error;\n\t\tthrow errorInitMissingFlags({\n\t\t\tmissing: [...flagTarget === void 0 ? [\"target\"] : [], ...flagAuthoring === void 0 ? [\"authoring\"] : []].filter((flag) => REQUIRED_FLAG_PROMPTS.has(flag)),\n\t\t\twhy: \"This session cannot prompt, so the answers have to arrive as flags.\"\n\t\t});\n\t}\n\tconst schemaPath = flags.schemaPath !== void 0 ? validateSchemaPath(flags.schemaPath, authoring) : await askSchemaPath(prompt, authoring);\n\tconst replaced = generatedFilesInitReplaces(schemaPath).filter((relative) => existsSync(join(cwd, relative)));\n\tconst reinit = replaced.length > 0;\n\tif (reinit) {\n\t\tif (!await prompt.consent(consentQuestion(replaced), { token: consentToken(cwd) })) throw errorInitUserAborted();\n\t}\n\tconst writeEnv = flags.writeEnv || await prompt.confirm(\"Also write a .env file from .env.example? (gitignored)\", { default: false });\n\tconst removePreviousFacade = await resolveRemovePreviousFacade({\n\t\tcwd,\n\t\ttarget,\n\t\treinit,\n\t\tkeepPreviousFacade: flags.keepPreviousFacade,\n\t\tprompt\n\t});\n\treturn {\n\t\ttarget,\n\t\tauthoring,\n\t\tschemaPath,\n\t\tinstall: !flags.skipInstall,\n\t\twriteEnv,\n\t\tprobeDb: flags.probeDb,\n\t\tstrictProbe: flags.strictProbe,\n\t\treinit,\n\t\tremovePreviousFacade,\n\t\tinstallProjectSkill: !flags.skipSkills\n\t};\n}\n//#endregion\n//#region src/commands/init/pnpm-fallback.ts\n/**\n* Recognised pnpm error signatures that justify a fallback to npm.\n*\n* These patterns indicate the published artifact itself is at fault\n* (a leaked `workspace:*` or `catalog:` specifier), not the user's\n* environment — pnpm is faithfully reporting \"I cannot resolve this\n* registry version\", and npm is willing to install it because npm\n* doesn't care about the protocol prefix when there's a fallback range.\n*\n* The predicate lives on its own so both shells' `init` share one list:\n* the commander command matches it against captured child stderr, the\n* engine command against the stderr the package-manager capability\n* returns on a failed install.\n*/\nfunction isRecognisedPnpmResolutionError(stderr) {\n\tif (!stderr) return false;\n\treturn stderr.includes(\"ERR_PNPM_WORKSPACE_PKG_NOT_FOUND\") || stderr.includes(\"ERR_PNPM_NO_MATCHING_VERSION\") || /No matching version found for .* in the catalog/i.test(stderr) || /workspace:[^\\s]+ is not a valid (version|spec)/i.test(stderr) || /catalog:[^\\s]* is not a valid (version|spec)/i.test(stderr);\n}\n//#endregion\n//#region src/orm/init-packages.ts\nfunction metaString(failure, key) {\n\tconst value = failure.meta?.[key];\n\treturn typeof value === \"string\" ? value : \"\";\n}\n/**\n* pnpm reported a specifier the published artifact leaked, which npm installs\n* happily. The engine redacts credentials out of the stderr it returns but\n* leaves error codes alone, which is what this reads.\n*/\nfunction pnpmLeakedASpecifier(failure) {\n\treturn metaString(failure, \"manager\") === \"pnpm\" && isRecognisedPnpmResolutionError(metaString(failure, \"stderrTail\"));\n}\n/**\n* The engine redacts the stderr it hands back, and this redacts it again\n* before quoting it: what the engine strips is its own business, and registry\n* auth material is not all URL-shaped.\n*/\nfunction fallbackWarning(failure) {\n\tconst firstLine = redactSecrets(metaString(failure, \"stderrTail\")).trim().split(\"\\n\")[0] ?? \"\";\n\treturn [\n\t\t\"pnpm could not install: a published Prisma Next dependency leaked a `workspace:*` or `catalog:` specifier.\",\n\t\t\"Falling back to npm so init can complete.\",\n\t\tfirstLine === \"\" ? \"\" : ` pnpm error: ${firstLine}`,\n\t\t\"Both installs ran under npm, which writes a package-lock.json beside the pnpm lockfile — delete whichever of the two you do not want to keep.\",\n\t\t\"Once the offending package republishes a clean version, re-run `pnpm install` to switch back.\"\n\t].filter((line) => line !== \"\").join(\"\\n\");\n}\n/** The pnpm failure the npm retry was meant to recover from, kept alongside the npm one. */\nfunction retriedWarning(failure) {\n\tconst firstLine = redactSecrets(metaString(failure, \"stderrTail\")).trim().split(\"\\n\")[0] ?? \"\";\n\treturn [\"pnpm failed first with a leaked `workspace:*` or `catalog:` specifier, so init retried with npm.\", firstLine === \"\" ? \"\" : ` pnpm error: ${firstLine}`].filter((line) => line !== \"\").join(\"\\n\");\n}\n/**\n* Adds the runtime and development dependencies through the engine's package\n* manager. The retry is `init`'s alone: the engine spells and runs the\n* command, and this decides — from the stderr it returned — that another\n* manager is worth a try.\n*/\n/**\n* The engine dependency spec a fresh scaffold installs. The scaffolded\n* `prisma.config.ts` imports `defineConfig` from `@prisma/cli-engine`, and the\n* installed `@prisma/cli` names the exact engine version it runs against — so\n* the spec is read from the manifest the install just placed, never guessed\n* from a dist-tag (whose `latest` has lagged that version before and broken\n* the very next command). A CLI without a readable engine entry falls back to\n* the `next` tag, the release train the CLI itself publishes under.\n*/\nfunction engineDevDependencySpec(cwd) {\n\ttry {\n\t\tconst manifest = JSON.parse(readFileSync(join(cwd, \"node_modules\", \"@prisma\", \"cli\", \"package.json\"), \"utf-8\"));\n\t\tif (typeof manifest === \"object\" && manifest !== null) for (const field of [\"dependencies\", \"peerDependencies\"]) {\n\t\t\tconst block = Reflect.get(manifest, field);\n\t\t\tif (typeof block === \"object\" && block !== null) {\n\t\t\t\tconst engine = Reflect.get(block, \"@prisma/cli-engine\");\n\t\t\t\tif (typeof engine === \"string\" && engine.length > 0) return `@prisma/cli-engine@${engine}`;\n\t\t\t}\n\t\t}\n\t} catch {}\n\treturn \"@prisma/cli-engine@next\";\n}\nasync function installProjectDependencies(ctx) {\n\tconst pair = async (manager) => {\n\t\tconst runtimeDeps = await ctx.packages.install({\n\t\t\tpackages: ctx.deps,\n\t\t\tcwd: ctx.cwd,\n\t\t\t...ifDefined(\"manager\", manager)\n\t\t});\n\t\tif (!runtimeDeps.ok) return runtimeDeps.failure;\n\t\tconst developmentDeps = await ctx.packages.install({\n\t\t\tpackages: ctx.devDeps,\n\t\t\tdev: true,\n\t\t\tcwd: ctx.cwd,\n\t\t\t...ifDefined(\"manager\", manager)\n\t\t});\n\t\treturn developmentDeps.ok ? void 0 : developmentDeps.failure;\n\t};\n\tconst failure = await pair();\n\tif (failure === void 0) return {\n\t\tfailure: void 0,\n\t\tmanager: void 0,\n\t\twarnings: ctx.catalogWarnings\n\t};\n\tif (!pnpmLeakedASpecifier(failure)) return {\n\t\tfailure,\n\t\tmanager: void 0,\n\t\twarnings: []\n\t};\n\tconst retryFailure = await pair(\"npm\");\n\tif (retryFailure !== void 0) return {\n\t\tfailure: retryFailure,\n\t\tmanager: void 0,\n\t\twarnings: [retriedWarning(failure)]\n\t};\n\treturn {\n\t\tfailure: void 0,\n\t\tmanager: \"npm\",\n\t\twarnings: [fallbackWarning(failure)]\n\t};\n}\nfunction skillArgs(url, skill) {\n\treturn [\n\t\t\"add\",\n\t\turl,\n\t\t\"--agent\",\n\t\t...DEFAULT_SKILL_AGENTS,\n\t\t\"--skill\",\n\t\tskill,\n\t\t\"-y\"\n\t];\n}\n/**\n* Registers every Prisma Next skill with the agent runtimes, in order. The\n* first failure stops the loop: the user opted into Prisma Next by running\n* `init`, and a half-installed skill set leaves the project ambiguous.\n*/\nasync function installAgentSkills(ctx) {\n\tfor (const source of DEFAULT_SKILL_SOURCES) {\n\t\tconst result = await ctx.packages.run({\n\t\t\tpackage: \"skills@latest\",\n\t\t\targs: skillArgs(formatSkillSourceUrl(source, ctx.env), source.skill),\n\t\t\tcwd: ctx.cwd,\n\t\t\t...ifDefined(\"manager\", ctx.manager)\n\t\t});\n\t\tif (!result.ok) return result.failure;\n\t}\n}\n//#endregion\n//#region src/orm/init.ts\n/** The scaffold is on disk from here on, so each of these is a finding. */\nconst INIT_EXIT_CODES = {\n\t4: \"scaffold written; dependency install failed\",\n\t5: \"scaffold written and installed; contract emit failed\",\n\t6: \"scaffold complete; agent-skill install failed\"\n};\nfunction probeWarning(outcome, strictProbe) {\n\tswitch (outcome.kind) {\n\t\tcase \"ok\": return {\n\t\t\twarning: void 0,\n\t\t\tfatal: void 0\n\t\t};\n\t\tcase \"below-minimum\": return {\n\t\t\twarning: outcome.message,\n\t\t\tfatal: void 0\n\t\t};\n\t\tcase \"no-database-url\":\n\t\tcase \"connection-failed\":\n\t\tcase \"driver-missing\": return strictProbe ? {\n\t\t\twarning: void 0,\n\t\t\tfatal: outcome.message\n\t\t} : {\n\t\t\twarning: outcome.message,\n\t\t\tfatal: void 0\n\t\t};\n\t}\n}\nfunction causeMessage(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\nconst createInitCommand = (injected) => defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Initialize a new Prisma Next project\",\n\t\tdescription: \"Scaffolds config, schema, and runtime files, installs dependencies,\\nand emits the contract. Gets you from zero to typed queries in one step.\\n\\nRun it interactively for a guided setup, or supply --target and --authoring\\nfor a fully scriptable run (CI, AI coding agents, automation).\",\n\t\texamples: [\n\t\t\t\"init\",\n\t\t\t\"init --target postgres --authoring psl\",\n\t\t\t\"init --target mongodb --authoring typescript --json\",\n\t\t\t\"init --skip-install\",\n\t\t\t\"init --skip-skills\",\n\t\t\t\"init --target postgres --keep-previous-facade\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\ttarget: flag.string({\n\t\t\tbrief: \"Database target: postgres or mongodb\",\n\t\t\tplaceholder: \"db\"\n\t\t}),\n\t\tauthoring: flag.string({\n\t\t\tbrief: \"Schema authoring style: psl or typescript\",\n\t\t\tplaceholder: \"style\"\n\t\t}),\n\t\tschemaPath: flag.string({\n\t\t\tbrief: \"Where to write the starter schema\",\n\t\t\tplaceholder: \"path\"\n\t\t}),\n\t\twriteEnv: flag.boolean({ brief: \"Write a .env file from .env.example (gitignored)\" }),\n\t\tprobeDb: flag.boolean({ brief: \"Connect to DATABASE_URL once and check the server version\" }),\n\t\tstrictProbe: flag.boolean({ brief: \"Treat a failed --probe-db as fatal\" }),\n\t\tskipInstall: flag.boolean({ brief: \"Skip dependency installation and contract emission\" }),\n\t\tskipSkills: flag.boolean({ brief: \"Skip the Prisma Next agent-skill install\" }),\n\t\tkeepPreviousFacade: flag.boolean({ brief: \"Keep the previous target package in package.json when switching targets\" })\n\t} },\n\texitCodes: INIT_EXIT_CODES,\n\tinstallsPackages: true,\n\thandler: async (args, ctx) => {\n\t\tconst warnings = [];\n\t\tconst warn = (text) => {\n\t\t\twarnings.push(text);\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext\n\t\t\t});\n\t\t};\n\t\tconst inputs = await resolveInitInputs({\n\t\t\tcwd: ctx.cwd,\n\t\t\tflags: args.flags,\n\t\t\tprompt: ctx.prompt\n\t\t});\n\t\tconst packageManager = await resolveScaffoldPackageManager({\n\t\t\tcwd: ctx.cwd,\n\t\t\tenv: ctx.env\n\t\t});\n\t\tconst scaffold = scaffoldProject({\n\t\t\tcwd: ctx.cwd,\n\t\t\tinputs,\n\t\t\tpackageManager\n\t\t});\n\t\tfor (const warning of scaffold.warnings) warn(warning);\n\t\tfor (const note of scaffold.notes) ctx.report({\n\t\t\tkind: \"message\",\n\t\t\tseverity: \"info\",\n\t\t\ttext: note\n\t\t});\n\t\tconst deps = [targetPackageName(inputs.target, scaffold.resolveImportSpecifier), \"dotenv\"];\n\t\tconst cliDevDeps = [\"@prisma/cli@next\"];\n\t\tconst devDeps = scaffold.hasTypesNode ? cliDevDeps : [...cliDevDeps, \"@types/node\"];\n\t\tconst findings = [];\n\t\tconst extraActions = [];\n\t\tlet installedManager;\n\t\tlet packagesInstalled = \"skipped\";\n\t\tlet contractEmitted = false;\n\t\tlet skillRegistered = false;\n\t\tconst settle = (exitCode) => {\n\t\t\tconst installed = packagesInstalled === \"installed\";\n\t\t\tconst document = {\n\t\t\t\tok: true,\n\t\t\t\ttarget: inputs.target === \"mongo\" ? \"mongodb\" : \"postgres\",\n\t\t\t\tauthoring: inputs.authoring,\n\t\t\t\tschemaPath: inputs.schemaPath,\n\t\t\t\tfilesWritten: scaffold.filesWritten,\n\t\t\t\tfilesDeleted: scaffold.filesDeleted,\n\t\t\t\tpackagesInstalled: {\n\t\t\t\t\tstatus: packagesInstalled,\n\t\t\t\t\tdeps: installed ? deps : [],\n\t\t\t\t\tdevDeps: installed ? devDeps : []\n\t\t\t\t},\n\t\t\t\tcontractEmitted,\n\t\t\t\tnextSteps: buildNextSteps({\n\t\t\t\t\ttarget: inputs.target === \"mongo\" ? \"mongodb\" : \"postgres\",\n\t\t\t\t\tpackagesInstalled,\n\t\t\t\t\tcontractEmitted,\n\t\t\t\t\temitCommand: EMIT_COMMAND,\n\t\t\t\t\tschemaPath: inputs.schemaPath,\n\t\t\t\t\tskillRegistered\n\t\t\t\t}),\n\t\t\t\twarnings\n\t\t\t};\n\t\t\tconst validated = InitOutputSchema(document);\n\t\t\tif (validated instanceof type.errors) return notOk$1(new CliStructuredError$1(\"CLI.INIT_INVALID_OUTPUT_DOCUMENT\", \"Init produced an invalid output document\", {\n\t\t\t\twhy: `The success document failed schema validation: ${String(validated)}`,\n\t\t\t\tnextActions: [chooseAction(\"This is a bug in Prisma Next. Please report it with `-v` output.\")],\n\t\t\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_OUTPUT_DOCUMENT\")\n\t\t\t}));\n\t\t\treturn ok$1(ctx.present({\n\t\t\t\tdata: document,\n\t\t\t\texitCode,\n\t\t\t\tdiagnostics: findings\n\t\t\t}, initPresentations({\n\t\t\t\tdocument,\n\t\t\t\tcomplete: exitCode === 0,\n\t\t\t\tnextActions: [...extraActions, ...buildInitNextActions({\n\t\t\t\t\tcontractEmitted,\n\t\t\t\t\tschemaPath: inputs.schemaPath,\n\t\t\t\t\tskillRegistered\n\t\t\t\t})]\n\t\t\t})));\n\t\t};\n\t\tif (inputs.install) {\n\t\t\tconst outcome = await installProjectDependencies({\n\t\t\t\tpackages: ctx.packages,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tdeps,\n\t\t\t\tdevDeps,\n\t\t\t\tcatalogWarnings: packageManager === \"pnpm\" ? buildCatalogWarnings(ctx.cwd, [...deps, ...devDeps]) : []\n\t\t\t});\n\t\t\tfor (const warning of outcome.warnings) warn(warning);\n\t\t\tif (outcome.failure !== void 0) {\n\t\t\t\tpackagesInstalled = \"failed\";\n\t\t\t\tfindings.push(installFailedFinding(outcome.failure, scaffold.filesWritten));\n\t\t\t\treturn settle(4);\n\t\t\t}\n\t\t\tconst engineSpec = engineDevDependencySpec(ctx.cwd);\n\t\t\tconst engineInstall = await ctx.packages.install({\n\t\t\t\tpackages: [engineSpec],\n\t\t\t\tdev: true,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\t...ifDefined(\"manager\", outcome.manager)\n\t\t\t});\n\t\t\tif (!engineInstall.ok) {\n\t\t\t\tpackagesInstalled = \"failed\";\n\t\t\t\tfindings.push(installFailedFinding(engineInstall.failure, scaffold.filesWritten));\n\t\t\t\treturn settle(4);\n\t\t\t}\n\t\t\tdevDeps.push(engineSpec);\n\t\t\tpackagesInstalled = \"installed\";\n\t\t\tinstalledManager = outcome.manager;\n\t\t\tconst emitStep = \"Emit the contract\";\n\t\t\tctx.report({\n\t\t\t\tkind: \"step-started\",\n\t\t\t\tstep: emitStep\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tawait injected.emitScaffoldedContract({ cwd: ctx.cwd });\n\t\t\t\tcontractEmitted = true;\n\t\t\t\tctx.report({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: emitStep,\n\t\t\t\t\toutcome: \"ok\"\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tctx.report({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: emitStep,\n\t\t\t\t\toutcome: \"failed\"\n\t\t\t\t});\n\t\t\t\tfindings.push(emitFailedFinding(causeMessage(error), scaffold.filesWritten));\n\t\t\t\treturn settle(5);\n\t\t\t}\n\t\t} else extraActions.push(chooseAction(`Install the project dependencies with your package manager: ${deps.join(\", \")} (and ${devDeps.join(\", \")} plus @prisma/cli-engine at the version @prisma/cli declares as its peer, as development dependencies)`));\n\t\tif (inputs.probeDb) {\n\t\t\tconst probe = probeWarning(await probeServerVersion({\n\t\t\t\tbaseDir: ctx.cwd,\n\t\t\t\ttarget: inputs.target,\n\t\t\t\tdatabaseUrl: ctx.env[\"DATABASE_URL\"],\n\t\t\t\tminVersion: MIN_SERVER_VERSION[inputs.target]\n\t\t\t}, {}), inputs.strictProbe);\n\t\t\tif (probe.warning !== void 0) warn(probe.warning);\n\t\t\tif (probe.fatal !== void 0) return notOk$1(normalizeError(errorInitProbeFailed({\n\t\t\t\tcause: probe.fatal,\n\t\t\t\tfilesWritten: scaffold.filesWritten\n\t\t\t})));\n\t\t}\n\t\tconst skillCommands = resolveProjectSkillInstallCommands(installedManager ?? packageManager, ctx.env);\n\t\tif (inputs.installProjectSkill) {\n\t\t\tconst failure = await installAgentSkills({\n\t\t\t\tpackages: ctx.packages,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tenv: ctx.env,\n\t\t\t\tmanager: installedManager\n\t\t\t});\n\t\t\tif (failure !== void 0) {\n\t\t\t\tfindings.push(skillInstallFailedFinding(failure, scaffold.filesWritten, skillCommands));\n\t\t\t\treturn settle(6);\n\t\t\t}\n\t\t\tskillRegistered = true;\n\t\t} else warn(`Skipped the Prisma Next agent-skill install (--skip-skills). To install them later, run: ${skillCommands.map((command) => `\\`${command}\\``).join(\" && \")}`);\n\t\treturn settle(0);\n\t}\n});\nconst initCommand = createInitCommand({ emitScaffoldedContract });\n//#endregion\n//#region src/orm/lsp.ts\n/**\n* R-S5-12 asks every command to end at 143 for SIGTERM and 130 otherwise, and\n* a server command is the one kind the engine leaves to do it: it settles the\n* handler's code verbatim, on the reasoning that a protocol conclusion was\n* never the CLI's to author. The two readings are in tension — this one wins\n* here, and the tension is recorded for the engine's owners, because it means\n* a SIGTERM landing after a clean `shutdown` reports 143 for a conversation\n* that ended correctly at 0.\n*/\nfunction signalExitCode(reason) {\n\treturn reason === \"SIGTERM\" ? 143 : 130;\n}\nconst lspCommand = defineServerCommand({\n\thelp: {\n\t\tsummary: \"Start the Prisma Next language server\",\n\t\tdescription: \"Launches a Language Server Protocol server that publishes PSL parse diagnostics\\nand handles whole-document PSL formatting for the schema inputs declared in\\nyour config (contract.source.inputs). Formatting uses the Prisma Next PSL\\nformatter and the formatter block from the project config.\\nCommunicates over stdio; intended to be spawned by an\\neditor, not run interactively. The server keeps running until the editor client\\ndisconnects.\",\n\t\texamples: [\"lsp\"]\n\t},\n\targs: { flags: {\n\t\tstdio: flag.boolean({ brief: \"Communicate with the editor over stdio (the default and only transport)\" }),\n\t\tclientProcessId: flag.number({\n\t\t\tbrief: \"Process id of the editor that spawned the server; the server ends when it dies\",\n\t\t\tplaceholder: \"pid\"\n\t\t})\n\t} },\n\thandler: async (args, io) => {\n\t\tconst exitCode = await withoutClientProcessIdInArgv(async () => {\n\t\t\tconst { startServer } = await import(\"@internal/language-server\");\n\t\t\treturn startServer({\n\t\t\t\tstdin: io.stdin,\n\t\t\t\tstdout: io.stdout,\n\t\t\t\tstderr: io.stderr,\n\t\t\t\tsignal: io.signal,\n\t\t\t\t...ifDefined(\"clientProcessId\", args.flags.clientProcessId)\n\t\t\t});\n\t\t});\n\t\treturn io.signal.aborted ? signalExitCode(io.signal.reason) : exitCode;\n\t}\n});\n/**\n* Importing `vscode-languageserver/node` reads `--clientProcessId` off\n* `process.argv` and arms a parent-watch interval that is never unref'd, so a\n* settled run would leave the process hanging. The server watches the client\n* process itself (from the parsed flag), so the argument is hidden for the\n* import and restored after.\n*/\nasync function withoutClientProcessIdInArgv(run) {\n\tconst original = process.argv;\n\tconst scrubbed = [];\n\tfor (let index = 0; index < original.length; index += 1) {\n\t\tconst token = original[index];\n\t\tif (token === \"--clientProcessId\") {\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (token === void 0 || token.startsWith(\"--clientProcessId=\")) continue;\n\t\tscrubbed.push(token);\n\t}\n\tprocess.argv = scrubbed;\n\ttry {\n\t\treturn await run();\n\t} finally {\n\t\tprocess.argv = original;\n\t}\n}\n//#endregion\n//#region src/utils/formatters/tone-markup.ts\n/**\n* The drawing formatters compose one string per line, measuring display widths\n* with `string-width` as they go. To carry colour through that pipeline without\n* disturbing a single width, a tone is marked with an SGR escape sequence:\n* `string-width` and `strip-ansi` already treat those as zero-width, so every\n* existing width calculation keeps its answer.\n*\n* The marks are a transport, not output. {@link toneDrawing} turns a marked\n* string into the engine's spans, and it drops every escape sequence it sees —\n* so no escape sequence can reach the engine, which does the painting itself.\n*/\nconst TONE_MARK_BASE = 900;\n/** The escape character every SGR sequence opens with. */\nconst ESCAPE = String.fromCharCode(27);\n/** Ends the innermost open mark. */\nconst TONE_MARK_END = `${ESCAPE}[${TONE_MARK_BASE}m`;\n/**\n* Every tone, in the order their marks are numbered. Exported so a test can\n* hold it against a compiler-checked list of the engine's tones: a tone\n* missing from here would silently lose its colour.\n*/\nconst TONE_ORDER = [\n\t\"ok\",\n\t\"warn\",\n\t\"error\",\n\t\"info\",\n\t\"heading\",\n\t\"identifier\",\n\t\"ref\",\n\t\"placeholder\",\n\t\"link\",\n\t\"emphasis\",\n\t\"muted\",\n\t\"structure\",\n\t\"highlight\",\n\t\"color-1\",\n\t\"color-2\",\n\t\"color-3\",\n\t\"color-4\",\n\t\"color-5\",\n\t\"color-6\"\n];\nconst MARK_BY_TONE = new Map(TONE_ORDER.map((tone, index) => [tone, TONE_MARK_BASE + index + 1]));\nconst TONE_BY_MARK = new Map(TONE_ORDER.map((tone, index) => [TONE_MARK_BASE + index + 1, tone]));\n/** Marks `text` as carrying `tone`. Marks nest; the innermost one wins. */\nfunction toned(tone, text) {\n\treturn `${ESCAPE}[${MARK_BY_TONE.get(tone)}m${text}${TONE_MARK_END}`;\n}\n/** The painter shape the formatters take, bound to one tone. */\nfunction tonePainter(tone) {\n\treturn (text) => toned(tone, text);\n}\nconst SGR_SEQUENCE = new RegExp(`${ESCAPE}\\\\[([\\\\d;]*)m`, \"g\");\nfunction pushSpan(spans, text, tone) {\n\tif (text.length === 0) return;\n\tconst previous = spans.at(-1);\n\tif (previous !== void 0 && previous.tone === tone) {\n\t\tspans[spans.length - 1] = {\n\t\t\ttext: previous.text + text,\n\t\t\t...tone === void 0 ? {} : { tone }\n\t\t};\n\t\treturn;\n\t}\n\tspans.push({\n\t\ttext,\n\t\t...tone === void 0 ? {} : { tone }\n\t});\n}\n/** One marked line as spans. Text carrying no mark becomes an untoned span. */\nfunction toneSpans(line) {\n\tconst spans = [];\n\tconst open = [];\n\tlet cursor = 0;\n\tSGR_SEQUENCE.lastIndex = 0;\n\tfor (let match = SGR_SEQUENCE.exec(line); match !== null; match = SGR_SEQUENCE.exec(line)) {\n\t\tpushSpan(spans, line.slice(cursor, match.index), open.at(-1));\n\t\tcursor = match.index + match[0].length;\n\t\tfor (const parameter of (match[1] ?? \"\").split(\";\")) {\n\t\t\tconst code = Number(parameter);\n\t\t\tif (code === TONE_MARK_BASE) {\n\t\t\t\topen.pop();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst tone = TONE_BY_MARK.get(code);\n\t\t\tif (tone !== void 0) open.push(tone);\n\t\t}\n\t}\n\tpushSpan(spans, line.slice(cursor), open.at(-1));\n\treturn spans;\n}\n/**\n* A marked block as the lines of a `drawing` block. A line with no marks stays\n* a plain string, which is what the engine's `Text` wants for untoned text.\n*/\nfunction toneDrawing(block) {\n\treturn block.split(\"\\n\").map((line) => {\n\t\tconst spans = toneSpans(line);\n\t\tif (spans.length === 0) return \"\";\n\t\tconst only = spans.length === 1 ? spans[0] : void 0;\n\t\treturn only !== void 0 && only.tone === void 0 ? only.text : spans;\n\t});\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-palette.ts\nconst LANE_COUNT = 6;\nconst forced = createColors({ useColor: true });\nconst ANSI_LANES = [\n\tforced.white,\n\tforced.cyan,\n\tforced.yellow,\n\tforced.blueBright,\n\tforced.magenta,\n\tforced.green\n];\n/** The palette the commander CLI paints with: ANSI SGR straight into the line. */\nconst ANSI_MIGRATION_GRAPH_PALETTE = {\n\tlane: (lane, text) => (ANSI_LANES[lane % LANE_COUNT] ?? ((value) => value))(text),\n\trole: (role, text) => role === \"on-path\" ? forced.greenBright(text) : forced.dim(text),\n\temphasis: (text) => bold(text),\n\tstatus: (status, text) => status === \"applied\" ? green(text) : yellow(text)\n};\nconst TONE_LANES = [\n\t\"color-1\",\n\t\"color-2\",\n\t\"color-3\",\n\t\"color-4\",\n\t\"color-5\",\n\t\"color-6\"\n];\n/**\n* The palette the engine shell marks with: each run of text carries the tone\n* it means, and the engine chooses the bytes. The lane series maps onto the\n* engine's indexed colours in order, which is the same rotation.\n*/\nconst TONE_MIGRATION_GRAPH_PALETTE = {\n\tlane: (lane, text) => tonePainter(TONE_LANES[lane % LANE_COUNT] ?? \"color-1\")(text),\n\trole: (role, text) => tonePainter(role === \"on-path\" ? \"highlight\" : \"muted\")(text),\n\temphasis: tonePainter(\"emphasis\"),\n\tstatus: (status, text) => tonePainter(status === \"applied\" ? \"ok\" : \"warn\")(text)\n};\n/** The palette a plain, uncoloured render uses: none of it. */\nconst PLAIN_MIGRATION_GRAPH_PALETTE = {\n\tlane: (_lane, text) => text,\n\trole: (_role, text) => text,\n\temphasis: (text) => text,\n\tstatus: (_status, text) => text\n};\nfunction migrationListForwardArrow(glyphMode) {\n\treturn glyphMode === \"ascii\" ? \"->\" : \"→\";\n}\nfunction migrationListEmptySource(glyphMode) {\n\treturn glyphMode === \"ascii\" ? \"-\" : \"∅\";\n}\nfunction abbreviateContractHash(hash) {\n\treturn hash.slice(0, 7);\n}\nfunction padFromHashColumn(text, width) {\n\tconst padding = Math.max(0, width - stringWidth(text));\n\treturn `${\" \".repeat(padding)}${text}`;\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-grid-layout.ts\n/**\n* Grid layout for the line/plane/occlusion migration-graph renderer.\n*\n* Produces a Grid (rows × cells) from a MigrationGraphRowModel. Each node\n* emits: fork connector, self-loop rows, node row, merge connector, and\n* inbound migration rows — in display order (tips first, then roots).\n*/\nfunction buildLaneAssignment(nodes, edges) {\n\tconst fwdEdges = edges.filter((e) => e.kind === \"forward\" && e.from !== e.to);\n\tconst outbound = /* @__PURE__ */ new Map();\n\tconst inbound = /* @__PURE__ */ new Map();\n\tfor (const edge of fwdEdges) {\n\t\tconst ob = outbound.get(edge.from);\n\t\tif (ob) ob.push(edge);\n\t\telse outbound.set(edge.from, [edge]);\n\t\tconst ib = inbound.get(edge.to);\n\t\tif (ib) ib.push(edge);\n\t\telse inbound.set(edge.to, [edge]);\n\t}\n\tfor (const list of outbound.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tfor (const list of inbound.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tconst components = [];\n\tlet current = [];\n\tfor (const n of nodes) if (n === null) {\n\t\tif (current.length > 0) components.push(current);\n\t\tcurrent = [];\n\t} else current.push(n);\n\tif (current.length > 0) components.push(current);\n\tconst allNodes = /* @__PURE__ */ new Set();\n\tfor (const n of nodes) if (n !== null) allNodes.add(n);\n\tconst nodeRank = /* @__PURE__ */ new Map();\n\tfor (const n of allNodes) nodeRank.set(n, 0);\n\tfor (let pass = 0; pass < allNodes.size; pass++) {\n\t\tlet changed = false;\n\t\tfor (const [from, es] of outbound) {\n\t\t\tconst base = nodeRank.get(from) ?? 0;\n\t\t\tfor (const e of es) {\n\t\t\t\tconst next = base + 1;\n\t\t\t\tif (next > (nodeRank.get(e.to) ?? 0)) {\n\t\t\t\t\tnodeRank.set(e.to, next);\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!changed) break;\n\t}\n\tconst nodeLane = /* @__PURE__ */ new Map();\n\tconst edgeLane = /* @__PURE__ */ new Map();\n\tlet totalLanes = 0;\n\tfor (const componentNodes of components) {\n\t\tconst componentSet = new Set(componentNodes);\n\t\tlet nextLane = 0;\n\t\tconst roots = [];\n\t\tfor (const n of componentNodes) if ((inbound.get(n) ?? []).length === 0) roots.push(n);\n\t\troots.sort((a, b) => {\n\t\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\t\treturn a.localeCompare(b);\n\t\t});\n\t\tconst bfsQueue = [];\n\t\tfor (const root of roots) if (!nodeLane.has(root)) {\n\t\t\tnodeLane.set(root, nextLane++);\n\t\t\tbfsQueue.push({\n\t\t\t\tnode: root,\n\t\t\t\tlane: nodeLane.get(root)\n\t\t\t});\n\t\t}\n\t\tlet head = 0;\n\t\twhile (head < bfsQueue.length) {\n\t\t\tconst { node, lane } = bfsQueue[head++];\n\t\t\tconst children = outbound.get(node) ?? [];\n\t\t\tlet first = true;\n\t\t\tfor (const childEdge of children) {\n\t\t\t\tconst child = childEdge.to;\n\t\t\t\tif (!componentSet.has(child)) continue;\n\t\t\t\tif (!nodeLane.has(child)) {\n\t\t\t\t\tconst childLane = first ? lane : nextLane++;\n\t\t\t\t\tnodeLane.set(child, childLane);\n\t\t\t\t\tbfsQueue.push({\n\t\t\t\t\t\tnode: child,\n\t\t\t\t\t\tlane: childLane\n\t\t\t\t\t});\n\t\t\t\t\tedgeLane.set(childEdge.migrationHash, childLane);\n\t\t\t\t} else edgeLane.set(childEdge.migrationHash, Math.max(lane, nodeLane.get(child)));\n\t\t\t\tfirst = false;\n\t\t\t}\n\t\t}\n\t\tfor (const n of componentNodes) if (!nodeLane.has(n)) nodeLane.set(n, nextLane++);\n\t\tfor (const n of componentNodes) {\n\t\t\tconst parents = inbound.get(n);\n\t\t\tif (!parents || parents.length <= 1) continue;\n\t\t\tlet trunkParent = parents[0].from;\n\t\t\tlet trunkRank = nodeRank.get(trunkParent) ?? 0;\n\t\t\tlet trunkLane = nodeLane.get(trunkParent) ?? 0;\n\t\t\tfor (let i = 1; i < parents.length; i++) {\n\t\t\t\tconst parent = parents[i].from;\n\t\t\t\tconst rank = nodeRank.get(parent) ?? 0;\n\t\t\t\tconst lane = nodeLane.get(parent) ?? 0;\n\t\t\t\tif (rank > trunkRank || rank === trunkRank && lane < trunkLane) {\n\t\t\t\t\ttrunkParent = parent;\n\t\t\t\t\ttrunkRank = rank;\n\t\t\t\t\ttrunkLane = lane;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst trunkParentLane = nodeLane.get(trunkParent) ?? 0;\n\t\t\tconst currentNodeLane = nodeLane.get(n) ?? 0;\n\t\t\tif (currentNodeLane === trunkParentLane) continue;\n\t\t\tnodeLane.set(n, trunkParentLane);\n\t\t\tfor (const parentEdge of parents) if (parentEdge.from === trunkParent) edgeLane.set(parentEdge.migrationHash, trunkParentLane);\n\t\t\tconst bfsDescendants = [n];\n\t\t\tlet descHead = 0;\n\t\t\twhile (descHead < bfsDescendants.length) {\n\t\t\t\tconst current = bfsDescendants[descHead++];\n\t\t\t\tconst children = outbound.get(current) ?? [];\n\t\t\t\tfor (const childEdge of children) {\n\t\t\t\t\tconst child = childEdge.to;\n\t\t\t\t\tif (!componentSet.has(child)) continue;\n\t\t\t\t\tif ((nodeLane.get(child) ?? 0) !== currentNodeLane) continue;\n\t\t\t\t\tnodeLane.set(child, trunkParentLane);\n\t\t\t\t\tconst existingEdgeLane = edgeLane.get(childEdge.migrationHash);\n\t\t\t\t\tif (existingEdgeLane !== void 0 && existingEdgeLane === currentNodeLane) edgeLane.set(childEdge.migrationHash, trunkParentLane);\n\t\t\t\t\tbfsDescendants.push(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (nextLane > totalLanes) totalLanes = nextLane;\n\t}\n\treturn {\n\t\tnodeLane,\n\t\tnodeRank,\n\t\tedgeLane,\n\t\tnumLanes: totalLanes\n\t};\n}\nfunction computeDisplayOrder(nodes, nodeLane, nodeRank) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst result = [];\n\tlet componentBuffer = [];\n\tfunction flushComponent() {\n\t\tcomponentBuffer.sort((a, b) => b.rank - a.rank || a.lane - b.lane);\n\t\tfor (const d of componentBuffer) result.push(d);\n\t\tcomponentBuffer = [];\n\t}\n\tfor (const n of nodes) {\n\t\tif (n === null) {\n\t\t\tflushComponent();\n\t\t\tresult.push(null);\n\t\t\tcontinue;\n\t\t}\n\t\tif (seen.has(n)) continue;\n\t\tseen.add(n);\n\t\tcomponentBuffer.push({\n\t\t\thash: n,\n\t\t\tlane: nodeLane.get(n) ?? 0,\n\t\t\trank: nodeRank.get(n) ?? 0\n\t\t});\n\t}\n\tflushComponent();\n\treturn result;\n}\n/** Create an empty cell. */\nfunction emptyCell() {\n\treturn { lines: [] };\n}\nfunction buildGrid(rowModel, opts = {}, highlight = {\n\tmode: \"flat\",\n\tonPath: /* @__PURE__ */ new Set()\n}) {\n\tconst colsPerLane = opts.colsPerLane ?? 2;\n\tconst isFocus = highlight.mode === \"focus\";\n\tconst { nodeLane, nodeRank, edgeLane, numLanes } = buildLaneAssignment(rowModel.nodes, rowModel.edges);\n\tconst displayOrder = computeDisplayOrder(rowModel.nodes, nodeLane, nodeRank);\n\tconst displayIndex = /* @__PURE__ */ new Map();\n\tlet nodeIdx = 0;\n\tfor (const d of displayOrder) if (d !== null) displayIndex.set(d.hash, nodeIdx++);\n\tconst rollbackEdges = rowModel.edges.filter((e) => e.kind === \"rollback\" && e.from !== e.to);\n\tconst adjacentRollbacks = [];\n\tconst skippingRollbacks = [];\n\tfor (const e of rollbackEdges) {\n\t\tconst si = displayIndex.get(e.from);\n\t\tconst ti = displayIndex.get(e.to);\n\t\tif (si === void 0 || ti === void 0) continue;\n\t\tif (ti === si + 1) adjacentRollbacks.push(e);\n\t\telse skippingRollbacks.push(e);\n\t}\n\tconst targetGroups = /* @__PURE__ */ new Map();\n\tfor (const e of skippingRollbacks) {\n\t\tconst group = targetGroups.get(e.to);\n\t\tif (group) group.push(e);\n\t\telse targetGroups.set(e.to, [e]);\n\t}\n\tconst sortedTargetKeys = [...targetGroups.keys()].sort((a, b) => {\n\t\tconst ta = displayIndex.get(a) ?? 0;\n\t\treturn (displayIndex.get(b) ?? 0) - ta;\n\t});\n\tconst numTargetGroups = sortedTargetKeys.length;\n\tconst geomLaneOf = /* @__PURE__ */ new Map();\n\tconst outermostGroup = numLanes + numTargetGroups - 1;\n\tsortedTargetKeys.forEach((targetHash, i) => {\n\t\tconst groupGeomLane = outermostGroup - i;\n\t\tfor (const e of targetGroups.get(targetHash)) geomLaneOf.set(e.migrationHash, groupGeomLane);\n\t});\n\tconst totalDisplayNodes = displayOrder.filter((d) => d !== null).length;\n\tconst planeLaneOf = /* @__PURE__ */ new Map();\n\tfor (const e of skippingRollbacks) {\n\t\tconst si = displayIndex.get(e.from) ?? 0;\n\t\tplaneLaneOf.set(e.migrationHash, totalDisplayNodes - si);\n\t}\n\tconst PALETTE_SIZE = 6;\n\tconst GREEN_PALETTE_IDX = 5;\n\tconst arcSourceIndex = /* @__PURE__ */ new Map();\n\tconst arcTargetIndex = /* @__PURE__ */ new Map();\n\tfor (const e of skippingRollbacks) {\n\t\tarcSourceIndex.set(e.migrationHash, displayIndex.get(e.from) ?? 0);\n\t\tarcTargetIndex.set(e.migrationHash, displayIndex.get(e.to) ?? 0);\n\t}\n\tconst arcsByTarget = /* @__PURE__ */ new Map();\n\tconst arcsBySource = /* @__PURE__ */ new Map();\n\tfor (const e of skippingRollbacks) {\n\t\tconst tb = arcsByTarget.get(e.to);\n\t\tif (tb) tb.push(e);\n\t\telse arcsByTarget.set(e.to, [e]);\n\t\tconst sb = arcsBySource.get(e.from);\n\t\tif (sb) sb.push(e);\n\t\telse arcsBySource.set(e.from, [e]);\n\t}\n\tconst colourLaneOf = /* @__PURE__ */ new Map();\n\tconst activeArcColours = /* @__PURE__ */ new Map();\n\tconst activeFwdLaneColours = /* @__PURE__ */ new Set();\n\tfor (let i = displayOrder.length - 1; i >= 0; i--) {\n\t\tconst nd = displayOrder[i];\n\t\tif (nd === null || nd === void 0) continue;\n\t\tconst { hash: nodeHash } = nd;\n\t\tconst nodeFwdLane = nodeLane.get(nodeHash) ?? 0;\n\t\tactiveFwdLaneColours.add(nodeFwdLane % PALETTE_SIZE);\n\t\tconst sortedIncoming = [...arcsByTarget.get(nodeHash) ?? []].sort((a, b) => a.dirName.localeCompare(b.dirName));\n\t\tfor (const arc of sortedIncoming) {\n\t\t\tconst originLaneColour = (nodeLane.get(arc.from) ?? 0) % PALETTE_SIZE;\n\t\t\tconst occupied = new Set(activeFwdLaneColours);\n\t\t\tfor (const c of activeArcColours.values()) occupied.add(c);\n\t\t\toccupied.add(GREEN_PALETTE_IDX);\n\t\t\toccupied.add(originLaneColour);\n\t\t\tlet chosen = -1;\n\t\t\tfor (let ci = 0; ci < PALETTE_SIZE; ci++) if (!occupied.has(ci)) {\n\t\t\t\tchosen = ci;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (chosen === -1) {\n\t\t\t\tfor (let ci = 0; ci < PALETTE_SIZE; ci++) if (ci !== GREEN_PALETTE_IDX) {\n\t\t\t\t\tchosen = ci;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcolourLaneOf.set(arc.migrationHash, chosen === -1 ? 0 : chosen);\n\t\t\tactiveArcColours.set(arc.migrationHash, chosen === -1 ? 0 : chosen);\n\t\t}\n\t\tfor (const arc of arcsBySource.get(nodeHash) ?? []) activeArcColours.delete(arc.migrationHash);\n\t}\n\tconst routedBackArcs = skippingRollbacks.map((e) => ({\n\t\tedge: e,\n\t\tsourceIndex: displayIndex.get(e.from) ?? 0,\n\t\ttargetIndex: displayIndex.get(e.to) ?? 0,\n\t\tgeomLane: geomLaneOf.get(e.migrationHash) ?? numLanes,\n\t\tcolourLane: colourLaneOf.get(e.migrationHash) ?? 0,\n\t\tplaneLane: planeLaneOf.get(e.migrationHash) ?? numLanes\n\t}));\n\tconst backArcsBySource = /* @__PURE__ */ new Map();\n\tconst backArcsByTarget = /* @__PURE__ */ new Map();\n\tfor (const arc of routedBackArcs) {\n\t\tconst sb = backArcsBySource.get(arc.edge.from);\n\t\tif (sb) sb.push(arc);\n\t\telse backArcsBySource.set(arc.edge.from, [arc]);\n\t\tconst tb = backArcsByTarget.get(arc.edge.to);\n\t\tif (tb) tb.push(arc);\n\t\telse backArcsByTarget.set(arc.edge.to, [arc]);\n\t}\n\tconst adjacentBySource = /* @__PURE__ */ new Map();\n\tconst adjacentByTarget = /* @__PURE__ */ new Map();\n\tfor (const e of adjacentRollbacks) {\n\t\tconst b = adjacentBySource.get(e.from);\n\t\tif (b) b.push(e);\n\t\telse adjacentBySource.set(e.from, [e]);\n\t\tconst t = adjacentByTarget.get(e.to);\n\t\tif (t) t.push(e);\n\t\telse adjacentByTarget.set(e.to, [e]);\n\t}\n\tfor (const list of adjacentBySource.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tconst totalCols = (numLanes + numTargetGroups) * colsPerLane;\n\tconst fwdEdges = rowModel.edges.filter((e) => e.kind === \"forward\" && e.from !== e.to);\n\tconst selfEdges = rowModel.edges.filter((e) => e.kind === \"self\");\n\tconst outboundFwd = /* @__PURE__ */ new Map();\n\tconst inboundFwd = /* @__PURE__ */ new Map();\n\tfor (const e of fwdEdges) {\n\t\tconst ob = outboundFwd.get(e.from);\n\t\tif (ob) ob.push(e);\n\t\telse outboundFwd.set(e.from, [e]);\n\t\tconst ib = inboundFwd.get(e.to);\n\t\tif (ib) ib.push(e);\n\t\telse inboundFwd.set(e.to, [e]);\n\t}\n\tfor (const list of outboundFwd.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tfor (const list of inboundFwd.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tconst selfEdgesByNode = /* @__PURE__ */ new Map();\n\tfor (const e of selfEdges) {\n\t\tconst bucket = selfEdgesByNode.get(e.from);\n\t\tif (bucket) bucket.push(e);\n\t\telse selfEdgesByNode.set(e.from, [e]);\n\t}\n\tfor (const list of selfEdgesByNode.values()) list.sort((a, b) => a.dirName.localeCompare(b.dirName));\n\tfunction roleOf(migrationHash) {\n\t\tif (!isFocus) return void 0;\n\t\treturn highlight.onPath.has(migrationHash) ? \"on-path\" : \"off-path\";\n\t}\n\tconst onPathNodes = /* @__PURE__ */ new Set();\n\tif (isFocus) {\n\t\tfor (const e of [\n\t\t\t...fwdEdges,\n\t\t\t...selfEdges,\n\t\t\t...rollbackEdges\n\t\t]) if (highlight.onPath.has(e.migrationHash)) {\n\t\t\tonPathNodes.add(e.from);\n\t\t\tonPathNodes.add(e.to);\n\t\t}\n\t}\n\tfunction nodeRoleOf(hash) {\n\t\tif (!isFocus) return void 0;\n\t\treturn onPathNodes.has(hash) ? \"on-path\" : \"off-path\";\n\t}\n\tfunction planeOf(lane, role) {\n\t\tif (!isFocus) return lane;\n\t\treturn role === \"on-path\" ? 0 : lane + 1;\n\t}\n\tfunction lineRefFor(edge, lane) {\n\t\treturn {\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tdirName: edge.dirName,\n\t\t\tlane,\n\t\t\trole: roleOf(edge.migrationHash)\n\t\t};\n\t}\n\t/** Synthetic LineRef for a lane carrying a representative edge's role (pass-through). */\n\tfunction passLineRef(lane, dirName, migHash) {\n\t\treturn {\n\t\t\tmigrationHash: migHash,\n\t\t\tdirName,\n\t\t\tlane,\n\t\t\trole: roleOf(migHash)\n\t\t};\n\t}\n\tfunction vertCell(line) {\n\t\treturn { lines: [{\n\t\t\tline,\n\t\t\tdirections: /* @__PURE__ */ new Set([\"up\", \"down\"]),\n\t\t\tplane: planeOf(line.lane, line.role)\n\t\t}] };\n\t}\n\tfunction dirCell(line, dirs) {\n\t\treturn { lines: [{\n\t\t\tline,\n\t\t\tdirections: dirs,\n\t\t\tplane: planeOf(line.lane, line.role)\n\t\t}] };\n\t}\n\tfunction nodeCell(nodeRef) {\n\t\treturn {\n\t\t\tnode: nodeRef,\n\t\t\tlines: []\n\t\t};\n\t}\n\tconst laneCurrentEdge = /* @__PURE__ */ new Map();\n\tfunction getRepLine(lane) {\n\t\tconst e = laneCurrentEdge.get(lane);\n\t\tif (e) return lineRefFor(e, lane);\n\t\treturn passLineRef(lane, `lane${lane}`, `lane${lane}`);\n\t}\n\tconst activeLanes = /* @__PURE__ */ new Set();\n\tconst grid = [];\n\tfunction makeRow() {\n\t\treturn Array.from({ length: totalCols }, () => emptyCell());\n\t}\n\tfunction placeVerticals(row, skip) {\n\t\tfor (const lane of activeLanes) {\n\t\t\tif (skip.has(lane)) continue;\n\t\t\tconst railCol = lane * colsPerLane;\n\t\t\tconst cell = row[railCol];\n\t\t\tif (cell !== void 0 && cell.lines.length === 0 && !cell.node) row[railCol] = vertCell(getRepLine(lane));\n\t\t}\n\t}\n\tconst activeBackArcs = /* @__PURE__ */ new Set();\n\tfunction backArcLine(arc) {\n\t\treturn {\n\t\t\tmigrationHash: arc.edge.migrationHash,\n\t\t\tdirName: arc.edge.dirName,\n\t\t\tlane: arc.colourLane,\n\t\t\trole: roleOf(arc.edge.migrationHash)\n\t\t};\n\t}\n\tfunction backArcPlane(arc) {\n\t\tconst role = roleOf(arc.edge.migrationHash);\n\t\tif (!isFocus) return arc.planeLane;\n\t\treturn role === \"on-path\" ? 0 : arc.planeLane + 1;\n\t}\n\tfunction composeLine(row, col, line, dirs, plane, extra) {\n\t\tconst existing = row[col];\n\t\tconst cellLine = {\n\t\t\tline,\n\t\t\tdirections: dirs,\n\t\t\tplane,\n\t\t\t...extra?.landingArrow ? { landingArrow: true } : {}\n\t\t};\n\t\tif (existing && (existing.lines.length > 0 || existing.node)) row[col] = {\n\t\t\t...existing,\n\t\t\tlines: [...existing.lines, cellLine]\n\t\t};\n\t\telse row[col] = { lines: [cellLine] };\n\t}\n\tfunction placeBackVerticals(row) {\n\t\tfor (const arc of activeBackArcs) composeLine(row, arc.geomLane * colsPerLane, backArcLine(arc), /* @__PURE__ */ new Set([\"up\", \"down\"]), backArcPlane(arc));\n\t\tplaceAdjacentOverlays(row);\n\t}\n\tconst activeAdjacent = /* @__PURE__ */ new Set();\n\tfunction placeAdjacentOverlays(row) {\n\t\tfor (const adj of activeAdjacent) {\n\t\t\tconst railCol = adj.lane * colsPerLane;\n\t\t\tif (row[railCol]?.node) continue;\n\t\t\tconst line = lineRefFor(adj.edge, adj.lane);\n\t\t\tcomposeLine(row, railCol, line, /* @__PURE__ */ new Set([\"up\", \"down\"]), planeOf(adj.lane, line.role));\n\t\t}\n\t}\n\tfunction emitBackArcTee(row, nodeLaneNum, arc) {\n\t\tconst nodeRail = nodeLaneNum * colsPerLane;\n\t\tconst geomRail = arc.geomLane * colsPerLane;\n\t\tconst line = backArcLine(arc);\n\t\tconst plane = backArcPlane(arc);\n\t\tfor (let col = nodeRail + 1; col < geomRail; col++) composeLine(row, col, line, /* @__PURE__ */ new Set([\"left\", \"right\"]), plane);\n\t\tcomposeLine(row, geomRail, line, /* @__PURE__ */ new Set([\"down\", \"left\"]), plane);\n\t}\n\tfunction emitBackArcLanding(row, nodeLaneNum, arc) {\n\t\tconst nodeRail = nodeLaneNum * colsPerLane;\n\t\tconst geomRail = arc.geomLane * colsPerLane;\n\t\tconst line = backArcLine(arc);\n\t\tconst plane = backArcPlane(arc);\n\t\tcomposeLine(row, nodeRail + 1, line, /* @__PURE__ */ new Set([\"left\", \"right\"]), plane, { landingArrow: true });\n\t\tfor (let col = nodeRail + 2; col < geomRail; col++) composeLine(row, col, line, /* @__PURE__ */ new Set([\"left\", \"right\"]), plane);\n\t\tcomposeLine(row, geomRail, line, /* @__PURE__ */ new Set([\"up\", \"left\"]), plane);\n\t}\n\tfunction emitConnectorRow(trunkLane, branchEntries, connectorType, trunkEdge) {\n\t\tconst row = makeRow();\n\t\tconst sorted = [...branchEntries].sort((a, b) => a.lane - b.lane);\n\t\tif (sorted.length === 0) return row;\n\t\tconst branchByLane = /* @__PURE__ */ new Map();\n\t\tfor (const b of sorted) branchByLane.set(b.lane, b.edge);\n\t\tlet continuousLane = trunkLane;\n\t\tif (isFocus) if (trunkEdge && highlight.onPath.has(trunkEdge.migrationHash)) continuousLane = trunkLane;\n\t\telse {\n\t\t\tconst onPathBranch = sorted.find((b) => highlight.onPath.has(b.edge.migrationHash));\n\t\t\tif (onPathBranch) continuousLane = onPathBranch.lane;\n\t\t}\n\t\tconst trunkRailCol = trunkLane * colsPerLane;\n\t\tconst continuousRailCol = continuousLane * colsPerLane;\n\t\tfunction addLine(col, line, dirs) {\n\t\t\tconst existing = row[col];\n\t\t\tconst cellLine = {\n\t\t\t\tline,\n\t\t\t\tdirections: dirs,\n\t\t\t\tplane: planeOf(line.lane, line.role)\n\t\t\t};\n\t\t\trow[col] = existing && existing.lines.length > 0 ? {\n\t\t\t\t...existing,\n\t\t\t\tlines: [...existing.lines, cellLine]\n\t\t\t} : { lines: [cellLine] };\n\t\t}\n\t\tconst cornerLeftDown = connectorType === \"merge\" ? /* @__PURE__ */ new Set([\"left\", \"down\"]) : /* @__PURE__ */ new Set([\"left\", \"up\"]);\n\t\tfor (let i = 0; i < sorted.length; i++) {\n\t\t\tconst b = sorted[i];\n\t\t\tif (b.lane === continuousLane) continue;\n\t\t\tconst branchLine = lineRefFor(b.edge, b.lane);\n\t\t\tconst railCol = b.lane * colsPerLane;\n\t\t\taddLine(railCol, branchLine, cornerLeftDown);\n\t\t\tconst leftBound = i === 0 ? trunkRailCol + 1 : sorted[i - 1].lane * colsPerLane + 1;\n\t\t\tfor (let col = leftBound; col < railCol; col++) addLine(col, branchLine, /* @__PURE__ */ new Set([\"left\", \"right\"]));\n\t\t}\n\t\tconst continuousLine = continuousLane === trunkLane ? trunkEdge ? lineRefFor(trunkEdge, trunkLane) : getRepLine(trunkLane) : lineRefFor(branchByLane.get(continuousLane), continuousLane);\n\t\tif (continuousLane === trunkLane) addLine(trunkRailCol, continuousLine, /* @__PURE__ */ new Set([\"up\", \"down\"]));\n\t\telse {\n\t\t\taddLine(trunkRailCol, continuousLine, connectorType === \"merge\" ? /* @__PURE__ */ new Set([\"up\", \"right\"]) : /* @__PURE__ */ new Set([\"down\", \"right\"]));\n\t\t\tfor (let col = trunkRailCol + 1; col < continuousRailCol; col++) addLine(col, continuousLine, /* @__PURE__ */ new Set([\"left\", \"right\"]));\n\t\t\taddLine(continuousRailCol, continuousLine, cornerLeftDown);\n\t\t}\n\t\tplaceVerticals(row, /* @__PURE__ */ new Set([trunkLane, ...sorted.map((b) => b.lane)]));\n\t\tplaceBackVerticals(row);\n\t\treturn row;\n\t}\n\tfor (const nodeDisplay of displayOrder) {\n\t\tif (nodeDisplay === null) {\n\t\t\tconst sepRow = makeRow();\n\t\t\tsepRow[0] = {\n\t\t\t\tlines: [],\n\t\t\t\tseparator: true\n\t\t\t};\n\t\t\tgrid.push(sepRow);\n\t\t\tcontinue;\n\t\t}\n\t\tconst { hash: nodeHash } = nodeDisplay;\n\t\tconst nodeLaneNum = nodeLane.get(nodeHash) ?? 0;\n\t\tactiveLanes.add(nodeLaneNum);\n\t\tconst outEdges = outboundFwd.get(nodeHash) ?? [];\n\t\tif (outEdges.length > 1) {\n\t\t\tconst trunkEdgeForFork = outEdges[0];\n\t\t\tconst trunkChildLane = edgeLane.get(trunkEdgeForFork.migrationHash) ?? nodeLane.get(trunkEdgeForFork.to) ?? nodeLaneNum;\n\t\t\tconst branchEntries = outEdges.slice(1).map((e) => ({\n\t\t\t\tlane: edgeLane.get(e.migrationHash) ?? nodeLane.get(e.to) ?? 0,\n\t\t\t\tedge: e\n\t\t\t})).filter((b) => b.lane !== trunkChildLane && activeLanes.has(b.lane));\n\t\t\tif (branchEntries.length > 0) {\n\t\t\t\tconst trunkEdge = outEdges[0];\n\t\t\t\tconst connRow = emitConnectorRow(nodeLaneNum, branchEntries, \"fork\", trunkEdge);\n\t\t\t\tgrid.push(connRow);\n\t\t\t\tassertSingleOwner(connRow, isFocus);\n\t\t\t\tfor (const b of branchEntries) activeLanes.delete(b.lane);\n\t\t\t}\n\t\t}\n\t\tconst selfMigrations = selfEdgesByNode.get(nodeHash) ?? [];\n\t\tfor (const selfEdge of selfMigrations) {\n\t\t\tconst row = makeRow();\n\t\t\tconst railCol = nodeLaneNum * colsPerLane;\n\t\t\tconst connCol = nodeLaneNum * colsPerLane + 1;\n\t\t\tconst line = lineRefFor(selfEdge, nodeLaneNum);\n\t\t\trow[railCol] = vertCell(line);\n\t\t\trow[connCol] = { lines: [{\n\t\t\t\tline,\n\t\t\t\tdirections: /* @__PURE__ */ new Set(),\n\t\t\t\tplane: planeOf(nodeLaneNum, line.role),\n\t\t\t\tselfLoop: true\n\t\t\t}] };\n\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set([nodeLaneNum]));\n\t\t\tplaceBackVerticals(row);\n\t\t\tgrid.push(row);\n\t\t}\n\t\t{\n\t\t\tconst row = makeRow();\n\t\t\tconst railCol = nodeLaneNum * colsPerLane;\n\t\t\trow[railCol] = nodeCell({\n\t\t\t\tcontractHash: nodeHash,\n\t\t\t\tisEmpty: nodeHash === EMPTY_CONTRACT_HASH,\n\t\t\t\tlane: nodeLaneNum,\n\t\t\t\trole: nodeRoleOf(nodeHash)\n\t\t\t});\n\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set([nodeLaneNum]));\n\t\t\tconst landingArcs = backArcsByTarget.get(nodeHash) ?? [];\n\t\t\tfor (const arc of landingArcs) activeBackArcs.delete(arc);\n\t\t\tfor (const adj of [...activeAdjacent]) if (adj.edge.to === nodeHash) activeAdjacent.delete(adj);\n\t\t\tplaceBackVerticals(row);\n\t\t\tfor (const arc of landingArcs) emitBackArcLanding(row, nodeLaneNum, arc);\n\t\t\tconst teeArcs = backArcsBySource.get(nodeHash) ?? [];\n\t\t\tfor (const arc of teeArcs) emitBackArcTee(row, nodeLaneNum, arc);\n\t\t\tgrid.push(row);\n\t\t\tfor (const arc of teeArcs) activeBackArcs.add(arc);\n\t\t\tfor (const adj of adjacentBySource.get(nodeHash) ?? []) activeAdjacent.add({\n\t\t\t\tlane: nodeLaneNum,\n\t\t\t\tedge: adj\n\t\t\t});\n\t\t}\n\t\tfunction edgeLaneFor(edge) {\n\t\t\tconst override = edgeLane.get(edge.migrationHash);\n\t\t\tif (override !== void 0) return override;\n\t\t\treturn Math.max(nodeLane.get(edge.from) ?? 0, nodeLane.get(edge.to) ?? 0);\n\t\t}\n\t\tconst inEdges = inboundFwd.get(nodeHash) ?? [];\n\t\tinEdges.sort((a, b) => {\n\t\t\tconst aLane = edgeLaneFor(a);\n\t\t\tconst bLane = edgeLaneFor(b);\n\t\t\tif (aLane !== bLane) return aLane - bLane;\n\t\t\treturn a.dirName.localeCompare(b.dirName);\n\t\t});\n\t\tfor (const edge of inEdges) laneCurrentEdge.set(edgeLaneFor(edge), edge);\n\t\t{\n\t\t\tconst teeArcs = backArcsBySource.get(nodeHash) ?? [];\n\t\t\tfor (const arc of teeArcs) {\n\t\t\t\tconst row = makeRow();\n\t\t\t\tconst railCol = arc.geomLane * colsPerLane;\n\t\t\t\tconst connCol = railCol + 1;\n\t\t\t\tconst line = backArcLine(arc);\n\t\t\t\tconst plane = backArcPlane(arc);\n\t\t\t\tcomposeLine(row, railCol, line, /* @__PURE__ */ new Set([\"up\", \"down\"]), plane);\n\t\t\t\tcomposeLine(row, connCol, line, /* @__PURE__ */ new Set([\"down\"]), plane);\n\t\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set());\n\t\t\t\tplaceBackVerticals(row);\n\t\t\t\tgrid.push(row);\n\t\t\t}\n\t\t}\n\t\tif (inEdges.length > 1) {\n\t\t\tconst branchEntries = inEdges.slice(1).map((e) => ({\n\t\t\t\tlane: edgeLaneFor(e),\n\t\t\t\tedge: e\n\t\t\t}));\n\t\t\tconst trunkEdge = inEdges[0];\n\t\t\tconst connRow = emitConnectorRow(nodeLaneNum, branchEntries, \"merge\", trunkEdge);\n\t\t\tgrid.push(connRow);\n\t\t\tassertSingleOwner(connRow, isFocus);\n\t\t\tfor (const b of branchEntries) activeLanes.add(b.lane);\n\t\t}\n\t\tfor (const edge of inEdges) {\n\t\t\tconst eLane = edgeLaneFor(edge);\n\t\t\tconst row = makeRow();\n\t\t\tconst railCol = eLane * colsPerLane;\n\t\t\tconst connCol = eLane * colsPerLane + 1;\n\t\t\tconst line = lineRefFor(edge, eLane);\n\t\t\trow[railCol] = vertCell(line);\n\t\t\trow[connCol] = dirCell(line, /* @__PURE__ */ new Set([\"up\"]));\n\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set([eLane]));\n\t\t\tplaceBackVerticals(row);\n\t\t\tgrid.push(row);\n\t\t}\n\t\t{\n\t\t\tconst adjacents = adjacentBySource.get(nodeHash) ?? [];\n\t\t\tfor (const adj of adjacents) {\n\t\t\t\tconst row = makeRow();\n\t\t\t\tconst connCol = nodeLaneNum * colsPerLane + 1;\n\t\t\t\tconst line = lineRefFor(adj, nodeLaneNum);\n\t\t\t\tconst plane = planeOf(nodeLaneNum, line.role);\n\t\t\t\tcomposeLine(row, connCol, line, /* @__PURE__ */ new Set([\"down\"]), plane);\n\t\t\t\tplaceVerticals(row, /* @__PURE__ */ new Set());\n\t\t\t\tplaceBackVerticals(row);\n\t\t\t\tgrid.push(row);\n\t\t\t}\n\t\t}\n\t\tif (inEdges.length === 0) activeLanes.delete(nodeLaneNum);\n\t}\n\treturn grid;\n}\nfunction assertSingleOwner(row, isFocus) {\n\tfor (const cell of row) {\n\t\tif (cell.lines.length <= 1) continue;\n\t\tlet topPlane = Number.POSITIVE_INFINITY;\n\t\tfor (const cl of cell.lines) if (cl.plane < topPlane) topPlane = cl.plane;\n\t\tconst top = cell.lines.filter((cl) => cl.plane === topPlane);\n\t\tif (top.length > 1) {\n\t\t\tif (isFocus) {\n\t\t\t\tif (new Set(top.map((cl) => cl.line.role)).size > 1) throw new InternalError(\"migration-graph layout: single-owner invariant violated — two differently-roled lines share the top plane in one cell\");\n\t\t\t}\n\t\t}\n\t}\n}\n//#endregion\n//#region src/utils/formatters/migration-list-graph-topology.ts\nfunction compareDirNameDesc(a, b) {\n\treturn b.dirName.localeCompare(a.dirName);\n}\nfunction bumpDegree(map, key) {\n\tmap.set(key, (map.get(key) ?? 0) + 1);\n}\nfunction compareNodesRootFirst(a, b) {\n\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\treturn a.localeCompare(b);\n}\n/**\n* Shortest-path distance of each node from the forward roots, over the given\n* candidate edges. Roots are the in-degree-0 nodes (baseline first, then lex);\n* a rooted component therefore distances every node by how many forward steps\n* it sits from a root. A component with no root (a pure cycle) is seeded from\n* its single lexically-smallest node so the cycle still gets a stable layering.\n*\n* Crucially this is *shortest* path, not longest: a backward (rollback) edge\n* `deep → shallow` never offers a shorter route to the already-shallower\n* target, so it is inert here. Distances are thus stable whether or not the\n* rollbacks are still in the candidate set — which is what lets the peel below\n* tell a genuine back-edge (target strictly shallower than source) apart from a\n* forward edge that merely happens to share the back-edge's cycle.\n*/\nfunction forwardDistances(nodes, candidates) {\n\tconst inDegree = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) inDegree.set(node, 0);\n\tfor (const edge of candidates) bumpDegree(inDegree, edge.to);\n\tconst roots = [...nodes].filter((node) => (inDegree.get(node) ?? 0) === 0);\n\troots.sort(compareNodesRootFirst);\n\tconst seeds = roots.length > 0 ? roots : [...nodes].sort(compareNodesRootFirst).slice(0, 1);\n\tconst dist = /* @__PURE__ */ new Map();\n\tfor (const seed of seeds) dist.set(seed, 0);\n\tconst maxPasses = nodes.size;\n\tfor (let pass = 0; pass < maxPasses; pass++) {\n\t\tlet changed = false;\n\t\tfor (const edge of candidates) {\n\t\t\tconst base = dist.get(edge.from);\n\t\t\tif (base === void 0) continue;\n\t\t\tconst next = base + 1;\n\t\t\tif (next < (dist.get(edge.to) ?? Number.POSITIVE_INFINITY)) {\n\t\t\t\tdist.set(edge.to, next);\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}\n\t\tif (!changed) break;\n\t}\n\tfor (const node of nodes) if (!dist.has(node)) dist.set(node, 0);\n\treturn dist;\n}\nfunction canReachForward(start, goal, candidates) {\n\tif (start === goal) return true;\n\tconst outgoing = /* @__PURE__ */ new Map();\n\tfor (const edge of candidates) {\n\t\tconst bucket = outgoing.get(edge.from);\n\t\tif (bucket) bucket.push(edge.to);\n\t\telse outgoing.set(edge.from, [edge.to]);\n\t}\n\tconst visited = /* @__PURE__ */ new Set([start]);\n\tconst queue = [start];\n\twhile (queue.length > 0) {\n\t\tconst node = queue.shift();\n\t\tif (node === void 0) continue;\n\t\tfor (const next of outgoing.get(node) ?? []) {\n\t\t\tif (next === goal) return true;\n\t\t\tif (!visited.has(next)) {\n\t\t\t\tvisited.add(next);\n\t\t\t\tqueue.push(next);\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n/**\n* Demote node-skipping rollbacks left forward by the DFS. An edge `from → to`\n* is a rollback exactly when both hold:\n* 1. `to` is a forward-ancestor of `from` — `to` can still reach `from` over\n* the other forward edges, so the edge closes a cycle; and\n* 2. `to` is strictly shallower than `from` (smaller forward distance) — the\n* edge points back toward the root rather than advancing history.\n*\n* Condition 2 is the discriminator: in a cycle created by a rollback every edge\n* satisfies condition 1, but only the rollback itself runs deep → shallow. The\n* forward chain edges run shallow → deep and are never peeled, however many\n* rollbacks converge on the same target. Tight back-edges whose source and\n* target sit at the same distance (mutual two-node cycles) are already resolved\n* by the DFS immediate-parent rule, so they never reach this pass. One edge is\n* peeled per iteration (dirName-descending tie-break) and distances/reachability\n* are recomputed, making the outcome independent of edge input order.\n*/\nfunction peelNodeSkippingRollbacks(nodes, kindByMigrationHash, nonSelf) {\n\tlet candidates = nonSelf.filter((edge) => kindByMigrationHash.get(edge.hash) === \"forward\");\n\twhile (candidates.length > 0) {\n\t\tconst dist = forwardDistances(nodes, candidates);\n\t\tconst backEdges = candidates.filter((edge) => {\n\t\t\tif ((dist.get(edge.to) ?? 0) >= (dist.get(edge.from) ?? 0)) return false;\n\t\t\tconst without = candidates.filter((candidate) => candidate !== edge);\n\t\t\treturn canReachForward(edge.to, edge.from, without);\n\t\t});\n\t\tif (backEdges.length === 0) break;\n\t\tbackEdges.sort(compareDirNameDesc);\n\t\tconst rollback = backEdges[0];\n\t\tif (rollback === void 0) break;\n\t\tkindByMigrationHash.set(rollback.hash, \"rollback\");\n\t\tcandidates = candidates.filter((edge) => edge !== rollback);\n\t}\n}\n/**\n* DFS with dirName-descending traversal. A GRAY target is a rollback only when it\n* is the immediate DFS parent of the source — cross-links to other GRAY nodes\n* stay forward. A follow-up peel pass demotes node-skipping rollbacks (target is\n* a forward-ancestor of the source and sits strictly shallower than it).\n*/\nfunction classifyNormalizedEdges(edges) {\n\tconst nodes = /* @__PURE__ */ new Set();\n\tconst kindByMigrationHash = /* @__PURE__ */ new Map();\n\tconst outgoingByFrom = /* @__PURE__ */ new Map();\n\tconst nonSelf = [];\n\tfor (const edge of edges) {\n\t\tnodes.add(edge.from);\n\t\tnodes.add(edge.to);\n\t\tif (edge.from === edge.to) {\n\t\t\tkindByMigrationHash.set(edge.hash, \"self\");\n\t\t\tcontinue;\n\t\t}\n\t\tnonSelf.push(edge);\n\t\tconst bucket = outgoingByFrom.get(edge.from);\n\t\tif (bucket) bucket.push(edge);\n\t\telse outgoingByFrom.set(edge.from, [edge]);\n\t}\n\tfor (const bucket of outgoingByFrom.values()) bucket.sort(compareDirNameDesc);\n\tconst nonSelfInDegree = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) nonSelfInDegree.set(node, 0);\n\tfor (const bucket of outgoingByFrom.values()) for (const edge of bucket) bumpDegree(nonSelfInDegree, edge.to);\n\tconst dfsRoots = [];\n\tfor (const node of nodes) if ((nonSelfInDegree.get(node) ?? 0) === 0) dfsRoots.push(node);\n\tdfsRoots.sort((a, b) => {\n\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\treturn a.localeCompare(b);\n\t});\n\tif (dfsRoots.length === 0) dfsRoots.push(...[...nodes].sort((a, b) => a.localeCompare(b)));\n\tconst WHITE = 0;\n\tconst GRAY = 1;\n\tconst BLACK = 2;\n\tconst color = /* @__PURE__ */ new Map();\n\tconst dfsParent = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) color.set(node, WHITE);\n\tconst stack = [];\n\tfunction isImmediateDfsParent(ancestor, node) {\n\t\treturn dfsParent.get(node) === ancestor;\n\t}\n\tfunction pushFrame(node, parent) {\n\t\tcolor.set(node, GRAY);\n\t\tdfsParent.set(node, parent);\n\t\tstack.push({\n\t\t\tnode,\n\t\t\toutgoing: outgoingByFrom.get(node) ?? [],\n\t\t\tindex: 0\n\t\t});\n\t}\n\tfunction runDfsFrom(root) {\n\t\tif (color.get(root) !== WHITE) return;\n\t\tpushFrame(root, void 0);\n\t\twhile (stack.length > 0) {\n\t\t\tconst frame = stack[stack.length - 1];\n\t\t\tif (frame === void 0) break;\n\t\t\tif (frame.index >= frame.outgoing.length) {\n\t\t\t\tcolor.set(frame.node, BLACK);\n\t\t\t\tstack.pop();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst edge = frame.outgoing[frame.index];\n\t\t\tframe.index += 1;\n\t\t\tif (edge === void 0) continue;\n\t\t\tconst v = edge.to;\n\t\t\tconst vColor = color.get(v);\n\t\t\tif (vColor === GRAY && isImmediateDfsParent(v, frame.node)) kindByMigrationHash.set(edge.hash, \"rollback\");\n\t\t\telse {\n\t\t\t\tkindByMigrationHash.set(edge.hash, \"forward\");\n\t\t\t\tif (vColor === WHITE) pushFrame(v, frame.node);\n\t\t\t}\n\t\t}\n\t}\n\tfor (const root of dfsRoots) runDfsFrom(root);\n\tconst remainingWhite = [...nodes].filter((node) => color.get(node) === WHITE);\n\tremainingWhite.sort((a, b) => a.localeCompare(b));\n\tfor (const root of remainingWhite) runDfsFrom(root);\n\tpeelNodeSkippingRollbacks(nodes, kindByMigrationHash, nonSelf);\n\tconst forwardInDegree = /* @__PURE__ */ new Map();\n\tconst forwardOutDegree = /* @__PURE__ */ new Map();\n\tfor (const edge of edges) {\n\t\tif (kindByMigrationHash.get(edge.hash) !== \"forward\") continue;\n\t\tbumpDegree(forwardOutDegree, edge.from);\n\t\tbumpDegree(forwardInDegree, edge.to);\n\t}\n\treturn {\n\t\tkindByMigrationHash,\n\t\tforwardInDegree,\n\t\tforwardOutDegree\n\t};\n}\n/**\n* Classify forward/rollback/self for a `MigrationGraph` edge set (Tier-3).\n*/\nfunction classifyMigrationGraphTopology(graph) {\n\tconst normalized = [];\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) normalized.push({\n\t\thash: edge.migrationHash,\n\t\tfrom: edge.from,\n\t\tto: edge.to,\n\t\tdirName: edge.dirName\n\t});\n\treturn classifyNormalizedEdges(normalized);\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-rows.ts\n/**\n* Return the weakly-connected components of `graph` as an array of node sets,\n* ordered so the component containing EMPTY_CONTRACT_HASH comes first (if\n* present), with remaining components sorted by their lex-smallest node hash.\n*/\nfunction weaklyConnectedComponents(graph) {\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst adjacency = /* @__PURE__ */ new Map();\n\tfunction addAdjacent(a, b) {\n\t\tconst aList = adjacency.get(a);\n\t\tif (aList) aList.push(b);\n\t\telse adjacency.set(a, [b]);\n\t\tconst bList = adjacency.get(b);\n\t\tif (bList) bList.push(a);\n\t\telse adjacency.set(b, [a]);\n\t}\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) if (edge.from !== edge.to) addAdjacent(edge.from, edge.to);\n\tfor (const node of graph.nodes) if (!adjacency.has(node)) adjacency.set(node, []);\n\tconst components = [];\n\tfunction bfsComponent(start) {\n\t\tconst component = /* @__PURE__ */ new Set();\n\t\tconst queue = [start];\n\t\twhile (queue.length > 0) {\n\t\t\tconst node = queue.shift();\n\t\t\tif (node === void 0 || visited.has(node)) continue;\n\t\t\tvisited.add(node);\n\t\t\tcomponent.add(node);\n\t\t\tfor (const neighbor of adjacency.get(node) ?? []) if (!visited.has(neighbor)) queue.push(neighbor);\n\t\t}\n\t\treturn component;\n\t}\n\tconst allNodes = [...graph.nodes].sort((a, b) => {\n\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\treturn a.localeCompare(b);\n\t});\n\tfor (const node of allNodes) if (!visited.has(node)) components.push(bfsComponent(node));\n\tcomponents.sort((a, b) => {\n\t\tconst aHasEmpty = a.has(EMPTY_CONTRACT_HASH);\n\t\tconst bHasEmpty = b.has(EMPTY_CONTRACT_HASH);\n\t\tif (aHasEmpty && !bHasEmpty) return -1;\n\t\tif (!aHasEmpty && bHasEmpty) return 1;\n\t\tconst aMin = [...a].sort((x, y) => x.localeCompare(y))[0] ?? \"\";\n\t\tconst bMin = [...b].sort((x, y) => x.localeCompare(y))[0] ?? \"\";\n\t\treturn aMin.localeCompare(bMin);\n\t});\n\treturn components;\n}\nfunction forwardRootsInComponent(componentNodes, topology) {\n\tconst roots = [];\n\tfor (const node of componentNodes) if ((topology.forwardInDegree.get(node) ?? 0) === 0) roots.push(node);\n\troots.sort((a, b) => {\n\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\treturn a.localeCompare(b);\n\t});\n\tif (roots.length > 0) return roots;\n\treturn [...componentNodes].sort((a, b) => {\n\t\tif (a === EMPTY_CONTRACT_HASH) return -1;\n\t\tif (b === EMPTY_CONTRACT_HASH) return 1;\n\t\treturn a.localeCompare(b);\n\t});\n}\nfunction compareNodesTipsFirst(a, b, rank) {\n\tconst rankA = rank.get(a) ?? 0;\n\tconst rankB = rank.get(b) ?? 0;\n\tif (rankA !== rankB) return rankB - rankA;\n\tif (a === EMPTY_CONTRACT_HASH) return 1;\n\tif (b === EMPTY_CONTRACT_HASH) return -1;\n\treturn a.localeCompare(b);\n}\n/**\n* Layer nodes by longest forward-path rank from forward roots within the\n* component. Rank 0 is the root (bottom row); the maximum rank is the tip\n* (top row). Emits rank-descending with lex-ascending tie-break among siblings\n* at the same rank — stable across edge-insertion order and correct under\n* diamonds, cross-links, and rollbacks.\n*/\nfunction maxRank(rank) {\n\tlet max = 0;\n\tfor (const value of rank.values()) if (value > max) max = value;\n\treturn max;\n}\nfunction layerNodesByLongestForwardPath(componentNodes, topology, graph, contractHash) {\n\tconst forwardOut = /* @__PURE__ */ new Map();\n\tfor (const node of componentNodes) forwardOut.set(node, []);\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) {\n\t\tif (!componentNodes.has(edge.from) || !componentNodes.has(edge.to)) continue;\n\t\tif (edge.from === edge.to) continue;\n\t\tif (topology.kindByMigrationHash.get(edge.migrationHash) !== \"forward\") continue;\n\t\tconst bucket = forwardOut.get(edge.from);\n\t\tif (bucket) bucket.push(edge.to);\n\t}\n\tconst roots = forwardRootsInComponent(componentNodes, topology);\n\tconst rank = /* @__PURE__ */ new Map();\n\tfor (const root of roots) rank.set(root, 0);\n\tconst maxPasses = componentNodes.size;\n\tfor (let pass = 0; pass < maxPasses; pass++) {\n\t\tlet changed = false;\n\t\tfor (const node of componentNodes) {\n\t\t\tconst base = rank.get(node);\n\t\t\tif (base === void 0) continue;\n\t\t\tfor (const to of forwardOut.get(node) ?? []) {\n\t\t\t\tconst next = base + 1;\n\t\t\t\tif (next > (rank.get(to) ?? -1)) {\n\t\t\t\t\trank.set(to, next);\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!changed) break;\n\t}\n\tfor (const node of componentNodes) if (!rank.has(node)) rank.set(node, 0);\n\tif (contractHash !== void 0 && contractHash !== EMPTY_CONTRACT_HASH && componentNodes.has(contractHash) && (forwardOut.get(contractHash) ?? []).length === 0) rank.set(contractHash, maxRank(rank) + 1);\n\treturn [...componentNodes].sort((a, b) => compareNodesTipsFirst(a, b, rank));\n}\n/**\n* Build the row model from a tolerant `MigrationGraph`.\n*\n* The row model is the first pure-data stage of the `migration graph` render\n* pipeline. It:\n* - classifies every edge as `forward`, `rollback`, or `self`;\n* - produces a deterministic vertical node ordering (tips at index 0, roots\n* at the end) within each weakly-connected component;\n* - separates disjoint components with `null` sentinels;\n* - optionally prepends a detached current contract as its own single-node\n* component when `contractHash` is not already in the graph.\n*\n* No columns, no lane allocation, no glyphs, no rendering.\n*/\n/**\n* Resolve the detached current contract, if any: a real contract (not the\n* empty baseline) that no migration on disk produces, so it is absent from\n* the graph. Such a contract renders as a floating node rather than\n* decorating an existing one. Returns the hash when detached, else undefined.\n*/\nfunction detachedContractHash(graph, contractHash) {\n\treturn contractHash !== void 0 && contractHash !== EMPTY_CONTRACT_HASH && !graph.nodes.has(contractHash) ? contractHash : void 0;\n}\nfunction isForwardLeaf(node, edges) {\n\treturn !edges.some((e) => e.kind === \"forward\" && e.from === node && e.from !== e.to);\n}\nfunction forwardReachableFrom(start, forwardTo) {\n\tconst reachable = /* @__PURE__ */ new Set([start]);\n\tconst queue = [start];\n\twhile (queue.length > 0) {\n\t\tconst node = queue.shift();\n\t\tif (node === void 0) continue;\n\t\tfor (const next of forwardTo.get(node) ?? []) if (!reachable.has(next)) {\n\t\t\treachable.add(next);\n\t\t\tqueue.push(next);\n\t\t}\n\t}\n\treturn reachable;\n}\nfunction buildForwardToMap(edges) {\n\tconst forwardTo = /* @__PURE__ */ new Map();\n\tfor (const edge of edges) {\n\t\tif (edge.kind !== \"forward\" || edge.from === edge.to) continue;\n\t\tconst bucket = forwardTo.get(edge.from);\n\t\tif (bucket) bucket.push(edge.to);\n\t\telse forwardTo.set(edge.from, [edge.to]);\n\t}\n\treturn forwardTo;\n}\nfunction sortEdgesForContractHashTrunk(edges, contractHash) {\n\tif (contractHash === void 0 || contractHash === EMPTY_CONTRACT_HASH || !isForwardLeaf(contractHash, edges)) return edges;\n\tconst preferredLeaf = contractHash;\n\tconst forwardTo = buildForwardToMap(edges);\n\tconst reachability = /* @__PURE__ */ new Map();\n\tfunction canReachContractHash(from) {\n\t\tlet cached = reachability.get(from);\n\t\tif (cached === void 0) {\n\t\t\tcached = forwardReachableFrom(from, forwardTo);\n\t\t\treachability.set(from, cached);\n\t\t}\n\t\treturn cached.has(preferredLeaf);\n\t}\n\tfunction trunkBias(edge) {\n\t\tif (edge.kind !== \"forward\" || edge.from === edge.to) return 0;\n\t\tif (edge.to === preferredLeaf) return 2;\n\t\tif (canReachContractHash(edge.to)) return 1;\n\t\treturn 0;\n\t}\n\treturn edges.map((edge, index) => ({\n\t\tedge,\n\t\tindex,\n\t\tbias: trunkBias(edge)\n\t})).sort((a, b) => {\n\t\tif (a.edge.from !== b.edge.from) return a.index - b.index;\n\t\tif (a.bias !== b.bias) return b.bias - a.bias;\n\t\treturn a.index - b.index;\n\t}).map(({ edge }) => edge);\n}\nfunction rebuildEdgeLookupMaps(edges) {\n\tconst edgesByFrom = /* @__PURE__ */ new Map();\n\tconst edgesByTo = /* @__PURE__ */ new Map();\n\tfor (const classified of edges) {\n\t\tconst fromBucket = edgesByFrom.get(classified.from);\n\t\tif (fromBucket) fromBucket.push(classified);\n\t\telse edgesByFrom.set(classified.from, [classified]);\n\t\tconst toBucket = edgesByTo.get(classified.to);\n\t\tif (toBucket) toBucket.push(classified);\n\t\telse edgesByTo.set(classified.to, [classified]);\n\t}\n\treturn {\n\t\tedgesByFrom,\n\t\tedgesByTo\n\t};\n}\nfunction buildMigrationGraphRows(graph, options = {}) {\n\tconst emptyModel = {\n\t\tnodes: [],\n\t\tedges: [],\n\t\tedgesByFrom: /* @__PURE__ */ new Map(),\n\t\tedgesByTo: /* @__PURE__ */ new Map()\n\t};\n\tif (graph.nodes.size === 0) {\n\t\tconst detached = detachedContractHash(graph, options.contractHash);\n\t\treturn detached !== void 0 ? {\n\t\t\t...emptyModel,\n\t\t\tnodes: [detached]\n\t\t} : emptyModel;\n\t}\n\tconst topology = classifyMigrationGraphTopology(graph);\n\tconst edges = [];\n\tfor (const edgeList of graph.forwardChain.values()) for (const edge of edgeList) {\n\t\tconst kind = topology.kindByMigrationHash.get(edge.migrationHash) ?? \"forward\";\n\t\tedges.push({\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tfrom: edge.from,\n\t\t\tto: edge.to,\n\t\t\tdirName: edge.dirName,\n\t\t\tkind\n\t\t});\n\t}\n\tconst sortedEdges = sortEdgesForContractHashTrunk(edges, options.contractHash);\n\tconst { edgesByFrom, edgesByTo } = rebuildEdgeLookupMaps(sortedEdges);\n\tconst components = weaklyConnectedComponents(graph);\n\tconst nodes = [];\n\tfor (let i = 0; i < components.length; i++) {\n\t\tif (i > 0) nodes.push(null);\n\t\tconst component = components[i];\n\t\tif (component === void 0) continue;\n\t\tconst ordered = layerNodesByLongestForwardPath(component, topology, graph, options.contractHash);\n\t\tfor (const node of ordered) nodes.push(node);\n\t}\n\tconst detached = detachedContractHash(graph, options.contractHash);\n\tif (detached !== void 0) {\n\t\tif (nodes.length > 0) nodes.unshift(null);\n\t\tnodes.unshift(detached);\n\t}\n\treturn {\n\t\tnodes,\n\t\tedges: sortedEdges,\n\t\tedgesByFrom,\n\t\tedgesByTo\n\t};\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-space-render.ts\nfunction mergeMigrationEdgeAnnotations(listOverlay, statusOverlay) {\n\tconst merged = /* @__PURE__ */ new Map();\n\tfor (const [migrationHash, listAnnotation] of listOverlay) {\n\t\tconst statusAnnotation = statusOverlay.get(migrationHash);\n\t\tmerged.set(migrationHash, {\n\t\t\t...listAnnotation,\n\t\t\t...statusAnnotation?.status !== void 0 ? { status: statusAnnotation.status } : {}\n\t\t});\n\t}\n\treturn merged;\n}\n/**\n* Translate `migrate --show` per-edge path-highlight annotations into a\n* {@link Highlight}. With any `pathHighlight` present the result is focus mode\n* (on-path lifted green, off-path dim); otherwise flat (lane-rotation colour).\n*/\nfunction highlightFromEdgeAnnotations(edgeAnnotationsByHash) {\n\tconst onPath = /* @__PURE__ */ new Set();\n\tlet anyPathHighlight = false;\n\tfor (const [migrationHash, annotation] of edgeAnnotationsByHash) {\n\t\tif (annotation.pathHighlight === void 0) continue;\n\t\tanyPathHighlight = true;\n\t\tif (annotation.pathHighlight === \"on-path\") onPath.add(migrationHash);\n\t}\n\treturn anyPathHighlight ? {\n\t\tmode: \"focus\",\n\t\tonPath\n\t} : {\n\t\tmode: \"flat\",\n\t\tonPath: /* @__PURE__ */ new Set()\n\t};\n}\nfunction buildGridForInput(input) {\n\tconst rowModel = buildMigrationGraphRows(input.graph, { contractHash: input.liveContractHash });\n\treturn {\n\t\tgrid: buildGrid(rowModel, {}, {\n\t\t\tmode: \"flat\",\n\t\t\tonPath: /* @__PURE__ */ new Set()\n\t\t}),\n\t\trowModel\n\t};\n}\n/**\n* The widest gutter→label column across the given space layouts. Cross-space\n* callers pass this back in so every section's labels share one column.\n*/\nfunction computeGlobalMaxEdgeTreePrefixWidth(inputs, glyphMode = \"unicode\") {\n\tlet globalMax = 0;\n\tfor (const input of inputs) {\n\t\tconst { grid } = buildGridForInput(input);\n\t\tglobalMax = Math.max(globalMax, computeLabelColumn(grid, glyphMode));\n\t}\n\treturn globalMax;\n}\nfunction computeGlobalMaxDirNameWidth(inputs) {\n\tlet globalMax = 0;\n\tfor (const input of inputs) {\n\t\tconst { rowModel } = buildGridForInput(input);\n\t\tglobalMax = Math.max(globalMax, computeMaxDirNameWidth(rowModel));\n\t}\n\treturn globalMax;\n}\nfunction renderMigrationGraphSpaceTreeInternal(input) {\n\tconst appSpace = input.isAppSpace !== false;\n\tconst rowModel = buildMigrationGraphRows(input.graph, { ...appSpace ? { contractHash: input.liveContractHash } : {} });\n\tconst listOverlay = buildEdgeAnnotationsByHashFromListEntries(input.migrations);\n\tconst edgeAnnotationsByHash = input.statusOverlayByHash === void 0 ? listOverlay : mergeMigrationEdgeAnnotations(listOverlay, input.statusOverlayByHash);\n\treturn renderMigrationGraphCommand({\n\t\tgrid: buildGrid(rowModel, {}, highlightFromEdgeAnnotations(edgeAnnotationsByHash)),\n\t\trowModel,\n\t\tcolorize: input.colorize,\n\t\tglyphMode: input.glyphMode,\n\t\tcontractHash: input.liveContractHash,\n\t\tisAppSpace: appSpace,\n\t\tedgeAnnotationsByHash,\n\t\trefsByHash: input.refsByHash ?? buildRefsByHashFromListEntries(input.migrations),\n\t\t...input.dbHash !== void 0 ? { dbHash: input.dbHash } : {},\n\t\t...input.styler !== void 0 ? { styler: input.styler } : {},\n\t\t...input.palette !== void 0 ? { palette: input.palette } : {},\n\t\t...input.globalMaxEdgeTreePrefixWidth !== void 0 ? { globalLabelColumn: input.globalMaxEdgeTreePrefixWidth } : {},\n\t\t...input.globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth: input.globalMaxDirNameWidth } : {}\n\t});\n}\nfunction renderMigrationGraphSpaceTree(input) {\n\treturn renderMigrationGraphSpaceTreeInternal(input);\n}\nfunction renderMigrationGraphSpaceTrees(inputs) {\n\tconst globalInputs = inputs.map((input) => ({\n\t\tgraph: input.graph,\n\t\tliveContractHash: input.liveContractHash\n\t}));\n\tconst glyphMode = inputs[0]?.glyphMode ?? \"unicode\";\n\tconst globalLabelColumn = inputs.length > 1 ? computeGlobalMaxEdgeTreePrefixWidth(globalInputs, glyphMode) : void 0;\n\tconst globalMaxDirName = inputs.length > 1 ? computeGlobalMaxDirNameWidth(globalInputs) : void 0;\n\treturn inputs.map((input) => renderMigrationGraphSpaceTreeInternal({\n\t\t...input,\n\t\t...globalLabelColumn !== void 0 ? { globalMaxEdgeTreePrefixWidth: globalLabelColumn } : {},\n\t\t...globalMaxDirName !== void 0 ? { globalMaxDirNameWidth: globalMaxDirName } : {}\n\t}));\n}\nfunction indentMigrationGraphTreeBlock(treeOutput, indent) {\n\tif (treeOutput.length === 0) return treeOutput;\n\treturn treeOutput.split(\"\\n\").map((line) => line.length === 0 ? line : `${indent}${line}`).join(\"\\n\");\n}\n//#endregion\n//#region src/utils/formatters/migration-list-render.ts\nconst IDENTITY_MIGRATION_LIST_STYLER = {\n\tkind: (text) => text,\n\tdirName: (text) => text,\n\tsourceHash: (text) => text,\n\tdestHash: (text) => text,\n\tglyph: (text) => text,\n\tlane: (text) => text,\n\tinvariants: (ids) => `{${ids.join(\", \")}}`,\n\trefs: (names) => `(${names.join(\", \")})`,\n\tspaceHeading: (text) => text,\n\tsummary: (text) => text,\n\temptyState: (text) => text\n};\nfunction canonicalFrom(from) {\n\treturn from ?? EMPTY_CONTRACT_HASH;\n}\nfunction migrationGraphFromListEntries(entries) {\n\tconst nodes = /* @__PURE__ */ new Set();\n\tconst forwardChain = /* @__PURE__ */ new Map();\n\tconst reverseChain = /* @__PURE__ */ new Map();\n\tconst migrationByHash = /* @__PURE__ */ new Map();\n\tfor (const entry of entries) {\n\t\tconst from = canonicalFrom(entry.fromContract);\n\t\tconst edge = {\n\t\t\tfrom,\n\t\t\tto: entry.toContract,\n\t\t\tmigrationHash: entry.hash,\n\t\t\tdirName: entry.name,\n\t\t\tcreatedAt: entry.createdAt,\n\t\t\tinvariants: entry.providedInvariants\n\t\t};\n\t\tnodes.add(from);\n\t\tnodes.add(entry.toContract);\n\t\tconst forward = forwardChain.get(from);\n\t\tif (forward) forward.push(edge);\n\t\telse forwardChain.set(from, [edge]);\n\t\tconst reverse = reverseChain.get(entry.toContract);\n\t\tif (reverse) reverse.push(edge);\n\t\telse reverseChain.set(entry.toContract, [edge]);\n\t\tmigrationByHash.set(entry.hash, edge);\n\t}\n\treturn {\n\t\tnodes,\n\t\tforwardChain,\n\t\treverseChain,\n\t\tmigrationByHash\n\t};\n}\nfunction buildEdgeAnnotationsByHashFromListEntries(entries) {\n\tconst annotations = /* @__PURE__ */ new Map();\n\tfor (const entry of entries) annotations.set(entry.hash, {\n\t\toperationCount: entry.operationCount,\n\t\tinvariants: entry.providedInvariants\n\t});\n\treturn annotations;\n}\nfunction buildRefsByHashFromListEntries(entries) {\n\tconst refsByHash = /* @__PURE__ */ new Map();\n\tfor (const entry of entries) if (entry.refs.length > 0) refsByHash.set(entry.toContract, entry.refs);\n\treturn refsByHash;\n}\nfunction formatEmptyStateLine(spaceId, style) {\n\treturn style.emptyState(`There are no migrations in migrations/${spaceId}/ yet`);\n}\nfunction renderSpaceTreeBlock(input) {\n\tconst { spaceId, migrations, multiSpace, glyphMode, style, colorize, liveContractHash, graphForSpace, appSpaceId, palette, globalMaxEdgeTreePrefixWidth, globalMaxDirNameWidth } = input;\n\tif (migrations.length === 0) {\n\t\tconst emptyLine = formatEmptyStateLine(spaceId, style);\n\t\tif (!multiSpace) return [emptyLine];\n\t\treturn [style.spaceHeading(`${spaceId}:`), ` ${emptyLine}`];\n\t}\n\tconst graph = graphForSpace(spaceId) ?? migrationGraphFromListEntries(migrations);\n\tconst isAppSpace = appSpaceId === void 0 ? void 0 : spaceId === appSpaceId;\n\tconst treeOutput = renderMigrationGraphSpaceTree({\n\t\tgraph,\n\t\tmigrations,\n\t\tliveContractHash,\n\t\tglyphMode,\n\t\tcolorize,\n\t\trefsByHash: buildRefsByHashFromListEntries(migrations),\n\t\tstyler: style,\n\t\t...palette !== void 0 ? { palette } : {},\n\t\t...isAppSpace !== void 0 ? { isAppSpace } : {},\n\t\t...globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth } : {},\n\t\t...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}\n\t});\n\tif (!multiSpace) return treeOutput.length === 0 ? [] : [treeOutput];\n\tconst indented = indentMigrationGraphTreeBlock(treeOutput, \" \");\n\treturn [style.spaceHeading(`${spaceId}:`), indented];\n}\n/**\n* Compose the styled `migration list` human output via the shared tree\n* renderer. Each on-disk migration is one edge row with package-fact\n* annotations; refs decorate destination contract nodes.\n*\n* `options.colorize` must match whether `style` emits ANSI (e.g. both true for\n* `createAnsiMigrationListStyler({ useColor: true })`).\n*/\nfunction renderMigrationListWithStyle(result, style, glyphMode = \"unicode\", options = {}) {\n\tconst multiSpace = result.spaces.length > 1;\n\tconst colorize = options.colorize ?? false;\n\tconst liveContractHash = options.liveContractHash ?? EMPTY_CONTRACT_HASH;\n\tconst graphForSpace = options.graphForSpace ?? (() => void 0);\n\tconst appSpaceId = options.appSpaceId;\n\tconst globalLayoutInputs = multiSpace ? result.spaces.filter((space) => space.migrations.length > 0).map((space) => ({\n\t\tgraph: graphForSpace(space.space) ?? migrationGraphFromListEntries(space.migrations),\n\t\tliveContractHash\n\t})) : [];\n\tconst globalMaxEdgeTreePrefixWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxEdgeTreePrefixWidth(globalLayoutInputs) : void 0;\n\tconst globalMaxDirNameWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxDirNameWidth(globalLayoutInputs) : void 0;\n\tconst lines = [];\n\tfor (let index = 0; index < result.spaces.length; index++) {\n\t\tconst space = result.spaces[index];\n\t\tif (index > 0) lines.push(\"\");\n\t\tlines.push(...renderSpaceTreeBlock({\n\t\t\tspaceId: space.space,\n\t\t\tmigrations: space.migrations,\n\t\t\tmultiSpace,\n\t\t\tglyphMode,\n\t\t\tstyle,\n\t\t\tcolorize,\n\t\t\tliveContractHash,\n\t\t\tgraphForSpace,\n\t\t\tappSpaceId,\n\t\t\tpalette: options.palette,\n\t\t\tglobalMaxEdgeTreePrefixWidth,\n\t\t\tglobalMaxDirNameWidth\n\t\t}));\n\t}\n\tif (result.spaces.reduce((count, space) => count + space.migrations.length, 0) > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(style.summary(result.summary));\n\t}\n\treturn lines.join(\"\\n\");\n}\n//#endregion\n//#region src/utils/formatters/migration-list-styler.ts\nfunction hasMarkersFormatter(styler) {\n\treturn \"markers\" in styler && typeof styler.markers === \"function\";\n}\nfunction styleMarkerName(name) {\n\treturn name === \"contract\" ? bold(green(name)) : green(name);\n}\nfunction plainMarkers(names) {\n\treturn names.map((name) => `@${name}`).join(\" \");\n}\nfunction formatContractNodeOverlays(styler, markers, refs) {\n\tconst parts = [];\n\tif (markers.length > 0) parts.push(hasMarkersFormatter(styler) ? styler.markers(markers) : plainMarkers(markers));\n\tif (refs.length > 0) parts.push(styler.refs(refs));\n\treturn parts.join(\" \");\n}\n/**\n* The current contract overlay marker. Unlike user refs, this names the user's\n* declared desired state — the implicit base/target for `plan` / `migrate` —\n* not a stored label. It is emphasized (bold) so it stands out from plain refs\n* (including the live-database `db` marker, which is just another ref).\n*/\nconst CONTRACT_MARKER_NAME = \"contract\";\nfunction styleRefName(name) {\n\treturn green(name);\n}\n/**\n* Build a {@link MigrationListStyler} that decorates `migration list`\n* tokens with ANSI SGR codes. When `useColor` is `false` (non-TTY,\n* `--no-color`, `NO_COLOR=1`, piped output) the function returns the\n* shared identity styler so callers get plain text with zero ANSI\n* bytes — pipe-friendly by construction.\n*\n* Palette:\n*\n* - `dirName`: bold\n* - `sourceHash`: dim cyan\n* - `destHash`: bright cyan\n* - `kind` (`*` / `↩` / `⟲`): bright — the signal; lanes and arrows dim\n* - `glyph` (`→` / `⟲` / `∅`): dim\n* - `lane` (graph gutter lines `│` and fan/join connectors `├─┐` / `├─┘`): dim\n* - `invariants` (`{...}`): yellow\n* - `markers` (`@contract @db`): green; the `contract` desired-state marker is\n* green-bold (`db` is plain green); the `@` sigil is applied to each name\n* - `refs` (`(...)`): green (the active ref is bolded separately by the tree styler)\n* - `spaceHeading` (`<spaceId>:`): bold\n* - `summary`: dim\n* - `emptyState`: dim\n*/\nfunction createAnsiMigrationListStyler(opts) {\n\tif (!opts.useColor) return {\n\t\t...IDENTITY_MIGRATION_LIST_STYLER,\n\t\tmarkers: plainMarkers\n\t};\n\treturn {\n\t\tkind: (text) => text,\n\t\tdirName: (text) => bold(text),\n\t\tsourceHash: (text) => dim(cyan(text)),\n\t\tdestHash: (text) => cyanBright(text),\n\t\tglyph: (text) => dim(text),\n\t\tlane: (text) => dim(text),\n\t\tinvariants: (ids) => yellow(`{${ids.join(\", \")}}`),\n\t\tmarkers: (names) => {\n\t\t\tconst sigil = green(\"@\");\n\t\t\treturn names.map((name) => sigil + styleMarkerName(name)).join(\" \");\n\t\t},\n\t\trefs: (names) => {\n\t\t\tconst open = green(\"(\");\n\t\t\tconst close = green(\")\");\n\t\t\tconst separator = green(\", \");\n\t\t\treturn open + names.map(styleRefName).join(separator) + close;\n\t\t},\n\t\tspaceHeading: (text) => bold(text),\n\t\tsummary: (text) => dim(text),\n\t\temptyState: (text) => dim(text)\n\t};\n}\n/**\n* The same vocabulary, said as meaning rather than as colour: each token is\n* marked with the tone it carries and the CLI engine chooses the bytes.\n*\n* Two distinctions the ANSI styler draws by shade do not survive, because a\n* span carries exactly one tone: the source and destination hashes are both\n* `identifier` (the ANSI styler dims the source and brightens the\n* destination), and the `contract` marker is `emphasis` rather than bold\n* green, which is what tells it apart from a plain marker such as `db`.\n*/\nfunction createToneMigrationListStyler() {\n\treturn {\n\t\tkind: (text) => text,\n\t\tdirName: (text) => toned(\"emphasis\", text),\n\t\tsourceHash: (text) => toned(\"identifier\", text),\n\t\tdestHash: (text) => toned(\"identifier\", text),\n\t\tglyph: (text) => toned(\"structure\", text),\n\t\tlane: (text) => toned(\"structure\", text),\n\t\tinvariants: (ids) => toned(\"warn\", `{${ids.join(\", \")}}`),\n\t\tmarkers: (names) => names.map((name) => toned(\"ref\", \"@\") + (name === \"contract\" ? toned(\"emphasis\", name) : toned(\"ref\", name))).join(\" \"),\n\t\trefs: (names) => toned(\"ref\", `(${names.join(\", \")})`),\n\t\tspaceHeading: (text) => toned(\"heading\", text),\n\t\tsummary: (text) => toned(\"muted\", text),\n\t\temptyState: (text) => toned(\"muted\", text)\n\t};\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-labels.ts\n/**\n* Per-row label formatting for the command graph renderer.\n*\n* The command graph renderer ({@link renderMigrationGraphCommand}) derives the\n* graph structure — rows, gutter, lane colours — from the grid pipeline. The\n* per-row LABEL (contract hash + markers + refs for node rows;\n* migration name + `from → to` + ops/status/will-run for migration rows) is\n* formatted here. This module owns ONLY label text + styling; it knows nothing\n* about lanes, gutters, or grid geometry.\n*\n* The label format (hash abbreviation, `from → to` arrow column, `@contract`/\n* `@db` markers, `(refs)`, ops/status/will-run suffix, the legend) is the same\n* as the previous renderer — that part was never the bug.\n*/\n/**\n* The live-database overlay marker. Just another ref as far as styling goes —\n* the only emphasized markers are the active ref and the `contract`\n* desired-state marker (see {@link CONTRACT_MARKER_NAME}).\n*/\nconst DB_MARKER_NAME = \"db\";\nfunction paletteFor(opts) {\n\treturn opts.palette ?? ANSI_MIGRATION_GRAPH_PALETTE;\n}\nconst identity = (text) => text;\n/** A palette painter bound to a path role, or a no-op when colour is off. */\nfunction rolePainter(palette, colorize, role) {\n\treturn colorize ? (text) => palette.role(role, text) : identity;\n}\n/**\n* The two label styles used in `migrate --show` path-highlight mode.\n*\n* - `onPath`: emphasized name, neutral hashes (the on-path lane glyphs are\n* coloured by the grid renderer, not here).\n* - `offPath`: the off-path role reaches the name and the whole hash field.\n*\n* To change the on-path / off-path label colour in future, edit this object.\n*/\nconst PATH_HIGHLIGHT_STYLES = {\n\tonPath: (_style, colorize, palette = ANSI_MIGRATION_GRAPH_PALETTE) => ({\n\t\tlane: rolePainter(palette, colorize, \"on-path\"),\n\t\tarrow: identity,\n\t\tdirName: colorize ? (text) => palette.emphasis(text) : identity,\n\t\thashOverride: void 0\n\t}),\n\toffPath: (colorize, palette = ANSI_MIGRATION_GRAPH_PALETTE) => ({\n\t\tlane: rolePainter(palette, colorize, \"off-path\"),\n\t\tarrow: rolePainter(palette, colorize, \"off-path\"),\n\t\tdirName: rolePainter(palette, colorize, \"off-path\"),\n\t\thashOverride: colorize ? rolePainter(palette, colorize, \"off-path\") : void 0\n\t})\n};\nfunction abbreviateHash(hash, hashLength, emptySource) {\n\tif (hash === EMPTY_CONTRACT_HASH) return emptySource;\n\treturn hash.slice(0, hashLength);\n}\nfunction overlayNamesForContract(contractHash, opts) {\n\tconst markers = [];\n\tconst refs = [];\n\tconst userRefs = opts.refsByHash?.get(contractHash);\n\tif (userRefs) refs.push(...[...userRefs].sort((a, b) => a.localeCompare(b)));\n\tif (opts.isAppSpace !== false && opts.contractHash === contractHash && contractHash !== EMPTY_CONTRACT_HASH) markers.push(CONTRACT_MARKER_NAME);\n\tif (opts.dbHash === contractHash) markers.push(DB_MARKER_NAME);\n\tmarkers.sort((a, b) => {\n\t\tif (a === \"contract\") return -1;\n\t\tif (b === \"contract\") return 1;\n\t\treturn a.localeCompare(b);\n\t});\n\treturn {\n\t\tmarkers,\n\t\trefs\n\t};\n}\nfunction createLabelStyler(opts) {\n\tconst base = opts.styler ?? createAnsiMigrationListStyler({ useColor: opts.colorize });\n\tconst activeRefName = opts.activeRefName;\n\tif (!opts.colorize || activeRefName === void 0) return base;\n\tconst palette = paletteFor(opts);\n\treturn {\n\t\t...base,\n\t\trefs: (names) => {\n\t\t\tconst styledNames = names.map((name) => name === activeRefName ? palette.emphasis(name) : name);\n\t\t\treturn base.refs(styledNames);\n\t\t}\n\t};\n}\nfunction overlayStatusGlyphs(mode) {\n\treturn mode === \"ascii\" ? {\n\t\tapplied: \"+\",\n\t\tpending: \">\"\n\t} : {\n\t\tapplied: \"✓\",\n\t\tpending: \"⧗\"\n\t};\n}\nfunction formatEdgeAnnotationSuffix(migrationHash, opts, style) {\n\tconst annotation = opts.edgeAnnotationsByHash?.get(migrationHash);\n\tif (annotation === void 0) return \"\";\n\tconst isOffPath = annotation.pathHighlight === \"off-path\";\n\tconst segments = [];\n\tif (annotation.operationCount !== void 0) segments.push(`${annotation.operationCount} ops`);\n\tif (annotation.invariants !== void 0 && annotation.invariants.length > 0) segments.push(style.invariants(annotation.invariants));\n\tconst status = annotation.status;\n\tif (status !== void 0) {\n\t\tconst glyphs = overlayStatusGlyphs(opts.glyphMode ?? \"unicode\");\n\t\tconst glyph = status === \"applied\" ? glyphs.applied : glyphs.pending;\n\t\tconst label = status === \"applied\" ? \"applied\" : \"pending\";\n\t\tif (!opts.colorize) segments.push(`${glyph} ${label}`);\n\t\telse segments.push(paletteFor(opts).status(status, `${glyph} ${label}`));\n\t}\n\tif (annotation.pathHighlight === \"on-path\") {\n\t\tconst glyph = opts.glyphMode === \"ascii\" ? \">\" : \"↑\";\n\t\tsegments.push(`${glyph} will run`);\n\t}\n\tif (segments.length === 0) return \"\";\n\tconst suffix = ` ${segments.join(\" \")}`;\n\treturn opts.colorize && isOffPath ? paletteFor(opts).role(\"off-path\", suffix) : suffix;\n}\n/**\n* Format the `from → to` hash data column for an edge row.\n*\n* When `hashOverride` is provided (off-path → `dim`), it replaces ALL sub-stylers\n* so dim reaches every character without inner ANSI codes overriding it.\n*/\nfunction formatEdgeHashColumn(edge, style, hashLength, glyphMode, hashOverride) {\n\tconst emptySource = migrationListEmptySource(glyphMode);\n\tconst forwardArrow = migrationListForwardArrow(glyphMode);\n\tconst src = hashOverride ?? style.sourceHash;\n\tconst dst = hashOverride ?? style.destHash;\n\tconst glyph = hashOverride ?? style.glyph;\n\tif (edge.kind === \"self\") {\n\t\tconst hash = abbreviateHash(edge.from, hashLength, emptySource);\n\t\treturn `${padFromHashColumn(src(hash), hashLength)} ${glyph(forwardArrow)} ${dst(hash)}`;\n\t}\n\treturn `${edge.from === EMPTY_CONTRACT_HASH ? padFromHashColumn(glyph(emptySource), hashLength) : padFromHashColumn(src(abbreviateHash(edge.from, hashLength, emptySource)), hashLength)} ${glyph(forwardArrow)} ${dst(abbreviateHash(edge.to, hashLength, emptySource))}`;\n}\n/**\n* The label text for a contract node row: the abbreviated hash (or the `∅`\n* empty-source token for the baseline) followed by its `@contract`/`@db` markers\n* and `(refs)`, with two spaces between the hash and the overlay block.\n*/\nfunction formatNodeLabel(contractHash, opts, nodeHighlight) {\n\tconst style = createLabelStyler(opts);\n\tconst hashLength = opts.hashLength ?? 7;\n\tconst emptySource = migrationListEmptySource(opts.glyphMode ?? \"unicode\");\n\tconst overlays = overlayNamesForContract(contractHash, opts);\n\tconst hasOverlays = overlays.markers.length > 0 || overlays.refs.length > 0;\n\tconst offPath = nodeHighlight === \"off-path\" && opts.colorize;\n\tconst dimmed = (text) => paletteFor(opts).role(\"off-path\", text);\n\tconst hashText = contractHash === EMPTY_CONTRACT_HASH ? (offPath ? dimmed : style.glyph)(emptySource) : (offPath ? dimmed : style.sourceHash)(abbreviateHash(contractHash, hashLength, emptySource));\n\tif (!hasOverlays) return hashText;\n\treturn `${hashText} ${formatContractNodeOverlays(style, overlays.markers, overlays.refs)}`;\n}\n/**\n* The label text for a migration row: the migration name (padded to\n* `dirNameWidth`) followed by the `from → to` hash column and the annotation\n* suffix (ops / status / will-run).\n*\n* In flat mode the name is tinted with its lane's hue (`lane` ≥ 0), so the node\n* `○`, the edges/arrows in the gutter, and the name all read in one colour. In\n* focus mode the on-path/off-path role overrides the lane hue (bold / dim).\n*/\nfunction formatMigrationLabel(edge, dirNameWidth, opts, lane) {\n\tconst style = createLabelStyler(opts);\n\tconst hashLength = opts.hashLength ?? 7;\n\tconst glyphMode = opts.glyphMode ?? \"unicode\";\n\tconst highlight = opts.edgeAnnotationsByHash?.get(edge.migrationHash)?.pathHighlight;\n\tconst palette = paletteFor(opts);\n\tlet dirNameStyler;\n\tlet hashOverride;\n\tif (highlight === \"on-path\") {\n\t\tdirNameStyler = rolePainter(palette, opts.colorize, \"on-path\");\n\t\thashOverride = void 0;\n\t} else if (highlight === \"off-path\") {\n\t\tdirNameStyler = opts.colorize ? rolePainter(palette, true, \"off-path\") : style.dirName;\n\t\thashOverride = opts.colorize ? rolePainter(palette, true, \"off-path\") : void 0;\n\t} else if (opts.colorize && lane !== void 0) {\n\t\tdirNameStyler = (text) => palette.lane(lane, text);\n\t\thashOverride = void 0;\n\t} else {\n\t\tdirNameStyler = style.dirName;\n\t\thashOverride = void 0;\n\t}\n\tconst dirNamePadding = \" \".repeat(Math.max(0, dirNameWidth - edge.dirName.length));\n\treturn `${`${dirNameStyler(edge.dirName)}${dirNamePadding}`}${formatEdgeHashColumn(edge, style, hashLength, glyphMode, hashOverride)}${formatEdgeAnnotationSuffix(edge.migrationHash, opts, style)}`;\n}\n/**\n* Format a single on-path migration row for the `migrate --show` run-list.\n* Shares PATH_HIGHLIGHT_STYLES.onPath with the graph tree so the run-list and\n* the graph are byte-for-byte identical in their name/hash columns.\n*/\nfunction formatOnPathMigrationRow(dirName, from, to, dirNameWidth, colorize, glyphMode, paint) {\n\tconst style = paint?.styler ?? createAnsiMigrationListStyler({ useColor: colorize });\n\tconst styledDirName = `${PATH_HIGHLIGHT_STYLES.onPath(style, colorize, paint?.palette).dirName(dirName)}${\" \".repeat(Math.max(0, dirNameWidth - dirName.length))}`;\n\tconst hashLength = 7;\n\tconst emptySource = migrationListEmptySource(glyphMode);\n\tconst forwardArrow = migrationListForwardArrow(glyphMode);\n\tconst fromAbbr = from === EMPTY_CONTRACT_HASH ? padFromHashColumn(style.glyph(emptySource), hashLength) : padFromHashColumn(style.sourceHash(abbreviateHash(from, hashLength, emptySource)), hashLength);\n\tconst toAbbr = to === EMPTY_CONTRACT_HASH ? style.glyph(emptySource) : style.destHash(abbreviateHash(to, hashLength, emptySource));\n\treturn `${styledDirName} ${fromAbbr} ${style.glyph(forwardArrow)} ${toAbbr}`;\n}\nfunction legendGlyphs(mode) {\n\treturn mode === \"ascii\" ? {\n\t\tnode: \"*\",\n\t\tforward: \"^\",\n\t\trollback: \"v\",\n\t\tself: \"@\"\n\t} : {\n\t\tnode: \"○\",\n\t\tforward: \"↑\",\n\t\trollback: \"↓\",\n\t\tself: \"⟲\"\n\t};\n}\n/**\n* A compact key for the tree visual language: the contract node glyph, the\n* in-lane direction arrows, the empty baseline, the system-marker `@…` and\n* user-ref `(…)` conventions, and a worked sample of the data-column hash arrow.\n*/\nfunction renderMigrationGraphLegend(opts) {\n\tconst glyphMode = opts.glyphMode ?? \"unicode\";\n\tconst style = opts.styler ?? createAnsiMigrationListStyler({ useColor: opts.colorize });\n\tconst palette = opts.palette ?? ANSI_MIGRATION_GRAPH_PALETTE;\n\tconst glyphs = legendGlyphs(glyphMode);\n\tconst emptySource = migrationListEmptySource(glyphMode);\n\tconst forwardArrow = migrationListForwardArrow(glyphMode);\n\tconst sampleArrow = `${style.sourceHash(\"aaaaaa\")} ${style.glyph(forwardArrow)} ${style.destHash(\"bbbbbb\")}`;\n\tconst statusGlyphs = overlayStatusGlyphs(glyphMode);\n\tconst appliedGlyph = opts.colorize ? palette.status(\"applied\", statusGlyphs.applied) : statusGlyphs.applied;\n\tconst pendingGlyph = opts.colorize ? palette.status(\"pending\", statusGlyphs.pending) : statusGlyphs.pending;\n\tconst appliedPending = ` ${appliedGlyph} ${style.summary(\"applied\")} ${pendingGlyph} ${style.summary(\"pending\")}`;\n\tconst exampleMarkers = style.markers([CONTRACT_MARKER_NAME, DB_MARKER_NAME]);\n\tconst exampleRefs = style.refs([\"prod\", \"staging\"]);\n\treturn [\n\t\t\"Legend:\",\n\t\t` ${style.kind(glyphs.node)} ${style.summary(\"contract\")} ${style.kind(glyphs.forward)} ${style.summary(\"forward\")} ${style.kind(glyphs.rollback)} ${style.summary(\"rollback\")}`,\n\t\t` ${style.kind(glyphs.self)} ${style.summary(\"migration without schema change\")}`,\n\t\tappliedPending,\n\t\t` ${style.kind(emptySource)} ${style.summary(\"empty database (baseline)\")}`,\n\t\t` ${exampleMarkers} ${style.summary(\"reserved markers — also typeable as --from/--to tokens\")}`,\n\t\t` ${exampleRefs} ${style.summary(\"user-defined refs\")}`,\n\t\t` ${sampleArrow} ${style.summary(\"migration from contract aaaaaa to bbbbbb\")}`\n\t].join(\"\\n\");\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-occlusion-render.ts\n/**\n* Occlusion renderer for the line/plane/occlusion migration-graph.\n*\n* Per cell: pick the topmost-plane line (lowest plane number = drawn on top),\n* look up its glyph, apply colour from the line's lane or role. Lower-plane\n* lines are occluded (not drawn).\n*\n* Colour comes from the palette the caller hands in; see migration-graph-palette.\n*/\nconst UNICODE_ALPHABET = {\n\tvertical: \"│\",\n\thorizontal: \"─\",\n\tcornerUpRight: \"╰\",\n\tcornerDownRight: \"╭\",\n\tcornerUpLeft: \"╯\",\n\tcornerDownLeft: \"╮\",\n\tarrowUp: \"↑\",\n\tarrowDown: \"↓\",\n\tnode: \"○\",\n\tselfLoop: \"⟲\",\n\tlandingArrow: \"◂\",\n\tfallback: \"?\"\n};\nconst ASCII_ALPHABET = {\n\tvertical: \"|\",\n\thorizontal: \"-\",\n\tcornerUpRight: \"\\\\\",\n\tcornerDownRight: \"/\",\n\tcornerUpLeft: \"/\",\n\tcornerDownLeft: \"\\\\\",\n\tarrowUp: \"^\",\n\tarrowDown: \"v\",\n\tnode: \"*\",\n\tselfLoop: \"@\",\n\tlandingArrow: \"<\",\n\tfallback: \"?\"\n};\nfunction alphabetFor(mode) {\n\treturn mode === \"ascii\" ? ASCII_ALPHABET : UNICODE_ALPHABET;\n}\nfunction glyphFor(dirs, alphabet) {\n\tconst has = (d) => dirs.has(d);\n\tif (has(\"up\") && has(\"down\") && !has(\"left\") && !has(\"right\")) return alphabet.vertical;\n\tif (has(\"left\") && has(\"right\") && !has(\"up\") && !has(\"down\")) return alphabet.horizontal;\n\tif (has(\"up\") && has(\"right\") && !has(\"down\") && !has(\"left\")) return alphabet.cornerUpRight;\n\tif (has(\"down\") && has(\"right\") && !has(\"up\") && !has(\"left\")) return alphabet.cornerDownRight;\n\tif (has(\"up\") && has(\"left\") && !has(\"down\") && !has(\"right\")) return alphabet.cornerUpLeft;\n\tif (has(\"down\") && has(\"left\") && !has(\"up\") && !has(\"right\")) return alphabet.cornerDownLeft;\n\tif (has(\"up\") && !has(\"down\") && !has(\"left\") && !has(\"right\")) return alphabet.arrowUp;\n\tif (has(\"down\") && !has(\"up\") && !has(\"left\") && !has(\"right\")) return alphabet.arrowDown;\n\treturn alphabet.fallback;\n}\n/** A line or node is painted by its path role when it has one, else by its lane. */\nfunction paintByRoleOrLane(palette, role, lane) {\n\treturn role === void 0 ? (text) => palette.lane(lane, text) : (text) => palette.role(role, text);\n}\nfunction renderCell(cell, palette, alphabet) {\n\tconst node = cell.node;\n\tif (node !== void 0) return paintByRoleOrLane(palette, node.role, node.lane)(alphabet.node);\n\tif (cell.lines.length === 0) return \" \";\n\tconst topLine = cell.lines.reduce((best, current) => {\n\t\tif (current.plane < best.plane) return current;\n\t\tif (current.plane > best.plane) return best;\n\t\tif (current.line.role === \"on-path\" && best.line.role !== \"on-path\") return current;\n\t\treturn best;\n\t}, cell.lines[0]);\n\tconst glyph = topLine.selfLoop === true ? alphabet.selfLoop : topLine.landingArrow === true ? alphabet.landingArrow : glyphFor(topLine.directions, alphabet);\n\treturn paintByRoleOrLane(palette, topLine.line.role, topLine.line.lane)(glyph);\n}\n/**\n* Render a single grid row to a coloured string. A completely empty row returns\n* the empty string (the row is NOT dropped) so callers that pair grid rows with\n* an external per-row label list keep a 1:1 index correspondence. `renderGrid`\n* itself drops empty rows for its standalone output (but preserves separator rows).\n*/\nfunction renderGridRow(row, opts = {}) {\n\tif (row[0]?.separator === true) return \"\";\n\tlet lastNonEmpty = -1;\n\tfor (let i = row.length - 1; i >= 0; i--) {\n\t\tconst cell = row[i];\n\t\tif (cell !== void 0 && (cell.lines.length > 0 || cell.node !== void 0)) {\n\t\t\tlastNonEmpty = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (lastNonEmpty < 0) return \"\";\n\tconst colsPerLane = opts.colsPerLane ?? 2;\n\tconst palette = opts.colorize ?? true ? opts.palette ?? ANSI_MIGRATION_GRAPH_PALETTE : PLAIN_MIGRATION_GRAPH_PALETTE;\n\tconst alphabet = alphabetFor(opts.glyphMode ?? \"unicode\");\n\tconst lastConnectorCol = Math.floor(lastNonEmpty / colsPerLane) * colsPerLane + (colsPerLane - 1);\n\tconst renderThrough = Math.max(lastNonEmpty, lastConnectorCol);\n\tlet line = \"\";\n\tfor (let col = 0; col <= Math.min(renderThrough, row.length - 1); col++) {\n\t\tconst cell = row[col];\n\t\tline += cell === void 0 ? \" \" : renderCell(cell, palette, alphabet);\n\t}\n\treturn line;\n}\n//#endregion\n//#region src/utils/formatters/migration-graph-command-render.ts\n/**\n* Command graph renderer: composes the gutter (from the grid) with per-row labels.\n*\n* Pipeline: buildMigrationGraphRows → buildGrid → renderMigrationGraphCommand\n*\n* Each grid row is classified by its cells: a node row gets a contract label;\n* a migration arrow row gets a migration label; connector rows get no label.\n* Label format and styling live in `./migration-graph-labels`.\n*/\nconst LABEL_GAP$1 = 2;\nconst MIN_HASH_DATA_COLUMN$1 = 25;\n/**\n* Classify a grid row by its own cells:\n* - a cell carrying a NodeRef → node row (contract label);\n* - a cell whose top line is an arrow ({up}/{down}/self-loop) → migration row;\n* - otherwise → no label.\n*\n* A migration's arrow appears in exactly one grid row (the forward `↑` row, the\n* adjacent-rollback `↓` row, or the self-loop `⟲` row), so each migration gets\n* exactly one label, on the row that draws its arrow.\n*\n* Two distinct migrations with identical content (same from/to/ops) hash to the\n* SAME migration hash, so the arrow line is matched on BOTH its hash and its\n* `dirName` (which the LineRef carries per-row) — otherwise both rows would\n* resolve to one edge and the other migration's name would be lost.\n*/\nfunction classifyRow(row, edgesByHash) {\n\tfor (const cell of row) if (cell.node !== void 0) return {\n\t\tkind: \"node\",\n\t\tcontractHash: cell.node.contractHash\n\t};\n\tfor (const cell of row) {\n\t\tconst arrow = arrowLine(cell);\n\t\tif (arrow === void 0) continue;\n\t\tconst candidates = edgesByHash.get(arrow.line.migrationHash) ?? [];\n\t\tconst edge = candidates.find((e) => e.dirName === arrow.line.dirName) ?? candidates[0];\n\t\tif (edge !== void 0) return {\n\t\t\tkind: \"migration\",\n\t\t\tedge,\n\t\t\tlane: arrow.line.lane\n\t\t};\n\t}\n\treturn { kind: \"none\" };\n}\n/**\n* Return the cell's arrow line if it carries one — a self-loop, or a line whose\n* directions are exactly `{up}` or `{down}` (the migration-direction arrows).\n* Connector/corner/vertical lines are not arrows and yield `undefined`.\n*/\nfunction arrowLine(cell) {\n\tfor (const line of cell.lines) {\n\t\tif (line.selfLoop === true) return line;\n\t\tif (line.landingArrow === true) continue;\n\t\tconst dirs = line.directions;\n\t\tif (dirs.size !== 1) continue;\n\t\tif (dirs.has(\"up\") || dirs.has(\"down\")) return line;\n\t}\n}\n/**\n* Resolve each contract's path-highlight role from the edges incident on it.\n* On-path wins: a contract touched by any on-path edge is on-path. Empty unless\n* focus-mode annotations are present.\n*/\nfunction resolveNodeHighlights(rowModel, edgeAnnotationsByHash) {\n\tconst result = /* @__PURE__ */ new Map();\n\tif (edgeAnnotationsByHash === void 0) return result;\n\tfor (const edge of rowModel.edges) {\n\t\tconst highlight = edgeAnnotationsByHash.get(edge.migrationHash)?.pathHighlight;\n\t\tif (highlight === void 0) continue;\n\t\tfor (const hash of [edge.from, edge.to]) {\n\t\t\tif (hash === EMPTY_CONTRACT_HASH) continue;\n\t\t\tif (result.get(hash) !== \"on-path\") result.set(hash, highlight);\n\t\t}\n\t}\n\treturn result;\n}\nfunction maxDirNameLength(edges) {\n\tlet max = 0;\n\tfor (const edge of edges) max = Math.max(max, edge.dirName.length);\n\treturn max;\n}\n/**\n* The label column for a render: the widest gutter (visible width) across every\n* row, plus the label gap. Labels begin here so they line up regardless of how\n* deep the lane structure runs on any one row. A cross-space override widens it\n* so sibling space sections share one column.\n*/\nfunction computeLabelColumn(grid, glyphMode) {\n\tlet maxGutter = 0;\n\tfor (const row of grid) {\n\t\tconst gutter = renderGridRow(row, {\n\t\t\tcolorize: false,\n\t\t\tglyphMode\n\t\t});\n\t\tmaxGutter = Math.max(maxGutter, stringWidth(gutter));\n\t}\n\treturn maxGutter + LABEL_GAP$1;\n}\nfunction computeMaxDirNameWidth(rowModel) {\n\treturn maxDirNameLength(rowModel.edges);\n}\nfunction padVisible(text, targetWidth) {\n\tconst padding = Math.max(0, targetWidth - stringWidth(text));\n\treturn text + \" \".repeat(padding);\n}\nconst ANSI_ESCAPE = \"\\x1B\";\nfunction trimTrailingWhitespace(line) {\n\tconst trailingSpaceBeforeReset = new RegExp(`[\\\\t ]+((?:${ANSI_ESCAPE}\\\\[[0-9;]*m)+)$`);\n\treturn line.replace(trailingSpaceBeforeReset, \"$1\").replace(/\\s+$/, \"\");\n}\nfunction renderMigrationGraphCommand(input) {\n\tconst { grid, rowModel } = input;\n\tconst glyphMode = input.glyphMode;\n\tconst edgesByHash = /* @__PURE__ */ new Map();\n\tfor (const edge of rowModel.edges) {\n\t\tconst bucket = edgesByHash.get(edge.migrationHash);\n\t\tif (bucket) bucket.push(edge);\n\t\telse edgesByHash.set(edge.migrationHash, [edge]);\n\t}\n\tconst labelOpts = {\n\t\tcolorize: input.colorize,\n\t\tglyphMode,\n\t\t...ifDefined(\"refsByHash\", input.refsByHash),\n\t\t...ifDefined(\"edgeAnnotationsByHash\", input.edgeAnnotationsByHash),\n\t\t...ifDefined(\"dbHash\", input.dbHash),\n\t\t...ifDefined(\"contractHash\", input.contractHash),\n\t\t...ifDefined(\"isAppSpace\", input.isAppSpace),\n\t\t...ifDefined(\"activeRefName\", input.activeRefName),\n\t\t...ifDefined(\"styler\", input.styler),\n\t\t...ifDefined(\"palette\", input.palette)\n\t};\n\tconst nodeHighlights = resolveNodeHighlights(rowModel, input.edgeAnnotationsByHash);\n\tconst labelColumn = input.globalLabelColumn ?? computeLabelColumn(grid, glyphMode);\n\tconst maxDirNameLen = input.globalMaxDirNameWidth ?? maxDirNameLength(rowModel.edges);\n\tconst dirNameWidth = Math.max(maxDirNameLen + LABEL_GAP$1, MIN_HASH_DATA_COLUMN$1 - labelColumn);\n\tconst lines = [];\n\tfor (const row of grid) {\n\t\tconst gutter = renderGridRow(row, {\n\t\t\tcolorize: input.colorize,\n\t\t\tglyphMode,\n\t\t\t...ifDefined(\"palette\", input.palette)\n\t\t});\n\t\tconst identity = classifyRow(row, edgesByHash);\n\t\tif (identity.kind === \"none\") {\n\t\t\tlines.push(trimTrailingWhitespace(gutter));\n\t\t\tcontinue;\n\t\t}\n\t\tconst gutterPad = padVisible(gutter, labelColumn);\n\t\tif (identity.kind === \"node\") {\n\t\t\tconst label = formatNodeLabel(identity.contractHash, labelOpts, nodeHighlights.get(identity.contractHash));\n\t\t\tlines.push(trimTrailingWhitespace(label.length === 0 ? gutter : `${gutterPad}${label}`));\n\t\t\tcontinue;\n\t\t}\n\t\tconst label = formatMigrationLabel(identity.edge, dirNameWidth, labelOpts, identity.lane);\n\t\tlines.push(trimTrailingWhitespace(`${gutterPad}${label}`));\n\t}\n\treturn lines.join(\"\\n\");\n}\n//#endregion\n//#region src/utils/formatters/migrate-show-render.ts\nconst LABEL_GAP = 2;\nconst MIN_HASH_DATA_COLUMN = 25;\nconst LIST_INDENT = 2;\nfunction paintOverrides(options) {\n\treturn {\n\t\t...options.styler === void 0 ? {} : { styler: options.styler },\n\t\t...options.palette === void 0 ? {} : { palette: options.palette }\n\t};\n}\n/**\n* Every space, with the migrations on the chosen path lifted to focus mode and\n* everything else dimmed. Widths are computed across all spaces first so the\n* sections and the run-list below them share their columns.\n*/\nfunction renderMigrateShowGraph(plan, options) {\n\tconst { aggregate, contractHash } = plan;\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tconst onPathHashes = new Set(plan.migrations.map((migration) => migration.migrationHash));\n\tconst spaceLayouts = allSpaces.map((space) => {\n\t\tconst isApp = space.spaceId === aggregate.app.spaceId;\n\t\tconst spaceGraph = space.graph();\n\t\tconst rowModel = buildMigrationGraphRows(spaceGraph, isApp ? { contractHash } : {});\n\t\tconst edgeAnnotations = /* @__PURE__ */ new Map();\n\t\tfor (const edge of spaceGraph.migrationByHash.values()) edgeAnnotations.set(edge.migrationHash, { pathHighlight: onPathHashes.has(edge.migrationHash) ? \"on-path\" : \"off-path\" });\n\t\treturn {\n\t\t\tspace,\n\t\t\tisApp,\n\t\t\trowModel,\n\t\t\tgrid: buildGrid(rowModel, {}, highlightFromEdgeAnnotations(edgeAnnotations)),\n\t\t\tedgeAnnotations\n\t\t};\n\t});\n\tconst multiSpace = spaceLayouts.length > 1;\n\tconst globalLabelColumn = multiSpace ? Math.max(...spaceLayouts.map(({ grid }) => computeLabelColumn(grid, options.glyphMode))) : void 0;\n\tconst widestRunListName = plan.migrations.length > 0 ? Math.max(...plan.migrations.map((migration) => migration.dirName.length)) : 0;\n\tconst globalMaxDirNameWidth = multiSpace ? Math.max(Math.max(...spaceLayouts.map(({ rowModel }) => computeMaxDirNameWidth(rowModel))), widestRunListName) : void 0;\n\tconst sections = [];\n\tfor (const { space, isApp, rowModel, grid, edgeAnnotations } of spaceLayouts) {\n\t\tconst liveMarkerHash = plan.renderMarkerHashBySpace.get(space.spaceId);\n\t\tconst tree = renderMigrationGraphCommand({\n\t\t\tgrid,\n\t\t\trowModel,\n\t\t\tcontractHash,\n\t\t\tisAppSpace: isApp,\n\t\t\t...plan.usedLiveMarker && liveMarkerHash !== void 0 ? { dbHash: liveMarkerHash } : {},\n\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\tedgeAnnotationsByHash: edgeAnnotations,\n\t\t\tcolorize: options.colorize,\n\t\t\tglyphMode: options.glyphMode,\n\t\t\t...paintOverrides(options),\n\t\t\t...globalLabelColumn === void 0 ? {} : { globalLabelColumn },\n\t\t\t...globalMaxDirNameWidth === void 0 ? {} : { globalMaxDirNameWidth }\n\t\t});\n\t\tif (tree.length === 0) continue;\n\t\tsections.push(multiSpace ? `${space.spaceId}:\\n${indentMigrationGraphTreeBlock(tree, \" \")}` : tree);\n\t}\n\treturn {\n\t\tgraphOutput: sections.join(\"\\n\\n\"),\n\t\trunListDirNameWidth: globalMaxDirNameWidth ?? widestRunListName,\n\t\trunListLeftPad: globalLabelColumn\n\t};\n}\n/**\n* The ordered \"will run\" rows, aligned with the graph above them.\n*\n* The `→` arrow has to land in the same absolute column in a list row as in a\n* graph edge row. A graph edge row is `[gutter][name][hashes]`; a list row is\n* `[indent][name][indent][hashes]`, so the list's name column absorbs the\n* gutter width and the indent — twice over when a flat tree has no space\n* headings indenting it.\n*/\nfunction migrateShowRunListRows(migrations, rendering, options) {\n\tconst gutter = rendering.runListLeftPad ?? 0;\n\tconst multiSpace = rendering.runListLeftPad !== void 0;\n\tconst listDirNameWidth = gutter + Math.max(rendering.runListDirNameWidth + LABEL_GAP, MIN_HASH_DATA_COLUMN - gutter) - (multiSpace ? LIST_INDENT : LIST_INDENT * 2);\n\treturn migrations.map((migration) => ` ${formatOnPathMigrationRow(migration.dirName, migration.from, migration.to, listDirNameWidth, options.colorize, options.glyphMode, paintOverrides(options))}`);\n}\n//#endregion\n//#region src/utils/migrate-failure.ts\n/** A `migrate` apply failure as the CLI's structured error. */\nfunction mapMigrateFailure(failure) {\n\tif (failure.code === \"MIGRATION_PATH_NOT_FOUND\") return errorPathUnreachable(failure);\n\treturn errorRunnerFailed(failure.summary, {\n\t\twhy: failure.why ?? \"Migration runner failed\",\n\t\tfix: \"Fix the issue and re-run `prisma-cli migrate --to <contract>` — previously applied migrations are preserved.\",\n\t\tmeta: failure.meta ?? {},\n\t\t...ifDefined(\"cause\", failure.cause)\n\t});\n}\n//#endregion\n//#region src/orm/migrate.ts\nconst STATUS_ACTION = runCommandAction(\"Check every space against the database\", \"prisma-cli migration status\");\n/**\n* The route the migration will take. The graph is a drawing — the engine cannot\n* derive a lane gutter — and the ordered list under it is drawn with the same\n* widths so every arrow lands in one column.\n*/\nfunction showPresentations$1(inputs) {\n\tconst { document, graph, runList } = inputs;\n\tconst count = document.migrations.length;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t\t},\n\t\t\t\t\t...inputs.database === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\t\tvalue: inputs.database\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.from === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\t\tvalue: inputs.from\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.to === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\t\tvalue: inputs.to\n\t\t\t\t\t}]\n\t\t\t\t]\n\t\t\t},\n\t\t\t...graph.length === 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(graph)\n\t\t\t}],\n\t\t\t...count === 0 ? [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"info\",\n\t\t\t\ttext: document.summary\n\t\t\t}] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"info\",\n\t\t\t\ttext: `The following ${count} migration${count === 1 ? \"\" : \"s\"} will run:`\n\t\t\t}, {\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(runList.join(\"\\n\"))\n\t\t\t}]\n\t\t],\n\t\tjson: () => document\n\t};\n}\nfunction applyPresentations(inputs) {\n\tconst { document } = inputs;\n\tconst advanced = document.advancedRef;\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t\t},\n\t\t\t\t\t...inputs.database === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\t\tvalue: inputs.database\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.to === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\t\tvalue: inputs.to\n\t\t\t\t\t}]\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: document.summary\n\t\t\t},\n\t\t\t...document.perSpace.length === 0 ? [] : perSpaceBlocks(document.perSpace, \"apply\"),\n\t\t\t...advanced === null || advanced === void 0 ? [] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: [{ text: `Advanced ref \"${advanced.name}\" → ` }, {\n\t\t\t\t\ttext: advanced.hash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}]\n\t\t\t}]\n\t\t],\n\t\tjson: () => document,\n\t\tnext: () => [STATUS_ACTION]\n\t};\n}\n/**\n* `--to` as a contract the app graph knows. A ref target keeps the invariants\n* the ref declares; a bare hash carries none. Omitting `--to` targets the\n* emitted contract, which needs no resolution at all.\n*/\nfunction resolveRequestedTarget(to, refs, graph) {\n\tif (to === void 0) return ok$1({\n\t\tentry: void 0,\n\t\trefName: void 0\n\t});\n\tconst resolved = resolveContractRef(to, {\n\t\tgraph,\n\t\trefs\n\t});\n\tif (!resolved.ok) return notOk$1(normalizeError(resolved.failure));\n\tif (resolved.value.provenance.kind !== \"ref\") return ok$1({\n\t\tentry: {\n\t\t\thash: resolved.value.hash,\n\t\t\tinvariants: []\n\t\t},\n\t\trefName: void 0\n\t});\n\tconst refName = resolved.value.provenance.refName;\n\treturn ok$1({\n\t\tentry: refs[refName],\n\t\trefName\n\t});\n}\nfunction createMigrateCommand(createClient) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Apply planned migrations to advance the database\",\n\t\t\tdescription: \"Walks every contract space (app + extensions) and applies pending on-disk\\nmigrations in canonical order (extensions alphabetically, then app). It\\nreplays the on-disk migration graph and never invents an edge. Use --to to\\ntarget a specific contract (hash, ref name, or migration directory) and\\n--show for a read-only preview of the route it would take.\",\n\t\t\texamples: [\n\t\t\t\t\"migrate\",\n\t\t\t\t\"migrate --db $DATABASE_URL\",\n\t\t\t\t\"migrate --to production\",\n\t\t\t\t\"migrate --show\",\n\t\t\t\t\"migrate --show --from @contract --to production\"\n\t\t\t]\n\t\t},\n\t\targs: { flags: {\n\t\t\tdb: dbFlag,\n\t\t\tto: flag.string({\n\t\t\t\tbrief: \"Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t}),\n\t\t\tadvanceRef: flag.string({\n\t\t\t\tbrief: \"Advance the named ref to the post-apply marker after success\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tshow: flag.boolean({ brief: \"Preview the migration route without applying (read-only)\" }),\n\t\t\tfrom: flag.string({\n\t\t\t\tbrief: \"From-state for the --show preview (@contract, @db, hash, ref name, or dir)\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst migrationsRelative = displayPath(migrationsDirFor(ctx.config, ctx.cwd), ctx.cwd);\n\t\t\tif (args.flags.show) {\n\t\t\t\tconst planned = await executeMigrateShowPlan({\n\t\t\t\t\tconfig: ctx.config,\n\t\t\t\t\tcwd: ctx.cwd,\n\t\t\t\t\tcreateClient,\n\t\t\t\t\t...ifDefined(\"db\", args.flags.db),\n\t\t\t\t\t...ifDefined(\"to\", args.flags.to),\n\t\t\t\t\t...ifDefined(\"from\", args.flags.from)\n\t\t\t\t});\n\t\t\t\tif (!planned.ok) return notOk$1(normalizeError(planned.failure));\n\t\t\t\tconst plan = planned.value;\n\t\t\t\tconst paint = {\n\t\t\t\t\tcolorize: true,\n\t\t\t\t\tglyphMode: \"unicode\",\n\t\t\t\t\tstyler: createToneMigrationListStyler(),\n\t\t\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t\t\t};\n\t\t\t\tconst rendering = renderMigrateShowGraph(plan, paint);\n\t\t\t\tconst document = {\n\t\t\t\t\tok: true,\n\t\t\t\t\tmigrations: plan.migrations,\n\t\t\t\t\tsummary: plan.summary\n\t\t\t\t};\n\t\t\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\t\t\treturn ok$1(ctx.present({ data: document }, showPresentations$1({\n\t\t\t\t\tdocument,\n\t\t\t\t\tgraph: rendering.graphOutput,\n\t\t\t\t\trunList: migrateShowRunListRows(plan.migrations, rendering, paint),\n\t\t\t\t\tmigrationsDir: migrationsRelative,\n\t\t\t\t\tdatabase: args.flags.from === void 0 && typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0,\n\t\t\t\t\tfrom: args.flags.from,\n\t\t\t\t\tto: args.flags.to\n\t\t\t\t})));\n\t\t\t}\n\t\t\tconst startedAt = Date.now();\n\t\t\tconst prepared = await prepareMigrationRun({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd,\n\t\t\t\tdb: args.flags.db,\n\t\t\t\tcommandName: \"migrate\",\n\t\t\t\tcreateClient\n\t\t\t});\n\t\t\tif (!prepared.ok) return notOk$1(prepared.failure);\n\t\t\tconst { client, contractJson, contractPath, dbConnection, migrationsDir, refsDir } = prepared.value;\n\t\t\tconst familyInstance = ctx.config.family.create(createControlStack(ctx.config));\n\t\t\tlet appContract;\n\t\t\ttry {\n\t\t\t\tappContract = familyInstance.deserializeContract(contractJson);\n\t\t\t} catch (error) {\n\t\t\t\treturn notOk$1(normalizeError(errorContractValidationFailed(`Contract at ${contractPath} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPath } })));\n\t\t\t}\n\t\t\tconst loaded = await loadContractSpaceAggregateForCli({\n\t\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\t\tmigrationsDir,\n\t\t\t\tappContract,\n\t\t\t\textensions: ctx.config.extensions ?? [],\n\t\t\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t\t\t});\n\t\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\t\tconst aggregate = loaded.value;\n\t\t\tconst integrityFailure = refuseContractSpaceIntegrity(aggregate, {\n\t\t\t\tdeclaredExtensions: toDeclaredExtensionsFromRaw(castAs(ctx.config.extensions ?? [])),\n\t\t\t\tcheckContracts: true\n\t\t\t}, migrationsDir);\n\t\t\tif (integrityFailure) return notOk$1(normalizeError(integrityFailure));\n\t\t\tconst target = resolveRequestedTarget(args.flags.to, aggregate.app.refs, aggregate.app.graph());\n\t\t\tif (!target.ok) return notOk$1(target.failure);\n\t\t\tlet document;\n\t\t\ttry {\n\t\t\t\tawait client.connect(dbConnection);\n\t\t\t\tconst appGraph = aggregate.app.graph();\n\t\t\t\tconst appMarker = (await client.readAllMarkers()).get(\"app\") ?? null;\n\t\t\t\tif (appMarker !== null) {\n\t\t\t\t\tconst markerRefusal = refuseMarkerOutsideGraph({\n\t\t\t\t\t\tmarkerHash: appMarker.storageHash,\n\t\t\t\t\t\tgraph: appGraph\n\t\t\t\t\t});\n\t\t\t\t\tif (markerRefusal) return notOk$1(normalizeError(markerRefusal));\n\t\t\t\t}\n\t\t\t\tconst refEntry = target.value.entry;\n\t\t\t\tif (refEntry !== void 0 && refEntry.invariants.length > 0) {\n\t\t\t\t\tconst invariantRefusal = refuseUnknownInvariants({\n\t\t\t\t\t\tgraph: appGraph,\n\t\t\t\t\t\tmarkerInvariants: appMarker?.invariants ?? [],\n\t\t\t\t\t\trefInvariants: refEntry.invariants,\n\t\t\t\t\t\t...ifDefined(\"refName\", args.flags.to)\n\t\t\t\t\t});\n\t\t\t\t\tif (invariantRefusal) return notOk$1(normalizeError(invariantRefusal));\n\t\t\t\t}\n\t\t\t\tlet applyContract = appContract;\n\t\t\t\tlet snapshotContractJson = contractJson;\n\t\t\t\tlet snapshotContractDts;\n\t\t\t\tif (args.flags.to !== void 0 && refEntry !== void 0) {\n\t\t\t\t\tif (aggregate.app.packages.find((p) => p.metadata.to === refEntry.hash) !== void 0) try {\n\t\t\t\t\t\tconst at = await aggregate.app.contractAt(refEntry.hash, target.value.refName === void 0 ? void 0 : { refName: target.value.refName });\n\t\t\t\t\t\tapplyContract = at.contract;\n\t\t\t\t\t\tsnapshotContractJson = blindCast(at.contractJson);\n\t\t\t\t\t\tsnapshotContractDts = at.contractDts;\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst mapped = mapContractAtError(error, { artifactRole: \"to\" });\n\t\t\t\t\t\tif (!mapped.ok) return notOk$1(normalizeError(mapped.failure));\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst applied = await client.migrate({\n\t\t\t\t\tcontract: applyContract,\n\t\t\t\t\tmigrationsDir,\n\t\t\t\t\tonProgress: controlProgressReporter(ctx.report),\n\t\t\t\t\t...ifDefined(\"refHash\", refEntry?.hash),\n\t\t\t\t\t...refEntry?.invariants === void 0 ? {} : { refInvariants: refEntry.invariants },\n\t\t\t\t\t...refEntry === void 0 ? {} : ifDefined(\"refName\", args.flags.to)\n\t\t\t\t});\n\t\t\t\tif (!applied.ok) return notOk$1(normalizeError(mapMigrateFailure(applied.failure)));\n\t\t\t\tconst { value } = applied;\n\t\t\t\tlet advancedRef = null;\n\t\t\t\tif (args.flags.advanceRef !== void 0) {\n\t\t\t\t\tconst contractIR = snapshotContractDts === void 0 ? await readContractIR(snapshotContractJson, contractPath) : {\n\t\t\t\t\t\tcontract: snapshotContractJson,\n\t\t\t\t\t\tcontractDts: snapshotContractDts\n\t\t\t\t\t};\n\t\t\t\t\tconst advanced = await advanceRefSafely({\n\t\t\t\t\t\trefsDir,\n\t\t\t\t\t\tmigrationsDir,\n\t\t\t\t\t\tname: args.flags.advanceRef,\n\t\t\t\t\t\thash: value.markerHash,\n\t\t\t\t\t\tcontractIR\n\t\t\t\t\t});\n\t\t\t\t\tif (!advanced.ok) return notOk$1(normalizeError(advanced.failure));\n\t\t\t\t\tadvancedRef = {\n\t\t\t\t\t\tname: advanced.value.name,\n\t\t\t\t\t\thash: advanced.value.hash\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdocument = {\n\t\t\t\t\tok: true,\n\t\t\t\t\tmigrationsApplied: value.migrationsApplied,\n\t\t\t\t\tmigrationsTotal: value.applied.length,\n\t\t\t\t\tmarkerHash: value.markerHash,\n\t\t\t\t\tapplied: value.applied,\n\t\t\t\t\tsummary: value.summary,\n\t\t\t\t\tperSpace: value.perSpace,\n\t\t\t\t\t...ifDefined(\"pathDecision\", value.pathDecision),\n\t\t\t\t\ttimings: { total: Date.now() - startedAt },\n\t\t\t\t\tadvancedRef\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\treturn notOk$1(normalizeError(mapCaughtMigrationError(error) ?? errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during migrate: ${error instanceof Error ? error.message : String(error)}` })));\n\t\t\t} finally {\n\t\t\t\tawait closeQuietly(client);\n\t\t\t}\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"verbose\",\n\t\t\t\ttext: `Total time: ${document.timings.total}ms`\n\t\t\t});\n\t\t\treturn ok$1(ctx.present({ data: document }, applyPresentations({\n\t\t\t\tdocument,\n\t\t\t\tmigrationsDir: migrationsRelative,\n\t\t\t\tdatabase: prepared.value.database,\n\t\t\t\tto: args.flags.to\n\t\t\t})));\n\t\t}\n\t});\n}\nconst migrateCommand = createMigrateCommand(createControlClient);\n//#endregion\n//#region src/utils/integrity-violation-to-check-failure.ts\nfunction migrationPathRelative(dirPath) {\n\treturn relative(process.cwd(), dirPath);\n}\nfunction migrationFileRelative(dirPath, fileName) {\n\treturn join(migrationPathRelative(dirPath), fileName);\n}\n/**\n* Map one {@link IntegrityViolation} onto a `migration check` failure row.\n* Sole catalogue mapping from integrity violations to `MIGRATION.CHECK_*` codes.\n*/\nfunction integrityViolationToCheckFailure(violation, migrationsDir) {\n\tconst spaceRelative = (spaceId) => migrationPathRelative(join(migrationsDir, spaceId));\n\tconst packageRelative = (spaceId, dirName) => migrationPathRelative(join(migrationsDir, spaceId, dirName));\n\tconst refRelative = (spaceId, refName) => migrationPathRelative(join(migrationsDir, spaceId, \"refs\", `${refName}.json`));\n\tswitch (violation.kind) {\n\t\tcase \"hashMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HASH_MISMATCH\",\n\t\t\twhere: migrationFileRelative(join(migrationsDir, violation.spaceId, violation.dirName), \"migration.json\"),\n\t\t\twhy: `Stored hash ${violation.stored} does not match recomputed hash ${violation.computed}`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package, or restore it from version control\")]\n\t\t};\n\t\tcase \"providedInvariantsMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_PROVIDED_INVARIANTS_MISMATCH\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" providedInvariants in migration.json disagrees with ops.json.`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package so migration.json and ops.json agree\")]\n\t\t};\n\t\tcase \"packageUnloadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_PACKAGE_UNLOADABLE\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" could not be loaded: ${violation.detail}`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package, or restore it from version control\")]\n\t\t};\n\t\tcase \"sameSourceAndTarget\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_NOOP_SELF_EDGE\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" in space \"${violation.spaceId}\" has source equal to target (${violation.hash}) with no data invariant — a true no-op self-edge.`,\n\t\t\tnextActions: [chooseAction(\"Add a data operation if this self-edge was meant to carry a data invariant\"), chooseAction(\"Or delete the migration if it is a true no-op\")]\n\t\t};\n\t\tcase \"orphanSpaceDir\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_ORPHAN_SPACE_DIR\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Contract-space directory \"${violation.spaceId}\" exists on disk but no extension declares it.`,\n\t\t\tnextActions: [chooseAction(\"Remove the orphan directory\"), chooseAction(\"Or declare the extension in `extensions`\")]\n\t\t};\n\t\tcase \"declaredButUnmigrated\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_DECLARED_BUT_UNMIGRATED\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Extension \"${violation.spaceId}\" is declared in \\`extensions\\` but has no on-disk migrations directory.`,\n\t\t\tnextActions: [runCommandAction(\"Re-emit the extension contract-space artefacts, then plan its migrations\", \"prisma-cli contract emit\"), chooseAction(\"Or remove the extension from `extensions` if it is unused\")]\n\t\t};\n\t\tcase \"headRefMissing\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HEAD_REF_MISSING\",\n\t\t\twhere: refRelative(violation.spaceId, \"head\"),\n\t\t\twhy: `Head ref \\`refs/head.json\\` is missing for contract space \"${violation.spaceId}\".`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the contract-space migrations and head ref artefacts\"), chooseAction(\"Or restore `refs/head.json` from version control\")]\n\t\t};\n\t\tcase \"headRefNotInGraph\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HEAD_REF_NOT_IN_GRAPH\",\n\t\t\twhere: refRelative(violation.spaceId, \"head\"),\n\t\t\twhy: `Head ref ${violation.hash} for contract space \"${violation.spaceId}\" is not present in its migration graph.`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the contract-space migrations\"), chooseAction(\"Or restore the missing migration package\")]\n\t\t};\n\t\tcase \"refUnreadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_REF_UNREADABLE\",\n\t\t\twhere: refRelative(violation.spaceId, violation.refName),\n\t\t\twhy: `Ref \"${violation.refName}\" for contract space \"${violation.spaceId}\" is unreadable: ${violation.detail}`,\n\t\t\tnextActions: [chooseAction(\"Repair or remove the corrupt ref file\")]\n\t\t};\n\t\tcase \"targetMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_TARGET_MISMATCH\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Contract space \"${violation.spaceId}\" targets \"${violation.actual}\" but the project targets \"${violation.expected}\".`,\n\t\t\tnextActions: [chooseAction(\"Update the extension to target the configured database\"), chooseAction(\"Or change the project target\")]\n\t\t};\n\t\tcase \"disjointness\": return {\n\t\t\tspace: \"app\",\n\t\t\tcode: \"MIGRATION.CHECK_SPACE_DISJOINTNESS_VIOLATION\",\n\t\t\twhere: migrationPathRelative(migrationsDir),\n\t\t\twhy: `Storage element \"${violation.element}\" is claimed by multiple contract spaces: ${violation.claimedBy.join(\", \")}.`,\n\t\t\tnextActions: [chooseAction(\"Update the contracts so each storage element is owned by exactly one contract space\")]\n\t\t};\n\t\tcase \"contractUnreadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_CONTRACT_UNREADABLE\",\n\t\t\twhere: migrationFileRelative(join(migrationsDir, violation.spaceId), \"contract.json\"),\n\t\t\twhy: `Contract for space \"${violation.spaceId}\" is unreadable: ${violation.detail}`,\n\t\t\tnextActions: [runCommandAction(\"Re-emit the extension contract artefacts\", \"prisma-cli contract emit\"), chooseAction(\"Or fix the descriptor producing the invalid contract\")]\n\t\t};\n\t\tcase \"duplicateMigrationHash\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_DUPLICATE_MIGRATION_HASH\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Multiple migrations in space \"${violation.spaceId}\" share migrationHash \"${violation.migrationHash}\" (${violation.dirNames.join(\", \")}).`,\n\t\t\tnextActions: [chooseAction(\"Re-emit one of the conflicting packages so each migrationHash is unique\")]\n\t\t};\n\t}\n}\n//#endregion\n//#region src/orm/migration/check.ts\n/**\n* The check completed and the artifacts it read are not internally consistent.\n* The findings ride the envelope as diagnostics; the run itself did its job,\n* which is why this is not an errored settlement.\n*/\nconst FINDINGS_EXIT_CODE = 4;\n/**\n* One integrity failure as an envelope diagnostic. `error` is the honest\n* severity: nothing about the artifacts is merely worth a look, and exit 4\n* makes it legal — the engine refuses a severity-`error` diagnostic only on a\n* run that exits 0.\n*\n* The summary leads with the path because the engine's diagnostic renderer\n* prints `code`, `summary`, `why` and the next actions and never prints\n* `where`. Several failure texts name no package on their own — a hash\n* mismatch reads \"Stored hash X does not match recomputed hash Y\" — so\n* without the path a project with fifty migrations cannot be told which one\n* is broken. `where` still carries the path on its own for a `--json`\n* consumer.\n*/\nfunction failureDiagnostic(failure) {\n\tif (!isStructuredErrorCode(failure.code)) throw new InternalError(`migration check produced the failure code \"${failure.code}\", which is not a dotted NAMESPACE.SUBCODE.`);\n\treturn {\n\t\tcode: failure.code,\n\t\tseverity: \"error\",\n\t\tsummary: `${failure.where}: ${failure.why}`,\n\t\tnextActions: failure.nextActions,\n\t\twhere: { path: failure.where },\n\t\tmeta: { space: failure.space }\n\t};\n}\nfunction checkPresentations(inputs) {\n\tconst summary = inputs.resolvedSpaceId === void 0 ? inputs.document.summary : `${inputs.document.summary} (space: ${inputs.resolvedSpaceId})`;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsRelative\n\t\t\t\t},\n\t\t\t\t...inputs.target === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"target\",\n\t\t\t\t\tvalue: inputs.target\n\t\t\t\t}],\n\t\t\t\t...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]\n\t\t\t]\n\t\t}, {\n\t\t\tkind: \"summary\",\n\t\t\tstatus: inputs.document.ok ? \"ok\" : \"error\",\n\t\t\ttext: summary\n\t\t}],\n\t\tjson: () => inputs.document\n\t};\n}\nconst migrationCheckCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Verify artifact and graph integrity\",\n\t\tdescription: \"Validates that on-disk migration packages are internally consistent\\n(hashes match, manifests are complete) and that the graph is well-formed\\n(edges connect, refs point at valid nodes). The whole-graph check spans\\nevery contract space by default; pass --space <id> to narrow to one. A\\nmigration reference checks a single package, resolved across all contract\\nspaces (narrow with --space; an ambiguous reference cannot be checked).\\nOffline — does not consult the database.\\nExit codes: 0 = all checks passed, 2 = precondition failed (unresolved\\ntarget or unknown --space), 4 = integrity failure(s) found.\",\n\t\texamples: [\n\t\t\t\"migration check\",\n\t\t\t\"migration check --space app\",\n\t\t\t\"migration check 20260101-add-users\",\n\t\t\t\"migration check 20260101-add-users --space app\",\n\t\t\t\"migration check --json\"\n\t\t]\n\t},\n\targs: {\n\t\tpositionals: { target: positional.optionalString({\n\t\t\tbrief: \"Migration reference: directory name, hash/prefix, ref, or path\",\n\t\t\tplaceholder: \"target\"\n\t\t}) },\n\t\tflags: { space: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}) }\n\t},\n\tneeds: { config: ormConfigSection },\n\texitCodes: { 4: \"integrity check found failures\" },\n\thandler: async (args, ctx) => {\n\t\tconst { target } = args.positionals;\n\t\tconst spaceFilter = args.flags.space;\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsDir = appMigrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsRelative = displayPath(appMigrationsDir, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst spaces = await enumerateCheckSpaces(loaded.value.aggregate, migrationsDir, ctx.cwd);\n\t\tlet document;\n\t\tlet resolvedSpaceId;\n\t\tif (target !== void 0) {\n\t\t\tconst outcome = await checkSingleTarget(target, {\n\t\t\t\tspaces,\n\t\t\t\t...ifDefined(\"spaceFilter\", spaceFilter),\n\t\t\t\tappMigrationsDir,\n\t\t\t\tappMigrationsRelative,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (outcome.error !== void 0) return notOk$1(normalizeError(outcome.error));\n\t\t\tconst result = outcome.result;\n\t\t\tif (result === void 0 || outcome.exitCode === 2) return notOk$1(normalizeError(errorMigrationPackageNotFound(result?.summary ?? `Migration package for \"${target}\" not found on disk`)));\n\t\t\tdocument = result;\n\t\t\tresolvedSpaceId = outcome.resolvedSpaceId;\n\t\t} else {\n\t\t\tconst checked = await runMigrationCheck({\n\t\t\t\tspaces,\n\t\t\t\t...ifDefined(\"spaceFilter\", spaceFilter)\n\t\t\t});\n\t\t\tif (!checked.ok) return notOk$1(normalizeError(checked.failure));\n\t\t\tconst violations = await loadAggregateIntegrityViolations(ctx.config, migrationsDir);\n\t\t\tconst scoped = spaceFilter === void 0 ? violations : violations.filter((violation) => violation.kind !== \"disjointness\" && violation.spaceId === spaceFilter);\n\t\t\tconst failures = [...checked.value.failures, ...scoped.map((violation) => integrityViolationToCheckFailure(violation, migrationsDir))];\n\t\t\tdocument = failures.length === 0 ? {\n\t\t\t\tok: true,\n\t\t\t\tfailures: [],\n\t\t\t\tsummary: \"All checks passed\"\n\t\t\t} : {\n\t\t\t\tok: false,\n\t\t\t\tfailures: [...failures],\n\t\t\t\tsummary: `${failures.length} integrity failure(s)`\n\t\t\t};\n\t\t}\n\t\tconst diagnostics = document.failures.map(failureDiagnostic);\n\t\treturn ok$1(ctx.present({\n\t\t\tdata: document,\n\t\t\texitCode: diagnostics.length === 0 ? 0 : FINDINGS_EXIT_CODE,\n\t\t\tdiagnostics\n\t\t}, checkPresentations({\n\t\t\tdocument,\n\t\t\tmigrationsRelative: appMigrationsRelative,\n\t\t\ttarget,\n\t\t\tspace: spaceFilter,\n\t\t\tresolvedSpaceId\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/utils/formatters/migration-graph-sections.ts\n/**\n* One tree per in-scope contract space. Widths are computed across every space\n* first so multi-space sections align with each other.\n*/\nfunction buildMigrationGraphTreeSections(inputs) {\n\tconst { aggregate, scopedSpaces, liveContractHash, glyphMode, colorize } = inputs;\n\tconst showSpaceHeadings = scopedSpaces.length > 1;\n\tconst globalLayoutInputs = showSpaceHeadings ? scopedSpaces.filter((entry) => entry.migrations.length > 0).flatMap((entry) => {\n\t\tconst graph = aggregate.space(entry.space)?.graph();\n\t\treturn graph === void 0 ? [] : [{\n\t\t\tgraph,\n\t\t\tliveContractHash\n\t\t}];\n\t}) : [];\n\tconst globalMaxEdgeTreePrefixWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxEdgeTreePrefixWidth(globalLayoutInputs) : void 0;\n\tconst globalMaxDirNameWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxDirNameWidth(globalLayoutInputs) : void 0;\n\tconst sections = [];\n\tfor (const entry of scopedSpaces) {\n\t\tconst space = aggregate.space(entry.space);\n\t\tif (space === void 0) continue;\n\t\tconst tree = entry.migrations.length === 0 ? \"\" : renderMigrationGraphSpaceTree({\n\t\t\tgraph: space.graph(),\n\t\t\tmigrations: entry.migrations,\n\t\t\tliveContractHash,\n\t\t\tglyphMode,\n\t\t\tcolorize,\n\t\t\tisAppSpace: entry.space === aggregate.app.spaceId,\n\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\t...inputs.styler !== void 0 ? { styler: inputs.styler } : {},\n\t\t\t...inputs.palette !== void 0 ? { palette: inputs.palette } : {},\n\t\t\t...globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth } : {},\n\t\t\t...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}\n\t\t});\n\t\tsections.push({\n\t\t\tspace: entry.space,\n\t\t\ttree: showSpaceHeadings && tree.length > 0 ? indentMigrationGraphTreeBlock(tree, \" \") : tree,\n\t\t\tshowHeading: showSpaceHeadings\n\t\t});\n\t}\n\treturn sections;\n}\n/** The rendered tree, headings and summary as one block of lines. */\nfunction renderMigrationGraphSections(sections, summary) {\n\tconst lines = [];\n\tfor (const section of sections) {\n\t\tif (section.showHeading) lines.push(`${section.space}:`);\n\t\tlines.push(section.tree.length > 0 ? section.tree : \"(no migrations)\");\n\t\tlines.push(\"\");\n\t}\n\tlines.push(summary);\n\treturn lines.join(\"\\n\").trimEnd();\n}\n/**\n* Graphviz DOT for the app graph. Node ids are truncated to 12 characters,\n* which is a collision hazard recorded and preserved by the port.\n*/\nfunction renderMigrationGraphDot(graph) {\n\tconst lines = [\"digraph migrations {\"];\n\tfor (const edge of graph.migrationByHash.values()) lines.push(` \"${edge.from.slice(0, 12)}\" -> \"${edge.to.slice(0, 12)}\" [label=\"${edge.dirName}\"];`);\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\n//#endregion\n//#region src/orm/migration/graph.ts\n/**\n* The tree is a drawing for a reader; the DOT document is a graph description\n* for another program, so it is also the stdout payload. It appears in both\n* surfaces because the engine treats the payload as a mirror of the human\n* output: on one shared screen it suppresses the stdout copy, so the human\n* block is what keeps `--dot` visible there, while split sinks receive both.\n*/\nfunction graphPresentations(inputs) {\n\tconst { tree, dot, legend } = inputs;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t}, ...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]]\n\t\t\t},\n\t\t\t...tree === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(tree)\n\t\t\t}],\n\t\t\t...dot === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: dot.split(\"\\n\")\n\t\t\t}],\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}]\n\t\t],\n\t\t...dot === void 0 ? {} : { stdout: () => dot.split(\"\\n\") },\n\t\tjson: () => inputs.document\n\t};\n}\nfunction graphSummary(spaces) {\n\tconst contracts = spaces.reduce((count, space) => count + space.contracts.length, 0);\n\tconst migrations = spaces.reduce((count, space) => count + space.migrations.length, 0);\n\treturn `${spaces.length} space(s), ${contracts} contract(s), ${migrations} migration(s)`;\n}\nconst migrationGraphCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show the migration graph topology\",\n\t\tdescription: \"Renders the migration graph topology. Offline — does not consult the\\ndatabase. --ascii swaps box-drawing for pipe-friendly ASCII glyphs.\\n--dot emits Graphviz DOT for the app graph instead of the tree, and\\nignores --space; in json mode the result carries the DOT text alongside\\nthe graph document.\",\n\t\texamples: [\n\t\t\t\"migration graph\",\n\t\t\t\"migration graph --json\",\n\t\t\t\"migration graph --dot\",\n\t\t\t\"migration graph --ascii\",\n\t\t\t\"migration graph --legend\",\n\t\t\t\"migration graph --space app\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tdot: flag.boolean({ brief: \"Emit Graphviz DOT for the app graph\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" }),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tif (args.flags.legend && args.flags.dot) return notOk$1(normalizeError(errorLegendHumanOnly(\"--dot\")));\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk$1(normalizeError(listed.failure));\n\t\tconst scopedSpaces = listed.value.spaces;\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst graphSpaces = [...buildMigrationSpaceGraphEntries({\n\t\t\taggregate,\n\t\t\tscopedSpaces\n\t\t})];\n\t\tconst summary = graphSummary(graphSpaces);\n\t\tconst graphDocument = {\n\t\t\tok: true,\n\t\t\tspaces: graphSpaces,\n\t\t\tsummary\n\t\t};\n\t\tconst dot = args.flags.dot ? renderMigrationGraphDot(aggregate.app.graph()) : void 0;\n\t\tconst document = dot === void 0 ? graphDocument : {\n\t\t\t...graphDocument,\n\t\t\tdot\n\t\t};\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst tree = dot === void 0 ? renderMigrationGraphSections(buildMigrationGraphTreeSections({\n\t\t\taggregate,\n\t\t\tscopedSpaces,\n\t\t\tliveContractHash,\n\t\t\tglyphMode,\n\t\t\tcolorize: true,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}), styler.summary(summary)) : void 0;\n\t\tconst legend = args.flags.legend ? renderMigrationGraphLegend({\n\t\t\tcolorize: true,\n\t\t\tglyphMode,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}) : void 0;\n\t\treturn ok$1(ctx.present({ data: document }, graphPresentations({\n\t\t\tdocument,\n\t\t\ttree,\n\t\t\tdot,\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tspace: args.flags.space,\n\t\t\tlegend\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/list.ts\nfunction listPresentations$1(inputs) {\n\tconst legend = inputs.legend;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t}, ...inputs.space === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: inputs.space\n\t\t\t\t}]]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(inputs.tree)\n\t\t\t},\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}]\n\t\t],\n\t\tjson: () => inputs.list\n\t};\n}\nconst migrationListCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"List on-disk migrations per contract space\",\n\t\tdescription: \"Enumerates every on-disk migration under migrations/<space>/ for every\\ncontract space found on disk. Offline — does not consult the database.\\nHuman output draws the shared migration graph tree with operation counts,\\ninvariants on each migration row, and refs on destination contract nodes.\\nPass --space <id> to narrow to one contract space. --ascii forces ASCII\\ntree glyphs.\",\n\t\texamples: [\n\t\t\t\"migration list\",\n\t\t\t\"migration list --space app\",\n\t\t\t\"migration list --ascii\",\n\t\t\t\"migration list --legend\",\n\t\t\t\"migration list --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tascii: flag.boolean({ brief: \"Use ASCII kind glyphs (pipe-friendly)\" }),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk$1(normalizeError(listed.failure));\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst tree = renderMigrationListWithStyle(listed.value, styler, glyphMode, {\n\t\t\tcolorize: true,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE,\n\t\t\tliveContractHash,\n\t\t\tgraphForSpace: (spaceId) => aggregate.space(spaceId)?.graph(),\n\t\t\tappSpaceId: aggregate.app.spaceId\n\t\t});\n\t\tconst legend = args.flags.legend ? renderMigrationGraphLegend({\n\t\t\tcolorize: true,\n\t\t\tglyphMode,\n\t\t\tstyler,\n\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t}) : void 0;\n\t\treturn ok$1(ctx.present({ data: listed.value }, listPresentations$1({\n\t\t\tlist: listed.value,\n\t\t\ttree,\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tspace: args.flags.space,\n\t\t\tlegend\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/utils/formatters/migration-log-table.ts\nfunction sortLedgerEntries(entries) {\n\treturn [...entries].sort((left, right) => {\n\t\tconst timeDiff = left.appliedAt.getTime() - right.appliedAt.getTime();\n\t\tif (timeDiff !== 0) return timeDiff;\n\t\tconst spaceDiff = left.space.localeCompare(right.space);\n\t\tif (spaceDiff !== 0) return spaceDiff;\n\t\treturn left.migrationName.localeCompare(right.migrationName);\n\t});\n}\nfunction pad2(value) {\n\treturn String(value).padStart(2, \"0\");\n}\nfunction formatLedgerAppliedAt(date, mode) {\n\tif (mode === \"iso\") return date.toISOString();\n\tif (mode === \"utc\") return `${date.getUTCFullYear()}-${pad2(date.getUTCMonth() + 1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}:${pad2(date.getUTCSeconds())}Z`;\n\tconst offsetMinutes = -date.getTimezoneOffset();\n\tconst sign = offsetMinutes >= 0 ? \"+\" : \"-\";\n\tconst absoluteOffset = Math.abs(offsetMinutes);\n\tconst offsetHours = pad2(Math.floor(absoluteOffset / 60));\n\tconst offsetMins = pad2(absoluteOffset % 60);\n\treturn `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())} ${pad2(date.getHours())}:${pad2(date.getMinutes())}:${pad2(date.getSeconds())} ${sign}${offsetHours}:${offsetMins}`;\n}\nfunction styleHashTransition(from, to, styler, glyphMode = \"unicode\") {\n\treturn `${from === null ? styler.glyph(migrationListEmptySource(glyphMode)) : styler.sourceHash(abbreviateContractHash(from))} ${styler.glyph(migrationListForwardArrow(glyphMode))} ${styler.destHash(abbreviateContractHash(to))}`;\n}\nfunction serializeLedgerEntriesForJson(entries) {\n\treturn sortLedgerEntries(entries).map((entry) => ({\n\t\tspace: entry.space,\n\t\tname: entry.migrationName,\n\t\thash: entry.migrationHash,\n\t\tfromContract: entry.from,\n\t\ttoContract: entry.to,\n\t\tappliedAt: formatLedgerAppliedAt(entry.appliedAt, \"iso\"),\n\t\toperationCount: entry.operationCount\n\t}));\n}\nconst MIGRATION_LOG_EMPTY_MESSAGE = \"No migrations have been applied to this database.\";\n//#endregion\n//#region src/orm/migration/log.ts\nconst HEADING_APPLIED_AT = \"Applied at\";\nconst HEADING_SPACE = \"Space\";\nconst HEADING_MIGRATION = \"Migration\";\nconst HEADING_CHANGE = \"Change\";\nconst HEADING_OPS = \"Ops\";\n/**\n* The ledger laid out for the engine to size. The Space heading appears only\n* when more than one contract space has run, as it does in the commander shell.\n*/\nfunction ledgerGrid(entries, options) {\n\tconst styler = createToneMigrationListStyler();\n\tconst sorted = sortLedgerEntries(entries);\n\tconst showSpace = new Set(sorted.map((entry) => entry.space)).size > 1;\n\tconst headings = [HEADING_APPLIED_AT];\n\tif (showSpace) headings.push(HEADING_SPACE);\n\theadings.push(HEADING_MIGRATION, HEADING_CHANGE, HEADING_OPS);\n\treturn {\n\t\theadings,\n\t\trows: sorted.map((entry) => {\n\t\t\tconst cells = [formatLedgerAppliedAt(entry.appliedAt, options.utc ? \"utc\" : \"local\")];\n\t\t\tif (showSpace) cells.push(entry.space);\n\t\t\tcells.push(toneSpans(styler.dirName(entry.migrationName)), toneSpans(styleHashTransition(entry.from, entry.to, styler, options.glyphMode)), `${entry.operationCount} ops`);\n\t\t\treturn cells;\n\t\t})\n\t};\n}\nfunction logPresentations(inputs) {\n\tconst grid = inputs.grid;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [...inputs.database === void 0 ? [] : [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [{\n\t\t\t\tlabel: \"database\",\n\t\t\t\tvalue: inputs.database\n\t\t\t}]\n\t\t}], ...grid === void 0 ? [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: MIGRATION_LOG_EMPTY_MESSAGE\n\t\t}] : [{\n\t\t\tkind: \"table\",\n\t\t\tcolumns: grid.headings,\n\t\t\trows: grid.rows\n\t\t}]],\n\t\tjson: () => inputs.document\n\t};\n}\nconst migrationLogCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show executed migration history\",\n\t\tdescription: \"Reads the database ledger and displays every applied migration edge in\\nchronological order, including rollbacks and re-applies, merged across\\nall contract spaces. Requires a database connection.\",\n\t\texamples: [\n\t\t\t\"migration log\",\n\t\t\t\"migration log --db $DATABASE_URL\",\n\t\t\t\"migration log --utc\",\n\t\t\t\"migration log --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tdb: dbFlag,\n\t\tutc: flag.boolean({ brief: \"Render human timestamps in UTC instead of local time\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\tconst missingDb = requireLiveDatabase({\n\t\t\tdbConnection,\n\t\t\thasDriver: ctx.config.driver !== void 0,\n\t\t\twhy: \"migration log needs a database connection and driver to read the ledger (set db.connection in prisma.config.ts, or pass --db <url>)\",\n\t\t\tcommandName: \"migration log\"\n\t\t});\n\t\tif (missingDb !== null) return notOk$1(normalizeError(missingDb));\n\t\tif (!targetSupportsMigrations(ctx.config.target)) return notOk$1(normalizeError(errorTargetMigrationNotSupported({ why: \"migration log reads the ledger a migration runner writes, and the configured target provides no runner.\" })));\n\t\tconst client = createControlClient({\n\t\t\tfamily: ctx.config.family,\n\t\t\ttarget: ctx.config.target,\n\t\t\tadapter: ctx.config.adapter,\n\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\textensions: ctx.config.extensions ?? []\n\t\t});\n\t\tlet entries;\n\t\ttry {\n\t\t\tawait client.connect(dbConnection);\n\t\t\tentries = await client.readLedger();\n\t\t} catch (error) {\n\t\t\treturn notOk$1(normalizeError(mapCaughtMigrationError(error) ?? errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read migration log: ${error instanceof Error ? error.message : String(error)}` })));\n\t\t} finally {\n\t\t\tawait closeQuietly(client);\n\t\t}\n\t\tconst records = serializeLedgerEntriesForJson(entries);\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\trecords,\n\t\t\tsummary: `${records.length} migration(s) applied`\n\t\t};\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\treturn ok$1(ctx.present({ data: document }, logPresentations({\n\t\t\tdocument,\n\t\t\tgrid: entries.length === 0 ? void 0 : ledgerGrid(entries, {\n\t\t\t\tutc: args.flags.utc,\n\t\t\t\tglyphMode\n\t\t\t}),\n\t\t\tdatabase: typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/new.ts\nfunction newPresentations(inputs) {\n\tconst { document } = inputs;\n\tconst migrationTs = join(document.dir, \"migration.ts\");\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.appMigrationsRelative\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: document.summary\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [{\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: document.from === null ? [{\n\t\t\t\t\t\ttext: \"(baseline)\",\n\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t}] : [{\n\t\t\t\t\t\ttext: document.from,\n\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t}]\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: [{\n\t\t\t\t\t\ttext: document.to,\n\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t}]\n\t\t\t\t}]\n\t\t\t}\n\t\t],\n\t\tjson: () => document,\n\t\tnext: () => [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: `Write the migration body in ${migrationTs}`\n\t\t}, runCommandAction(\"Run it to self-emit ops.json and attest the package\", `node \"${migrationTs}\"`)]\n\t};\n}\nconst migrationNewCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Scaffold a new migration for manual authoring\",\n\t\tdescription: \"Creates a migration package with a migration.ts file for manual authoring.\\nWrite the migration body in migration.ts, then run the file with Node\\n(`node migration.ts`) to self-emit ops.json and attest the package.\\nOffline — does not consult the database.\",\n\t\texamples: [\n\t\t\t\"migration new --name split-name\",\n\t\t\t\"migration new --name custom-fk --from abc123\",\n\t\t\t\"migration new --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tname: flag.string({\n\t\t\tbrief: \"Migration name (used in directory name)\",\n\t\t\tplaceholder: \"slug\"\n\t\t}),\n\t\tfrom: flag.string({\n\t\t\tbrief: \"Starting contract hash (default: latest migration target)\",\n\t\t\tplaceholder: \"hash\"\n\t\t})\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst scaffolded = await executeMigrationNewCommand({\n\t\t\tconfig: ctx.config,\n\t\t\tcwd: ctx.cwd,\n\t\t\tconfigPath: projectConfigPathFor(ctx.cwd),\n\t\t\t...ifDefined(\"name\", args.flags.name),\n\t\t\t...ifDefined(\"from\", args.flags.from)\n\t\t});\n\t\tif (!scaffolded.ok) return notOk$1(normalizeError(scaffolded.failure));\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\treturn ok$1(ctx.present({ data: scaffolded.value }, newPresentations({\n\t\t\tdocument: scaffolded.value,\n\t\t\tcontractPath: contractPath === void 0 ? \"(unset)\" : displayPath(contractPath, ctx.cwd),\n\t\t\tappMigrationsRelative: displayPath(appMigrationsDirFor(ctx.config, ctx.cwd), ctx.cwd)\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/plan.ts\nfunction hashRow(label, hash) {\n\treturn {\n\t\tlabel,\n\t\tvalue: hash === null ? [{\n\t\t\ttext: \"(baseline)\",\n\t\t\ttone: \"muted\"\n\t\t}] : [{\n\t\t\ttext: hash,\n\t\t\ttone: \"identifier\"\n\t\t}]\n\t};\n}\n/**\n* Where the run put things: the contract edge it planned, then every directory\n* it wrote — the app-space package, the auto-baseline package that precedes it,\n* and any extension-space package the seed phase materialised.\n*/\nfunction outcomeFields(result, migrationsRelative) {\n\treturn {\n\t\tkind: \"fields\",\n\t\trows: [\n\t\t\thashRow(\"from\", result.from),\n\t\t\thashRow(\"to\", result.to),\n\t\t\t...result.baselineDir === void 0 ? [] : [{\n\t\t\t\tlabel: \"baseline\",\n\t\t\t\tvalue: result.baselineDir\n\t\t\t}],\n\t\t\t...result.dir === void 0 ? [] : [{\n\t\t\t\tlabel: \"app space\",\n\t\t\t\tvalue: result.dir\n\t\t\t}],\n\t\t\t...result.emittedExtensionDirs.map((entry) => ({\n\t\t\t\tlabel: `space ${entry.spaceId}`,\n\t\t\t\tvalue: join(migrationsRelative, entry.spaceId, entry.dirName)\n\t\t\t}))\n\t\t]\n\t};\n}\nfunction operationNodes$1(result) {\n\treturn result.operations.map((operation) => operation.operationClass === \"destructive\" ? {\n\t\tlabel: operation.label,\n\t\tstatus: \"warn\"\n\t} : { label: operation.label });\n}\nfunction operationBlocks$1(result) {\n\tif (result.operations.length === 0) return [];\n\tconst destructive = result.operations.some((operation) => operation.operationClass === \"destructive\");\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: [{\n\t\t\tlabel: result.dir ?? \"operations\",\n\t\t\tchildren: operationNodes$1(result)\n\t\t}]\n\t}, ...destructive ? [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"This migration contains destructive operations that may cause data loss.\"\n\t}] : []];\n}\n/** Statements a database would run, printed verbatim rather than laid out. */\nfunction previewBlocks$1(result) {\n\tconst preview = result.preview;\n\tif (preview === void 0) return [];\n\tconst statements = preview.statements.map((statement) => statement.text.trim()).filter((text) => text.length > 0).map((text) => text.endsWith(\";\") ? text : `${text};`);\n\tif (statements.length === 0) return [];\n\treturn [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: previewBlockHeader(preview)\n\t}, {\n\t\tkind: \"drawing\",\n\t\tlines: statements\n\t}];\n}\nfunction planBlocks(result, migrationsRelative) {\n\tconst outcome = outcomeFields(result, migrationsRelative);\n\tif (result.noOp) return [{\n\t\tkind: \"summary\",\n\t\tstatus: \"ok\",\n\t\ttext: \"No changes detected\"\n\t}, outcome];\n\tif (result.pendingPlaceholders === true) return [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: result.summary\n\t}, outcome];\n\treturn [\n\t\t{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: result.summary\n\t\t},\n\t\t...operationBlocks$1(result),\n\t\toutcome,\n\t\t...previewBlocks$1(result)\n\t];\n}\nfunction planNextActions(result, migrationsRelative) {\n\tif (result.pendingPlaceholders === true) {\n\t\tconst migrationTs = join(result.dir ?? \"<dir>\", \"migration.ts\");\n\t\treturn [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: `Replace each placeholder(...) call in ${migrationTs} with your query`\n\t\t}, runCommandAction(\"Run it to self-emit ops.json and attest the package\", `node \"${migrationTs}\"`)];\n\t}\n\tconst written = [\n\t\t...result.baselineDir === void 0 ? [] : [result.baselineDir],\n\t\t...result.dir === void 0 ? [] : [result.dir],\n\t\t...result.emittedExtensionDirs.map((entry) => join(migrationsRelative, entry.spaceId, entry.dirName))\n\t];\n\tif (written.length === 0) return [];\n\treturn [{\n\t\tkind: \"edit-file\",\n\t\tlabel: `Review ${written.join(\" and \")}`\n\t}, runCommandAction(\"Apply the migration\", \"prisma-cli migrate\")];\n}\nfunction planPresentations(inputs) {\n\treturn {\n\t\tstdout: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"fields\",\n\t\t\trail: true,\n\t\t\trows: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: inputs.appMigrationsRelative\n\t\t\t\t},\n\t\t\t\t...inputs.from === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: inputs.from\n\t\t\t\t}],\n\t\t\t\t...inputs.to === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: inputs.to\n\t\t\t\t}],\n\t\t\t\t...inputs.name === void 0 ? [] : [{\n\t\t\t\t\tlabel: \"name\",\n\t\t\t\t\tvalue: inputs.name\n\t\t\t\t}]\n\t\t\t]\n\t\t}, ...planBlocks(inputs.document, inputs.migrationsRelative)],\n\t\tjson: () => inputs.document,\n\t\tnext: () => planNextActions(inputs.document, inputs.migrationsRelative)\n\t};\n}\nconst migrationPlanCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Plan a migration from contract changes\",\n\t\tdescription: \"Compares the emitted contract against the latest on-disk migration state\\nand produces a new migration package with the required operations.\\nOffline — does not consult the database.\",\n\t\texamples: [\n\t\t\t\"migration plan\",\n\t\t\t\"migration plan --name add-users-table\",\n\t\t\t\"migration plan --to <migration-dir>^ --name rollback\",\n\t\t\t\"migration plan --json\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tname: flag.string({\n\t\t\tbrief: \"Name slug for the migration directory\",\n\t\t\tplaceholder: \"slug\"\n\t\t}),\n\t\tfrom: flag.string({\n\t\t\tbrief: \"Starting contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\",\n\t\t\tplaceholder: \"contract\"\n\t\t}),\n\t\tto: flag.string({\n\t\t\tbrief: \"Destination contract reference; defaults to the emitted contract. Same grammar as --from\",\n\t\t\tplaceholder: \"contract\"\n\t\t})\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst seeded = (record) => {\n\t\t\tif (record.action !== \"updated\") return;\n\t\t\tconst step = `Seed contract space ${record.spaceId}`;\n\t\t\tctx.report({\n\t\t\t\tkind: \"step-started\",\n\t\t\t\tstep,\n\t\t\t\tid: record.spaceId\n\t\t\t});\n\t\t\tctx.report({\n\t\t\t\tkind: \"step-finished\",\n\t\t\t\tstep,\n\t\t\t\tid: record.spaceId,\n\t\t\t\toutcome: \"ok\",\n\t\t\t\tdata: {\n\t\t\t\t\tnewHash: record.newHash,\n\t\t\t\t\tnewMigrationDirs: record.newMigrationDirs\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tconst planned = await executeMigrationPlanCommand({\n\t\t\tconfig: ctx.config,\n\t\t\tcwd: ctx.cwd,\n\t\t\tconfigPath: projectConfigPathFor(ctx.cwd),\n\t\t\t...ifDefined(\"name\", args.flags.name),\n\t\t\t...ifDefined(\"from\", args.flags.from),\n\t\t\t...ifDefined(\"to\", args.flags.to)\n\t\t}, Date.now(), { onSeeded: seeded });\n\t\tif (!planned.ok) return notOk$1(normalizeError(planned.failure));\n\t\tctx.report({\n\t\t\tkind: \"message\",\n\t\t\tseverity: \"verbose\",\n\t\t\ttext: `Total time: ${planned.value.timings.total}ms`\n\t\t});\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\treturn ok$1(ctx.present({ data: planned.value }, planPresentations({\n\t\t\tdocument: planned.value,\n\t\t\tcontractPath: contractPath === void 0 ? \"(unset)\" : displayPath(contractPath, ctx.cwd),\n\t\t\tappMigrationsRelative: displayPath(appMigrationsDirFor(ctx.config, ctx.cwd), ctx.cwd),\n\t\t\tmigrationsRelative: displayPath(migrationsDirFor(ctx.config, ctx.cwd), ctx.cwd),\n\t\t\tfrom: args.flags.from,\n\t\t\tto: args.flags.to,\n\t\t\tname: args.flags.name\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/show.ts\n/** One node per operation, the destructive ones carrying the warning glyph. */\nfunction operationNodes(migration) {\n\treturn migration.operations.map((operation) => operation.operationClass === \"destructive\" ? {\n\t\tlabel: operation.label,\n\t\tstatus: \"warn\"\n\t} : { label: operation.label });\n}\nfunction operationBlocks(migration) {\n\tif (migration.operations.length === 0) return [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttext: \"No operations.\"\n\t}];\n\tconst destructive = migration.operations.some((operation) => operation.operationClass === \"destructive\");\n\treturn [{\n\t\tkind: \"tree\",\n\t\troots: [{\n\t\t\tlabel: `${migration.operations.length} operation(s)`,\n\t\t\tchildren: operationNodes(migration)\n\t\t}]\n\t}, ...destructive ? [{\n\t\tkind: \"summary\",\n\t\tstatus: \"warn\",\n\t\ttext: \"This migration contains destructive operations that may cause data loss.\"\n\t}] : []];\n}\n/**\n* The statement preview: text a database would run, printed verbatim rather\n* than laid out, so nothing is re-wrapped between here and the reader.\n*/\nfunction previewBlocks(migration) {\n\tconst statements = migration.preview.statements.map((statement) => renderPreviewStatement(statement.text, statement.language)).filter((text) => text !== void 0);\n\tif (statements.length === 0) return [];\n\treturn [{\n\t\tkind: \"summary\",\n\t\tstatus: \"info\",\n\t\ttone: \"muted\",\n\t\ttext: previewBlockHeader(migration.preview)\n\t}, {\n\t\tkind: \"drawing\",\n\t\tlines: statements\n\t}];\n}\nfunction showPresentations(inputs) {\n\tconst migration = inputs.document.migration;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"contract\",\n\t\t\t\t\t\tvalue: inputs.contractPath\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.appMigrationsRelative\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"target\",\n\t\t\t\t\t\tvalue: inputs.target\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: [{\n\t\t\t\t\ttext: migration.name,\n\t\t\t\t\ttone: \"emphasis\"\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\t\tvalue: migration.fromContract === null ? [{\n\t\t\t\t\t\t\ttext: \"(baseline)\",\n\t\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t\t}] : [{\n\t\t\t\t\t\t\ttext: migration.fromContract,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.toContract,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"hash\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.hash,\n\t\t\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"created\",\n\t\t\t\t\t\tvalue: [{\n\t\t\t\t\t\t\ttext: migration.createdAt,\n\t\t\t\t\t\t\ttone: \"muted\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t...operationBlocks(migration),\n\t\t\t...previewBlocks(migration)\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\n/**\n* A path-looking target must land inside `migrations/app/`; anything else is a\n* migration reference resolved against the app graph and refs. Both routes are\n* app-space only, as they are today.\n*/\nfunction resolvePackage(inputs) {\n\tif (looksLikePath(inputs.target)) {\n\t\tconst path = resolveAppTargetPath(inputs.cwd, inputs.target, inputs.appMigrationsDir, inputs.appMigrationsRelative);\n\t\tif (!path.ok) return notOk$1(normalizeError(path.failure));\n\t\tconst matched = findPackageByDirPath(inputs.packages, path.value);\n\t\treturn matched === void 0 ? notOk$1(normalizeError(errorMigrationPackageNotFound(`No loaded migration package at ${relative(inputs.cwd, path.value)}`))) : ok$1(matched);\n\t}\n\tif (inputs.packages.length === 0) return notOk$1(normalizeError(errorNoMigrations(inputs.appMigrationsRelative)));\n\tconst ref = resolveMigrationRef(inputs.target, {\n\t\tgraph: inputs.graph,\n\t\trefs: inputs.refs\n\t});\n\tif (!ref.ok) return notOk$1(normalizeError(ref.failure));\n\tconst matched = inputs.packages.find((candidate) => candidate.metadata.migrationHash === ref.value.migrationHash);\n\treturn matched === void 0 ? notOk$1(normalizeError(errorMigrationPackageNotFound(`Resolved migration \"${ref.value.dirName}\" but the package was not loaded`))) : ok$1(matched);\n}\nconst migrationShowCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Display migration package contents\",\n\t\tdescription: \"Shows the operations, statement preview, and metadata for one app-space\\nmigration. Accepts a directory path, directory name, or hash prefix.\\nOffline — does not consult the database.\",\n\t\texamples: [\n\t\t\t\"migration show 20260101_100000_add_user\",\n\t\t\t\"migration show a1b2c3\",\n\t\t\t\"migration show migrations/app/20260101_100000_add_user\",\n\t\t\t\"migration show 20260101_100000_add_user --json\"\n\t\t]\n\t},\n\targs: { positionals: { target: positional.string({\n\t\tbrief: \"Migration reference: directory name, hash/prefix, ref, or path\",\n\t\tplaceholder: \"target\"\n\t}) } },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst { target } = args.positionals;\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\tif (contractPath === void 0) return notOk$1(normalizeError(errorConfigValidation(\"contract.output\", {\n\t\t\twhy: \"migration show reads the emitted contract from config.contract.output; the config has no value to read.\",\n\t\t\tsection: \"contract\"\n\t\t})));\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsDir = appMigrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst appMigrationsRelative = displayPath(appMigrationsDir, ctx.cwd);\n\t\tlet contractJson;\n\t\ttry {\n\t\t\tcontractJson = await readFile(contractPath, \"utf-8\");\n\t\t} catch (error) {\n\t\t\treturn notOk$1(normalizeError(Reflect.get(Object(error), \"code\") === \"ENOENT\" ? errorFileNotFound(contractPath, {\n\t\t\t\twhy: `Contract file not found at ${contractPath}`,\n\t\t\t\tfix: `Run \\`prisma-cli contract emit\\` to generate ${relative(ctx.cwd, contractPath)}`\n\t\t\t}) : errorUnexpected(error instanceof Error ? error.message : String(error), { why: \"Failed to read contract file\" })));\n\t\t}\n\t\tconst familyInstance = ctx.config.family.create(createControlStack(ctx.config));\n\t\tlet appContract;\n\t\ttry {\n\t\t\tappContract = familyInstance.deserializeContract(castAs(JSON.parse(contractJson)));\n\t\t} catch (error) {\n\t\t\treturn notOk$1(normalizeError(errorContractValidationFailed(`Contract at ${contractPath} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPath } })));\n\t\t}\n\t\tconst loaded = await loadContractSpaceAggregateForCli({\n\t\t\ttargetId: ctx.config.target.targetId,\n\t\t\tmigrationsDir,\n\t\t\tappContract,\n\t\t\textensions: [],\n\t\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t\t});\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst aggregate = loaded.value;\n\t\tconst resolved = resolvePackage({\n\t\t\ttarget,\n\t\t\tcwd: ctx.cwd,\n\t\t\tappMigrationsDir,\n\t\t\tappMigrationsRelative,\n\t\t\tpackages: aggregate.app.packages,\n\t\t\tgraph: aggregate.app.graph(),\n\t\t\trefs: aggregate.app.refs\n\t\t});\n\t\tif (!resolved.ok) return notOk$1(resolved.failure);\n\t\tconst pkg = resolved.value;\n\t\tconst client = createControlClient({\n\t\t\tfamily: ctx.config.family,\n\t\t\ttarget: ctx.config.target,\n\t\t\tadapter: ctx.config.adapter,\n\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\textensions: ctx.config.extensions ?? []\n\t\t});\n\t\tconst ops = castAs(pkg.ops);\n\t\tconst preview = client.toOperationPreview(ops) ?? { statements: [] };\n\t\tconst migration = {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tname: pkg.dirName,\n\t\t\thash: pkg.metadata.migrationHash,\n\t\t\tfromContract: pkg.metadata.from,\n\t\t\ttoContract: pkg.metadata.to,\n\t\t\tcreatedAt: pkg.metadata.createdAt,\n\t\t\toperations: ops.map((op) => ({\n\t\t\t\tid: op.id,\n\t\t\t\tlabel: op.label,\n\t\t\t\toperationClass: op.operationClass\n\t\t\t})),\n\t\t\tpreview: { statements: [...preview.statements] }\n\t\t};\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\tsummary: `Migration ${migration.name} in ${migration.space}: ${migration.operations.length} operation(s)`,\n\t\t\tmigration\n\t\t};\n\t\treturn ok$1(ctx.present({ data: document }, showPresentations({\n\t\t\tdocument,\n\t\t\tcontractPath: displayPath(contractPath, ctx.cwd),\n\t\t\tappMigrationsRelative,\n\t\t\ttarget\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/migration/status-findings.ts\nconst EMIT_CONTRACT = runCommandAction(\"Regenerate the contract\", \"prisma-cli contract emit\");\nfunction contractUnreadableFinding(reason) {\n\tconst message = `Could not read contract: ${reason}`;\n\treturn {\n\t\tdocument: {\n\t\t\tcode: \"CONTRACT.UNREADABLE\",\n\t\t\tseverity: \"warn\",\n\t\t\tmessage,\n\t\t\thints: [\"Run 'prisma-cli contract emit' to generate a valid contract\"]\n\t\t},\n\t\tdiagnostic: {\n\t\t\tcode: \"CONTRACT.UNREADABLE\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: message,\n\t\t\twhy: \"The status tree falls back to the on-disk migration graph when the emitted contract cannot be read.\",\n\t\t\tnextActions: [EMIT_CONTRACT]\n\t\t}\n\t};\n}\nfunction markerNotInHistoryFinding(space) {\n\tconst message = `Database was updated outside the migration system (marker for space \"${space}\" does not match any migration)`;\n\treturn {\n\t\tdocument: {\n\t\t\tcode: \"MIGRATION.MARKER_NOT_IN_HISTORY\",\n\t\t\tseverity: \"warn\",\n\t\t\tmessage,\n\t\t\thints: [\"Run 'prisma-cli db sign' to overwrite the marker if the database already matches the contract\", \"Run 'prisma-cli db update' to push the current contract to the database\"]\n\t\t},\n\t\tdiagnostic: {\n\t\t\tcode: \"MIGRATION.MARKER_NOT_IN_HISTORY\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: message,\n\t\t\twhy: \"The marker the database carries names no contract in the on-disk migration graph.\",\n\t\t\tmeta: { space },\n\t\t\tnextActions: [runCommandAction(\"Overwrite the marker if the database already matches the contract\", \"prisma-cli db sign\"), runCommandAction(\"Or push the current contract to the database\", \"prisma-cli db update\")]\n\t\t}\n\t};\n}\nfunction missingInvariantsFinding(inputs) {\n\tconst message = `missing invariant(s): ${inputs.missing.join(\", \")}`;\n\treturn {\n\t\tdocument: {\n\t\t\tcode: \"MIGRATION.MISSING_INVARIANTS\",\n\t\t\tseverity: \"warn\",\n\t\t\t...ifDefined(\"ref\", inputs.refName),\n\t\t\tinvariants: [...inputs.missing],\n\t\t\tmessage\n\t\t},\n\t\tdiagnostic: {\n\t\t\tcode: \"MIGRATION.MISSING_INVARIANTS\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: message,\n\t\t\twhy: inputs.refName === void 0 ? \"The database marker does not carry every invariant the target requires.\" : `The database marker does not carry every invariant \\`${inputs.refName}\\` requires.`,\n\t\t\tnextActions: [runCommandAction(\"Apply the migrations that provide them\", \"prisma-cli migrate\")],\n\t\t\tmeta: {\n\t\t\t\tinvariants: [...inputs.missing],\n\t\t\t\t...ifDefined(\"ref\", inputs.refName)\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/orm/migration/status.ts\nconst SHORT_HASH_LENGTH = 12;\nfunction shortDisplayHash(hash) {\n\treturn hash.slice(0, SHORT_HASH_LENGTH);\n}\nconst NO_DATABASE_STATE = {\n\tmarkersBySpace: /* @__PURE__ */ new Map(),\n\tledgersBySpace: /* @__PURE__ */ new Map()\n};\nasync function readDatabaseState(inputs) {\n\tconst { client } = inputs;\n\ttry {\n\t\tawait client.connect(inputs.connection);\n\t\tconst markersBySpace = new Map(await client.readAllMarkers());\n\t\tconst ledgersBySpace = /* @__PURE__ */ new Map();\n\t\tfor (const spaceId of inputs.spaceIds) ledgersBySpace.set(spaceId, await client.readLedger(spaceId));\n\t\treturn ok$1({\n\t\t\tmarkersBySpace,\n\t\t\tledgersBySpace\n\t\t});\n\t} catch (error) {\n\t\treturn notOk$1(normalizeError(CliStructuredError$1.is(error) ? error : errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read database state: ${error instanceof Error ? error.message : String(error)}` })));\n\t} finally {\n\t\tawait closeQuietly(client);\n\t}\n}\nfunction buildNoPathSummary(args) {\n\tconst markerPart = args.markerHash !== void 0 ? `the database state (${shortDisplayHash(args.markerHash)})` : \"the database state\";\n\tconst targetShort = shortDisplayHash(args.targetHash);\n\tif (!args.explicitTarget) return `No migration path from ${markerPart} to the application's contract (${targetShort}). Run \\`prisma-cli migration plan --name <name>\\` to author one.`;\n\treturn `No migration path from ${markerPart} to ${args.refName !== void 0 ? `the target (${targetShort} via \\`${args.refName}\\`)` : `the target (${targetShort})`}. Run \\`prisma-cli migration plan --name <name>\\` to author one, or pass \\`--to <contract>\\` to pick a reachable target.`;\n}\nfunction buildStatusHeadline(args) {\n\tif (args.markerDiverged && args.markerHash !== void 0) return `Database marker ${shortDisplayHash(args.markerHash)} is not in the on-disk migration graph`;\n\tif (args.pendingCount === 0) return \"Up to date\";\n\treturn `${args.pendingCount} pending — run \\`prisma-cli migrate --to ${shortDisplayHash(args.targetHash)}\\``;\n}\n/**\n* One space's section: its heading, where more than one space is in scope, on\n* top of its tree. Heading and tree are one drawing so the heading stays a\n* bare label — a `summary` would put a status glyph in front of it.\n*/\nfunction sectionBlock(section) {\n\tconst heading = section.showHeading ? [[{\n\t\ttext: `${section.space}:`,\n\t\ttone: \"heading\"\n\t}]] : [];\n\tconst body = section.tree.length === 0 ? [[{\n\t\ttext: \"(no migrations)\",\n\t\ttone: \"muted\"\n\t}]] : toneDrawing(section.tree);\n\treturn {\n\t\tkind: \"drawing\",\n\t\tlines: [...heading, ...body]\n\t};\n}\nfunction statusPresentations(inputs) {\n\tconst legend = inputs.legend;\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [\n\t\t\t{\n\t\t\t\tkind: \"fields\",\n\t\t\t\trail: true,\n\t\t\t\trows: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\t\tvalue: inputs.migrationsDir\n\t\t\t\t\t},\n\t\t\t\t\t...inputs.database === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\t\tvalue: inputs.database\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.ref === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"ref\",\n\t\t\t\t\t\tvalue: inputs.ref\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.from === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\t\tvalue: inputs.from\n\t\t\t\t\t}],\n\t\t\t\t\t...inputs.space === void 0 ? [] : [{\n\t\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\t\tvalue: inputs.space\n\t\t\t\t\t}]\n\t\t\t\t]\n\t\t\t},\n\t\t\t...legend === void 0 ? [] : [{\n\t\t\t\tkind: \"drawing\",\n\t\t\t\tlines: toneDrawing(legend)\n\t\t\t}],\n\t\t\t...inputs.sections.map(sectionBlock),\n\t\t\tinputs.headline\n\t\t],\n\t\tjson: () => inputs.document\n\t};\n}\nconst migrationStatusCommand = defineOrmCommand({\n\thelp: {\n\t\tsummary: \"Show migration path and pending status\",\n\t\tdescription: \"Shows which migrations are pending between the database marker and the\\ntarget contract. Requires a database connection. Pass --from for an\\noffline path preview without a database. Use `migration graph` for\\ntopology, `migration log` for history, and `migration list` for on-disk\\nenumeration.\",\n\t\texamples: [\n\t\t\t\"migration status\",\n\t\t\t\"migration status --db $DATABASE_URL\",\n\t\t\t\"migration status --to production\",\n\t\t\t\"migration status --from abc123 --to production\",\n\t\t\t\"migration status --ascii\",\n\t\t\t\"migration status --legend\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tdb: dbFlag,\n\t\tspace: flag.string({\n\t\t\tbrief: \"Narrow output to a single contract space\",\n\t\t\tplaceholder: \"id\"\n\t\t}),\n\t\tto: flag.string({\n\t\t\tbrief: \"Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\",\n\t\t\tplaceholder: \"contract\"\n\t\t}),\n\t\tfrom: flag.string({\n\t\t\tbrief: \"Origin contract reference; same grammar as --to. Supplying it switches to offline path computation\",\n\t\t\tplaceholder: \"contract\"\n\t\t}),\n\t\tlegend: flag.boolean({ brief: \"Print a key for the tree glyphs and lane colors\" }),\n\t\tascii: flag.boolean({ brief: \"Use ASCII glyphs (pipe-friendly)\" })\n\t} },\n\tneeds: { config: ormConfigSection },\n\thandler: async (args, ctx) => {\n\t\tconst migrationsDir = migrationsDirFor(ctx.config, ctx.cwd);\n\t\tconst dbConnection = args.flags.db ?? ctx.config.db?.connection;\n\t\tconst hasDriver = ctx.config.driver !== void 0;\n\t\tconst usingFromOverride = args.flags.from !== void 0;\n\t\tif (!usingFromOverride) {\n\t\t\tconst missingDb = requireLiveDatabase({\n\t\t\t\tdbConnection,\n\t\t\t\thasDriver,\n\t\t\t\twhy: \"migration status needs a database connection to read the marker and ledger (or pass --from for an offline path preview)\",\n\t\t\t\tretryCommand: \"prisma-cli migration status --from <contract>\"\n\t\t\t});\n\t\t\tif (missingDb !== null) return notOk$1(normalizeError(missingDb));\n\t\t}\n\t\tconst refsResult = await readMigrationRefs(appRefsDirFor(ctx.config, ctx.cwd));\n\t\tif (!refsResult.ok) return notOk$1(normalizeError(refsResult.failure));\n\t\tconst refs = refsResult.value;\n\t\tconst findings = [];\n\t\tconst loaded = await buildReadAggregate(ctx.config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk$1(normalizeError(loaded.failure));\n\t\tconst { aggregate, contractHash } = loaded.value;\n\t\tconst contractConfig = { contract: ifDefined(\"output\", contractPathFor(ctx.config, ctx.cwd)) };\n\t\ttry {\n\t\t\tawait readContractEnvelope(contractConfig);\n\t\t} catch (error) {\n\t\t\tfindings.push(contractUnreadableFinding(error instanceof Error ? error.message : \"unknown error\"));\n\t\t}\n\t\tif (await loadContractRawSafely(contractConfig) !== null) {\n\t\t\tconst corruption = refusePackageCorruptionOnAggregate(aggregate, migrationsDir);\n\t\t\tif (corruption) return notOk$1(normalizeError(corruption));\n\t\t}\n\t\tconst appGraph = aggregate.app.graph();\n\t\tlet activeRefHash;\n\t\tlet activeRefName;\n\t\tlet activeRefEntry;\n\t\tif (args.flags.to !== void 0) {\n\t\t\tconst resolved = resolveContractRef(args.flags.to, {\n\t\t\t\tgraph: appGraph,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tif (!resolved.ok) return notOk$1(normalizeError(resolved.failure));\n\t\t\tactiveRefHash = resolved.value.hash;\n\t\t\tif (resolved.value.provenance.kind === \"ref\") {\n\t\t\t\tactiveRefName = resolved.value.provenance.refName;\n\t\t\t\tactiveRefEntry = refs[activeRefName];\n\t\t\t}\n\t\t}\n\t\tlet fromOverrideHash;\n\t\tif (args.flags.from !== void 0) {\n\t\t\tconst resolved = resolveContractRef(args.flags.from, {\n\t\t\t\tgraph: appGraph,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tif (!resolved.ok) return notOk$1(normalizeError(resolved.failure));\n\t\t\tfromOverrideHash = resolved.value.hash;\n\t\t}\n\t\tconst listed = runMigrationList({\n\t\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t\t...ifDefined(\"spaceFilter\", args.flags.space)\n\t\t});\n\t\tif (!listed.ok) return notOk$1(normalizeError(listed.failure));\n\t\tconst scopedSpaces = listed.value.spaces;\n\t\tconst connects = dbConnection !== void 0 && hasDriver && !usingFromOverride;\n\t\tlet database = NO_DATABASE_STATE;\n\t\tif (connects) {\n\t\t\tconst read = await readDatabaseState({\n\t\t\t\tclient: createControlClient({\n\t\t\t\t\tfamily: ctx.config.family,\n\t\t\t\t\ttarget: ctx.config.target,\n\t\t\t\t\tadapter: ctx.config.adapter,\n\t\t\t\t\t...ifDefined(\"driver\", ctx.config.driver),\n\t\t\t\t\textensions: ctx.config.extensions ?? []\n\t\t\t\t}),\n\t\t\t\tconnection: dbConnection,\n\t\t\t\tspaceIds: scopedSpaces.map((entry) => entry.space)\n\t\t\t});\n\t\t\tif (!read.ok) return notOk$1(read.failure);\n\t\t\tdatabase = read.value;\n\t\t}\n\t\tconst appMarker = database.markersBySpace.get(aggregate.app.spaceId);\n\t\tif (activeRefEntry !== void 0 && activeRefEntry.invariants.length > 0 && connects) {\n\t\t\tconst unknown = refuseUnknownInvariants({\n\t\t\t\tgraph: appGraph,\n\t\t\t\tmarkerInvariants: appMarker?.invariants ?? [],\n\t\t\t\trefInvariants: activeRefEntry.invariants,\n\t\t\t\t...ifDefined(\"refName\", activeRefName)\n\t\t\t});\n\t\t\tif (unknown) return notOk$1(normalizeError(unknown));\n\t\t}\n\t\tconst glyphMode = args.flags.ascii ? \"ascii\" : \"unicode\";\n\t\tconst styler = createToneMigrationListStyler();\n\t\tconst showSpaceHeadings = scopedSpaces.length > 1;\n\t\tconst statusSpaces = [];\n\t\tconst renderInputs = [];\n\t\tconst emptySpaces = [];\n\t\tlet divergedMarker;\n\t\tlet noPath;\n\t\tlet headlineTargetHash = activeRefHash ?? contractHash;\n\t\tlet totalPending = 0;\n\t\tfor (const entry of scopedSpaces) {\n\t\t\tconst space = aggregate.space(entry.space);\n\t\t\tif (space === void 0) continue;\n\t\t\tconst graph = space.graph();\n\t\t\tconst spaceContractHash = space.contract().storage.storageHash;\n\t\t\tconst targetHash = activeRefHash ?? spaceContractHash;\n\t\t\tif (entry.space === aggregate.app.spaceId) headlineTargetHash = targetHash;\n\t\t\tconst markerHash = usingFromOverride ? fromOverrideHash : database.markersBySpace.get(entry.space)?.storageHash;\n\t\t\tconst originHash = originHashForStatus(markerHash);\n\t\t\tconst markerInGraph = markerHash === void 0 || graph.nodes.has(markerHash) || markerHash === spaceContractHash;\n\t\t\tif (connects && markerInGraph && originHash !== targetHash && noPath === void 0 && !hasMigrationPath(graph, originHash, targetHash)) noPath = {\n\t\t\t\tmarkerHash,\n\t\t\t\ttargetHash\n\t\t\t};\n\t\t\tif (connects && markerHash !== void 0 && !markerInGraph) {\n\t\t\t\tdivergedMarker ??= {\n\t\t\t\t\tspace: entry.space,\n\t\t\t\t\tmarkerHash\n\t\t\t\t};\n\t\t\t\tfindings.push(markerNotInHistoryFinding(entry.space));\n\t\t\t}\n\t\t\tconst ledger = database.ledgersBySpace.get(entry.space) ?? [];\n\t\t\tconst annotations = deriveStatusEdgeAnnotations({\n\t\t\t\tgraph,\n\t\t\t\ttargetHash,\n\t\t\t\toriginHash,\n\t\t\t\tappliedMigrationHashes: connects ? appliedHashesFromLedger(ledger) : /* @__PURE__ */ new Set(),\n\t\t\t\tshowAppliedOverlay: connects\n\t\t\t});\n\t\t\tconst migrations = entry.migrations.map((migration) => ({\n\t\t\t\t...migration,\n\t\t\t\tstatus: statusForMigrationHash(migration.hash, annotations)\n\t\t\t}));\n\t\t\ttotalPending += migrations.filter((migration) => migration.status === \"pending\").length;\n\t\t\tstatusSpaces.push({\n\t\t\t\tspace: entry.space,\n\t\t\t\tcurrentContract: markerHash ?? null,\n\t\t\t\ttargetContract: targetHash,\n\t\t\t\tmigrations\n\t\t\t});\n\t\t\tif (graph.nodes.size === 0) {\n\t\t\t\temptySpaces.push(entry.space);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trenderInputs.push({\n\t\t\t\tspaceId: entry.space,\n\t\t\t\tgraph,\n\t\t\t\tmigrations: entry.migrations,\n\t\t\t\tliveContractHash: contractHash,\n\t\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\t\tstatusOverlayByHash: annotations,\n\t\t\t\tcolorize: true,\n\t\t\t\tglyphMode,\n\t\t\t\tstyler,\n\t\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE,\n\t\t\t\tisAppSpace: entry.space === aggregate.app.spaceId,\n\t\t\t\t...connects && markerHash !== void 0 ? { dbHash: markerHash } : {}\n\t\t\t});\n\t\t}\n\t\tconst requiredInvariants = [...activeRefEntry?.invariants ?? []].sort();\n\t\tif (connects && requiredInvariants.length > 0) {\n\t\t\tconst held = new Set(appMarker?.invariants ?? []);\n\t\t\tconst missing = requiredInvariants.filter((id) => !held.has(id));\n\t\t\tif (missing.length > 0) {\n\t\t\t\tfindings.push(missingInvariantsFinding({\n\t\t\t\t\tmissing,\n\t\t\t\t\trefName: activeRefName\n\t\t\t\t}));\n\t\t\t\tif (activeRefHash !== void 0) {\n\t\t\t\t\tconst unreachable = refuseMissingInvariantPath({\n\t\t\t\t\t\tgraph: appGraph,\n\t\t\t\t\t\toriginHash: originHashForStatus(appMarker?.storageHash),\n\t\t\t\t\t\ttargetHash: activeRefHash,\n\t\t\t\t\t\tmissing,\n\t\t\t\t\t\t...ifDefined(\"refName\", activeRefName)\n\t\t\t\t\t});\n\t\t\t\t\tif (unreachable) return notOk$1(normalizeError(unreachable));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst rendered = renderMigrationGraphSpaceTrees(renderInputs);\n\t\tconst treesBySpace = new Map(renderInputs.map((input, index) => [input.spaceId, rendered[index] ?? \"\"]));\n\t\tconst sections = scopedSpaces.map((entry) => {\n\t\t\tconst tree = treesBySpace.get(entry.space) ?? \"\";\n\t\t\treturn {\n\t\t\t\tspace: entry.space,\n\t\t\t\ttree: showSpaceHeadings && tree.length > 0 ? indentMigrationGraphTreeBlock(tree, \" \") : tree,\n\t\t\t\tshowHeading: showSpaceHeadings\n\t\t\t};\n\t\t});\n\t\tconst summary = scopedSpaces.every((entry) => entry.migrations.length === 0) ? \"No migrations found\" : noPath !== void 0 ? buildNoPathSummary({\n\t\t\tmarkerHash: noPath.markerHash,\n\t\t\ttargetHash: noPath.targetHash,\n\t\t\texplicitTarget: args.flags.to !== void 0,\n\t\t\trefName: activeRefName\n\t\t}) : buildStatusHeadline({\n\t\t\tpendingCount: totalPending,\n\t\t\ttargetHash: headlineTargetHash,\n\t\t\tmarkerDiverged: divergedMarker !== void 0,\n\t\t\tmarkerHash: divergedMarker?.markerHash\n\t\t});\n\t\tconst diagnostics = findings.map((finding) => finding.diagnostic);\n\t\tconst document = {\n\t\t\tok: true,\n\t\t\tspaces: statusSpaces,\n\t\t\tsummary,\n\t\t\tdiagnostics: findings.map((finding) => finding.document)\n\t\t};\n\t\tconst alarming = divergedMarker !== void 0 || totalPending > 0 || noPath !== void 0;\n\t\treturn ok$1(ctx.present({\n\t\t\tdata: document,\n\t\t\tdiagnostics\n\t\t}, statusPresentations({\n\t\t\tdocument,\n\t\t\tsections,\n\t\t\theadline: {\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: alarming ? \"warn\" : \"ok\",\n\t\t\t\ttext: summary\n\t\t\t},\n\t\t\tmigrationsDir: displayPath(migrationsDir, ctx.cwd),\n\t\t\tdatabase: connects && typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0,\n\t\t\tref: activeRefName,\n\t\t\tfrom: args.flags.from,\n\t\t\tspace: args.flags.space,\n\t\t\tlegend: args.flags.legend ? renderMigrationGraphLegend({\n\t\t\t\tcolorize: true,\n\t\t\t\tglyphMode,\n\t\t\t\tstyler,\n\t\t\t\tpalette: TONE_MIGRATION_GRAPH_PALETTE\n\t\t\t}) : void 0\n\t\t})));\n\t}\n});\n//#endregion\n//#region src/orm/ref/delete.ts\nfunction deletePresentations(document) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [\n\t\t\t\t{ text: \"Deleted ref \\\"\" },\n\t\t\t\t{\n\t\t\t\t\ttext: document.ref,\n\t\t\t\t\ttone: \"ref\"\n\t\t\t\t},\n\t\t\t\t{ text: \"\\\"\" }\n\t\t\t]\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createRefDeleteCommand(execute = executeRefDeleteCommand) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Delete a ref\",\n\t\t\tdescription: \"Removes migrations/app/refs/<name>.json. The contract the ref pointed at\\nis untouched: a ref is a pointer, and its target survives the deletion.\",\n\t\t\texamples: [\"ref delete staging\", \"ref delete staging --json\"]\n\t\t},\n\t\targs: { positionals: { name: positional.string({\n\t\t\tbrief: \"Ref name to delete\",\n\t\t\tplaceholder: \"name\"\n\t\t}) } },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst result = await execute(args.positionals.name, {\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (!result.ok) return notOk$1(normalizeError(result.failure));\n\t\t\treturn ok$1(ctx.present({ data: result.value }, deletePresentations(result.value)));\n\t\t}\n\t});\n}\nconst refDeleteCommand = createRefDeleteCommand();\n//#endregion\n//#region src/orm/ref/list.ts\nconst HEADING_REF = \"Ref\";\nconst HEADING_CONTRACT = \"Contract\";\nconst HEADING_INVARIANTS = \"Invariants\";\nconst EMPTY_MESSAGE = \"No refs defined\";\n/**\n* The refs as a grid the engine sizes. The invariants heading appears only\n* when a ref carries any, as the commander shell appended them only then.\n*/\nfunction refsGrid(refs) {\n\tconst entries = Object.entries(refs);\n\tconst showInvariants = entries.some(([, entry]) => entry.invariants.length > 0);\n\treturn {\n\t\tkind: \"table\",\n\t\tcolumns: showInvariants ? [\n\t\t\tHEADING_REF,\n\t\t\tHEADING_CONTRACT,\n\t\t\tHEADING_INVARIANTS\n\t\t] : [HEADING_REF, HEADING_CONTRACT],\n\t\trows: entries.map(([name, entry]) => {\n\t\t\tconst cells = [[{\n\t\t\t\ttext: name,\n\t\t\t\ttone: \"ref\"\n\t\t\t}], [{\n\t\t\t\ttext: entry.hash,\n\t\t\t\ttone: \"identifier\"\n\t\t\t}]];\n\t\t\tif (showInvariants) cells.push(entry.invariants.join(\", \"));\n\t\t\treturn cells;\n\t\t})\n\t};\n}\nfunction listPresentations(document) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => Object.keys(document.refs).length === 0 ? [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"info\",\n\t\t\ttext: EMPTY_MESSAGE\n\t\t}] : [refsGrid(document.refs)],\n\t\tjson: () => document\n\t};\n}\nfunction createRefListCommand(execute = executeRefListCommand) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"List every named ref\",\n\t\t\tdescription: \"Reads migrations/app/refs/ and reports each ref with the contract hash it\\npoints at and the invariants recorded against it. Offline — does not\\nconsult the database.\",\n\t\t\texamples: [\"ref list\", \"ref list --json\"]\n\t\t},\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (_args, ctx) => {\n\t\t\tconst result = await execute({\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (!result.ok) return notOk$1(normalizeError(result.failure));\n\t\t\treturn ok$1(ctx.present({ data: result.value }, listPresentations(result.value)));\n\t\t}\n\t});\n}\nconst refListCommand = createRefListCommand();\n//#endregion\n//#region src/orm/ref/set.ts\nfunction setPresentations(document) {\n\treturn {\n\t\tstdout: () => [],\n\t\tnext: () => [],\n\t\thuman: () => [{\n\t\t\tkind: \"summary\",\n\t\t\tstatus: \"ok\",\n\t\t\ttext: [\n\t\t\t\t{ text: \"Set ref \\\"\" },\n\t\t\t\t{\n\t\t\t\t\ttext: document.ref,\n\t\t\t\t\ttone: \"ref\"\n\t\t\t\t},\n\t\t\t\t{ text: \"\\\" → \" },\n\t\t\t\t{\n\t\t\t\t\ttext: document.hash,\n\t\t\t\t\ttone: \"identifier\"\n\t\t\t\t}\n\t\t\t]\n\t\t}],\n\t\tjson: () => document\n\t};\n}\nfunction createRefSetCommand(execute = executeRefSetCommand) {\n\treturn defineOrmCommand({\n\t\thelp: {\n\t\t\tsummary: \"Point a ref at a contract\",\n\t\t\tdescription: \"Writes migrations/app/refs/<name>.json so a logical environment name\\nresolves to a contract hash. The contract is given as a hash or prefix,\\nanother ref name, a migration directory name, or <dir>^ for that\\nmigration's source contract. Offline — the contract must already be a\\nnode of the on-disk migration graph, with its snapshot present.\",\n\t\t\texamples: [\n\t\t\t\t\"ref set staging 4cb4256\",\n\t\t\t\t\"ref set production 20260101T1000_add_user\",\n\t\t\t\t\"ref set staging production --json\"\n\t\t\t]\n\t\t},\n\t\targs: { positionals: {\n\t\t\tname: positional.string({\n\t\t\t\tbrief: \"Ref name (e.g. staging, production)\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tcontract: positional.string({\n\t\t\t\tbrief: \"Contract reference: hash, prefix, ref name, migration dir name, or <dir>^\",\n\t\t\t\tplaceholder: \"contract\"\n\t\t\t})\n\t\t} },\n\t\tneeds: { config: ormConfigSection },\n\t\thandler: async (args, ctx) => {\n\t\t\tconst result = await execute(args.positionals.name, args.positionals.contract, {\n\t\t\t\tconfig: ctx.config,\n\t\t\t\tcwd: ctx.cwd\n\t\t\t});\n\t\t\tif (!result.ok) return notOk$1(normalizeError(result.failure));\n\t\t\treturn ok$1(ctx.present({ data: result.value }, setPresentations(result.value)));\n\t\t}\n\t});\n}\nconst refSetCommand = createRefSetCommand();\n//#endregion\n//#region src/orm/family.ts\n/**\n* The engine derives each diagnostic's docs link from this base plus the\n* dotted code.\n*/\nconst DOCS_BASE_URL = `${DOCS_BASE}/`;\n/**\n* The unit the ORM contributes to a CLI: its config section, its commands by\n* name, where its diagnostics are documented, and the invocations it retired.\n* The shell owns the command tree, so nothing here says where a command mounts.\n*/\nconst ormCommandFamily = defineCommandFamily({\n\tconfigSection: ormConfigSection,\n\tcommands: {\n\t\t\"contract emit\": contractEmitCommand,\n\t\t\"contract infer\": contractInferCommand,\n\t\t\"db init\": dbInitCommand,\n\t\t\"db schema\": dbSchemaCommand,\n\t\t\"db sign\": dbSignCommand,\n\t\t\"db update\": dbUpdateCommand,\n\t\t\"db verify\": dbVerifyCommand,\n\t\tformat: formatCommand,\n\t\tinit: initCommand,\n\t\tlsp: lspCommand,\n\t\tmigrate: migrateCommand,\n\t\t\"migration check\": migrationCheckCommand,\n\t\t\"migration graph\": migrationGraphCommand,\n\t\t\"migration list\": migrationListCommand,\n\t\t\"migration log\": migrationLogCommand,\n\t\t\"migration new\": migrationNewCommand,\n\t\t\"migration plan\": migrationPlanCommand,\n\t\t\"migration show\": migrationShowCommand,\n\t\t\"migration status\": migrationStatusCommand,\n\t\t\"ref delete\": refDeleteCommand,\n\t\t\"ref list\": refListCommand,\n\t\t\"ref set\": refSetCommand\n\t},\n\tdocsBaseUrl: DOCS_BASE_URL,\n\tredirects: [\n\t\t{\n\t\t\tfrom: \"migration apply\",\n\t\t\treplacement: \"{bin} migrate --to <contract>\",\n\t\t\treason: \"Applying a migration is a move to a target contract, not a verb of its own.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration ref\",\n\t\t\treplacement: \"{bin} ref set|list|delete\",\n\t\t\treason: \"Refs are managed by their own command, for every space rather than migrations alone.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration status\",\n\t\t\tflag: \"graph\",\n\t\t\treplacement: \"{bin} migration graph\",\n\t\t\treason: \"Topology is its own command rather than a mode of the status report.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration status\",\n\t\t\tflag: \"all\",\n\t\t\treplacement: \"{bin} migration log --db <url>\",\n\t\t\treason: \"Execution history is read from the database ledger, which is what migration log does.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration status\",\n\t\t\tflag: \"limit\",\n\t\t\treplacement: \"{bin} migration log --db <url>\",\n\t\t\treason: \"Execution history is read from the database ledger, which is what migration log does.\"\n\t\t},\n\t\t{\n\t\t\tfrom: \"migration status\",\n\t\t\tflag: \"ref\",\n\t\t\treplacement: \"{bin} migration status --to <contract>\",\n\t\t\treason: \"One flag names the target contract, whether it is a ref, a hash or a migration.\"\n\t\t}\n\t]\n});\n//#endregion\n//#region src/orm/load-config.ts\n/** The file the ORM's loader reads when `--config` names none. */\nconst ORM_CONFIG_FILENAME = \"prisma.config.ts\";\n/**\n* Builds the engine's `Runtime.config` from `prisma.config.ts`.\n*\n* The engine ships its own synchronous loader, but the bin owns the load: the\n* ORM's c12 loader evaluates the module asynchronously and finalizes paths\n* against the config file's own directory. It reads the same shape the engine\n* does — defineConfig from `@prisma/cli-engine` with the whole Prisma Next\n* configuration nested as the single `orm` section.\n*\n* Only failures that prevent evaluation entirely are diagnostics here, and\n* they carry `section: null` so they fail exactly the commands that read\n* config. Structural verdicts belong to the section validator.\n*/\nasync function loadOrmConfig(options) {\n\tconst path = resolve(options.cwd, options.configPath ?? ORM_CONFIG_FILENAME);\n\tconst loaded = await loadConfig(options.configPath, { cwd: options.cwd });\n\tif (!loaded.ok) return {\n\t\tpath,\n\t\tsections: {},\n\t\tdiagnostics: [{\n\t\t\tsection: null,\n\t\t\tdiagnostic: toEngineDiagnostic(loaded.failure)\n\t\t}]\n\t};\n\treturn {\n\t\tpath,\n\t\tsections: { [\"orm\"]: loaded.value.config },\n\t\tdiagnostics: []\n\t};\n}\n//#endregion\nexport { contractInferCommand as C, version as D, ormConfigSection as E, createDbInitCommand as S, normalizeError as T, formatCommand as _, refDeleteCommand as a, createDbSignCommand as b, migrationPlanCommand as c, migrationListCommand as d, migrationGraphCommand as f, initCommand as g, lspCommand as h, refListCommand as i, migrationNewCommand as l, createMigrateCommand as m, ormCommandFamily as n, migrationStatusCommand as o, migrationCheckCommand as p, refSetCommand as r, migrationShowCommand as s, loadOrmConfig as t, migrationLogCommand as u, createDbVerifyCommand as v, contractEmitCommand as w, createDbSchemaCommand as x, createDbUpdateCommand as y };\n\n//# sourceMappingURL=load-config-BmhVL82j.mjs.map","import { E as ormConfigSection, n as ormCommandFamily, t as loadOrmConfig } from \"../load-config-BmhVL82j.mjs\";\nimport { existsSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { join, resolve } from \"pathe\";\nimport { tmpdir } from \"node:os\";\nimport { pathToFileURL } from \"node:url\";\nimport { build } from \"esbuild\";\n//#region src/load-ts-contract.ts\nfunction contractSourceError(code, message, options) {\n\tconst error = new CliStructuredError(code, message, options?.meta !== void 0 ? { meta: options.meta } : void 0);\n\tif (options?.cause !== void 0) error.cause = options.cause;\n\treturn error;\n}\nconst DEFAULT_ALLOWLIST = [\n\t\"@internal/*\",\n\t\"@prisma/orm-*\",\n\t\"node:crypto\"\n];\nfunction isAllowedImport(importPath, allowlist) {\n\tfor (const pattern of allowlist) if (pattern.endsWith(\"/*\")) {\n\t\tconst prefix = pattern.slice(0, -2);\n\t\tif (importPath === prefix || importPath.startsWith(`${prefix}/`)) return true;\n\t} else if (pattern.endsWith(\"*\")) {\n\t\tconst prefix = pattern.slice(0, -1);\n\t\tif (importPath.startsWith(prefix)) return true;\n\t} else if (importPath === pattern) return true;\n\treturn false;\n}\nfunction validatePurity(value, entryPath) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tconst path = /* @__PURE__ */ new WeakSet();\n\tfunction check(value) {\n\t\tif (value === null || typeof value !== \"object\") return;\n\t\tif (path.has(value)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export contains circular references\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"circular\"\n\t\t} });\n\t\tpath.add(value);\n\t\ttry {\n\t\t\tfor (const key in value) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\t\t\tif (descriptor && (descriptor.get || descriptor.set)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains getter/setter at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"getter\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tif (descriptor && typeof descriptor.value === \"function\") throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains function at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"function\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tcheck(value[key]);\n\t\t\t}\n\t\t} finally {\n\t\t\tpath.delete(value);\n\t\t}\n\t}\n\ttry {\n\t\tcheck(value);\n\t\tJSON.stringify(value);\n\t} catch (error) {\n\t\tif (error instanceof Error) {\n\t\t\tif (error.message.includes(\"getter\") || error.message.includes(\"circular\")) throw error;\n\t\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export is not JSON-serializable: ${error.message}`, {\n\t\t\t\tmeta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"not-json-serializable\"\n\t\t\t\t},\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export is not JSON-serializable\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-json-serializable\"\n\t\t} });\n\t}\n}\nfunction createImportAllowlistPlugin(allowlist, entryPath, collected) {\n\tconst entryAbs = resolve(entryPath);\n\tfunction isFromEntry(importer) {\n\t\treturn importer === entryAbs || importer === entryPath || importer === \"<stdin>\";\n\t}\n\treturn {\n\t\tname: \"import-allowlist\",\n\t\tsetup(build) {\n\t\t\tbuild.onResolve({ filter: /.*/ }, (args) => {\n\t\t\t\tif (args.kind === \"entry-point\") return;\n\t\t\t\tif (args.path.startsWith(\".\") || args.path.startsWith(\"/\")) return;\n\t\t\t\tif (isFromEntry(args.importer) && !isAllowedImport(args.path, allowlist)) {\n\t\t\t\t\tcollected.add(args.path);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpath: args.path,\n\t\t\t\t\t\texternal: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n}\n/**\n* Loads a contract from a TypeScript file and returns it as Contract.\n*\n* **Responsibility: Parsing Only**\n* This function loads and parses a TypeScript contract file. It does NOT normalize the contract.\n* The contract should already be normalized if it was built using the contract builder.\n*\n* Normalization must happen in the contract builder when the contract is created.\n* This function only validates that the contract is JSON-serializable and returns it as-is.\n*\n* @param entryPath - Path to the TypeScript contract file\n* @param options - Optional configuration (import allowlist)\n* @returns The contract as Contract (should already be normalized)\n* @throws structured errors: `CLI.FILE_NOT_FOUND`, `CONTRACT.SOURCE_LOAD_FAILED`,\n* `CONTRACT.SOURCE_IMPORT_DISALLOWED`, `CONTRACT.MODULE_EXPORT_MISSING`, `CONTRACT.EXPORT_INVALID`\n*/\nasync function loadContractFromTs(entryPath, options) {\n\tconst allowlist = options?.allowlist ?? DEFAULT_ALLOWLIST;\n\tif (!existsSync(entryPath)) throw new CliStructuredError(\"CLI.FILE_NOT_FOUND\", `Contract file not found: ${entryPath}`, { where: { path: entryPath } });\n\tconst tempFile = join(tmpdir(), `prisma-next-contract-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);\n\tconst disallowedFromEntry = /* @__PURE__ */ new Set();\n\ttry {\n\t\tconst result = await build({\n\t\t\tentryPoints: [entryPath],\n\t\t\tbundle: true,\n\t\t\tformat: \"esm\",\n\t\t\tplatform: \"node\",\n\t\t\ttarget: \"es2022\",\n\t\t\toutfile: tempFile,\n\t\t\twrite: false,\n\t\t\tmetafile: true,\n\t\t\tplugins: [createImportAllowlistPlugin(allowlist, entryPath, disallowedFromEntry)],\n\t\t\tlogLevel: \"error\"\n\t\t});\n\t\tif (result.errors.length > 0) throw contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to bundle contract file: ${result.errors.map((e) => e.text).join(\"\\n\")}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\tstage: \"bundle\"\n\t\t} });\n\t\tif (!result.outputFiles || result.outputFiles.length === 0) throw new InternalError(\"No output files generated from bundling\");\n\t\tif (disallowedFromEntry.size > 0) throw contractSourceError(\"CONTRACT.SOURCE_IMPORT_DISALLOWED\", `Disallowed imports detected. Only imports matching the allowlist are permitted:\\n Allowlist: ${allowlist.join(\", \")}\\n Disallowed imports: ${[...disallowedFromEntry].join(\", \")}`, { meta: {\n\t\t\tallowlist: [...allowlist],\n\t\t\tdisallowed: [...disallowedFromEntry]\n\t\t} });\n\t\tconst bundleContent = result.outputFiles[0]?.text;\n\t\tif (bundleContent === void 0) throw new InternalError(\"Bundle content is undefined\");\n\t\twriteFileSync(tempFile, bundleContent, \"utf-8\");\n\t\tconst module = await import(\n\t\t\t/* @vite-ignore */\n\t\t\tpathToFileURL(tempFile).href\n);\n\t\tunlinkSync(tempFile);\n\t\tlet contract;\n\t\tif (module.default !== void 0) contract = module.default;\n\t\telse if (module.contract !== void 0) contract = module.contract;\n\t\telse throw new CliStructuredError(\"CONTRACT.MODULE_EXPORT_MISSING\", `Contract file must export a contract as default export or named export 'contract'. Found exports: ${Object.keys(module).join(\", \") || \"none\"}`, { where: { path: entryPath } });\n\t\tif (typeof contract !== \"object\" || contract === null) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export must be an object, got ${typeof contract}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-object\"\n\t\t} });\n\t\tvalidatePurity(contract, entryPath);\n\t\treturn contract;\n\t} catch (error) {\n\t\ttry {\n\t\t\tif (tempFile) unlinkSync(tempFile);\n\t\t} catch {}\n\t\tif (error instanceof Error) throw error;\n\t\tthrow contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to load contract from ${entryPath}: ${String(error)}`, {\n\t\t\tmeta: {\n\t\t\t\tpath: entryPath,\n\t\t\t\tstage: \"import\"\n\t\t\t},\n\t\t\tcause: error\n\t\t});\n\t}\n}\n//#endregion\nexport { loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAI,UAAU;AACd,MAAM,wBAAwB;CAC7B,MAAM;CACN,OAAO;CACP,SAAS;AACV;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO;EACN,MAAM;EACN,OAAO,WAAW,MAAM;CACzB;AACD;AACA,SAAS,gBAAgB,OAAO;CAC/B,OAAO;EACN,MAAM;EACN,UAAU;EACV,SAAS,MAAM;EACf,KAAK,MAAM;EACX,aAAa,CAAC,iBAAiB,MAAM,KAAK,CAAC;EAC3C,MAAM;GACL,O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