@prisma/orm-toolchain 8.0.0-rc.1-dev.43 → 8.0.0-rc.1-dev.44

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","createContractEmitCommand","errorRuntime","CliStructuredError$1","errorConfigValidation","createFormatCommand"],"sources":["../../../../1-framework/3-tooling/cli/dist/load-config-pHRFM_nB.mjs","../../../../1-framework/3-tooling/cli/dist/exports/index.mjs"],"sourcesContent":["import { c as targetLabel, i as scaffoldSpecifierResolverFor, l as targetPackageName, n as dbFile, o as starterSchema, r as defaultSchemaPath, t as configFile } from \"./code-templates-C_0IIsWa.mjs\";\nimport { I as requireLiveDatabase, L as chooseAction, M as errorTargetMigrationNotSupported, N as errorTargetMismatch, O as errorRunnerFailed, P as errorUnexpected, R as runCommandAction, a as errorConsentPlanMismatch, b as errorMigrationPlanningFailed, c as errorContractValidationFailed, d as errorDriverRequired, f as errorFileNotFound, g as errorLegendHumanOnly, i as errorConfigValidation, k as errorRuntime, l as errorDatabaseConnectionRequired, o as errorContractArgConflict, p as errorHashMismatch, t as CliStructuredError$1, u as errorDestructiveChanges, v as errorMarkerMissing, x as errorNoMigrations, y as errorMigrationPackageNotFound } from \"./cli-errors-B4zTLaqQ.mjs\";\nimport { t as executeContractEmit } from \"./contract-emit-BG7KL4zk.mjs\";\nimport { d as renderPreviewStatement, u as previewBlockHeader } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { a as maskConnectionUrl, l as sanitizeErrorMessage, n as closeQuietly, o as readContractEnvelope, p as targetSupportsMigrations } from \"./command-helpers-BCgwcqTe.mjs\";\nimport { a as loadContractSpaceAggregateForCli, i as loadContractRawSafely, l as refusePackageCorruptionOnAggregate, r as buildReadAggregate, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from \"./contract-space-aggregate-loader-fa04OIaL.mjs\";\nimport { t as createControlClient } from \"./client-C6Qp5ujC.mjs\";\nimport { a as readContractIR, o as resolveRefAdvancementFields, t as advanceRefSafely } from \"./ref-advancement-DaZBzm7m.mjs\";\nimport { t as mapDbInitFailure } from \"./db-init-failure-B5cQML4A.mjs\";\nimport { t as resolveContractRefToSnapshot } from \"./contract-snapshot-resolution-De2VvOJn.mjs\";\nimport { t as combineVerifyResults } from \"./combine-verify-results-B87B_pMc.mjs\";\nimport { t as executeFormat } from \"./format-DrW250a2.mjs\";\nimport { t as mapCaughtMigrationError } from \"./caught-errors-BZo7zcRc.mjs\";\nimport { t as mapContractAtError } from \"./contract-at-errors-BSoDI0Hw.mjs\";\nimport { i as refuseMarkerOutsideGraph, n as refuseUnknownInvariants, r as hasMigrationPath, t as refuseMissingInvariantPath } from \"./invariants-Bltd8DyA.mjs\";\nimport { t as executeMigrateShowPlan } from \"./migrate-show-C_9xR4Qt.mjs\";\nimport { n as resolveMigrationRef, t as resolveContractRef } from \"./ref-resolution-BSN1amKm.mjs\";\nimport { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList, t as listRefsByContractHash } from \"./migration-list-CY08bD8I.mjs\";\nimport { C as toneSpans, S as toneDrawing, a as renderMigrationGraphLegend, h as renderMigrationGraphSpaceTrees, l as renderMigrationListWithStyle, p as indentMigrationGraphTreeBlock, s as createToneMigrationListStyler, x as TONE_MIGRATION_GRAPH_PALETTE } from \"./migration-graph-command-render-h0VdTkSM.mjs\";\nimport { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from \"./migrate-failure-D4NvkoCk.mjs\";\nimport { n as looksLikePath, r as resolveAppTargetPath, t as findPackageByDirPath } from \"./migration-path-target-JDWqF9kj.mjs\";\nimport { i as runMigrationCheck, n as enumerateCheckSpaces, r as loadAggregateIntegrityViolations, t as checkSingleTarget } from \"./migration-check-Bbdw7t-r.mjs\";\nimport { t as integrityViolationToCheckFailure } from \"./integrity-violation-to-check-failure-BmWMLAae.mjs\";\nimport { t as buildMigrationSpaceGraphEntries } from \"./migration-graph-B8WxW_tm.mjs\";\nimport { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from \"./migration-graph-sections-BBHPOFN-.mjs\";\nimport { a as sortLedgerEntries, i as serializeLedgerEntriesForJson, n as formatLedgerAppliedAt, o as styleHashTransition, t as MIGRATION_LOG_EMPTY_MESSAGE } from \"./migration-log-table-eES9lPjv.mjs\";\nimport { t as executeMigrationNewCommand } from \"./migration-new-DXMvJdbB.mjs\";\nimport { t as executeMigrationPlanCommand } from \"./migration-plan-Cfz0efEL.mjs\";\nimport { a as statusForMigrationHash, i as originHashForStatus, n as appliedHashesFromLedger, r as deriveStatusEdgeAnnotations, t as readMigrationRefs } from \"./refs-fQLFcMoq.mjs\";\nimport { n as executeRefListCommand, r as executeRefSetCommand, t as executeRefDeleteCommand } from \"./ref-WXLIR9Xm.mjs\";\nimport { A as formatSkillSourceUrl, C as validateSchemaPath, D as DEFAULT_SKILL_AGENTS, E as envFileContent, G as buildCatalogWarnings, H as errorInitStrictProbeWithoutProbe, I as errorInitInvalidManifest, L as errorInitInvalidTsconfig, M as resolveProjectSkillInstallCommands, N as probeServerVersion, O as DEFAULT_SKILL_SOURCES, R as errorInitMissingFlags, S as resolveTarget, T as envExampleContent, U as errorInitUserAborted, W as errorInitWriteFailed, a as mergeTsConfig, c as findStaleArtifacts, d as ensureEsmModuleType, f as mergePackageScripts, h as requiredGitattributesLines, i as defaultTsConfig, j as legacySkillDirs, l as removeDependency, m as mergeGitattributes, n as isRecognisedPnpmResolutionError, o as minimalProjectReadmeMd, p as mergeGitignore, r as TsConfigParseError, s as quickReferenceMd, t as redactSecrets, u as REQUIRED_SCRIPTS, w as MIN_SERVER_VERSION, x as resolveAuthoring, y as formatRunCommand, z as errorInitProbeFailed } from \"./redact-secrets-Bt-n_DxQ.mjs\";\nimport { n as buildNextSteps, t as InitOutputSchema } from \"./output-DP3woAjV.mjs\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { basename, dirname, isAbsolute, join, normalize, relative, resolve } from \"pathe\";\nimport { mkdir, readFile, rename, rm, writeFile } from \"node:fs/promises\";\nimport { APP_SPACE_ID, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, createControlStack, issueOutcome } from \"@internal/framework-components/control\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { printPsl } from \"@internal/psl-printer\";\nimport { InternalError, assertNever, isInternalError } from \"@internal/utils/internal-error\";\nimport { DOCS_BASE, docsUrlFor, isStructuredError, isStructuredErrorCode } from \"@internal/utils/structured-error\";\nimport { type } from \"arktype\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, defineServerCommand, flag, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError, notOk, ok } from \"@prisma/cli-engine/protocol\";\nimport { collectConfigIssues } from \"@internal/config/config-validation\";\nimport { detect } from \"package-manager-detector/detect\";\nconst MISSING_CONFIG_ACTION = {\n\tkind: \"run-command\",\n\tlabel: \"Create a config file\",\n\tcommand: \"prisma-next init\"\n};\nfunction editConfigAction(field) {\n\treturn {\n\t\tkind: \"edit-file\",\n\t\tlabel: `Correct ${field} in prisma-next.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-next.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-next.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-next.config.ts\"\n\t\t}]\n\t};\n}\nfunction isRecord(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(contract)) return [];\n\tconst source = contract[\"source\"];\n\tconst output = contract[\"output\"];\n\tif (!isRecord(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(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(\"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;\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(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 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, ctx);\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn notOk(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\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(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\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(normalizeError(errorDatabaseConnectionRequired({\n\t\t\t\twhy: \"Database connection is required for contract infer (set db.connection in prisma-next.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(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(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$1.is(error)) return notOk(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(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(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/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-next 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-next.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(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-next contract emit` to generate contract.json, or update `contract.output` in prisma-next.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(castAs(JSON.parse(content)));\n\t} catch (error) {\n\t\treturn notOk(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(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(contract.failure);\n\tconst dbConnection = inputs.db ?? config.db?.connection;\n\tif (dbConnection === void 0) return notOk(normalizeError(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${commandName} (set db.connection in prisma-next.config.ts, or pass --db <url>)`,\n\t\tcommandName,\n\t\tmissingFlags: [\"--db\"]\n\t})));\n\tif (config.driver === void 0) return notOk(normalizeError(errorDriverRequired({ why: `Config.driver is required for ${commandName}` })));\n\tif (!targetSupportsMigrations(config.target)) return notOk(normalizeError(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` })));\n\treturn ok({\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\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-next 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(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(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(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$1.is(error)) return notOk(normalizeError(error));\n\t\t\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk(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(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(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\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(normalizeError(errorDatabaseConnectionRequired({\n\t\t\t\twhy: \"Database connection is required for db schema (set db.connection in prisma-next.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(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$1.is(error)) return notOk(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(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(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(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(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-next contract emit\\` to generate ${relativePath}, or update \\`contract.output\\` in prisma-next.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({\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(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(normalizeError(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${inputs.invocation} (set db.connection in prisma-next.config.ts, or pass --db <url>)`,\n\t\tmissingFlags: [\"--db\"],\n\t\tretryCommand: `prisma-next ${inputs.invocation} --db <url>`\n\t})));\n\tif (inputs.config.driver === void 0) return notOk(normalizeError(errorDriverRequired({ why: `Config.driver is required for ${inputs.invocation}` })));\n\treturn ok(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(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-next.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\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\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(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(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(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(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(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-next 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(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(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-next db init` to recreate it with the current per-space schema.\" : \"Inspect the reported conflict, reconcile schema drift if needed, then re-run `prisma-next 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-next 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(\"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-next 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(\"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-next 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\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-next 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(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(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(normalizeError(errorConsentOperationsMissing()));\n\t\t\t\t\tconst token = refusal.databaseName ?? \"\";\n\t\t\t\t\tif (token.trim().length === 0) return notOk(normalizeError(errorConsentTokenUnresolved(ctx.config.target.targetId)));\n\t\t\t\t\tif (!await ctx.prompt.consent(destructiveConsentQuestion(refusal.destructiveOperations, token), { token })) return notOk(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(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(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) throw error;\n\t\t\t\tif (CliStructuredError$1.is(error)) return notOk(normalizeError(error));\n\t\t\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk(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(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(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/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-next 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(\"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(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(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(\"schema-only\");\n\treturn ok(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\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\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(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(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(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(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(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(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(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(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(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(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(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(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/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\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(normalizeError(result.failure));\n\t\t\treturn ok(ctx.present({ data: result.value }, formatPresentations(result.value, ctx.cwd)));\n\t\t}\n\t});\n}\nconst formatCommand = createFormatCommand();\n//#endregion\n//#region src/orm/init-diagnostics.ts\n/** The invocation that finishes what a failed `init` phase started. */\nconst EMIT_COMMAND = \"prisma-next 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\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/orm/init-emit.ts\n/**\n* Emits the contract for the project `init` has just scaffolded.\n*\n* The config file is the one this run wrote, so it is read here rather than\n* through `needs.config`: `init` runs where no config exists yet, and the\n* engine loads a section before the handler starts. The emitter and the config\n* loader are imported at execution time so a run that skips the install — and\n* therefore skips the emit — never pays for either.\n*/\nasync function emitScaffoldedContract(ctx) {\n\tconst { executeContractEmit } = await import(\"./contract-emit-BkEj3siG.mjs\");\n\tconst { loadConfigForSections } = await import(\"@internal/config-loader\");\n\tconst configPath = join(ctx.cwd, \"prisma-next.config.ts\");\n\tconst loaded = await loadConfigForSections(configPath, [\n\t\t\"contract\",\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"extensions\"\n\t]);\n\tif (!loaded.ok) throw loaded.failure;\n\tawait executeContractEmit({\n\t\tconfig: loaded.value,\n\t\tcwd: ctx.cwd,\n\t\tconfigPath\n\t});\n}\n//#endregion\n//#region src/orm/init-scaffold.ts\nconst CONFIG_FILE = \"prisma-next.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-next\", \"\").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\treturn validateSchemaPath(await prompt.text(\"Where should the schema file go?\", { default: defaultSchemaPath(authoring) }), 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/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*/\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 devDeps = scaffold.hasTypesNode ? [\"prisma-next\"] : [\"prisma-next\", \"@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(new CliStructuredError(\"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(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\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(\", \")} 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(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/orm/migrate.ts\nconst STATUS_ACTION = runCommandAction(\"Check every space against the database\", \"prisma-next 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\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\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({\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(normalizeError(resolved.failure));\n\tif (resolved.value.provenance.kind !== \"ref\") return ok({\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({\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(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(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(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(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(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});\n\t\t\tif (integrityFailure) return notOk(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(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(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(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(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(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(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(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(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/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\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(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(normalizeError(outcome.error));\n\t\t\tconst result = outcome.result;\n\t\t\tif (result === void 0 || outcome.exitCode === 2) return notOk(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(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(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/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 the one thing here that belongs on stdout.\n*/\nfunction graphPresentations(inputs) {\n\tconst { tree, dot, legend } = inputs;\n\treturn {\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...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(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(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(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(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\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(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(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(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/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\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-next.config.ts, or pass --db <url>)\",\n\t\t\tcommandName: \"migration log\"\n\t\t});\n\t\tif (missingDb !== null) return notOk(normalizeError(missingDb));\n\t\tif (!targetSupportsMigrations(ctx.config.target)) return notOk(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(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(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\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(normalizeError(scaffolded.failure));\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\treturn ok(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-next migrate\")];\n}\nfunction planPresentations(inputs) {\n\treturn {\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(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(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\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(normalizeError(path.failure));\n\t\tconst matched = findPackageByDirPath(inputs.packages, path.value);\n\t\treturn matched === void 0 ? notOk(normalizeError(errorMigrationPackageNotFound(`No loaded migration package at ${relative(inputs.cwd, path.value)}`))) : ok(matched);\n\t}\n\tif (inputs.packages.length === 0) return notOk(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(normalizeError(ref.failure));\n\tconst matched = inputs.packages.find((candidate) => candidate.metadata.migrationHash === ref.value.migrationHash);\n\treturn matched === void 0 ? notOk(normalizeError(errorMigrationPackageNotFound(`Resolved migration \"${ref.value.dirName}\" but the package was not loaded`))) : ok(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(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(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-next 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(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(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(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(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-next 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-next 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-next db sign' to overwrite the marker if the database already matches the contract\", \"Run 'prisma-next 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-next db sign\"), runCommandAction(\"Or push the current contract to the database\", \"prisma-next 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-next 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({\n\t\t\tmarkersBySpace,\n\t\t\tledgersBySpace\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(normalizeError(CliStructuredError.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-next 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-next 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-next 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\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-next migration status --from <contract>\"\n\t\t\t});\n\t\t\tif (missingDb !== null) return notOk(normalizeError(missingDb));\n\t\t}\n\t\tconst refsResult = await readMigrationRefs(appRefsDirFor(ctx.config, ctx.cwd));\n\t\tif (!refsResult.ok) return notOk(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(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);\n\t\t\tif (corruption) return notOk(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(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(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(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(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(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(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(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\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(normalizeError(result.failure));\n\t\t\treturn ok(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\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(normalizeError(result.failure));\n\t\t\treturn ok(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\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(normalizeError(result.failure));\n\t\t\treturn ok(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-next.config.ts\";\n/**\n* Builds the engine's `Runtime.config` from `prisma-next.config.ts`.\n*\n* The engine's own loader reads `prisma.config.ts` and the `$prismaConfig`\n* marker, which is not the file this bin reads, so 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. The whole result nests as the\n* single `orm` section — the engine models one section per family, and\n* `contract`, `db`, `migrations` and the rest are subsections of it.\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, 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-pHRFM_nB.mjs.map","import { t as createContractEmitCommand } from \"../contract-emit-GknCmgn_.mjs\";\nimport { t as createFormatCommand } from \"../format-Ca7dUE6B.mjs\";\nimport { E as ormConfigSection, n as ormCommandFamily, t as loadOrmConfig } from \"../load-config-pHRFM_nB.mjs\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { join, resolve } from \"pathe\";\nimport { existsSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\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 { createContractEmitCommand, createFormatCommand, loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };\n\n//# sourceMappingURL=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A2B,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","createContractEmitCommand","errorRuntime","CliStructuredError$1","errorConfigValidation","createFormatCommand"],"sources":["../../../../1-framework/3-tooling/cli/dist/load-config-CZL229Gn.mjs","../../../../1-framework/3-tooling/cli/dist/exports/index.mjs"],"sourcesContent":["import { c as targetLabel, i as scaffoldSpecifierResolverFor, l as targetPackageName, n as dbFile, o as starterSchema, r as defaultSchemaPath, t as configFile } from \"./code-templates-D_sGnEF6.mjs\";\nimport { I as requireLiveDatabase, L as chooseAction, M as errorTargetMigrationNotSupported, N as errorTargetMismatch, O as errorRunnerFailed, P as errorUnexpected, R as runCommandAction, a as errorConsentPlanMismatch, b as errorMigrationPlanningFailed, c as errorContractValidationFailed, d as errorDriverRequired, f as errorFileNotFound, g as errorLegendHumanOnly, i as errorConfigValidation, k as errorRuntime, l as errorDatabaseConnectionRequired, o as errorContractArgConflict, p as errorHashMismatch, t as CliStructuredError$1, u as errorDestructiveChanges, v as errorMarkerMissing, x as errorNoMigrations, y as errorMigrationPackageNotFound } from \"./cli-errors-B4zTLaqQ.mjs\";\nimport { t as executeContractEmit } from \"./contract-emit-BG7KL4zk.mjs\";\nimport { d as renderPreviewStatement, u as previewBlockHeader } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { a as maskConnectionUrl, l as sanitizeErrorMessage, n as closeQuietly, o as readContractEnvelope, p as targetSupportsMigrations } from \"./command-helpers-BCgwcqTe.mjs\";\nimport { a as loadContractSpaceAggregateForCli, i as loadContractRawSafely, l as refusePackageCorruptionOnAggregate, r as buildReadAggregate, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from \"./contract-space-aggregate-loader-fa04OIaL.mjs\";\nimport { t as createControlClient } from \"./client-C6Qp5ujC.mjs\";\nimport { a as readContractIR, o as resolveRefAdvancementFields, t as advanceRefSafely } from \"./ref-advancement-DaZBzm7m.mjs\";\nimport { t as mapDbInitFailure } from \"./db-init-failure-B5cQML4A.mjs\";\nimport { t as resolveContractRefToSnapshot } from \"./contract-snapshot-resolution-De2VvOJn.mjs\";\nimport { t as combineVerifyResults } from \"./combine-verify-results-B87B_pMc.mjs\";\nimport { t as executeFormat } from \"./format-DrW250a2.mjs\";\nimport { t as mapCaughtMigrationError } from \"./caught-errors-BZo7zcRc.mjs\";\nimport { t as mapContractAtError } from \"./contract-at-errors-BSoDI0Hw.mjs\";\nimport { i as refuseMarkerOutsideGraph, n as refuseUnknownInvariants, r as hasMigrationPath, t as refuseMissingInvariantPath } from \"./invariants-Bltd8DyA.mjs\";\nimport { t as executeMigrateShowPlan } from \"./migrate-show-C_9xR4Qt.mjs\";\nimport { n as resolveMigrationRef, t as resolveContractRef } from \"./ref-resolution-BSN1amKm.mjs\";\nimport { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList, t as listRefsByContractHash } from \"./migration-list-CY08bD8I.mjs\";\nimport { C as toneSpans, S as toneDrawing, a as renderMigrationGraphLegend, h as renderMigrationGraphSpaceTrees, l as renderMigrationListWithStyle, p as indentMigrationGraphTreeBlock, s as createToneMigrationListStyler, x as TONE_MIGRATION_GRAPH_PALETTE } from \"./migration-graph-command-render-h0VdTkSM.mjs\";\nimport { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from \"./migrate-failure-D4NvkoCk.mjs\";\nimport { n as looksLikePath, r as resolveAppTargetPath, t as findPackageByDirPath } from \"./migration-path-target-JDWqF9kj.mjs\";\nimport { i as runMigrationCheck, n as enumerateCheckSpaces, r as loadAggregateIntegrityViolations, t as checkSingleTarget } from \"./migration-check-Bbdw7t-r.mjs\";\nimport { t as integrityViolationToCheckFailure } from \"./integrity-violation-to-check-failure-BmWMLAae.mjs\";\nimport { t as buildMigrationSpaceGraphEntries } from \"./migration-graph-B8WxW_tm.mjs\";\nimport { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from \"./migration-graph-sections-BBHPOFN-.mjs\";\nimport { a as sortLedgerEntries, i as serializeLedgerEntriesForJson, n as formatLedgerAppliedAt, o as styleHashTransition, t as MIGRATION_LOG_EMPTY_MESSAGE } from \"./migration-log-table-eES9lPjv.mjs\";\nimport { t as executeMigrationNewCommand } from \"./migration-new-DXMvJdbB.mjs\";\nimport { t as executeMigrationPlanCommand } from \"./migration-plan-Cfz0efEL.mjs\";\nimport { a as statusForMigrationHash, i as originHashForStatus, n as appliedHashesFromLedger, r as deriveStatusEdgeAnnotations, t as readMigrationRefs } from \"./refs-fQLFcMoq.mjs\";\nimport { n as executeRefListCommand, r as executeRefSetCommand, t as executeRefDeleteCommand } from \"./ref-WXLIR9Xm.mjs\";\nimport { A as formatSkillSourceUrl, C as validateSchemaPath, D as DEFAULT_SKILL_AGENTS, E as envFileContent, G as buildCatalogWarnings, H as errorInitStrictProbeWithoutProbe, I as errorInitInvalidManifest, L as errorInitInvalidTsconfig, M as resolveProjectSkillInstallCommands, N as probeServerVersion, O as DEFAULT_SKILL_SOURCES, R as errorInitMissingFlags, S as resolveTarget, T as envExampleContent, U as errorInitUserAborted, W as errorInitWriteFailed, a as mergeTsConfig, c as findStaleArtifacts, d as ensureEsmModuleType, f as mergePackageScripts, h as requiredGitattributesLines, i as defaultTsConfig, j as legacySkillDirs, l as removeDependency, m as mergeGitattributes, n as isRecognisedPnpmResolutionError, o as minimalProjectReadmeMd, p as mergeGitignore, r as TsConfigParseError, s as quickReferenceMd, t as redactSecrets, u as REQUIRED_SCRIPTS, w as MIN_SERVER_VERSION, x as resolveAuthoring, y as formatRunCommand, z as errorInitProbeFailed } from \"./redact-secrets-ojVi2cpy.mjs\";\nimport { n as buildNextSteps, t as InitOutputSchema } from \"./output-DP3woAjV.mjs\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { basename, dirname, isAbsolute, join, normalize, relative, resolve } from \"pathe\";\nimport { mkdir, readFile, rename, rm, writeFile } from \"node:fs/promises\";\nimport { APP_SPACE_ID, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, createControlStack, issueOutcome } from \"@internal/framework-components/control\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { printPsl } from \"@internal/psl-printer\";\nimport { InternalError, assertNever, isInternalError } from \"@internal/utils/internal-error\";\nimport { DOCS_BASE, docsUrlFor, isStructuredError, isStructuredErrorCode } from \"@internal/utils/structured-error\";\nimport { type } from \"arktype\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, defineServerCommand, flag, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError, notOk, ok } from \"@prisma/cli-engine/protocol\";\nimport { collectConfigIssues } from \"@internal/config/config-validation\";\nimport { detect } from \"package-manager-detector/detect\";\nconst MISSING_CONFIG_ACTION = {\n\tkind: \"run-command\",\n\tlabel: \"Create a config file\",\n\tcommand: \"prisma-next init\"\n};\nfunction editConfigAction(field) {\n\treturn {\n\t\tkind: \"edit-file\",\n\t\tlabel: `Correct ${field} in prisma-next.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-next.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-next.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-next.config.ts\"\n\t\t}]\n\t};\n}\nfunction isRecord(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(contract)) return [];\n\tconst source = contract[\"source\"];\n\tconst output = contract[\"output\"];\n\tif (!isRecord(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(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(\"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;\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(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 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, ctx);\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn notOk(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\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(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\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(normalizeError(errorDatabaseConnectionRequired({\n\t\t\t\twhy: \"Database connection is required for contract infer (set db.connection in prisma-next.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(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(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$1.is(error)) return notOk(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(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(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/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-next 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-next.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(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-next contract emit` to generate contract.json, or update `contract.output` in prisma-next.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(castAs(JSON.parse(content)));\n\t} catch (error) {\n\t\treturn notOk(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(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(contract.failure);\n\tconst dbConnection = inputs.db ?? config.db?.connection;\n\tif (dbConnection === void 0) return notOk(normalizeError(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${commandName} (set db.connection in prisma-next.config.ts, or pass --db <url>)`,\n\t\tcommandName,\n\t\tmissingFlags: [\"--db\"]\n\t})));\n\tif (config.driver === void 0) return notOk(normalizeError(errorDriverRequired({ why: `Config.driver is required for ${commandName}` })));\n\tif (!targetSupportsMigrations(config.target)) return notOk(normalizeError(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` })));\n\treturn ok({\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\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-next 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(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(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(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$1.is(error)) return notOk(normalizeError(error));\n\t\t\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk(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(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(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\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(normalizeError(errorDatabaseConnectionRequired({\n\t\t\t\twhy: \"Database connection is required for db schema (set db.connection in prisma-next.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(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$1.is(error)) return notOk(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(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(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(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(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-next contract emit\\` to generate ${relativePath}, or update \\`contract.output\\` in prisma-next.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({\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(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(normalizeError(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${inputs.invocation} (set db.connection in prisma-next.config.ts, or pass --db <url>)`,\n\t\tmissingFlags: [\"--db\"],\n\t\tretryCommand: `prisma-next ${inputs.invocation} --db <url>`\n\t})));\n\tif (inputs.config.driver === void 0) return notOk(normalizeError(errorDriverRequired({ why: `Config.driver is required for ${inputs.invocation}` })));\n\treturn ok(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(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-next.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\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\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(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(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(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(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(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-next 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(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(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-next db init` to recreate it with the current per-space schema.\" : \"Inspect the reported conflict, reconcile schema drift if needed, then re-run `prisma-next 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-next 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(\"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-next 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(\"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-next 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\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-next 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(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(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(normalizeError(errorConsentOperationsMissing()));\n\t\t\t\t\tconst token = refusal.databaseName ?? \"\";\n\t\t\t\t\tif (token.trim().length === 0) return notOk(normalizeError(errorConsentTokenUnresolved(ctx.config.target.targetId)));\n\t\t\t\t\tif (!await ctx.prompt.consent(destructiveConsentQuestion(refusal.destructiveOperations, token), { token })) return notOk(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(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(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) throw error;\n\t\t\t\tif (CliStructuredError$1.is(error)) return notOk(normalizeError(error));\n\t\t\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk(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(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(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/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-next 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(\"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(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(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(\"schema-only\");\n\treturn ok(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\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\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(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(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(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(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(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(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(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(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(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(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(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(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/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\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(normalizeError(result.failure));\n\t\t\treturn ok(ctx.present({ data: result.value }, formatPresentations(result.value, ctx.cwd)));\n\t\t}\n\t});\n}\nconst formatCommand = createFormatCommand();\n//#endregion\n//#region src/orm/init-diagnostics.ts\n/** The invocation that finishes what a failed `init` phase started. */\nconst EMIT_COMMAND = \"prisma-next 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\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/orm/init-emit.ts\n/**\n* Emits the contract for the project `init` has just scaffolded.\n*\n* The config file is the one this run wrote, so it is read here rather than\n* through `needs.config`: `init` runs where no config exists yet, and the\n* engine loads a section before the handler starts. The emitter and the config\n* loader are imported at execution time so a run that skips the install — and\n* therefore skips the emit — never pays for either.\n*/\nasync function emitScaffoldedContract(ctx) {\n\tconst { executeContractEmit } = await import(\"./contract-emit-BkEj3siG.mjs\");\n\tconst { loadConfigForSections } = await import(\"@internal/config-loader\");\n\tconst configPath = join(ctx.cwd, \"prisma-next.config.ts\");\n\tconst loaded = await loadConfigForSections(configPath, [\n\t\t\"contract\",\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"extensions\"\n\t]);\n\tif (!loaded.ok) throw loaded.failure;\n\tawait executeContractEmit({\n\t\tconfig: loaded.value,\n\t\tcwd: ctx.cwd,\n\t\tconfigPath\n\t});\n}\n//#endregion\n//#region src/orm/init-scaffold.ts\nconst CONFIG_FILE = \"prisma-next.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-next\", \"\").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\treturn validateSchemaPath(await prompt.text(\"Where should the schema file go?\", { default: defaultSchemaPath(authoring) }), 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/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*/\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 devDeps = scaffold.hasTypesNode ? [\"prisma-next\"] : [\"prisma-next\", \"@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(new CliStructuredError(\"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(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\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(\", \")} 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(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/orm/migrate.ts\nconst STATUS_ACTION = runCommandAction(\"Check every space against the database\", \"prisma-next 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\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\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({\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(normalizeError(resolved.failure));\n\tif (resolved.value.provenance.kind !== \"ref\") return ok({\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({\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(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(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(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(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(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});\n\t\t\tif (integrityFailure) return notOk(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(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(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(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(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(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(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(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(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/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\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(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(normalizeError(outcome.error));\n\t\t\tconst result = outcome.result;\n\t\t\tif (result === void 0 || outcome.exitCode === 2) return notOk(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(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(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/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 the one thing here that belongs on stdout.\n*/\nfunction graphPresentations(inputs) {\n\tconst { tree, dot, legend } = inputs;\n\treturn {\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...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(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(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(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(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\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(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(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(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/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\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-next.config.ts, or pass --db <url>)\",\n\t\t\tcommandName: \"migration log\"\n\t\t});\n\t\tif (missingDb !== null) return notOk(normalizeError(missingDb));\n\t\tif (!targetSupportsMigrations(ctx.config.target)) return notOk(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(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(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\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(normalizeError(scaffolded.failure));\n\t\tconst contractPath = contractPathFor(ctx.config, ctx.cwd);\n\t\treturn ok(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-next migrate\")];\n}\nfunction planPresentations(inputs) {\n\treturn {\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(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(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\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(normalizeError(path.failure));\n\t\tconst matched = findPackageByDirPath(inputs.packages, path.value);\n\t\treturn matched === void 0 ? notOk(normalizeError(errorMigrationPackageNotFound(`No loaded migration package at ${relative(inputs.cwd, path.value)}`))) : ok(matched);\n\t}\n\tif (inputs.packages.length === 0) return notOk(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(normalizeError(ref.failure));\n\tconst matched = inputs.packages.find((candidate) => candidate.metadata.migrationHash === ref.value.migrationHash);\n\treturn matched === void 0 ? notOk(normalizeError(errorMigrationPackageNotFound(`Resolved migration \"${ref.value.dirName}\" but the package was not loaded`))) : ok(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(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(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-next 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(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(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(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(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-next 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-next 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-next db sign' to overwrite the marker if the database already matches the contract\", \"Run 'prisma-next 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-next db sign\"), runCommandAction(\"Or push the current contract to the database\", \"prisma-next 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-next 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({\n\t\t\tmarkersBySpace,\n\t\t\tledgersBySpace\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(normalizeError(CliStructuredError.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-next 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-next 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-next 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\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-next migration status --from <contract>\"\n\t\t\t});\n\t\t\tif (missingDb !== null) return notOk(normalizeError(missingDb));\n\t\t}\n\t\tconst refsResult = await readMigrationRefs(appRefsDirFor(ctx.config, ctx.cwd));\n\t\tif (!refsResult.ok) return notOk(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(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);\n\t\t\tif (corruption) return notOk(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(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(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(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(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(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(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(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\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(normalizeError(result.failure));\n\t\t\treturn ok(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\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(normalizeError(result.failure));\n\t\t\treturn ok(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\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(normalizeError(result.failure));\n\t\t\treturn ok(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-next.config.ts\";\n/**\n* Builds the engine's `Runtime.config` from `prisma-next.config.ts`.\n*\n* The engine's own loader reads `prisma.config.ts` and the `$prismaConfig`\n* marker, which is not the file this bin reads, so 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. The whole result nests as the\n* single `orm` section — the engine models one section per family, and\n* `contract`, `db`, `migrations` and the rest are subsections of it.\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, 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-CZL229Gn.mjs.map","import { t as createContractEmitCommand } from \"../contract-emit-GknCmgn_.mjs\";\nimport { t as createFormatCommand } from \"../format-Ca7dUE6B.mjs\";\nimport { E as ormConfigSection, n as ormCommandFamily, t as loadOrmConfig } from \"../load-config-CZL229Gn.mjs\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { join, resolve } from \"pathe\";\nimport { existsSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\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 { createContractEmitCommand, createFormatCommand, loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,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,OAAO,MAAM;GACb,SAAS,MAAM;EAChB;CACD;AACD;AACA,SAAS,0BAA0B;CAClC,OAAO;EACN,MAAM;EACN,UAAU;EACV,SAAS;EACT,KAAK;EACL,aAAa,CAAC,qBAAqB;CACpC;AACD;AACA,SAAS,wBAAwB;CAChC,OAAO;EACN,MAAM;EACN,UAAU;EACV,SAAS;EACT,KAAK;EACL,aAAa,CAAC;GACb,MAAM;GACN,OAAO;EACR,CAAC;CACF;AACD;AACA,SAAS,qBAAqB,OAAO;CACpC,OAAO;EACN,MAAM;EACN,UAAU;EACV,SAAS;EACT,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAC1D,aAAa,CAAC;GACb,MAAM;GACN,OAAO;EACR,CAAC;CACF;AACD;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC3E;;;;;;AAMA,SAAS,+BAA+B,KAAK;CAC5C,MAAM,WAAW,IAAI;CACrB,IAAI,CAAC,SAAS,QAAQ,GAAG,OAAO,C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