@prisma/orm-toolchain 8.0.0-rc.1-dev.42 → 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/bin__prisma-next.mjs +2 -2
- package/dist/bin__prisma-next.mjs.map +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/{code-templates-xi-uYwD3-FoFK1hQS.mjs → code-templates-D_sGnEF6-DRLPzlq8.mjs} +3 -3
- package/dist/{code-templates-xi-uYwD3-FoFK1hQS.mjs.map → code-templates-D_sGnEF6-DRLPzlq8.mjs.map} +1 -1
- package/dist/{init-DWkdEN4F-gRFdVSCZ.mjs → init-B86mXFNC-C2HAUCRn.mjs} +4 -4
- package/dist/{init-DWkdEN4F-gRFdVSCZ.mjs.map → init-B86mXFNC-C2HAUCRn.mjs.map} +1 -1
- package/dist/{redact-secrets-Dmn0oXjA-Jbuvkip9.mjs → redact-secrets-ojVi2cpy-CLyiSDk5.mjs} +4 -4
- package/dist/{redact-secrets-Dmn0oXjA-Jbuvkip9.mjs.map → redact-secrets-ojVi2cpy-CLyiSDk5.mjs.map} +1 -1
- package/package.json +12 -12
package/dist/{redact-secrets-Dmn0oXjA-Jbuvkip9.mjs.map → redact-secrets-ojVi2cpy-CLyiSDk5.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redact-secrets-Dmn0oXjA-Jbuvkip9.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/redact-secrets-Dmn0oXjA.mjs"],"sourcesContent":["import { a as schemaSample, l as targetPackageName, s as targetEntrypoint, u as version } from \"./code-templates-xi-uYwD3.mjs\";\nimport { t as CliStructuredError$1 } from \"./cli-errors-B4zTLaqQ.mjs\";\nimport { createRequire } from \"node:module\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { dirname, extname, join, normalize } from \"pathe\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { docsUrlFor } from \"@internal/utils/structured-error\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { detect, getUserAgent } from \"package-manager-detector/detect\";\nimport { applyEdits, modify, parse, printParseErrorCode } from \"jsonc-parser\";\n//#region src/commands/init/detect-pnpm-catalog.ts\n/**\n* Walks up from `baseDir` looking for `pnpm-workspace.yaml`, then scans\n* its top-level `catalog:` block for entries that match any of `packages`.\n*\n* Implements FR7.3 / Spec Decision 8 (honour-and-warn): when `init` runs\n* inside a pnpm workspace whose catalog overrides one of the packages it\n* installs, surface a structured warning so the user knows the catalog\n* version (not the published `latest`) is what ended up in their\n* `node_modules`. pnpm itself does this silently; the warning closes the\n* \"looks fine, must be wrong version six months later\" gap.\n*\n* Notes / scope:\n*\n* - We only inspect the unnamed top-level `catalog:` block. pnpm also\n* supports `catalogs:` (plural — *named* catalogs referenced via\n* `catalog:foo` specifiers); those don't apply to a vanilla\n* `pnpm add prisma-next` invocation, so we skip them.\n* - We don't validate YAML syntax exhaustively. The file format pnpm\n* ships is line-oriented and well-known; a minimal regex is more\n* robust than depending on a YAML parser for one warning.\n* - We don't compare against the registry's `latest` — pnpm uses the\n* catalog version regardless, so the warning fires whenever a match\n* exists. The user-facing copy explains how to opt out.\n*/\nfunction detectPnpmCatalogOverrides(baseDir, packages) {\n\tconst workspaceFile = findNearestPnpmWorkspaceFile(baseDir);\n\tif (workspaceFile === null) return null;\n\tconst catalog = extractCatalogBlock(readFileSync(workspaceFile, \"utf-8\"));\n\tif (catalog === null) return {\n\t\tworkspaceFile,\n\t\tentries: []\n\t};\n\tconst wanted = new Set(packages);\n\tconst entries = [];\n\tfor (const [name, version] of catalog) if (wanted.has(name)) entries.push({\n\t\tname,\n\t\tversion\n\t});\n\treturn {\n\t\tworkspaceFile,\n\t\tentries\n\t};\n}\nfunction findNearestPnpmWorkspaceFile(baseDir) {\n\tlet dir = baseDir;\n\tlet prev = \"\";\n\twhile (dir !== prev) {\n\t\tconst candidate = join(dir, \"pnpm-workspace.yaml\");\n\t\tif (existsSync(candidate)) return candidate;\n\t\tprev = dir;\n\t\tdir = dirname(dir);\n\t}\n\treturn null;\n}\n/**\n* Returns the entries inside the top-level `catalog:` block as `[name, version]`\n* pairs in document order, or `null` when no `catalog:` block exists.\n*\n* The parser is intentionally minimal: it reads line-by-line, locates the\n* top-level `catalog:` line (no leading whitespace), then collects every\n* subsequent indented line of the form `<key>: <value>` until the next\n* top-level key (or end of file). Quotes around `<key>` and `<value>`\n* are stripped; comments (`#…`) are ignored.\n*/\nfunction extractCatalogBlock(contents) {\n\tconst lines = contents.split(/\\r?\\n/);\n\tconst startIdx = lines.findIndex((line) => /^catalog\\s*:\\s*$/.test(line));\n\tif (startIdx === -1) return null;\n\tconst entries = [];\n\tfor (let i = startIdx + 1; i < lines.length; i++) {\n\t\tconst raw = lines[i] ?? \"\";\n\t\tif (raw.trim() === \"\" || /^\\s*#/.test(raw)) continue;\n\t\tif (!/^\\s/.test(raw)) break;\n\t\tconst match = raw.match(/^\\s+(?:'([^']+)'|\"([^\"]+)\"|([^:\\s'\"]+))\\s*:\\s*(.*?)\\s*(?:#.*)?$/);\n\t\tif (!match) continue;\n\t\tconst name = match[1] ?? match[2] ?? match[3];\n\t\tif (name === void 0) continue;\n\t\tconst version = stripQuotes((match[4] ?? \"\").trim());\n\t\tif (version === \"\") continue;\n\t\tentries.push([name, version]);\n\t}\n\treturn entries;\n}\nfunction stripQuotes(value) {\n\tif (value.length >= 2) {\n\t\tconst first = value[0];\n\t\tconst last = value[value.length - 1];\n\t\tif (first === \"\\\"\" && last === \"\\\"\" || first === \"'\" && last === \"'\") return value.slice(1, -1);\n\t}\n\treturn value;\n}\n//#endregion\n//#region src/commands/init/catalog-warnings.ts\nfunction formatCatalogWarning(workspaceFile, entries) {\n\treturn [\n\t\t\"pnpm workspace catalog overrides detected — pnpm will install these versions instead of `latest`:\",\n\t\tentries.map((entry) => ` • ${entry.name}: ${entry.version}`).join(\"\\n\"),\n\t\t`Catalog source: ${workspaceFile}`,\n\t\t\"To use the published `latest` instead, remove or update the catalog entry, then re-run `pnpm install`.\"\n\t].join(\"\\n\");\n}\n/**\n* Honour-and-warn: when the surrounding pnpm workspace pins one of the\n* packages `init` installs through its catalog, say so — the catalog version,\n* not the published `latest`, is what ends up in the project. Empty when there\n* is no workspace above the project or its catalog names none of them.\n*/\nfunction buildCatalogWarnings(baseDir, packages) {\n\tconst result = detectPnpmCatalogOverrides(baseDir, packages);\n\tif (result === null || result.entries.length === 0) return [];\n\treturn [formatCatalogWarning(result.workspaceFile, result.entries)];\n}\n//#endregion\n//#region src/commands/init/errors.ts\n/**\n* Re-init in non-interactive mode without `--force`. Distinct from the\n* decline-the-prompt path (which is `errorInitUserAborted`) because here\n* the user was never given the choice — `--force` is the contract.\n*/\nfunction errorInitReinitNeedsForce() {\n\treturn new CliStructuredError$1(\"CLI.INIT_REINIT_NEEDS_FORCE\", \"Project is already initialized\", {\n\t\twhy: \"A `prisma-next.config.ts` already exists in this directory. Re-running `init` would overwrite the scaffolded files; in non-interactive mode `init` will not do that without `--force`.\",\n\t\tfix: \"Pass `--force` to overwrite the existing scaffold, or run `init` interactively to confirm.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_REINIT_NEEDS_FORCE\")\n\t});\n}\n/**\n* Non-interactive mode is missing one or more required inputs. Lists every\n* missing flag in the error so an agent / CI script can react without\n* needing to parse English.\n*\n* @param missing — kebab-case flag names without leading dashes\n* @param why — additional context (e.g. \"stdin is not a TTY\") that helps\n* the user understand why interactive fallback was skipped.\n*/\nfunction errorInitMissingFlags(options) {\n\tconst flagList = options.missing.map((flag) => `--${flag}`).join(\", \");\n\tconst fixList = options.missing.map((flag) => {\n\t\tswitch (flag) {\n\t\t\tcase \"target\": return \"--target postgres|mongodb\";\n\t\t\tcase \"authoring\": return \"--authoring psl|typescript\";\n\t\t\tcase \"schema-path\": return \"--schema-path <path>\";\n\t\t\tdefault: return `--${flag} <value>`;\n\t\t}\n\t}).join(\" \");\n\treturn new CliStructuredError$1(\"CLI.INIT_MISSING_FLAGS\", \"Missing required flags\", {\n\t\twhy: `${options.why} Missing required flag(s): ${flagList}.`,\n\t\tfix: `Re-run with the missing flag(s) supplied, e.g. \\`prisma-next init --yes ${fixList}\\`. Use \\`prisma-next init --help\\` to see every flag.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_MISSING_FLAGS\"),\n\t\tmeta: { missingFlags: options.missing }\n\t});\n}\n/**\n* A flag value was supplied but is not in the allowed set. Lists the\n* allowed values in `meta` for machine-readable consumption.\n*/\nfunction errorInitInvalidFlagValue(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_INVALID_FLAG_VALUE\", `Invalid value for --${options.flag}`, {\n\t\twhy: `\\`--${options.flag} ${options.value}\\` is not one of: ${options.allowed.join(\", \")}.`,\n\t\tfix: `Use one of: ${options.allowed.map((v) => `--${options.flag} ${v}`).join(\", \")}.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_FLAG_VALUE\"),\n\t\tmeta: {\n\t\t\tflag: options.flag,\n\t\t\tvalue: options.value,\n\t\t\tallowed: options.allowed\n\t\t}\n\t});\n}\n/**\n* `--authoring` and `--schema-path` disagree on file extension (e.g. PSL\n* authoring with a `.ts` path). Surfaces before any scaffold files are\n* written so the project tree stays untouched.\n*/\nfunction errorInitAuthoringSchemaPathMismatch(options) {\n\tconst expectedAuthoring = options.expectedExtension === \".ts\" ? \"typescript\" : \"psl\";\n\treturn new CliStructuredError$1(\"CLI.INIT_AUTHORING_SCHEMA_PATH_MISMATCH\", \"Authoring and schema path do not match\", {\n\t\twhy: `\\`--authoring ${options.authoring}\\` requires a schema file ending in ${options.expectedExtension}, but \\`--schema-path ${options.schemaPath}\\` ends in ${options.actualExtension}.`,\n\t\tfix: `Use a matching pair, for example \\`--authoring ${expectedAuthoring} --schema-path <path>${options.expectedExtension}\\`, or change \\`--authoring\\` to match the path you supplied. You can also omit \\`--schema-path\\` to use the default for the chosen authoring.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_AUTHORING_SCHEMA_PATH_MISMATCH\"),\n\t\tmeta: {\n\t\t\tauthoring: options.authoring,\n\t\t\tschemaPath: options.schemaPath,\n\t\t\tactualExtension: options.actualExtension,\n\t\t\texpectedExtension: options.expectedExtension\n\t\t}\n\t});\n}\n/**\n* The user cancelled an interactive prompt (Ctrl-C, escape, declined a\n* selection). Distinct from `errorInitReinitNeedsForce` because that path\n* applies to non-interactive mode where the user was never given the\n* choice; this one is the generic \"user said no\" path. Maps to exit code\n* 3 (USER_ABORTED).\n*/\nfunction errorInitUserAborted() {\n\treturn new CliStructuredError$1(\"CLI.INIT_USER_ABORTED\", \"Init cancelled\", {\n\t\twhy: \"The interactive prompt was cancelled before all required inputs were supplied. No files were modified.\",\n\t\tfix: \"Re-run `prisma-next init` and complete the prompts, or pass the required inputs as flags (see `--help`) for a non-interactive run.\",\n\t\tseverity: \"info\"\n\t});\n}\n/**\n* `--strict-probe` was supplied without `--probe-db`. Per FR8.3 / NFR9\n* (offline-by-default), `--strict-probe` is a no-op without `--probe-db` —\n* but rather than silently ignoring it we tell the user what they probably\n* meant. Without this guard, the flag combination silently does nothing,\n* which is exactly the kind of \"looks like it worked\" trap that a strict\n* mode is supposed to prevent.\n*/\nfunction errorInitStrictProbeWithoutProbe() {\n\treturn new CliStructuredError$1(\"CLI.INIT_STRICT_PROBE_WITHOUT_PROBE\", \"`--strict-probe` requires `--probe-db`\", {\n\t\twhy: \"`--strict-probe` only changes how a *failed* probe is reported; without `--probe-db` no probe is attempted in the first place. (`init` is offline-by-default — it never opens a connection to your database without explicit consent.)\",\n\t\tfix: \"Add `--probe-db` to opt in to the probe, or drop `--strict-probe` if you do not need the version check.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_STRICT_PROBE_WITHOUT_PROBE\")\n\t});\n}\n/**\n* Dependency installation failed and the pnpm → npm fallback (FR7.2)\n* either did not apply (pm ≠ pnpm or stderr did not match a recognised\n* leak) or also failed. Files scaffolded before the install step are\n* already on disk; `meta.filesWritten` carries the list so a follow-up\n* agent can resume manually. Maps to exit code `4 = INSTALL_FAILED`.\n*/\nfunction errorInitInstallFailed(options) {\n\tconst trimmed = options.stderrLines.map((s) => s.trim()).filter(Boolean);\n\treturn new CliStructuredError$1(\"CLI.INIT_INSTALL_FAILED\", \"Failed to install dependencies\", {\n\t\twhy: trimmed.length === 0 ? \"The package manager exited with an error and no recoverable fallback applied.\" : `The package manager exited with: ${trimmed[0]}`,\n\t\tfix: `Install manually:\\n ${options.addCommand}\\n ${options.addDevCommand}\\nThen run \\`${options.emitCommand}\\` to emit the contract.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INSTALL_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tstderr: trimmed\n\t\t}\n\t});\n}\n/**\n* The user's project manifest (typically `package.json`) failed to parse\n* as JSON. Init reads the manifest to merge `scripts` (FR3.5) and to\n* skip `@types/node` when it is already declared (FR2.1); a malformed\n* file would otherwise surface as an `INTERNAL_ERROR` with a raw\n* `SyntaxError` stack, which violates the FR1.6 contract that every\n* documented failure mode maps to a stable exit code.\n*\n* Maps to exit code `2 = PRECONDITION` — the user can fix the manifest\n* and re-run.\n*/\nfunction errorInitInvalidManifest(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_INVALID_MANIFEST\", `Failed to parse ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` is not valid JSON: ${options.cause}`,\n\t\tfix: `Fix the JSON syntax in \\`${options.path}\\` (a missing comma or unbalanced brace is the most common cause), then re-run \\`prisma-next init\\`.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_MANIFEST\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* The user's existing `tsconfig.json` could not be parsed even with JSONC\n* tolerance (comments + trailing commas) enabled. Init merges the\n* minimum compiler options the scaffolded files need (FR2.2), so an\n* unparseable tsconfig is a hard precondition failure: we cannot\n* faithfully edit a file we cannot read.\n*\n* Init must surface this **before** writing any scaffold file so the\n* user's working tree stays byte-identical (FR6.2 / NFR3) — see\n* `runInit` for the precondition gate.\n*\n* Maps to exit code `2 = PRECONDITION` — the user can fix the file and\n* re-run.\n*/\nfunction errorInitInvalidTsconfig(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_INVALID_TSCONFIG\", `Failed to parse ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` is not valid JSON or JSONC: ${options.cause}`,\n\t\tfix: `Fix the syntax in \\`${options.path}\\` and re-run \\`prisma-next init\\`. \\`init\\` accepts JSONC (comments and trailing commas) but cannot recover from unbalanced braces or missing commas.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_TSCONFIG\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* `--probe-db` was supplied along with `--strict-probe` and the probe\n* could not complete (no `DATABASE_URL`, network/auth error, the target\n* driver was not installed, …). Without `--strict-probe` the probe\n* surfaces these as warnings; `--strict-probe` escalates them to\n* fatal so a CI gate can rely on \"init exit code 2 means something\n* about the runtime environment is wrong\" (FR8.3).\n*\n* Maps to exit code `2 = PRECONDITION`. The caller's project files\n* are already on disk by this point — the probe runs after the write\n* phase — but the install/emit steps may or may not have completed\n* depending on `--no-install` and the exact failure mode; `meta`\n* carries `filesWritten` so a follow-up agent can resume manually.\n*/\nfunction errorInitProbeFailed(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_PROBE_FAILED\", \"Database probe failed\", {\n\t\twhy: `\\`--probe-db\\` could not complete and \\`--strict-probe\\` was set: ${options.cause}`,\n\t\tfix: \"Confirm `DATABASE_URL` points at a reachable server, or drop `--strict-probe` to treat probe failures as warnings.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_PROBE_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* `prisma-next contract emit` failed after a successful install. Surface\n* the underlying error so the user can fix it and re-run; files and\n* dependencies remain on disk untouched. Maps to exit code\n* `5 = EMIT_FAILED`.\n*/\nfunction errorInitEmitFailed(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_EMIT_FAILED\", \"Failed to emit contract\", {\n\t\twhy: `\\`prisma-next contract emit\\` failed: ${options.cause}`,\n\t\tfix: `Inspect your contract file, fix the underlying issue, then re-run \\`${options.emitCommand}\\`. Pass \\`-v\\` for the full error envelope.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_EMIT_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* A scaffold file could not be written after earlier writes had already\n* landed. The directory is half-scaffolded, so this carries the list of what\n* did get written, the way every other post-write failure in `init` does.\n*\n* Maps to exit code `2 = PRECONDITION`: what stopped the write is something\n* about the directory the user can fix.\n*/\nfunction errorInitWriteFailed(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_WRITE_FAILED\", `Failed to write ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` could not be written: ${options.cause}`,\n\t\tfix: \"Fix what stopped the write — a directory sitting where the file goes, permissions, a full disk — then run `prisma-next init` again. It will ask you to confirm replacing the files this run already wrote (listed in `meta.filesWritten`).\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_WRITE_FAILED\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause,\n\t\t\tfilesWritten: options.filesWritten\n\t\t}\n\t});\n}\n/**\n* The project-level skills install (`npx skills add\n* prisma/prisma#v<version>`) failed after a successful dependency\n* install + emit. The project's scaffold remains on disk; the user\n* can either fix the underlying issue (network, registry, PATH) and\n* run the install command manually, or re-run `init --no-skill` to\n* proceed without the skill.\n*\n* Non-rolling-back, matching the existing install/emit failure\n* semantics. Maps to exit code `6 = SKILL_INSTALL_FAILED`.\n*/\nfunction errorInitSkillInstallFailed(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_SKILL_INSTALL_FAILED\", \"Failed to install Prisma Next skills\", {\n\t\twhy: `\\`${options.skillInstallCommand}\\` exited with an error: ${options.cause}`,\n\t\tfix: `Either:\n - Re-run \\`prisma-next init --no-skill${options.filesWritten.length > 0 ? \" --force\" : \"\"}\\` to skip the skill install for this run, or\\n - Fix the underlying issue (network, npm registry, \\`npx skills\\` on PATH) and install manually:\\n ${options.skillInstallCommand}`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_SKILL_INSTALL_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tskillInstallCommand: options.skillInstallCommand,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n//#endregion\n//#region src/commands/init/probe-db.ts\n/**\n* Connects (when configured) to the user's database and returns a\n* structured outcome describing whether the server meets the declared\n* minimum (FR8.1). Pure with respect to its inputs: no I/O happens\n* unless `databaseUrl` is set.\n*\n* The outcome is shaped so that `--strict-probe` can branch on the\n* `kind`/`meetsMinimum` pair without re-stringifying the message:\n*\n* - `ok` — informational; `init` continues.\n* - `below-minimum` — warning; `init` continues regardless of\n* `--strict-probe` (the spec scopes strict-probe to \"probe\n* *failures*\", and a successful probe that finds an old server is\n* not a failure).\n* - `no-database-url` / `connection-failed` / `driver-missing` —\n* warning by default, fatal under `--strict-probe`.\n*/\nasync function probeServerVersion(ctx, overrides = {}) {\n\tconst { databaseUrl, minVersion, target } = ctx;\n\tif (databaseUrl === void 0 || databaseUrl.trim().length === 0) return {\n\t\tkind: \"no-database-url\",\n\t\tminVersion,\n\t\tmeetsMinimum: null,\n\t\tmessage: \"Skipped --probe-db: DATABASE_URL is not set in the current shell environment. (init does not read .env for the probe; export the variable or drop --probe-db.)\"\n\t};\n\tlet driverResult;\n\ttry {\n\t\tif (target === \"postgres\") driverResult = overrides.probePostgres !== void 0 ? await overrides.probePostgres(databaseUrl) : await defaultProbePostgres(databaseUrl, ctx.baseDir, overrides);\n\t\telse driverResult = overrides.probeMongo !== void 0 ? await overrides.probeMongo(databaseUrl) : await defaultProbeMongo(databaseUrl, ctx.baseDir, overrides);\n\t} catch (err) {\n\t\tif (err instanceof DriverMissingError) return {\n\t\t\tkind: \"driver-missing\",\n\t\t\tminVersion,\n\t\t\tmeetsMinimum: null,\n\t\t\tcause: err.message,\n\t\t\tmessage: `Skipped --probe-db: ${err.message}. (Run with install enabled, or install the driver yourself, then re-run \\`prisma-next init --probe-db\\`.)`\n\t\t};\n\t\tconst cause = redactDatabaseUrlSecrets(causeMessage(err));\n\t\treturn {\n\t\t\tkind: \"connection-failed\",\n\t\t\tminVersion,\n\t\t\tmeetsMinimum: null,\n\t\t\tcause,\n\t\t\tmessage: `--probe-db could not connect: ${cause}.`\n\t\t};\n\t}\n\tif (compareVersionPrefix(driverResult.serverVersion, minVersion) < 0) return {\n\t\tkind: \"below-minimum\",\n\t\tserverVersion: driverResult.serverVersion,\n\t\tminVersion,\n\t\tmeetsMinimum: false,\n\t\tmessage: `--probe-db: server reports version ${driverResult.serverVersion}, below the declared minimum (${minVersion}). Some queries may fail until the server is upgraded.`\n\t};\n\treturn {\n\t\tkind: \"ok\",\n\t\tserverVersion: driverResult.serverVersion,\n\t\tminVersion,\n\t\tmeetsMinimum: true,\n\t\tmessage: `--probe-db: server reports version ${driverResult.serverVersion} (>= ${minVersion}).`\n\t};\n}\n/**\n* Compares two semver-prefix strings (\"14\", \"14.2\", \"6.0\", …) by\n* numeric components left-to-right. Returns a negative number when `a`\n* is older than `b`, zero when both versions agree on every numeric\n* component (treating missing trailing components as `0`), and a\n* positive number when `a` is newer.\n*\n* The loop runs over the **longer** of the two prefixes so that\n* `'14'` compares less than `'14.1'` — without that, the shorter\n* prefix would be silently accepted whenever the configured minimum\n* has a non-zero minor or patch.\n*\n* Exported for unit tests.\n*/\nfunction compareVersionPrefix(a, b) {\n\tconst aParts = parseNumericParts(a);\n\tconst bParts = parseNumericParts(b);\n\tconst len = Math.max(aParts.length, bParts.length);\n\tfor (let i = 0; i < len; i += 1) {\n\t\tconst aPart = aParts[i] ?? 0;\n\t\tconst bPart = bParts[i] ?? 0;\n\t\tif (aPart !== bPart) return aPart - bPart;\n\t}\n\treturn 0;\n}\nfunction parseNumericParts(version) {\n\tconst match = version.match(/^[^\\d]*(\\d+(?:\\.\\d+){0,3})/);\n\tif (match === null) return [];\n\treturn (match[1] ?? \"\").split(\".\").map((part) => Number.parseInt(part, 10));\n}\nvar DriverMissingError = class extends Error {};\nfunction causeMessage(err) {\n\tif (err instanceof Error) return err.message;\n\treturn String(err);\n}\n/**\n* Strips `user:password@` userinfo from any URL-shaped substring before\n* we surface the cause to the user. Mirrors `redactSecrets` in\n* `init.ts` — the probe path has its own redactor because the inputs\n* here include the raw connection string by construction (driver\n* errors echo the URL back).\n*\n* Exported for unit tests.\n*/\nfunction redactDatabaseUrlSecrets(text) {\n\tif (!text) return text;\n\treturn text.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/)([^/@\\s]+)@/g, \"$1***@\");\n}\nasync function defaultProbePostgres(databaseUrl, baseDir, overrides) {\n\tconst client = new (requirePeer(\"pg\", baseDir, overrides)).Client({ connectionString: databaseUrl });\n\tawait client.connect();\n\ttry {\n\t\tconst result = await client.query(\"SELECT version() as version\");\n\t\treturn { serverVersion: parsePostgresVersion(String(result?.rows?.[0]?.version ?? \"\")) };\n\t} finally {\n\t\tawait client.end().catch(() => void 0);\n\t}\n}\n/**\n* Extracts the numeric prefix from a Postgres `version()` row, e.g.\n*\n* `PostgreSQL 14.10 on x86_64-pc-linux-gnu, ...` → `\"14.10\"`\n* `PostgreSQL 16beta1 on …` → `\"16\"` (we\n* conservatively drop the suffix; minimum-version comparisons\n* treat 16beta1 as 16, which is what every reasonable user\n* expects).\n*\n* Exported for unit tests.\n*/\nfunction parsePostgresVersion(versionString) {\n\tconst match = versionString.match(/PostgreSQL\\s+(\\d+(?:\\.\\d+)?)/i);\n\tif (match === null || match[1] === void 0) throw new CliStructuredError(\"CLI.INIT_PROBE_FAILED\", `Could not parse PostgreSQL version from \\`${versionString}\\``);\n\treturn match[1];\n}\nasync function defaultProbeMongo(databaseUrl, baseDir, overrides) {\n\tconst client = new (requirePeer(\"mongodb\", baseDir, overrides)).MongoClient(databaseUrl);\n\tawait client.connect();\n\ttry {\n\t\tconst buildInfo = await client.db().admin().command({ buildInfo: 1 });\n\t\tconst versionString = String(buildInfo.version ?? \"\");\n\t\tif (versionString.length === 0) throw new CliStructuredError(\"CLI.INIT_PROBE_FAILED\", \"buildInfo did not include a `version` field\");\n\t\treturn { serverVersion: versionString };\n\t} finally {\n\t\tawait client.close().catch(() => void 0);\n\t}\n}\n/**\n* Loads a peer driver (`pg` / `mongodb`) from the user's project\n* `node_modules`. We deliberately resolve from `baseDir` rather than\n* from the CLI bundle — the CLI does not depend on `pg` or `mongodb`\n* directly, but the user's `init`-generated `package.json` does (via\n* the target facade). Failure to resolve is folded into a typed\n* `DriverMissingError` so `probeServerVersion` can map it to a\n* `driver-missing` outcome rather than letting a `MODULE_NOT_FOUND`\n* leak as a generic connection failure.\n*/\nfunction requirePeer(moduleId, baseDir, overrides) {\n\ttry {\n\t\tif (overrides.requireFromBaseDir !== void 0) return overrides.requireFromBaseDir(baseDir, moduleId);\n\t\treturn createRequire(join(baseDir, \"package.json\"))(moduleId);\n\t} catch (err) {\n\t\tthrow new DriverMissingError(`\\`${moduleId}\\` is not installed in this project (resolved from ${baseDir}; cause: ${causeMessage(err)})`);\n\t}\n}\n//#endregion\n//#region src/commands/init/skill-sources.ts\n/**\n* Default base for the GitHub-URL form `<owner>/<repo>` consumed by\n* upstream `skills add`. Each `SkillSource` joins this base with its\n* own subpath (and optional `#ref` for version-pinned clusters).\n*/\nconst DEFAULT_SKILL_BASE = \"prisma/prisma\";\nconst DEFAULT_SKILL_SOURCES = [\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-8\",\n\t\tref: \"cli\",\n\t\tdescription: \"usage skill (version-locked to installed Prisma Next)\"\n\t},\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-next-upgrade\",\n\t\tref: null,\n\t\tdescription: \"upgrade skill (always tracks `main`)\"\n\t},\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-8-extension-upgrade\",\n\t\tref: null,\n\t\tdescription: \"extension-author upgrade skill (always tracks `main`)\"\n\t}\n];\n/**\n* Test-only escape hatch for pinning the install base to a local\n* checkout. Production runs leave this unset, so installs always use\n* `DEFAULT_SKILL_BASE`.\n*\n* When set to an absolute filesystem path (typical for tests), the\n* `#ref` fragment is dropped — local-path mode in upstream's CLI does\n* not accept refs, and the local clone has whatever content the test\n* checked into it anyway. When set to anything else (e.g. a fork name\n* `myuser/prisma-next`), the ref policy is preserved.\n*/\nfunction resolveAgentSkillBase(env) {\n\tconst override = env[\"PRISMA_NEXT_SKILLS_BASE\"]?.trim();\n\treturn override && override.length > 0 ? override : DEFAULT_SKILL_BASE;\n}\nfunction isLocalPath(base) {\n\treturn base.startsWith(\"/\") || /^[a-zA-Z]:[\\\\/]/.test(base);\n}\n/**\n* Agents passed to every project-level init install. Upstream `skills add`\n* is the source of truth for per-agent install behaviour; the CLI lists\n* every supported runtime on one invocation and delegates the rest.\n*/\nconst DEFAULT_SKILL_AGENTS = [\n\t\"cursor\",\n\t\"claude-code\",\n\t\"codex\",\n\t\"windsurf\"\n];\n/**\n* Build the `<base>/<subpath>[#ref]` URL the `skills` CLI will\n* resolve. Exported for unit tests so the per-source format can be\n* asserted without going through the full install loop.\n*/\nfunction formatSkillSourceUrl(source, env = process.env) {\n\tconst base = resolveAgentSkillBase(env);\n\tconst url = `${base}/${source.subpath}`;\n\tif (source.ref === null) return url;\n\tif (isLocalPath(base)) return url;\n\tif (source.ref === \"cli\") return `${url}#v${version}`;\n\treturn url;\n}\n/**\n* The skill-install command for one source, formatted for the\n* project's detected package manager. `npx`/`pnpm dlx`/`bunx` are\n* interchangeable to the user; we pick the variant that matches the\n* rest of the install step so a single project consistently uses one\n* runner.\n*\n* `--agent` takes space-separated slugs on one flag; the explicit\n* `--skill <name>` and `-y` skip the multi-select prompts a\n* non-interactive scaffold step cannot show.\n*\n* Exported for unit tests so the per-PM dispatch can be asserted\n* without a live subprocess.\n*/\nfunction formatSkillInstallCommand(args) {\n\tconst agents = args.agents ?? DEFAULT_SKILL_AGENTS;\n\tconst cliArgs = [\n\t\t\"skills@latest\",\n\t\t\"add\",\n\t\tformatSkillSourceUrl(args.source, args.env),\n\t\t\"--agent\",\n\t\t...agents,\n\t\t\"--skill\",\n\t\targs.source.skill,\n\t\t\"-y\"\n\t];\n\treturn formatPackageManagerCommand(args.pm, cliArgs);\n}\n/**\n* Ordered skill-install commands for one init run. This is both what the\n* commander shell runs and what either shell tells the user to run when the\n* install is skipped or fails — the commands need no scaffold and no `init`.\n*/\nfunction resolveProjectSkillInstallCommands(pm, env) {\n\treturn DEFAULT_SKILL_SOURCES.map((source) => formatSkillInstallCommand({\n\t\tpm,\n\t\tsource,\n\t\t...ifDefined(\"env\", env)\n\t}));\n}\nfunction formatPackageManagerCommand(pm, args) {\n\tswitch (pm) {\n\t\tcase \"pnpm\": return `pnpm dlx ${args.join(\" \")}`;\n\t\tcase \"yarn\": return `yarn dlx ${args.join(\" \")}`;\n\t\tcase \"bun\": return `bunx ${args.join(\" \")}`;\n\t\tcase \"deno\": return `deno run -A npm:${args.join(\" \")}`;\n\t\tcase \"npm\": return `npx ${args.join(\" \")}`;\n\t}\n}\n/**\n* Skill directories that predate the consolidated `prisma-8` skill:\n* the per-workflow usage cluster (including the renamed\n* `prisma-8-migration-review` spelling it briefly shipped under), the\n* pre-rename spellings of the consolidated skill and the\n* extension-author upgrade skill, and any hand-rolled `prisma-next`\n* stub. Projects initialised before the consolidation carry these as\n* sibling directories in each agent's install root; left in place\n* they compete with the current skills for activation, so init\n* removes them on every run.\n*/\nconst RETIRED_SKILL_NAMES = [\n\t\"prisma-next\",\n\t\"prisma-next-quickstart\",\n\t\"prisma-next-contract\",\n\t\"prisma-next-migrations\",\n\t\"prisma-next-migration-review\",\n\t\"prisma-8-migration-review\",\n\t\"prisma-next-queries\",\n\t\"prisma-next-runtime\",\n\t\"prisma-next-build\",\n\t\"prisma-next-supabase\",\n\t\"prisma-next-debug\",\n\t\"prisma-next-feedback\",\n\t\"prisma-next-extension-upgrade\"\n];\n/**\n* Project-level install roots the upstream `skills` CLI uses for the\n* agents in `DEFAULT_SKILL_AGENTS`: cursor and codex install into\n* `.agents/skills`, claude-code into `.claude/skills`, windsurf into\n* `.windsurf/skills`.\n*/\nconst AGENT_SKILL_ROOTS = [\n\t\".agents/skills\",\n\t\".claude/skills\",\n\t\".windsurf/skills\"\n];\n/**\n* Every directory a retired per-workflow skill may occupy in a\n* consumer project. Init deletes each (recursively) before running the\n* skill install.\n*/\nfunction legacySkillDirs() {\n\treturn AGENT_SKILL_ROOTS.flatMap((root) => RETIRED_SKILL_NAMES.map((name) => `${root}/${name}`));\n}\n//#endregion\n//#region src/commands/init/templates/env.ts\n/**\n* The minimum supported server version for each target. The\n* authoritative source of truth is each target package's\n* `package.json#prismaNext.minServerVersion` field — this module\n* mirrors those values and a workspace-level test asserts the two\n* never drift (`templates/tsconfig-env.test.ts`).\n*\n* Bumping a value here in isolation is **not** safe: edit the\n* corresponding target package's `package.json` first, then mirror\n* here. The scaffold's `.env.example` and the \"Requirements\" section\n* of `prisma-next.md` both read from this constant, so a stale value\n* lies to every freshly initialised user.\n*/\nconst MIN_SERVER_VERSION = {\n\tpostgres: \"17\",\n\tmongo: \"8.0\"\n};\nconst TARGET_LABEL = {\n\tpostgres: \"PostgreSQL\",\n\tmongo: \"MongoDB\"\n};\n/**\n* Renders the placeholder body shared by `.env` and `.env.example`:\n* the target-specific connection-string requirement comments and the\n* commented-shape `DATABASE_URL` line. The output is identical for both\n* authoring styles — the env file is orthogonal to PSL vs TS schema\n* authoring.\n*/\nfunction envPlaceholderBody(target) {\n\tconst label = TARGET_LABEL[target];\n\tconst minVersion = MIN_SERVER_VERSION[target];\n\tconst lines = [];\n\tlines.push(`# Connection string for ${label}.`);\n\tlines.push(`# Requires ${label} >= ${minVersion}.`);\n\tlines.push(\"\");\n\tif (target === \"postgres\") lines.push(\"DATABASE_URL=\\\"postgresql://user:password@localhost:5432/mydb\\\"\");\n\telse {\n\t\tlines.push(\"# Standalone local mongod / `docker run mongo:8` — no replica set required for first-run queries.\");\n\t\tlines.push(\"# Transactions and change streams need a replica set; add ?replicaSet=... only after initiating one.\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"DATABASE_URL=\\\"mongodb://user:password@localhost:27017/mydb\\\"\");\n\t}\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders the `.env.example` content for a given target:\n*\n* - Carries a \"Copy this file to `.env`…\" intro that only makes sense\n* for the example file (the real `.env` is the destination of that\n* copy and so does not get the same intro).\n* - Documents the `DATABASE_URL` placeholder in the target's native URL\n* shape (Postgres: standard `postgresql://`, Mongo: `mongodb://` plus\n* a `mydb` database segment so the lazy facade has a `dbName`).\n* - Carries a `# Requires <db> >= <version>` comment so a fresh user\n* knows the minimum supported server before they first try to connect.\n*/\nfunction envExampleContent(target) {\n\tconst lines = [];\n\tlines.push(\"# Copy this file to `.env` and replace the placeholder with your real connection string.\");\n\tlines.push(envPlaceholderBody(target));\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders the initial `.env` content for `--write-env` / interactive\n* opt-in. Same placeholder body as `.env.example`, **without** the\n* example file's \"Copy this file to `.env`…\" intro: the real `.env` is\n* the destination of that copy, so the line would lie. Writing this\n* file is gitignored (`.env` lands in `.gitignore` during init).\n*/\nfunction envFileContent(target) {\n\treturn envPlaceholderBody(target);\n}\n//#endregion\n//#region src/commands/init/input-values.ts\nconst TARGET_ALIASES = /* @__PURE__ */ new Map([\n\t[\"postgres\", \"postgres\"],\n\t[\"postgresql\", \"postgres\"],\n\t[\"mongo\", \"mongo\"],\n\t[\"mongodb\", \"mongo\"]\n]);\nconst AUTHORING_VALUES = /* @__PURE__ */ new Map([\n\t[\"psl\", \"psl\"],\n\t[\"typescript\", \"typescript\"],\n\t[\"ts\", \"typescript\"]\n]);\nfunction resolveTarget(value) {\n\tif (value === void 0) return void 0;\n\tconst mapped = TARGET_ALIASES.get(value.toLowerCase());\n\tif (mapped === void 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"target\",\n\t\tvalue,\n\t\tallowed: [\"postgres\", \"mongodb\"]\n\t});\n\treturn mapped;\n}\nfunction resolveAuthoring(value) {\n\tif (value === void 0) return void 0;\n\tconst mapped = AUTHORING_VALUES.get(value.toLowerCase());\n\tif (mapped === void 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"authoring\",\n\t\tvalue,\n\t\tallowed: [\"psl\", \"typescript\"]\n\t});\n\treturn mapped;\n}\n/**\n* Validates `--schema-path` against the chosen `--authoring` style: PSL\n* authoring requires a `.prisma` file and TypeScript authoring requires a\n* `.ts` file. Mismatched combinations would silently scaffold PSL content\n* into a `.ts` file (or vice versa); this validator surfaces the mistake\n* as a precondition error naming both flags.\n*/\nfunction validateSchemaPath(value, authoring) {\n\tconst trimmed = value.trim();\n\tif (trimmed.length === 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"schema-path\",\n\t\tvalue,\n\t\tallowed: [\"<non-empty file path with .prisma or .ts extension>\"]\n\t});\n\tif (trimmed.endsWith(\"/\") || trimmed.endsWith(\"\\\\\")) throw errorInitInvalidFlagValue({\n\t\tflag: \"schema-path\",\n\t\tvalue,\n\t\tallowed: [\"<file path, not a directory>\"]\n\t});\n\tconst ext = extname(trimmed).toLowerCase();\n\tconst expected = authoring === \"typescript\" ? \".ts\" : \".prisma\";\n\tif (ext !== expected) throw errorInitAuthoringSchemaPathMismatch({\n\t\tauthoring,\n\t\tschemaPath: trimmed,\n\t\tactualExtension: ext.length > 0 ? ext : \"(none)\",\n\t\texpectedExtension: expected\n\t});\n\treturn normalize(trimmed);\n}\n//#endregion\n//#region src/commands/init/detect-package-manager.ts\nconst KNOWN = /* @__PURE__ */ new Set([\n\t\"pnpm\",\n\t\"npm\",\n\t\"yarn\",\n\t\"bun\",\n\t\"deno\"\n]);\nfunction isPackageManager(name) {\n\treturn KNOWN.has(name);\n}\n/**\n* Resolves the package manager `init` should drive for `add` / `install`\n* commands. Tries, in order:\n*\n* 1. **`detect()`** — walks up from `cwd` looking for a lockfile, the\n* `packageManager` field, the `devEngines.packageManager` field, or\n* install metadata. This is the right answer whenever the user is\n* anywhere inside an existing project, including a deep workspace\n* subdirectory.\n*\n* 2. **`getUserAgent()`** — parses `npm_config_user_agent`, the env var\n* every PM sets when it spawns a script. This catches the\n* bare-directory case where there's no project to walk up to but the\n* user invoked us via `pnpm dlx prisma-next init` / `bunx\n* prisma-next init` / `yarn dlx …`. Same signal used by every\n* `create-*` tool in the ecosystem (`create-vite`, `create-next-app`,\n* `create-astro`, `@antfu/ni`, …).\n*\n* 3. **`npm`** — final fallback. Always present alongside Node.\n*/\nasync function detectPackageManager(cwd) {\n\tconst detected = await detect({ cwd });\n\tif (detected && isPackageManager(detected.name)) return detected.name;\n\tconst userAgent = getUserAgent();\n\tif (userAgent !== null && isPackageManager(userAgent)) return userAgent;\n\treturn \"npm\";\n}\nfunction hasProjectManifest(cwd) {\n\treturn existsSync(join(cwd, \"package.json\")) || existsSync(join(cwd, \"deno.json\")) || existsSync(join(cwd, \"deno.jsonc\"));\n}\nfunction formatRunCommand(pm, bin, args) {\n\tif (pm === \"npm\") return `npx ${bin} ${args}`;\n\tif (pm === \"deno\") return `deno run npm:${bin} ${args}`;\n\treturn `${pm} ${bin} ${args}`;\n}\nfunction formatRunScriptCommand(pm, scriptName) {\n\tswitch (pm) {\n\t\tcase \"deno\": return `deno task ${scriptName}`;\n\t\tcase \"bun\": return `bun run ${scriptName}`;\n\t\tcase \"pnpm\": return `pnpm run ${scriptName}`;\n\t\tcase \"yarn\": return `yarn run ${scriptName}`;\n\t\tdefault: return `npm run ${scriptName}`;\n\t}\n}\nfunction formatAddArgs(pm, packages) {\n\tif (pm === \"deno\") return [\"add\", ...packages.map((p) => `npm:${p}`)];\n\treturn [\"add\", ...packages];\n}\nfunction formatAddDevArgs(pm, packages) {\n\tif (pm === \"deno\") return [\n\t\t\"add\",\n\t\t\"--dev\",\n\t\t...packages.map((p) => `npm:${p}`)\n\t];\n\treturn [\n\t\t\"add\",\n\t\t\"-D\",\n\t\t...packages\n\t];\n}\n//#endregion\n//#region src/commands/init/hygiene-gitattributes.ts\n/**\n* The `.gitattributes` entries written for a freshly initialised project\n* (FR3.4). Mirrors the relevant subset of the repo-root\n* [`.gitattributes`](../../../../../../../../.gitattributes):\n*\n* - **Today**: `contract.json`, `contract.d.ts` are emitted on every\n* `prisma-next contract emit`. Marking them `linguist-generated`\n* keeps GitHub's diff stats honest and collapses the file in code\n* review by default.\n* - **Forward-looking**: `ops.json`, `migration.json` are not yet emitted\n* by `init` flows but will be produced by adjacent commands (lower /\n* migration tooling). Adding them now matches Decision 5\n* (forward-looking subset) so the file does not need to be amended\n* every time a new artifact lands.\n*\n* `ARTIFACT_FILENAMES` entries are written relative to the schema\n* directory so a user who runs `init --schema-path db/contract.prisma`\n* gets `db/contract.json linguist-generated` — not the workspace-glob\n* form `<glob>/contract.json` (which would over-match any unrelated\n* `contract.json` the user has elsewhere) and not the absolute\n* `DEFAULT_CONTRACT_SOURCE_DIR/contract.json` (which would silently\n* break for a non-default schema path).\n*\n* The migration contract snapshot store (`migrations/snapshots/<hex>/`)\n* is anchored to the migrations root instead, not the schema directory:\n* migration package depth under `migrations/` varies (`app/<pkg>`,\n* `<space>/<pkg>`, or a bare `<pkg>` in extension source repos), so no\n* single schema-dir-relative pattern can reach every snapshot. See\n* `STORE_GITATTRIBUTES_LINES` below.\n*/\nconst ARTIFACT_FILENAMES$1 = [\n\t\"contract.json\",\n\t\"contract.d.ts\",\n\t\"ops.json\",\n\t\"migration.json\"\n];\nconst ATTRIBUTE = \"linguist-generated\";\n/**\n* Full `.gitattributes` lines for the migration contract snapshot store,\n* already anchored to the migrations root — unlike `ARTIFACT_FILENAMES`,\n* these are not combined with the schema-relative prefix.\n*/\nconst STORE_GITATTRIBUTES_LINES = [`migrations/snapshots/**/contract.json ${ATTRIBUTE}`, `migrations/snapshots/**/contract.d.ts ${ATTRIBUTE}`];\n/**\n* Computes the `.gitattributes` lines this scaffold expects to own. Each\n* line has the shape `<path> linguist-generated`. The `target` parameter\n* is currently unused but accepted for symmetry with the other hygiene\n* helpers and to leave room for target-specific entries (e.g. a future\n* family-specific artifact) without a signature break.\n*/\nfunction requiredGitattributesLines(schemaDir, _target) {\n\tconst dir = schemaDir === \".\" ? \"\" : schemaDir.replace(/\\/+$/, \"\");\n\tconst prefix = dir === \"\" ? \"\" : `${dir}/`;\n\treturn [...ARTIFACT_FILENAMES$1.map((file) => `${prefix}${file} ${ATTRIBUTE}`), ...STORE_GITATTRIBUTES_LINES];\n}\n/**\n* Idempotent `.gitattributes` merge (FR3.4 / FR9.3). Returns the new file\n* content given the existing content (or `undefined` if the file does\n* not yet exist).\n*\n* Equivalence is exact-line: a user-customised line like\n* `prisma/*.json linguist-generated` is *not* recognised as covering\n* `DEFAULT_CONTRACT_SOURCE_DIR/contract.json linguist-generated`. We accept that\n* over-specification — preserving the user's broad pattern *and*\n* appending the narrow one — because the narrow lines are what the\n* acceptance criteria pin (FR3.4 AC).\n*\n* Returns `null` when no changes are required (file already contains\n* every required entry).\n*/\nfunction mergeGitattributes(existing, required) {\n\tif (existing === void 0) return `${required.join(\"\\n\")}\\n`;\n\tconst presentLines = new Set(existing.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith(\"#\")));\n\tconst missing = required.filter((line) => !presentLines.has(line));\n\tif (missing.length === 0) return null;\n\treturn `${existing}${existing.length === 0 || existing.endsWith(\"\\n\") ? \"\" : \"\\n\"}${missing.join(\"\\n\")}\\n`;\n}\n//#endregion\n//#region src/commands/init/hygiene-gitignore.ts\n/**\n* The minimal `.gitignore` lines a Prisma Next scaffold needs (FR3.3).\n* Order matches what Node tooling typically writes today.\n*\n* `node_modules/` first because it's the byte-largest miss; `dist/`\n* because the scaffolded `tsconfig.json` writes there; `.env` last so\n* the secret-bearing file is the one most-recently visible in any diff\n* (a paranoid-correct ordering — humans skim from the top).\n*/\nconst REQUIRED_GITIGNORE_ENTRIES = [\n\t\"node_modules/\",\n\t\"dist/\",\n\t\".env\"\n];\n/**\n* Idempotent `.gitignore` merge (FR3.3 / FR9.3). Returns the new file\n* content given the existing content (or `undefined` if the file does\n* not yet exist). Adds only entries that are not already present and\n* never duplicates a line. Existing comments and blank lines are\n* preserved verbatim — `.gitignore` is parsed by `git` without a tree,\n* so any line modification risks changing semantics.\n*\n* Pattern equivalence is line-literal: `node_modules/` and `node_modules`\n* are treated as different entries. This is intentional — `git` treats\n* them differently (the trailing slash restricts the match to\n* directories), and the AC pins the trailing-slash form.\n*\n* Returns `null` when no changes are required (file already contains\n* every required entry). The caller can use this to decide whether to\n* include `.gitignore` in `filesWritten`.\n*/\nfunction mergeGitignore(existing) {\n\tif (existing === void 0) return `${REQUIRED_GITIGNORE_ENTRIES.join(\"\\n\")}\\n`;\n\tconst present = new Set(existing.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith(\"#\")));\n\tconst missing = REQUIRED_GITIGNORE_ENTRIES.filter((entry) => !present.has(entry));\n\tif (missing.length === 0) return null;\n\treturn `${existing}${existing.length === 0 || existing.endsWith(\"\\n\") ? \"\" : \"\\n\"}${missing.join(\"\\n\")}\\n`;\n}\n//#endregion\n//#region src/commands/init/hygiene-package-scripts.ts\nconst REQUIRED_SCRIPTS = [{\n\tname: \"contract:emit\",\n\tcommand: \"prisma-next contract emit\"\n}];\n/**\n* Idempotent `package.json#scripts` merge with collision detection\n* (FR3.5 / FR9.3):\n*\n* - If a required script is **missing**, append it.\n* - If a required script is **already present and identical**, leave\n* the file alone (idempotency).\n* - If a required script is **present but maps to a different command**,\n* skip the write for that script and surface a structured warning.\n* The user's override is sacred — `init` should never silently\n* overwrite a custom build pipeline.\n*\n* Preserves the existing key order (so a user who has alphabetised\n* their scripts does not see them reshuffled) and appends new entries\n* at the end.\n*\n* The `package.json` is parsed and re-stringified through `JSON` —\n* comments are not preserved (package.json does not support them per\n* spec). Trailing newline matches the original input's trailing\n* newline behaviour.\n*/\nfunction mergePackageScripts(existing, required = REQUIRED_SCRIPTS) {\n\tconst parsed = blindCast(JSON.parse(existing));\n\tconst scripts = typeof parsed[\"scripts\"] === \"object\" && parsed[\"scripts\"] !== null ? { ...blindCast(parsed[\"scripts\"]) } : {};\n\tconst warnings = [];\n\tlet mutated = false;\n\tfor (const { name, command } of required) {\n\t\tconst existingValue = scripts[name];\n\t\tif (existingValue === void 0) {\n\t\t\tscripts[name] = command;\n\t\t\tmutated = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (existingValue !== command) warnings.push(`package.json already has a \"${name}\" script with a different command — keeping yours.\\n existing: ${existingValue}\\n expected: ${command}\\nIf you want the default, remove your \"${name}\" script and re-run \\`init\\`.`);\n\t}\n\tif (!mutated) return {\n\t\tcontent: null,\n\t\twarnings\n\t};\n\tparsed[\"scripts\"] = scripts;\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn {\n\t\tcontent: `${JSON.stringify(parsed, null, 2)}${trailingNewline}`,\n\t\twarnings\n\t};\n}\n/**\n* Idempotently sets `\"type\": \"module\"` on a `package.json` so the\n* scaffolded `prisma/db.ts` — which uses the ESM-only `with { type: 'json' }`\n* import attribute — loads as ES module under Node's loader (TML-2494).\n*\n* Without this field Node either:\n*\n* - emits `MODULE_TYPELESS_PACKAGE_JSON` and reparses the file as ESM\n* with a perf penalty (Node 22+ with `--experimental-strip-types`), or\n* - hard-fails with `ERR_*` because the CJS loader cannot parse the\n* import-attribute syntax (older Node, or any tool that doesn't\n* reparse).\n*\n* Behaviour:\n*\n* - **Field missing** → set to `\"module\"`. New entry is inserted right\n* after `\"name\"` (when present) so the diff lands in a conventional\n* spot for human review; falls through to the natural append position\n* otherwise.\n* - **Field already `\"module\"`** → no-op (idempotent).\n* - **Field set to anything else** (e.g. `\"commonjs\"`) → leave it alone\n* and surface a structured warning. The user explicitly opted out of\n* ESM and we don't silently overwrite that.\n*/\nfunction ensureEsmModuleType(existing) {\n\tconst parsed = blindCast(JSON.parse(existing));\n\tconst currentType = parsed[\"type\"];\n\tif (currentType === \"module\") return {\n\t\tcontent: null,\n\t\twarning: null\n\t};\n\tif (typeof currentType === \"string\" && currentType !== \"module\") return {\n\t\tcontent: null,\n\t\twarning: `package.json declares \"type\": \"${currentType}\" — keeping yours, but the scaffolded prisma/db.ts uses an ESM-only import attribute (\\`with { type: 'json' }\\`) and will not load under that module type.\\nIf you want the default, set \"type\": \"module\" in package.json.`\n\t};\n\tconst next = {};\n\tlet inserted = false;\n\tfor (const [key, value] of Object.entries(parsed)) {\n\t\tif (key === \"type\") continue;\n\t\tnext[key] = value;\n\t\tif (!inserted && key === \"name\") {\n\t\t\tnext[\"type\"] = \"module\";\n\t\t\tinserted = true;\n\t\t}\n\t}\n\tif (!inserted) next[\"type\"] = \"module\";\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn {\n\t\tcontent: `${JSON.stringify(next, null, 2)}${trailingNewline}`,\n\t\twarning: null\n\t};\n}\n//#endregion\n//#region src/commands/init/reinit-cleanup.ts\n/**\n* Filenames the contract pipeline emits next to the user's schema source\n* (`<schemaDir>/contract.json`, `<schemaDir>/contract.d.ts`, …). Mirrors\n* the schema-dir-relative `ARTIFACT_FILENAMES` in `hygiene-gitattributes.ts`\n* (not that file's migrations-root-anchored store lines, which are outside\n* this command's scope — reinit only ever touches `schemaDir`); kept as a\n* separate constant here because the cleanup contract is target-agnostic\n* and we deliberately do not want a stale artifact from a previous target\n* lingering after a re-init.\n*\n* If a future emit pipeline produces an additional schema-dir artifact,\n* add it here **and** to `ARTIFACT_FILENAMES` in `hygiene-gitattributes.ts`\n* — the two stay in lockstep so the file `init` advertises as\n* `linguist-generated` is exactly the file `init` is willing to delete on\n* re-init.\n*/\nconst ARTIFACT_FILENAMES = [\n\t\"contract.json\",\n\t\"contract.d.ts\",\n\t\"ops.json\",\n\t\"migration.json\"\n];\n/**\n* Returns the schema-relative paths of stale contract artifacts the\n* previous `init` run (or a `contract emit`) left behind in `schemaDir`.\n* Paths are returned relative to `baseDir` so the caller can plumb them\n* into `filesWritten`-style logging without re-deriving the path.\n*\n* Pure function: no filesystem mutation. Used by `runInit`'s precondition\n* phase (FR6.2 / NFR3 atomicity) so a downstream parse failure leaves\n* the artifacts on disk and the project byte-identical to its pre-init\n* state.\n*/\nfunction findStaleArtifacts(baseDir, schemaDir) {\n\tconst result = [];\n\tfor (const filename of ARTIFACT_FILENAMES) {\n\t\tconst rel = join(schemaDir, filename);\n\t\tif (existsSync(join(baseDir, rel))) result.push(rel);\n\t}\n\treturn result;\n}\n/**\n* Drops a single key from `package.json#dependencies`, returning the new\n* file content. Returns `null` when the dependency was already absent —\n* the caller can skip the write to keep re-init idempotent (FR9.3).\n*\n* Used by `runInit` for the FR9.2 target-switch path: when the user\n* re-inits a project from `--target postgres` to `--target mongodb` (or\n* vice versa), the previous facade is removed from `dependencies` so the\n* resulting project depends only on the chosen target's facade.\n*\n* Devs/peers/optional dep groups are intentionally *not* touched — the\n* facades are only ever in `dependencies` (FR4 / FR7), and broadening\n* the search would risk clobbering an unrelated dep with the same name\n* in `peerDependencies`.\n*\n* Throws `SyntaxError` if `existing` is not parseable as JSON; the\n* caller (`runInit`) already guards on that with a structured 5010\n* error before this helper is reached.\n*/\nfunction removeDependency(existing, depName) {\n\tconst parsed = JSON.parse(existing);\n\tconst deps = parsed[\"dependencies\"];\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return null;\n\tif (!Object.hasOwn(deps, depName)) return null;\n\tconst next = { ...deps };\n\tdelete next[depName];\n\tparsed[\"dependencies\"] = next;\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn `${JSON.stringify(parsed, null, 2)}${trailingNewline}`;\n}\n//#endregion\n//#region src/commands/init/templates/render.ts\nfunction renderTemplate(templateFile, variableNames, vars) {\n\tlet result = readFileSync(join(import.meta.dirname, templateFile), \"utf-8\");\n\tfor (const key of variableNames) {\n\t\tconst value = vars[key];\n\t\tif (value === void 0) throw new InternalError(`Template variable '${key}' is not defined`);\n\t\tresult = result.replaceAll(`{{${key}}}`, value);\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/commands/init/templates/quick-reference.ts\nconst variables = [\n\t\"schemaPath\",\n\t\"schemaDir\",\n\t\"dbImportPath\",\n\t\"pkgRun\",\n\t\"pkg\",\n\t\"configEntrypoint\",\n\t\"schemaSample\",\n\t\"requirements\"\n];\nfunction quickReferenceMd(target, authoring, schemaPath, pkgRun, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst schemaDir = dirname(schemaPath);\n\tconst pkg = targetPackageName(target, resolveImportSpecifier);\n\tconst vars = {\n\t\tschemaPath,\n\t\tschemaDir,\n\t\tdbImportPath: `./${schemaDir}/db`,\n\t\tpkgRun,\n\t\tpkg,\n\t\tconfigEntrypoint: targetEntrypoint(target, \"config\", resolveImportSpecifier),\n\t\tschemaSample: schemaSample(target, authoring, resolveImportSpecifier),\n\t\trequirements: requirementsBlock(target)\n\t};\n\treturn renderTemplate(`quick-reference-${target}.md`, variables, vars);\n}\n/**\n* Renders the FR8.2 \"Requirements\" block injected into `prisma-next.md`\n* (the user-facing quick reference). Sources the minimum server\n* version from `MIN_SERVER_VERSION` — itself mirrored from each\n* target package's `package.json#prismaNext.minServerVersion`\n* (FR8.1).\n*\n* The verification command is target-specific — Postgres scaffolds\n* shouldn't ship Mongo's `db.runCommand` (and vice versa) just because\n* we couldn't be bothered to branch.\n*/\nfunction requirementsBlock(target) {\n\treturn [\n\t\t\"## Requirements\",\n\t\t\"\",\n\t\t`- **${TARGET_LABEL[target]} ${MIN_SERVER_VERSION[target]} or newer.** Older servers are not supported. Run ${target === \"postgres\" ? \"`SELECT version()`\" : \"`db.runCommand({ buildInfo: 1 })`\"} against your server to verify.`,\n\t\t\"- The CLI never connects to your database without explicit consent. Pass `--probe-db` to `prisma-next init` if you want `init` to verify the server version itself.\"\n\t].join(\"\\n\");\n}\n//#endregion\n//#region src/commands/init/templates/readme.ts\nconst sharedVariables = [\n\t\"projectName\",\n\t\"contractPath\",\n\t\"runDev\",\n\t\"runContractEmit\"\n];\nconst postgresVariables = [\n\t...sharedVariables,\n\t\"runDbInit\",\n\t\"runDbUpdate\",\n\t\"runMigrationPlan\",\n\t\"runMigrate\",\n\t\"runDbSeed\"\n];\nconst mongoVariables = [\n\t...sharedVariables,\n\t\"runDbUp\",\n\t\"runDbDown\",\n\t\"runDbReset\",\n\t\"runMigrationPlan\",\n\t\"runMigrate\",\n\t\"runDbSeed\"\n];\nfunction minimalProjectReadmeMd(target, schemaPath, projectName, pm) {\n\tconst run = (script) => formatRunScriptCommand(pm, script);\n\tconst shared = {\n\t\tprojectName,\n\t\tcontractPath: schemaPath,\n\t\trunDev: run(\"dev\"),\n\t\trunContractEmit: run(\"contract:emit\"),\n\t\trunMigrationPlan: run(\"migration:plan\"),\n\t\trunMigrate: run(\"migrate\"),\n\t\trunDbSeed: run(\"db:seed\")\n\t};\n\tif (target === \"mongo\") {\n\t\tconst vars = {\n\t\t\t...shared,\n\t\t\trunDbUp: run(\"db:up\"),\n\t\t\trunDbDown: run(\"db:down\"),\n\t\t\trunDbReset: run(\"db:reset\")\n\t\t};\n\t\treturn renderTemplate(\"readme-mongo.md\", mongoVariables, vars);\n\t}\n\tconst vars = {\n\t\t...shared,\n\t\trunDbInit: run(\"db:init\"),\n\t\trunDbUpdate: run(\"db:update\")\n\t};\n\treturn renderTemplate(\"readme-postgres.md\", postgresVariables, vars);\n}\n//#endregion\n//#region src/commands/init/templates/tsconfig.ts\n/**\n* Compiler options the scaffolded `prisma-next.config.ts` and `db.ts` need\n* to typecheck:\n*\n* - `module: 'preserve'` + `moduleResolution: 'bundler'` align with how\n* modern bundlers (and `tsdown`) consume our facade packages.\n* - `resolveJsonModule` lets `db.ts` import `contract.json with { type:\n* 'json' }` — the runtime path the facades document (FR4).\n*\n* `types: ['node']` is FR2.2 territory and lives in\n* `REQUIRED_COMPILER_OPTIONS_TYPES` because TS only honours an _array_\n* here, and a string-keyed merge would clobber any user-specified entries.\n* Merge handling preserves any extra `types` the user added.\n*/\nconst REQUIRED_COMPILER_OPTIONS = {\n\tmodule: \"preserve\",\n\tmoduleResolution: \"bundler\",\n\tresolveJsonModule: true\n};\n/**\n* Types that must be present in `compilerOptions.types` for the scaffold\n* to typecheck. With `moduleResolution: 'bundler'`, TypeScript does not\n* implicitly include all `@types/*` packages — `process.env` only resolves\n* when `node` is in this array (or `types` is omitted, but then any other\n* type listed here would force the same behaviour). Listing `node`\n* explicitly is the documented escape hatch (FR2.2).\n*/\nconst REQUIRED_COMPILER_OPTIONS_TYPES = [\"node\"];\nfunction defaultTsConfig() {\n\treturn JSON.stringify({\n\t\tcompilerOptions: {\n\t\t\ttarget: \"ES2022\",\n\t\t\t...REQUIRED_COMPILER_OPTIONS,\n\t\t\ttypes: [...REQUIRED_COMPILER_OPTIONS_TYPES],\n\t\t\tstrict: true,\n\t\t\tskipLibCheck: true,\n\t\t\tesModuleInterop: true,\n\t\t\toutDir: \"dist\"\n\t\t},\n\t\tinclude: [\"**/*.ts\"]\n\t}, null, 2);\n}\n/**\n* Thrown by `mergeTsConfig` when the user's existing `tsconfig.json` is\n* not parseable as JSONC (TypeScript's actual configured dialect — see\n* FR6.1). Carries the raw parse errors so the caller can render an\n* actionable, location-aware message.\n*\n* `runInit` catches this exception during the precondition phase and\n* maps it to a `CliStructuredError(5011)` so the user's working tree\n* stays byte-identical when init bails (FR6.2 / NFR3).\n*/\nvar TsConfigParseError = class extends Error {\n\terrors;\n\tconstructor(errors) {\n\t\tsuper(formatTsConfigParseErrors(errors));\n\t\tthis.errors = errors;\n\t\tthis.name = \"TsConfigParseError\";\n\t}\n};\nfunction formatTsConfigParseErrors(errors) {\n\tif (errors.length === 0) return \"tsconfig.json is empty or not an object\";\n\treturn errors.map((e) => `${printParseErrorCode(e.error)} at offset ${e.offset}`).join(\"; \");\n}\n/**\n* Merges the required compiler options into an existing `tsconfig.json`.\n*\n* Parsing is delegated to `jsonc-parser` so JSONC inputs (comments,\n* trailing commas) — TypeScript's real configuration dialect — survive\n* unchanged: edits are applied as text patches via `modify` /\n* `applyEdits`, preserving the user's formatting, key ordering, and\n* comments wherever the touched paths permit (FR6.1, AC \"Hostile\n* inputs\").\n*\n* Throws `TsConfigParseError` when the input is not parseable as JSONC.\n* The caller must catch this and surface a structured error before\n* writing any scaffold files (FR6.2 atomicity).\n*/\nfunction mergeTsConfig(existing) {\n\tconst { config } = parseTsConfigText(existing);\n\tconst formattingOptions = {\n\t\ttabSize: detectIndent(existing),\n\t\tinsertSpaces: true,\n\t\teol: existing.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\"\n\t};\n\tlet result = existing;\n\tfor (const [key, value] of Object.entries(REQUIRED_COMPILER_OPTIONS)) {\n\t\tconst edits = modify(result, [\"compilerOptions\", key], value, { formattingOptions });\n\t\tresult = applyEdits(result, edits);\n\t}\n\tconst existingTypes = config[\"compilerOptions\"]?.[\"types\"];\n\tconst mergedTypes = mergeTypesArray(existingTypes);\n\tconst typesEdits = modify(result, [\"compilerOptions\", \"types\"], mergedTypes, { formattingOptions });\n\tresult = applyEdits(result, typesEdits);\n\treturn result;\n}\n/**\n* Parses an existing `tsconfig.json` (JSONC) and returns the structured\n* config alongside any non-fatal parse warnings. Throws\n* `TsConfigParseError` if the input cannot be parsed at all or does\n* not resolve to a JSON object — both cases mean we cannot safely\n* apply edits.\n*\n* Exposed independently so callers (notably `runInit`'s precondition\n* gate) can validate the file *before* any scaffold file is written.\n*/\nfunction parseTsConfigText(text) {\n\tconst errors = [];\n\tconst value = parse(text, errors, {\n\t\tallowTrailingComma: true,\n\t\tdisallowComments: false,\n\t\tallowEmptyContent: false\n\t});\n\tif (value === void 0 || value === null || typeof value !== \"object\" || Array.isArray(value)) throw new TsConfigParseError(errors);\n\tif (errors.length > 0) throw new TsConfigParseError(errors);\n\treturn { config: value };\n}\nfunction detectIndent(text) {\n\tconst match = text.match(/^([ \\t]+)\\S/m);\n\tif (match === null) return 2;\n\tconst indent = match[1] ?? \"\";\n\tif (indent.startsWith(\"\t\")) return 1;\n\treturn indent.length || 2;\n}\n/**\n* Merges `REQUIRED_COMPILER_OPTIONS_TYPES` into the user's existing\n* `compilerOptions.types` array. Preserves order and dedupes. If the\n* user has no `types` array (or has set it to a non-array), we replace\n* with the required minimum — overwriting a non-array `types` is the\n* correct fix because anything other than a string array is invalid TS\n* config.\n*/\nfunction mergeTypesArray(existing) {\n\tconst result = [];\n\tif (Array.isArray(existing)) {\n\t\tfor (const item of existing) if (typeof item === \"string\" && !result.includes(item)) result.push(item);\n\t}\n\tfor (const required of REQUIRED_COMPILER_OPTIONS_TYPES) if (!result.includes(required)) result.push(required);\n\treturn result;\n}\n//#endregion\n//#region src/commands/init/pnpm-fallback.ts\n/**\n* Recognised pnpm error signatures that justify a fallback to npm.\n*\n* These patterns indicate the published artifact itself is at fault\n* (a leaked `workspace:*` or `catalog:` specifier), not the user's\n* environment — pnpm is faithfully reporting \"I cannot resolve this\n* registry version\", and npm is willing to install it because npm\n* doesn't care about the protocol prefix when there's a fallback range.\n*\n* The predicate lives on its own so both shells' `init` share one list:\n* the commander command matches it against captured child stderr, the\n* engine command against the stderr the package-manager capability\n* returns on a failed install.\n*/\nfunction isRecognisedPnpmResolutionError(stderr) {\n\tif (!stderr) return false;\n\treturn stderr.includes(\"ERR_PNPM_WORKSPACE_PKG_NOT_FOUND\") || stderr.includes(\"ERR_PNPM_NO_MATCHING_VERSION\") || /No matching version found for .* in the catalog/i.test(stderr) || /workspace:[^\\s]+ is not a valid (version|spec)/i.test(stderr) || /catalog:[^\\s]* is not a valid (version|spec)/i.test(stderr);\n}\n//#endregion\n//#region src/commands/init/redact-secrets.ts\n/**\n* Strips credentials out of package-manager stderr before it reaches a warning,\n* an error's meta, or a log. Two shapes carry them: userinfo inside a registry\n* URL (`https://user:token@registry…`), and the npmrc settings npm and pnpm\n* echo back when authentication fails (`//registry.npmjs.org/:_authToken=…`,\n* or the top-level `_authToken=…` with no registry scope), which are not\n* URL-shaped and survive a userinfo-only pass.\n*\n* Both shells' `init` call this, and both call it on stderr they already\n* received from somewhere else: redaction is cheap and doubling it is harmless,\n* while trusting another layer to have done it is not.\n*/\nfunction redactSecrets(stderr) {\n\treturn stderr.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/)([^/@\\s]+)@/g, \"$1***@\").replace(/(\\b_(?:authToken|auth|password)=)\\S+/gi, \"$1***\");\n}\n//#endregion\nexport { formatSkillSourceUrl as A, errorInitReinitNeedsForce as B, validateSchemaPath as C, DEFAULT_SKILL_AGENTS as D, envFileContent as E, errorInitInstallFailed as F, buildCatalogWarnings as G, errorInitStrictProbeWithoutProbe as H, errorInitInvalidManifest as I, errorInitInvalidTsconfig as L, resolveProjectSkillInstallCommands as M, probeServerVersion as N, DEFAULT_SKILL_SOURCES as O, errorInitEmitFailed as P, errorInitMissingFlags as R, resolveTarget as S, envExampleContent as T, errorInitUserAborted as U, errorInitSkillInstallFailed as V, errorInitWriteFailed as W, formatAddArgs as _, mergeTsConfig as a, hasProjectManifest as b, findStaleArtifacts as c, ensureEsmModuleType as d, mergePackageScripts as f, detectPackageManager as g, requiredGitattributesLines as h, defaultTsConfig as i, legacySkillDirs as j, formatSkillInstallCommand as k, removeDependency as l, mergeGitattributes as m, isRecognisedPnpmResolutionError as n, minimalProjectReadmeMd as o, mergeGitignore as p, TsConfigParseError as r, quickReferenceMd as s, redactSecrets as t, REQUIRED_SCRIPTS as u, formatAddDevArgs as v, MIN_SERVER_VERSION as w, resolveAuthoring as x, formatRunCommand as y, errorInitProbeFailed as z };\n\n//# sourceMappingURL=redact-secrets-Dmn0oXjA.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,2BAA2B,SAAS,UAAU;CACtD,MAAM,gBAAgB,6BAA6B,OAAO;CAC1D,IAAI,kBAAkB,MAAM,OAAO;CACnC,MAAM,UAAU,oBAAoB,aAAa,eAAe,OAAO,CAAC;CACxE,IAAI,YAAY,MAAM,OAAO;EAC5B;EACA,SAAS,CAAC;CACX;CACA,MAAM,SAAS,IAAI,IAAI,QAAQ;CAC/B,MAAM,UAAU,CAAC;CACjB,KAAK,MAAM,CAAC,MAAM,YAAY,SAAS,IAAI,OAAO,IAAI,IAAI,GAAG,QAAQ,KAAK;EACzE;EACA;CACD,CAAC;CACD,OAAO;EACN;EACA;CACD;AACD;AACA,SAAS,6BAA6B,SAAS;CAC9C,IAAI,MAAM;CACV,IAAI,OAAO;CACX,OAAO,QAAQ,MAAM;EACpB,MAAM,YAAY,KAAK,KAAK,qBAAqB;EACjD,IAAI,WAAW,SAAS,GAAG,OAAO;EAClC,OAAO;EACP,MAAM,QAAQ,GAAG;CAClB;CACA,OAAO;AACR;;;;;;;;;;;AAWA,SAAS,oBAAoB,UAAU;CACtC,MAAM,QAAQ,SAAS,MAAM,OAAO;CACpC,MAAM,WAAW,MAAM,WAAW,SAAS,mBAAmB,KAAK,IAAI,CAAC;CACxE,IAAI,aAAa,IAAI,OAAO;CAC5B,MAAM,UAAU,CAAC;CACjB,KAAK,IAAI,IAAI,WAAW,GAAG,IAAI,MAAM,QAAQ,KAAK;EACjD,MAAM,MAAM,MAAM,MAAM;EACxB,IAAI,IAAI,KAAK,MAAM,MAAM,QAAQ,KAAK,GAAG,GAAG;EAC5C,IAAI,CAAC,MAAM,KAAK,GAAG,GAAG;EAC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,mBAAmB,MAAM;CAChI,IAAI,OAAO,SAAS,GAAG,MAAM,IAAI,mBAAmB,MAAM;CAC1D,OAAO,EAAE,QAAQ,MAAM;AACxB;AACA,SAAS,aAAa,MAAM;CAC3B,MAAM,QAAQ,KAAK,MAAM,cAAc;CACvC,IAAI,UAAU,MAAM,OAAO;CAC3B,MAAM,SAAS,MAAM,MAAM;CAC3B,IAAI,OAAO,WAAW,GAAG,GAAG,OAAO;CACnC,OAAO,OAAO,UAAU;AACzB;;;;;;;;;AASA,SAAS,gBAAgB,UAAU;CAClC,MAAM,SAAS,CAAC;CAChB,IAAI,MAAM,QAAQ,QAAQ,GACpB;OAAA,MAAM,QAAQ,UAAU,IAAI,OAAO,SAAS,YAAY,CAAC,OAAO,SAAS,IAAI,GAAG,OAAO,KAAK,IAAI;CAAA;CAEtG,KAAK,MAAM,YAAY,iCAAiC,IAAI,CAAC,OAAO,SAAS,QAAQ,GAAG,OAAO,KAAK,QAAQ;CAC5G,OAAO;AACR;;;;;;;;;;;;;;;AAiBA,SAAS,gCAAgC,QAAQ;CAChD,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO,OAAO,SAAS,kCAAkC,KAAK,OAAO,SAAS,8BAA8B,KAAK,mDAAmD,KAAK,MAAM,KAAK,kDAAkD,KAAK,MAAM,KAAK,gDAAgD,KAAK,MAAM;AAClT;;;;;;;;;;;;;AAeA,SAAS,cAAc,QAAQ;CAC9B,OAAO,OAAO,QAAQ,8CAA8C,QAAQ,CAAC,CAAC,QAAQ,0CAA0C,OAAO;AACxI"}
|
|
1
|
+
{"version":3,"file":"redact-secrets-ojVi2cpy-CLyiSDk5.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/redact-secrets-ojVi2cpy.mjs"],"sourcesContent":["import { a as schemaSample, l as targetPackageName, s as targetEntrypoint, u as version } from \"./code-templates-D_sGnEF6.mjs\";\nimport { t as CliStructuredError$1 } from \"./cli-errors-B4zTLaqQ.mjs\";\nimport { createRequire } from \"node:module\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { dirname, extname, join, normalize } from \"pathe\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { docsUrlFor } from \"@internal/utils/structured-error\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { detect, getUserAgent } from \"package-manager-detector/detect\";\nimport { applyEdits, modify, parse, printParseErrorCode } from \"jsonc-parser\";\n//#region src/commands/init/detect-pnpm-catalog.ts\n/**\n* Walks up from `baseDir` looking for `pnpm-workspace.yaml`, then scans\n* its top-level `catalog:` block for entries that match any of `packages`.\n*\n* Implements FR7.3 / Spec Decision 8 (honour-and-warn): when `init` runs\n* inside a pnpm workspace whose catalog overrides one of the packages it\n* installs, surface a structured warning so the user knows the catalog\n* version (not the published `latest`) is what ended up in their\n* `node_modules`. pnpm itself does this silently; the warning closes the\n* \"looks fine, must be wrong version six months later\" gap.\n*\n* Notes / scope:\n*\n* - We only inspect the unnamed top-level `catalog:` block. pnpm also\n* supports `catalogs:` (plural — *named* catalogs referenced via\n* `catalog:foo` specifiers); those don't apply to a vanilla\n* `pnpm add prisma-next` invocation, so we skip them.\n* - We don't validate YAML syntax exhaustively. The file format pnpm\n* ships is line-oriented and well-known; a minimal regex is more\n* robust than depending on a YAML parser for one warning.\n* - We don't compare against the registry's `latest` — pnpm uses the\n* catalog version regardless, so the warning fires whenever a match\n* exists. The user-facing copy explains how to opt out.\n*/\nfunction detectPnpmCatalogOverrides(baseDir, packages) {\n\tconst workspaceFile = findNearestPnpmWorkspaceFile(baseDir);\n\tif (workspaceFile === null) return null;\n\tconst catalog = extractCatalogBlock(readFileSync(workspaceFile, \"utf-8\"));\n\tif (catalog === null) return {\n\t\tworkspaceFile,\n\t\tentries: []\n\t};\n\tconst wanted = new Set(packages);\n\tconst entries = [];\n\tfor (const [name, version] of catalog) if (wanted.has(name)) entries.push({\n\t\tname,\n\t\tversion\n\t});\n\treturn {\n\t\tworkspaceFile,\n\t\tentries\n\t};\n}\nfunction findNearestPnpmWorkspaceFile(baseDir) {\n\tlet dir = baseDir;\n\tlet prev = \"\";\n\twhile (dir !== prev) {\n\t\tconst candidate = join(dir, \"pnpm-workspace.yaml\");\n\t\tif (existsSync(candidate)) return candidate;\n\t\tprev = dir;\n\t\tdir = dirname(dir);\n\t}\n\treturn null;\n}\n/**\n* Returns the entries inside the top-level `catalog:` block as `[name, version]`\n* pairs in document order, or `null` when no `catalog:` block exists.\n*\n* The parser is intentionally minimal: it reads line-by-line, locates the\n* top-level `catalog:` line (no leading whitespace), then collects every\n* subsequent indented line of the form `<key>: <value>` until the next\n* top-level key (or end of file). Quotes around `<key>` and `<value>`\n* are stripped; comments (`#…`) are ignored.\n*/\nfunction extractCatalogBlock(contents) {\n\tconst lines = contents.split(/\\r?\\n/);\n\tconst startIdx = lines.findIndex((line) => /^catalog\\s*:\\s*$/.test(line));\n\tif (startIdx === -1) return null;\n\tconst entries = [];\n\tfor (let i = startIdx + 1; i < lines.length; i++) {\n\t\tconst raw = lines[i] ?? \"\";\n\t\tif (raw.trim() === \"\" || /^\\s*#/.test(raw)) continue;\n\t\tif (!/^\\s/.test(raw)) break;\n\t\tconst match = raw.match(/^\\s+(?:'([^']+)'|\"([^\"]+)\"|([^:\\s'\"]+))\\s*:\\s*(.*?)\\s*(?:#.*)?$/);\n\t\tif (!match) continue;\n\t\tconst name = match[1] ?? match[2] ?? match[3];\n\t\tif (name === void 0) continue;\n\t\tconst version = stripQuotes((match[4] ?? \"\").trim());\n\t\tif (version === \"\") continue;\n\t\tentries.push([name, version]);\n\t}\n\treturn entries;\n}\nfunction stripQuotes(value) {\n\tif (value.length >= 2) {\n\t\tconst first = value[0];\n\t\tconst last = value[value.length - 1];\n\t\tif (first === \"\\\"\" && last === \"\\\"\" || first === \"'\" && last === \"'\") return value.slice(1, -1);\n\t}\n\treturn value;\n}\n//#endregion\n//#region src/commands/init/catalog-warnings.ts\nfunction formatCatalogWarning(workspaceFile, entries) {\n\treturn [\n\t\t\"pnpm workspace catalog overrides detected — pnpm will install these versions instead of `latest`:\",\n\t\tentries.map((entry) => ` • ${entry.name}: ${entry.version}`).join(\"\\n\"),\n\t\t`Catalog source: ${workspaceFile}`,\n\t\t\"To use the published `latest` instead, remove or update the catalog entry, then re-run `pnpm install`.\"\n\t].join(\"\\n\");\n}\n/**\n* Honour-and-warn: when the surrounding pnpm workspace pins one of the\n* packages `init` installs through its catalog, say so — the catalog version,\n* not the published `latest`, is what ends up in the project. Empty when there\n* is no workspace above the project or its catalog names none of them.\n*/\nfunction buildCatalogWarnings(baseDir, packages) {\n\tconst result = detectPnpmCatalogOverrides(baseDir, packages);\n\tif (result === null || result.entries.length === 0) return [];\n\treturn [formatCatalogWarning(result.workspaceFile, result.entries)];\n}\n//#endregion\n//#region src/commands/init/errors.ts\n/**\n* Re-init in non-interactive mode without `--force`. Distinct from the\n* decline-the-prompt path (which is `errorInitUserAborted`) because here\n* the user was never given the choice — `--force` is the contract.\n*/\nfunction errorInitReinitNeedsForce() {\n\treturn new CliStructuredError$1(\"CLI.INIT_REINIT_NEEDS_FORCE\", \"Project is already initialized\", {\n\t\twhy: \"A `prisma-next.config.ts` already exists in this directory. Re-running `init` would overwrite the scaffolded files; in non-interactive mode `init` will not do that without `--force`.\",\n\t\tfix: \"Pass `--force` to overwrite the existing scaffold, or run `init` interactively to confirm.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_REINIT_NEEDS_FORCE\")\n\t});\n}\n/**\n* Non-interactive mode is missing one or more required inputs. Lists every\n* missing flag in the error so an agent / CI script can react without\n* needing to parse English.\n*\n* @param missing — kebab-case flag names without leading dashes\n* @param why — additional context (e.g. \"stdin is not a TTY\") that helps\n* the user understand why interactive fallback was skipped.\n*/\nfunction errorInitMissingFlags(options) {\n\tconst flagList = options.missing.map((flag) => `--${flag}`).join(\", \");\n\tconst fixList = options.missing.map((flag) => {\n\t\tswitch (flag) {\n\t\t\tcase \"target\": return \"--target postgres|mongodb\";\n\t\t\tcase \"authoring\": return \"--authoring psl|typescript\";\n\t\t\tcase \"schema-path\": return \"--schema-path <path>\";\n\t\t\tdefault: return `--${flag} <value>`;\n\t\t}\n\t}).join(\" \");\n\treturn new CliStructuredError$1(\"CLI.INIT_MISSING_FLAGS\", \"Missing required flags\", {\n\t\twhy: `${options.why} Missing required flag(s): ${flagList}.`,\n\t\tfix: `Re-run with the missing flag(s) supplied, e.g. \\`prisma-next init --yes ${fixList}\\`. Use \\`prisma-next init --help\\` to see every flag.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_MISSING_FLAGS\"),\n\t\tmeta: { missingFlags: options.missing }\n\t});\n}\n/**\n* A flag value was supplied but is not in the allowed set. Lists the\n* allowed values in `meta` for machine-readable consumption.\n*/\nfunction errorInitInvalidFlagValue(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_INVALID_FLAG_VALUE\", `Invalid value for --${options.flag}`, {\n\t\twhy: `\\`--${options.flag} ${options.value}\\` is not one of: ${options.allowed.join(\", \")}.`,\n\t\tfix: `Use one of: ${options.allowed.map((v) => `--${options.flag} ${v}`).join(\", \")}.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_FLAG_VALUE\"),\n\t\tmeta: {\n\t\t\tflag: options.flag,\n\t\t\tvalue: options.value,\n\t\t\tallowed: options.allowed\n\t\t}\n\t});\n}\n/**\n* `--authoring` and `--schema-path` disagree on file extension (e.g. PSL\n* authoring with a `.ts` path). Surfaces before any scaffold files are\n* written so the project tree stays untouched.\n*/\nfunction errorInitAuthoringSchemaPathMismatch(options) {\n\tconst expectedAuthoring = options.expectedExtension === \".ts\" ? \"typescript\" : \"psl\";\n\treturn new CliStructuredError$1(\"CLI.INIT_AUTHORING_SCHEMA_PATH_MISMATCH\", \"Authoring and schema path do not match\", {\n\t\twhy: `\\`--authoring ${options.authoring}\\` requires a schema file ending in ${options.expectedExtension}, but \\`--schema-path ${options.schemaPath}\\` ends in ${options.actualExtension}.`,\n\t\tfix: `Use a matching pair, for example \\`--authoring ${expectedAuthoring} --schema-path <path>${options.expectedExtension}\\`, or change \\`--authoring\\` to match the path you supplied. You can also omit \\`--schema-path\\` to use the default for the chosen authoring.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_AUTHORING_SCHEMA_PATH_MISMATCH\"),\n\t\tmeta: {\n\t\t\tauthoring: options.authoring,\n\t\t\tschemaPath: options.schemaPath,\n\t\t\tactualExtension: options.actualExtension,\n\t\t\texpectedExtension: options.expectedExtension\n\t\t}\n\t});\n}\n/**\n* The user cancelled an interactive prompt (Ctrl-C, escape, declined a\n* selection). Distinct from `errorInitReinitNeedsForce` because that path\n* applies to non-interactive mode where the user was never given the\n* choice; this one is the generic \"user said no\" path. Maps to exit code\n* 3 (USER_ABORTED).\n*/\nfunction errorInitUserAborted() {\n\treturn new CliStructuredError$1(\"CLI.INIT_USER_ABORTED\", \"Init cancelled\", {\n\t\twhy: \"The interactive prompt was cancelled before all required inputs were supplied. No files were modified.\",\n\t\tfix: \"Re-run `prisma-next init` and complete the prompts, or pass the required inputs as flags (see `--help`) for a non-interactive run.\",\n\t\tseverity: \"info\"\n\t});\n}\n/**\n* `--strict-probe` was supplied without `--probe-db`. Per FR8.3 / NFR9\n* (offline-by-default), `--strict-probe` is a no-op without `--probe-db` —\n* but rather than silently ignoring it we tell the user what they probably\n* meant. Without this guard, the flag combination silently does nothing,\n* which is exactly the kind of \"looks like it worked\" trap that a strict\n* mode is supposed to prevent.\n*/\nfunction errorInitStrictProbeWithoutProbe() {\n\treturn new CliStructuredError$1(\"CLI.INIT_STRICT_PROBE_WITHOUT_PROBE\", \"`--strict-probe` requires `--probe-db`\", {\n\t\twhy: \"`--strict-probe` only changes how a *failed* probe is reported; without `--probe-db` no probe is attempted in the first place. (`init` is offline-by-default — it never opens a connection to your database without explicit consent.)\",\n\t\tfix: \"Add `--probe-db` to opt in to the probe, or drop `--strict-probe` if you do not need the version check.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_STRICT_PROBE_WITHOUT_PROBE\")\n\t});\n}\n/**\n* Dependency installation failed and the pnpm → npm fallback (FR7.2)\n* either did not apply (pm ≠ pnpm or stderr did not match a recognised\n* leak) or also failed. Files scaffolded before the install step are\n* already on disk; `meta.filesWritten` carries the list so a follow-up\n* agent can resume manually. Maps to exit code `4 = INSTALL_FAILED`.\n*/\nfunction errorInitInstallFailed(options) {\n\tconst trimmed = options.stderrLines.map((s) => s.trim()).filter(Boolean);\n\treturn new CliStructuredError$1(\"CLI.INIT_INSTALL_FAILED\", \"Failed to install dependencies\", {\n\t\twhy: trimmed.length === 0 ? \"The package manager exited with an error and no recoverable fallback applied.\" : `The package manager exited with: ${trimmed[0]}`,\n\t\tfix: `Install manually:\\n ${options.addCommand}\\n ${options.addDevCommand}\\nThen run \\`${options.emitCommand}\\` to emit the contract.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INSTALL_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tstderr: trimmed\n\t\t}\n\t});\n}\n/**\n* The user's project manifest (typically `package.json`) failed to parse\n* as JSON. Init reads the manifest to merge `scripts` (FR3.5) and to\n* skip `@types/node` when it is already declared (FR2.1); a malformed\n* file would otherwise surface as an `INTERNAL_ERROR` with a raw\n* `SyntaxError` stack, which violates the FR1.6 contract that every\n* documented failure mode maps to a stable exit code.\n*\n* Maps to exit code `2 = PRECONDITION` — the user can fix the manifest\n* and re-run.\n*/\nfunction errorInitInvalidManifest(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_INVALID_MANIFEST\", `Failed to parse ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` is not valid JSON: ${options.cause}`,\n\t\tfix: `Fix the JSON syntax in \\`${options.path}\\` (a missing comma or unbalanced brace is the most common cause), then re-run \\`prisma-next init\\`.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_MANIFEST\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* The user's existing `tsconfig.json` could not be parsed even with JSONC\n* tolerance (comments + trailing commas) enabled. Init merges the\n* minimum compiler options the scaffolded files need (FR2.2), so an\n* unparseable tsconfig is a hard precondition failure: we cannot\n* faithfully edit a file we cannot read.\n*\n* Init must surface this **before** writing any scaffold file so the\n* user's working tree stays byte-identical (FR6.2 / NFR3) — see\n* `runInit` for the precondition gate.\n*\n* Maps to exit code `2 = PRECONDITION` — the user can fix the file and\n* re-run.\n*/\nfunction errorInitInvalidTsconfig(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_INVALID_TSCONFIG\", `Failed to parse ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` is not valid JSON or JSONC: ${options.cause}`,\n\t\tfix: `Fix the syntax in \\`${options.path}\\` and re-run \\`prisma-next init\\`. \\`init\\` accepts JSONC (comments and trailing commas) but cannot recover from unbalanced braces or missing commas.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_INVALID_TSCONFIG\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* `--probe-db` was supplied along with `--strict-probe` and the probe\n* could not complete (no `DATABASE_URL`, network/auth error, the target\n* driver was not installed, …). Without `--strict-probe` the probe\n* surfaces these as warnings; `--strict-probe` escalates them to\n* fatal so a CI gate can rely on \"init exit code 2 means something\n* about the runtime environment is wrong\" (FR8.3).\n*\n* Maps to exit code `2 = PRECONDITION`. The caller's project files\n* are already on disk by this point — the probe runs after the write\n* phase — but the install/emit steps may or may not have completed\n* depending on `--no-install` and the exact failure mode; `meta`\n* carries `filesWritten` so a follow-up agent can resume manually.\n*/\nfunction errorInitProbeFailed(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_PROBE_FAILED\", \"Database probe failed\", {\n\t\twhy: `\\`--probe-db\\` could not complete and \\`--strict-probe\\` was set: ${options.cause}`,\n\t\tfix: \"Confirm `DATABASE_URL` points at a reachable server, or drop `--strict-probe` to treat probe failures as warnings.\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_PROBE_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* `prisma-next contract emit` failed after a successful install. Surface\n* the underlying error so the user can fix it and re-run; files and\n* dependencies remain on disk untouched. Maps to exit code\n* `5 = EMIT_FAILED`.\n*/\nfunction errorInitEmitFailed(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_EMIT_FAILED\", \"Failed to emit contract\", {\n\t\twhy: `\\`prisma-next contract emit\\` failed: ${options.cause}`,\n\t\tfix: `Inspect your contract file, fix the underlying issue, then re-run \\`${options.emitCommand}\\`. Pass \\`-v\\` for the full error envelope.`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_EMIT_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n/**\n* A scaffold file could not be written after earlier writes had already\n* landed. The directory is half-scaffolded, so this carries the list of what\n* did get written, the way every other post-write failure in `init` does.\n*\n* Maps to exit code `2 = PRECONDITION`: what stopped the write is something\n* about the directory the user can fix.\n*/\nfunction errorInitWriteFailed(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_WRITE_FAILED\", `Failed to write ${options.path}`, {\n\t\twhy: `\\`${options.path}\\` could not be written: ${options.cause}`,\n\t\tfix: \"Fix what stopped the write — a directory sitting where the file goes, permissions, a full disk — then run `prisma-next init` again. It will ask you to confirm replacing the files this run already wrote (listed in `meta.filesWritten`).\",\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_WRITE_FAILED\"),\n\t\tmeta: {\n\t\t\tpath: options.path,\n\t\t\tcause: options.cause,\n\t\t\tfilesWritten: options.filesWritten\n\t\t}\n\t});\n}\n/**\n* The project-level skills install (`npx skills add\n* prisma/prisma#v<version>`) failed after a successful dependency\n* install + emit. The project's scaffold remains on disk; the user\n* can either fix the underlying issue (network, registry, PATH) and\n* run the install command manually, or re-run `init --no-skill` to\n* proceed without the skill.\n*\n* Non-rolling-back, matching the existing install/emit failure\n* semantics. Maps to exit code `6 = SKILL_INSTALL_FAILED`.\n*/\nfunction errorInitSkillInstallFailed(options) {\n\treturn new CliStructuredError$1(\"CLI.INIT_SKILL_INSTALL_FAILED\", \"Failed to install Prisma Next skills\", {\n\t\twhy: `\\`${options.skillInstallCommand}\\` exited with an error: ${options.cause}`,\n\t\tfix: `Either:\n - Re-run \\`prisma-next init --no-skill${options.filesWritten.length > 0 ? \" --force\" : \"\"}\\` to skip the skill install for this run, or\\n - Fix the underlying issue (network, npm registry, \\`npx skills\\` on PATH) and install manually:\\n ${options.skillInstallCommand}`,\n\t\tdocsUrl: docsUrlFor(\"CLI.INIT_SKILL_INSTALL_FAILED\"),\n\t\tmeta: {\n\t\t\tfilesWritten: options.filesWritten,\n\t\t\tskillInstallCommand: options.skillInstallCommand,\n\t\t\tcause: options.cause\n\t\t}\n\t});\n}\n//#endregion\n//#region src/commands/init/probe-db.ts\n/**\n* Connects (when configured) to the user's database and returns a\n* structured outcome describing whether the server meets the declared\n* minimum (FR8.1). Pure with respect to its inputs: no I/O happens\n* unless `databaseUrl` is set.\n*\n* The outcome is shaped so that `--strict-probe` can branch on the\n* `kind`/`meetsMinimum` pair without re-stringifying the message:\n*\n* - `ok` — informational; `init` continues.\n* - `below-minimum` — warning; `init` continues regardless of\n* `--strict-probe` (the spec scopes strict-probe to \"probe\n* *failures*\", and a successful probe that finds an old server is\n* not a failure).\n* - `no-database-url` / `connection-failed` / `driver-missing` —\n* warning by default, fatal under `--strict-probe`.\n*/\nasync function probeServerVersion(ctx, overrides = {}) {\n\tconst { databaseUrl, minVersion, target } = ctx;\n\tif (databaseUrl === void 0 || databaseUrl.trim().length === 0) return {\n\t\tkind: \"no-database-url\",\n\t\tminVersion,\n\t\tmeetsMinimum: null,\n\t\tmessage: \"Skipped --probe-db: DATABASE_URL is not set in the current shell environment. (init does not read .env for the probe; export the variable or drop --probe-db.)\"\n\t};\n\tlet driverResult;\n\ttry {\n\t\tif (target === \"postgres\") driverResult = overrides.probePostgres !== void 0 ? await overrides.probePostgres(databaseUrl) : await defaultProbePostgres(databaseUrl, ctx.baseDir, overrides);\n\t\telse driverResult = overrides.probeMongo !== void 0 ? await overrides.probeMongo(databaseUrl) : await defaultProbeMongo(databaseUrl, ctx.baseDir, overrides);\n\t} catch (err) {\n\t\tif (err instanceof DriverMissingError) return {\n\t\t\tkind: \"driver-missing\",\n\t\t\tminVersion,\n\t\t\tmeetsMinimum: null,\n\t\t\tcause: err.message,\n\t\t\tmessage: `Skipped --probe-db: ${err.message}. (Run with install enabled, or install the driver yourself, then re-run \\`prisma-next init --probe-db\\`.)`\n\t\t};\n\t\tconst cause = redactDatabaseUrlSecrets(causeMessage(err));\n\t\treturn {\n\t\t\tkind: \"connection-failed\",\n\t\t\tminVersion,\n\t\t\tmeetsMinimum: null,\n\t\t\tcause,\n\t\t\tmessage: `--probe-db could not connect: ${cause}.`\n\t\t};\n\t}\n\tif (compareVersionPrefix(driverResult.serverVersion, minVersion) < 0) return {\n\t\tkind: \"below-minimum\",\n\t\tserverVersion: driverResult.serverVersion,\n\t\tminVersion,\n\t\tmeetsMinimum: false,\n\t\tmessage: `--probe-db: server reports version ${driverResult.serverVersion}, below the declared minimum (${minVersion}). Some queries may fail until the server is upgraded.`\n\t};\n\treturn {\n\t\tkind: \"ok\",\n\t\tserverVersion: driverResult.serverVersion,\n\t\tminVersion,\n\t\tmeetsMinimum: true,\n\t\tmessage: `--probe-db: server reports version ${driverResult.serverVersion} (>= ${minVersion}).`\n\t};\n}\n/**\n* Compares two semver-prefix strings (\"14\", \"14.2\", \"6.0\", …) by\n* numeric components left-to-right. Returns a negative number when `a`\n* is older than `b`, zero when both versions agree on every numeric\n* component (treating missing trailing components as `0`), and a\n* positive number when `a` is newer.\n*\n* The loop runs over the **longer** of the two prefixes so that\n* `'14'` compares less than `'14.1'` — without that, the shorter\n* prefix would be silently accepted whenever the configured minimum\n* has a non-zero minor or patch.\n*\n* Exported for unit tests.\n*/\nfunction compareVersionPrefix(a, b) {\n\tconst aParts = parseNumericParts(a);\n\tconst bParts = parseNumericParts(b);\n\tconst len = Math.max(aParts.length, bParts.length);\n\tfor (let i = 0; i < len; i += 1) {\n\t\tconst aPart = aParts[i] ?? 0;\n\t\tconst bPart = bParts[i] ?? 0;\n\t\tif (aPart !== bPart) return aPart - bPart;\n\t}\n\treturn 0;\n}\nfunction parseNumericParts(version) {\n\tconst match = version.match(/^[^\\d]*(\\d+(?:\\.\\d+){0,3})/);\n\tif (match === null) return [];\n\treturn (match[1] ?? \"\").split(\".\").map((part) => Number.parseInt(part, 10));\n}\nvar DriverMissingError = class extends Error {};\nfunction causeMessage(err) {\n\tif (err instanceof Error) return err.message;\n\treturn String(err);\n}\n/**\n* Strips `user:password@` userinfo from any URL-shaped substring before\n* we surface the cause to the user. Mirrors `redactSecrets` in\n* `init.ts` — the probe path has its own redactor because the inputs\n* here include the raw connection string by construction (driver\n* errors echo the URL back).\n*\n* Exported for unit tests.\n*/\nfunction redactDatabaseUrlSecrets(text) {\n\tif (!text) return text;\n\treturn text.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/)([^/@\\s]+)@/g, \"$1***@\");\n}\nasync function defaultProbePostgres(databaseUrl, baseDir, overrides) {\n\tconst client = new (requirePeer(\"pg\", baseDir, overrides)).Client({ connectionString: databaseUrl });\n\tawait client.connect();\n\ttry {\n\t\tconst result = await client.query(\"SELECT version() as version\");\n\t\treturn { serverVersion: parsePostgresVersion(String(result?.rows?.[0]?.version ?? \"\")) };\n\t} finally {\n\t\tawait client.end().catch(() => void 0);\n\t}\n}\n/**\n* Extracts the numeric prefix from a Postgres `version()` row, e.g.\n*\n* `PostgreSQL 14.10 on x86_64-pc-linux-gnu, ...` → `\"14.10\"`\n* `PostgreSQL 16beta1 on …` → `\"16\"` (we\n* conservatively drop the suffix; minimum-version comparisons\n* treat 16beta1 as 16, which is what every reasonable user\n* expects).\n*\n* Exported for unit tests.\n*/\nfunction parsePostgresVersion(versionString) {\n\tconst match = versionString.match(/PostgreSQL\\s+(\\d+(?:\\.\\d+)?)/i);\n\tif (match === null || match[1] === void 0) throw new CliStructuredError(\"CLI.INIT_PROBE_FAILED\", `Could not parse PostgreSQL version from \\`${versionString}\\``);\n\treturn match[1];\n}\nasync function defaultProbeMongo(databaseUrl, baseDir, overrides) {\n\tconst client = new (requirePeer(\"mongodb\", baseDir, overrides)).MongoClient(databaseUrl);\n\tawait client.connect();\n\ttry {\n\t\tconst buildInfo = await client.db().admin().command({ buildInfo: 1 });\n\t\tconst versionString = String(buildInfo.version ?? \"\");\n\t\tif (versionString.length === 0) throw new CliStructuredError(\"CLI.INIT_PROBE_FAILED\", \"buildInfo did not include a `version` field\");\n\t\treturn { serverVersion: versionString };\n\t} finally {\n\t\tawait client.close().catch(() => void 0);\n\t}\n}\n/**\n* Loads a peer driver (`pg` / `mongodb`) from the user's project\n* `node_modules`. We deliberately resolve from `baseDir` rather than\n* from the CLI bundle — the CLI does not depend on `pg` or `mongodb`\n* directly, but the user's `init`-generated `package.json` does (via\n* the target facade). Failure to resolve is folded into a typed\n* `DriverMissingError` so `probeServerVersion` can map it to a\n* `driver-missing` outcome rather than letting a `MODULE_NOT_FOUND`\n* leak as a generic connection failure.\n*/\nfunction requirePeer(moduleId, baseDir, overrides) {\n\ttry {\n\t\tif (overrides.requireFromBaseDir !== void 0) return overrides.requireFromBaseDir(baseDir, moduleId);\n\t\treturn createRequire(join(baseDir, \"package.json\"))(moduleId);\n\t} catch (err) {\n\t\tthrow new DriverMissingError(`\\`${moduleId}\\` is not installed in this project (resolved from ${baseDir}; cause: ${causeMessage(err)})`);\n\t}\n}\n//#endregion\n//#region src/commands/init/skill-sources.ts\n/**\n* Default base for the GitHub-URL form `<owner>/<repo>` consumed by\n* upstream `skills add`. Each `SkillSource` joins this base with its\n* own subpath (and optional `#ref` for version-pinned clusters).\n*/\nconst DEFAULT_SKILL_BASE = \"prisma/prisma\";\nconst DEFAULT_SKILL_SOURCES = [\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-8\",\n\t\tref: \"cli\",\n\t\tdescription: \"usage skill (version-locked to installed Prisma Next)\"\n\t},\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-next-upgrade\",\n\t\tref: null,\n\t\tdescription: \"upgrade skill (always tracks `main`)\"\n\t},\n\t{\n\t\tsubpath: \"skills\",\n\t\tskill: \"prisma-8-extension-upgrade\",\n\t\tref: null,\n\t\tdescription: \"extension-author upgrade skill (always tracks `main`)\"\n\t}\n];\n/**\n* Test-only escape hatch for pinning the install base to a local\n* checkout. Production runs leave this unset, so installs always use\n* `DEFAULT_SKILL_BASE`.\n*\n* When set to an absolute filesystem path (typical for tests), the\n* `#ref` fragment is dropped — local-path mode in upstream's CLI does\n* not accept refs, and the local clone has whatever content the test\n* checked into it anyway. When set to anything else (e.g. a fork name\n* `myuser/prisma-next`), the ref policy is preserved.\n*/\nfunction resolveAgentSkillBase(env) {\n\tconst override = env[\"PRISMA_NEXT_SKILLS_BASE\"]?.trim();\n\treturn override && override.length > 0 ? override : DEFAULT_SKILL_BASE;\n}\nfunction isLocalPath(base) {\n\treturn base.startsWith(\"/\") || /^[a-zA-Z]:[\\\\/]/.test(base);\n}\n/**\n* Agents passed to every project-level init install. Upstream `skills add`\n* is the source of truth for per-agent install behaviour; the CLI lists\n* every supported runtime on one invocation and delegates the rest.\n*/\nconst DEFAULT_SKILL_AGENTS = [\n\t\"cursor\",\n\t\"claude-code\",\n\t\"codex\",\n\t\"windsurf\"\n];\n/**\n* Build the `<base>/<subpath>[#ref]` URL the `skills` CLI will\n* resolve. Exported for unit tests so the per-source format can be\n* asserted without going through the full install loop.\n*/\nfunction formatSkillSourceUrl(source, env = process.env) {\n\tconst base = resolveAgentSkillBase(env);\n\tconst url = `${base}/${source.subpath}`;\n\tif (source.ref === null) return url;\n\tif (isLocalPath(base)) return url;\n\tif (source.ref === \"cli\") return `${url}#v${version}`;\n\treturn url;\n}\n/**\n* The skill-install command for one source, formatted for the\n* project's detected package manager. `npx`/`pnpm dlx`/`bunx` are\n* interchangeable to the user; we pick the variant that matches the\n* rest of the install step so a single project consistently uses one\n* runner.\n*\n* `--agent` takes space-separated slugs on one flag; the explicit\n* `--skill <name>` and `-y` skip the multi-select prompts a\n* non-interactive scaffold step cannot show.\n*\n* Exported for unit tests so the per-PM dispatch can be asserted\n* without a live subprocess.\n*/\nfunction formatSkillInstallCommand(args) {\n\tconst agents = args.agents ?? DEFAULT_SKILL_AGENTS;\n\tconst cliArgs = [\n\t\t\"skills@latest\",\n\t\t\"add\",\n\t\tformatSkillSourceUrl(args.source, args.env),\n\t\t\"--agent\",\n\t\t...agents,\n\t\t\"--skill\",\n\t\targs.source.skill,\n\t\t\"-y\"\n\t];\n\treturn formatPackageManagerCommand(args.pm, cliArgs);\n}\n/**\n* Ordered skill-install commands for one init run. This is both what the\n* commander shell runs and what either shell tells the user to run when the\n* install is skipped or fails — the commands need no scaffold and no `init`.\n*/\nfunction resolveProjectSkillInstallCommands(pm, env) {\n\treturn DEFAULT_SKILL_SOURCES.map((source) => formatSkillInstallCommand({\n\t\tpm,\n\t\tsource,\n\t\t...ifDefined(\"env\", env)\n\t}));\n}\nfunction formatPackageManagerCommand(pm, args) {\n\tswitch (pm) {\n\t\tcase \"pnpm\": return `pnpm dlx ${args.join(\" \")}`;\n\t\tcase \"yarn\": return `yarn dlx ${args.join(\" \")}`;\n\t\tcase \"bun\": return `bunx ${args.join(\" \")}`;\n\t\tcase \"deno\": return `deno run -A npm:${args.join(\" \")}`;\n\t\tcase \"npm\": return `npx ${args.join(\" \")}`;\n\t}\n}\n/**\n* Skill directories that predate the consolidated `prisma-8` skill:\n* the per-workflow usage cluster (including the renamed\n* `prisma-8-migration-review` spelling it briefly shipped under), the\n* pre-rename spellings of the consolidated skill and the\n* extension-author upgrade skill, and any hand-rolled `prisma-next`\n* stub. Projects initialised before the consolidation carry these as\n* sibling directories in each agent's install root; left in place\n* they compete with the current skills for activation, so init\n* removes them on every run.\n*/\nconst RETIRED_SKILL_NAMES = [\n\t\"prisma-next\",\n\t\"prisma-next-quickstart\",\n\t\"prisma-next-contract\",\n\t\"prisma-next-migrations\",\n\t\"prisma-next-migration-review\",\n\t\"prisma-8-migration-review\",\n\t\"prisma-next-queries\",\n\t\"prisma-next-runtime\",\n\t\"prisma-next-build\",\n\t\"prisma-next-supabase\",\n\t\"prisma-next-debug\",\n\t\"prisma-next-feedback\",\n\t\"prisma-next-extension-upgrade\"\n];\n/**\n* Project-level install roots the upstream `skills` CLI uses for the\n* agents in `DEFAULT_SKILL_AGENTS`: cursor and codex install into\n* `.agents/skills`, claude-code into `.claude/skills`, windsurf into\n* `.windsurf/skills`.\n*/\nconst AGENT_SKILL_ROOTS = [\n\t\".agents/skills\",\n\t\".claude/skills\",\n\t\".windsurf/skills\"\n];\n/**\n* Every directory a retired per-workflow skill may occupy in a\n* consumer project. Init deletes each (recursively) before running the\n* skill install.\n*/\nfunction legacySkillDirs() {\n\treturn AGENT_SKILL_ROOTS.flatMap((root) => RETIRED_SKILL_NAMES.map((name) => `${root}/${name}`));\n}\n//#endregion\n//#region src/commands/init/templates/env.ts\n/**\n* The minimum supported server version for each target. The\n* authoritative source of truth is each target package's\n* `package.json#prismaNext.minServerVersion` field — this module\n* mirrors those values and a workspace-level test asserts the two\n* never drift (`templates/tsconfig-env.test.ts`).\n*\n* Bumping a value here in isolation is **not** safe: edit the\n* corresponding target package's `package.json` first, then mirror\n* here. The scaffold's `.env.example` and the \"Requirements\" section\n* of `prisma-next.md` both read from this constant, so a stale value\n* lies to every freshly initialised user.\n*/\nconst MIN_SERVER_VERSION = {\n\tpostgres: \"15\",\n\tmongo: \"8.0\"\n};\nconst TARGET_LABEL = {\n\tpostgres: \"PostgreSQL\",\n\tmongo: \"MongoDB\"\n};\n/**\n* Renders the placeholder body shared by `.env` and `.env.example`:\n* the target-specific connection-string requirement comments and the\n* commented-shape `DATABASE_URL` line. The output is identical for both\n* authoring styles — the env file is orthogonal to PSL vs TS schema\n* authoring.\n*/\nfunction envPlaceholderBody(target) {\n\tconst label = TARGET_LABEL[target];\n\tconst minVersion = MIN_SERVER_VERSION[target];\n\tconst lines = [];\n\tlines.push(`# Connection string for ${label}.`);\n\tlines.push(`# Requires ${label} >= ${minVersion}.`);\n\tlines.push(\"\");\n\tif (target === \"postgres\") lines.push(\"DATABASE_URL=\\\"postgresql://user:password@localhost:5432/mydb\\\"\");\n\telse {\n\t\tlines.push(\"# Standalone local mongod / `docker run mongo:8` — no replica set required for first-run queries.\");\n\t\tlines.push(\"# Transactions and change streams need a replica set; add ?replicaSet=... only after initiating one.\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"DATABASE_URL=\\\"mongodb://user:password@localhost:27017/mydb\\\"\");\n\t}\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders the `.env.example` content for a given target:\n*\n* - Carries a \"Copy this file to `.env`…\" intro that only makes sense\n* for the example file (the real `.env` is the destination of that\n* copy and so does not get the same intro).\n* - Documents the `DATABASE_URL` placeholder in the target's native URL\n* shape (Postgres: standard `postgresql://`, Mongo: `mongodb://` plus\n* a `mydb` database segment so the lazy facade has a `dbName`).\n* - Carries a `# Requires <db> >= <version>` comment so a fresh user\n* knows the minimum supported server before they first try to connect.\n*/\nfunction envExampleContent(target) {\n\tconst lines = [];\n\tlines.push(\"# Copy this file to `.env` and replace the placeholder with your real connection string.\");\n\tlines.push(envPlaceholderBody(target));\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders the initial `.env` content for `--write-env` / interactive\n* opt-in. Same placeholder body as `.env.example`, **without** the\n* example file's \"Copy this file to `.env`…\" intro: the real `.env` is\n* the destination of that copy, so the line would lie. Writing this\n* file is gitignored (`.env` lands in `.gitignore` during init).\n*/\nfunction envFileContent(target) {\n\treturn envPlaceholderBody(target);\n}\n//#endregion\n//#region src/commands/init/input-values.ts\nconst TARGET_ALIASES = /* @__PURE__ */ new Map([\n\t[\"postgres\", \"postgres\"],\n\t[\"postgresql\", \"postgres\"],\n\t[\"mongo\", \"mongo\"],\n\t[\"mongodb\", \"mongo\"]\n]);\nconst AUTHORING_VALUES = /* @__PURE__ */ new Map([\n\t[\"psl\", \"psl\"],\n\t[\"typescript\", \"typescript\"],\n\t[\"ts\", \"typescript\"]\n]);\nfunction resolveTarget(value) {\n\tif (value === void 0) return void 0;\n\tconst mapped = TARGET_ALIASES.get(value.toLowerCase());\n\tif (mapped === void 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"target\",\n\t\tvalue,\n\t\tallowed: [\"postgres\", \"mongodb\"]\n\t});\n\treturn mapped;\n}\nfunction resolveAuthoring(value) {\n\tif (value === void 0) return void 0;\n\tconst mapped = AUTHORING_VALUES.get(value.toLowerCase());\n\tif (mapped === void 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"authoring\",\n\t\tvalue,\n\t\tallowed: [\"psl\", \"typescript\"]\n\t});\n\treturn mapped;\n}\n/**\n* Validates `--schema-path` against the chosen `--authoring` style: PSL\n* authoring requires a `.prisma` file and TypeScript authoring requires a\n* `.ts` file. Mismatched combinations would silently scaffold PSL content\n* into a `.ts` file (or vice versa); this validator surfaces the mistake\n* as a precondition error naming both flags.\n*/\nfunction validateSchemaPath(value, authoring) {\n\tconst trimmed = value.trim();\n\tif (trimmed.length === 0) throw errorInitInvalidFlagValue({\n\t\tflag: \"schema-path\",\n\t\tvalue,\n\t\tallowed: [\"<non-empty file path with .prisma or .ts extension>\"]\n\t});\n\tif (trimmed.endsWith(\"/\") || trimmed.endsWith(\"\\\\\")) throw errorInitInvalidFlagValue({\n\t\tflag: \"schema-path\",\n\t\tvalue,\n\t\tallowed: [\"<file path, not a directory>\"]\n\t});\n\tconst ext = extname(trimmed).toLowerCase();\n\tconst expected = authoring === \"typescript\" ? \".ts\" : \".prisma\";\n\tif (ext !== expected) throw errorInitAuthoringSchemaPathMismatch({\n\t\tauthoring,\n\t\tschemaPath: trimmed,\n\t\tactualExtension: ext.length > 0 ? ext : \"(none)\",\n\t\texpectedExtension: expected\n\t});\n\treturn normalize(trimmed);\n}\n//#endregion\n//#region src/commands/init/detect-package-manager.ts\nconst KNOWN = /* @__PURE__ */ new Set([\n\t\"pnpm\",\n\t\"npm\",\n\t\"yarn\",\n\t\"bun\",\n\t\"deno\"\n]);\nfunction isPackageManager(name) {\n\treturn KNOWN.has(name);\n}\n/**\n* Resolves the package manager `init` should drive for `add` / `install`\n* commands. Tries, in order:\n*\n* 1. **`detect()`** — walks up from `cwd` looking for a lockfile, the\n* `packageManager` field, the `devEngines.packageManager` field, or\n* install metadata. This is the right answer whenever the user is\n* anywhere inside an existing project, including a deep workspace\n* subdirectory.\n*\n* 2. **`getUserAgent()`** — parses `npm_config_user_agent`, the env var\n* every PM sets when it spawns a script. This catches the\n* bare-directory case where there's no project to walk up to but the\n* user invoked us via `pnpm dlx prisma-next init` / `bunx\n* prisma-next init` / `yarn dlx …`. Same signal used by every\n* `create-*` tool in the ecosystem (`create-vite`, `create-next-app`,\n* `create-astro`, `@antfu/ni`, …).\n*\n* 3. **`npm`** — final fallback. Always present alongside Node.\n*/\nasync function detectPackageManager(cwd) {\n\tconst detected = await detect({ cwd });\n\tif (detected && isPackageManager(detected.name)) return detected.name;\n\tconst userAgent = getUserAgent();\n\tif (userAgent !== null && isPackageManager(userAgent)) return userAgent;\n\treturn \"npm\";\n}\nfunction hasProjectManifest(cwd) {\n\treturn existsSync(join(cwd, \"package.json\")) || existsSync(join(cwd, \"deno.json\")) || existsSync(join(cwd, \"deno.jsonc\"));\n}\nfunction formatRunCommand(pm, bin, args) {\n\tif (pm === \"npm\") return `npx ${bin} ${args}`;\n\tif (pm === \"deno\") return `deno run npm:${bin} ${args}`;\n\treturn `${pm} ${bin} ${args}`;\n}\nfunction formatRunScriptCommand(pm, scriptName) {\n\tswitch (pm) {\n\t\tcase \"deno\": return `deno task ${scriptName}`;\n\t\tcase \"bun\": return `bun run ${scriptName}`;\n\t\tcase \"pnpm\": return `pnpm run ${scriptName}`;\n\t\tcase \"yarn\": return `yarn run ${scriptName}`;\n\t\tdefault: return `npm run ${scriptName}`;\n\t}\n}\nfunction formatAddArgs(pm, packages) {\n\tif (pm === \"deno\") return [\"add\", ...packages.map((p) => `npm:${p}`)];\n\treturn [\"add\", ...packages];\n}\nfunction formatAddDevArgs(pm, packages) {\n\tif (pm === \"deno\") return [\n\t\t\"add\",\n\t\t\"--dev\",\n\t\t...packages.map((p) => `npm:${p}`)\n\t];\n\treturn [\n\t\t\"add\",\n\t\t\"-D\",\n\t\t...packages\n\t];\n}\n//#endregion\n//#region src/commands/init/hygiene-gitattributes.ts\n/**\n* The `.gitattributes` entries written for a freshly initialised project\n* (FR3.4). Mirrors the relevant subset of the repo-root\n* [`.gitattributes`](../../../../../../../../.gitattributes):\n*\n* - **Today**: `contract.json`, `contract.d.ts` are emitted on every\n* `prisma-next contract emit`. Marking them `linguist-generated`\n* keeps GitHub's diff stats honest and collapses the file in code\n* review by default.\n* - **Forward-looking**: `ops.json`, `migration.json` are not yet emitted\n* by `init` flows but will be produced by adjacent commands (lower /\n* migration tooling). Adding them now matches Decision 5\n* (forward-looking subset) so the file does not need to be amended\n* every time a new artifact lands.\n*\n* `ARTIFACT_FILENAMES` entries are written relative to the schema\n* directory so a user who runs `init --schema-path db/contract.prisma`\n* gets `db/contract.json linguist-generated` — not the workspace-glob\n* form `<glob>/contract.json` (which would over-match any unrelated\n* `contract.json` the user has elsewhere) and not the absolute\n* `DEFAULT_CONTRACT_SOURCE_DIR/contract.json` (which would silently\n* break for a non-default schema path).\n*\n* The migration contract snapshot store (`migrations/snapshots/<hex>/`)\n* is anchored to the migrations root instead, not the schema directory:\n* migration package depth under `migrations/` varies (`app/<pkg>`,\n* `<space>/<pkg>`, or a bare `<pkg>` in extension source repos), so no\n* single schema-dir-relative pattern can reach every snapshot. See\n* `STORE_GITATTRIBUTES_LINES` below.\n*/\nconst ARTIFACT_FILENAMES$1 = [\n\t\"contract.json\",\n\t\"contract.d.ts\",\n\t\"ops.json\",\n\t\"migration.json\"\n];\nconst ATTRIBUTE = \"linguist-generated\";\n/**\n* Full `.gitattributes` lines for the migration contract snapshot store,\n* already anchored to the migrations root — unlike `ARTIFACT_FILENAMES`,\n* these are not combined with the schema-relative prefix.\n*/\nconst STORE_GITATTRIBUTES_LINES = [`migrations/snapshots/**/contract.json ${ATTRIBUTE}`, `migrations/snapshots/**/contract.d.ts ${ATTRIBUTE}`];\n/**\n* Computes the `.gitattributes` lines this scaffold expects to own. Each\n* line has the shape `<path> linguist-generated`. The `target` parameter\n* is currently unused but accepted for symmetry with the other hygiene\n* helpers and to leave room for target-specific entries (e.g. a future\n* family-specific artifact) without a signature break.\n*/\nfunction requiredGitattributesLines(schemaDir, _target) {\n\tconst dir = schemaDir === \".\" ? \"\" : schemaDir.replace(/\\/+$/, \"\");\n\tconst prefix = dir === \"\" ? \"\" : `${dir}/`;\n\treturn [...ARTIFACT_FILENAMES$1.map((file) => `${prefix}${file} ${ATTRIBUTE}`), ...STORE_GITATTRIBUTES_LINES];\n}\n/**\n* Idempotent `.gitattributes` merge (FR3.4 / FR9.3). Returns the new file\n* content given the existing content (or `undefined` if the file does\n* not yet exist).\n*\n* Equivalence is exact-line: a user-customised line like\n* `prisma/*.json linguist-generated` is *not* recognised as covering\n* `DEFAULT_CONTRACT_SOURCE_DIR/contract.json linguist-generated`. We accept that\n* over-specification — preserving the user's broad pattern *and*\n* appending the narrow one — because the narrow lines are what the\n* acceptance criteria pin (FR3.4 AC).\n*\n* Returns `null` when no changes are required (file already contains\n* every required entry).\n*/\nfunction mergeGitattributes(existing, required) {\n\tif (existing === void 0) return `${required.join(\"\\n\")}\\n`;\n\tconst presentLines = new Set(existing.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith(\"#\")));\n\tconst missing = required.filter((line) => !presentLines.has(line));\n\tif (missing.length === 0) return null;\n\treturn `${existing}${existing.length === 0 || existing.endsWith(\"\\n\") ? \"\" : \"\\n\"}${missing.join(\"\\n\")}\\n`;\n}\n//#endregion\n//#region src/commands/init/hygiene-gitignore.ts\n/**\n* The minimal `.gitignore` lines a Prisma Next scaffold needs (FR3.3).\n* Order matches what Node tooling typically writes today.\n*\n* `node_modules/` first because it's the byte-largest miss; `dist/`\n* because the scaffolded `tsconfig.json` writes there; `.env` last so\n* the secret-bearing file is the one most-recently visible in any diff\n* (a paranoid-correct ordering — humans skim from the top).\n*/\nconst REQUIRED_GITIGNORE_ENTRIES = [\n\t\"node_modules/\",\n\t\"dist/\",\n\t\".env\"\n];\n/**\n* Idempotent `.gitignore` merge (FR3.3 / FR9.3). Returns the new file\n* content given the existing content (or `undefined` if the file does\n* not yet exist). Adds only entries that are not already present and\n* never duplicates a line. Existing comments and blank lines are\n* preserved verbatim — `.gitignore` is parsed by `git` without a tree,\n* so any line modification risks changing semantics.\n*\n* Pattern equivalence is line-literal: `node_modules/` and `node_modules`\n* are treated as different entries. This is intentional — `git` treats\n* them differently (the trailing slash restricts the match to\n* directories), and the AC pins the trailing-slash form.\n*\n* Returns `null` when no changes are required (file already contains\n* every required entry). The caller can use this to decide whether to\n* include `.gitignore` in `filesWritten`.\n*/\nfunction mergeGitignore(existing) {\n\tif (existing === void 0) return `${REQUIRED_GITIGNORE_ENTRIES.join(\"\\n\")}\\n`;\n\tconst present = new Set(existing.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith(\"#\")));\n\tconst missing = REQUIRED_GITIGNORE_ENTRIES.filter((entry) => !present.has(entry));\n\tif (missing.length === 0) return null;\n\treturn `${existing}${existing.length === 0 || existing.endsWith(\"\\n\") ? \"\" : \"\\n\"}${missing.join(\"\\n\")}\\n`;\n}\n//#endregion\n//#region src/commands/init/hygiene-package-scripts.ts\nconst REQUIRED_SCRIPTS = [{\n\tname: \"contract:emit\",\n\tcommand: \"prisma-next contract emit\"\n}];\n/**\n* Idempotent `package.json#scripts` merge with collision detection\n* (FR3.5 / FR9.3):\n*\n* - If a required script is **missing**, append it.\n* - If a required script is **already present and identical**, leave\n* the file alone (idempotency).\n* - If a required script is **present but maps to a different command**,\n* skip the write for that script and surface a structured warning.\n* The user's override is sacred — `init` should never silently\n* overwrite a custom build pipeline.\n*\n* Preserves the existing key order (so a user who has alphabetised\n* their scripts does not see them reshuffled) and appends new entries\n* at the end.\n*\n* The `package.json` is parsed and re-stringified through `JSON` —\n* comments are not preserved (package.json does not support them per\n* spec). Trailing newline matches the original input's trailing\n* newline behaviour.\n*/\nfunction mergePackageScripts(existing, required = REQUIRED_SCRIPTS) {\n\tconst parsed = blindCast(JSON.parse(existing));\n\tconst scripts = typeof parsed[\"scripts\"] === \"object\" && parsed[\"scripts\"] !== null ? { ...blindCast(parsed[\"scripts\"]) } : {};\n\tconst warnings = [];\n\tlet mutated = false;\n\tfor (const { name, command } of required) {\n\t\tconst existingValue = scripts[name];\n\t\tif (existingValue === void 0) {\n\t\t\tscripts[name] = command;\n\t\t\tmutated = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (existingValue !== command) warnings.push(`package.json already has a \"${name}\" script with a different command — keeping yours.\\n existing: ${existingValue}\\n expected: ${command}\\nIf you want the default, remove your \"${name}\" script and re-run \\`init\\`.`);\n\t}\n\tif (!mutated) return {\n\t\tcontent: null,\n\t\twarnings\n\t};\n\tparsed[\"scripts\"] = scripts;\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn {\n\t\tcontent: `${JSON.stringify(parsed, null, 2)}${trailingNewline}`,\n\t\twarnings\n\t};\n}\n/**\n* Idempotently sets `\"type\": \"module\"` on a `package.json` so the\n* scaffolded `prisma/db.ts` — which uses the ESM-only `with { type: 'json' }`\n* import attribute — loads as ES module under Node's loader (TML-2494).\n*\n* Without this field Node either:\n*\n* - emits `MODULE_TYPELESS_PACKAGE_JSON` and reparses the file as ESM\n* with a perf penalty (Node 22+ with `--experimental-strip-types`), or\n* - hard-fails with `ERR_*` because the CJS loader cannot parse the\n* import-attribute syntax (older Node, or any tool that doesn't\n* reparse).\n*\n* Behaviour:\n*\n* - **Field missing** → set to `\"module\"`. New entry is inserted right\n* after `\"name\"` (when present) so the diff lands in a conventional\n* spot for human review; falls through to the natural append position\n* otherwise.\n* - **Field already `\"module\"`** → no-op (idempotent).\n* - **Field set to anything else** (e.g. `\"commonjs\"`) → leave it alone\n* and surface a structured warning. The user explicitly opted out of\n* ESM and we don't silently overwrite that.\n*/\nfunction ensureEsmModuleType(existing) {\n\tconst parsed = blindCast(JSON.parse(existing));\n\tconst currentType = parsed[\"type\"];\n\tif (currentType === \"module\") return {\n\t\tcontent: null,\n\t\twarning: null\n\t};\n\tif (typeof currentType === \"string\" && currentType !== \"module\") return {\n\t\tcontent: null,\n\t\twarning: `package.json declares \"type\": \"${currentType}\" — keeping yours, but the scaffolded prisma/db.ts uses an ESM-only import attribute (\\`with { type: 'json' }\\`) and will not load under that module type.\\nIf you want the default, set \"type\": \"module\" in package.json.`\n\t};\n\tconst next = {};\n\tlet inserted = false;\n\tfor (const [key, value] of Object.entries(parsed)) {\n\t\tif (key === \"type\") continue;\n\t\tnext[key] = value;\n\t\tif (!inserted && key === \"name\") {\n\t\t\tnext[\"type\"] = \"module\";\n\t\t\tinserted = true;\n\t\t}\n\t}\n\tif (!inserted) next[\"type\"] = \"module\";\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn {\n\t\tcontent: `${JSON.stringify(next, null, 2)}${trailingNewline}`,\n\t\twarning: null\n\t};\n}\n//#endregion\n//#region src/commands/init/reinit-cleanup.ts\n/**\n* Filenames the contract pipeline emits next to the user's schema source\n* (`<schemaDir>/contract.json`, `<schemaDir>/contract.d.ts`, …). Mirrors\n* the schema-dir-relative `ARTIFACT_FILENAMES` in `hygiene-gitattributes.ts`\n* (not that file's migrations-root-anchored store lines, which are outside\n* this command's scope — reinit only ever touches `schemaDir`); kept as a\n* separate constant here because the cleanup contract is target-agnostic\n* and we deliberately do not want a stale artifact from a previous target\n* lingering after a re-init.\n*\n* If a future emit pipeline produces an additional schema-dir artifact,\n* add it here **and** to `ARTIFACT_FILENAMES` in `hygiene-gitattributes.ts`\n* — the two stay in lockstep so the file `init` advertises as\n* `linguist-generated` is exactly the file `init` is willing to delete on\n* re-init.\n*/\nconst ARTIFACT_FILENAMES = [\n\t\"contract.json\",\n\t\"contract.d.ts\",\n\t\"ops.json\",\n\t\"migration.json\"\n];\n/**\n* Returns the schema-relative paths of stale contract artifacts the\n* previous `init` run (or a `contract emit`) left behind in `schemaDir`.\n* Paths are returned relative to `baseDir` so the caller can plumb them\n* into `filesWritten`-style logging without re-deriving the path.\n*\n* Pure function: no filesystem mutation. Used by `runInit`'s precondition\n* phase (FR6.2 / NFR3 atomicity) so a downstream parse failure leaves\n* the artifacts on disk and the project byte-identical to its pre-init\n* state.\n*/\nfunction findStaleArtifacts(baseDir, schemaDir) {\n\tconst result = [];\n\tfor (const filename of ARTIFACT_FILENAMES) {\n\t\tconst rel = join(schemaDir, filename);\n\t\tif (existsSync(join(baseDir, rel))) result.push(rel);\n\t}\n\treturn result;\n}\n/**\n* Drops a single key from `package.json#dependencies`, returning the new\n* file content. Returns `null` when the dependency was already absent —\n* the caller can skip the write to keep re-init idempotent (FR9.3).\n*\n* Used by `runInit` for the FR9.2 target-switch path: when the user\n* re-inits a project from `--target postgres` to `--target mongodb` (or\n* vice versa), the previous facade is removed from `dependencies` so the\n* resulting project depends only on the chosen target's facade.\n*\n* Devs/peers/optional dep groups are intentionally *not* touched — the\n* facades are only ever in `dependencies` (FR4 / FR7), and broadening\n* the search would risk clobbering an unrelated dep with the same name\n* in `peerDependencies`.\n*\n* Throws `SyntaxError` if `existing` is not parseable as JSON; the\n* caller (`runInit`) already guards on that with a structured 5010\n* error before this helper is reached.\n*/\nfunction removeDependency(existing, depName) {\n\tconst parsed = JSON.parse(existing);\n\tconst deps = parsed[\"dependencies\"];\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return null;\n\tif (!Object.hasOwn(deps, depName)) return null;\n\tconst next = { ...deps };\n\tdelete next[depName];\n\tparsed[\"dependencies\"] = next;\n\tconst trailingNewline = existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n\treturn `${JSON.stringify(parsed, null, 2)}${trailingNewline}`;\n}\n//#endregion\n//#region src/commands/init/templates/render.ts\nfunction renderTemplate(templateFile, variableNames, vars) {\n\tlet result = readFileSync(join(import.meta.dirname, templateFile), \"utf-8\");\n\tfor (const key of variableNames) {\n\t\tconst value = vars[key];\n\t\tif (value === void 0) throw new InternalError(`Template variable '${key}' is not defined`);\n\t\tresult = result.replaceAll(`{{${key}}}`, value);\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/commands/init/templates/quick-reference.ts\nconst variables = [\n\t\"schemaPath\",\n\t\"schemaDir\",\n\t\"dbImportPath\",\n\t\"pkgRun\",\n\t\"pkg\",\n\t\"configEntrypoint\",\n\t\"schemaSample\",\n\t\"requirements\"\n];\nfunction quickReferenceMd(target, authoring, schemaPath, pkgRun, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst schemaDir = dirname(schemaPath);\n\tconst pkg = targetPackageName(target, resolveImportSpecifier);\n\tconst vars = {\n\t\tschemaPath,\n\t\tschemaDir,\n\t\tdbImportPath: `./${schemaDir}/db`,\n\t\tpkgRun,\n\t\tpkg,\n\t\tconfigEntrypoint: targetEntrypoint(target, \"config\", resolveImportSpecifier),\n\t\tschemaSample: schemaSample(target, authoring, resolveImportSpecifier),\n\t\trequirements: requirementsBlock(target)\n\t};\n\treturn renderTemplate(`quick-reference-${target}.md`, variables, vars);\n}\n/**\n* Renders the FR8.2 \"Requirements\" block injected into `prisma-next.md`\n* (the user-facing quick reference). Sources the minimum server\n* version from `MIN_SERVER_VERSION` — itself mirrored from each\n* target package's `package.json#prismaNext.minServerVersion`\n* (FR8.1).\n*\n* The verification command is target-specific — Postgres scaffolds\n* shouldn't ship Mongo's `db.runCommand` (and vice versa) just because\n* we couldn't be bothered to branch.\n*/\nfunction requirementsBlock(target) {\n\treturn [\n\t\t\"## Requirements\",\n\t\t\"\",\n\t\t`- **${TARGET_LABEL[target]} ${MIN_SERVER_VERSION[target]} or newer.** Older servers are not supported. Run ${target === \"postgres\" ? \"`SELECT version()`\" : \"`db.runCommand({ buildInfo: 1 })`\"} against your server to verify.`,\n\t\t\"- The CLI never connects to your database without explicit consent. Pass `--probe-db` to `prisma-next init` if you want `init` to verify the server version itself.\"\n\t].join(\"\\n\");\n}\n//#endregion\n//#region src/commands/init/templates/readme.ts\nconst sharedVariables = [\n\t\"projectName\",\n\t\"contractPath\",\n\t\"runDev\",\n\t\"runContractEmit\"\n];\nconst postgresVariables = [\n\t...sharedVariables,\n\t\"runDbInit\",\n\t\"runDbUpdate\",\n\t\"runMigrationPlan\",\n\t\"runMigrate\",\n\t\"runDbSeed\"\n];\nconst mongoVariables = [\n\t...sharedVariables,\n\t\"runDbUp\",\n\t\"runDbDown\",\n\t\"runDbReset\",\n\t\"runMigrationPlan\",\n\t\"runMigrate\",\n\t\"runDbSeed\"\n];\nfunction minimalProjectReadmeMd(target, schemaPath, projectName, pm) {\n\tconst run = (script) => formatRunScriptCommand(pm, script);\n\tconst shared = {\n\t\tprojectName,\n\t\tcontractPath: schemaPath,\n\t\trunDev: run(\"dev\"),\n\t\trunContractEmit: run(\"contract:emit\"),\n\t\trunMigrationPlan: run(\"migration:plan\"),\n\t\trunMigrate: run(\"migrate\"),\n\t\trunDbSeed: run(\"db:seed\")\n\t};\n\tif (target === \"mongo\") {\n\t\tconst vars = {\n\t\t\t...shared,\n\t\t\trunDbUp: run(\"db:up\"),\n\t\t\trunDbDown: run(\"db:down\"),\n\t\t\trunDbReset: run(\"db:reset\")\n\t\t};\n\t\treturn renderTemplate(\"readme-mongo.md\", mongoVariables, vars);\n\t}\n\tconst vars = {\n\t\t...shared,\n\t\trunDbInit: run(\"db:init\"),\n\t\trunDbUpdate: run(\"db:update\")\n\t};\n\treturn renderTemplate(\"readme-postgres.md\", postgresVariables, vars);\n}\n//#endregion\n//#region src/commands/init/templates/tsconfig.ts\n/**\n* Compiler options the scaffolded `prisma-next.config.ts` and `db.ts` need\n* to typecheck:\n*\n* - `module: 'preserve'` + `moduleResolution: 'bundler'` align with how\n* modern bundlers (and `tsdown`) consume our facade packages.\n* - `resolveJsonModule` lets `db.ts` import `contract.json with { type:\n* 'json' }` — the runtime path the facades document (FR4).\n*\n* `types: ['node']` is FR2.2 territory and lives in\n* `REQUIRED_COMPILER_OPTIONS_TYPES` because TS only honours an _array_\n* here, and a string-keyed merge would clobber any user-specified entries.\n* Merge handling preserves any extra `types` the user added.\n*/\nconst REQUIRED_COMPILER_OPTIONS = {\n\tmodule: \"preserve\",\n\tmoduleResolution: \"bundler\",\n\tresolveJsonModule: true\n};\n/**\n* Types that must be present in `compilerOptions.types` for the scaffold\n* to typecheck. With `moduleResolution: 'bundler'`, TypeScript does not\n* implicitly include all `@types/*` packages — `process.env` only resolves\n* when `node` is in this array (or `types` is omitted, but then any other\n* type listed here would force the same behaviour). Listing `node`\n* explicitly is the documented escape hatch (FR2.2).\n*/\nconst REQUIRED_COMPILER_OPTIONS_TYPES = [\"node\"];\nfunction defaultTsConfig() {\n\treturn JSON.stringify({\n\t\tcompilerOptions: {\n\t\t\ttarget: \"ES2022\",\n\t\t\t...REQUIRED_COMPILER_OPTIONS,\n\t\t\ttypes: [...REQUIRED_COMPILER_OPTIONS_TYPES],\n\t\t\tstrict: true,\n\t\t\tskipLibCheck: true,\n\t\t\tesModuleInterop: true,\n\t\t\toutDir: \"dist\"\n\t\t},\n\t\tinclude: [\"**/*.ts\"]\n\t}, null, 2);\n}\n/**\n* Thrown by `mergeTsConfig` when the user's existing `tsconfig.json` is\n* not parseable as JSONC (TypeScript's actual configured dialect — see\n* FR6.1). Carries the raw parse errors so the caller can render an\n* actionable, location-aware message.\n*\n* `runInit` catches this exception during the precondition phase and\n* maps it to a `CliStructuredError(5011)` so the user's working tree\n* stays byte-identical when init bails (FR6.2 / NFR3).\n*/\nvar TsConfigParseError = class extends Error {\n\terrors;\n\tconstructor(errors) {\n\t\tsuper(formatTsConfigParseErrors(errors));\n\t\tthis.errors = errors;\n\t\tthis.name = \"TsConfigParseError\";\n\t}\n};\nfunction formatTsConfigParseErrors(errors) {\n\tif (errors.length === 0) return \"tsconfig.json is empty or not an object\";\n\treturn errors.map((e) => `${printParseErrorCode(e.error)} at offset ${e.offset}`).join(\"; \");\n}\n/**\n* Merges the required compiler options into an existing `tsconfig.json`.\n*\n* Parsing is delegated to `jsonc-parser` so JSONC inputs (comments,\n* trailing commas) — TypeScript's real configuration dialect — survive\n* unchanged: edits are applied as text patches via `modify` /\n* `applyEdits`, preserving the user's formatting, key ordering, and\n* comments wherever the touched paths permit (FR6.1, AC \"Hostile\n* inputs\").\n*\n* Throws `TsConfigParseError` when the input is not parseable as JSONC.\n* The caller must catch this and surface a structured error before\n* writing any scaffold files (FR6.2 atomicity).\n*/\nfunction mergeTsConfig(existing) {\n\tconst { config } = parseTsConfigText(existing);\n\tconst formattingOptions = {\n\t\ttabSize: detectIndent(existing),\n\t\tinsertSpaces: true,\n\t\teol: existing.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\"\n\t};\n\tlet result = existing;\n\tfor (const [key, value] of Object.entries(REQUIRED_COMPILER_OPTIONS)) {\n\t\tconst edits = modify(result, [\"compilerOptions\", key], value, { formattingOptions });\n\t\tresult = applyEdits(result, edits);\n\t}\n\tconst existingTypes = config[\"compilerOptions\"]?.[\"types\"];\n\tconst mergedTypes = mergeTypesArray(existingTypes);\n\tconst typesEdits = modify(result, [\"compilerOptions\", \"types\"], mergedTypes, { formattingOptions });\n\tresult = applyEdits(result, typesEdits);\n\treturn result;\n}\n/**\n* Parses an existing `tsconfig.json` (JSONC) and returns the structured\n* config alongside any non-fatal parse warnings. Throws\n* `TsConfigParseError` if the input cannot be parsed at all or does\n* not resolve to a JSON object — both cases mean we cannot safely\n* apply edits.\n*\n* Exposed independently so callers (notably `runInit`'s precondition\n* gate) can validate the file *before* any scaffold file is written.\n*/\nfunction parseTsConfigText(text) {\n\tconst errors = [];\n\tconst value = parse(text, errors, {\n\t\tallowTrailingComma: true,\n\t\tdisallowComments: false,\n\t\tallowEmptyContent: false\n\t});\n\tif (value === void 0 || value === null || typeof value !== \"object\" || Array.isArray(value)) throw new TsConfigParseError(errors);\n\tif (errors.length > 0) throw new TsConfigParseError(errors);\n\treturn { config: value };\n}\nfunction detectIndent(text) {\n\tconst match = text.match(/^([ \\t]+)\\S/m);\n\tif (match === null) return 2;\n\tconst indent = match[1] ?? \"\";\n\tif (indent.startsWith(\"\t\")) return 1;\n\treturn indent.length || 2;\n}\n/**\n* Merges `REQUIRED_COMPILER_OPTIONS_TYPES` into the user's existing\n* `compilerOptions.types` array. Preserves order and dedupes. If the\n* user has no `types` array (or has set it to a non-array), we replace\n* with the required minimum — overwriting a non-array `types` is the\n* correct fix because anything other than a string array is invalid TS\n* config.\n*/\nfunction mergeTypesArray(existing) {\n\tconst result = [];\n\tif (Array.isArray(existing)) {\n\t\tfor (const item of existing) if (typeof item === \"string\" && !result.includes(item)) result.push(item);\n\t}\n\tfor (const required of REQUIRED_COMPILER_OPTIONS_TYPES) if (!result.includes(required)) result.push(required);\n\treturn result;\n}\n//#endregion\n//#region src/commands/init/pnpm-fallback.ts\n/**\n* Recognised pnpm error signatures that justify a fallback to npm.\n*\n* These patterns indicate the published artifact itself is at fault\n* (a leaked `workspace:*` or `catalog:` specifier), not the user's\n* environment — pnpm is faithfully reporting \"I cannot resolve this\n* registry version\", and npm is willing to install it because npm\n* doesn't care about the protocol prefix when there's a fallback range.\n*\n* The predicate lives on its own so both shells' `init` share one list:\n* the commander command matches it against captured child stderr, the\n* engine command against the stderr the package-manager capability\n* returns on a failed install.\n*/\nfunction isRecognisedPnpmResolutionError(stderr) {\n\tif (!stderr) return false;\n\treturn stderr.includes(\"ERR_PNPM_WORKSPACE_PKG_NOT_FOUND\") || stderr.includes(\"ERR_PNPM_NO_MATCHING_VERSION\") || /No matching version found for .* in the catalog/i.test(stderr) || /workspace:[^\\s]+ is not a valid (version|spec)/i.test(stderr) || /catalog:[^\\s]* is not a valid (version|spec)/i.test(stderr);\n}\n//#endregion\n//#region src/commands/init/redact-secrets.ts\n/**\n* Strips credentials out of package-manager stderr before it reaches a warning,\n* an error's meta, or a log. Two shapes carry them: userinfo inside a registry\n* URL (`https://user:token@registry…`), and the npmrc settings npm and pnpm\n* echo back when authentication fails (`//registry.npmjs.org/:_authToken=…`,\n* or the top-level `_authToken=…` with no registry scope), which are not\n* URL-shaped and survive a userinfo-only pass.\n*\n* Both shells' `init` call this, and both call it on stderr they already\n* received from somewhere else: redaction is cheap and doubling it is harmless,\n* while trusting another layer to have done it is not.\n*/\nfunction redactSecrets(stderr) {\n\treturn stderr.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/)([^/@\\s]+)@/g, \"$1***@\").replace(/(\\b_(?:authToken|auth|password)=)\\S+/gi, \"$1***\");\n}\n//#endregion\nexport { formatSkillSourceUrl as A, errorInitReinitNeedsForce as B, validateSchemaPath as C, DEFAULT_SKILL_AGENTS as D, envFileContent as E, errorInitInstallFailed as F, buildCatalogWarnings as G, errorInitStrictProbeWithoutProbe as H, errorInitInvalidManifest as I, errorInitInvalidTsconfig as L, resolveProjectSkillInstallCommands as M, probeServerVersion as N, DEFAULT_SKILL_SOURCES as O, errorInitEmitFailed as P, errorInitMissingFlags as R, resolveTarget as S, envExampleContent as T, errorInitUserAborted as U, errorInitSkillInstallFailed as V, errorInitWriteFailed as W, formatAddArgs as _, mergeTsConfig as a, hasProjectManifest as b, findStaleArtifacts as c, ensureEsmModuleType as d, mergePackageScripts as f, detectPackageManager as g, requiredGitattributesLines as h, defaultTsConfig as i, legacySkillDirs as j, formatSkillInstallCommand as k, removeDependency as l, mergeGitattributes as m, isRecognisedPnpmResolutionError as n, minimalProjectReadmeMd as o, mergeGitignore as p, TsConfigParseError as r, quickReferenceMd as s, redactSecrets as t, REQUIRED_SCRIPTS as u, formatAddDevArgs as v, MIN_SERVER_VERSION as w, resolveAuthoring as x, formatRunCommand as y, errorInitProbeFailed as z };\n\n//# sourceMappingURL=redact-secrets-ojVi2cpy.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,2BAA2B,SAAS,UAAU;CACtD,MAAM,gBAAgB,6BAA6B,OAAO;CAC1D,IAAI,kBAAkB,MAAM,OAAO;CACnC,MAAM,UAAU,oBAAoB,aAAa,eAAe,OAAO,CAAC;CACxE,IAAI,YAAY,MAAM,OAAO;EAC5B;EACA,SAAS,CAAC;CACX;CACA,MAAM,SAAS,IAAI,IAAI,QAAQ;CAC/B,MAAM,UAAU,CAAC;CACjB,KAAK,MAAM,CAAC,MAAM,YAAY,SAAS,IAAI,OAAO,IAAI,IAAI,GAAG,QAAQ,KAAK;EACzE;EACA;CACD,CAAC;CACD,OAAO;EACN;EACA;CACD;AACD;AACA,SAAS,6BAA6B,SAAS;CAC9C,IAAI,MAAM;CACV,IAAI,OAAO;CACX,OAAO,QAAQ,MAAM;EACpB,MAAM,YAAY,KAAK,KAAK,qBAAqB;EACjD,IAAI,WAAW,SAAS,GAAG,OAAO;EAClC,OAAO;EACP,MAAM,QAAQ,GAAG;CAClB;CACA,OAAO;AACR;;;;;;;;;;;AAWA,SAAS,oBAAoB,UAAU;CACtC,MAAM,QAAQ,SAAS,MAAM,OAAO;CACpC,MAAM,WAAW,MAAM,WAAW,SAAS,mBAAmB,KAAK,IAAI,CAAC;CACxE,IAAI,aAAa,IAAI,OAAO;CAC5B,MAAM,UAAU,CAAC;CACjB,KAAK,IAAI,IAAI,WAAW,GAAG,IAAI,MAAM,QAAQ,KAAK;EACjD,MAAM,MAAM,MAAM,MAAM;EACxB,IAAI,IAA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apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@clack/prompts": "^1.7.0",
|
|
16
16
|
"@prisma/cli-engine": "0.0.9",
|
|
17
|
-
"@prisma/orm-framework": "8.0.0-rc.1-dev.
|
|
17
|
+
"@prisma/orm-framework": "8.0.0-rc.1-dev.44",
|
|
18
18
|
"@vercel/detect-agent": "^1.2.4",
|
|
19
19
|
"arktype": "^2.2.2",
|
|
20
20
|
"c12": "^3.3.4",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"wrap-ansi": "^10.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@internal/cli": "8.0.0-rc.1-dev.
|
|
39
|
-
"@internal/cli-telemetry": "8.0.0-rc.1-dev.
|
|
40
|
-
"@internal/config-loader": "8.0.0-rc.1-dev.
|
|
41
|
-
"@internal/emitter": "8.0.0-rc.1-dev.
|
|
42
|
-
"@internal/language-server": "8.0.0-rc.1-dev.
|
|
43
|
-
"@internal/migration-tools": "8.0.0-rc.1-dev.
|
|
44
|
-
"@internal/publish-surface": "8.0.0-rc.1-dev.
|
|
45
|
-
"@repo/tsconfig": "8.0.0-rc.1-dev.
|
|
46
|
-
"@repo/tsdown": "8.0.0-rc.1-dev.
|
|
47
|
-
"@internal/vite-plugin-contract-emit": "8.0.0-rc.1-dev.
|
|
38
|
+
"@internal/cli": "8.0.0-rc.1-dev.44",
|
|
39
|
+
"@internal/cli-telemetry": "8.0.0-rc.1-dev.44",
|
|
40
|
+
"@internal/config-loader": "8.0.0-rc.1-dev.44",
|
|
41
|
+
"@internal/emitter": "8.0.0-rc.1-dev.44",
|
|
42
|
+
"@internal/language-server": "8.0.0-rc.1-dev.44",
|
|
43
|
+
"@internal/migration-tools": "8.0.0-rc.1-dev.44",
|
|
44
|
+
"@internal/publish-surface": "8.0.0-rc.1-dev.44",
|
|
45
|
+
"@repo/tsconfig": "8.0.0-rc.1-dev.44",
|
|
46
|
+
"@repo/tsdown": "8.0.0-rc.1-dev.44",
|
|
47
|
+
"@internal/vite-plugin-contract-emit": "8.0.0-rc.1-dev.44",
|
|
48
48
|
"tsdown": "0.22.14",
|
|
49
49
|
"typescript": "5.9.3"
|
|
50
50
|
},
|