@dxgjs/generators 0.0.0 → 0.1.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/@antfu+ni@30.5.0/node_modules/@antfu/ni/dist/rolldown-runtime-DPI6AWJA.mjs","../../../node_modules/.pnpm/package-manager-detector@1.8.0/node_modules/package-manager-detector/dist/commands.mjs","../../../node_modules/.pnpm/package-manager-detector@1.8.0/node_modules/package-manager-detector/dist/constants.mjs","../../../node_modules/.pnpm/package-manager-detector@1.8.0/node_modules/package-manager-detector/dist/detect.mjs","../../../node_modules/.pnpm/package-manager-detector@1.8.0/node_modules/package-manager-detector/dist/index.mjs","../../../node_modules/.pnpm/tinyexec@1.3.0/node_modules/tinyexec/dist/main.mjs","../../../node_modules/.pnpm/@antfu+ni@30.5.0/node_modules/@antfu/ni/dist/src-DSImyIFd.mjs","../../../node_modules/.pnpm/@antfu+ni@30.5.0/node_modules/@antfu/ni/dist/index.mjs","../src/generators/database/index.ts","../src/install/installer.ts","../src/install/approvals.ts","../src/install/classify.ts","../src/install/dlx.ts","../src/generators/database/prisma-flow.ts","../src/generators/database/detect-prisma-state.ts","../src/generators/database/inspect.ts","../src/generators/database/drizzle-flow.ts","../src/index.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\n//#region \\0rolldown/runtime.js\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\tkey = keys[i];\n\t\tif (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\tvalue: mod,\n\tenumerable: true\n}) : target, mod));\nvar __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();\n//#endregion\nexport { __toESM as a, __require as i, __exportAll as n, __reExport as r, __commonJSMin as t };\n","function splitRunArgs(args, valueFlags = []) {\n for (let i = 0; i < args.length; i++) {\n if (args[i].startsWith(\"-\"))\n continue;\n if (i > 0 && valueFlags.includes(args[i - 1]))\n continue;\n return { before: args.slice(0, i), script: args[i], after: args.slice(i + 1) };\n }\n return { before: args, script: void 0, after: [] };\n}\nfunction dashDashArg(agent, agentCommand, valueFlags = []) {\n return (args) => {\n const { before, script, after } = splitRunArgs(args, valueFlags);\n if (script === void 0)\n return [agent, agentCommand, ...before];\n if (after.length > 0)\n return [agent, agentCommand, ...before, script, \"--\", ...after];\n return [agent, agentCommand, ...before, script];\n };\n}\nconst npm = {\n \"agent\": [\"npm\", 0],\n \"run\": dashDashArg(\"npm\", \"run\", [\"-w\", \"--workspace\"]),\n \"install\": [\"npm\", \"i\", 0],\n \"frozen\": [\"npm\", \"ci\", 0],\n \"global\": [\"npm\", \"i\", \"-g\", 0],\n \"add\": [\"npm\", \"i\", 0],\n \"upgrade\": [\"npm\", \"update\", 0],\n \"upgrade-interactive\": null,\n \"dedupe\": [\"npm\", \"dedupe\", 0],\n \"execute\": [\"npx\", 0],\n \"execute-local\": [\"npx\", 0],\n \"uninstall\": [\"npm\", \"uninstall\", 0],\n \"global_uninstall\": [\"npm\", \"uninstall\", \"-g\", 0]\n};\nconst yarn = {\n \"agent\": [\"yarn\", 0],\n \"run\": [\"yarn\", \"run\", 0],\n \"install\": [\"yarn\", \"install\", 0],\n \"frozen\": [\"yarn\", \"install\", \"--frozen-lockfile\", 0],\n \"global\": [\"yarn\", \"global\", \"add\", 0],\n \"add\": [\"yarn\", \"add\", 0],\n \"upgrade\": [\"yarn\", \"upgrade\", 0],\n \"upgrade-interactive\": [\"yarn\", \"upgrade-interactive\", 0],\n \"dedupe\": null,\n \"execute\": [\"npx\", 0],\n \"execute-local\": dashDashArg(\"yarn\", \"exec\"),\n \"uninstall\": [\"yarn\", \"remove\", 0],\n \"global_uninstall\": [\"yarn\", \"global\", \"remove\", 0]\n};\nconst yarnBerry = {\n ...yarn,\n \"frozen\": [\"yarn\", \"install\", \"--immutable\", 0],\n \"upgrade\": [\"yarn\", \"up\", 0],\n \"upgrade-interactive\": [\"yarn\", \"up\", \"-i\", 0],\n \"dedupe\": [\"yarn\", \"dedupe\", 0],\n \"execute\": [\"yarn\", \"dlx\", 0],\n \"execute-local\": [\"yarn\", \"exec\", 0],\n // Yarn 2+ removed 'global', see https://github.com/yarnpkg/berry/issues/821\n \"global\": [\"npm\", \"i\", \"-g\", 0],\n \"global_uninstall\": [\"npm\", \"uninstall\", \"-g\", 0]\n};\nfunction createPnpmCommands(cli) {\n return {\n \"agent\": [cli, 0],\n \"run\": [cli, \"run\", 0],\n \"install\": [cli, \"i\", 0],\n \"frozen\": [cli, \"i\", \"--frozen-lockfile\", 0],\n \"global\": [cli, \"add\", \"-g\", 0],\n \"add\": [cli, \"add\", 0],\n \"upgrade\": [cli, \"update\", 0],\n \"upgrade-interactive\": [cli, \"update\", \"-i\", 0],\n \"dedupe\": [cli, \"dedupe\", 0],\n \"execute\": [cli, \"dlx\", 0],\n \"execute-local\": [cli, \"exec\", 0],\n \"uninstall\": [cli, \"remove\", 0],\n \"global_uninstall\": [cli, \"remove\", \"--global\", 0]\n };\n}\nconst pnpm = createPnpmCommands(\"pnpm\");\nconst pnpmRush = createPnpmCommands(\"rush-pnpm\");\nconst bun = {\n \"agent\": [\"bun\", 0],\n \"run\": [\"bun\", \"run\", 0],\n \"install\": [\"bun\", \"install\", 0],\n \"frozen\": [\"bun\", \"install\", \"--frozen-lockfile\", 0],\n \"global\": [\"bun\", \"add\", \"-g\", 0],\n \"add\": [\"bun\", \"add\", 0],\n \"upgrade\": [\"bun\", \"update\", 0],\n \"upgrade-interactive\": [\"bun\", \"update\", \"-i\", 0],\n \"dedupe\": null,\n \"execute\": [\"bun\", \"x\", 0],\n \"execute-local\": [\"bun\", \"x\", 0],\n \"uninstall\": [\"bun\", \"remove\", 0],\n \"global_uninstall\": [\"bun\", \"remove\", \"-g\", 0]\n};\nconst aube = {\n \"agent\": [\"aube\", 0],\n \"run\": [\"aube\", \"run\", 0],\n \"install\": [\"aube\", \"install\", 0],\n \"frozen\": [\"aube\", \"install\", \"--frozen-lockfile\", 0],\n \"global\": [\"aube\", \"add\", \"-g\", 0],\n \"add\": [\"aube\", \"add\", 0],\n \"upgrade\": [\"aube\", \"update\", 0],\n \"upgrade-interactive\": [\"aube\", \"update\", \"-i\", 0],\n \"dedupe\": [\"aube\", \"dedupe\", 0],\n \"execute\": [\"aube\", \"dlx\", 0],\n \"execute-local\": [\"aube\", \"exec\", 0],\n \"uninstall\": [\"aube\", \"remove\", 0],\n \"global_uninstall\": [\"aube\", \"remove\", \"-g\", 0]\n};\nconst deno = {\n \"agent\": [\"deno\", 0],\n \"run\": [\"deno\", \"task\", 0],\n \"install\": [\"deno\", \"install\", 0],\n \"frozen\": [\"deno\", \"install\", \"--frozen\", 0],\n \"global\": [\"deno\", \"install\", \"-g\", 0],\n \"add\": [\"deno\", \"add\", 0],\n \"upgrade\": [\"deno\", \"outdated\", \"--update\", 0],\n \"upgrade-interactive\": [\"deno\", \"outdated\", \"--update\", 0],\n \"dedupe\": null,\n \"execute\": [\"deno\", \"x\", 0],\n \"execute-local\": [\"deno\", \"task\", \"--eval\", 0],\n \"uninstall\": [\"deno\", \"remove\", 0],\n \"global_uninstall\": [\"deno\", \"uninstall\", \"-g\", 0]\n};\nconst nub = {\n \"agent\": [\"nub\", 0],\n \"run\": [\"nub\", \"run\", 0],\n \"install\": [\"nub\", \"install\", 0],\n \"frozen\": [\"nub\", \"install\", \"--frozen-lockfile\", 0],\n \"global\": [\"nub\", \"add\", \"-g\", 0],\n \"add\": [\"nub\", \"add\", 0],\n \"upgrade\": [\"nub\", \"update\", 0],\n \"upgrade-interactive\": [\"nub\", \"update\", \"-i\", 0],\n \"dedupe\": [\"nub\", \"dedupe\", 0],\n \"execute\": [\"nubx\", 0],\n \"execute-local\": [\"nub\", \"exec\", 0],\n \"uninstall\": [\"nub\", \"remove\", 0],\n \"global_uninstall\": [\"nub\", \"remove\", \"-g\", 0]\n};\nconst COMMANDS = {\n \"npm\": npm,\n \"yarn\": yarn,\n \"yarn@berry\": yarnBerry,\n \"pnpm\": pnpm,\n // pnpm v6.x or below\n \"pnpm@6\": {\n ...pnpm,\n run: dashDashArg(\"pnpm\", \"run\", [\"-F\", \"--filter\"])\n },\n \"pnpm-rush\": pnpmRush,\n \"bun\": bun,\n \"aube\": aube,\n \"deno\": deno,\n \"nub\": nub\n};\nfunction resolveCommand(agent, command, args) {\n const value = COMMANDS[agent][command];\n return constructCommand(value, args);\n}\nfunction constructCommand(value, args) {\n if (value == null)\n return null;\n const list = typeof value === \"function\" ? value(args) : value.flatMap((v) => {\n if (typeof v === \"number\")\n return args;\n return [v];\n });\n return {\n command: list[0],\n args: list.slice(1)\n };\n}\n\nexport { COMMANDS, constructCommand, resolveCommand, splitRunArgs };\n","const AGENTS = [\n \"npm\",\n \"yarn\",\n \"yarn@berry\",\n \"pnpm\",\n \"pnpm@6\",\n \"pnpm-rush\",\n \"bun\",\n \"deno\",\n \"nub\",\n \"aube\"\n];\nconst LOCKS = {\n \"aube-lock.yaml\": \"aube\",\n \"aube-workspace.yaml\": \"aube\",\n \"bun.lock\": \"bun\",\n \"bun.lockb\": \"bun\",\n \"deno.lock\": \"deno\",\n \"nub.lock\": \"nub\",\n \"pnpm-lock.yaml\": \"pnpm\",\n \"pnpm-workspace.yaml\": \"pnpm\",\n \"yarn.lock\": \"yarn\",\n \"package-lock.json\": \"npm\",\n \"npm-shrinkwrap.json\": \"npm\"\n};\nconst INSTALL_METADATA = {\n \"node_modules/.aube/\": \"aube\",\n \"node_modules/.deno/\": \"deno\",\n \"node_modules/.pnpm/\": \"pnpm\",\n \"node_modules/.yarn-state.yml\": \"yarn\",\n // yarn v2+ (node-modules)\n \"node_modules/.yarn_integrity\": \"yarn\",\n // yarn v1\n \"node_modules/.package-lock.json\": \"npm\",\n \".pnp.cjs\": \"yarn\",\n // yarn v3+ (pnp)\n \".pnp.js\": \"yarn\",\n // yarn v2 (pnp)\n \"bun.lock\": \"bun\",\n \"bun.lockb\": \"bun\"\n};\nconst INSTALL_PAGE = {\n \"aube\": \"https://aube.en.dev/installation\",\n \"bun\": \"https://bun.sh\",\n \"deno\": \"https://deno.com\",\n \"pnpm\": \"https://pnpm.io/installation\",\n \"pnpm@6\": \"https://pnpm.io/6.x/installation\",\n \"pnpm-rush\": \"https://rushjs.io/pages/intro/get_started/\",\n \"yarn\": \"https://classic.yarnpkg.com/en/docs/install\",\n \"yarn@berry\": \"https://yarnpkg.com/getting-started/install\",\n \"npm\": \"https://docs.npmjs.com/cli/configuring-npm/install\",\n \"nub\": \"https://nubjs.com/docs/install\"\n};\n\nexport { AGENTS, INSTALL_METADATA, INSTALL_PAGE, LOCKS };\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { INSTALL_METADATA, LOCKS, AGENTS } from './constants.mjs';\n\nasync function pathExists(path2, type) {\n try {\n const stat = await fs.stat(path2);\n return type === \"file\" ? stat.isFile() : stat.isDirectory();\n } catch {\n return false;\n }\n}\nfunction getUserAgent() {\n const userAgent = process.env.npm_config_user_agent;\n if (!userAgent) {\n return null;\n }\n const name = userAgent.split(\"/\")[0];\n return AGENTS.includes(name) ? name : null;\n}\nfunction* lookup(cwd = process.cwd()) {\n let directory = path.resolve(cwd);\n const { root } = path.parse(directory);\n while (directory && directory !== root) {\n yield directory;\n directory = path.dirname(directory);\n }\n}\nasync function parsePackageJson(filepath, options) {\n if (!filepath || !await pathExists(filepath, \"file\"))\n return null;\n return await handlePackageManager(filepath, options);\n}\nasync function detect(options = {}) {\n const {\n cwd,\n strategies = [\"lockfile\", \"packageManager-field\", \"devEngines-field\"]\n } = options;\n let stopDir;\n if (typeof options.stopDir === \"string\") {\n const resolved = path.resolve(options.stopDir);\n stopDir = (dir) => dir === resolved;\n } else {\n stopDir = options.stopDir;\n }\n for (const directory of lookup(cwd)) {\n for (const strategy of strategies) {\n switch (strategy) {\n case \"lockfile\": {\n if (await pathExists(path.join(directory, \"rush.json\"), \"file\")) {\n return { name: \"pnpm\", agent: \"pnpm-rush\" };\n }\n for (const lock of Object.keys(LOCKS)) {\n if (await pathExists(path.join(directory, lock), \"file\")) {\n const name = LOCKS[lock];\n const result = await parsePackageJson(path.join(directory, \"package.json\"), options);\n if (result)\n return result;\n else\n return { name, agent: name };\n }\n }\n break;\n }\n case \"packageManager-field\":\n case \"devEngines-field\": {\n const result = await parsePackageJson(path.join(directory, \"package.json\"), options);\n if (result)\n return result;\n break;\n }\n case \"install-metadata\": {\n for (const metadata of Object.keys(INSTALL_METADATA)) {\n const fileOrDir = metadata.endsWith(\"/\") ? \"dir\" : \"file\";\n if (await pathExists(path.join(directory, metadata), fileOrDir)) {\n const name = INSTALL_METADATA[metadata];\n const agent = name === \"yarn\" ? isMetadataYarnClassic(metadata) ? \"yarn\" : \"yarn@berry\" : name;\n return { name, agent };\n }\n }\n break;\n }\n }\n }\n if (stopDir?.(directory))\n break;\n }\n return null;\n}\nfunction getNameAndVer(pkg) {\n const handelVer = (version) => version?.match(/\\d+(\\.\\d+){0,2}/)?.[0] ?? version;\n if (typeof pkg.packageManager === \"string\") {\n const [name, ver] = pkg.packageManager.replace(/^\\^/, \"\").split(\"@\");\n return { name, ver: handelVer(ver) };\n }\n if (typeof pkg.devEngines?.packageManager?.name === \"string\") {\n return {\n name: pkg.devEngines.packageManager.name,\n ver: handelVer(pkg.devEngines.packageManager.version)\n };\n }\n return void 0;\n}\nasync function handlePackageManager(filepath, options) {\n try {\n const content = await fs.readFile(filepath, \"utf8\");\n const pkg = options.packageJsonParser ? await options.packageJsonParser(content, filepath) : JSON.parse(content);\n let agent;\n const nameAndVer = getNameAndVer(pkg);\n if (nameAndVer) {\n const name = nameAndVer.name;\n const ver = nameAndVer.ver;\n let version = ver;\n if (name === \"yarn\" && ver && Number.parseInt(ver) > 1) {\n agent = \"yarn@berry\";\n version = \"berry\";\n return { name, agent, version };\n } else if (name === \"pnpm\" && ver && Number.parseInt(ver) < 7) {\n agent = \"pnpm@6\";\n return { name, agent, version };\n } else if (AGENTS.includes(name)) {\n agent = name;\n return { name, agent, version };\n } else {\n return options.onUnknown?.(pkg.packageManager) ?? null;\n }\n }\n } catch {\n }\n return null;\n}\nfunction isMetadataYarnClassic(metadataPath) {\n return metadataPath.endsWith(\".yarn_integrity\");\n}\n\nexport { detect, getUserAgent };\n","export { COMMANDS, constructCommand, resolveCommand } from './commands.mjs';\nexport { AGENTS, INSTALL_METADATA, INSTALL_PAGE, LOCKS } from './constants.mjs';\nexport { detect, getUserAgent } from './detect.mjs';\nimport 'node:fs/promises';\nimport 'node:path';\nimport 'node:process';\n","import { spawn, spawnSync } from \"node:child_process\";\nimport { cwd } from \"node:process\";\nimport { basename, delimiter, dirname, normalize, resolve } from \"node:path\";\nimport { pipeline } from \"node:stream/promises\";\nimport { PassThrough } from \"node:stream\";\nimport readline from \"node:readline\";\nimport { closeSync, openSync, readSync, statSync } from \"node:fs\";\n//#region src/env.ts\nconst isPathLikePattern = /^path$/i;\nconst defaultEnvPathInfo = {\n\tkey: \"PATH\",\n\tvalue: \"\"\n};\nfunction getPathFromEnv(env) {\n\tfor (const key in env) {\n\t\tif (!Object.prototype.hasOwnProperty.call(env, key) || !isPathLikePattern.test(key)) continue;\n\t\tconst value = env[key];\n\t\tif (!value) return defaultEnvPathInfo;\n\t\treturn {\n\t\t\tkey,\n\t\t\tvalue\n\t\t};\n\t}\n\treturn defaultEnvPathInfo;\n}\nfunction addNodeBinToPath(cwd, path) {\n\tconst parts = path.value.split(delimiter);\n\tconst nodeBinPaths = [];\n\tlet currentPath = cwd;\n\tlet lastPath;\n\tdo {\n\t\tnodeBinPaths.push(resolve(currentPath, \"node_modules\", \".bin\"));\n\t\tlastPath = currentPath;\n\t\tcurrentPath = dirname(currentPath);\n\t} while (currentPath !== lastPath);\n\tnodeBinPaths.push(dirname(process.execPath));\n\tconst newPath = nodeBinPaths.concat(parts).join(delimiter);\n\treturn {\n\t\tkey: path.key,\n\t\tvalue: newPath\n\t};\n}\nfunction computeEnv(cwd, env, nodePath = true) {\n\tconst envWithDefault = {\n\t\t...process.env,\n\t\t...env\n\t};\n\tif (!nodePath) return envWithDefault;\n\tconst envPathInfo = addNodeBinToPath(cwd, getPathFromEnv(envWithDefault));\n\tenvWithDefault[envPathInfo.key] = envPathInfo.value;\n\treturn envWithDefault;\n}\n//#endregion\n//#region src/stream.ts\nconst combineStreams = (streams) => {\n\tlet streamCount = streams.length;\n\tconst combined = new PassThrough();\n\tconst maybeEmitEnd = () => {\n\t\tif (--streamCount === 0) combined.end();\n\t};\n\tfor (const stream of streams) pipeline(stream, combined, { end: false }).then(maybeEmitEnd).catch(maybeEmitEnd);\n\treturn combined;\n};\n//#endregion\n//#region src/normalize.ts\nconst metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\nconst shebangRegExp = /^#!\\s*(.+)/;\nconst isWindowsExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isNodeModulesCmdRegExp = /node_modules[\\\\/]\\.bin[\\\\/][^\\\\/]+\\.cmd$/i;\nconst isWindows = process.platform === \"win32\";\nconst defaultPathExt = [\n\t\".EXE\",\n\t\".CMD\",\n\t\".BAT\",\n\t\".COM\"\n];\nconst noPathExt = [\"\"];\n/**\n* Normalizes the command and arguments to work cross-platform.\n* On Windows, this basically handles things like shebangs, calling\n* `node_modules/.bin` commands, and escaping meta characters.\n* On other platforms, it just returns the command and arguments as-is.\n*/\nfunction normalizeSpawnCommand(command, args = [], options = {}) {\n\tif (options.shell === true || !isWindows) return {\n\t\tcommand,\n\t\targs,\n\t\toptions\n\t};\n\tlet file = resolveCommand(command, options);\n\tlet shebang = null;\n\tif (file !== null) {\n\t\tconst size = 150;\n\t\tconst buffer = Buffer.alloc(size);\n\t\tlet fd = null;\n\t\ttry {\n\t\t\tfd = openSync(file, \"r\");\n\t\t\treadSync(fd, buffer, 0, size, 0);\n\t\t} catch {} finally {\n\t\t\tif (fd !== null) closeSync(fd);\n\t\t}\n\t\tconst match = buffer.toString().match(shebangRegExp);\n\t\tif (match !== null) {\n\t\t\tconst line = match[1].trim();\n\t\t\tconst separatorIndex = line.indexOf(\" \");\n\t\t\tconst path = separatorIndex !== -1 ? line.slice(0, separatorIndex) : line;\n\t\t\tconst argument = separatorIndex !== -1 ? line.slice(separatorIndex + 1) : \"\";\n\t\t\tconst binary = basename(path);\n\t\t\tshebang = binary === \"env\" ? argument || null : binary;\n\t\t}\n\t}\n\tif (shebang !== null && file !== null) {\n\t\targs = [file, ...args];\n\t\tcommand = shebang;\n\t\tfile = resolveCommand(command, options);\n\t}\n\tif (file === null || !isWindowsExecutableRegExp.test(file)) {\n\t\tconst needsDoubleEscapeMetaChars = file !== null && isNodeModulesCmdRegExp.test(file);\n\t\tcommand = normalize(command);\n\t\tcommand = command.replace(metaCharsRegExp, \"^$1\");\n\t\targs = args.map((arg) => {\n\t\t\targ = arg.replace(/(?=(\\\\+?)?)\\1\"/g, \"$1$1\\\\\\\"\");\n\t\t\targ = arg.replace(/(?=(\\\\+?)?)\\1$/, \"$1$1\");\n\t\t\targ = `\"${arg}\"`;\n\t\t\targ = arg.replace(metaCharsRegExp, \"^$1\");\n\t\t\tif (needsDoubleEscapeMetaChars) arg = arg.replace(metaCharsRegExp, \"^$1\");\n\t\t\treturn arg;\n\t\t});\n\t\targs = [\n\t\t\t\"/d\",\n\t\t\t\"/s\",\n\t\t\t\"/c\",\n\t\t\t`\"${[command, ...args].join(\" \")}\"`\n\t\t];\n\t\tcommand = options.env?.comspec ?? \"cmd.exe\";\n\t\toptions = {\n\t\t\t...options,\n\t\t\twindowsVerbatimArguments: true\n\t\t};\n\t}\n\treturn {\n\t\tcommand,\n\t\targs,\n\t\toptions\n\t};\n}\n/**\n* Resolves the command to an absolute path if possible.\n* Handles things like traversing PATH and adding extensions from PATHEXT\n*/\nfunction resolveCommand(command, options) {\n\tconst cwd$3 = (options.cwd ?? cwd()).toString();\n\tconst env = options.env ?? process.env;\n\tconst PATH = getPathFromEnv(env).value;\n\tconst pathEnv = command.includes(\"/\") || command.includes(\"\\\\\") ? [\"\"] : [cwd$3, ...PATH.split(delimiter)];\n\tlet pathExt = env.PATHEXT ? env.PATHEXT.split(delimiter) : defaultPathExt;\n\tif (command.includes(\".\") && pathExt[0] !== \"\") pathExt = [\"\", ...pathExt];\n\tfor (const extensions of [pathExt, noPathExt]) for (const path of pathEnv) {\n\t\tconst dest = resolve(cwd$3, path.startsWith(\"\\\"\") && path.endsWith(\"\\\"\") && path.length > 1 ? path.slice(1, -1) : path, command);\n\t\tfor (const ext of extensions) {\n\t\t\tconst destWithExt = dest + ext;\n\t\t\ttry {\n\t\t\t\tif (statSync(destWithExt).isFile()) return destWithExt;\n\t\t\t} catch {}\n\t\t}\n\t}\n\treturn null;\n}\n//#endregion\n//#region src/non-zero-exit-error.ts\nvar NonZeroExitError = class extends Error {\n\tresult;\n\toutput;\n\texitCode;\n\tget signalCode() {\n\t\treturn this.result.signalCode;\n\t}\n\tconstructor(result, output, command, args) {\n\t\tlet target = \"The process\";\n\t\tif (command) target = `The command \\`${args?.length ? `${command} ${args.map((a) => /[ \"'`()]/.test(a) ? JSON.stringify(a) : a).join(\" \")}` : command}\\``;\n\t\tconst exitCode = result.exitCode ?? 1;\n\t\tsuper(result.signalCode !== null ? `${target} was killed by the signal ${result.signalCode}` : `${target} exited with a non-zero status (${exitCode})`);\n\t\tthis.result = result;\n\t\tthis.output = output;\n\t\tthis.exitCode = exitCode;\n\t\tObject.defineProperty(this, \"result\", {\n\t\t\tenumerable: false,\n\t\t\twritable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n};\n//#endregion\n//#region src/main.ts\nconst LINE_SEPARATOR_REGEX = /\\r?\\n/;\nconst defaultOptions = {\n\ttimeout: void 0,\n\tpersist: false\n};\nconst defaultSyncOptions = { timeout: void 0 };\nconst defaultNodeOptions = { windowsHide: true };\nfunction combineSignals(signals) {\n\tconst controller = new AbortController();\n\tfor (const signal of signals) {\n\t\tif (signal.aborted) {\n\t\t\tcontroller.abort();\n\t\t\treturn signal;\n\t\t}\n\t\tconst onAbort = () => {\n\t\t\tcontroller.abort(signal.reason);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { signal: controller.signal });\n\t}\n\treturn controller.signal;\n}\nasync function readStream(stream) {\n\tlet output = \"\";\n\ttry {\n\t\tfor await (const chunk of stream) output += chunk.toString();\n\t} catch {}\n\treturn output;\n}\nvar ExecProcess = class {\n\t_process;\n\t_aborted = false;\n\t_options;\n\t_command;\n\t_args;\n\t_resolveClose;\n\t_processClosed;\n\t_thrownError;\n\tget process() {\n\t\treturn this._process;\n\t}\n\tget pid() {\n\t\treturn this._process?.pid;\n\t}\n\tget exitCode() {\n\t\tif (this._process && this._process.exitCode !== null) return this._process.exitCode;\n\t}\n\tget signalCode() {\n\t\treturn this._process?.signalCode ?? null;\n\t}\n\tconstructor(command, args, options) {\n\t\tthis._options = {\n\t\t\t...defaultOptions,\n\t\t\t...options\n\t\t};\n\t\tthis._command = command;\n\t\tthis._args = args ?? [];\n\t\tthis._processClosed = new Promise((resolve) => {\n\t\t\tthis._resolveClose = resolve;\n\t\t});\n\t}\n\tkill(signal) {\n\t\treturn this._process?.kill(signal) === true;\n\t}\n\tget aborted() {\n\t\treturn this._aborted;\n\t}\n\tget killed() {\n\t\treturn this._process?.killed === true;\n\t}\n\tpipe(command, args, options) {\n\t\treturn exec(command, args, {\n\t\t\t...options,\n\t\t\tstdin: this\n\t\t});\n\t}\n\tasync *[Symbol.asyncIterator]() {\n\t\tconst proc = this._process;\n\t\tif (!proc) return;\n\t\tconst streams = [];\n\t\tif (this._streamErr) streams.push(this._streamErr);\n\t\tif (this._streamOut) streams.push(this._streamOut);\n\t\tconst streamCombined = combineStreams(streams);\n\t\tconst rl = readline.createInterface({ input: streamCombined });\n\t\tfor await (const chunk of rl) yield chunk.toString();\n\t\tawait this._processClosed;\n\t\tproc.removeAllListeners();\n\t\tif (this._thrownError) throw this._thrownError;\n\t\tif (this._options?.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, void 0, this._command, this._args);\n\t}\n\tasync _waitForOutput() {\n\t\tconst proc = this._process;\n\t\tif (!proc) throw new Error(\"No process was started\");\n\t\tconst [stdout, stderr] = await Promise.all([this._streamOut ? readStream(this._streamOut) : \"\", this._streamErr ? readStream(this._streamErr) : \"\"]);\n\t\tawait this._processClosed;\n\t\tconst { stdin } = this._options;\n\t\tif (stdin && typeof stdin !== \"string\") await stdin;\n\t\tproc.removeAllListeners();\n\t\tif (this._thrownError) throw this._thrownError;\n\t\tconst result = {\n\t\t\tstderr,\n\t\t\tstdout,\n\t\t\texitCode: this.exitCode\n\t\t};\n\t\tif (this._options.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, result, this._command, this._args);\n\t\treturn result;\n\t}\n\tthen(onfulfilled, onrejected) {\n\t\treturn this._waitForOutput().then(onfulfilled, onrejected);\n\t}\n\t_streamOut;\n\t_streamErr;\n\tspawn() {\n\t\tconst cwd$1 = cwd();\n\t\tconst options = this._options;\n\t\tconst nodeOptions = {\n\t\t\t...defaultNodeOptions,\n\t\t\t...options.nodeOptions\n\t\t};\n\t\tconst signals = [];\n\t\tthis._resetState();\n\t\tif (options.timeout !== void 0) signals.push(AbortSignal.timeout(options.timeout));\n\t\tif (options.signal !== void 0) signals.push(options.signal);\n\t\tif (options.persist === true) nodeOptions.detached = true;\n\t\tif (signals.length > 0) nodeOptions.signal = combineSignals(signals);\n\t\tnodeOptions.env = computeEnv(cwd$1, nodeOptions.env, options.nodePath);\n\t\tconst crossResult = normalizeSpawnCommand(this._command, this._args, nodeOptions);\n\t\tconst handle = spawn(crossResult.command, crossResult.args, crossResult.options);\n\t\tif (handle.stderr) this._streamErr = handle.stderr;\n\t\tif (handle.stdout) this._streamOut = handle.stdout;\n\t\tthis._process = handle;\n\t\thandle.once(\"error\", this._onError);\n\t\thandle.once(\"close\", this._onClose);\n\t\tif (handle.stdin) {\n\t\t\tconst { stdin } = options;\n\t\t\tif (typeof stdin === \"string\") handle.stdin.end(stdin);\n\t\t\telse stdin?.process?.stdout?.pipe(handle.stdin);\n\t\t}\n\t}\n\t_resetState() {\n\t\tthis._aborted = false;\n\t\tthis._processClosed = new Promise((resolve) => {\n\t\t\tthis._resolveClose = resolve;\n\t\t});\n\t\tthis._thrownError = void 0;\n\t}\n\t_onError = (err) => {\n\t\tif (err.name === \"AbortError\" && (!(err.cause instanceof Error) || err.cause.name !== \"TimeoutError\")) {\n\t\t\tthis._aborted = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._thrownError = err;\n\t};\n\t_onClose = () => {\n\t\tif (this._resolveClose) this._resolveClose();\n\t};\n};\nfunction xSync(command, args, options) {\n\tconst opts = {\n\t\t...defaultSyncOptions,\n\t\t...options\n\t};\n\tconst cwd$2 = cwd();\n\tconst nodeOptions = {\n\t\twindowsHide: true,\n\t\t...opts.nodeOptions\n\t};\n\tif (opts.timeout !== void 0) nodeOptions.timeout = opts.timeout;\n\tnodeOptions.env = computeEnv(cwd$2, nodeOptions.env, opts.nodePath);\n\tconst crossResult = normalizeSpawnCommand(command, args ?? [], nodeOptions);\n\tconst spawnResult = spawnSync(crossResult.command, crossResult.args, crossResult.options);\n\tif (spawnResult.error) throw spawnResult.error;\n\tconst stdout = spawnResult.stdout?.toString() ?? \"\";\n\tconst stderr = spawnResult.stderr?.toString() ?? \"\";\n\tconst exitCode = spawnResult.status ?? void 0;\n\tconst signalCode = spawnResult.signal ?? null;\n\tconst killed = signalCode !== null;\n\tconst result = {\n\t\tstdout,\n\t\tstderr,\n\t\tget exitCode() {\n\t\t\treturn exitCode;\n\t\t},\n\t\tget signalCode() {\n\t\t\treturn signalCode;\n\t\t},\n\t\tget pid() {\n\t\t\treturn spawnResult.pid;\n\t\t},\n\t\tget killed() {\n\t\t\treturn killed;\n\t\t},\n\t\t*[Symbol.iterator]() {\n\t\t\tfor (const text of [stdout, stderr]) {\n\t\t\t\tif (!text) continue;\n\t\t\t\tconst lines = text.split(LINE_SEPARATOR_REGEX);\n\t\t\t\tif (lines[lines.length - 1] === \"\") lines.pop();\n\t\t\t\tyield* lines;\n\t\t\t}\n\t\t}\n\t};\n\tif (opts.throwOnError && (exitCode !== 0 && exitCode !== void 0 || signalCode !== null)) throw new NonZeroExitError(result, {\n\t\tstdout: result.stdout,\n\t\tstderr: result.stderr,\n\t\texitCode: result.exitCode\n\t}, command, args);\n\treturn result;\n}\nconst x = (command, args, userOptions) => {\n\tconst proc = new ExecProcess(command, args, userOptions);\n\tproc.spawn();\n\treturn proc;\n};\nconst exec = x;\nconst execSync = xSync;\n//#endregion\nexport { ExecProcess, NonZeroExitError, exec, execSync, normalizeSpawnCommand, x, xSync };\n","import { a as __toESM, i as __require, n as __exportAll, r as __reExport, t as __commonJSMin } from \"./rolldown-runtime-DPI6AWJA.mjs\";\nimport fs, { existsSync, promises } from \"node:fs\";\nimport path, { dirname, join, resolve } from \"node:path\";\nimport process$1 from \"node:process\";\nimport { AGENTS, detect } from \"package-manager-detector\";\nimport { INSTALL_PAGE } from \"package-manager-detector/constants\";\nimport { x } from \"tinyexec\";\nimport os from \"node:os\";\nimport { styleText } from \"node:util\";\n//#region node_modules/.pnpm/ini@7.0.0/node_modules/ini/lib/ini.js\nvar require_ini = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst { hasOwnProperty } = Object.prototype;\n\tconst encode = (obj, opt = {}) => {\n\t\tif (typeof opt === \"string\") opt = { section: opt };\n\t\topt.align = opt.align === true;\n\t\topt.newline = opt.newline === true;\n\t\topt.sort = opt.sort === true;\n\t\topt.whitespace = opt.whitespace === true || opt.align === true;\n\t\t/* istanbul ignore next */\n\t\topt.platform = opt.platform || typeof process !== \"undefined\" && process.platform;\n\t\topt.bracketedArray = opt.bracketedArray !== false;\n\t\t/* istanbul ignore next */\n\t\tconst eol = opt.platform === \"win32\" ? \"\\r\\n\" : \"\\n\";\n\t\tconst separator = opt.whitespace ? \" = \" : \"=\";\n\t\tconst children = [];\n\t\tconst keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);\n\t\tlet padToChars = 0;\n\t\tif (opt.align) padToChars = safe(keys.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== \"object\").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([\"\"]).reduce((a, b) => safe(a).length >= safe(b).length ? a : b)).length;\n\t\tlet out = \"\";\n\t\tconst arraySuffix = opt.bracketedArray ? \"[]\" : \"\";\n\t\tfor (const k of keys) {\n\t\t\tconst val = obj[k];\n\t\t\tif (val && Array.isArray(val)) for (const item of val) out += safe(`${k}${arraySuffix}`).padEnd(padToChars, \" \") + separator + safe(item) + eol;\n\t\t\telse if (val && typeof val === \"object\") children.push(k);\n\t\t\telse out += safe(k).padEnd(padToChars, \" \") + separator + safe(val) + eol;\n\t\t}\n\t\tif (opt.section && out.length) out = \"[\" + safe(opt.section) + \"]\" + (opt.newline ? eol + eol : eol) + out;\n\t\tfor (const k of children) {\n\t\t\tconst nk = splitSections(k, \".\").join(\"\\\\.\");\n\t\t\tconst section = (opt.section ? opt.section + \".\" : \"\") + nk;\n\t\t\tconst child = encode(obj[k], {\n\t\t\t\t...opt,\n\t\t\t\tsection\n\t\t\t});\n\t\t\tif (out.length && child.length) out += eol;\n\t\t\tout += child;\n\t\t}\n\t\treturn out;\n\t};\n\tfunction splitSections(str, separator) {\n\t\tvar lastMatchIndex = 0;\n\t\tvar lastSeparatorIndex = 0;\n\t\tvar nextIndex = 0;\n\t\tvar sections = [];\n\t\tdo {\n\t\t\tnextIndex = str.indexOf(separator, lastMatchIndex);\n\t\t\tif (nextIndex !== -1) {\n\t\t\t\tlastMatchIndex = nextIndex + separator.length;\n\t\t\t\tif (nextIndex > 0 && str[nextIndex - 1] === \"\\\\\") continue;\n\t\t\t\tsections.push(str.slice(lastSeparatorIndex, nextIndex));\n\t\t\t\tlastSeparatorIndex = nextIndex + separator.length;\n\t\t\t}\n\t\t} while (nextIndex !== -1);\n\t\tsections.push(str.slice(lastSeparatorIndex));\n\t\treturn sections;\n\t}\n\tconst decode = (str, opt = {}) => {\n\t\topt.bracketedArray = opt.bracketedArray !== false;\n\t\tconst out = Object.create(null);\n\t\tlet p = out;\n\t\tlet section = null;\n\t\tconst re = /^\\[([^\\]]*)\\]\\s*$|^([^=]+)(=(.*))?$/i;\n\t\tconst lines = str.split(/[\\r\\n]+/g);\n\t\tconst duplicates = {};\n\t\tfor (const line of lines) {\n\t\t\tif (!line || line.match(/^\\s*[;#]/) || line.match(/^\\s*$/)) continue;\n\t\t\tconst match = line.match(re);\n\t\t\tif (!match) continue;\n\t\t\tif (match[1] !== void 0) {\n\t\t\t\tsection = unsafe(match[1]);\n\t\t\t\tif (section === \"__proto__\") {\n\t\t\t\t\tp = Object.create(null);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tp = out[section] = out[section] || Object.create(null);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst keyRaw = unsafe(match[2]);\n\t\t\tlet isArray;\n\t\t\tif (opt.bracketedArray) isArray = keyRaw.length > 2 && keyRaw.slice(-2) === \"[]\";\n\t\t\telse {\n\t\t\t\tduplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1;\n\t\t\t\tisArray = duplicates[keyRaw] > 1;\n\t\t\t}\n\t\t\tconst key = isArray && keyRaw.endsWith(\"[]\") ? keyRaw.slice(0, -2) : keyRaw;\n\t\t\tif (key === \"__proto__\") continue;\n\t\t\tconst valueRaw = match[3] ? unsafe(match[4]) : true;\n\t\t\tconst value = valueRaw === \"true\" || valueRaw === \"false\" || valueRaw === \"null\" ? JSON.parse(valueRaw) : valueRaw;\n\t\t\tif (isArray) {\n\t\t\t\tif (!hasOwnProperty.call(p, key)) p[key] = [];\n\t\t\t\telse if (!Array.isArray(p[key])) p[key] = [p[key]];\n\t\t\t}\n\t\t\tif (Array.isArray(p[key])) p[key].push(value);\n\t\t\telse p[key] = value;\n\t\t}\n\t\tconst remove = [];\n\t\tfor (const k of Object.keys(out)) {\n\t\t\tif (!hasOwnProperty.call(out, k) || typeof out[k] !== \"object\" || Array.isArray(out[k])) continue;\n\t\t\tconst parts = splitSections(k, \".\");\n\t\t\tp = out;\n\t\t\tconst l = parts.pop();\n\t\t\tconst nl = l.replace(/\\\\\\./g, \".\");\n\t\t\tfor (const part of parts) {\n\t\t\t\tif (part === \"__proto__\") continue;\n\t\t\t\tif (!hasOwnProperty.call(p, part) || typeof p[part] !== \"object\") p[part] = Object.create(null);\n\t\t\t\tp = p[part];\n\t\t\t}\n\t\t\tif (p === out && nl === l) continue;\n\t\t\tp[nl] = out[k];\n\t\t\tremove.push(k);\n\t\t}\n\t\tfor (const del of remove) delete out[del];\n\t\treturn out;\n\t};\n\tconst isQuoted = (val) => {\n\t\treturn val.startsWith(\"\\\"\") && val.endsWith(\"\\\"\") || val.startsWith(\"'\") && val.endsWith(\"'\");\n\t};\n\tconst safe = (val) => {\n\t\tif (typeof val !== \"string\" || val.match(/[=\\r\\n]/) || val.match(/^\\[/) || val.length > 1 && isQuoted(val) || val !== val.trim()) return JSON.stringify(val);\n\t\treturn val.split(\";\").join(\"\\\\;\").split(\"#\").join(\"\\\\#\");\n\t};\n\tconst unsafe = (val) => {\n\t\tval = (val || \"\").trim();\n\t\tif (isQuoted(val)) {\n\t\t\tif (val.charAt(0) === \"'\") val = val.slice(1, -1);\n\t\t\ttry {\n\t\t\t\tval = JSON.parse(val);\n\t\t\t} catch {}\n\t\t} else {\n\t\t\tlet esc = false;\n\t\t\tlet unesc = \"\";\n\t\t\tfor (let i = 0, l = val.length; i < l; i++) {\n\t\t\t\tconst c = val.charAt(i);\n\t\t\t\tif (esc) {\n\t\t\t\t\tif (\"\\\\;#\".indexOf(c) !== -1) unesc += c;\n\t\t\t\t\telse unesc += \"\\\\\" + c;\n\t\t\t\t\tesc = false;\n\t\t\t\t} else if (\";#\".indexOf(c) !== -1) break;\n\t\t\t\telse if (c === \"\\\\\") esc = true;\n\t\t\t\telse unesc += c;\n\t\t\t}\n\t\t\tif (esc) unesc += \"\\\\\";\n\t\t\treturn unesc.trim();\n\t\t}\n\t\treturn val;\n\t};\n\tmodule.exports = {\n\t\tparse: decode,\n\t\tdecode,\n\t\tstringify: encode,\n\t\tencode,\n\t\tsafe,\n\t\tunsafe\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/index.js\nvar require_kleur = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tlet FORCE_COLOR;\n\tlet NODE_DISABLE_COLORS;\n\tlet NO_COLOR;\n\tlet TERM;\n\tlet isTTY = true;\n\tif (typeof process !== \"undefined\") {\n\t\t({FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM} = process.env || {});\n\t\tisTTY = process.stdout && process.stdout.isTTY;\n\t}\n\tconst $ = {\n\t\tenabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== \"dumb\" && (FORCE_COLOR != null && FORCE_COLOR !== \"0\" || isTTY),\n\t\treset: init(0, 0),\n\t\tbold: init(1, 22),\n\t\tdim: init(2, 22),\n\t\titalic: init(3, 23),\n\t\tunderline: init(4, 24),\n\t\tinverse: init(7, 27),\n\t\thidden: init(8, 28),\n\t\tstrikethrough: init(9, 29),\n\t\tblack: init(30, 39),\n\t\tred: init(31, 39),\n\t\tgreen: init(32, 39),\n\t\tyellow: init(33, 39),\n\t\tblue: init(34, 39),\n\t\tmagenta: init(35, 39),\n\t\tcyan: init(36, 39),\n\t\twhite: init(37, 39),\n\t\tgray: init(90, 39),\n\t\tgrey: init(90, 39),\n\t\tbgBlack: init(40, 49),\n\t\tbgRed: init(41, 49),\n\t\tbgGreen: init(42, 49),\n\t\tbgYellow: init(43, 49),\n\t\tbgBlue: init(44, 49),\n\t\tbgMagenta: init(45, 49),\n\t\tbgCyan: init(46, 49),\n\t\tbgWhite: init(47, 49)\n\t};\n\tfunction run(arr, str) {\n\t\tlet i = 0, tmp, beg = \"\", end = \"\";\n\t\tfor (; i < arr.length; i++) {\n\t\t\ttmp = arr[i];\n\t\t\tbeg += tmp.open;\n\t\t\tend += tmp.close;\n\t\t\tif (!!~str.indexOf(tmp.close)) str = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t}\n\t\treturn beg + str + end;\n\t}\n\tfunction chain(has, keys) {\n\t\tlet ctx = {\n\t\t\thas,\n\t\t\tkeys\n\t\t};\n\t\tctx.reset = $.reset.bind(ctx);\n\t\tctx.bold = $.bold.bind(ctx);\n\t\tctx.dim = $.dim.bind(ctx);\n\t\tctx.italic = $.italic.bind(ctx);\n\t\tctx.underline = $.underline.bind(ctx);\n\t\tctx.inverse = $.inverse.bind(ctx);\n\t\tctx.hidden = $.hidden.bind(ctx);\n\t\tctx.strikethrough = $.strikethrough.bind(ctx);\n\t\tctx.black = $.black.bind(ctx);\n\t\tctx.red = $.red.bind(ctx);\n\t\tctx.green = $.green.bind(ctx);\n\t\tctx.yellow = $.yellow.bind(ctx);\n\t\tctx.blue = $.blue.bind(ctx);\n\t\tctx.magenta = $.magenta.bind(ctx);\n\t\tctx.cyan = $.cyan.bind(ctx);\n\t\tctx.white = $.white.bind(ctx);\n\t\tctx.gray = $.gray.bind(ctx);\n\t\tctx.grey = $.grey.bind(ctx);\n\t\tctx.bgBlack = $.bgBlack.bind(ctx);\n\t\tctx.bgRed = $.bgRed.bind(ctx);\n\t\tctx.bgGreen = $.bgGreen.bind(ctx);\n\t\tctx.bgYellow = $.bgYellow.bind(ctx);\n\t\tctx.bgBlue = $.bgBlue.bind(ctx);\n\t\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\t\tctx.bgCyan = $.bgCyan.bind(ctx);\n\t\tctx.bgWhite = $.bgWhite.bind(ctx);\n\t\treturn ctx;\n\t}\n\tfunction init(open, close) {\n\t\tlet blk = {\n\t\t\topen: `\\x1b[${open}m`,\n\t\t\tclose: `\\x1b[${close}m`,\n\t\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, \"g\")\n\t\t};\n\t\treturn function(txt) {\n\t\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\t\t~this.has.indexOf(open) || (this.has.push(open), this.keys.push(blk));\n\t\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt + \"\") : txt + \"\";\n\t\t\t}\n\t\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt + \"\") : txt + \"\";\n\t\t};\n\t}\n\tmodule.exports = $;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/util/action.js\nvar require_action = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = (key, isSelect) => {\n\t\tif (key.meta && key.name !== \"escape\") return;\n\t\tif (key.ctrl) {\n\t\t\tif (key.name === \"a\") return \"first\";\n\t\t\tif (key.name === \"c\") return \"abort\";\n\t\t\tif (key.name === \"d\") return \"abort\";\n\t\t\tif (key.name === \"e\") return \"last\";\n\t\t\tif (key.name === \"g\") return \"reset\";\n\t\t\tif (key.name === \"n\") return \"down\";\n\t\t\tif (key.name === \"p\") return \"up\";\n\t\t\treturn;\n\t\t}\n\t\tif (isSelect) {\n\t\t\tif (key.name === \"j\") return \"down\";\n\t\t\tif (key.name === \"k\") return \"up\";\n\t\t}\n\t\tif (key.name === \"return\") return \"submit\";\n\t\tif (key.name === \"enter\") return \"submit\";\n\t\tif (key.name === \"backspace\") return \"delete\";\n\t\tif (key.name === \"delete\") return \"deleteForward\";\n\t\tif (key.name === \"abort\") return \"abort\";\n\t\tif (key.name === \"escape\") return \"exit\";\n\t\tif (key.name === \"tab\") return \"next\";\n\t\tif (key.name === \"pagedown\") return \"nextPage\";\n\t\tif (key.name === \"pageup\") return \"prevPage\";\n\t\tif (key.name === \"home\") return \"home\";\n\t\tif (key.name === \"end\") return \"end\";\n\t\tif (key.name === \"up\") return \"up\";\n\t\tif (key.name === \"down\") return \"down\";\n\t\tif (key.name === \"right\") return \"right\";\n\t\tif (key.name === \"left\") return \"left\";\n\t\treturn false;\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/util/strip.js\nvar require_strip = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = (str) => {\n\t\tconst pattern = [\"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\", \"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PRZcf-ntqry=><~]))\"].join(\"|\");\n\t\tconst RGX = new RegExp(pattern, \"g\");\n\t\treturn typeof str === \"string\" ? str.replace(RGX, \"\") : str;\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js\nvar require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst ESC = \"\\x1B\";\n\tconst CSI = `${ESC}[`;\n\tconst beep = \"\\x07\";\n\tconst cursor = {\n\t\tto(x, y) {\n\t\t\tif (!y) return `${CSI}${x + 1}G`;\n\t\t\treturn `${CSI}${y + 1};${x + 1}H`;\n\t\t},\n\t\tmove(x, y) {\n\t\t\tlet ret = \"\";\n\t\t\tif (x < 0) ret += `${CSI}${-x}D`;\n\t\t\telse if (x > 0) ret += `${CSI}${x}C`;\n\t\t\tif (y < 0) ret += `${CSI}${-y}A`;\n\t\t\telse if (y > 0) ret += `${CSI}${y}B`;\n\t\t\treturn ret;\n\t\t},\n\t\tup: (count = 1) => `${CSI}${count}A`,\n\t\tdown: (count = 1) => `${CSI}${count}B`,\n\t\tforward: (count = 1) => `${CSI}${count}C`,\n\t\tbackward: (count = 1) => `${CSI}${count}D`,\n\t\tnextLine: (count = 1) => `${CSI}E`.repeat(count),\n\t\tprevLine: (count = 1) => `${CSI}F`.repeat(count),\n\t\tleft: `${CSI}G`,\n\t\thide: `${CSI}?25l`,\n\t\tshow: `${CSI}?25h`,\n\t\tsave: `${ESC}7`,\n\t\trestore: `${ESC}8`\n\t};\n\tmodule.exports = {\n\t\tcursor,\n\t\tscroll: {\n\t\t\tup: (count = 1) => `${CSI}S`.repeat(count),\n\t\t\tdown: (count = 1) => `${CSI}T`.repeat(count)\n\t\t},\n\t\terase: {\n\t\t\tscreen: `${CSI}2J`,\n\t\t\tup: (count = 1) => `${CSI}1J`.repeat(count),\n\t\t\tdown: (count = 1) => `${CSI}J`.repeat(count),\n\t\t\tline: `${CSI}2K`,\n\t\t\tlineEnd: `${CSI}K`,\n\t\t\tlineStart: `${CSI}1K`,\n\t\t\tlines(count) {\n\t\t\t\tlet clear = \"\";\n\t\t\t\tfor (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : \"\");\n\t\t\t\tif (count) clear += cursor.left;\n\t\t\t\treturn clear;\n\t\t\t}\n\t\t},\n\t\tbeep\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/util/clear.js\nvar require_clear = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst strip = require_strip();\n\tconst { erase, cursor } = require_src();\n\tconst width = (str) => [...strip(str)].length;\n\t/**\n\t* @param {string} prompt\n\t* @param {number} perLine\n\t*/\n\tmodule.exports = function(prompt, perLine) {\n\t\tif (!perLine) return erase.line + cursor.to(0);\n\t\tlet rows = 0;\n\t\tconst lines = prompt.split(/\\r?\\n/);\n\t\tfor (let line of lines) rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);\n\t\treturn erase.lines(rows);\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/util/figures.js\nvar require_figures = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst main = {\n\t\tarrowUp: \"↑\",\n\t\tarrowDown: \"↓\",\n\t\tarrowLeft: \"←\",\n\t\tarrowRight: \"→\",\n\t\tradioOn: \"◉\",\n\t\tradioOff: \"◯\",\n\t\ttick: \"✔\",\n\t\tcross: \"✖\",\n\t\tellipsis: \"…\",\n\t\tpointerSmall: \"›\",\n\t\tline: \"─\",\n\t\tpointer: \"❯\"\n\t};\n\tconst win = {\n\t\tarrowUp: main.arrowUp,\n\t\tarrowDown: main.arrowDown,\n\t\tarrowLeft: main.arrowLeft,\n\t\tarrowRight: main.arrowRight,\n\t\tradioOn: \"(*)\",\n\t\tradioOff: \"( )\",\n\t\ttick: \"√\",\n\t\tcross: \"×\",\n\t\tellipsis: \"...\",\n\t\tpointerSmall: \"»\",\n\t\tline: \"─\",\n\t\tpointer: \">\"\n\t};\n\tmodule.exports = process.platform === \"win32\" ? win : main;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/util/style.js\nvar require_style = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst c = require_kleur();\n\tconst figures = require_figures();\n\tconst styles = Object.freeze({\n\t\tpassword: {\n\t\t\tscale: 1,\n\t\t\trender: (input) => \"*\".repeat(input.length)\n\t\t},\n\t\temoji: {\n\t\t\tscale: 2,\n\t\t\trender: (input) => \"😃\".repeat(input.length)\n\t\t},\n\t\tinvisible: {\n\t\t\tscale: 0,\n\t\t\trender: (input) => \"\"\n\t\t},\n\t\tdefault: {\n\t\t\tscale: 1,\n\t\t\trender: (input) => `${input}`\n\t\t}\n\t});\n\tconst render = (type) => styles[type] || styles.default;\n\tconst symbols = Object.freeze({\n\t\taborted: c.red(figures.cross),\n\t\tdone: c.green(figures.tick),\n\t\texited: c.yellow(figures.cross),\n\t\tdefault: c.cyan(\"?\")\n\t});\n\tconst symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;\n\tconst delimiter = (completing) => c.gray(completing ? figures.ellipsis : figures.pointerSmall);\n\tconst item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : \"+\" : figures.line);\n\tmodule.exports = {\n\t\tstyles,\n\t\trender,\n\t\tsymbols,\n\t\tsymbol,\n\t\tdelimiter,\n\t\titem\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/util/lines.js\nvar require_lines = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst strip = require_strip();\n\t/**\n\t* @param {string} msg\n\t* @param {number} perLine\n\t*/\n\tmodule.exports = function(msg, perLine) {\n\t\tlet lines = String(strip(msg) || \"\").split(/\\r?\\n/);\n\t\tif (!perLine) return lines.length;\n\t\treturn lines.map((l) => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/util/wrap.js\nvar require_wrap = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\t/**\n\t* @param {string} msg The message to wrap\n\t* @param {object} opts\n\t* @param {number|string} [opts.margin] Left margin\n\t* @param {number} opts.width Maximum characters per line including the margin\n\t*/\n\tmodule.exports = (msg, opts = {}) => {\n\t\tconst tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(\" \").join(\"\") : opts.margin || \"\";\n\t\tconst width = opts.width;\n\t\treturn (msg || \"\").split(/\\r?\\n/g).map((line) => line.split(/\\s+/g).reduce((arr, w) => {\n\t\t\tif (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width) arr[arr.length - 1] += ` ${w}`;\n\t\t\telse arr.push(`${tab}${w}`);\n\t\t\treturn arr;\n\t\t}, [tab]).join(\"\\n\")).join(\"\\n\");\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/util/entriesToDisplay.js\nvar require_entriesToDisplay = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\t/**\n\t* Determine what entries should be displayed on the screen, based on the\n\t* currently selected index and the maximum visible. Used in list-based\n\t* prompts like `select` and `multiselect`.\n\t*\n\t* @param {number} cursor the currently selected entry\n\t* @param {number} total the total entries available to display\n\t* @param {number} [maxVisible] the number of entries that can be displayed\n\t*/\n\tmodule.exports = (cursor, total, maxVisible) => {\n\t\tmaxVisible = maxVisible || total;\n\t\tlet startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));\n\t\tif (startIndex < 0) startIndex = 0;\n\t\tlet endIndex = Math.min(startIndex + maxVisible, total);\n\t\treturn {\n\t\t\tstartIndex,\n\t\t\tendIndex\n\t\t};\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/util/index.js\nvar require_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\taction: require_action(),\n\t\tclear: require_clear(),\n\t\tstyle: require_style(),\n\t\tstrip: require_strip(),\n\t\tfigures: require_figures(),\n\t\tlines: require_lines(),\n\t\twrap: require_wrap(),\n\t\tentriesToDisplay: require_entriesToDisplay()\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/prompt.js\nvar require_prompt = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst readline = __require(\"readline\");\n\tconst { action } = require_util();\n\tconst EventEmitter = __require(\"events\");\n\tconst { beep, cursor } = require_src();\n\tconst color = require_kleur();\n\t/**\n\t* Base prompt skeleton\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t*/\n\tvar Prompt = class extends EventEmitter {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper();\n\t\t\tthis.firstRender = true;\n\t\t\tthis.in = opts.stdin || process.stdin;\n\t\t\tthis.out = opts.stdout || process.stdout;\n\t\t\tthis.onRender = (opts.onRender || (() => void 0)).bind(this);\n\t\t\tconst rl = readline.createInterface({\n\t\t\t\tinput: this.in,\n\t\t\t\tescapeCodeTimeout: 50\n\t\t\t});\n\t\t\treadline.emitKeypressEvents(this.in, rl);\n\t\t\tif (this.in.isTTY) this.in.setRawMode(true);\n\t\t\tconst isSelect = [\"SelectPrompt\", \"MultiselectPrompt\"].indexOf(this.constructor.name) > -1;\n\t\t\tconst keypress = (str, key) => {\n\t\t\t\tlet a = action(key, isSelect);\n\t\t\t\tif (a === false) this._ && this._(str, key);\n\t\t\t\telse if (typeof this[a] === \"function\") this[a](key);\n\t\t\t\telse this.bell();\n\t\t\t};\n\t\t\tthis.close = () => {\n\t\t\t\tthis.out.write(cursor.show);\n\t\t\t\tthis.in.removeListener(\"keypress\", keypress);\n\t\t\t\tif (this.in.isTTY) this.in.setRawMode(false);\n\t\t\t\trl.close();\n\t\t\t\tthis.emit(this.aborted ? \"abort\" : this.exited ? \"exit\" : \"submit\", this.value);\n\t\t\t\tthis.closed = true;\n\t\t\t};\n\t\t\tthis.in.on(\"keypress\", keypress);\n\t\t}\n\t\tfire() {\n\t\t\tthis.emit(\"state\", {\n\t\t\t\tvalue: this.value,\n\t\t\t\taborted: !!this.aborted,\n\t\t\t\texited: !!this.exited\n\t\t\t});\n\t\t}\n\t\tbell() {\n\t\t\tthis.out.write(beep);\n\t\t}\n\t\trender() {\n\t\t\tthis.onRender(color);\n\t\t\tif (this.firstRender) this.firstRender = false;\n\t\t}\n\t};\n\tmodule.exports = Prompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/text.js\nvar require_text = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst color = require_kleur();\n\tconst Prompt = require_prompt();\n\tconst { erase, cursor } = require_src();\n\tconst { style, clear, lines, figures } = require_util();\n\t/**\n\t* TextPrompt Base Element\n\t* @param {Object} opts Options\n\t* @param {String} opts.message Message\n\t* @param {String} [opts.style='default'] Render style\n\t* @param {String} [opts.initial] Default value\n\t* @param {Function} [opts.validate] Validate function\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t* @param {String} [opts.error] The invalid error label\n\t*/\n\tvar TextPrompt = class extends Prompt {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t\tthis.transform = style.render(opts.style);\n\t\t\tthis.scale = this.transform.scale;\n\t\t\tthis.msg = opts.message;\n\t\t\tthis.initial = opts.initial || ``;\n\t\t\tthis.validator = opts.validate || (() => true);\n\t\t\tthis.value = ``;\n\t\t\tthis.errorMsg = opts.error || `Please Enter A Valid Value`;\n\t\t\tthis.cursor = Number(!!this.initial);\n\t\t\tthis.cursorOffset = 0;\n\t\t\tthis.clear = clear(``, this.out.columns);\n\t\t\tthis.render();\n\t\t}\n\t\tset value(v) {\n\t\t\tif (!v && this.initial) {\n\t\t\t\tthis.placeholder = true;\n\t\t\t\tthis.rendered = color.gray(this.transform.render(this.initial));\n\t\t\t} else {\n\t\t\t\tthis.placeholder = false;\n\t\t\t\tthis.rendered = this.transform.render(v);\n\t\t\t}\n\t\t\tthis._value = v;\n\t\t\tthis.fire();\n\t\t}\n\t\tget value() {\n\t\t\treturn this._value;\n\t\t}\n\t\treset() {\n\t\t\tthis.value = ``;\n\t\t\tthis.cursor = Number(!!this.initial);\n\t\t\tthis.cursorOffset = 0;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\texit() {\n\t\t\tthis.abort();\n\t\t}\n\t\tabort() {\n\t\t\tthis.value = this.value || this.initial;\n\t\t\tthis.done = this.aborted = true;\n\t\t\tthis.error = false;\n\t\t\tthis.red = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tasync validate() {\n\t\t\tlet valid = await this.validator(this.value);\n\t\t\tif (typeof valid === `string`) {\n\t\t\t\tthis.errorMsg = valid;\n\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tthis.error = !valid;\n\t\t}\n\t\tasync submit() {\n\t\t\tthis.value = this.value || this.initial;\n\t\t\tthis.cursorOffset = 0;\n\t\t\tthis.cursor = this.rendered.length;\n\t\t\tawait this.validate();\n\t\t\tif (this.error) {\n\t\t\t\tthis.red = true;\n\t\t\t\tthis.fire();\n\t\t\t\tthis.render();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.done = true;\n\t\t\tthis.aborted = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tnext() {\n\t\t\tif (!this.placeholder) return this.bell();\n\t\t\tthis.value = this.initial;\n\t\t\tthis.cursor = this.rendered.length;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\tmoveCursor(n) {\n\t\t\tif (this.placeholder) return;\n\t\t\tthis.cursor = this.cursor + n;\n\t\t\tthis.cursorOffset += n;\n\t\t}\n\t\t_(c, key) {\n\t\t\tlet s1 = this.value.slice(0, this.cursor);\n\t\t\tlet s2 = this.value.slice(this.cursor);\n\t\t\tthis.value = `${s1}${c}${s2}`;\n\t\t\tthis.red = false;\n\t\t\tthis.cursor = this.placeholder ? 0 : s1.length + 1;\n\t\t\tthis.render();\n\t\t}\n\t\tdelete() {\n\t\t\tif (this.isCursorAtStart()) return this.bell();\n\t\t\tlet s1 = this.value.slice(0, this.cursor - 1);\n\t\t\tlet s2 = this.value.slice(this.cursor);\n\t\t\tthis.value = `${s1}${s2}`;\n\t\t\tthis.red = false;\n\t\t\tif (this.isCursorAtStart()) this.cursorOffset = 0;\n\t\t\telse {\n\t\t\t\tthis.cursorOffset++;\n\t\t\t\tthis.moveCursor(-1);\n\t\t\t}\n\t\t\tthis.render();\n\t\t}\n\t\tdeleteForward() {\n\t\t\tif (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();\n\t\t\tlet s1 = this.value.slice(0, this.cursor);\n\t\t\tlet s2 = this.value.slice(this.cursor + 1);\n\t\t\tthis.value = `${s1}${s2}`;\n\t\t\tthis.red = false;\n\t\t\tif (this.isCursorAtEnd()) this.cursorOffset = 0;\n\t\t\telse this.cursorOffset++;\n\t\t\tthis.render();\n\t\t}\n\t\tfirst() {\n\t\t\tthis.cursor = 0;\n\t\t\tthis.render();\n\t\t}\n\t\tlast() {\n\t\t\tthis.cursor = this.value.length;\n\t\t\tthis.render();\n\t\t}\n\t\tleft() {\n\t\t\tif (this.cursor <= 0 || this.placeholder) return this.bell();\n\t\t\tthis.moveCursor(-1);\n\t\t\tthis.render();\n\t\t}\n\t\tright() {\n\t\t\tif (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();\n\t\t\tthis.moveCursor(1);\n\t\t\tthis.render();\n\t\t}\n\t\tisCursorAtStart() {\n\t\t\treturn this.cursor === 0 || this.placeholder && this.cursor === 1;\n\t\t}\n\t\tisCursorAtEnd() {\n\t\t\treturn this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;\n\t\t}\n\t\trender() {\n\t\t\tif (this.closed) return;\n\t\t\tif (!this.firstRender) {\n\t\t\t\tif (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n\t\t\t\tthis.out.write(clear(this.outputText, this.out.columns));\n\t\t\t}\n\t\t\tsuper.render();\n\t\t\tthis.outputError = \"\";\n\t\t\tthis.outputText = [\n\t\t\t\tstyle.symbol(this.done, this.aborted),\n\t\t\t\tcolor.bold(this.msg),\n\t\t\t\tstyle.delimiter(this.done),\n\t\t\t\tthis.red ? color.red(this.rendered) : this.rendered\n\t\t\t].join(` `);\n\t\t\tif (this.error) this.outputError += this.errorMsg.split(`\\n`).reduce((a, l, i) => a + `\\n${i ? \" \" : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n\t\t\tthis.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));\n\t\t}\n\t};\n\tmodule.exports = TextPrompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/select.js\nvar require_select = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst color = require_kleur();\n\tconst Prompt = require_prompt();\n\tconst { style, clear, figures, wrap, entriesToDisplay } = require_util();\n\tconst { cursor } = require_src();\n\t/**\n\t* SelectPrompt Base Element\n\t* @param {Object} opts Options\n\t* @param {String} opts.message Message\n\t* @param {Array} opts.choices Array of choice objects\n\t* @param {String} [opts.hint] Hint to display\n\t* @param {Number} [opts.initial] Index of default value\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t* @param {Number} [opts.optionsPerPage=10] Max options to display at once\n\t*/\n\tvar SelectPrompt = class extends Prompt {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t\tthis.msg = opts.message;\n\t\t\tthis.hint = opts.hint || \"- Use arrow-keys. Return to submit.\";\n\t\t\tthis.warn = opts.warn || \"- This option is disabled\";\n\t\t\tthis.cursor = opts.initial || 0;\n\t\t\tthis.choices = opts.choices.map((ch, idx) => {\n\t\t\t\tif (typeof ch === \"string\") ch = {\n\t\t\t\t\ttitle: ch,\n\t\t\t\t\tvalue: idx\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttitle: ch && (ch.title || ch.value || ch),\n\t\t\t\t\tvalue: ch && (ch.value === void 0 ? idx : ch.value),\n\t\t\t\t\tdescription: ch && ch.description,\n\t\t\t\t\tselected: ch && ch.selected,\n\t\t\t\t\tdisabled: ch && ch.disabled\n\t\t\t\t};\n\t\t\t});\n\t\t\tthis.optionsPerPage = opts.optionsPerPage || 10;\n\t\t\tthis.value = (this.choices[this.cursor] || {}).value;\n\t\t\tthis.clear = clear(\"\", this.out.columns);\n\t\t\tthis.render();\n\t\t}\n\t\tmoveCursor(n) {\n\t\t\tthis.cursor = n;\n\t\t\tthis.value = this.choices[n].value;\n\t\t\tthis.fire();\n\t\t}\n\t\treset() {\n\t\t\tthis.moveCursor(0);\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\texit() {\n\t\t\tthis.abort();\n\t\t}\n\t\tabort() {\n\t\t\tthis.done = this.aborted = true;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tsubmit() {\n\t\t\tif (!this.selection.disabled) {\n\t\t\t\tthis.done = true;\n\t\t\t\tthis.aborted = false;\n\t\t\t\tthis.fire();\n\t\t\t\tthis.render();\n\t\t\t\tthis.out.write(\"\\n\");\n\t\t\t\tthis.close();\n\t\t\t} else this.bell();\n\t\t}\n\t\tfirst() {\n\t\t\tthis.moveCursor(0);\n\t\t\tthis.render();\n\t\t}\n\t\tlast() {\n\t\t\tthis.moveCursor(this.choices.length - 1);\n\t\t\tthis.render();\n\t\t}\n\t\tup() {\n\t\t\tif (this.cursor === 0) this.moveCursor(this.choices.length - 1);\n\t\t\telse this.moveCursor(this.cursor - 1);\n\t\t\tthis.render();\n\t\t}\n\t\tdown() {\n\t\t\tif (this.cursor === this.choices.length - 1) this.moveCursor(0);\n\t\t\telse this.moveCursor(this.cursor + 1);\n\t\t\tthis.render();\n\t\t}\n\t\tnext() {\n\t\t\tthis.moveCursor((this.cursor + 1) % this.choices.length);\n\t\t\tthis.render();\n\t\t}\n\t\t_(c, key) {\n\t\t\tif (c === \" \") return this.submit();\n\t\t}\n\t\tget selection() {\n\t\t\treturn this.choices[this.cursor];\n\t\t}\n\t\trender() {\n\t\t\tif (this.closed) return;\n\t\t\tif (this.firstRender) this.out.write(cursor.hide);\n\t\t\telse this.out.write(clear(this.outputText, this.out.columns));\n\t\t\tsuper.render();\n\t\t\tlet { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage);\n\t\t\tthis.outputText = [\n\t\t\t\tstyle.symbol(this.done, this.aborted),\n\t\t\t\tcolor.bold(this.msg),\n\t\t\t\tstyle.delimiter(false),\n\t\t\t\tthis.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint)\n\t\t\t].join(\" \");\n\t\t\tif (!this.done) {\n\t\t\t\tthis.outputText += \"\\n\";\n\t\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\t\tlet title, prefix, desc = \"\", v = this.choices[i];\n\t\t\t\t\tif (i === startIndex && startIndex > 0) prefix = figures.arrowUp;\n\t\t\t\t\telse if (i === endIndex - 1 && endIndex < this.choices.length) prefix = figures.arrowDown;\n\t\t\t\t\telse prefix = \" \";\n\t\t\t\t\tif (v.disabled) {\n\t\t\t\t\t\ttitle = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n\t\t\t\t\t\tprefix = (this.cursor === i ? color.bold().gray(figures.pointer) + \" \" : \" \") + prefix;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttitle = this.cursor === i ? color.cyan().underline(v.title) : v.title;\n\t\t\t\t\t\tprefix = (this.cursor === i ? color.cyan(figures.pointer) + \" \" : \" \") + prefix;\n\t\t\t\t\t\tif (v.description && this.cursor === i) {\n\t\t\t\t\t\t\tdesc = ` - ${v.description}`;\n\t\t\t\t\t\t\tif (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) desc = \"\\n\" + wrap(v.description, {\n\t\t\t\t\t\t\t\tmargin: 3,\n\t\t\t\t\t\t\t\twidth: this.out.columns\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.outputText += `${prefix} ${title}${color.gray(desc)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.out.write(this.outputText);\n\t\t}\n\t};\n\tmodule.exports = SelectPrompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/toggle.js\nvar require_toggle = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst color = require_kleur();\n\tconst Prompt = require_prompt();\n\tconst { style, clear } = require_util();\n\tconst { cursor, erase } = require_src();\n\t/**\n\t* TogglePrompt Base Element\n\t* @param {Object} opts Options\n\t* @param {String} opts.message Message\n\t* @param {Boolean} [opts.initial=false] Default value\n\t* @param {String} [opts.active='no'] Active label\n\t* @param {String} [opts.inactive='off'] Inactive label\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t*/\n\tvar TogglePrompt = class extends Prompt {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t\tthis.msg = opts.message;\n\t\t\tthis.value = !!opts.initial;\n\t\t\tthis.active = opts.active || \"on\";\n\t\t\tthis.inactive = opts.inactive || \"off\";\n\t\t\tthis.initialValue = this.value;\n\t\t\tthis.render();\n\t\t}\n\t\treset() {\n\t\t\tthis.value = this.initialValue;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\texit() {\n\t\t\tthis.abort();\n\t\t}\n\t\tabort() {\n\t\t\tthis.done = this.aborted = true;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tsubmit() {\n\t\t\tthis.done = true;\n\t\t\tthis.aborted = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tdeactivate() {\n\t\t\tif (this.value === false) return this.bell();\n\t\t\tthis.value = false;\n\t\t\tthis.render();\n\t\t}\n\t\tactivate() {\n\t\t\tif (this.value === true) return this.bell();\n\t\t\tthis.value = true;\n\t\t\tthis.render();\n\t\t}\n\t\tdelete() {\n\t\t\tthis.deactivate();\n\t\t}\n\t\tleft() {\n\t\t\tthis.deactivate();\n\t\t}\n\t\tright() {\n\t\t\tthis.activate();\n\t\t}\n\t\tdown() {\n\t\t\tthis.deactivate();\n\t\t}\n\t\tup() {\n\t\t\tthis.activate();\n\t\t}\n\t\tnext() {\n\t\t\tthis.value = !this.value;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\t_(c, key) {\n\t\t\tif (c === \" \") this.value = !this.value;\n\t\t\telse if (c === \"1\") this.value = true;\n\t\t\telse if (c === \"0\") this.value = false;\n\t\t\telse return this.bell();\n\t\t\tthis.render();\n\t\t}\n\t\trender() {\n\t\t\tif (this.closed) return;\n\t\t\tif (this.firstRender) this.out.write(cursor.hide);\n\t\t\telse this.out.write(clear(this.outputText, this.out.columns));\n\t\t\tsuper.render();\n\t\t\tthis.outputText = [\n\t\t\t\tstyle.symbol(this.done, this.aborted),\n\t\t\t\tcolor.bold(this.msg),\n\t\t\t\tstyle.delimiter(this.done),\n\t\t\t\tthis.value ? this.inactive : color.cyan().underline(this.inactive),\n\t\t\t\tcolor.gray(\"/\"),\n\t\t\t\tthis.value ? color.cyan().underline(this.active) : this.active\n\t\t\t].join(\" \");\n\t\t\tthis.out.write(erase.line + cursor.to(0) + this.outputText);\n\t\t}\n\t};\n\tmodule.exports = TogglePrompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/datepart.js\nvar require_datepart = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = class DatePart {\n\t\tconstructor({ token, date, parts, locales }) {\n\t\t\tthis.token = token;\n\t\t\tthis.date = date || /* @__PURE__ */ new Date();\n\t\t\tthis.parts = parts || [this];\n\t\t\tthis.locales = locales || {};\n\t\t}\n\t\tup() {}\n\t\tdown() {}\n\t\tnext() {\n\t\t\tconst currentIdx = this.parts.indexOf(this);\n\t\t\treturn this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n\t\t}\n\t\tsetTo(val) {}\n\t\tprev() {\n\t\t\tlet parts = [].concat(this.parts).reverse();\n\t\t\tconst currentIdx = parts.indexOf(this);\n\t\t\treturn parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n\t\t}\n\t\ttoString() {\n\t\t\treturn String(this.date);\n\t\t}\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/meridiem.js\nvar require_meridiem = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst DatePart = require_datepart();\n\tvar Meridiem = class extends DatePart {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t}\n\t\tup() {\n\t\t\tthis.date.setHours((this.date.getHours() + 12) % 24);\n\t\t}\n\t\tdown() {\n\t\t\tthis.up();\n\t\t}\n\t\ttoString() {\n\t\t\tlet meridiem = this.date.getHours() > 12 ? \"pm\" : \"am\";\n\t\t\treturn /\\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;\n\t\t}\n\t};\n\tmodule.exports = Meridiem;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/day.js\nvar require_day = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst DatePart = require_datepart();\n\tconst pos = (n) => {\n\t\tn = n % 10;\n\t\treturn n === 1 ? \"st\" : n === 2 ? \"nd\" : n === 3 ? \"rd\" : \"th\";\n\t};\n\tvar Day = class extends DatePart {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t}\n\t\tup() {\n\t\t\tthis.date.setDate(this.date.getDate() + 1);\n\t\t}\n\t\tdown() {\n\t\t\tthis.date.setDate(this.date.getDate() - 1);\n\t\t}\n\t\tsetTo(val) {\n\t\t\tthis.date.setDate(parseInt(val.substr(-2)));\n\t\t}\n\t\ttoString() {\n\t\t\tlet date = this.date.getDate();\n\t\t\tlet day = this.date.getDay();\n\t\t\treturn this.token === \"DD\" ? String(date).padStart(2, \"0\") : this.token === \"Do\" ? date + pos(date) : this.token === \"d\" ? day + 1 : this.token === \"ddd\" ? this.locales.weekdaysShort[day] : this.token === \"dddd\" ? this.locales.weekdays[day] : date;\n\t\t}\n\t};\n\tmodule.exports = Day;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/hours.js\nvar require_hours = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst DatePart = require_datepart();\n\tvar Hours = class extends DatePart {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t}\n\t\tup() {\n\t\t\tthis.date.setHours(this.date.getHours() + 1);\n\t\t}\n\t\tdown() {\n\t\t\tthis.date.setHours(this.date.getHours() - 1);\n\t\t}\n\t\tsetTo(val) {\n\t\t\tthis.date.setHours(parseInt(val.substr(-2)));\n\t\t}\n\t\ttoString() {\n\t\t\tlet hours = this.date.getHours();\n\t\t\tif (/h/.test(this.token)) hours = hours % 12 || 12;\n\t\t\treturn this.token.length > 1 ? String(hours).padStart(2, \"0\") : hours;\n\t\t}\n\t};\n\tmodule.exports = Hours;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/milliseconds.js\nvar require_milliseconds = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst DatePart = require_datepart();\n\tvar Milliseconds = class extends DatePart {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t}\n\t\tup() {\n\t\t\tthis.date.setMilliseconds(this.date.getMilliseconds() + 1);\n\t\t}\n\t\tdown() {\n\t\t\tthis.date.setMilliseconds(this.date.getMilliseconds() - 1);\n\t\t}\n\t\tsetTo(val) {\n\t\t\tthis.date.setMilliseconds(parseInt(val.substr(-this.token.length)));\n\t\t}\n\t\ttoString() {\n\t\t\treturn String(this.date.getMilliseconds()).padStart(4, \"0\").substr(0, this.token.length);\n\t\t}\n\t};\n\tmodule.exports = Milliseconds;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/minutes.js\nvar require_minutes = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst DatePart = require_datepart();\n\tvar Minutes = class extends DatePart {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t}\n\t\tup() {\n\t\t\tthis.date.setMinutes(this.date.getMinutes() + 1);\n\t\t}\n\t\tdown() {\n\t\t\tthis.date.setMinutes(this.date.getMinutes() - 1);\n\t\t}\n\t\tsetTo(val) {\n\t\t\tthis.date.setMinutes(parseInt(val.substr(-2)));\n\t\t}\n\t\ttoString() {\n\t\t\tlet m = this.date.getMinutes();\n\t\t\treturn this.token.length > 1 ? String(m).padStart(2, \"0\") : m;\n\t\t}\n\t};\n\tmodule.exports = Minutes;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/month.js\nvar require_month = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst DatePart = require_datepart();\n\tvar Month = class extends DatePart {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t}\n\t\tup() {\n\t\t\tthis.date.setMonth(this.date.getMonth() + 1);\n\t\t}\n\t\tdown() {\n\t\t\tthis.date.setMonth(this.date.getMonth() - 1);\n\t\t}\n\t\tsetTo(val) {\n\t\t\tval = parseInt(val.substr(-2)) - 1;\n\t\t\tthis.date.setMonth(val < 0 ? 0 : val);\n\t\t}\n\t\ttoString() {\n\t\t\tlet month = this.date.getMonth();\n\t\t\tlet tl = this.token.length;\n\t\t\treturn tl === 2 ? String(month + 1).padStart(2, \"0\") : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1);\n\t\t}\n\t};\n\tmodule.exports = Month;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/seconds.js\nvar require_seconds = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst DatePart = require_datepart();\n\tvar Seconds = class extends DatePart {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t}\n\t\tup() {\n\t\t\tthis.date.setSeconds(this.date.getSeconds() + 1);\n\t\t}\n\t\tdown() {\n\t\t\tthis.date.setSeconds(this.date.getSeconds() - 1);\n\t\t}\n\t\tsetTo(val) {\n\t\t\tthis.date.setSeconds(parseInt(val.substr(-2)));\n\t\t}\n\t\ttoString() {\n\t\t\tlet s = this.date.getSeconds();\n\t\t\treturn this.token.length > 1 ? String(s).padStart(2, \"0\") : s;\n\t\t}\n\t};\n\tmodule.exports = Seconds;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/year.js\nvar require_year = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst DatePart = require_datepart();\n\tvar Year = class extends DatePart {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t}\n\t\tup() {\n\t\t\tthis.date.setFullYear(this.date.getFullYear() + 1);\n\t\t}\n\t\tdown() {\n\t\t\tthis.date.setFullYear(this.date.getFullYear() - 1);\n\t\t}\n\t\tsetTo(val) {\n\t\t\tthis.date.setFullYear(val.substr(-4));\n\t\t}\n\t\ttoString() {\n\t\t\tlet year = String(this.date.getFullYear()).padStart(4, \"0\");\n\t\t\treturn this.token.length === 2 ? year.substr(-2) : year;\n\t\t}\n\t};\n\tmodule.exports = Year;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/dateparts/index.js\nvar require_dateparts = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\tDatePart: require_datepart(),\n\t\tMeridiem: require_meridiem(),\n\t\tDay: require_day(),\n\t\tHours: require_hours(),\n\t\tMilliseconds: require_milliseconds(),\n\t\tMinutes: require_minutes(),\n\t\tMonth: require_month(),\n\t\tSeconds: require_seconds(),\n\t\tYear: require_year()\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/date.js\nvar require_date = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst color = require_kleur();\n\tconst Prompt = require_prompt();\n\tconst { style, clear, figures } = require_util();\n\tconst { erase, cursor } = require_src();\n\tconst { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require_dateparts();\n\tconst regex = /\\\\(.)|\"((?:\\\\[\"\\\\]|[^\"])+)\"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;\n\tconst regexGroups = {\n\t\t1: ({ token }) => token.replace(/\\\\(.)/g, \"$1\"),\n\t\t2: (opts) => new Day(opts),\n\t\t3: (opts) => new Month(opts),\n\t\t4: (opts) => new Year(opts),\n\t\t5: (opts) => new Meridiem(opts),\n\t\t6: (opts) => new Hours(opts),\n\t\t7: (opts) => new Minutes(opts),\n\t\t8: (opts) => new Seconds(opts),\n\t\t9: (opts) => new Milliseconds(opts)\n\t};\n\tconst dfltLocales = {\n\t\tmonths: \"January,February,March,April,May,June,July,August,September,October,November,December\".split(\",\"),\n\t\tmonthsShort: \"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec\".split(\",\"),\n\t\tweekdays: \"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\".split(\",\"),\n\t\tweekdaysShort: \"Sun,Mon,Tue,Wed,Thu,Fri,Sat\".split(\",\")\n\t};\n\t/**\n\t* DatePrompt Base Element\n\t* @param {Object} opts Options\n\t* @param {String} opts.message Message\n\t* @param {Number} [opts.initial] Index of default value\n\t* @param {String} [opts.mask] The format mask\n\t* @param {object} [opts.locales] The date locales\n\t* @param {String} [opts.error] The error message shown on invalid value\n\t* @param {Function} [opts.validate] Function to validate the submitted value\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t*/\n\tvar DatePrompt = class extends Prompt {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t\tthis.msg = opts.message;\n\t\t\tthis.cursor = 0;\n\t\t\tthis.typed = \"\";\n\t\t\tthis.locales = Object.assign(dfltLocales, opts.locales);\n\t\t\tthis._date = opts.initial || /* @__PURE__ */ new Date();\n\t\t\tthis.errorMsg = opts.error || \"Please Enter A Valid Value\";\n\t\t\tthis.validator = opts.validate || (() => true);\n\t\t\tthis.mask = opts.mask || \"YYYY-MM-DD HH:mm:ss\";\n\t\t\tthis.clear = clear(\"\", this.out.columns);\n\t\t\tthis.render();\n\t\t}\n\t\tget value() {\n\t\t\treturn this.date;\n\t\t}\n\t\tget date() {\n\t\t\treturn this._date;\n\t\t}\n\t\tset date(date) {\n\t\t\tif (date) this._date.setTime(date.getTime());\n\t\t}\n\t\tset mask(mask) {\n\t\t\tlet result;\n\t\t\tthis.parts = [];\n\t\t\twhile (result = regex.exec(mask)) {\n\t\t\t\tlet match = result.shift();\n\t\t\t\tlet idx = result.findIndex((gr) => gr != null);\n\t\t\t\tthis.parts.push(idx in regexGroups ? regexGroups[idx]({\n\t\t\t\t\ttoken: result[idx] || match,\n\t\t\t\t\tdate: this.date,\n\t\t\t\t\tparts: this.parts,\n\t\t\t\t\tlocales: this.locales\n\t\t\t\t}) : result[idx] || match);\n\t\t\t}\n\t\t\tlet parts = this.parts.reduce((arr, i) => {\n\t\t\t\tif (typeof i === \"string\" && typeof arr[arr.length - 1] === \"string\") arr[arr.length - 1] += i;\n\t\t\t\telse arr.push(i);\n\t\t\t\treturn arr;\n\t\t\t}, []);\n\t\t\tthis.parts.splice(0);\n\t\t\tthis.parts.push(...parts);\n\t\t\tthis.reset();\n\t\t}\n\t\tmoveCursor(n) {\n\t\t\tthis.typed = \"\";\n\t\t\tthis.cursor = n;\n\t\t\tthis.fire();\n\t\t}\n\t\treset() {\n\t\t\tthis.moveCursor(this.parts.findIndex((p) => p instanceof DatePart));\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\texit() {\n\t\t\tthis.abort();\n\t\t}\n\t\tabort() {\n\t\t\tthis.done = this.aborted = true;\n\t\t\tthis.error = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tasync validate() {\n\t\t\tlet valid = await this.validator(this.value);\n\t\t\tif (typeof valid === \"string\") {\n\t\t\t\tthis.errorMsg = valid;\n\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tthis.error = !valid;\n\t\t}\n\t\tasync submit() {\n\t\t\tawait this.validate();\n\t\t\tif (this.error) {\n\t\t\t\tthis.color = \"red\";\n\t\t\t\tthis.fire();\n\t\t\t\tthis.render();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.done = true;\n\t\t\tthis.aborted = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tup() {\n\t\t\tthis.typed = \"\";\n\t\t\tthis.parts[this.cursor].up();\n\t\t\tthis.render();\n\t\t}\n\t\tdown() {\n\t\t\tthis.typed = \"\";\n\t\t\tthis.parts[this.cursor].down();\n\t\t\tthis.render();\n\t\t}\n\t\tleft() {\n\t\t\tlet prev = this.parts[this.cursor].prev();\n\t\t\tif (prev == null) return this.bell();\n\t\t\tthis.moveCursor(this.parts.indexOf(prev));\n\t\t\tthis.render();\n\t\t}\n\t\tright() {\n\t\t\tlet next = this.parts[this.cursor].next();\n\t\t\tif (next == null) return this.bell();\n\t\t\tthis.moveCursor(this.parts.indexOf(next));\n\t\t\tthis.render();\n\t\t}\n\t\tnext() {\n\t\t\tlet next = this.parts[this.cursor].next();\n\t\t\tthis.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex((part) => part instanceof DatePart));\n\t\t\tthis.render();\n\t\t}\n\t\t_(c) {\n\t\t\tif (/\\d/.test(c)) {\n\t\t\t\tthis.typed += c;\n\t\t\t\tthis.parts[this.cursor].setTo(this.typed);\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t}\n\t\trender() {\n\t\t\tif (this.closed) return;\n\t\t\tif (this.firstRender) this.out.write(cursor.hide);\n\t\t\telse this.out.write(clear(this.outputText, this.out.columns));\n\t\t\tsuper.render();\n\t\t\tthis.outputText = [\n\t\t\t\tstyle.symbol(this.done, this.aborted),\n\t\t\t\tcolor.bold(this.msg),\n\t\t\t\tstyle.delimiter(false),\n\t\t\t\tthis.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), []).join(\"\")\n\t\t\t].join(\" \");\n\t\t\tif (this.error) this.outputText += this.errorMsg.split(\"\\n\").reduce((a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n\t\t\tthis.out.write(erase.line + cursor.to(0) + this.outputText);\n\t\t}\n\t};\n\tmodule.exports = DatePrompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/number.js\nvar require_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst color = require_kleur();\n\tconst Prompt = require_prompt();\n\tconst { cursor, erase } = require_src();\n\tconst { style, figures, clear, lines } = require_util();\n\tconst isNumber = /[0-9]/;\n\tconst isDef = (any) => any !== void 0;\n\tconst round = (number, precision) => {\n\t\tlet factor = Math.pow(10, precision);\n\t\treturn Math.round(number * factor) / factor;\n\t};\n\t/**\n\t* NumberPrompt Base Element\n\t* @param {Object} opts Options\n\t* @param {String} opts.message Message\n\t* @param {String} [opts.style='default'] Render style\n\t* @param {Number} [opts.initial] Default value\n\t* @param {Number} [opts.max=+Infinity] Max value\n\t* @param {Number} [opts.min=-Infinity] Min value\n\t* @param {Boolean} [opts.float=false] Parse input as floats\n\t* @param {Number} [opts.round=2] Round floats to x decimals\n\t* @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n\t* @param {Function} [opts.validate] Validate function\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t* @param {String} [opts.error] The invalid error label\n\t*/\n\tvar NumberPrompt = class extends Prompt {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t\tthis.transform = style.render(opts.style);\n\t\t\tthis.msg = opts.message;\n\t\t\tthis.initial = isDef(opts.initial) ? opts.initial : \"\";\n\t\t\tthis.float = !!opts.float;\n\t\t\tthis.round = opts.round || 2;\n\t\t\tthis.inc = opts.increment || 1;\n\t\t\tthis.min = isDef(opts.min) ? opts.min : -Infinity;\n\t\t\tthis.max = isDef(opts.max) ? opts.max : Infinity;\n\t\t\tthis.errorMsg = opts.error || `Please Enter A Valid Value`;\n\t\t\tthis.validator = opts.validate || (() => true);\n\t\t\tthis.color = `cyan`;\n\t\t\tthis.value = ``;\n\t\t\tthis.typed = ``;\n\t\t\tthis.lastHit = 0;\n\t\t\tthis.render();\n\t\t}\n\t\tset value(v) {\n\t\t\tif (!v && v !== 0) {\n\t\t\t\tthis.placeholder = true;\n\t\t\t\tthis.rendered = color.gray(this.transform.render(`${this.initial}`));\n\t\t\t\tthis._value = ``;\n\t\t\t} else {\n\t\t\t\tthis.placeholder = false;\n\t\t\t\tthis.rendered = this.transform.render(`${round(v, this.round)}`);\n\t\t\t\tthis._value = round(v, this.round);\n\t\t\t}\n\t\t\tthis.fire();\n\t\t}\n\t\tget value() {\n\t\t\treturn this._value;\n\t\t}\n\t\tparse(x) {\n\t\t\treturn this.float ? parseFloat(x) : parseInt(x);\n\t\t}\n\t\tvalid(c) {\n\t\t\treturn c === `-` || c === `.` && this.float || isNumber.test(c);\n\t\t}\n\t\treset() {\n\t\t\tthis.typed = ``;\n\t\t\tthis.value = ``;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\texit() {\n\t\t\tthis.abort();\n\t\t}\n\t\tabort() {\n\t\t\tlet x = this.value;\n\t\t\tthis.value = x !== `` ? x : this.initial;\n\t\t\tthis.done = this.aborted = true;\n\t\t\tthis.error = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(`\\n`);\n\t\t\tthis.close();\n\t\t}\n\t\tasync validate() {\n\t\t\tlet valid = await this.validator(this.value);\n\t\t\tif (typeof valid === `string`) {\n\t\t\t\tthis.errorMsg = valid;\n\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tthis.error = !valid;\n\t\t}\n\t\tasync submit() {\n\t\t\tawait this.validate();\n\t\t\tif (this.error) {\n\t\t\t\tthis.color = `red`;\n\t\t\t\tthis.fire();\n\t\t\t\tthis.render();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet x = this.value;\n\t\t\tthis.value = x !== `` ? x : this.initial;\n\t\t\tthis.done = true;\n\t\t\tthis.aborted = false;\n\t\t\tthis.error = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(`\\n`);\n\t\t\tthis.close();\n\t\t}\n\t\tup() {\n\t\t\tthis.typed = ``;\n\t\t\tif (this.value === \"\") this.value = this.min - this.inc;\n\t\t\tif (this.value >= this.max) return this.bell();\n\t\t\tthis.value += this.inc;\n\t\t\tthis.color = `cyan`;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\tdown() {\n\t\t\tthis.typed = ``;\n\t\t\tif (this.value === \"\") this.value = this.min + this.inc;\n\t\t\tif (this.value <= this.min) return this.bell();\n\t\t\tthis.value -= this.inc;\n\t\t\tthis.color = `cyan`;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\tdelete() {\n\t\t\tlet val = this.value.toString();\n\t\t\tif (val.length === 0) return this.bell();\n\t\t\tthis.value = this.parse(val = val.slice(0, -1)) || ``;\n\t\t\tif (this.value !== \"\" && this.value < this.min) this.value = this.min;\n\t\t\tthis.color = `cyan`;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\tnext() {\n\t\t\tthis.value = this.initial;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\t_(c, key) {\n\t\t\tif (!this.valid(c)) return this.bell();\n\t\t\tconst now = Date.now();\n\t\t\tif (now - this.lastHit > 1e3) this.typed = ``;\n\t\t\tthis.typed += c;\n\t\t\tthis.lastHit = now;\n\t\t\tthis.color = `cyan`;\n\t\t\tif (c === `.`) return this.fire();\n\t\t\tthis.value = Math.min(this.parse(this.typed), this.max);\n\t\t\tif (this.value > this.max) this.value = this.max;\n\t\t\tif (this.value < this.min) this.value = this.min;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\trender() {\n\t\t\tif (this.closed) return;\n\t\t\tif (!this.firstRender) {\n\t\t\t\tif (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n\t\t\t\tthis.out.write(clear(this.outputText, this.out.columns));\n\t\t\t}\n\t\t\tsuper.render();\n\t\t\tthis.outputError = \"\";\n\t\t\tthis.outputText = [\n\t\t\t\tstyle.symbol(this.done, this.aborted),\n\t\t\t\tcolor.bold(this.msg),\n\t\t\t\tstyle.delimiter(this.done),\n\t\t\t\t!this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered\n\t\t\t].join(` `);\n\t\t\tif (this.error) this.outputError += this.errorMsg.split(`\\n`).reduce((a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n\t\t\tthis.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);\n\t\t}\n\t};\n\tmodule.exports = NumberPrompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/multiselect.js\nvar require_multiselect = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst color = require_kleur();\n\tconst { cursor } = require_src();\n\tconst Prompt = require_prompt();\n\tconst { clear, figures, style, wrap, entriesToDisplay } = require_util();\n\t/**\n\t* MultiselectPrompt Base Element\n\t* @param {Object} opts Options\n\t* @param {String} opts.message Message\n\t* @param {Array} opts.choices Array of choice objects\n\t* @param {String} [opts.hint] Hint to display\n\t* @param {String} [opts.warn] Hint shown for disabled choices\n\t* @param {Number} [opts.max] Max choices\n\t* @param {Number} [opts.cursor=0] Cursor start position\n\t* @param {Number} [opts.optionsPerPage=10] Max options to display at once\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t*/\n\tvar MultiselectPrompt = class extends Prompt {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t\tthis.msg = opts.message;\n\t\t\tthis.cursor = opts.cursor || 0;\n\t\t\tthis.scrollIndex = opts.cursor || 0;\n\t\t\tthis.hint = opts.hint || \"\";\n\t\t\tthis.warn = opts.warn || \"- This option is disabled -\";\n\t\t\tthis.minSelected = opts.min;\n\t\t\tthis.showMinError = false;\n\t\t\tthis.maxChoices = opts.max;\n\t\t\tthis.instructions = opts.instructions;\n\t\t\tthis.optionsPerPage = opts.optionsPerPage || 10;\n\t\t\tthis.value = opts.choices.map((ch, idx) => {\n\t\t\t\tif (typeof ch === \"string\") ch = {\n\t\t\t\t\ttitle: ch,\n\t\t\t\t\tvalue: idx\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttitle: ch && (ch.title || ch.value || ch),\n\t\t\t\t\tdescription: ch && ch.description,\n\t\t\t\t\tvalue: ch && (ch.value === void 0 ? idx : ch.value),\n\t\t\t\t\tselected: ch && ch.selected,\n\t\t\t\t\tdisabled: ch && ch.disabled\n\t\t\t\t};\n\t\t\t});\n\t\t\tthis.clear = clear(\"\", this.out.columns);\n\t\t\tif (!opts.overrideRender) this.render();\n\t\t}\n\t\treset() {\n\t\t\tthis.value.map((v) => !v.selected);\n\t\t\tthis.cursor = 0;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\tselected() {\n\t\t\treturn this.value.filter((v) => v.selected);\n\t\t}\n\t\texit() {\n\t\t\tthis.abort();\n\t\t}\n\t\tabort() {\n\t\t\tthis.done = this.aborted = true;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tsubmit() {\n\t\t\tconst selected = this.value.filter((e) => e.selected);\n\t\t\tif (this.minSelected && selected.length < this.minSelected) {\n\t\t\t\tthis.showMinError = true;\n\t\t\t\tthis.render();\n\t\t\t} else {\n\t\t\t\tthis.done = true;\n\t\t\t\tthis.aborted = false;\n\t\t\t\tthis.fire();\n\t\t\t\tthis.render();\n\t\t\t\tthis.out.write(\"\\n\");\n\t\t\t\tthis.close();\n\t\t\t}\n\t\t}\n\t\tfirst() {\n\t\t\tthis.cursor = 0;\n\t\t\tthis.render();\n\t\t}\n\t\tlast() {\n\t\t\tthis.cursor = this.value.length - 1;\n\t\t\tthis.render();\n\t\t}\n\t\tnext() {\n\t\t\tthis.cursor = (this.cursor + 1) % this.value.length;\n\t\t\tthis.render();\n\t\t}\n\t\tup() {\n\t\t\tif (this.cursor === 0) this.cursor = this.value.length - 1;\n\t\t\telse this.cursor--;\n\t\t\tthis.render();\n\t\t}\n\t\tdown() {\n\t\t\tif (this.cursor === this.value.length - 1) this.cursor = 0;\n\t\t\telse this.cursor++;\n\t\t\tthis.render();\n\t\t}\n\t\tleft() {\n\t\t\tthis.value[this.cursor].selected = false;\n\t\t\tthis.render();\n\t\t}\n\t\tright() {\n\t\t\tif (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();\n\t\t\tthis.value[this.cursor].selected = true;\n\t\t\tthis.render();\n\t\t}\n\t\thandleSpaceToggle() {\n\t\t\tconst v = this.value[this.cursor];\n\t\t\tif (v.selected) {\n\t\t\t\tv.selected = false;\n\t\t\t\tthis.render();\n\t\t\t} else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();\n\t\t\telse {\n\t\t\t\tv.selected = true;\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t}\n\t\ttoggleAll() {\n\t\t\tif (this.maxChoices !== void 0 || this.value[this.cursor].disabled) return this.bell();\n\t\t\tconst newSelected = !this.value[this.cursor].selected;\n\t\t\tthis.value.filter((v) => !v.disabled).forEach((v) => v.selected = newSelected);\n\t\t\tthis.render();\n\t\t}\n\t\t_(c, key) {\n\t\t\tif (c === \" \") this.handleSpaceToggle();\n\t\t\telse if (c === \"a\") this.toggleAll();\n\t\t\telse return this.bell();\n\t\t}\n\t\trenderInstructions() {\n\t\t\tif (this.instructions === void 0 || this.instructions) {\n\t\t\t\tif (typeof this.instructions === \"string\") return this.instructions;\n\t\t\t\treturn `\nInstructions:\n ${figures.arrowUp}/${figures.arrowDown}: Highlight option\\n ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\\n` + (this.maxChoices === void 0 ? ` a: Toggle all\\n` : \"\") + ` enter/return: Complete answer`;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\t\trenderOption(cursor, v, i, arrowIndicator) {\n\t\t\tconst prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + \" \" + arrowIndicator + \" \";\n\t\t\tlet title, desc;\n\t\t\tif (v.disabled) title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n\t\t\telse {\n\t\t\t\ttitle = cursor === i ? color.cyan().underline(v.title) : v.title;\n\t\t\t\tif (cursor === i && v.description) {\n\t\t\t\t\tdesc = ` - ${v.description}`;\n\t\t\t\t\tif (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) desc = \"\\n\" + wrap(v.description, {\n\t\t\t\t\t\tmargin: prefix.length,\n\t\t\t\t\t\twidth: this.out.columns\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn prefix + title + color.gray(desc || \"\");\n\t\t}\n\t\tpaginateOptions(options) {\n\t\t\tif (options.length === 0) return color.red(\"No matches for this query.\");\n\t\t\tlet { startIndex, endIndex } = entriesToDisplay(this.cursor, options.length, this.optionsPerPage);\n\t\t\tlet prefix, styledOptions = [];\n\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\tif (i === startIndex && startIndex > 0) prefix = figures.arrowUp;\n\t\t\t\telse if (i === endIndex - 1 && endIndex < options.length) prefix = figures.arrowDown;\n\t\t\t\telse prefix = \" \";\n\t\t\t\tstyledOptions.push(this.renderOption(this.cursor, options[i], i, prefix));\n\t\t\t}\n\t\t\treturn \"\\n\" + styledOptions.join(\"\\n\");\n\t\t}\n\t\trenderOptions(options) {\n\t\t\tif (!this.done) return this.paginateOptions(options);\n\t\t\treturn \"\";\n\t\t}\n\t\trenderDoneOrInstructions() {\n\t\t\tif (this.done) return this.value.filter((e) => e.selected).map((v) => v.title).join(\", \");\n\t\t\tconst output = [color.gray(this.hint), this.renderInstructions()];\n\t\t\tif (this.value[this.cursor].disabled) output.push(color.yellow(this.warn));\n\t\t\treturn output.join(\" \");\n\t\t}\n\t\trender() {\n\t\t\tif (this.closed) return;\n\t\t\tif (this.firstRender) this.out.write(cursor.hide);\n\t\t\tsuper.render();\n\t\t\tlet prompt = [\n\t\t\t\tstyle.symbol(this.done, this.aborted),\n\t\t\t\tcolor.bold(this.msg),\n\t\t\t\tstyle.delimiter(false),\n\t\t\t\tthis.renderDoneOrInstructions()\n\t\t\t].join(\" \");\n\t\t\tif (this.showMinError) {\n\t\t\t\tprompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n\t\t\t\tthis.showMinError = false;\n\t\t\t}\n\t\t\tprompt += this.renderOptions(this.value);\n\t\t\tthis.out.write(this.clear + prompt);\n\t\t\tthis.clear = clear(prompt, this.out.columns);\n\t\t}\n\t};\n\tmodule.exports = MultiselectPrompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/autocomplete.js\nvar require_autocomplete = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst color = require_kleur();\n\tconst Prompt = require_prompt();\n\tconst { erase, cursor } = require_src();\n\tconst { style, clear, figures, wrap, entriesToDisplay } = require_util();\n\tconst getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);\n\tconst getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);\n\tconst getIndex = (arr, valOrTitle) => {\n\t\tconst index = arr.findIndex((el) => el.value === valOrTitle || el.title === valOrTitle);\n\t\treturn index > -1 ? index : void 0;\n\t};\n\t/**\n\t* TextPrompt Base Element\n\t* @param {Object} opts Options\n\t* @param {String} opts.message Message\n\t* @param {Array} opts.choices Array of auto-complete choices objects\n\t* @param {Function} [opts.suggest] Filter function. Defaults to sort by title\n\t* @param {Number} [opts.limit=10] Max number of results to show\n\t* @param {Number} [opts.cursor=0] Cursor start position\n\t* @param {String} [opts.style='default'] Render style\n\t* @param {String} [opts.fallback] Fallback message - initial to default value\n\t* @param {String} [opts.initial] Index of the default value\n\t* @param {Boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t* @param {String} [opts.noMatches] The no matches found label\n\t*/\n\tvar AutocompletePrompt = class extends Prompt {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t\tthis.msg = opts.message;\n\t\t\tthis.suggest = opts.suggest;\n\t\t\tthis.choices = opts.choices;\n\t\t\tthis.initial = typeof opts.initial === \"number\" ? opts.initial : getIndex(opts.choices, opts.initial);\n\t\t\tthis.select = this.initial || opts.cursor || 0;\n\t\t\tthis.i18n = { noMatches: opts.noMatches || \"no matches found\" };\n\t\t\tthis.fallback = opts.fallback || this.initial;\n\t\t\tthis.clearFirst = opts.clearFirst || false;\n\t\t\tthis.suggestions = [];\n\t\t\tthis.input = \"\";\n\t\t\tthis.limit = opts.limit || 10;\n\t\t\tthis.cursor = 0;\n\t\t\tthis.transform = style.render(opts.style);\n\t\t\tthis.scale = this.transform.scale;\n\t\t\tthis.render = this.render.bind(this);\n\t\t\tthis.complete = this.complete.bind(this);\n\t\t\tthis.clear = clear(\"\", this.out.columns);\n\t\t\tthis.complete(this.render);\n\t\t\tthis.render();\n\t\t}\n\t\tset fallback(fb) {\n\t\t\tthis._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;\n\t\t}\n\t\tget fallback() {\n\t\t\tlet choice;\n\t\t\tif (typeof this._fb === \"number\") choice = this.choices[this._fb];\n\t\t\telse if (typeof this._fb === \"string\") choice = { title: this._fb };\n\t\t\treturn choice || this._fb || { title: this.i18n.noMatches };\n\t\t}\n\t\tmoveSelect(i) {\n\t\t\tthis.select = i;\n\t\t\tif (this.suggestions.length > 0) this.value = getVal(this.suggestions, i);\n\t\t\telse this.value = this.fallback.value;\n\t\t\tthis.fire();\n\t\t}\n\t\tasync complete(cb) {\n\t\t\tconst p = this.completing = this.suggest(this.input, this.choices);\n\t\t\tconst suggestions = await p;\n\t\t\tif (this.completing !== p) return;\n\t\t\tthis.suggestions = suggestions.map((s, i, arr) => ({\n\t\t\t\ttitle: getTitle(arr, i),\n\t\t\t\tvalue: getVal(arr, i),\n\t\t\t\tdescription: s.description\n\t\t\t}));\n\t\t\tthis.completing = false;\n\t\t\tconst l = Math.max(suggestions.length - 1, 0);\n\t\t\tthis.moveSelect(Math.min(l, this.select));\n\t\t\tcb && cb();\n\t\t}\n\t\treset() {\n\t\t\tthis.input = \"\";\n\t\t\tthis.complete(() => {\n\t\t\t\tthis.moveSelect(this.initial !== void 0 ? this.initial : 0);\n\t\t\t\tthis.render();\n\t\t\t});\n\t\t\tthis.render();\n\t\t}\n\t\texit() {\n\t\t\tif (this.clearFirst && this.input.length > 0) this.reset();\n\t\t\telse {\n\t\t\t\tthis.done = this.exited = true;\n\t\t\t\tthis.aborted = false;\n\t\t\t\tthis.fire();\n\t\t\t\tthis.render();\n\t\t\t\tthis.out.write(\"\\n\");\n\t\t\t\tthis.close();\n\t\t\t}\n\t\t}\n\t\tabort() {\n\t\t\tthis.done = this.aborted = true;\n\t\t\tthis.exited = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tsubmit() {\n\t\t\tthis.done = true;\n\t\t\tthis.aborted = this.exited = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\t_(c, key) {\n\t\t\tlet s1 = this.input.slice(0, this.cursor);\n\t\t\tlet s2 = this.input.slice(this.cursor);\n\t\t\tthis.input = `${s1}${c}${s2}`;\n\t\t\tthis.cursor = s1.length + 1;\n\t\t\tthis.complete(this.render);\n\t\t\tthis.render();\n\t\t}\n\t\tdelete() {\n\t\t\tif (this.cursor === 0) return this.bell();\n\t\t\tlet s1 = this.input.slice(0, this.cursor - 1);\n\t\t\tlet s2 = this.input.slice(this.cursor);\n\t\t\tthis.input = `${s1}${s2}`;\n\t\t\tthis.complete(this.render);\n\t\t\tthis.cursor = this.cursor - 1;\n\t\t\tthis.render();\n\t\t}\n\t\tdeleteForward() {\n\t\t\tif (this.cursor * this.scale >= this.rendered.length) return this.bell();\n\t\t\tlet s1 = this.input.slice(0, this.cursor);\n\t\t\tlet s2 = this.input.slice(this.cursor + 1);\n\t\t\tthis.input = `${s1}${s2}`;\n\t\t\tthis.complete(this.render);\n\t\t\tthis.render();\n\t\t}\n\t\tfirst() {\n\t\t\tthis.moveSelect(0);\n\t\t\tthis.render();\n\t\t}\n\t\tlast() {\n\t\t\tthis.moveSelect(this.suggestions.length - 1);\n\t\t\tthis.render();\n\t\t}\n\t\tup() {\n\t\t\tif (this.select === 0) this.moveSelect(this.suggestions.length - 1);\n\t\t\telse this.moveSelect(this.select - 1);\n\t\t\tthis.render();\n\t\t}\n\t\tdown() {\n\t\t\tif (this.select === this.suggestions.length - 1) this.moveSelect(0);\n\t\t\telse this.moveSelect(this.select + 1);\n\t\t\tthis.render();\n\t\t}\n\t\tnext() {\n\t\t\tif (this.select === this.suggestions.length - 1) this.moveSelect(0);\n\t\t\telse this.moveSelect(this.select + 1);\n\t\t\tthis.render();\n\t\t}\n\t\tnextPage() {\n\t\t\tthis.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));\n\t\t\tthis.render();\n\t\t}\n\t\tprevPage() {\n\t\t\tthis.moveSelect(Math.max(this.select - this.limit, 0));\n\t\t\tthis.render();\n\t\t}\n\t\tleft() {\n\t\t\tif (this.cursor <= 0) return this.bell();\n\t\t\tthis.cursor = this.cursor - 1;\n\t\t\tthis.render();\n\t\t}\n\t\tright() {\n\t\t\tif (this.cursor * this.scale >= this.rendered.length) return this.bell();\n\t\t\tthis.cursor = this.cursor + 1;\n\t\t\tthis.render();\n\t\t}\n\t\trenderOption(v, hovered, isStart, isEnd) {\n\t\t\tlet desc;\n\t\t\tlet prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : \" \";\n\t\t\tlet title = hovered ? color.cyan().underline(v.title) : v.title;\n\t\t\tprefix = (hovered ? color.cyan(figures.pointer) + \" \" : \" \") + prefix;\n\t\t\tif (v.description) {\n\t\t\t\tdesc = ` - ${v.description}`;\n\t\t\t\tif (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) desc = \"\\n\" + wrap(v.description, {\n\t\t\t\t\tmargin: 3,\n\t\t\t\t\twidth: this.out.columns\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn prefix + \" \" + title + color.gray(desc || \"\");\n\t\t}\n\t\trender() {\n\t\t\tif (this.closed) return;\n\t\t\tif (this.firstRender) this.out.write(cursor.hide);\n\t\t\telse this.out.write(clear(this.outputText, this.out.columns));\n\t\t\tsuper.render();\n\t\t\tlet { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit);\n\t\t\tthis.outputText = [\n\t\t\t\tstyle.symbol(this.done, this.aborted, this.exited),\n\t\t\t\tcolor.bold(this.msg),\n\t\t\t\tstyle.delimiter(this.completing),\n\t\t\t\tthis.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)\n\t\t\t].join(\" \");\n\t\t\tif (!this.done) {\n\t\t\t\tconst suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i) => this.renderOption(item, this.select === i + startIndex, i === 0 && startIndex > 0, i + startIndex === endIndex - 1 && endIndex < this.choices.length)).join(\"\\n\");\n\t\t\t\tthis.outputText += `\\n` + (suggestions || color.gray(this.fallback.title));\n\t\t\t}\n\t\t\tthis.out.write(erase.line + cursor.to(0) + this.outputText);\n\t\t}\n\t};\n\tmodule.exports = AutocompletePrompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/autocompleteMultiselect.js\nvar require_autocompleteMultiselect = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst color = require_kleur();\n\tconst { cursor } = require_src();\n\tconst MultiselectPrompt = require_multiselect();\n\tconst { clear, style, figures } = require_util();\n\t/**\n\t* MultiselectPrompt Base Element\n\t* @param {Object} opts Options\n\t* @param {String} opts.message Message\n\t* @param {Array} opts.choices Array of choice objects\n\t* @param {String} [opts.hint] Hint to display\n\t* @param {String} [opts.warn] Hint shown for disabled choices\n\t* @param {Number} [opts.max] Max choices\n\t* @param {Number} [opts.cursor=0] Cursor start position\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t*/\n\tvar AutocompleteMultiselectPrompt = class extends MultiselectPrompt {\n\t\tconstructor(opts = {}) {\n\t\t\topts.overrideRender = true;\n\t\t\tsuper(opts);\n\t\t\tthis.inputValue = \"\";\n\t\t\tthis.clear = clear(\"\", this.out.columns);\n\t\t\tthis.filteredOptions = this.value;\n\t\t\tthis.render();\n\t\t}\n\t\tlast() {\n\t\t\tthis.cursor = this.filteredOptions.length - 1;\n\t\t\tthis.render();\n\t\t}\n\t\tnext() {\n\t\t\tthis.cursor = (this.cursor + 1) % this.filteredOptions.length;\n\t\t\tthis.render();\n\t\t}\n\t\tup() {\n\t\t\tif (this.cursor === 0) this.cursor = this.filteredOptions.length - 1;\n\t\t\telse this.cursor--;\n\t\t\tthis.render();\n\t\t}\n\t\tdown() {\n\t\t\tif (this.cursor === this.filteredOptions.length - 1) this.cursor = 0;\n\t\t\telse this.cursor++;\n\t\t\tthis.render();\n\t\t}\n\t\tleft() {\n\t\t\tthis.filteredOptions[this.cursor].selected = false;\n\t\t\tthis.render();\n\t\t}\n\t\tright() {\n\t\t\tif (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();\n\t\t\tthis.filteredOptions[this.cursor].selected = true;\n\t\t\tthis.render();\n\t\t}\n\t\tdelete() {\n\t\t\tif (this.inputValue.length) {\n\t\t\t\tthis.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);\n\t\t\t\tthis.updateFilteredOptions();\n\t\t\t}\n\t\t}\n\t\tupdateFilteredOptions() {\n\t\t\tconst currentHighlight = this.filteredOptions[this.cursor];\n\t\t\tthis.filteredOptions = this.value.filter((v) => {\n\t\t\t\tif (this.inputValue) {\n\t\t\t\t\tif (typeof v.title === \"string\") {\n\t\t\t\t\t\tif (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) return true;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof v.value === \"string\") {\n\t\t\t\t\t\tif (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) return true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t\t\tconst newHighlightIndex = this.filteredOptions.findIndex((v) => v === currentHighlight);\n\t\t\tthis.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;\n\t\t\tthis.render();\n\t\t}\n\t\thandleSpaceToggle() {\n\t\t\tconst v = this.filteredOptions[this.cursor];\n\t\t\tif (v.selected) {\n\t\t\t\tv.selected = false;\n\t\t\t\tthis.render();\n\t\t\t} else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();\n\t\t\telse {\n\t\t\t\tv.selected = true;\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t}\n\t\thandleInputChange(c) {\n\t\t\tthis.inputValue = this.inputValue + c;\n\t\t\tthis.updateFilteredOptions();\n\t\t}\n\t\t_(c, key) {\n\t\t\tif (c === \" \") this.handleSpaceToggle();\n\t\t\telse this.handleInputChange(c);\n\t\t}\n\t\trenderInstructions() {\n\t\t\tif (this.instructions === void 0 || this.instructions) {\n\t\t\t\tif (typeof this.instructions === \"string\") return this.instructions;\n\t\t\t\treturn `\nInstructions:\n ${figures.arrowUp}/${figures.arrowDown}: Highlight option\n ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\t\trenderCurrentInput() {\n\t\t\treturn `\nFiltered results for: ${this.inputValue ? this.inputValue : color.gray(\"Enter something to filter\")}\\n`;\n\t\t}\n\t\trenderOption(cursor, v, i, arrowIndicator) {\n\t\t\tconst prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + \" \" + arrowIndicator + \" \";\n\t\t\tlet title;\n\t\t\tif (v.disabled) title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n\t\t\telse title = cursor === i ? color.cyan().underline(v.title) : v.title;\n\t\t\treturn prefix + title;\n\t\t}\n\t\trenderDoneOrInstructions() {\n\t\t\tif (this.done) return this.value.filter((e) => e.selected).map((v) => v.title).join(\", \");\n\t\t\tconst output = [\n\t\t\t\tcolor.gray(this.hint),\n\t\t\t\tthis.renderInstructions(),\n\t\t\t\tthis.renderCurrentInput()\n\t\t\t];\n\t\t\tif (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) output.push(color.yellow(this.warn));\n\t\t\treturn output.join(\" \");\n\t\t}\n\t\trender() {\n\t\t\tif (this.closed) return;\n\t\t\tif (this.firstRender) this.out.write(cursor.hide);\n\t\t\tsuper.render();\n\t\t\tlet prompt = [\n\t\t\t\tstyle.symbol(this.done, this.aborted),\n\t\t\t\tcolor.bold(this.msg),\n\t\t\t\tstyle.delimiter(false),\n\t\t\t\tthis.renderDoneOrInstructions()\n\t\t\t].join(\" \");\n\t\t\tif (this.showMinError) {\n\t\t\t\tprompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n\t\t\t\tthis.showMinError = false;\n\t\t\t}\n\t\t\tprompt += this.renderOptions(this.filteredOptions);\n\t\t\tthis.out.write(this.clear + prompt);\n\t\t\tthis.clear = clear(prompt, this.out.columns);\n\t\t}\n\t};\n\tmodule.exports = AutocompleteMultiselectPrompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/confirm.js\nvar require_confirm = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst color = require_kleur();\n\tconst Prompt = require_prompt();\n\tconst { style, clear } = require_util();\n\tconst { erase, cursor } = require_src();\n\t/**\n\t* ConfirmPrompt Base Element\n\t* @param {Object} opts Options\n\t* @param {String} opts.message Message\n\t* @param {Boolean} [opts.initial] Default value (true/false)\n\t* @param {Stream} [opts.stdin] The Readable stream to listen to\n\t* @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t* @param {String} [opts.yes] The \"Yes\" label\n\t* @param {String} [opts.yesOption] The \"Yes\" option when choosing between yes/no\n\t* @param {String} [opts.no] The \"No\" label\n\t* @param {String} [opts.noOption] The \"No\" option when choosing between yes/no\n\t*/\n\tvar ConfirmPrompt = class extends Prompt {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper(opts);\n\t\t\tthis.msg = opts.message;\n\t\t\tthis.value = opts.initial;\n\t\t\tthis.initialValue = !!opts.initial;\n\t\t\tthis.yesMsg = opts.yes || \"yes\";\n\t\t\tthis.yesOption = opts.yesOption || \"(Y/n)\";\n\t\t\tthis.noMsg = opts.no || \"no\";\n\t\t\tthis.noOption = opts.noOption || \"(y/N)\";\n\t\t\tthis.render();\n\t\t}\n\t\treset() {\n\t\t\tthis.value = this.initialValue;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t}\n\t\texit() {\n\t\t\tthis.abort();\n\t\t}\n\t\tabort() {\n\t\t\tthis.done = this.aborted = true;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\tsubmit() {\n\t\t\tthis.value = this.value || false;\n\t\t\tthis.done = true;\n\t\t\tthis.aborted = false;\n\t\t\tthis.fire();\n\t\t\tthis.render();\n\t\t\tthis.out.write(\"\\n\");\n\t\t\tthis.close();\n\t\t}\n\t\t_(c, key) {\n\t\t\tif (c.toLowerCase() === \"y\") {\n\t\t\t\tthis.value = true;\n\t\t\t\treturn this.submit();\n\t\t\t}\n\t\t\tif (c.toLowerCase() === \"n\") {\n\t\t\t\tthis.value = false;\n\t\t\t\treturn this.submit();\n\t\t\t}\n\t\t\treturn this.bell();\n\t\t}\n\t\trender() {\n\t\t\tif (this.closed) return;\n\t\t\tif (this.firstRender) this.out.write(cursor.hide);\n\t\t\telse this.out.write(clear(this.outputText, this.out.columns));\n\t\t\tsuper.render();\n\t\t\tthis.outputText = [\n\t\t\t\tstyle.symbol(this.done, this.aborted),\n\t\t\t\tcolor.bold(this.msg),\n\t\t\t\tstyle.delimiter(this.done),\n\t\t\t\tthis.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption)\n\t\t\t].join(\" \");\n\t\t\tthis.out.write(erase.line + cursor.to(0) + this.outputText);\n\t\t}\n\t};\n\tmodule.exports = ConfirmPrompt;\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/elements/index.js\nvar require_elements = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\tTextPrompt: require_text(),\n\t\tSelectPrompt: require_select(),\n\t\tTogglePrompt: require_toggle(),\n\t\tDatePrompt: require_date(),\n\t\tNumberPrompt: require_number(),\n\t\tMultiselectPrompt: require_multiselect(),\n\t\tAutocompletePrompt: require_autocomplete(),\n\t\tAutocompleteMultiselectPrompt: require_autocompleteMultiselect(),\n\t\tConfirmPrompt: require_confirm()\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/prompts.js\nvar require_prompts$1 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tconst $ = exports;\n\tconst el = require_elements();\n\tconst noop = (v) => v;\n\tfunction toPrompt(type, args, opts = {}) {\n\t\treturn new Promise((res, rej) => {\n\t\t\tconst p = new el[type](args);\n\t\t\tconst onAbort = opts.onAbort || noop;\n\t\t\tconst onSubmit = opts.onSubmit || noop;\n\t\t\tconst onExit = opts.onExit || noop;\n\t\t\tp.on(\"state\", args.onState || noop);\n\t\t\tp.on(\"submit\", (x) => res(onSubmit(x)));\n\t\t\tp.on(\"exit\", (x) => res(onExit(x)));\n\t\t\tp.on(\"abort\", (x) => rej(onAbort(x)));\n\t\t});\n\t}\n\t/**\n\t* Text prompt\n\t* @param {string} args.message Prompt message to display\n\t* @param {string} [args.initial] Default string value\n\t* @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t* @param {function} [args.onState] On state change callback\n\t* @param {function} [args.validate] Function to validate user input\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.text = (args) => toPrompt(\"TextPrompt\", args);\n\t/**\n\t* Password prompt with masked input\n\t* @param {string} args.message Prompt message to display\n\t* @param {string} [args.initial] Default string value\n\t* @param {function} [args.onState] On state change callback\n\t* @param {function} [args.validate] Function to validate user input\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.password = (args) => {\n\t\targs.style = \"password\";\n\t\treturn $.text(args);\n\t};\n\t/**\n\t* Prompt where input is invisible, like sudo\n\t* @param {string} args.message Prompt message to display\n\t* @param {string} [args.initial] Default string value\n\t* @param {function} [args.onState] On state change callback\n\t* @param {function} [args.validate] Function to validate user input\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.invisible = (args) => {\n\t\targs.style = \"invisible\";\n\t\treturn $.text(args);\n\t};\n\t/**\n\t* Number prompt\n\t* @param {string} args.message Prompt message to display\n\t* @param {number} args.initial Default number value\n\t* @param {function} [args.onState] On state change callback\n\t* @param {number} [args.max] Max value\n\t* @param {number} [args.min] Min value\n\t* @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t* @param {Boolean} [opts.float=false] Parse input as floats\n\t* @param {Number} [opts.round=2] Round floats to x decimals\n\t* @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n\t* @param {function} [args.validate] Function to validate user input\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.number = (args) => toPrompt(\"NumberPrompt\", args);\n\t/**\n\t* Date prompt\n\t* @param {string} args.message Prompt message to display\n\t* @param {number} args.initial Default number value\n\t* @param {function} [args.onState] On state change callback\n\t* @param {number} [args.max] Max value\n\t* @param {number} [args.min] Min value\n\t* @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t* @param {Boolean} [opts.float=false] Parse input as floats\n\t* @param {Number} [opts.round=2] Round floats to x decimals\n\t* @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n\t* @param {function} [args.validate] Function to validate user input\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.date = (args) => toPrompt(\"DatePrompt\", args);\n\t/**\n\t* Classic yes/no prompt\n\t* @param {string} args.message Prompt message to display\n\t* @param {boolean} [args.initial=false] Default value\n\t* @param {function} [args.onState] On state change callback\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.confirm = (args) => toPrompt(\"ConfirmPrompt\", args);\n\t/**\n\t* List prompt, split intput string by `seperator`\n\t* @param {string} args.message Prompt message to display\n\t* @param {string} [args.initial] Default string value\n\t* @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t* @param {string} [args.separator] String separator\n\t* @param {function} [args.onState] On state change callback\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input, in form of an `Array`\n\t*/\n\t$.list = (args) => {\n\t\tconst sep = args.separator || \",\";\n\t\treturn toPrompt(\"TextPrompt\", args, { onSubmit: (str) => str.split(sep).map((s) => s.trim()) });\n\t};\n\t/**\n\t* Toggle/switch prompt\n\t* @param {string} args.message Prompt message to display\n\t* @param {boolean} [args.initial=false] Default value\n\t* @param {string} [args.active=\"on\"] Text for `active` state\n\t* @param {string} [args.inactive=\"off\"] Text for `inactive` state\n\t* @param {function} [args.onState] On state change callback\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.toggle = (args) => toPrompt(\"TogglePrompt\", args);\n\t/**\n\t* Interactive select prompt\n\t* @param {string} args.message Prompt message to display\n\t* @param {Array} args.choices Array of choices objects `[{ title, value }, ...]`\n\t* @param {number} [args.initial] Index of default value\n\t* @param {String} [args.hint] Hint to display\n\t* @param {function} [args.onState] On state change callback\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.select = (args) => toPrompt(\"SelectPrompt\", args);\n\t/**\n\t* Interactive multi-select / autocompleteMultiselect prompt\n\t* @param {string} args.message Prompt message to display\n\t* @param {Array} args.choices Array of choices objects `[{ title, value, [selected] }, ...]`\n\t* @param {number} [args.max] Max select\n\t* @param {string} [args.hint] Hint to display user\n\t* @param {Number} [args.cursor=0] Cursor start position\n\t* @param {function} [args.onState] On state change callback\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.multiselect = (args) => {\n\t\targs.choices = [].concat(args.choices || []);\n\t\tconst toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);\n\t\treturn toPrompt(\"MultiselectPrompt\", args, {\n\t\t\tonAbort: toSelected,\n\t\t\tonSubmit: toSelected\n\t\t});\n\t};\n\t$.autocompleteMultiselect = (args) => {\n\t\targs.choices = [].concat(args.choices || []);\n\t\tconst toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);\n\t\treturn toPrompt(\"AutocompleteMultiselectPrompt\", args, {\n\t\t\tonAbort: toSelected,\n\t\t\tonSubmit: toSelected\n\t\t});\n\t};\n\tconst byTitle = (input, choices) => Promise.resolve(choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase()));\n\t/**\n\t* Interactive auto-complete prompt\n\t* @param {string} args.message Prompt message to display\n\t* @param {Array} args.choices Array of auto-complete choices objects `[{ title, value }, ...]`\n\t* @param {Function} [args.suggest] Function to filter results based on user input. Defaults to sort by `title`\n\t* @param {number} [args.limit=10] Max number of results to show\n\t* @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t* @param {String} [args.initial] Index of the default value\n\t* @param {boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n\t* @param {String} [args.fallback] Fallback message - defaults to initial value\n\t* @param {function} [args.onState] On state change callback\n\t* @param {Stream} [args.stdin] The Readable stream to listen to\n\t* @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t* @returns {Promise} Promise with user input\n\t*/\n\t$.autocomplete = (args) => {\n\t\targs.suggest = args.suggest || byTitle;\n\t\targs.choices = [].concat(args.choices || []);\n\t\treturn toPrompt(\"AutocompletePrompt\", args);\n\t};\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/lib/index.js\nvar require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst prompts = require_prompts$1();\n\tconst passOn = [\n\t\t\"suggest\",\n\t\t\"format\",\n\t\t\"onState\",\n\t\t\"validate\",\n\t\t\"onRender\",\n\t\t\"type\"\n\t];\n\tconst noop = () => {};\n\t/**\n\t* Prompt for a series of questions\n\t* @param {Array|Object} questions Single question object or Array of question objects\n\t* @param {Function} [onSubmit] Callback function called on prompt submit\n\t* @param {Function} [onCancel] Callback function called on cancel/abort\n\t* @returns {Object} Object with values from user input\n\t*/\n\tasync function prompt(questions = [], { onSubmit = noop, onCancel = noop } = {}) {\n\t\tconst answers = {};\n\t\tconst override = prompt._override || {};\n\t\tquestions = [].concat(questions);\n\t\tlet answer, question, quit, name, type, lastPrompt;\n\t\tconst getFormattedAnswer = async (question, answer, skipValidation = false) => {\n\t\t\tif (!skipValidation && question.validate && question.validate(answer) !== true) return;\n\t\t\treturn question.format ? await question.format(answer, answers) : answer;\n\t\t};\n\t\tfor (question of questions) {\n\t\t\t({name, type} = question);\n\t\t\tif (typeof type === \"function\") {\n\t\t\t\ttype = await type(answer, { ...answers }, question);\n\t\t\t\tquestion[\"type\"] = type;\n\t\t\t}\n\t\t\tif (!type) continue;\n\t\t\tfor (let key in question) {\n\t\t\t\tif (passOn.includes(key)) continue;\n\t\t\t\tlet value = question[key];\n\t\t\t\tquestion[key] = typeof value === \"function\" ? await value(answer, { ...answers }, lastPrompt) : value;\n\t\t\t}\n\t\t\tlastPrompt = question;\n\t\t\tif (typeof question.message !== \"string\") throw new Error(\"prompt message is required\");\n\t\t\t({name, type} = question);\n\t\t\tif (prompts[type] === void 0) throw new Error(`prompt type (${type}) is not defined`);\n\t\t\tif (override[question.name] !== void 0) {\n\t\t\t\tanswer = await getFormattedAnswer(question, override[question.name]);\n\t\t\t\tif (answer !== void 0) {\n\t\t\t\t\tanswers[name] = answer;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tanswer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts[type](question);\n\t\t\t\tanswers[name] = answer = await getFormattedAnswer(question, answer, true);\n\t\t\t\tquit = await onSubmit(question, answer, answers);\n\t\t\t} catch (err) {\n\t\t\t\tquit = !await onCancel(question, answers);\n\t\t\t}\n\t\t\tif (quit) return answers;\n\t\t}\n\t\treturn answers;\n\t}\n\tfunction getInjectedAnswer(injected, deafultValue) {\n\t\tconst answer = injected.shift();\n\t\tif (answer instanceof Error) throw answer;\n\t\treturn answer === void 0 ? deafultValue : answer;\n\t}\n\tfunction inject(answers) {\n\t\tprompt._injected = (prompt._injected || []).concat(answers);\n\t}\n\tfunction override(answers) {\n\t\tprompt._override = Object.assign({}, answers);\n\t}\n\tmodule.exports = Object.assign(prompt, {\n\t\tprompt,\n\t\tprompts,\n\t\tinject,\n\t\toverride\n\t});\n}));\n//#endregion\n//#region node_modules/.pnpm/@posva+prompts@2.4.4/node_modules/@posva/prompts/index.js\nvar require_prompts = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = require_lib$1();\n}));\n//#endregion\n//#region node_modules/.pnpm/isexe@4.0.0/node_modules/isexe/dist/commonjs/index.min.js\nvar require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tvar a = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);\n\tvar _ = a((i) => {\n\t\t\"use strict\";\n\t\tObject.defineProperty(i, \"__esModule\", { value: !0 });\n\t\ti.sync = i.isexe = void 0;\n\t\tvar M = __require(\"node:fs\"), x = __require(\"node:fs/promises\"), q = async (t, e = {}) => {\n\t\t\tlet { ignoreErrors: r = !1 } = e;\n\t\t\ttry {\n\t\t\t\treturn d(await (0, x.stat)(t), e);\n\t\t\t} catch (s) {\n\t\t\t\tlet n = s;\n\t\t\t\tif (r || n.code === \"EACCES\") return !1;\n\t\t\t\tthrow n;\n\t\t\t}\n\t\t};\n\t\ti.isexe = q;\n\t\tvar m = (t, e = {}) => {\n\t\t\tlet { ignoreErrors: r = !1 } = e;\n\t\t\ttry {\n\t\t\t\treturn d((0, M.statSync)(t), e);\n\t\t\t} catch (s) {\n\t\t\t\tlet n = s;\n\t\t\t\tif (r || n.code === \"EACCES\") return !1;\n\t\t\t\tthrow n;\n\t\t\t}\n\t\t};\n\t\ti.sync = m;\n\t\tvar d = (t, e) => t.isFile() && A(t, e), A = (t, e) => {\n\t\t\tlet r = e.uid ?? process.getuid?.(), s = e.groups ?? process.getgroups?.() ?? [], n = e.gid ?? process.getgid?.() ?? s[0];\n\t\t\tif (r === void 0 || n === void 0) throw new Error(\"cannot get uid or gid\");\n\t\t\tlet u = /* @__PURE__ */ new Set([n, ...s]), c = t.mode, S = t.uid, P = t.gid, f = parseInt(\"100\", 8), l = parseInt(\"010\", 8);\n\t\t\treturn !!(c & parseInt(\"001\", 8) || c & l && u.has(P) || c & f && S === r || c & 72 && r === 0);\n\t\t};\n\t});\n\tvar g = a((o) => {\n\t\t\"use strict\";\n\t\tObject.defineProperty(o, \"__esModule\", { value: !0 });\n\t\to.sync = o.isexe = void 0;\n\t\tvar T = __require(\"node:fs\"), I = __require(\"node:fs/promises\"), D = __require(\"node:path\"), F = async (t, e = {}) => {\n\t\t\tlet { ignoreErrors: r = !1 } = e;\n\t\t\ttry {\n\t\t\t\treturn y(await (0, I.stat)(t), t, e);\n\t\t\t} catch (s) {\n\t\t\t\tlet n = s;\n\t\t\t\tif (r || n.code === \"EACCES\") return !1;\n\t\t\t\tthrow n;\n\t\t\t}\n\t\t};\n\t\to.isexe = F;\n\t\tvar L = (t, e = {}) => {\n\t\t\tlet { ignoreErrors: r = !1 } = e;\n\t\t\ttry {\n\t\t\t\treturn y((0, T.statSync)(t), t, e);\n\t\t\t} catch (s) {\n\t\t\t\tlet n = s;\n\t\t\t\tif (r || n.code === \"EACCES\") return !1;\n\t\t\t\tthrow n;\n\t\t\t}\n\t\t};\n\t\to.sync = L;\n\t\tvar B = (t, e) => {\n\t\t\tlet { pathExt: r = process.env.PATHEXT || \"\" } = e, s = r.split(D.delimiter);\n\t\t\tif (s.indexOf(\"\") !== -1) return !0;\n\t\t\tfor (let n of s) {\n\t\t\t\tlet u = n.toLowerCase(), c = t.substring(t.length - u.length).toLowerCase();\n\t\t\t\tif (u && c === u) return !0;\n\t\t\t}\n\t\t\treturn !1;\n\t\t}, y = (t, e, r) => t.isFile() && B(e, r);\n\t});\n\tvar p = a((h) => {\n\t\t\"use strict\";\n\t\tObject.defineProperty(h, \"__esModule\", { value: !0 });\n\t});\n\tvar v = exports && exports.__createBinding || (Object.create ? (function(t, e, r, s) {\n\t\ts === void 0 && (s = r);\n\t\tvar n = Object.getOwnPropertyDescriptor(e, r);\n\t\t(!n || (\"get\" in n ? !e.__esModule : n.writable || n.configurable)) && (n = {\n\t\t\tenumerable: !0,\n\t\t\tget: function() {\n\t\t\t\treturn e[r];\n\t\t\t}\n\t\t}), Object.defineProperty(t, s, n);\n\t}) : (function(t, e, r, s) {\n\t\ts === void 0 && (s = r), t[s] = e[r];\n\t}));\n\tvar G = exports && exports.__setModuleDefault || (Object.create ? (function(t, e) {\n\t\tObject.defineProperty(t, \"default\", {\n\t\t\tenumerable: !0,\n\t\t\tvalue: e\n\t\t});\n\t}) : function(t, e) {\n\t\tt.default = e;\n\t});\n\tvar w = exports && exports.__importStar || (function() {\n\t\tvar t = function(e) {\n\t\t\treturn t = Object.getOwnPropertyNames || function(r) {\n\t\t\t\tvar s = [];\n\t\t\t\tfor (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (s[s.length] = n);\n\t\t\t\treturn s;\n\t\t\t}, t(e);\n\t\t};\n\t\treturn function(e) {\n\t\t\tif (e && e.__esModule) return e;\n\t\t\tvar r = {};\n\t\t\tif (e != null) for (var s = t(e), n = 0; n < s.length; n++) s[n] !== \"default\" && v(r, e, s[n]);\n\t\t\treturn G(r, e), r;\n\t\t};\n\t})();\n\tvar X = exports && exports.__exportStar || function(t, e) {\n\t\tfor (var r in t) r !== \"default\" && !Object.prototype.hasOwnProperty.call(e, r) && v(e, t, r);\n\t};\n\tObject.defineProperty(exports, \"__esModule\", { value: !0 });\n\texports.sync = exports.isexe = exports.posix = exports.win32 = void 0;\n\tvar E = w(_());\n\texports.posix = E;\n\tvar O = w(g());\n\texports.win32 = O;\n\tX(p(), exports);\n\tvar b = (process.env._ISEXE_TEST_PLATFORM_ || process.platform) === \"win32\" ? O : E;\n\texports.isexe = b.isexe;\n\texports.sync = b.sync;\n}));\n//#endregion\n//#region src/utils.ts\nvar import_lib = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst { isexe, sync: isexeSync } = require_index_min();\n\tconst { join: join$1, delimiter, sep, posix } = __require(\"path\");\n\tconst isWindows = process.platform === \"win32\";\n\t/* istanbul ignore next */\n\tconst rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? \"\" : sep}]`.replace(/(\\\\)/g, \"\\\\$1\"));\n\tconst rRel = new RegExp(`^\\\\.${rSlash.source}`);\n\tconst getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: \"ENOENT\" });\n\tconst getPathInfo = (cmd, { path: optPath = process.env.PATH, pathExt: optPathExt = process.env.PATHEXT, delimiter: optDelimiter = delimiter }) => {\n\t\tconst pathEnv = cmd.match(rSlash) ? [\"\"] : [...isWindows ? [process.cwd()] : [], ...(optPath || \"\").split(optDelimiter)];\n\t\tif (isWindows) {\n\t\t\tconst pathExtExe = optPathExt || [\n\t\t\t\t\".EXE\",\n\t\t\t\t\".CMD\",\n\t\t\t\t\".BAT\",\n\t\t\t\t\".COM\"\n\t\t\t].join(optDelimiter);\n\t\t\tconst pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);\n\t\t\tif (cmd.includes(\".\") && pathExt[0] !== \"\") pathExt.unshift(\"\");\n\t\t\treturn {\n\t\t\t\tpathEnv,\n\t\t\t\tpathExt,\n\t\t\t\tpathExtExe\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tpathEnv,\n\t\t\tpathExt: [\"\"]\n\t\t};\n\t};\n\tconst getPathPart = (raw, cmd) => {\n\t\tconst pathPart = /^\".*\"$/.test(raw) ? raw.slice(1, -1) : raw;\n\t\treturn (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : \"\") + join$1(pathPart, cmd);\n\t};\n\tconst which = async (cmd, opt = {}) => {\n\t\tconst { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);\n\t\tconst found = [];\n\t\tfor (const envPart of pathEnv) {\n\t\t\tconst p = getPathPart(envPart, cmd);\n\t\t\tfor (const ext of pathExt) {\n\t\t\t\tconst withExt = p + ext;\n\t\t\t\tif (await isexe(withExt, {\n\t\t\t\t\tpathExt: pathExtExe,\n\t\t\t\t\tignoreErrors: true\n\t\t\t\t})) {\n\t\t\t\t\tif (!opt.all) return withExt;\n\t\t\t\t\tfound.push(withExt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (opt.all && found.length) return found;\n\t\tif (opt.nothrow) return null;\n\t\tthrow getNotFoundError(cmd);\n\t};\n\tconst whichSync = (cmd, opt = {}) => {\n\t\tconst { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);\n\t\tconst found = [];\n\t\tfor (const pathEnvPart of pathEnv) {\n\t\t\tconst p = getPathPart(pathEnvPart, cmd);\n\t\t\tfor (const ext of pathExt) {\n\t\t\t\tconst withExt = p + ext;\n\t\t\t\tif (isexeSync(withExt, {\n\t\t\t\t\tpathExt: pathExtExe,\n\t\t\t\t\tignoreErrors: true\n\t\t\t\t})) {\n\t\t\t\t\tif (!opt.all) return withExt;\n\t\t\t\t\tfound.push(withExt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (opt.all && found.length) return found;\n\t\tif (opt.nothrow) return null;\n\t\tthrow getNotFoundError(cmd);\n\t};\n\tmodule.exports = which;\n\twhich.sync = whichSync;\n})))(), 1);\nconst CLI_TEMP_DIR = join(os.tmpdir(), \"antfu-ni\");\nfunction remove(arr, v) {\n\tconst index = arr.indexOf(v);\n\tif (index >= 0) arr.splice(index, 1);\n\treturn arr;\n}\nfunction exclude(arr, ...v) {\n\treturn arr.slice().filter((item) => !v.includes(item));\n}\nfunction cmdExists(cmd) {\n\treturn import_lib.default.sync(cmd, { nothrow: true }) !== null;\n}\nlet counter = 0;\nasync function openTemp() {\n\tif (!existsSync(CLI_TEMP_DIR)) await promises.mkdir(CLI_TEMP_DIR, { recursive: true });\n\tconst competitivePath = join(CLI_TEMP_DIR, `.${process$1.pid}.${counter}`);\n\tcounter += 1;\n\treturn promises.open(competitivePath, \"wx\").then((fd) => ({\n\t\tfd,\n\t\tpath: competitivePath,\n\t\tcleanup() {\n\t\t\tfd.close().then(() => {\n\t\t\t\tif (existsSync(competitivePath)) promises.unlink(competitivePath);\n\t\t\t});\n\t\t}\n\t})).catch((error) => {\n\t\tif (error && error.code === \"EEXIST\") return openTemp();\n\t\telse return void 0;\n\t});\n}\n/**\n* Write file safely avoiding conflicts\n*/\nasync function writeFileSafe(path, data = \"\") {\n\tconst temp = await openTemp();\n\tif (temp) promises.writeFile(temp.path, data).then(() => {\n\t\tconst directory = dirname(path);\n\t\tif (!existsSync(directory)) promises.mkdir(directory, { recursive: true });\n\t\treturn promises.rename(temp.path, path).then(() => true).catch(() => false);\n\t}).catch(() => false).finally(temp.cleanup);\n\treturn false;\n}\nfunction limitText(text, maxWidth) {\n\tif (text.length <= maxWidth) return text;\n\treturn `${text.slice(0, maxWidth)}${styleText(\"dim\", \"…\")}`;\n}\nfunction terminalLink(text, url, options) {\n\tif (process$1.env.FORCE_HYPERLINK || process$1.stdout.isTTY && !process$1.env.NO_HYPERLINK) return `\\u001B]8;;${url}\\u0007${text}\\u001B]8;;\\u0007`;\n\tif (options?.fallback) return options.fallback(text, url);\n\treturn `${text} (${url})`;\n}\nfunction formatPackageWithUrl(pkg, url, limits = 80) {\n\treturn url ? terminalLink(pkg, url, { fallback: (_, url) => pkg.length + url.length > limits ? pkg : `${pkg} ${styleText(\"dim\", `- ${url}`)}` }) : pkg;\n}\n//#endregion\n//#region src/detect.ts\nvar import_prompts = /* @__PURE__ */ __toESM(require_prompts(), 1);\nconst INSTALL_PACKAGES = { aube: \"@endevco/aube\" };\nasync function detect$1({ autoInstall, programmatic, cwd } = {}) {\n\tconst targetDir = cwd ?? process$1.cwd();\n\tif (existsSync(path.join(targetDir, \"deno.json\")) || existsSync(path.join(targetDir, \"deno.jsonc\"))) return \"deno\";\n\tconst { name, agent, version } = await detect({\n\t\tcwd,\n\t\tonUnknown: (packageManager) => {\n\t\t\tif (!programmatic) console.warn(\"[ni] Unknown packageManager:\", packageManager);\n\t\t}\n\t}) || {};\n\tif (name && !cmdExists(name) && !programmatic) {\n\t\tif (!autoInstall) {\n\t\t\tconsole.warn(`[ni] Detected ${name} but it doesn't seem to be installed.\\n`);\n\t\t\tif (process$1.env.CI) process$1.exit(1);\n\t\t\tconst { tryInstall } = await (0, import_prompts.default)({\n\t\t\t\tname: \"tryInstall\",\n\t\t\t\ttype: \"confirm\",\n\t\t\t\tmessage: `Would you like to globally install ${terminalLink(name, INSTALL_PAGE[name])}?`\n\t\t\t});\n\t\t\tif (!tryInstall) process$1.exit(1);\n\t\t}\n\t\tawait x(\"npm\", [\n\t\t\t\"i\",\n\t\t\t\"-g\",\n\t\t\t`${INSTALL_PACKAGES[name] ?? name}${version ? `@${version}` : \"\"}`\n\t\t], {\n\t\t\tnodeOptions: {\n\t\t\t\tstdio: \"inherit\",\n\t\t\t\tcwd\n\t\t\t},\n\t\t\tthrowOnError: true\n\t\t});\n\t}\n\treturn agent;\n}\n//#endregion\n//#region src/config.ts\nvar import_ini = /* @__PURE__ */ __toESM(require_ini(), 1);\nconst customRcPath = process$1.env.NI_CONFIG_FILE;\nconst home = process$1.platform === \"win32\" ? process$1.env.USERPROFILE : process$1.env.HOME;\nconst defaultRcPath = path.join(home || \"~/\", \".nirc\");\nconst rcPath = customRcPath || defaultRcPath;\nconst defaultConfig = {\n\tdefaultAgent: \"prompt\",\n\tglobalAgent: \"npm\",\n\trunAgent: void 0,\n\tuseSfw: false,\n\tcatalog: true,\n\tnoLastCommand: false\n};\nlet config;\nasync function getConfig() {\n\tif (!config) {\n\t\tconfig = {\n\t\t\t...defaultConfig,\n\t\t\t...fs.existsSync(rcPath) ? import_ini.default.parse(fs.readFileSync(rcPath, \"utf-8\")) : null\n\t\t};\n\t\tif (process$1.env.NI_DEFAULT_AGENT) config.defaultAgent = process$1.env.NI_DEFAULT_AGENT;\n\t\tif (process$1.env.NI_GLOBAL_AGENT) config.globalAgent = process$1.env.NI_GLOBAL_AGENT;\n\t\tif (process$1.env.NI_RUN_AGENT === \"node\") config.runAgent = process$1.env.NI_RUN_AGENT;\n\t\tif (process$1.env.NI_USE_SFW !== void 0) config.useSfw = process$1.env.NI_USE_SFW === \"true\";\n\t\tif (process$1.env.NI_CATALOG !== void 0) config.catalog = process$1.env.NI_CATALOG !== \"false\";\n\t\tif (process$1.env.NI_NO_LAST_COMMAND !== void 0) config.noLastCommand = process$1.env.NI_NO_LAST_COMMAND === \"true\";\n\t\tconst agent = await detect$1({ programmatic: true });\n\t\tif (agent) config.defaultAgent = agent;\n\t}\n\treturn config;\n}\nasync function getDefaultAgent(programmatic) {\n\tconst { defaultAgent } = await getConfig();\n\tif (defaultAgent === \"prompt\" && (programmatic || process$1.env.CI)) return \"npm\";\n\treturn defaultAgent;\n}\nasync function getGlobalAgent() {\n\tconst { globalAgent } = await getConfig();\n\treturn globalAgent;\n}\nasync function getRunAgent() {\n\tconst { runAgent } = await getConfig();\n\treturn runAgent;\n}\nasync function getUseSfw() {\n\tconst { useSfw } = await getConfig();\n\treturn useSfw;\n}\nasync function getCatalog() {\n\tconst { catalog } = await getConfig();\n\treturn catalog;\n}\n//#endregion\n//#region src/parse.ts\nvar UnsupportedCommand = class extends Error {\n\tconstructor({ agent, command }) {\n\t\tsuper(`Command \"${command}\" is not support by agent \"${agent}\"`);\n\t}\n};\nfunction getCommand(agent, command, args = []) {\n\tif (!src_exports.COMMANDS[agent]) throw new Error(`Unsupported agent \"${agent}\"`);\n\tif (!src_exports.COMMANDS[agent][command]) throw new UnsupportedCommand({\n\t\tagent,\n\t\tcommand\n\t});\n\treturn (0, src_exports.constructCommand)(src_exports.COMMANDS[agent][command], args);\n}\nconst parseNi = ((agent, args, ctx) => {\n\tif (agent === \"bun\") args = args.map((i) => i === \"-D\" ? \"-d\" : i);\n\tif (agent === \"npm\") args = args.map((i) => i === \"-P\" ? \"--omit=dev\" : i);\n\tif (args.includes(\"-P\")) args = args.map((i) => i === \"-P\" ? \"--production\" : i);\n\tif (args.includes(\"-g\")) return getCommand(agent, \"global\", exclude(args, \"-g\"));\n\tif (args.includes(\"--frozen-if-present\")) {\n\t\targs = exclude(args, \"--frozen-if-present\");\n\t\treturn getCommand(agent, ctx?.hasLock ? \"frozen\" : \"install\", args);\n\t}\n\tif (args.includes(\"--frozen\")) return getCommand(agent, \"frozen\", exclude(args, \"--frozen\"));\n\tif (args.length === 0 || args.every((i) => i.startsWith(\"-\"))) return getCommand(agent, \"install\", args);\n\treturn getCommand(agent, \"add\", args);\n});\nconst parseNr = (async (agent, args, ctx) => {\n\tif (args.length === 0) args.push(\"start\");\n\tif (args[0] === \"-p\") args = args.slice(1);\n\tconst runAgent = await getRunAgent();\n\tlet runWithNode = false;\n\tif (runAgent === \"node\") {\n\t\tconst [majorNodeVersion] = process$1.versions.node.split(\".\").map(Number);\n\t\tif (majorNodeVersion < 22) throw new Error(\"The runAgent \\\"node\\\" requires Node.js 22.0.0 or higher\");\n\t\trunWithNode = true;\n\t\targs = [\"--run\", ...args];\n\t}\n\tlet hasIfPresent = false;\n\tif (args.includes(\"--if-present\")) {\n\t\targs = exclude(args, \"--if-present\");\n\t\thasIfPresent = true;\n\t}\n\tconst processedArgs = [];\n\tlet i = 0;\n\twhile (i < args.length) {\n\t\tconst arg = args[i];\n\t\tif ((arg === \"-w\" || arg === \"--workspace\") && i + 1 < args.length && !args[i + 1].startsWith(\"-\")) {\n\t\t\tprocessedArgs.push(`${arg}=${args[i + 1]}`);\n\t\t\ti += 2;\n\t\t} else {\n\t\t\tprocessedArgs.push(arg);\n\t\t\ti++;\n\t\t}\n\t}\n\targs = processedArgs;\n\tconst cmd = runWithNode ? {\n\t\tcommand: \"node\",\n\t\targs\n\t} : getCommand(agent, \"run\", args);\n\tif (ctx?.cwd) cmd.cwd = ctx.cwd;\n\tif (!cmd) return cmd;\n\tif (hasIfPresent && !runWithNode) cmd.args.splice(1, 0, \"--if-present\");\n\treturn cmd;\n});\nconst parseNup = ((agent, args) => {\n\tif (args.includes(\"-i\")) return getCommand(agent, \"upgrade-interactive\", exclude(args, \"-i\"));\n\treturn getCommand(agent, \"upgrade\", args);\n});\nconst parseNd = ((agent, args) => {\n\tif (agent === \"pnpm\" || agent === \"aube\") args = args.map((i) => i === \"-c\" ? \"--check\" : i);\n\tif (agent === \"npm\") args = args.map((i) => i === \"-c\" ? \"--dry-run\" : i);\n\treturn getCommand(agent, \"dedupe\", args);\n});\nconst parseNun = ((agent, args) => {\n\tif (args.includes(\"-g\")) return getCommand(agent, \"global_uninstall\", exclude(args, \"-g\"));\n\treturn getCommand(agent, \"uninstall\", args);\n});\nconst parseNlx = ((agent, args) => {\n\tif (args.includes(\"--local\")) return getCommand(agent, \"execute-local\", exclude(args, \"--local\"));\n\treturn getCommand(agent, \"execute\", args);\n});\nconst parseNa = ((agent, args) => {\n\treturn getCommand(agent, \"agent\", args);\n});\nfunction serializeCommand(command) {\n\tif (!command) return void 0;\n\tif (command.args.length === 0) return command.command;\n\treturn `${command.command} ${command.args.map((i) => i.includes(\" \") ? `\"${i}\"` : i).join(\" \")}`;\n}\n//#endregion\n//#region package.json\nvar version = \"30.5.0\";\n//#endregion\n//#region src/environment.ts\nconst DEFAULT_ENVIRONMENT_OPTIONS = { autoInstall: false };\nfunction getEnvironmentOptions() {\n\treturn {\n\t\t...DEFAULT_ENVIRONMENT_OPTIONS,\n\t\tautoInstall: process$1.env.NI_AUTO_INSTALL === \"true\"\n\t};\n}\n//#endregion\n//#region src/runner.ts\nconst DEBUG_SIGN = \"?\";\nconst PROGRAMMATIC_SIGN = \"--programmatic\";\nasync function runCli(fn, options = {}) {\n\toptions = {\n\t\t...getEnvironmentOptions(),\n\t\t...options\n\t};\n\tconst { args = process$1.argv.slice(2).filter(Boolean) } = options;\n\ttry {\n\t\tawait run(fn, args, options);\n\t} catch (error) {\n\t\tif (error instanceof UnsupportedCommand && !options.programmatic) console.log(styleText(\"red\", `\\u2717 ${error.message}`));\n\t\tif (!options.programmatic) process$1.exit(1);\n\t\tthrow error;\n\t}\n}\nasync function getCliCommand(fn, args, options = {}, cwd = options.cwd ?? process$1.cwd()) {\n\tif (args.includes(\"-g\")) return await fn(await getGlobalAgent(), args);\n\tlet agent = await detect$1({\n\t\t...options,\n\t\tcwd\n\t}) || await getDefaultAgent(options.programmatic);\n\tif (agent === \"prompt\") {\n\t\tagent = (await (0, import_prompts.default)({\n\t\t\tname: \"agent\",\n\t\t\ttype: \"select\",\n\t\t\tmessage: \"Choose the agent\",\n\t\t\tchoices: AGENTS.filter((i) => !i.includes(\"@\")).map((value) => ({\n\t\t\t\ttitle: value,\n\t\t\t\tvalue\n\t\t\t}))\n\t\t})).agent;\n\t\tif (!agent) return;\n\t}\n\treturn await fn(agent, args, {\n\t\tprogrammatic: options.programmatic,\n\t\thasLock: Boolean(agent),\n\t\tcwd\n\t});\n}\nasync function run(fn, args, options = {}) {\n\tconst { detectVolta = true } = options;\n\tconst debug = args.includes(DEBUG_SIGN);\n\tif (debug) remove(args, DEBUG_SIGN);\n\tconst programmaticFromArgs = args.includes(PROGRAMMATIC_SIGN);\n\tif (programmaticFromArgs) remove(args, PROGRAMMATIC_SIGN);\n\tconst programmatic = options.programmatic || programmaticFromArgs;\n\tlet cwd = options.cwd ?? process$1.cwd();\n\tif (args[0] === \"-C\") {\n\t\tcwd = resolve(cwd, args[1]);\n\t\targs.splice(0, 2);\n\t}\n\tif (args.length === 1 && (args[0]?.toLowerCase() === \"-v\" || args[0] === \"--version\")) {\n\t\tconst getCmd = (a) => AGENTS.includes(a) ? getCommand(a, \"agent\", [\"-v\"]) : {\n\t\t\tcommand: a,\n\t\t\targs: [\"-v\"]\n\t\t};\n\t\tconst xVersionOptions = {\n\t\t\tnodeOptions: { cwd },\n\t\t\tthrowOnError: true\n\t\t};\n\t\tconst getV = (a) => {\n\t\t\tconst { command, args } = getCmd(a);\n\t\t\treturn x(command, args, xVersionOptions).then((e) => e.stdout).then((e) => e.startsWith(\"v\") ? e : `v${e}`);\n\t\t};\n\t\tconst globalAgentPromise = getGlobalAgent();\n\t\tconst globalAgentVersionPromise = globalAgentPromise.then(getV);\n\t\tconst agentPromise = detect$1({\n\t\t\t...options,\n\t\t\tcwd\n\t\t}).then((a) => a || \"\");\n\t\tconst agentVersionPromise = agentPromise.then((a) => a && getV(a));\n\t\tconst nodeVersionPromise = getV(\"node\");\n\t\tconsole.log(`@antfu/ni ${styleText(\"cyan\", `v${version}`)}`);\n\t\tconsole.log(`node ${styleText(\"green\", await nodeVersionPromise)}`);\n\t\tconst [agent, agentVersion] = await Promise.all([agentPromise, agentVersionPromise]);\n\t\tif (agent) console.log(`${agent.padEnd(10)} ${styleText(\"blue\", agentVersion)}`);\n\t\telse console.log(\"agent no lock file\");\n\t\tconst [globalAgent, globalAgentVersion] = await Promise.all([globalAgentPromise, globalAgentVersionPromise]);\n\t\tconsole.log(`${`${globalAgent} -g`.padEnd(10)} ${styleText(\"blue\", globalAgentVersion)}`);\n\t\treturn;\n\t}\n\tif (args.length === 1 && args[0] === \"--agent\") {\n\t\tconst agent = args.includes(\"-g\") ? await getGlobalAgent() : await detect$1({\n\t\t\t...options,\n\t\t\tcwd,\n\t\t\tprogrammatic: true\n\t\t}) || await getDefaultAgent(programmatic);\n\t\tif (agent && agent !== \"prompt\") process$1.stdout.write(`${agent}\\n`);\n\t\telse process$1.stdout.write(\"unknown\\n\");\n\t\treturn;\n\t}\n\tif (args.length === 1 && [\"-h\", \"--help\"].includes(args[0])) {\n\t\tconst dash = styleText(\"dim\", \"-\");\n\t\tconsole.log(`${styleText([\"green\", \"bold\"], \"@antfu/ni\")} ${styleText(\"dim\", `use the right package manager v${version}`)}\\n`);\n\t\tconsole.log(`ni ${dash} install`);\n\t\tconsole.log(`nr ${dash} run`);\n\t\tconsole.log(`nlx ${dash} execute`);\n\t\tconsole.log(`nlx --local ${dash} execute (prefer locally installed binary, no download)`);\n\t\tconsole.log(`nup ${dash} upgrade`);\n\t\tconsole.log(`nun ${dash} uninstall`);\n\t\tconsole.log(`nci ${dash} clean install`);\n\t\tconsole.log(`na ${dash} agent alias`);\n\t\tconsole.log(`nd ${dash} dedupe dependencies`);\n\t\tconsole.log(`ni -v ${dash} show used agent`);\n\t\tconsole.log(`ni --agent ${dash} print detected agent name (for scripting)`);\n\t\tconsole.log(`ni -i ${dash} interactive package management`);\n\t\tconsole.log(`ni ? ${dash} dry run (print the resolved command)`);\n\t\tconsole.log(styleText(\"yellow\", \"\\ncheck https://github.com/antfu/ni for more documentation.\"));\n\t\treturn;\n\t}\n\tif (options.onBeforeCommand) {\n\t\tlet shouldExit = false;\n\t\tawait options.onBeforeCommand(args, {\n\t\t\tcwd,\n\t\t\tprogrammatic,\n\t\t\texit: () => {\n\t\t\t\tshouldExit = true;\n\t\t\t}\n\t\t});\n\t\tif (shouldExit) return;\n\t}\n\tconst command = await getCliCommand(fn, args, {\n\t\t...options,\n\t\tprogrammatic\n\t}, cwd);\n\tif (!command) return;\n\tconst useSfw = await getUseSfw();\n\tif (useSfw && cmdExists(\"sfw\")) {\n\t\tcommand.args = [command.command, ...command.args];\n\t\tcommand.command = \"sfw\";\n\t} else if (useSfw) {\n\t\tif (programmatic) throw new Error(\"sfw is enabled but not installed\");\n\t\tconsole.error(\"[ni] sfw is enabled but not installed.\");\n\t\tconsole.error(\"[ni] Install it with: npm install -g sfw\");\n\t\tprocess$1.exit(1);\n\t}\n\tif (detectVolta && cmdExists(\"volta\")) {\n\t\tcommand.args = [\n\t\t\t\"run\",\n\t\t\tcommand.command,\n\t\t\t...command.args\n\t\t];\n\t\tcommand.command = \"volta\";\n\t}\n\tif (debug) {\n\t\tconsole.log(serializeCommand(command));\n\t\treturn;\n\t}\n\tconst proc = x(command.command, command.args, {\n\t\tnodeOptions: {\n\t\t\tstdio: \"inherit\",\n\t\t\tcwd: command.cwd ?? cwd\n\t\t},\n\t\tnodePath: false,\n\t\tthrowOnError: true\n\t});\n\tprocess$1.once(\"SIGINT\", async () => {\n\t\tawait proc;\n\t\tprocess$1.exit(proc.exitCode);\n\t});\n\tawait proc;\n}\n//#endregion\n//#region src/index.ts\nvar src_exports = /* @__PURE__ */ __exportAll({\n\tCLI_TEMP_DIR: () => CLI_TEMP_DIR,\n\tUnsupportedCommand: () => UnsupportedCommand,\n\tcmdExists: () => cmdExists,\n\tdetect: () => detect$1,\n\texclude: () => exclude,\n\tformatPackageWithUrl: () => formatPackageWithUrl,\n\tgetCatalog: () => getCatalog,\n\tgetCliCommand: () => getCliCommand,\n\tgetCommand: () => getCommand,\n\tgetConfig: () => getConfig,\n\tgetDefaultAgent: () => getDefaultAgent,\n\tgetGlobalAgent: () => getGlobalAgent,\n\tgetRunAgent: () => getRunAgent,\n\tgetUseSfw: () => getUseSfw,\n\tlimitText: () => limitText,\n\tparseNa: () => parseNa,\n\tparseNd: () => parseNd,\n\tparseNi: () => parseNi,\n\tparseNlx: () => parseNlx,\n\tparseNr: () => parseNr,\n\tparseNun: () => parseNun,\n\tparseNup: () => parseNup,\n\tremove: () => remove,\n\trun: () => run,\n\trunCli: () => runCli,\n\tserializeCommand: () => serializeCommand,\n\tterminalLink: () => terminalLink,\n\twriteFileSafe: () => writeFileSafe\n});\nimport * as import_package_manager_detector_commands from \"package-manager-detector/commands\";\n__reExport(src_exports, import_package_manager_detector_commands);\nimport * as import_package_manager_detector_constants from \"package-manager-detector/constants\";\n__reExport(src_exports, import_package_manager_detector_constants);\n//#endregion\nexport { require_prompts as A, cmdExists as C, remove as D, limitText as E, terminalLink as O, CLI_TEMP_DIR as S, formatPackageWithUrl as T, getDefaultAgent as _, UnsupportedCommand as a, getUseSfw as b, parseNd as c, parseNr as d, parseNun as f, getConfig as g, getCatalog as h, runCli as i, writeFileSafe as k, parseNi as l, serializeCommand as m, getCliCommand as n, getCommand as o, parseNup as p, run as r, parseNa as s, src_exports as t, parseNlx as u, getGlobalAgent as v, exclude as w, detect$1 as x, getRunAgent as y };\n","import { n as __exportAll, r as __reExport } from \"./rolldown-runtime-DPI6AWJA.mjs\";\nimport { C as cmdExists, D as remove, E as limitText, O as terminalLink, S as CLI_TEMP_DIR, T as formatPackageWithUrl, _ as getDefaultAgent, a as UnsupportedCommand, b as getUseSfw, c as parseNd, d as parseNr, f as parseNun, g as getConfig, h as getCatalog, i as runCli, k as writeFileSafe, l as parseNi, m as serializeCommand, n as getCliCommand, o as getCommand, p as parseNup, r as run, s as parseNa, t as src_exports, u as parseNlx, v as getGlobalAgent, w as exclude, x as detect, y as getRunAgent } from \"./src-DSImyIFd.mjs\";\nexport * from \"package-manager-detector/constants\";\nexport * from \"package-manager-detector/commands\";\n__reExport(/* @__PURE__ */ __exportAll({\n\tCLI_TEMP_DIR: () => CLI_TEMP_DIR,\n\tUnsupportedCommand: () => UnsupportedCommand,\n\tcmdExists: () => cmdExists,\n\tdetect: () => detect,\n\texclude: () => exclude,\n\tformatPackageWithUrl: () => formatPackageWithUrl,\n\tgetCatalog: () => getCatalog,\n\tgetCliCommand: () => getCliCommand,\n\tgetCommand: () => getCommand,\n\tgetConfig: () => getConfig,\n\tgetDefaultAgent: () => getDefaultAgent,\n\tgetGlobalAgent: () => getGlobalAgent,\n\tgetRunAgent: () => getRunAgent,\n\tgetUseSfw: () => getUseSfw,\n\tlimitText: () => limitText,\n\tparseNa: () => parseNa,\n\tparseNd: () => parseNd,\n\tparseNi: () => parseNi,\n\tparseNlx: () => parseNlx,\n\tparseNr: () => parseNr,\n\tparseNun: () => parseNun,\n\tparseNup: () => parseNup,\n\tremove: () => remove,\n\trun: () => run,\n\trunCli: () => runCli,\n\tserializeCommand: () => serializeCommand,\n\tterminalLink: () => terminalLink,\n\twriteFileSafe: () => writeFileSafe\n}), src_exports);\n//#endregion\nexport { CLI_TEMP_DIR, UnsupportedCommand, cmdExists, detect, exclude, formatPackageWithUrl, getCatalog, getCliCommand, getCommand, getConfig, getDefaultAgent, getGlobalAgent, getRunAgent, getUseSfw, limitText, parseNa, parseNd, parseNi, parseNlx, parseNr, parseNun, parseNup, remove, run, runCli, serializeCommand, terminalLink, writeFileSafe };\n","// Get the directory where this module is located\nimport { GeneratorContext, Generator } from \"../../types\";\nimport { addPackageScripts, open } from \"@dxgjs/fs\";\n\n// Import Clack-native UX utilities from @dxgjs/prompts\nimport {\n intro,\n isCancel,\n spinner,\n note,\n prompt,\n multiselect,\n} from \"@dxgjs/prompts\";\n\nimport { fileURLToPath } from \"url\";\nimport { dirname, join, sep, posix } from \"path\";\nimport { executeCommand } from \"@dxgjs/fs\";\nimport { parseNlx, getCliCommand } from \"@antfu/ni\";\nimport pc from \"picocolors\";\nimport type { ExecaError } from \"execa\";\nimport type {\n DependencyPlan,\n DependencyInstallResult,\n DependencySpec,\n} from \"../../install/types\";\nimport { installerFailureHint } from \"../../install/installer\";\nimport { withDlxBuildApprovals } from \"../../install/dlx\";\n\n// DXG Error types\nimport {\n ProviderUnsupportedError,\n BuildBlockedError,\n TemplateMissingError,\n InstallerFailureError,\n ValidationError,\n SpawnError,\n} from \"@dxgjs/errors\";\n\n// ORM flow modules\nimport { setupPrismaFlow } from \"./prisma-flow\";\nimport { setupDrizzleFlow } from \"./drizzle-flow\";\n\n// Shared database meta (single source of truth for Prisma version, providers, scripts, paths)\nimport {\n providerData,\n databaseScriptCatalog,\n SEED_SCRIPT_NAME,\n SEED_FILE_PATH,\n SEED_CONFIG_COMMAND,\n PRISMA_CONFIG_PATH,\n PRISMA_PINNED_VERSION,\n DEFAULT_GENERATOR_OUTPUT,\n DEFAULT_HELPER_PATH,\n buildPrismaInitArgs,\n providerScripts,\n recommendedScripts,\n resolveDatabaseScripts,\n normalizeContent,\n sanitizeEnvValue,\n computeRelativeImport,\n computeFileImport,\n normalizeHelperPath,\n validateHelperPath,\n providersMatch,\n specName,\n} from \"@dxgjs/database-meta\";\n\n// Get the directory where this module is located\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Determine if we're in a bundled context (where __dirname points to dist/)\n// In bundled context, we need to adjust the path to point to generators/database/templates/\nconst isBundled =\n __dirname.endsWith(`${sep}dist`) || __dirname.endsWith(\"/dist\");\nlet templateBasePath: string;\nif (isBundled) {\n // In bundle, templates are under generators/<generator-name>/templates/\n templateBasePath = join(__dirname, \"generators\", \"database\", \"templates\");\n} else {\n // In source, templates are under the generator's directory\n templateBasePath = join(__dirname, \"templates\");\n}\n\n// Provider data and script catalog are now imported from @dxgjs/database-meta\n// Re-export for backward compatibility with tests\nexport { providerData } from \"@dxgjs/database-meta\";\nexport {\n databaseScriptCatalog,\n SEED_SCRIPT_NAME,\n SEED_FILE_PATH,\n SEED_CONFIG_COMMAND,\n PRISMA_CONFIG_PATH,\n PRISMA_PINNED_VERSION,\n DEFAULT_GENERATOR_OUTPUT,\n DEFAULT_HELPER_PATH,\n normalizePrismaProvider,\n providersMatch,\n} from \"@dxgjs/database-meta\";\nexport {\n providerScripts,\n recommendedScripts,\n resolveDatabaseScripts,\n} from \"@dxgjs/database-meta\";\nexport { buildPrismaInitArgs } from \"@dxgjs/database-meta\";\nexport { detectPrismaState } from \"./detect-prisma-state\";\nexport { inspectDatabase } from \"./inspect\";\n\n// Patch providerData with correct template paths for this package\n// The database-meta package calculates paths relative to itself, but templates\n// live in this package (generators/database/templates)\nconst patchedProviderData = { ...providerData };\nfor (const key of Object.keys(patchedProviderData)) {\n const provider = patchedProviderData[key];\n if (provider.templatePath) {\n const templateName =\n provider.templatePath.split(sep).pop() || provider.templatePath;\n patchedProviderData[key] = {\n ...provider,\n templatePath: join(templateBasePath, templateName),\n };\n }\n}\n\n// Use patched provider data for the rest of this module\nconst providerDataLocal = patchedProviderData;\n\n// Prompt questions for the database generator\nexport const databasePrompts = [\n {\n // ORM selection prompt: first interaction when --orm flag not provided.\n // Prisma is default; Drizzle shows \"Coming soon\" hint.\n type: \"select\" as const,\n name: \"orm\",\n message: \"Which ORM would you like to use?\",\n initialValue: \"prisma\",\n choices: [\n {\n name: \"Prisma\",\n value: \"prisma\",\n hint: \"Next-generation ORM with schema & migrations\",\n },\n {\n name: \"Drizzle\",\n value: \"drizzle\",\n hint: \"Lightweight & SQL-like TypeScript ORM (Coming soon)\",\n },\n ],\n },\n {\n type: \"select\" as const,\n name: \"provider\",\n message: \"Choose your database provider:\",\n default: \"postgresql\",\n choices: Object.values(providerDataLocal).map((p) => ({\n name: p.displayName,\n value: p.key,\n })),\n },\n {\n // DATABASE_URL prompt: shown for all providers after provider selection.\n // For SQLite, prefilled with the conventional file URL.\n // For server providers, shows a template placeholder the user can edit.\n // This prompt runs BEFORE the skills/scripts/helper prompts so the value\n // is available for planDatabase.\n type: \"input\" as const,\n name: \"databaseUrl\",\n message: \"Database connection URL (DATABASE_URL):\",\n // The default/initialValue will be set dynamically in run() based on provider\n validate: (value) =>\n typeof value === \"string\" && value.length > 0\n ? true\n : \"DATABASE_URL cannot be empty\",\n },\n {\n // DXG owns the Prisma agent skills decision: the user is asked here so\n // Prisma itself never has to ask. Default is No — Prisma agent skills\n // (.claude/skills/, .windsurf/skills/, .agents/skills/, skills-lock.json)\n // are only written into the user's project when explicitly requested.\n type: \"confirm\" as const,\n name: \"installPrismaSkills\",\n message: \"Install Prisma agent skills?\",\n default: false,\n },\n {\n // Database scripts phase: decides which db:* npm scripts land in the\n // project's package.json. Default is the recommended set.\n type: \"select\" as const,\n name: \"databaseScripts\",\n message: \"Configure database scripts?\",\n default: \"recommended\",\n choices: [\n { name: \"Recommended\", value: \"recommended\" },\n { name: \"Customize\", value: \"customize\" },\n { name: \"Skip\", value: \"skip\" },\n ],\n },\n {\n // Helper path (decision document, section 6): where the DXG-owned\n // Prisma singleton helper lands. Relative to the project root;\n // backslashes, leading ./ and a missing .ts are normalized, and\n // protected Prisma/DXG paths are rejected by planDatabase.\n type: \"input\" as const,\n name: \"helperPath\",\n message: \"Where should the Prisma client helper be created?\",\n default: DEFAULT_HELPER_PATH,\n initialValue: DEFAULT_HELPER_PATH,\n validate: (value) =>\n typeof value === \"string\" &&\n (value === \"\" ||\n /^[a-zA-Z0-9_/.-]+\\.[jt]s$/.test(value) ||\n \"Must be a relative path ending in .ts or .tsx\"),\n },\n] satisfies {\n type: \"input\" | \"confirm\" | \"select\";\n name: string;\n message: string;\n default?: unknown;\n initialValue?: unknown;\n choices?: Array<{ name: string; value: string; hint?: string }>;\n validate?: (input: unknown) => boolean | string;\n}[];\n\n/**\n * Builds the exact `prisma init` argument contract. This is the single\n * source of truth used by BOTH production resolution paths in\n * executeDatabase (the primary `getCliCommand(parseNlx, ...)` call and the\n * `originalArgs` fallback/workaround), so the skills decision can never\n * diverge between the two paths.\n *\n * Skills translation (verified against the prisma@7 CLI source):\n * - `installSkills: false` passes the explicit `--no-skills` flag → Prisma\n * skips agent skills entirely.\n * - `installSkills: true` omits the flag → prisma@7 installs agent skills\n * unconditionally and NON-interactively (that code path contains no\n * prompt/TTY check). Prisma therefore never asks the question DXG\n * already asked.\n */\n\n// Precondition checks\nexport async function checkPreconditions(ctx: GeneratorContext): Promise<void> {\n // 1. package.json must exist (we are adding to an existing project)\n const packageJsonExists = await ctx.fs.pathExists(\"package.json\");\n if (!packageJsonExists) {\n throw new ValidationError(\n \"package.json not found. Please initialize your project (e.g., npm init) before running dxg add database.\",\n );\n }\n\n // Read package.json for compatibility with tests (though not strictly needed for logic)\n // This ensures fs.readFile is called for package.json as expected by tests\n await ctx.fs.readFile(\"package.json\", { encoding: \"utf8\" });\n}\n\n// Planning function\nexport function planDatabase(\n answers: Record<string, unknown>,\n inspection?: import(\"./inspect\").DatabaseInspection,\n) {\n const providerKey = answers.provider as string;\n const provider =\n providerDataLocal[providerKey as keyof typeof providerDataLocal];\n\n if (!provider) {\n const supportedProviders = Object.keys(providerDataLocal);\n throw new ProviderUnsupportedError(providerKey, supportedProviders);\n }\n\n // Helper path resolution (decision document, section 6). Deterministic\n // order: an explicit answer (CLI or prompt) wins; otherwise a helper\n // candidate discovered by the inspection is REUSED (a re-run must not\n // duplicate the helper at a second location); otherwise the default.\n // Non-interactive mode without an answer lands on the default — never a\n // prompt. Normalization + validation are inspect.ts's single ownership.\n const helperPath =\n typeof answers.helperPath === \"string\" && answers.helperPath.trim() !== \"\"\n ? normalizeHelperPath(answers.helperPath)\n : inspection !== undefined && inspection.helperCandidates.length > 0\n ? inspection.helperCandidates[0]\n : DEFAULT_HELPER_PATH;\n const helperError = validateHelperPath(helperPath);\n if (helperError !== undefined) {\n throw new ValidationError(\n `Invalid helper path \"${helperPath}\": ${helperError}`,\n );\n }\n\n // Generator-output resolution — the single source of truth for the plan\n // fields AND the template data: a user-owned schema that declares a\n // parseable, root-internal output wins (the plan must agree with where\n // `prisma generate` will actually write the client); every other state —\n // no generator block, unparseable output, root-escaping output, or no\n // inspection at all — falls back to the helper-derived co-location rule.\n const generatorOutput =\n inspection !== undefined &&\n inspection.schemaHasGenerator &&\n !inspection.generatorOutputEscapesRoot &&\n inspection.generatorOutput !== DEFAULT_GENERATOR_OUTPUT\n ? inspection.generatorOutput\n : computeDefaultGeneratorOutput(helperPath);\n\n // Dynamic imports (decision document, section 7): computed here, in the\n // planning layer, from the helper path and the generator output — never\n // hardcoded in the templates. The seed imports the helper with a relative\n // specifier from its own directory (prisma/).\n const generatedClientImport = computeRelativeImport(\n helperPath,\n generatorOutput,\n );\n const helperImportFromSeed = computeFileImport(\n \"prisma/seed.ts\",\n helperPath.replace(/\\.ts$/, \"\"),\n );\n\n const data = {\n provider: provider.key,\n providerName: provider.displayName,\n year: new Date().getFullYear(),\n generatedClientImport,\n helperImportFromSeed,\n ...provider, // Spread provider data for template use\n };\n\n // Determine packages to install - separate dev and regular dependencies.\n // State-aware (idempotence): when the inspection reports the Prisma\n // declarations already satisfied, the pinned prisma/@prisma/client specs\n // are dropped from the install batches — the second run must not\n // reinstall what the project already declares at the verified pin.\n // Non-Prisma provider deps (adapters, drivers, dotenv, tsx) follow the\n // same declared rule: declared → dropped (an install with nothing to do\n // still rewrites package-lock.json on npm — never assume a cheap no-op;\n // live-proven by the e2e rerun-noop lockfile mutation), missing → they\n // stay in the batch and self-heal. Every omission is reported through\n // the summary (skipped).\n const devPackages = [...provider.devDependencies];\n const regularPackages = [...provider.dependencies];\n\n const prismaSatisfied =\n inspection !== undefined && inspection.prismaVersion === \"satisfied\";\n const clientSatisfied =\n inspection !== undefined && inspection.clientVersion === \"satisfied\";\n\n // Drop each Prisma package independently based on its own satisfaction status.\n // A declared \"7.0.0\" or \"^7.0.0\" satisfies the 7.x branch policy and should\n // not be reinstalled. The version gate is per-package; both don't need to\n // be satisfied together.\n if (prismaSatisfied || clientSatisfied) {\n for (const list of [devPackages, regularPackages]) {\n for (let i = list.length - 1; i >= 0; i--) {\n const name = specName(list[i]);\n if ((name === \"prisma\" && prismaSatisfied) || (name === \"@prisma/client\" && clientSatisfied)) {\n list.splice(i, 1);\n }\n }\n }\n }\n\n // Idempotence, non-Prisma side: every provider dependency the manifest\n // already declares is dropped from the batches too. The historical\n // assumption — \"the manager makes their reinstall a cheap no-op\" — was\n // refuted live on npm (e2e rerun-noop 2026-10-10, kept project\n // dxg-e2e-rerun-noop-npm-ZR61CI): a residual `npm install <declared\n // specs>` rewrites package-lock.json even when nothing changes, so the\n // rerun was not a byte-stable no-op. Missing entries self-heal: they\n // stay in the batch. Legacy callers without an inspection keep the\n // historical full-batch behavior.\n const declaredProviderDepsDropped: string[] = [];\n if (inspection !== undefined) {\n const missing = inspection.providerDependenciesMissing;\n for (const list of [devPackages, regularPackages]) {\n for (let i = list.length - 1; i >= 0; i--) {\n const name = specName(list[i]);\n if (\n name !== \"prisma\" &&\n name !== \"@prisma/client\" &&\n !missing.includes(name)\n ) {\n list.splice(i, 1);\n declaredProviderDepsDropped.push(name);\n }\n }\n }\n }\n\n // The seed script only works end-to-end when its three parts travel\n // together: the runner (tsx, devDependency), the seed file, and the\n // `prisma.seed` config Prisma reads. Selected here, materialized below.\n // A rerun of a seeded project must not reinstall a declared tsx (same\n // lockfile-mutation defect as the declared batches above).\n const seedSelected = resolveDatabaseScripts(\n answers.databaseScripts,\n provider.key,\n ).includes(SEED_SCRIPT_NAME);\n if (\n seedSelected &&\n !devPackages.includes(\"tsx\") &&\n inspection?.seedRunnerDeclared !== true\n ) {\n devPackages.push(\"tsx\");\n }\n\n // Domain-owned build knowledge (data-driven, provider-local): which\n // packages in this provider's plan run install lifecycle scripts that\n // build native artifacts. prisma's preinstall is a Node-version guard;\n // @prisma/engines' postinstall downloads the schema engine binary\n // (required for migrate/db push); better-sqlite3@12 compiles/links the\n // .node binding. tsx pulls esbuild transitively, whose postinstall\n // verifies/downloads the platform binary — an install script pnpm 11\n // blocks (strictDepBuilds on by default) unless pre-approved.\n // @types/*, dotenv, pg and the adapters have none.\n const requiresBuild = (spec: string): boolean =>\n /^prisma@/.test(spec) ||\n spec === \"@prisma/engines\" ||\n spec === \"esbuild\" ||\n /^better-sqlite3@/.test(spec);\n // The adapter pulls @prisma/engines transitively — its build approval is\n // needed even though it never appears as a direct spec. Same for esbuild\n // under the seed runner (tsx).\n const buildApprovalNames = [\"prisma\", \"@prisma/engines\"];\n if (provider.key === \"sqlite\") {\n buildApprovalNames.push(\"better-sqlite3\");\n }\n if (seedSelected) {\n buildApprovalNames.push(\"esbuild\");\n }\n\n // Build dependency plan with spec objects for the installer.\n const devPackageSpecs: DependencySpec[] = [\n ...devPackages.map((spec) => ({\n spec,\n requiresBuild: requiresBuild(spec),\n })),\n // tsx pulls esbuild transitively — esbuild's postinstall needs build\n // approval even though it is never installed as a direct spec.\n ...(seedSelected\n ? [{ spec: \"esbuild\", requiresBuild: true, approvalOnly: true }]\n : []),\n ];\n const regularPackageSpecs: DependencySpec[] = [\n ...regularPackages.map((spec) => ({\n spec,\n requiresBuild: requiresBuild(spec),\n })),\n // @prisma/engines is a transitive dependency of the adapter that requires\n // build approval but is never installed directly.\n {\n spec: \"@prisma/engines\",\n requiresBuild: true,\n approvalOnly: true,\n },\n ];\n const dependencyPlan: DependencyPlan = {\n devDependencies: devPackageSpecs,\n dependencies: regularPackageSpecs,\n };\n\n // Determine files to create - only DXG-owned application templates.\n // The helper lands at the RESOLVED helper path (user answer, discovered\n // candidate, or default) — never hardcoded lib/prisma.ts.\n const filesToCreate = [\n {\n path: helperPath,\n templatePath: provider.templatePath,\n data,\n },\n ];\n if (seedSelected) {\n filesToCreate.push({\n path: SEED_FILE_PATH,\n templatePath: join(templateBasePath, \"prisma-seed.tmpl\"),\n data,\n });\n }\n\n // State-aware decision markers (idempotence). Derived from the inspection\n // when present; a missing inspection (legacy callers, unit tests) keeps the\n // historical fresh-run behavior so nothing changes for existing callers.\n // initRequired=true when schema.prisma is missing. If schema exists, prisma/\n // folder exists and `prisma init` would fail (exits 1). If schema doesn't\n // exist but config does, init runs to create the schema (clobbers config -\n // known limitation), otherwise `prisma generate` fails loading the config.\n const initRequired =\n inspection === undefined\n ? true // fresh-run default: run init unconditionally (historical behavior)\n : !inspection.schemaExists;\n // prismaDeclarationsSatisfied is true if EITHER prisma OR @prisma/client\n // is satisfied (version gate is per-package; both don't need to be\n // satisfied together).\n const prismaDeclarationsSatisfied =\n inspection === undefined ? false : (prismaSatisfied || clientSatisfied);\n\n // Determine if we need to write DATABASE_URL to .env:\n // - SQLite: always needs a DATABASE_URL (default file:./dev.db if not provided)\n // - Server providers: only needs DATABASE_URL if user provided one (interactive or CLI)\n // In non-interactive mode without explicit databaseUrl, user configures later.\n const isServerProvider = provider.key !== \"sqlite\";\n const hasUserDatabaseUrl =\n typeof answers.databaseUrl === \"string\" &&\n answers.databaseUrl.trim() !== \"\";\n const envNeedsDatabaseUrl =\n inspection?.envHasDatabaseUrl === false &&\n (!isServerProvider || hasUserDatabaseUrl);\n\n return {\n ...data,\n provider: provider.key, // Return just the provider key string for tests\n providerName: provider.displayName,\n // DXG-owned Prisma agent skills decision (from the confirm prompt).\n // Defaults to false (skip) — see buildPrismaInitArgs.\n installPrismaSkills: answers.installPrismaSkills === true,\n seedSelected,\n devPackages,\n regularPackages,\n dependencyPlan,\n buildApprovalNames,\n filesToCreate,\n // Idempotence markers consumed by executeDatabase's gates and the\n // operation summary. initRequired=false means schema.prisma already exists:\n // `prisma init` would fail (prisma/ folder exists). If schema is missing,\n // init runs to create it (clobbers config if present - known limitation),\n // otherwise `prisma generate` fails loading the config.\n initRequired,\n prismaDeclarationsSatisfied,\n generatorOutput,\n // Prisma init output path relative to the prisma directory (where schema.prisma lives).\n // This is the argument passed to `prisma init --output`.\n prismaInitOutput: posix.join(\"..\", generatorOutput),\n envExists: inspection?.envExists ?? false,\n envHasDatabaseUrl: inspection?.envHasDatabaseUrl ?? false,\n envNeedsDatabaseUrl,\n // Non-Prisma provider dependencies dropped from the install batches\n // because the manifest already declares them (name-only check,\n // inspection-driven). Surfaced in the summary so a rerun reads as a\n // no-op for them too, not as a silent omission.\n declaredProviderDepsDropped,\n // The .env declaration line: SQLite gets the conventional file URL so\n // the recommended chain works out-of-the-box — an empty URL fails\n // `prisma db push` with `Connection url is empty` (live-proven, e2e\n // sqlite-native 2026-10-10, kept project\n // dxg-e2e-sqlite-native-npm-zYRENi: prisma7.config.ts reads\n // process.env[\"DATABASE_URL\"]). Server providers only get a DATABASE_URL\n // line when the user explicitly provides one (interactive opt-in or CLI).\n envDatabaseUrlLine:\n provider.key === \"sqlite\"\n ? `DATABASE_URL=\"${sanitizeEnvValue((answers.databaseUrl as string) ?? \"file:./dev.db\")}\"`\n : hasUserDatabaseUrl\n ? `DATABASE_URL=\"${sanitizeEnvValue(answers.databaseUrl as string)}\"`\n : \"\",\n helperPath,\n generatedClientImport,\n helperImportFromSeed,\n // Individual params env lines for providers using individualParams pattern (mysql, sqlserver).\n // These are written to .env alongside DATABASE_URL so the adapter works out-of-the-box.\n envIndividualLines:\n provider.instantiationPattern === \"individualParams\" && hasUserDatabaseUrl\n ? buildIndividualEnvLines(provider.key, answers.databaseUrl as string)\n : \"\",\n };\n}\n\n/** Runs the interactive part of the customize branch (the multiselect). */\nexport async function promptCustomScripts(\n providerKey: string,\n): Promise<string[]> {\n const offered = providerScripts(providerKey);\n const selected = await multiselect({\n message: \"Select database scripts to add\",\n options: offered.map((name) => ({\n value: name,\n label: name,\n hint: databaseScriptCatalog[name].hint,\n })),\n initialValues: recommendedScripts(providerKey),\n required: false,\n });\n if (isCancel(selected)) {\n throw selected;\n }\n return selected as string[];\n}\n\n/**\n * Inserts the seed entry into the `migrations` block of a Prisma 7 config\n * file's raw text, preserving every other byte (comments, imports, the\n * `process.env[\"DATABASE_URL\"]` datasource form, formatting).\n *\n * This is a deliberately narrow, domain-local text transform — a\n * temporary mechanism owned by the database generator. A robust,\n * reusable transformer for user-owned files (prisma7.config.ts, Better\n * Auth configs, layouts...) is deferred to a separate architectural\n * task; this one intentionally handles only the single shape `prisma\n * init` writes (verified against the prisma@7 CLI bundle).\n */\nexport function insertSeedIntoPrismaConfig(\n configText: string,\n): string | undefined {\n // A pre-existing seed line is REPLACED in place (the --force path —\n // a conflict was already reported for the different value, force\n // resolves it by overwriting, exactly like conflicting scripts).\n const existingSeed = configText.match(\n /^[ \\t]*seed\\s*:\\s*[\"'][^\"']*[\"'],?[ \\t]*$/m,\n );\n if (existingSeed) {\n const replacement = existingSeed[0].replace(\n /([\"']).*?\\1/,\n `\"${SEED_CONFIG_COMMAND}\"`,\n );\n return configText.replace(existingSeed[0], replacement);\n }\n // Fresh insert: anchored on the migrations block `path` line prisma\n // init always writes. A string replace (not regex) keeps the match\n // literal and the rest of the file untouched. The seed entry is\n // formatted exactly like the surrounding prisma init entries\n // (4-space indent inside migrations).\n const pathLine = ' path: \"prisma/migrations\",';\n const anchor = configText.indexOf(pathLine);\n if (anchor === -1) {\n return undefined;\n }\n const insertAt = anchor + pathLine.length;\n return (\n configText.slice(0, insertAt) +\n \"\\n\" +\n ` seed: \"${SEED_CONFIG_COMMAND}\",` +\n configText.slice(insertAt)\n );\n}\n\n/**\n * Extracts the existing `migrations.seed` command from a Prisma config\n * file's raw text, if one is configured. Returns the trimmed command\n * string (e.g. `\"node custom-seed.js\"`) or undefined.\n */\nexport function readSeedFromPrismaConfig(\n configText: string,\n): string | undefined {\n const match = configText.match(/seed\\s*:\\s*[\"']([^\"']+)[\"']/);\n return match ? match[1] : undefined;\n}\n\n/**\n * Applies the Prisma 7 seed contract to the prisma7.config.ts file:\n * `migrations.seed = \"tsx prisma/seed.ts\"` — the ONLY place `prisma db\n * seed` reads the seed command. Semantics mirror addPackageScripts\n * (@dxgjs/fs): identical → already satisfied (skipped), different →\n * conflict preserved unless force. The rest of the config file is\n * preserved byte-for-byte. Domain-local on purpose — Prisma seed-config\n * knowledge belongs to the database domain.\n */\nexport async function applySeedConfigToPrismaFile(\n fs: GeneratorContext[\"fs\"],\n projectRoot: string,\n force: boolean,\n): Promise<\n | { added: false; skipped: true; conflictExisting?: undefined }\n | { added: false; skipped: false; conflictExisting: string }\n | { added: true; skipped: false; conflictExisting?: undefined }\n> {\n const configPath = join(projectRoot, PRISMA_CONFIG_PATH);\n // Fresh read from disk: prisma init (executeDatabase step 3) wrote the\n // file moments ago; ctx.awareness snapshots predate it. Missing file →\n // empty string (the transform reports a missing anchor, not a crash —\n // prisma init owns that file and any failure there surfaced earlier).\n const current =\n ((await fs.readFile(configPath, { encoding: \"utf8\" })) as\n | string\n | undefined) ?? \"\";\n\n const existing = readSeedFromPrismaConfig(current);\n if (existing !== undefined) {\n if (existing === SEED_CONFIG_COMMAND) {\n return { added: false, skipped: true };\n }\n // The user configured their own seed command — never clobber it\n // without --force (same contract as conflicting scripts).\n if (!force) {\n return { added: false, skipped: false, conflictExisting: existing };\n }\n }\n\n const updated = insertSeedIntoPrismaConfig(current);\n if (updated === undefined) {\n // The migrations block anchor is missing (user restructured the\n // config) — report as a conflict rather than guessing where to\n // insert, so nothing is silently misplaced.\n return {\n added: false,\n skipped: false,\n conflictExisting: \"migrations.path (missing anchor)\",\n };\n }\n await fs.writeFile(configPath, updated, \"utf8\");\n return { added: true, skipped: false };\n}\n\n/**\n * Writes a file with restricted permissions (0o600) for sensitive files like .env.\n * Uses fs.open to explicitly set the mode, avoiding world-readable defaults.\n */\nexport async function writeSecureFile(\n filePath: string,\n content: string,\n): Promise<void> {\n const fd = await open(filePath, \"w\", 0o600);\n try {\n await fd.writeFile(content, \"utf8\");\n } finally {\n await fd.close();\n }\n}\n\n// Helper-derived default generator output. Deterministic co-location\n// rule: the generated client lands in <helperDir>/generated/prisma, so\n// the helper's import is always \"./generated/prisma/client\" and stays\n// INSIDE the project whatever the helper path. (Replaces the old\n// /lib|custom/ heuristics, which could resolve the client outside the\n// helper's subtree — even above the project root.)\nexport function computeDefaultGeneratorOutput(helperPath: string): string {\n return posix.join(posix.dirname(helperPath), \"generated\", \"prisma\");\n}\n\n/**\n * Parses a DATABASE_URL for mysql or sqlserver providers and returns\n * the individual environment variable lines to write to .env.\n * Each provider's adapter expects different variable names:\n * - mysql: DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT\n * - sqlserver: HOST, DB_USER, DB_PASSWORD, DB_NAME\n */\nexport function buildIndividualEnvLines(\n providerKey: string,\n databaseUrl: string,\n): string {\n const parsed = parseDatabaseUrl(providerKey, databaseUrl);\n if (!parsed) {\n return \"\";\n }\n\n const lines: string[] = [];\n\n if (providerKey === \"mysql\") {\n // MySQL adapter expects: DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT\n if (parsed.host)\n lines.push(`DATABASE_HOST=\"${sanitizeEnvValue(parsed.host)}\"`);\n if (parsed.user)\n lines.push(`DATABASE_USER=\"${sanitizeEnvValue(parsed.user)}\"`);\n if (parsed.password)\n lines.push(`DATABASE_PASSWORD=\"${sanitizeEnvValue(parsed.password)}\"`);\n if (parsed.database)\n lines.push(`DATABASE_NAME=\"${sanitizeEnvValue(parsed.database)}\"`);\n if (parsed.port)\n lines.push(`DATABASE_PORT=\"${sanitizeEnvValue(parsed.port)}\"`);\n } else if (providerKey === \"sqlserver\") {\n // SQL Server adapter expects: HOST, DB_USER, DB_PASSWORD, DB_NAME\n if (parsed.host) lines.push(`HOST=\"${sanitizeEnvValue(parsed.host)}\"`);\n if (parsed.user) lines.push(`DB_USER=\"${sanitizeEnvValue(parsed.user)}\"`);\n if (parsed.password)\n lines.push(`DB_PASSWORD=\"${sanitizeEnvValue(parsed.password)}\"`);\n if (parsed.database)\n lines.push(`DB_NAME=\"${sanitizeEnvValue(parsed.database)}\"`);\n // Note: encrypt is already in DATABASE_URL, adapter reads from connection string options\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Parses a database URL for mysql or sqlserver format.\n * Returns extracted components or null if parsing fails.\n */\nexport function parseDatabaseUrl(\n providerKey: string,\n databaseUrl: string,\n): {\n host?: string;\n user?: string;\n password?: string;\n database?: string;\n port?: string;\n} | null {\n try {\n if (providerKey === \"mysql\") {\n // mysql://user:password@host:port/database?params\n const url = new URL(databaseUrl);\n return {\n host: url.hostname || undefined,\n user: url.username || undefined,\n password: url.password || undefined,\n database: url.pathname.slice(1) || undefined, // remove leading /\n port: url.port || \"3306\",\n };\n } else if (providerKey === \"sqlserver\") {\n // sqlserver://host:port;database=db;user=user;password=pass;encrypt=true\n // This format doesn't work with URL constructor, parse manually\n const params = new URLSearchParams(\n databaseUrl.replace(\"sqlserver://\", \"\").replace(/;/g, \"&\"),\n );\n const hostPort =\n params.get(\"\")?.split(\":\") ||\n databaseUrl.match(/sqlserver:\\/\\/([^:;]+):(\\d+)/);\n let host = \"\";\n let port = \"1433\";\n\n if (hostPort) {\n if (Array.isArray(hostPort)) {\n host = hostPort[0];\n port = hostPort[1] || \"1433\";\n } else {\n host = hostPort[1] || \"\";\n port = hostPort[2] || \"1433\";\n }\n }\n\n return {\n host: host || undefined,\n user: params.get(\"user\") || undefined,\n password: params.get(\"password\") || undefined,\n database: params.get(\"database\") || undefined,\n port: port || \"1433\",\n };\n }\n } catch {\n // Parsing failed, return empty\n }\n return null;\n}\n\n// Execution function\nexport async function executeDatabase(\n answers: Record<string, unknown>,\n ctx: GeneratorContext,\n plan?: ReturnType<typeof planDatabase>,\n): Promise<{\n created: string[];\n updated: string[];\n skipped: string[];\n conflicts: { path: string; existsAs: \"file\" | \"directory\" }[];\n wouldRun: string[];\n}> {\n const { fs } = ctx;\n const planToUse = plan ?? planDatabase(answers);\n const result: {\n created: string[];\n updated: string[];\n skipped: string[];\n conflicts: { path: string; existsAs: \"file\" | \"directory\" }[];\n wouldRun: string[];\n } = {\n created: [],\n updated: [],\n skipped: [],\n conflicts: [],\n wouldRun: [],\n };\n\n // Steps 1-2: Install dependencies through the installer seam. The seam\n // (built in prepareContext from the detected agent) resolves the command,\n // pre-writes the manager's build approvals for exactly the plan's\n // requiresBuild names, runs with buffered output, and classifies. This\n // generator holds ZERO package-manager logic — no if (pm === \"pnpm\"),\n // ever. The spinner stays Clack-native: it runs above the buffered\n // install and the captured output is echoed on completion.\n if (!ctx.dryRun) {\n if (!ctx.installer) {\n throw new InstallerFailureError(\n \"installer-unavailable\",\n \"Dependency installer unavailable: the generator context was built without one (package manager could not be detected).\",\n );\n }\n // Reconciliation visibility: the Prisma packages were intentionally\n // left out of the install batches (already declared at the verified\n // pin) — surfaced in the summary so a second run reads as a no-op for\n // them, not as a silent omission. Unconditional on satisfaction: with\n // the declared provider-deps drop, a fully-reconciled rerun has EMPTY\n // batches, and the omission still deserves its summary line.\n if (planToUse.prismaDeclarationsSatisfied) {\n const providerObj =\n providerDataLocal[planToUse.provider as keyof typeof providerDataLocal];\n const skippedPrisma = [];\n if (planToUse.devPackages.some((p) => p.startsWith(\"prisma@\")) === false &&\n planToUse.regularPackages.some((p) => p.startsWith(\"prisma@\")) === false) {\n // Check if prisma was in the original provider devDependencies\n if (providerObj.devDependencies.some((p) => p.startsWith(\"prisma@\"))) {\n skippedPrisma.push(\"prisma\");\n }\n }\n if (planToUse.devPackages.some((p) => p.startsWith(\"@prisma/client@\")) === false &&\n planToUse.regularPackages.some((p) => p.startsWith(\"@prisma/client@\")) === false) {\n // Check if @prisma/client was in the original provider dependencies\n if (providerObj.dependencies.some((p) => p.startsWith(\"@prisma/client@\"))) {\n skippedPrisma.push(\"@prisma/client\");\n }\n }\n if (skippedPrisma.length > 0) {\n result.skipped.push(\n `${skippedPrisma.join(\" and \")} reinstall (already declared at the verified pin)`,\n );\n }\n }\n // Same visibility for the non-Prisma provider dependencies dropped by\n // the plan (declared in the manifest → not reinstalled).\n if (planToUse.declaredProviderDepsDropped.length > 0) {\n result.skipped.push(\n `${planToUse.declaredProviderDepsDropped.join(\", \")} reinstall (already declared)`,\n );\n }\n if (\n planToUse.devPackages.length > 0 ||\n planToUse.regularPackages.length > 0\n ) {\n const installLabel = [\n planToUse.devPackages.length > 0\n ? `dev: ${planToUse.devPackages.join(\", \")}`\n : null,\n planToUse.regularPackages.length > 0\n ? `deps: ${planToUse.regularPackages.join(\", \")}`\n : null,\n ]\n .filter(Boolean)\n .join(\" | \");\n\n const s = spinner();\n s.start(`Installing dependencies (${installLabel})`);\n let installResult: DependencyInstallResult;\n try {\n installResult = await ctx.installer.install(planToUse.dependencyPlan, {\n cwd: ctx.awareness.projectRoot,\n });\n } catch (error) {\n s.stop(\"Failed to install dependencies\");\n throw new InstallerFailureError(\n \"unknown\",\n error instanceof Error ? error.message : String(error),\n { cause: error instanceof Error ? error : undefined },\n );\n }\n\n if (!installResult.success) {\n s.stop(\"Failed to install dependencies\");\n // Normalized failure: reason is machine-usable, hint/suggestion\n // carry the manager's own remediation. A build-script-blocked\n // outcome is reported as what it is — an approval gap, not a\n // broken install.\n const hint = installerFailureHint(installResult);\n if (installResult.reason === \"build-script-blocked\") {\n // Extract blocked package names from the hint/output\n const blockedMatch = installResult.output.match(\n /build scripts for ([\\w@/,-]+) \\(blocked/,\n );\n const blockedPackages = blockedMatch\n ? blockedMatch[1].split(\", \")\n : [\"unknown\"];\n throw new BuildBlockedError(blockedPackages, {\n cause: new Error(hint),\n });\n }\n throw new InstallerFailureError(\n installResult.reason,\n installResult.output.trim().split(\"\\n\").slice(-8).join(\"\\n\"),\n { cause: new Error(hint) },\n );\n }\n\n s.stop(`Successfully installed dependencies (${installLabel})`);\n\n // Even on success, silently-blocked builds are surfaced — the\n // silent-drift hazard (npm/bun/yarn-berry exit 0 with scripts\n // skipped). A note (not a spinner line) because the install itself\n // succeeded; the user must still know their native artifacts may be\n // missing until they approve.\n if (installResult.blockedBuilds.length > 0) {\n note(\n [\n \"Some dependency build scripts were blocked by your package manager:\",\n ...installResult.blockedBuilds.map((name) => ` • ${name}`),\n \" Native artifacts (e.g. .node bindings) may be missing until the builds are approved.\",\n ].join(\"\\n\"),\n \"Install scripts blocked\",\n );\n result.skipped.push(\n `build scripts for ${installResult.blockedBuilds.join(\", \")} (blocked by package manager)`,\n );\n }\n if (installResult.approvedBuilds.length > 0) {\n result.updated.push(\n `pre-approved build scripts for ${installResult.approvedBuilds.join(\", \")}`,\n );\n }\n }\n } else {\n // Dry-run: record the planned installs for the summary\n if (planToUse.devPackages.length > 0) {\n result.wouldRun.push(\n `install dev dependencies (${planToUse.devPackages.join(\", \")})`,\n );\n }\n if (planToUse.regularPackages.length > 0) {\n result.wouldRun.push(\n `install dependencies (${planToUse.regularPackages.join(\", \")})`,\n );\n }\n if (planToUse.buildApprovalNames.length > 0) {\n result.wouldRun.push(\n `pre-approve build scripts (${planToUse.buildApprovalNames.join(\", \")})`,\n );\n }\n }\n\n // Step 3: Execute Prisma initialization — GATED (idempotence). init runs\n // ONLY when prisma/schema.prisma is missing:\n // `prisma init` exits 1 when any prisma/ folder exists (even empty) and\n // CLOBBERS an existing prisma7.config.ts (both verified empirically).\n // If schema is missing but config exists, init runs to create the schema\n // (clobbers config - known limitation), otherwise `prisma generate` fails.\n const providerObj =\n providerDataLocal[planToUse.provider as keyof typeof providerDataLocal];\n if (!ctx.dryRun && !planToUse.initRequired) {\n result.skipped.push(\"Prisma initialization (schema.prisma already exists)\");\n } else if (!ctx.dryRun) {\n try {\n const s = spinner();\n s.start(\n `Initializing Prisma with provider ${providerObj.prismaProvider}...`,\n );\n\n // The skills decision (DXG-owned) is translated here into the exact\n // prisma init argument contract. This array is the single source of\n // truth for BOTH the primary resolution and the originalArgs fallback\n // below, so the two paths can never diverge.\n const prismaInitArguments = buildPrismaInitArgs(\n providerObj.prismaProvider,\n planToUse.installPrismaSkills === true,\n planToUse.prismaInitOutput,\n );\n\n // Use the existing command execution infrastructure\n const prismaResolved = await getCliCommand(\n parseNlx,\n prismaInitArguments,\n {\n cwd: process.cwd(),\n programmatic: true,\n },\n );\n\n if (!prismaResolved) {\n throw new SpawnError(\n \"prisma\",\n [\"init\"],\n \"Failed to resolve prisma command\",\n );\n }\n\n const {\n command: prismaCmdInitial,\n args: prismaArgsInitial,\n cwd: prismaResolvedCwd,\n } = prismaResolved;\n\n let prismaCmd = prismaCmdInitial;\n let prismaArgs = prismaArgsInitial;\n\n // Workaround for @antfu/ni issue with dlx commands\n // When args starts with [\"prisma@7\", \"init\"], some versions incorrectly resolve to \"<agent> add ...\"\n // Built from the same contract as the primary path (see prismaInitArguments).\n const originalArgs = [...prismaInitArguments];\n const pinnedPrismaSpec = `prisma@${PRISMA_PINNED_VERSION}`;\n if (\n originalArgs.length >= 2 &&\n originalArgs[0] === pinnedPrismaSpec &&\n originalArgs[1] === \"init\" &&\n prismaArgs.includes(\"add\")\n ) {\n // Correct the command to use npx (universal)\n prismaCmd = \"npx\";\n // Use the intended arguments\n prismaArgs = originalArgs;\n }\n\n // pnpm dlx build approval (install-layer adapter): when the command\n // really is `pnpm dlx`, pass --allow-build for exactly the plan's\n // approvalOnly packages — otherwise pnpm's dlx cache install drops\n // the transitive @prisma/engines postinstall into ignoredBuilds and\n // (TTY) prompts \"Choose which packages to build\" inside this spinner,\n // or (non-TTY) silently skips the schema-engine binary download.\n prismaArgs = withDlxBuildApprovals(\n prismaCmd,\n prismaArgs,\n planToUse.dependencyPlan,\n );\n\n const prismaExecuteCwd = prismaResolvedCwd ?? process.cwd();\n\n try {\n // Use stdio: \"pipe\" to capture output and prevent leakage into the terminal.\n // Output is only surfaced on failure for diagnostics.\n const result = await executeCommand(prismaCmd, prismaArgs, {\n cwd: prismaExecuteCwd,\n stdio: \"pipe\",\n });\n s.stop(\n `Prisma initialized successfully with provider ${providerObj.prismaProvider}`,\n );\n // Success: output is intentionally discarded to keep the terminal clean.\n // The Clack spinner provides the user-facing progress indication.\n void result; // Acknowledge captured output is intentionally unused on success.\n } catch (executeError) {\n s.stop(`Failed to initialize Prisma`);\n // Capture stdout/stderr from the error for diagnostics.\n const errorOutput =\n executeError instanceof Error && \"stdout\" in executeError\n ? ((executeError as ExecaError).stdout ??\n (executeError as ExecaError).stderr ??\n \"\")\n : \"\";\n const errorMessage =\n executeError instanceof Error\n ? executeError.message\n : String(executeError);\n // Include captured output in the error message for actionable diagnostics.\n const fullMessage = errorOutput\n ? `${errorMessage}\\n\\nCaptured output:\\n${errorOutput}`\n : errorMessage;\n throw new SpawnError(prismaCmd, prismaArgs, fullMessage, {\n cause: executeError instanceof Error ? executeError : undefined,\n });\n }\n } catch (error) {\n throw new SpawnError(\n \"prisma\",\n [\"init\"],\n error instanceof Error ? error.message : String(error),\n { cause: error instanceof Error ? error : undefined },\n );\n }\n }\n\n // Step 3b: .env additive reconciliation (decision document, section 5).\n // `prisma init` preserves an existing .env byte-for-byte but NEVER adds\n // DATABASE_URL to it (verified empirically) — the historical false\n // success: green run, broken runtime. DXG owns the gap:\n // - .env absent → create a minimal one with header. When init ran, it\n // created a .env with DATABASE_URL=\"\" (empty) that the write below\n // REPLACES with the minimal file — envExists holds the PRE-RUN truth,\n // so the \"absent\" branch wins over init's empty placeholder.\n // - .env present without DATABASE_URL → SQLite: append DATABASE_URL line;\n // server providers: do nothing (user configures later via .env or CLI).\n // - .env already defines DATABASE_URL → untouched.\n // The line's VALUE (plan.envDatabaseUrlLine): SQLite gets the conventional\n // file URL (empty fails `prisma db push`). Server providers only get a\n // DATABASE_URL line when user explicitly provides one (interactive opt-in\n // or CLI). In non-interactive mode without explicit databaseUrl, nothing\n // is written — user configures later.\n // Track whether we created/updated .env in this run (for .gitignore gating)\n let envCreatedOrUpdated = false;\n // Check if we have individual env lines to write (for mysql, sqlserver)\n const hasIndividualLines = Boolean(planToUse.envIndividualLines);\n if (ctx.dryRun) {\n if (!planToUse.envExists) {\n const parts = [\"create minimal .env (header only\"];\n if (planToUse.envDatabaseUrlLine) parts.push(\"DATABASE_URL\");\n if (hasIndividualLines) parts.push(\"individual params\");\n result.wouldRun.push(parts.join(\" + \") + \")\");\n } else if (!planToUse.envHasDatabaseUrl) {\n const isServerProvider = planToUse.provider !== \"sqlite\";\n const hasDatabaseUrlLine = Boolean(planToUse.envDatabaseUrlLine);\n if (isServerProvider && !hasDatabaseUrlLine && !hasIndividualLines) {\n result.wouldRun.push(\n \"skip .env DATABASE_URL (server provider, user configures later)\",\n );\n } else {\n const parts = [\"append\"];\n if (hasDatabaseUrlLine) parts.push(\"DATABASE_URL\");\n if (hasIndividualLines) parts.push(\"individual params\");\n result.wouldRun.push(parts.join(\" + \") + \" to .env\");\n }\n } else {\n // Check if individual params are missing even when DATABASE_URL exists\n if (hasIndividualLines) {\n // In dry-run we can't check actual .env content, so we note the possibility\n result.wouldRun.push(\n \"check .env for missing individual params (mysql/sqlserver)\",\n );\n } else {\n result.wouldRun.push(\"skip .env (already has DATABASE_URL)\");\n }\n }\n } else {\n const envPath = join(ctx.awareness.projectRoot, \".env\");\n // envExists comes from the inspection (pre-run truth); when init\n // just created .env it holds DATABASE_URL already (marker false).\n const envText = planToUse.envExists\n ? ((await fs.readFile(envPath, {\n encoding: \"utf8\",\n })) as string | undefined)\n : undefined;\n\n if (typeof envText !== \"string\") {\n // No .env at all: create minimal file with header.\n // For SQLite, include DATABASE_URL; for server providers without\n // explicit databaseUrl, create header only (user configures later).\n // For individualParams providers (mysql, sqlserver), also include individual params.\n const lines = [\n \"# Environment variables — declared by the database layer\",\n ];\n if (planToUse.envDatabaseUrlLine) {\n lines.push(planToUse.envDatabaseUrlLine);\n }\n if (planToUse.envIndividualLines) {\n lines.push(planToUse.envIndividualLines);\n }\n lines.push(\"\");\n await writeSecureFile(envPath, lines.join(\"\\n\"));\n envCreatedOrUpdated = true;\n const parts = [];\n if (planToUse.envDatabaseUrlLine) parts.push(\"DATABASE_URL\");\n if (planToUse.envIndividualLines) parts.push(\"individual params\");\n result.created.push(\n parts.length > 0\n ? `.env (minimal, ${parts.join(\" + \")})`\n : \".env (minimal, header only — server provider, user configures later)\",\n );\n } else if (!/^\\s*(?:export\\s+)?DATABASE_URL\\s*=/m.test(envText)) {\n // .env exists but no DATABASE_URL.\n // SQLite: append DATABASE_URL. Server providers without databaseUrl: do nothing.\n // For individualParams providers (mysql, sqlserver), also append individual params.\n const linesToAppend: string[] = [];\n if (planToUse.envDatabaseUrlLine) {\n linesToAppend.push(planToUse.envDatabaseUrlLine);\n }\n if (planToUse.envIndividualLines) {\n // Split individual lines and only append those not already present\n const individualLines = planToUse.envIndividualLines.split(\"\\n\");\n for (const line of individualLines) {\n const varName = line.split(\"=\")[0];\n if (\n !new RegExp(`^\\\\s*(?:export\\\\s+)?${varName}\\\\s*=`).test(envText)\n ) {\n linesToAppend.push(line);\n }\n }\n }\n\n if (linesToAppend.length > 0) {\n const needsLeadingNewline =\n envText.length > 0 && !envText.endsWith(\"\\n\");\n await writeSecureFile(\n envPath,\n `${envText}${needsLeadingNewline ? \"\\n\" : \"\"}${linesToAppend.join(\"\\n\")}\\n`,\n );\n envCreatedOrUpdated = true;\n const parts = [];\n if (planToUse.envDatabaseUrlLine) parts.push(\"DATABASE_URL\");\n if (planToUse.envIndividualLines) parts.push(\"individual params\");\n result.updated.push(`.env (appended ${parts.join(\" + \")})`);\n } else {\n result.skipped.push(\n \".env (no DATABASE_URL added — server provider, user configures later)\",\n );\n }\n } else {\n // .env already has DATABASE_URL — check if individual params are missing.\n if (planToUse.envIndividualLines) {\n const individualLines = planToUse.envIndividualLines.split(\"\\n\");\n const missingLines: string[] = [];\n for (const line of individualLines) {\n const varName = line.split(\"=\")[0];\n if (\n !new RegExp(`^\\\\s*(?:export\\\\s+)?${varName}\\\\s*=`).test(envText)\n ) {\n missingLines.push(line);\n }\n }\n if (missingLines.length > 0) {\n const needsLeadingNewline =\n envText.length > 0 && !envText.endsWith(\"\\n\");\n await writeSecureFile(\n envPath,\n `${envText}${needsLeadingNewline ? \"\\n\" : \"\"}${missingLines.join(\"\\n\")}\\n`,\n );\n envCreatedOrUpdated = true;\n result.updated.push(\".env (appended individual params)\");\n } else {\n result.skipped.push(\n \".env (already has DATABASE_URL and individual params)\",\n );\n }\n } else {\n result.skipped.push(\".env (already has DATABASE_URL)\");\n }\n }\n }\n\n // Step 3c: .gitignore coverage for the .env this run wrote. `prisma\n // init` warns about it (\"Don't forget to add .env in it to not commit\n // any private information\" — live-captured in the audit reference\n // run) but never acts. DXG owns the DATABASE_URL declaration, so DXG\n // closes the hygiene loop — additively and byte-preservingly,\n // mirroring Step 3b's philosophy:\n // - .gitignore absent → create a minimal one covering .env.\n // - present without .env coverage → APPEND the line; every existing\n // byte is preserved.\n // - already covering .env (whole-line spellings: .env, .env*,\n // *.env — the only spellings git actually ignores .env under,\n // probe-verified 2026-10-11; \".env.*\" does NOT cover .env) →\n // untouched. Trailing spaces are insignificant to git (trimmed\n // for the comparison); leading spaces are significant — an\n // indented \" .env\" is not coverage and must not count.\n // - an explicit `!.env` negation is a deliberate user choice to track\n // .env → respected, untouched.\n // Scoped to runs where DXG created or updated .env: a user-owned .env\n // that already declared DATABASE_URL is none of DXG's business, and\n // reruns find DATABASE_URL already declared, never re-entering this\n // path (idempotent by construction).\n if (envCreatedOrUpdated) {\n if (ctx.dryRun) {\n result.wouldRun.push(\"ensure .gitignore covers .env\");\n } else {\n const gitignorePath = join(ctx.awareness.projectRoot, \".gitignore\");\n // pathExists BEFORE readFile: readFile throws ENOENT on a missing\n // file (there is no pre-run inspection for .gitignore — unlike\n // .env's envExists marker), so existence is checked here.\n const gitignoreText = (await fs.pathExists(gitignorePath))\n ? ((await fs.readFile(gitignorePath, {\n encoding: \"utf8\",\n })) as string)\n : undefined;\n const lines =\n typeof gitignoreText === \"string\" ? gitignoreText.split(/\\r?\\n/) : [];\n const coversEnv = lines.some((line) =>\n [\".env\", \".env*\", \"*.env\"].includes(line.trimEnd()),\n );\n const negatesEnv = lines.some((line) => line.trimEnd() === \"!.env\");\n if (!coversEnv && !negatesEnv) {\n if (typeof gitignoreText !== \"string\") {\n await fs.writeFile(gitignorePath, \".env\\n\", \"utf8\");\n result.created.push(\".gitignore (covers .env)\");\n } else {\n const needsLeadingNewline =\n gitignoreText.length > 0 && !gitignoreText.endsWith(\"\\n\");\n await fs.writeFile(\n gitignorePath,\n `${gitignoreText}${needsLeadingNewline ? \"\\n\" : \"\"}.env\\n`,\n \"utf8\",\n );\n result.updated.push(\".gitignore (appended .env)\");\n }\n } else if (coversEnv && !negatesEnv) {\n // .gitignore already covers .env — nothing to do\n result.skipped.push(\".gitignore (already covers .env)\");\n }\n }\n } else if (planToUse.envExists && planToUse.envHasDatabaseUrl) {\n // .env already has DATABASE_URL — check if .gitignore covers it for summary\n const gitignorePath = join(ctx.awareness.projectRoot, \".gitignore\");\n const gitignoreText = (await fs.pathExists(gitignorePath))\n ? ((await fs.readFile(gitignorePath, {\n encoding: \"utf8\",\n })) as string)\n : undefined;\n const lines =\n typeof gitignoreText === \"string\" ? gitignoreText.split(/\\r?\\n/) : [];\n const coversEnv = lines.some((line) =>\n [\".env\", \".env*\", \"*.env\"].includes(line.trimEnd()),\n );\n if (coversEnv) {\n result.skipped.push(\".gitignore (already covers .env)\");\n }\n }\n\n // Step 3d: Run prisma db push to initialize the database with the schema.\n // This MUST run after .env reconciliation (Step 3b) so that DATABASE_URL\n // is correctly configured. For SQLite, this creates the dev.db file and\n // applies the schema. For server providers, prisma db push is NOT run by\n // DXG — users who need migrations run the Prisma CLI directly (prisma\n // migrate dev) or use external workflows. This step is required on every\n // run (fresh or reconcile) for SQLite because schema changes between runs\n // would leave the database stale. `prisma db push` is idempotent on an\n // unchanged schema (verified empirically).\n if (!ctx.dryRun && planToUse.provider === \"sqlite\") {\n try {\n const s = spinner();\n s.start(\"Pushing schema to database (prisma db push)\");\n\n // Use the locally installed Prisma binary via the package manager's\n // exec command (pnpm prisma, npx prisma, yarn prisma, bunx prisma)\n // instead of dlx (which downloads Prisma fresh each time). This is\n // faster since Prisma is already installed as a dev dependency.\n const agent = ctx.installer?.agent ?? \"npm\";\n const execCmd =\n agent === \"bun\" ? \"bunx\" : agent === \"npm\" ? \"npx\" : agent;\n const pushArgs = [\"prisma\", \"db\", \"push\"];\n\n try {\n // Use stdio: \"pipe\" to capture output and prevent leakage into the terminal.\n // Output is only surfaced on failure for diagnostics.\n const result = await executeCommand(execCmd, pushArgs, {\n cwd: process.cwd(),\n stdio: \"pipe\",\n });\n s.stop(\"Schema pushed to database (prisma db push)\");\n // Success: output is intentionally discarded to keep the terminal clean.\n void result;\n } catch (executeError) {\n s.stop(`Failed to push schema to database`);\n // Capture stdout/stderr from the error for diagnostics.\n const errorOutput =\n executeError instanceof Error && \"stdout\" in executeError\n ? ((executeError as ExecaError).stdout ??\n (executeError as ExecaError).stderr ??\n \"\")\n : \"\";\n const errorMessage =\n executeError instanceof Error\n ? executeError.message\n : String(executeError);\n // Include captured output in the error message for actionable diagnostics.\n const fullMessage = errorOutput\n ? `${errorMessage}\\n\\nCaptured output:\\n${errorOutput}`\n : errorMessage;\n throw new SpawnError(execCmd, pushArgs, fullMessage, {\n cause: executeError instanceof Error ? executeError : undefined,\n });\n }\n } catch (error) {\n throw new SpawnError(\n \"prisma\",\n [\"db\", \"push\"],\n error instanceof Error ? error.message : String(error),\n { cause: error instanceof Error ? error : undefined },\n );\n }\n } else if (planToUse.provider === \"sqlite\") {\n // Dry-run: record the planned prisma db push (SQLite only).\n result.wouldRun.push(\"prisma db push\");\n }\n\n // Step 3e: Generate the Prisma Client — ALWAYS (decision document,\n // section \"always-generate\"): `prisma generate` is byte-stable on an\n // unchanged schema (verified empirically, identical sha256 across runs)\n // and costs 300-700 ms, while skipping on client-existence alone is\n // indefensible (a model added between two runs would leave a stale\n // client — the staleness case). The command therefore runs on every\n // reconcile, fresh OR existing, after a skipped OR executed init.\n // Runs AFTER prisma db push so the generated client reflects the\n // database state.\n if (!ctx.dryRun) {\n // Step 3e: Generate the Prisma Client. Prisma 7 has NO auto-generate —\n // @prisma/client ships a stub that throws \"did not initialize yet\" at\n // import time until `prisma generate` runs, and no install-lifecycle\n // script triggers it. Without this step the generated lib/prisma.ts\n // would import a path that does not exist yet.\n //\n // Use the locally installed Prisma binary via the package manager's\n // exec command (pnpm prisma, npx prisma, yarn prisma, bunx prisma)\n // instead of dlx (which downloads Prisma fresh each time). This is\n // faster since Prisma is already installed as a dev dependency.\n try {\n const s = spinner();\n s.start(\"Generating Prisma Client\");\n\n // Map agent to exec command for running local binaries\n const agent = ctx.installer?.agent ?? \"npm\";\n const execCmd =\n agent === \"bun\" ? \"bunx\" : agent === \"npm\" ? \"npx\" : agent;\n const generateArgs = [\"prisma\", \"generate\", \"--no-hints\"];\n\n try {\n // Use stdio: \"pipe\" to capture output and prevent leakage into the terminal.\n // Output is only surfaced on failure for diagnostics.\n const generateResult = await executeCommand(execCmd, generateArgs, {\n cwd: process.cwd(),\n stdio: \"pipe\",\n });\n s.stop(\"Prisma Client generated\");\n // Success: output is intentionally discarded to keep the terminal clean.\n void generateResult; // Acknowledge captured output is intentionally unused on success.\n // Report Prisma Client generation in the operation summary.\n result.created.push(\"Prisma Client generated\");\n } catch (executeError) {\n s.stop(`Failed to generate Prisma Client`);\n // Capture stdout/stderr from the error for diagnostics.\n const errorOutput =\n executeError instanceof Error && \"stdout\" in executeError\n ? ((executeError as ExecaError).stdout ??\n (executeError as ExecaError).stderr ??\n \"\")\n : \"\";\n const errorMessage =\n executeError instanceof Error\n ? executeError.message\n : String(executeError);\n // Include captured output in the error message for actionable diagnostics.\n const fullMessage = errorOutput\n ? `${errorMessage}\\n\\nCaptured output:\\n${errorOutput}`\n : errorMessage;\n throw new SpawnError(execCmd, generateArgs, fullMessage, {\n cause: executeError instanceof Error ? executeError : undefined,\n });\n }\n } catch (error) {\n throw new SpawnError(\n \"prisma\",\n [\"generate\", \"--no-hints\"],\n error instanceof Error ? error.message : String(error),\n { cause: error instanceof Error ? error : undefined },\n );\n }\n } else {\n // Dry-run: record the planned prisma init and the files Prisma owns.\n // The gated path (initRequired=false) shows the skip instead — the\n // wouldRun entries below reflect only what would actually execute.\n if (!planToUse.initRequired) {\n result.skipped.push(\n \"Prisma initialization (schema.prisma already exists)\",\n );\n }\n // Reflect the DXG-owned skills decision in the planned command:\n // No (default) → \"--no-skills\" is part of the planned arguments;\n // Yes → the flag is omitted (prisma@7 then installs skills\n // non-interactively). Nothing is executed in dry-run mode.\n if (planToUse.initRequired) {\n const plannedArgs = buildPrismaInitArgs(\n providerObj.prismaProvider,\n planToUse.installPrismaSkills === true,\n planToUse.prismaInitOutput,\n )\n .slice(1) // drop the \"prisma@7\" package spec for display\n .join(\" \");\n result.wouldRun.push(`prisma ${plannedArgs}`);\n }\n result.wouldRun.push(\"prisma db push\");\n result.wouldRun.push(\"prisma generate --no-hints\");\n if (planToUse.initRequired) {\n result.wouldRun.push(\n \"create prisma/schema.prisma, prisma7.config.ts, .env (Prisma-owned)\",\n );\n }\n }\n\n // Step 4: Add the selected database scripts to package.json\n const selectedScripts = resolveDatabaseScripts(\n answers.databaseScripts,\n planToUse.provider,\n );\n if (selectedScripts.length === 0) {\n // \"Skip\" (or an empty customize selection): package.json is left\n // untouched; the summary makes the skip visible.\n result.skipped.push(\"database scripts (skipped)\");\n } else if (!ctx.dryRun) {\n // Declared with let (not const) because addPackageScripts is the\n // sole assignment; the initial value documents the empty-result shape\n // for the catch path below.\n let scriptResult: {\n added: string[];\n skipped: string[];\n conflicted: { script: string; existingCommand: string }[];\n };\n try {\n const scriptsToAdd: Record<string, string> = {};\n for (const name of selectedScripts) {\n scriptsToAdd[name] = databaseScriptCatalog[name].command;\n }\n\n // Read package.json FRESH from disk. Steps 1-2 of this run executed the\n // package manager, which persists the newly installed dependencies into\n // package.json on disk. `ctx.awareness.packageJson` is the pre-install\n // snapshot captured ONCE at CLI bootstrap (detectProjectAwareness) —\n // handing it to addPackageScripts would write that stale snapshot back\n // verbatim (full writeJson overwrite), erasing every dependency the\n // package manager just recorded: node_modules had Prisma, the manifest\n // no longer declared it, and a later `pnpm prisma ...` pruned the\n // \"extraneous\" packages. ProjectAwareness stays read-only knowledge.\n const packageJsonPath = join(ctx.awareness.projectRoot, \"package.json\");\n const currentPackageJson = await ctx.fs.readJson<\n Record<string, unknown> & { scripts?: Record<string, string> }\n >(packageJsonPath);\n\n scriptResult = await addPackageScripts(\n currentPackageJson,\n ctx.awareness.projectRoot,\n ctx.dryRun ?? false,\n ctx.force ?? false,\n {\n readJson: ctx.fs.readJson,\n writeJson: ctx.fs.writeJson,\n },\n scriptsToAdd,\n );\n\n // Seed support (Prisma 7 contract): `prisma db seed` resolves its\n // command from `migrations.seed` in prisma7.config.ts — never from\n // package.json. Applied as its own file write, separate from the\n // scripts write-back (different file, different semantics): the\n // rest of the Prisma-owned config is preserved byte-for-byte.\n if (planToUse.seedSelected) {\n const seedConfigResult = await applySeedConfigToPrismaFile(\n ctx.fs,\n ctx.awareness.projectRoot,\n ctx.force ?? false,\n );\n if (seedConfigResult.conflictExisting !== undefined) {\n result.conflicts.push({\n path: `${PRISMA_CONFIG_PATH} migrations.seed (existing: ${seedConfigResult.conflictExisting})`,\n existsAs: \"file\",\n });\n } else if (seedConfigResult.added) {\n result.updated.push(\n `${PRISMA_CONFIG_PATH} migrations.seed (${SEED_CONFIG_COMMAND})`,\n );\n }\n // skipped → already configured identically; the summary reports\n // it through the script result (db:seed already exists).\n }\n\n // Record script results into the structured operation result —\n // rendered once by summarizeDatabase, never narrated mid-run.\n if (scriptResult.added.length > 0) {\n // If we added scripts, we've updated package.json\n result.updated.push(\"package.json\");\n result.updated.push(\n ...scriptResult.added.map(\n (script) => `package.json scripts (${script})`,\n ),\n );\n }\n if (scriptResult.skipped.length > 0) {\n result.skipped.push(\n ...scriptResult.skipped.map(\n (script) => `package.json script ${script} (already exists)`,\n ),\n );\n }\n if (scriptResult.conflicted.length > 0) {\n const conflictDetails = scriptResult.conflicted\n .map((c) => `${c.script} (existing: ${c.existingCommand})`)\n .join(\", \");\n result.conflicts.push({\n path: `package.json scripts (${conflictDetails})`,\n existsAs: \"file\",\n });\n }\n } catch (error) {\n // Don't fail the whole generator for script issues — but a missing\n // scripts section is actionable context the user needs to know about,\n // so it earns a single dedicated note (not part of the success summary).\n note(\n `Failed to add database scripts: ${error instanceof Error ? error.message : String(error)}`,\n \"Warning\",\n );\n }\n } else {\n // Dry-run: record the planned script additions for the summary\n result.wouldRun.push(\n `add database scripts to package.json (${selectedScripts.join(\", \")})`,\n );\n }\n\n // Step 4: Handle DXG-owned application template (Prisma Client integration)\n for (const { path, templatePath, data } of planToUse.filesToCreate) {\n // Read the template file with utf8 encoding to get a string directly\n let template: string;\n try {\n template = (await fs.readFile(templatePath, {\n encoding: \"utf8\",\n })) as string;\n } catch (error) {\n throw new TemplateMissingError(templatePath, {\n cause: error instanceof Error ? error : undefined,\n });\n }\n\n const rendered = ctx.templates.render(template, data);\n const exists = await fs.pathExists(path);\n\n if (exists) {\n // Check if it's a file or directory\n const stats = await fs.stat(path);\n const isDirectory = stats.isDirectory();\n\n if (isDirectory) {\n // Directory collision - expected path is occupied by a directory\n result.conflicts.push({ path, existsAs: \"directory\" });\n continue;\n }\n\n // It's a file, check content (normalize line endings and trailing spaces for idempotence)\n const current = (await fs.readFile(path, { encoding: \"utf8\" })) as string;\n if (normalizeContent(current) === normalizeContent(rendered)) {\n result.skipped.push(path);\n continue;\n }\n\n // File exists with different content - handle based on dryRun and force flags\n if (ctx.dryRun) {\n // In dry-run mode, report as conflict (would need user interaction or force to resolve)\n result.conflicts.push({ path, existsAs: \"file\" });\n continue;\n }\n\n if (ctx.force) {\n // Force overwrite\n await fs.writeFile(path, rendered, \"utf8\");\n result.updated.push(path);\n continue;\n }\n\n // Without force, treat as conflict\n result.conflicts.push({ path, existsAs: \"file\" });\n continue;\n } else {\n // Path doesn't exist, check if parent directory would be a file collision\n const dir = path.split(\"/\").slice(0, -1).join(\"/\");\n if (dir) {\n const dirExists = await fs.pathExists(dir);\n if (dirExists) {\n const dirStats = await fs.stat(dir);\n if (dirStats.isFile()) {\n // Parent path is occupied by a file\n result.conflicts.push({ path: dir, existsAs: \"file\" });\n continue;\n }\n }\n }\n\n // Safe to create\n if (!ctx.dryRun) {\n // Ensure the directory exists\n if (dir && !(await fs.pathExists(dir))) {\n await fs.mkdir(dir, { recursive: true });\n }\n await fs.writeFile(path, rendered, \"utf8\");\n }\n result.created.push(path);\n }\n }\n\n return result;\n}\n\n// Verification function\nexport async function verifyDatabase(\n answers: Record<string, unknown>,\n ctx: GeneratorContext,\n plan?: ReturnType<typeof planDatabase>,\n): Promise<void> {\n const { fs } = ctx;\n const planToUse = plan ?? planDatabase(answers);\n\n // Verify that the DXG-owned application file exists if it was supposed to be created\n for (const { path } of planToUse.filesToCreate) {\n const exists = await fs.pathExists(path);\n if (!exists) {\n throw new ValidationError(\n `Expected file missing after generation: ${path}`,\n );\n }\n }\n\n // Prisma-owned artifact: the generated client. The path is DYNAMIC —\n // parsed from the schema's generator block when the project owns its\n // schema (custom output), the DXG default otherwise. `prisma generate`\n // writes client.ts at that output (prisma-client generator writes INTO\n // the project, not node_modules). Missing client.ts = the \"did not\n // initialize yet\" stub at import time — verified empirically in lab\n // e2e-pnpm/e2e-npm.\n const generatedClientPath = `${planToUse.generatorOutput}/client.ts`;\n if (!(await fs.pathExists(generatedClientPath))) {\n throw new ValidationError(\n `Prisma Client was not generated: ${generatedClientPath} is missing. Run \"npm run db:generate\" (prisma generate) and try again.`,\n );\n }\n\n // Native-driver artifact (SQLite only): the better-sqlite3 binding.\n // Version-aware (lab-verified): 12.x resolves lazily through the\n // `bindings` package → build/Release/better_sqlite3.node; 13.x ships\n // N-API prebuilds inside the tarball → prebuilds/<platform>-<arch>.node.\n // The plan pins ^12.6.0 (adapter requirement), but verification must\n // accept either layout — a user may have resolved a different major.\n // A missing binding is EXACTLY what a blocked install script leaves\n // behind: install exits 0 (npm/bun) or 1-with-tree-installed (pnpm),\n // `require(\"better-sqlite3\")` still succeeds, and the failure only\n // surfaces at `new Database()` with \"Could not locate the bindings file\".\n if (planToUse.provider === \"sqlite\" && !ctx.dryRun) {\n const bindingCandidates = [\n \"node_modules/better-sqlite3/build/Release/better_sqlite3.node\", // 12.x\n // 13.x prebuilds: platform-arch named (win32-x64, linux-arm64, …) —\n // glob-less probe: the directory itself is the signal.\n \"node_modules/better-sqlite3/prebuilds\",\n ];\n let bindingFound = false;\n for (const candidate of bindingCandidates) {\n if (await fs.pathExists(candidate)) {\n bindingFound = true;\n break;\n }\n }\n if (!bindingFound) {\n throw new BuildBlockedError([\"better-sqlite3\"], {\n cause: new Error(\"Native binding not found after install\"),\n });\n }\n }\n\n // Note: We don't verify prisma-owned files (schema.prisma, prisma7.config.ts, .env)\n // as they are managed by Prisma CLI, not DXG — but the generated client\n // IS verified because lib/prisma.ts imports it.\n}\n\n// Summarize function using Clack UX (replaces logger-based summarization).\n// Collect first, render once: the structured result — including the dry-run\n// plan — is consolidated into a single coherent Operation Summary note.\n// Fully Clack-native: no logger output (completion itself is communicated\n// by the generator's outro).\nexport interface SummarizeDatabaseOptions {\n created: string[];\n updated: string[];\n skipped: string[];\n conflicts: { path: string; existsAs: \"file\" | \"directory\" }[];\n wouldRun?: string[];\n /** Detected Prisma provider (for the \"Detected\" section in dry-run). */\n detectedProvider?: string | null;\n /** Requested provider (for the \"Detected\" section in dry-run). */\n requestedProvider?: string;\n}\n\n/**\n * Summarizes the database generator operation.\n * Includes a \"Detected\" section showing the existing Prisma provider vs requested.\n */\nexport function summarizeDatabase(options: SummarizeDatabaseOptions): void {\n const {\n created,\n updated,\n skipped,\n conflicts,\n wouldRun,\n detectedProvider,\n requestedProvider,\n } = options;\n\n const sections: string[] = [];\n\n // Detected section (shown in dry-run and normal execution when Prisma exists)\n if (detectedProvider !== undefined) {\n const detectedLine = detectedProvider\n ? `Prisma provider: ${detectedProvider}`\n : \"Prisma provider: (not determined)\";\n const requestedLine = requestedProvider\n ? `Requested: ${requestedProvider}`\n : \"Requested: (unknown)\";\n\n let matchStatus = \"\";\n if (detectedProvider && requestedProvider) {\n matchStatus = providersMatch(detectedProvider, requestedProvider)\n ? \" (match)\"\n : \" (mismatch), no action\";\n }\n\n sections.push(\n [\n \"Detected:\",\n ` • ${detectedLine}`,\n ` • ${requestedLine}${matchStatus}`,\n ].join(\"\\n\"),\n );\n }\n\n if (created.length) {\n sections.push([\"Created:\", ...created.map((p) => ` • ${p}`)].join(\"\\n\"));\n }\n\n if (updated.length) {\n sections.push([\"Updated:\", ...updated.map((p) => ` • ${p}`)].join(\"\\n\"));\n }\n\n if (skipped.length) {\n sections.push([\"Skipped:\", ...skipped.map((p) => ` • ${p}`)].join(\"\\n\"));\n }\n\n if (conflicts.length) {\n sections.push(\n [\n \"Conflicts:\",\n ...conflicts.map((c) => ` • ${c.path} (${c.existsAs})`),\n ].join(\"\\n\"),\n );\n }\n\n // Dry-run plan: the operations that WOULD be performed, described\n // coherently instead of note-by-note narration.\n if (wouldRun && wouldRun.length > 0) {\n sections.push(\n [\"Would run:\", ...wouldRun.map((op) => ` • ${op}`)].join(\"\\n\"),\n );\n }\n\n // Only render the summary block when there is something to report.\n if (sections.length > 0) {\n note(sections.join(\"\\n\\n\"), \"Operation Summary\");\n }\n}\n\n/**\n * Database generator – satisfies the Generator interface.\n * The run method executes the full pipeline: validate → plan → execute → verify → summarize.\n */\nexport const databaseGenerator: Generator = {\n name: \"database\",\n description: \"Adds Prisma ORM with a selected database provider\",\n prompts: databasePrompts,\n async run(cliAnswers: Record<string, unknown>, context: GeneratorContext) {\n const ctx = context;\n\n // Collect inputs - use CLI/provided answers\n const answers = { ...cliAnswers };\n\n // ============================================================\n // STEP 0: ORM Selection (MUST BE FIRST - before provider validation)\n // ============================================================\n // Get ORM from CLI flag or prompt interactively\n const rawOrm = answers.orm as string | undefined;\n let orm: \"prisma\" | \"drizzle\" | undefined;\n\n if (rawOrm !== undefined) {\n // CLI flag provided: validate it\n if (rawOrm === \"prisma\" || rawOrm === \"drizzle\") {\n orm = rawOrm;\n } else {\n throw new ValidationError(\n `Unsupported ORM: ${rawOrm}. Supported: prisma, drizzle`,\n );\n }\n }\n\n // If ORM not provided via CLI, prompt in interactive mode\n if (orm === undefined) {\n const shouldPrompt =\n !ctx.dryRun && !ctx.nonInteractive && !process.env.CI;\n // Backward compatibility: if caller pre-provided Prisma-required answers\n // (at minimum provider), assume Prisma and skip the ORM prompt.\n // This allows existing tests and scripts to work unchanged.\n const hasPrismaAnswers =\n answers.provider !== undefined ||\n answers.databaseUrl !== undefined ||\n answers.installPrismaSkills !== undefined ||\n answers.databaseScripts !== undefined ||\n answers.helperPath !== undefined;\n\n if (shouldPrompt && !hasPrismaAnswers) {\n // Show intro only in interactive mode\n intro(pc.bgCyan(pc.black(\" DXG Database Setup \")));\n\n // Prompt for ORM selection\n const ormPrompt = databasePrompts[0]; // ORM prompt is now first in array\n try {\n const ormAnswer = await prompt([ormPrompt] as Parameters<\n typeof prompt\n >[0]);\n orm = ormAnswer.orm as \"prisma\" | \"drizzle\";\n } catch (error) {\n if (isCancel(error)) {\n throw error;\n }\n throw error;\n }\n } else {\n // Non-interactive mode OR all Prisma answers pre-provided: default to prisma\n orm = \"prisma\";\n }\n }\n\n // Store ORM in answers for downstream use\n answers.orm = orm;\n\n // Drizzle is a placeholder for now: its flow throws a ValidationError\n // (\"not supported yet\"), so the CLI exits with a non-zero code.\n if (orm === \"drizzle\") {\n await setupDrizzleFlow(answers, ctx);\n return;\n }\n\n // Delegate to Prisma flow for all Prisma-specific logic\n await setupPrismaFlow(answers, ctx);\n },\n};\n\n// Default export for convenience\nexport default databaseGenerator;\n\n// Re-export new exports from prisma-flow for backward compatibility\nexport { setupPrismaFlow, type PlanDatabaseResult } from \"./prisma-flow\";\n","/**\n * The dependency installer: resolves the package-manager command via\n * @antfu/ni, pre-writes build approvals for exactly the plan's\n * `requiresBuild` packages, executes with buffered output, then normalizes\n * the outcome.\n *\n * Output handling — the deliberate deviation from DXG's `stdio: \"inherit\"`\n * convention for installs ONLY: the silent blockers (npm 12, bun, yarn\n * berry) print their \"scripts blocked\" notices on stdout/stderr while\n * exiting 0. Inherit would stream those straight past the Clack spinner\n * AND make them invisible to classification. So installs run piped; the\n * spinner stays alive (the Clack convention survives). The captured\n * output rides the result: on failure the caller embeds the tail in the\n * thrown error, on success the blocked-builds note names the affected\n * packages. `prisma init`/`prisma generate` keep `inherit` — they are\n * tool output the user wants live.\n *\n * Non-interactivity: every getCliCommand call passes `programmatic: true`\n * — verified in ni's source: the \"Would you like to globally install yarn?\"\n * prompt exists ONLY on the non-programmatic path (`if (name &&\n * !cmdExists(name) && !programmatic)`), and CI=1 exits 1 instead. No\n * hidden prompts can ever spawn from here.\n */\n\nimport { parseNi, getCliCommand } from \"@antfu/ni\";\nimport { executeCommand } from \"@dxgjs/fs\";\nimport { join } from \"path\";\nimport type { FSInterface } from \"../types\";\nimport type {\n DependencyInstallOptions,\n DependencyInstallResult,\n DependencyInstaller,\n DependencyPlan,\n PackageManagerAgent,\n} from \"./types\";\nimport {\n applyNpmAllowScripts,\n applyPnpmAllowBuilds,\n applyYarnBerryDependenciesMeta,\n} from \"./approvals\";\nimport {\n classifyInstallFailure,\n packageNameFromSpec,\n scanBlockedBuilds,\n} from \"./classify\";\n\nexport { packageNameFromSpec };\n\n/** Options for createDependencyInstaller. */\nexport interface CreateInstallerOptions {\n /** Agent detected via @antfu/ni (fine-grained: yarn vs yarn@berry). */\n agent: PackageManagerAgent;\n /** Filesystem seam (GeneratorContext.fs). */\n fs: FSInterface;\n}\n\n/**\n * Reconciles package.json after a successful install batch: the manifest\n * must state the spec DXG commanded, not the manager's save-prefix\n * policy. npm resolves `prisma@^7.10.1` and saves it caret-prefixed\n * (`^7.10.1` — live-verified on npm 12), and even a\n * commanded range comes back as the latest match\n * (`better-sqlite3@^12.6.0` → `^12.11.1`), silently breaking the\n * verified-pin contract. pnpm is NOT exempt: 12.5.1 saves pins verbatim\n * but bumps commanded ranges to the latest match too (live-proven\n * 2026-10-11: `pnpm add better-sqlite3@^12.6.0` saves `^12.11.1` into\n * both manifest and lockfile). This therefore runs for every agent and\n * rewrites only when an installed entry actually differs — yarn/bun's\n * verbatim saves make it a read-and-skip (byte-stable fixpoint). Naked\n * specs (no `@version` part) carry no version contract and stay as\n * the manager wrote them; entries outside the batch are never touched.\n *\n * Returns whether the manifest was rewritten: the caller must then\n * refresh the lockfile via LOCKFILE_SYNC, which still records the\n * manager's rewritten specifier.\n */\nasync function reconcileBatchSpecs(\n fs: FSInterface,\n cwd: string,\n section: \"devDependencies\" | \"dependencies\",\n specs: string[],\n): Promise<boolean> {\n const wanted: { name: string; declared: string }[] = [];\n for (const spec of specs) {\n // Same split as packageNameFromSpec: the LAST \"@\" separates the\n // (possibly scoped) name from the version part.\n const at = spec.lastIndexOf(\"@\");\n if (at <= 0) continue; // naked spec — no version contract\n const declared = spec.slice(at + 1);\n if (declared === \"\") continue;\n wanted.push({ name: packageNameFromSpec(spec), declared });\n }\n if (wanted.length === 0) return false;\n\n const pkgPath = join(cwd, \"package.json\");\n if (!(await fs.pathExists(pkgPath))) return false; // nothing to reconcile against\n const pkg = (await fs.readJson<Record<string, unknown>>(pkgPath)) ?? {};\n const entries = (pkg[section] ?? {}) as Record<string, unknown>;\n let changed = false;\n for (const { name, declared } of wanted) {\n if (entries[name] !== undefined && entries[name] !== declared) {\n entries[name] = declared;\n changed = true;\n }\n }\n if (!changed) return false;\n pkg[section] = entries;\n await fs.writeJson(pkgPath, pkg);\n return true;\n}\n\n/**\n * Lockfile-only refresh per agent, run after reconcile restored the\n * commanded specs in package.json: the lockfile still records the\n * REWRITTEN specifier the manager saved, and a manifest/lockfile\n * mismatch is a CI-breaking contract violation — `npm ci` and\n * `pnpm install --frozen-lockfile` both hard-fail on it\n * (ERR_PNPM_OUTDATED_LOCKFILE: \"better-sqlite3 (lockfile: ^12.11.1,\n * manifest: ^12.6.0)\" — live-proven 2026-10-11 on the audit reference\n * project). Executed directly, not via @antfu/ni: the flags are\n * lockfile-refresh-specific and agent-dependent. yarn classic and bun\n * save specs verbatim (no drift observed across the audit E2E\n * baseline), so reconcile is a read-and-skip there and this entry\n * stays a structural fallback — plain install is the correct refresh\n * should a future version start rewriting.\n */\nconst LOCKFILE_SYNC: Record<\n PackageManagerAgent,\n { binary: string; args: string[] }\n> = {\n npm: { binary: \"npm\", args: [\"install\", \"--package-lock-only\"] },\n pnpm: { binary: \"pnpm\", args: [\"install\", \"--lockfile-only\"] },\n \"yarn@berry\": { binary: \"yarn\", args: [\"install\", \"--mode=update-lockfile\"] },\n yarn: { binary: \"yarn\", args: [\"install\"] },\n bun: { binary: \"bun\", args: [\"install\"] },\n};\n\n/**\n * Builds the installer bound to a detected agent. The agent (not\n * `awareness.packageManager`) decides the approval mechanics, so the\n * generator never branches on the package manager.\n */\nexport function createDependencyInstaller(\n options: CreateInstallerOptions,\n): DependencyInstaller {\n const { agent, fs } = options;\n\n async function preApprove(\n plan: DependencyPlan,\n projectRoot: string,\n ): Promise<string[]> {\n // Union of both sections' requiresBuild names — approvals are recorded\n // once, before either install command runs.\n const names = [\n ...new Set(\n [...plan.devDependencies, ...plan.dependencies]\n .filter((d) => d.requiresBuild)\n .map((d) => packageNameFromSpec(d.spec)),\n ),\n ];\n if (names.length === 0) return [];\n\n switch (agent) {\n case \"pnpm\":\n await applyPnpmAllowBuilds(fs, projectRoot, names);\n return names;\n case \"npm\":\n await applyNpmAllowScripts(fs, projectRoot, names);\n return names;\n case \"yarn@berry\":\n await applyYarnBerryDependenciesMeta(fs, projectRoot, names);\n return names;\n default:\n // yarn classic: scripts run by default, nothing to pre-write.\n // bun: the default-trusted list covers DXG's plans; writing\n // trustedDependencies would REPLACE that list (bun semantics) —\n // never do that from a scaffolder.\n return [];\n }\n }\n\n async function install(\n plan: DependencyPlan,\n options: DependencyInstallOptions,\n ): Promise<DependencyInstallResult> {\n const { cwd, dryRun } = options;\n if (dryRun) {\n return {\n success: true,\n approvedBuilds: [],\n blockedBuilds: [],\n output: \"\",\n };\n }\n\n // One install command per non-empty section, in plan order — dev first\n // (mirrors the previous generator flow: tools before runtime deps).\n // approvalOnly entries are excluded: they exist to reach the approval\n // map, never to be installed by name (they arrive transitively).\n const installable = (deps: DependencyPlan[\"devDependencies\"]) =>\n deps.filter((d) => !d.approvalOnly);\n const devSpecs = installable(plan.devDependencies);\n const regularSpecs = installable(plan.dependencies);\n const batches: {\n args: string[];\n label: string;\n section: \"devDependencies\" | \"dependencies\";\n specs: string[];\n }[] = [];\n if (devSpecs.length > 0) {\n batches.push({\n args: [\"-D\", ...devSpecs.map((d) => d.spec)],\n label: \"dev dependencies\",\n section: \"devDependencies\",\n specs: devSpecs.map((d) => d.spec),\n });\n }\n if (regularSpecs.length > 0) {\n batches.push({\n args: regularSpecs.map((d) => d.spec),\n label: \"dependencies\",\n section: \"dependencies\",\n specs: regularSpecs.map((d) => d.spec),\n });\n }\n if (batches.length === 0) {\n return {\n success: true,\n approvedBuilds: [],\n blockedBuilds: [],\n output: \"\",\n };\n }\n\n // Approvals are written once, BEFORE the first install — pre-approval\n // (validated end-to-end in labs) beats post-hoc approve+rebuild flows.\n const approvedBuilds = await preApprove(plan, cwd);\n\n const outputs: string[] = [];\n // Deduplicated across batches: two install commands can both report the\n // same blocked package — the user-facing note should list it once.\n const blockedBuilds: string[] = [];\n\n for (const batch of batches) {\n const resolved = await getCliCommand(parseNi, batch.args, {\n cwd,\n programmatic: true,\n });\n if (!resolved) {\n return {\n success: false,\n reason: \"unknown\",\n output: outputs.join(\"\\n\"),\n hint: `Failed to resolve the ${agent} command for installing ${batch.label}.`,\n };\n }\n\n const { command, args, cwd: resolvedCwd } = resolved;\n let exitCode: number | undefined;\n let output: string;\n try {\n // Piped (buffered) capture: classification needs the blocked-script\n // notices that arrive even on success. stdout+stderr interleaved.\n // Use stdio: [\"ignore\", \"pipe\", \"pipe\"] to avoid stdin inheritance\n // issues on Windows when the parent process has stdin ignored.\n const result = await executeCommand(command, args, {\n cwd: resolvedCwd ?? cwd,\n all: true,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n output = String(result.all ?? result.stdout ?? \"\");\n } catch (error) {\n // execa throws on non-zero exit; the payload carries streams + code.\n const e = error as {\n message?: string;\n exitCode?: number;\n all?: string;\n stdout?: string;\n stderr?: string;\n };\n exitCode = e.exitCode;\n output = String(e.all ?? e.stdout ?? e.stderr ?? e.message ?? \"\");\n const classified = classifyInstallFailure(output, exitCode, agent);\n return {\n success: false,\n reason: classified.reason,\n output: [...outputs, output].join(\"\\n\"),\n exitCode,\n hint: classified.hint,\n suggestion: classified.suggestion,\n };\n }\n\n // Even a 0-exit install can have silently blocked builds — scan.\n const batchBlocked = scanBlockedBuilds(output, agent);\n for (const name of batchBlocked) {\n if (!blockedBuilds.includes(name)) {\n blockedBuilds.push(name);\n }\n }\n outputs.push(output);\n\n // The manifest a manager writes for an installed spec is not\n // guaranteed to BE the spec (npm rewrites entries with its\n // save-prefix; pnpm 12.5.1 bumps commanded ranges) — reconcile\n // the entries THIS batch installed before moving on, so a later\n // batch's failure still leaves the earlier contract intact.\n const reconciled = await reconcileBatchSpecs(\n fs,\n cwd,\n batch.section,\n batch.specs,\n );\n if (reconciled) {\n // The lockfile still records the manager's rewritten specifier:\n // refresh it so the manifest/lockfile pair is coherent again\n // (`npm ci` / `pnpm install --frozen-lockfile` contract). Same\n // per-batch rationale as the reconcile above. A failed refresh\n // is surfaced as a failure — a drifted lockfile must never be\n // left behind silently.\n const sync = LOCKFILE_SYNC[agent];\n try {\n const refreshed = await executeCommand(sync.binary, sync.args, {\n cwd,\n all: true,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n outputs.push(String(refreshed.all ?? \"\"));\n } catch (error) {\n const e = error as {\n message?: string;\n exitCode?: number;\n all?: string;\n stdout?: string;\n stderr?: string;\n };\n const syncOutput = String(\n e.all ?? e.stdout ?? e.stderr ?? e.message ?? \"\",\n );\n return {\n success: false,\n reason: \"lockfile-sync\",\n output: [...outputs, syncOutput].join(\"\\n\"),\n exitCode: e.exitCode,\n hint: `package.json now states the commanded specs again, but the lockfile refresh failed (${sync.binary} ${sync.args.join(\" \")}). Run it manually before committing, or the next frozen-lockfile install will fail on the mismatch.`,\n suggestion: `${sync.binary} ${sync.args.join(\" \")}`,\n };\n }\n }\n }\n\n return {\n success: true,\n approvedBuilds,\n blockedBuilds,\n output: outputs.join(\"\\n\"),\n };\n }\n\n return { agent, install };\n}\n\n/**\n * Detects the fine-grained agent for a project directory via @antfu/ni's\n * detect (same detector getCliCommand uses, so the approval mechanics can\n * never diverge from the command actually run). Returns null when no agent\n * is detectable — callers surface an explicit error rather than guessing.\n */\nexport async function detectPackageManagerAgent(\n cwd: string,\n): Promise<PackageManagerAgent | null> {\n const { detect } = await import(\"@antfu/ni\");\n const agent = await detect({ cwd, programmatic: true });\n return (agent as PackageManagerAgent | undefined) ?? null;\n}\n\n/**\n * Maps an install failure to a DXG-presentable hint. Kept separate from\n * the installer so the CLI layer (which owns DXGError) stays the only\n * place that formats errors.\n */\nexport function installerFailureHint(\n result: Extract<DependencyInstallResult, { success: false }>,\n): string {\n const lines: string[] = [];\n if (result.hint) lines.push(result.hint);\n if (result.suggestion) lines.push(`Try: ${result.suggestion}`);\n return lines.join(\"\\n\");\n}\n\n/** Convenience: project-root-relative paths of the approval files. */\nexport function approvalPaths(projectRoot: string): {\n workspaceYaml: string;\n packageJson: string;\n} {\n return {\n workspaceYaml: join(projectRoot, \"pnpm-workspace.yaml\"),\n packageJson: join(projectRoot, \"package.json\"),\n };\n}\n","/**\n * Build-approval policy: the per-manager mechanics for allowing EXACTLY the\n * packages a plan marked `requiresBuild` to run their install scripts.\n *\n * Security contract (non-negotiable):\n * - Approvals are per-package-name. NEVER a global \"allow everything\"\n * (no dangerouslyAllowAllBuilds / --dangerously-allow-all-scripts /\n * enableScripts:true / --ignore-scripts).\n * - Approvals are written BEFORE the install, additively — existing\n * entries are preserved, never removed or flipped to false.\n * - Nothing outside the plan's requiresBuild names is touched.\n *\n * Every mechanic below was validated empirically on this machine (pnpm\n * 11.18.0, npm 12.0.1, bun 1.3.14, yarn classic 1.22.22, yarn berry 4.1.1):\n * - pnpm 11: `allowBuilds` map in pnpm-workspace.yaml, name → true|false.\n * Pre-writing {pkg: true} BEFORE install = scripts run inline, exit 0.\n * (Lab e2e-pnpm: full database plan, zero ERR_PNPM_IGNORED_BUILDS.)\n * Keys starting with \"@\" MUST be single-quoted or pnpm's YAML parser\n * fails with \"bad indentation of a mapping entry\" (lab-observed).\n * - npm 12: `allowScripts` map in package.json. Name-only entries work\n * pre-written (lab npm-nameonly: script ran, binding created, no\n * warning) — the pkg@version pinning npm's CLI applies by default is\n * NOT required for pre-approval. NOTE (live-verified, npm 12): when\n * the map is ABSENT, npm silently blocks scripts with a warn line and\n * exit 0 — DXG pre-writes the map for exactly the plan's packages.\n * - yarn berry: `dependenciesMeta` {pkg: {built: true}} in package.json\n * is the documented allow-list path when enableScripts is false.\n * Verified live on yarn 4.1.1: it overrides enableScripts:false\n * PER PACKAGE (the plan's prisma/engines built while out-of-plan sharp\n * stayed YN0004-blocked), and enableScripts defaults to TRUE for fresh\n * projects — the map is written so the plan's builds survive either\n * default. Classic (v1): scripts run by default, nothing to write\n * (verified live: full sqlite plan, binding + engines binary on disk,\n * zero approval config written by DXG).\n * - bun: its default-trusted list covers the packages DXG's database plan\n * needs (lab bun-full: zero blocked). Writing `trustedDependencies`\n * would REPLACE the default list (bun semantics) — a hazard — so the\n * adapter writes nothing.\n */\n\nimport { join } from \"path\";\nimport type { FSInterface } from \"../types\";\n\n/**\n * Minimal YAML writer/patcher for the single map pnpm 11 needs. Not a\n * general YAML library: pnpm-workspace.yaml is user-owned, so edits are\n * byte-preserving text transforms on the `allowBuilds:` block only —\n * comments, ordering, and every other key survive untouched.\n *\n * Format matches what pnpm itself writes (observed in lab m2/e5):\n * allowBuilds:\n * better-sqlite3: true\n * '@prisma/engines': true\n */\nexport async function applyPnpmAllowBuilds(\n fs: FSInterface,\n projectRoot: string,\n packageNames: string[],\n): Promise<void> {\n if (packageNames.length === 0) return;\n const yamlPath = join(projectRoot, \"pnpm-workspace.yaml\");\n const existing = (await fs.pathExists(yamlPath))\n ? ((await fs.readFile(yamlPath, { encoding: \"utf8\" })) as string)\n : \"\";\n\n const updated = mergeAllowBuildsBlock(existing, packageNames);\n if (updated === existing) return; // Idempotent: nothing new to approve.\n\n await fs.writeFile(yamlPath, updated, \"utf8\");\n}\n\n/**\n * Pure transform (exported for tests): merges names into the allowBuilds\n * map, preserving the rest of the document byte-for-byte.\n */\nexport function mergeAllowBuildsBlock(\n yaml: string,\n packageNames: string[],\n): string {\n if (packageNames.length === 0) return yaml;\n\n const lines = yaml.split(\"\\n\");\n\n // Locate the top-level `allowBuilds:` key. The pattern accepts a trailing\n // inline comment on the key line — missing it would append a SECOND\n // `allowBuilds:` block at the document end, a duplicate mapping key pnpm\n // rejects. (Block style only: pnpm itself never writes the `{…}` flow\n // form.)\n const keyIdx = lines.findIndex((line) =>\n /^allowBuilds:\\s*(#.*)?$/.test(line.trim()),\n );\n\n if (keyIdx === -1) {\n // No allowBuilds block yet: append one. pnpm creates pnpm-workspace.yaml\n // itself when missing (empty file → just the new block).\n const block = [\n \"allowBuilds:\",\n ...packageNames.map((n) => ` ${yamlKey(n)}: true`),\n ].join(\"\\n\");\n if (yaml === \"\" || yaml.trim() === \"\") return `${block}\\n`;\n return `${yaml.replace(/\\n+$/, \"\")}\\n${block}\\n`;\n }\n\n // Collect the existing entry names in the block (indented lines directly\n // under allowBuilds:) and find the block's end — the first line that is\n // not an indented entry (another top-level key, a comment at column 0,\n // EOF, or a blank line, conservatively).\n const existingNames = new Set<string>();\n let end = keyIdx + 1;\n while (end < lines.length) {\n const line = lines[end];\n if (!/^\\s/.test(line)) break; // Exit block when line doesn't start with whitespace\n\n // Only process non-empty lines within the block\n if (line.trim() !== \"\") {\n const entry = line.match(/^\\s+([^\\s:][^:]*):\\s*(.*)$/);\n if (entry) existingNames.add(unquoteYamlKey(entry[1].trim()));\n }\n end += 1;\n }\n\n // Append only the missing approvals, right after the block's last line —\n // the block grows, everything else stays in place.\n const missing = packageNames.filter((n) => !existingNames.has(n));\n if (missing.length === 0) return yaml;\n\n lines.splice(end, 0, ...missing.map((n) => ` ${yamlKey(n)}: true`));\n return lines.join(\"\\n\");\n}\n\n/**\n * pnpm's YAML requires quoting for keys starting with \"@\" (lab-verified:\n * an unquoted `@prisma/engines:` key breaks parsing). Same rule pnpm\n * itself applies when it writes placeholders.\n */\nfunction yamlKey(name: string): string {\n return /^@/.test(name) ? `'${name}'` : name;\n}\n\nfunction unquoteYamlKey(key: string): string {\n return key.replace(/^['\"]|['\"]$/g, \"\");\n}\n\n/**\n * npm 12: pre-write `allowScripts` {name: true} into package.json.\n * Name-only entries. STRICTLY ADDITIVE — the same rule as the pnpm merge:\n * a name that already has an entry is never touched, so an explicit user\n * denial (`false`) stands. The install then blocks/skips that package's\n * scripts and the blocked-builds scan (or artifact verification) surfaces\n * it honestly — never a silent flip.\n */\nexport async function applyNpmAllowScripts(\n fs: FSInterface,\n projectRoot: string,\n packageNames: string[],\n): Promise<void> {\n if (packageNames.length === 0) return;\n const pkgPath = join(projectRoot, \"package.json\");\n const pkg = (await fs.readJson<Record<string, unknown>>(pkgPath)) ?? {};\n const allowScripts = (pkg.allowScripts ?? {}) as Record<string, boolean>;\n let changed = false;\n for (const name of packageNames) {\n if (allowScripts[name] === undefined) {\n allowScripts[name] = true;\n changed = true;\n }\n }\n if (!changed) return;\n pkg.allowScripts = allowScripts;\n await fs.writeJson(pkgPath, pkg);\n}\n\n/**\n * yarn berry: pre-write `dependenciesMeta` {name: {built: true}} into\n * package.json — the documented allow-list when enableScripts is false\n * (per-package override, live-verified on yarn 4.1.1: the plan's packages\n * built while out-of-plan sharp stayed YN0004-blocked). STRICTLY ADDITIVE\n * — same rule as pnpm/npm: `built` is set ONLY when the field is absent.\n * An explicit denial (`built: false`) stands; other meta fields on an\n * existing entry are always preserved. NEVER `onlyBuiltDependencies`\n * (pnpm-only name; and writing unknown keys into berry's .yarnrc.yml would\n * abort under enableStrictSettings).\n */\nexport async function applyYarnBerryDependenciesMeta(\n fs: FSInterface,\n projectRoot: string,\n packageNames: string[],\n): Promise<void> {\n if (packageNames.length === 0) return;\n const pkgPath = join(projectRoot, \"package.json\");\n const pkg = (await fs.readJson<Record<string, unknown>>(pkgPath)) ?? {};\n const meta = (pkg.dependenciesMeta ?? {}) as Record<\n string,\n Record<string, unknown>\n >;\n let changed = false;\n for (const name of packageNames) {\n const entry = (meta[name] ?? {}) as Record<string, unknown>;\n if (entry.built === undefined) {\n entry.built = true;\n meta[name] = entry;\n changed = true;\n }\n }\n if (!changed) return;\n pkg.dependenciesMeta = meta;\n await fs.writeJson(pkgPath, pkg);\n}\n","/**\n * Failure classification: maps raw package-manager output + exit code to a\n * normalized `DependencyInstallFailureReason`.\n *\n * Every signature below was captured empirically (lab runs against the\n * real pnpm 11.18.0 / npm 12.0.1 / bun 1.3.14 / yarn classic 1.22.22 /\n * yarn berry 4.1.1 on this machine). Matching is anchored on stable\n * machine markers (error CODES, manager-owned line prefixes), never on\n * full prose, so a reworded message cannot silently break detection.\n *\n * Critical asymmetry this module exists for:\n * - pnpm ≥11 BLOCKS LOUDLY: exit 1 + ERR_PNPM_IGNORED_BUILDS on stdout,\n * while the dependency tree IS installed (resolutions succeeded).\n * - npm 12 / bun / yarn-berry BLOCK SILENTLY: exit 0 + a warning line\n * (npm warn install-scripts / bun \"Blocked N postinstall\" / YN0004).\n * So both branches must classify: exit≠0 needs a reason, and exit==0 needs\n * a blocked-builds scan.\n */\n\nimport type {\n DependencyInstallFailureReason,\n PackageManagerAgent,\n} from \"./types\";\n\n/** Extracts the bare package name from an npm spec (\"a@^1\" → \"a\", \"@x/y@2\" → \"@x/y\"). */\nexport function packageNameFromSpec(spec: string): string {\n // Scoped: the LAST \"@\" separates scope/name from the version.\n const at = spec.lastIndexOf(\"@\");\n if (at > 0) return spec.slice(0, at);\n return spec;\n}\n\n/**\n * pnpm ≥11 hard-error signature (exit 1, printed on STDOUT while stderr is\n * empty). The dependency tree IS installed at this point — only the build\n * scripts were skipped, so this is \"build-script-blocked\", NOT an\n * installation failure. Format captured in lab e2r/e5:\n * [ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: @prisma/engines@7.10.0, prisma@7.10.0\n */\nexport function isPnpmIgnoredBuilds(output: string): boolean {\n return output.includes(\"ERR_PNPM_IGNORED_BUILDS\");\n}\n\n/**\n * Parses the pnpm ignored-builds package list. Deduplicated names, each\n * potentially versioned (\"@prisma/engines@7.10.0\").\n */\nexport function parsePnpmIgnoredBuilds(output: string): string[] {\n const match = output.match(/Ignored build scripts:\\s*(.+)$/m);\n if (!match) return [];\n return match[1]\n .split(\",\")\n .map((entry) =>\n packageNameFromSpec(entry.trim().replace(/^['\"]|['\"]$/g, \"\")),\n )\n .filter((name) => name.length > 0);\n}\n\n/**\n * npm ≥12 blocked-scripts notice (exit 0, STDERR). Captured in lab e6:\n * npm warn install-scripts 2 packages had install scripts blocked because they are not covered by allowScripts:\n * npm warn install-scripts prisma@7.10.0 (preinstall: node scripts/preinstall-entry.js)\n */\nexport function isNpmInstallScriptsWarning(output: string): boolean {\n return output.includes(\"npm warn install-scripts\");\n}\n\n/** Parses the npm blocked-scripts package names from the notice lines. */\nexport function parseNpmBlockedScripts(output: string): string[] {\n const names: string[] = [];\n for (const line of output.split(\"\\n\")) {\n // Continuation lines: \"npm warn install-scripts <pkg>@<ver> (<scripts>)\".\n // The package id itself cannot contain spaces; the \"(\", which begins\n // the script list, ends it.\n const match = line.match(\n /^\\s*npm warn install-scripts\\s+([^\\s(]+)\\s+\\(/,\n );\n if (match) {\n names.push(packageNameFromSpec(match[1]));\n }\n }\n return [...new Set(names)];\n}\n\n/**\n * bun blocked postinstall notice (exit 0, STDOUT — verified: the notice\n * rides the install summary stream, not stderr). Captured in lab e8-vfy:\n * Blocked 1 postinstall. Run `bun pm untrusted` for details.\n * `bun pm untrusted` itself proved UNRELIABLE for this (it reported 0\n * right after an install printed \"Blocked 1\") — never depend on it.\n */\nexport function isBunBlockedPostinstall(output: string): boolean {\n return /Blocked \\d+ postinstalls?\\b/.test(output);\n}\n\n/**\n * yarn berry disabled-build warning (exit 0): YN0004 — \"…lists build\n * scripts, but all build scripts have been disabled\". Verified locally\n * (yarn 4.1.1, lab adversarial): enableScripts:false blocks OUT-OF-PLAN\n * packages (sharp stayed YN0004-blocked) while dependenciesMeta built:true\n * entries keep the plan's own packages building.\n */\nexport function isYarnDisabledBuildScripts(output: string): boolean {\n return /YN0004/.test(output);\n}\n\n/** Registry 404 signatures (exit 1): pnpm ERR_PNPM_FETCH_404 (stdout), npm E404 (stderr), bun \"GET … - 404\" (stderr). */\nexport function isPackageNotFound(output: string): boolean {\n return (\n output.includes(\"ERR_PNPM_FETCH_404\") ||\n /\\bE404\\b/.test(output) ||\n /GET .* - 404/.test(output)\n );\n}\n\n/**\n * A dependency lifecycle script that RAN and failed. pnpm/npm propagate the\n * script's own exit code under ELIFECYCLE / \"Command failed with exit code\n * N\"; yarn berry reports \"couldn't be built successfully (exit code N)\".\n */\nexport function isNativeBuildFailed(output: string): boolean {\n return (\n output.includes(\"ELIFECYCLE\") ||\n /Command failed with exit code \\d+/.test(output) ||\n /couldn't be built successfully/.test(output)\n );\n}\n\n/**\n * Classifies a non-zero exit into a normalized failure reason.\n * Order matters: the most specific, recoverable signatures are tested\n * before the generic ones, so \"install ran, only the build approval is\n * missing\" never reads as a broken install.\n */\nexport function classifyInstallFailure(\n output: string,\n exitCode: number | undefined,\n agent: PackageManagerAgent,\n): {\n reason: DependencyInstallFailureReason;\n hint?: string;\n suggestion?: string;\n} {\n void exitCode; // Signatures are more reliable than codes (npm propagates script codes).\n void agent; // Signatures are shared where they overlap (ELIFECYCLE, 404).\n\n // pnpm blocked-builds is a POLICY outcome with a tree fully installed —\n // the cheapest, most actionable failure, so it wins over everything.\n if (isPnpmIgnoredBuilds(output)) {\n return {\n reason: \"build-script-blocked\",\n hint:\n \"pnpm installed the dependencies but skipped their build scripts (strictDepBuilds is on by default).\",\n suggestion:\n \"pnpm approve-builds # or set allowBuilds in pnpm-workspace.yaml\",\n };\n }\n if (isPackageNotFound(output)) {\n return {\n reason: \"installation-failed\",\n hint: \"The package manager could not find one of the requested packages in the registry.\",\n };\n }\n if (isNativeBuildFailed(output)) {\n return {\n reason: \"native-build-failed\",\n hint: \"A dependency's install script ran and failed — often a native build (missing compiler toolchain or no matching prebuild).\",\n };\n }\n return { reason: \"unknown\" };\n}\n\n/**\n * Scans a SUCCESS (exit 0) install output for silently-blocked build\n * scripts — the silent-drift hazard. npm warns on stderr, bun on stdout,\n * yarn berry emits YN0004; pnpm never reaches here silently (it hard-fails\n * instead).\n */\nexport function scanBlockedBuilds(\n output: string,\n agent: PackageManagerAgent,\n): string[] {\n switch (agent) {\n case \"npm\":\n return parseNpmBlockedScripts(output);\n case \"bun\":\n // bun's notice names no packages on the install stream — only a\n // count. Package-level naming is not available without `bun pm\n // untrusted`, which proved unreliable in the lab.\n return isBunBlockedPostinstall(output)\n ? [\"(bun: unnamed blocked postinstalls)\"]\n : [];\n case \"yarn@berry\":\n return isYarnDisabledBuildScripts(output)\n ? [\"(yarn: build scripts disabled via enableScripts)\"]\n : [];\n default:\n return [];\n }\n}\n","/**\n * dlx build-approval adapter: the command-line side of the same\n * per-package approval contract approvals.ts writes into project files.\n *\n * Two DIFFERENT install scopes exist for `dxg add database` under pnpm:\n *\n * 1. PROJECT install (`pnpm add`) — governed by the `allowBuilds` map\n * pnpm-workspace.yaml holds. The installer seam pre-writes it\n * (applyPnpmAllowBuilds) for exactly the plan's requiresBuild\n * packages. This scope is NOT where the interactive prompt came\n * from.\n *\n * 2. DLX CACHE install (`pnpm dlx prisma@7 ...`) — `prisma init` and\n * `prisma generate` resolve through dlx, so prisma AND its\n * transitive deps are installed into an isolated\n * `<pnpm-cache>/dlx/<cacheKey>/pkg` directory the project files\n * never mention. pnpm 11 pre-approves only the dlx alias itself\n * (verified in pnpm 11.18.0 source: `allowBuilds = fromEntries(...\n * resolvedPkgAliases)`); every TRANSITIVE package with a build\n * script lands in `ignoredBuilds`. On a TTY, `promptApproveDlxBuilds`\n * then runs the `approve-builds` handler — the multiselect\n * \"Choose which packages to build\" — INSIDE DXG's init spinner. On a\n * non-TTY the prompt is skipped silently: @prisma/engines' postinstall\n * (the schema-engine binary download) never runs and a cold-cache\n * machine is left without the binary that db:push/db:migrate (the\n * scripts DXG itself writes) require.\n *\n * `--allow-build=<name>` is pnpm dlx's OFFICIAL narrow approval channel\n * (dlx cliOptionsTypes: `{\"allow-build\": [String, Array]}`), validated\n * empirically: with the flag, the dlx cache's .modules.yaml records\n * `allowBuilds: {prisma: true, \"@prisma/engines\": true}` and\n * `ignoredBuilds: []` — the prompt's precondition (non-empty\n * ignoredBuilds) is gone, so it can never appear in EITHER mode, and the\n * postinstall DOES run (binary delivered).\n *\n * Scope discipline (same security contract as approvals.ts):\n * - ONLY pnpm: `pnpm dlx` is the only resolution with this approval\n * gate. npx runs scripts by default; yarn v1 maps dlx execution to\n * npx; yarn berry's dlx and `bun x` have no build-approval prompt\n * (bun's default-trusted list covers the plan). The `command ===\n * \"pnpm\"` check (not just `args[0] === \"dlx\"` — yarn berry also\n * resolves to `[\"dlx\", ...]`) is what keeps the flag pnpm-only.\n * - ONLY the names the plan itself marked approvalOnly — the packages\n * DXG intentionally installs (transitively) and whose build scripts\n * it needs. No global allow-all flag exists here, and nothing\n * outside the plan is approved.\n * - The flag changes the dlx cacheKey, so it must ride the SAME\n * resolution call as the command — never a separate one.\n */\n\nimport type { DependencyPlan } from \"./types\";\n\n/**\n * Inserts pnpm dlx build-approval flags into a RESOLVED command line.\n * Returns the args unchanged for every other command shape — npx, yarn\n * (classic and berry dlx), and bun x executions never receive a\n * pnpm-only flag.\n */\nexport function withDlxBuildApprovals(\n command: string,\n args: string[],\n plan: DependencyPlan,\n): string[] {\n // Only a real `pnpm dlx` invocation carries the approval gate. The\n // generator's \"dlx resolved as add\" guard rewrites mis-resolutions to\n // npx BEFORE this runs, so an \"add\" shape never reaches here with\n // command \"pnpm\" — but the check keeps the adapter total.\n if (command !== \"pnpm\" || args[0] !== \"dlx\") {\n return args;\n }\n\n // The dlx cache pre-approves the top-level alias (prisma) on its own;\n // only the TRANSITIVE build packages need the explicit flag. That is\n // exactly the plan's approvalOnly section — the same names whose\n // project-scope approvals applyPnpmAllowBuilds already writes.\n const names = [\n ...new Set(\n [...plan.devDependencies, ...plan.dependencies]\n .filter((d) => d.approvalOnly && d.requiresBuild)\n .map((d) => d.spec),\n ),\n ];\n if (names.length === 0) {\n return args;\n }\n\n // Flag position, verified empirically against pnpm 11.18.0: after\n // \"dlx\", before the package spec — the flag belongs to dlx's own\n // option parsing, so it must precede the spec it approves builds for.\n const flags = names.map((name) => `--allow-build=${name}`);\n return [\"dlx\", ...flags, ...args.slice(1)];\n}\n","// packages/generators/src/generators/database/prisma-flow.ts\n// This module contains ALL Prisma-specific logic extracted from index.ts\n// It exports a single setupPrismaFlow function that runs the complete Prisma setup\n\nimport type { GeneratorContext } from \"../../types\";\nimport { outro, isCancel, cancel, prompt, note } from \"@dxgjs/prompts\";\nimport pc from \"picocolors\";\nimport {\n resolvePackageManagerCommands,\n type PackageManagerAgent,\n} from \"@dxgjs/fs\";\n\n// Import from database-meta (single source of truth for Prisma version, providers, scripts, paths)\nimport {\n providerData,\n databaseScriptCatalog,\n recommendedScripts,\n validateDatabase,\n PRISMA_PACKAGE_VERSION,\n} from \"@dxgjs/database-meta\";\n\n// Import from local modules\nimport { detectPrismaState } from \"./detect-prisma-state\";\nimport { inspectDatabase } from \"./inspect\";\nimport {\n databasePrompts,\n DEFAULT_HELPER_PATH,\n normalizePrismaProvider,\n providersMatch,\n checkPreconditions,\n promptCustomScripts,\n planDatabase,\n executeDatabase,\n verifyDatabase,\n summarizeDatabase,\n} from \"./index\";\n\n// Import error types\nimport {\n PrismaVersionConflictError,\n ProviderUnsupportedError,\n ProviderMismatchError,\n ValidationError,\n} from \"@dxgjs/errors\";\n\n// Re-export all the public functions from index.ts for backward compatibility\nexport {\n planDatabase,\n executeDatabase,\n verifyDatabase,\n summarizeDatabase,\n databasePrompts,\n providerData,\n detectPrismaState,\n inspectDatabase,\n buildPrismaInitArgs,\n providerScripts,\n recommendedScripts,\n resolveDatabaseScripts,\n normalizePrismaProvider,\n providersMatch,\n PRISMA_PINNED_VERSION,\n PRISMA_CONFIG_PATH,\n SEED_SCRIPT_NAME,\n SEED_FILE_PATH,\n SEED_CONFIG_COMMAND,\n DEFAULT_GENERATOR_OUTPUT,\n DEFAULT_HELPER_PATH,\n checkPreconditions,\n promptCustomScripts,\n insertSeedIntoPrismaConfig,\n readSeedFromPrismaConfig,\n applySeedConfigToPrismaFile,\n writeSecureFile,\n computeDefaultGeneratorOutput,\n buildIndividualEnvLines,\n parseDatabaseUrl,\n} from \"./index\";\n\n/**\n * Runs the complete Prisma database setup flow.\n * This is the main entry point for Prisma ORM setup, called by databaseGenerator.run()\n * when orm === 'prisma'.\n */\nexport async function setupPrismaFlow(\n answers: Record<string, unknown>,\n ctx: GeneratorContext,\n): Promise<void> {\n // ============================================================\n // STEP 1: Validate provider BEFORE any prompts or side effects\n // ============================================================\n // Normalize provider (postgres -> postgresql) and validate it's supported\n const rawProvider = answers.provider as string | undefined;\n let normalizedProvider: string | undefined;\n if (rawProvider !== undefined) {\n normalizedProvider = normalizePrismaProvider(rawProvider);\n answers.provider = normalizedProvider;\n }\n\n // Check if provider is supported (fail fast with dedicated error code)\n const supportedProviders = Object.keys(providerData);\n if (\n normalizedProvider !== undefined &&\n !providerData[normalizedProvider as keyof typeof providerData]\n ) {\n throw new ProviderUnsupportedError(normalizedProvider, supportedProviders);\n }\n\n // ============================================================\n // STEP 2: Detect existing Prisma state (read-only)\n // ============================================================\n const prismaState = await detectPrismaState(ctx);\n\n // ============================================================\n // STEP 3: Compare providers (mismatch -> error, before prompts)\n // ============================================================\n if (\n prismaState.installed &&\n prismaState.provider &&\n normalizedProvider !== undefined &&\n !providersMatch(prismaState.provider, normalizedProvider)\n ) {\n throw new ProviderMismatchError(prismaState.provider, normalizedProvider);\n }\n\n // ============================================================\n // STEP 3: Inspect project state BEFORE prompts (for idempotence)\n // ============================================================\n // We need the provider to inspect correctly (provider-specific deps, env handling)\n const providerForInspection = (answers.provider as string) ?? \"postgresql\";\n const inspection = await inspectDatabase(ctx, providerForInspection);\n\n // ============================================================\n // GATE 1 (fail early, before ANY installation): `prisma init` exits 1\n // when any prisma/ folder exists — even an empty one (verified\n // empirically). A prisma/ directory without schema.prisma is therefore\n // unrecoverable for this generator: it must neither install (the user\n // decides the resolution) nor init (it would fail anyway).\n // ============================================================\n if (inspection.prismaDirEmpty) {\n throw new ValidationError(\n [\n \"The prisma/ directory exists but contains no schema.prisma.\",\n \"Prisma init refuses to run when a prisma/ folder already exists,\",\n \"so DXG cannot reconcile this state automatically.\",\n \"Either create prisma/schema.prisma yourself or remove the prisma/\",\n \"directory, then run dxg add database again.\",\n ].join(\"\\n\"),\n );\n }\n\n // ============================================================\n // GATE 2 (fail early, before ANY installation): an incompatible Prisma\n // declaration (6.x, 8.x, another 7.x, a prerelease range) is a user\n // decision DXG must not overturn silently — npm flips a declared\n // 6.20.0 to ^7.10.1 without any warning (verified empirically). The\n // user resolves the version conflict explicitly; nothing is touched.\n // ============================================================\n if (\n inspection.prismaVersion === \"incompatible\" ||\n inspection.clientVersion === \"incompatible\"\n ) {\n const declared = [\n inspection.prismaDeclaredSpec !== undefined\n ? `prisma: ${inspection.prismaDeclaredSpec}`\n : null,\n inspection.clientDeclaredSpec !== undefined\n ? `@prisma/client: ${inspection.clientDeclaredSpec}`\n : null,\n ]\n .filter(Boolean)\n .join(\", \");\n throw new PrismaVersionConflictError(\n [\n `Prisma version conflict: this project declares ${declared},`,\n `but DXG verifies against prisma@${PRISMA_PACKAGE_VERSION} (exact pin).`,\n \"DXG will not silently upgrade or downgrade an existing Prisma\",\n `declaration. Align the declared version to ${PRISMA_PACKAGE_VERSION} (or a range that`,\n `contains exactly it, e.g. ${PRISMA_PACKAGE_VERSION}) and run dxg add database again.`,\n ].join(\"\\n\"),\n );\n }\n\n // ============================================================\n // STEP 4: Now handle prompts (only if validation passed)\n // ============================================================\n // Intro already shown during ORM selection if interactive\n const needsProvider = answers.provider === undefined;\n const needsSkillsAnswer = answers.installPrismaSkills === undefined;\n // Check if scripts are already configured in package.json\n const packageJsonForScripts = await ctx.fs\n .readJson<\n Record<string, unknown> & { scripts?: Record<string, string> }\n >(\"package.json\")\n .catch(() => undefined);\n const existingScripts = packageJsonForScripts?.scripts ?? {};\n const recommendedScriptNames = recommendedScripts(providerForInspection);\n const hasAllRecommendedScripts = recommendedScriptNames.every(\n (name) => existingScripts[name] === databaseScriptCatalog[name].command,\n );\n const needsScriptsAnswer =\n answers.databaseScripts === undefined && !hasAllRecommendedScripts;\n\n // Only prompt in interactive mode (not dry-run and not CI)\n const shouldPrompt = !ctx.dryRun && !ctx.nonInteractive && !process.env.CI;\n\n // First: prompt for provider if needed (provider is now at index 1)\n if (shouldPrompt && needsProvider) {\n // Use existing Prisma provider as default if detected, otherwise postgresql\n const providerDefault = prismaState.provider ?? \"postgresql\";\n const providerPrompt = {\n ...databasePrompts[1], // provider prompt is at index 1 (index 0 is ORM)\n default: providerDefault,\n };\n const promptQuestions = [providerPrompt];\n let promptAnswers: Record<string, unknown>;\n try {\n promptAnswers = await prompt(\n promptQuestions as Parameters<typeof prompt>[0],\n );\n } catch (error) {\n if (isCancel(error)) {\n throw error;\n }\n throw error;\n }\n answers = { ...answers, ...promptAnswers };\n // Re-inspect with the now-known provider\n const newProvider = answers.provider as string;\n if (newProvider !== providerForInspection) {\n // Provider changed, re-inspect for accurate provider-specific checks\n Object.assign(inspection, await inspectDatabase(ctx, newProvider));\n }\n // Provider mismatch check for interactive mode: if project already has Prisma\n // with a different provider, error out immediately (same as CLI mode)\n if (\n prismaState.installed &&\n prismaState.provider &&\n !providersMatch(prismaState.provider, newProvider)\n ) {\n throw new ProviderMismatchError(prismaState.provider, newProvider);\n }\n } else if (needsProvider && !shouldPrompt) {\n // In non-interactive mode, throw error for missing required values\n throw new ValidationError(\n \"Missing required values in non-interactive mode: provider\",\n );\n }\n\n // After provider is known (either from CLI or prompt), check if databaseUrl is needed\n // databaseUrl prompt is needed for ALL providers when not provided AND no existing DATABASE_URL in .env\n const needsDatabaseUrl =\n answers.databaseUrl === undefined && !inspection.envHasDatabaseUrl;\n\n // Second: prompt for configureDatabaseUrl (for ALL providers, not just server)\n // This matches the test expectations: configureDatabaseUrl is always prompted separately\n if (shouldPrompt && needsDatabaseUrl) {\n const { providerPlaceholders } = await import(\"@dxgjs/database-meta\");\n const placeholder = providerPlaceholders[answers.provider as string] ?? \"\";\n const configureUrlPrompt = {\n type: \"confirm\" as const,\n name: \"configureDatabaseUrl\",\n message: \"Configure database connection URL now?\",\n default: false,\n };\n const configureAnswer = await prompt([configureUrlPrompt]);\n answers = { ...answers, ...configureAnswer };\n\n // Third: if user wants to configure URL, prompt for databaseUrl\n if (configureAnswer.configureDatabaseUrl) {\n const databaseUrlPrompt = { ...databasePrompts[2] }; // databaseUrl is at index 2\n databaseUrlPrompt.initialValue = placeholder;\n databaseUrlPrompt.default = placeholder;\n databaseUrlPrompt.message +=\n \" (format: see template — replace USER/PASSWORD/HOST/DATABASE)\";\n const databaseUrlAnswer = await prompt([databaseUrlPrompt]);\n answers = { ...answers, ...databaseUrlAnswer };\n }\n // If user says No, skip databaseUrl prompt — they'll set it in .env later\n }\n\n // Fourth: prompt for skills and databaseScripts (combined)\n if (shouldPrompt && (needsSkillsAnswer || needsScriptsAnswer)) {\n const promptQuestions = [];\n if (needsSkillsAnswer) {\n promptQuestions.push(databasePrompts[3]); // skills prompt at index 3\n }\n if (needsScriptsAnswer) {\n promptQuestions.push(databasePrompts[4]); // database scripts prompt at index 4\n }\n if (promptQuestions.length > 0) {\n let promptAnswers: Record<string, unknown>;\n try {\n promptAnswers = await prompt(\n promptQuestions as Parameters<typeof prompt>[0],\n );\n } catch (error) {\n if (isCancel(error)) {\n throw error;\n }\n throw error;\n }\n answers = { ...answers, ...promptAnswers };\n }\n }\n\n // Non-interactive / dry-run / CLI: provide default databaseUrl ONLY for SQLite\n // For server providers, leave undefined — user configures in .env later\n if (answers.databaseUrl === undefined && !inspection.envHasDatabaseUrl) {\n if (answers.provider === \"sqlite\") {\n const { providerPlaceholders } = await import(\"@dxgjs/database-meta\");\n answers.databaseUrl = providerPlaceholders.sqlite ?? \"file:./dev.db\";\n }\n // For server providers: no default, they'll set DATABASE_URL in .env manually\n }\n\n // Non-interactive / dry-run / CLI: provide default databaseUrl ONLY for SQLite\n // For server providers, leave undefined — user configures in .env later\n if (answers.databaseUrl === undefined && !inspection.envHasDatabaseUrl) {\n if (answers.provider === \"sqlite\") {\n const { providerPlaceholders } = await import(\"@dxgjs/database-meta\");\n answers.databaseUrl = providerPlaceholders.sqlite ?? \"file:./dev.db\";\n }\n // For server providers: no default, they'll set DATABASE_URL in .env manually\n }\n\n if (answers.installPrismaSkills === undefined) {\n // Non-interactive / dry-run / CLI-only default: do NOT install Prisma\n // agent skills. The conservative choice keeps the user's project free\n // of .claude/skills/, .windsurf/skills/, .agents/skills/ and\n // skills-lock.json unless explicitly requested (see buildPrismaInitArgs).\n answers.installPrismaSkills = false;\n }\n\n // Database scripts phase — interactive customize branch. The user chose\n // \"Customize\": show the provider-appropriate script catalogue (each\n // option carries its hint) with the recommended set preselected. Clack\n // primitives resolve with the cancel symbol; throw it so the existing\n // cancellation boundary (run's isCancel catch → the CLI's clean exit)\n // handles it. Asked AFTER database setup answers, BEFORE execution —\n // cancelling here leaves package.json completely untouched.\n if (answers.databaseScripts === \"customize\") {\n try {\n answers.databaseScripts = await promptCustomScripts(\n answers.provider as string,\n );\n } catch (error) {\n if (isCancel(error)) {\n throw error;\n }\n throw error;\n }\n }\n\n // Validate (interface compliance)\n if (!validateDatabase()) {\n // Use Clack cancel for validation failure\n cancel(\"Invalid responses for database generator\");\n throw new ValidationError(\"Invalid responses for database generator\");\n }\n\n try {\n // Validate preconditions (inside the try so precondition failures close\n // the Clack frame via the catch's outro, like execution failures do)\n await checkPreconditions(ctx);\n\n // Re-inspect with the final provider (after any prompts) for provider-dependent\n // logic: helper path resolution, planDatabase, etc.\n // Note: GATE 1 and GATE 2 already ran earlier with provider-independent checks.\n const inspection = await inspectDatabase(ctx, answers.provider as string);\n\n // GATE 3b: Provider installed but undetermined (unreadable schema).\n // Warn but continue — don't block, just inform.\n if (prismaState.installed && prismaState.provider === null) {\n note(\n [\n \"Existing Prisma provider not detected, verification impossible.\",\n \"DXG will continue by filling in what is missing.\",\n ].join(\"\\n\"),\n \"Warning\",\n );\n }\n\n // ============================================================\n // Helper path resolution: detect valid existing helpers BEFORE prompting\n // ============================================================\n // The inspection now returns only content-validated helpers in helperCandidates.\n // - 0 valid helpers -> show prompt with default\n // - 1 valid helper -> auto-reuse it, skip prompt\n // - Multiple valid helpers -> prompt for disambiguation\n const needsHelperPathNow = answers.helperPath === undefined;\n const validHelpers = inspection.helperCandidates ?? [];\n const validHelperCount = validHelpers.length;\n\n if (needsHelperPathNow && validHelperCount === 1) {\n // Exactly one valid helper found: auto-reuse it, no prompt\n answers.helperPath = validHelpers[0];\n } else if (shouldPrompt && needsHelperPathNow && validHelperCount > 1) {\n // Multiple valid helpers: prompt for disambiguation\n const helperPrompt = databasePrompts[5]; // helper path prompt (index 5, shifted by ORM)\n // Show all valid helpers as hint\n helperPrompt.message += ` (found ${validHelperCount} existing: ${validHelpers.join(\", \")})`;\n try {\n const helperAnswer = await prompt([helperPrompt] as Parameters<\n typeof prompt\n >[0]);\n answers = { ...answers, ...helperAnswer };\n } catch (error) {\n if (isCancel(error)) {\n throw error;\n }\n throw error;\n }\n } else if (needsHelperPathNow && !shouldPrompt && validHelperCount > 0) {\n // Non-interactive mode: auto-select first valid helper\n answers.helperPath = validHelpers[0];\n }\n // If no valid helpers found, show the normal prompt with default\n if (shouldPrompt && needsHelperPathNow && validHelperCount === 0) {\n const helperPrompt = databasePrompts[5]; // helper path prompt (index 5, shifted by ORM)\n try {\n const helperAnswer = await prompt([helperPrompt] as Parameters<\n typeof prompt\n >[0]);\n answers = { ...answers, ...helperAnswer };\n } catch (error) {\n if (isCancel(error)) {\n throw error;\n }\n throw error;\n }\n } else if (needsHelperPathNow && !shouldPrompt && validHelperCount === 0) {\n // Non-interactive mode with no valid helpers: use default\n answers.helperPath = DEFAULT_HELPER_PATH;\n }\n\n // Plan (state-aware: the inspection drives init/install gating and\n // the dynamic imports for the template files)\n const plan = planDatabase(answers, inspection);\n\n // Execute\n const execResult = await executeDatabase(answers, ctx, plan);\n\n // Verify (skip in dry-run mode)\n if (!ctx.dryRun) {\n await verifyDatabase(answers, ctx, plan);\n }\n\n // Summarize using Clack UX\n summarizeDatabase({\n ...execResult,\n detectedProvider: prismaState.provider,\n requestedProvider: answers.provider as string,\n });\n\n // Next steps — provider-specific, package-manager-aware guided next steps\n const { providerPlaceholders } = await import(\"@dxgjs/database-meta\");\n const placeholder = providerPlaceholders[answers.provider as string] ?? \"\";\n const isSqlite = answers.provider === \"sqlite\";\n const pm = ctx.awareness.packageManager;\n\n // Resolve package-manager-specific command prefixes using shared utility\n // Fall back to npm if package manager is unknown (e.g., in test environments without lock files)\n let cmds: { run: string; exec: string };\n try {\n cmds = resolvePackageManagerCommands(pm as PackageManagerAgent);\n } catch {\n cmds = { run: \"npm run\", exec: \"npx\" };\n }\n\n const lines: string[] = [\"\", pc.bold(\"Checklist:\"), \"\"];\n\n if (isSqlite) {\n lines.push(\n \"SQLite is ready — the dev.db file will be created on first migration.\",\n \"\",\n ` 1. Push schema to database:`,\n ` ${pc.cyan(`${cmds.run} db:push`)} ${pc.dim(`# or: ${cmds.exec} prisma db push`)}`,\n \"\",\n ` 2. Generate Prisma Client:`,\n ` ${pc.cyan(`${cmds.run} db:generate`)} ${pc.dim(`# or: ${cmds.exec} prisma generate --no-hints`)}`,\n \"\",\n ` 3. Open Prisma Studio:`,\n ` ${pc.cyan(`${cmds.run} db:studio`)} ${pc.dim(`# or: ${cmds.exec} prisma studio`)}`,\n );\n } else {\n // Provider-specific configuration steps\n if (answers.provider === \"mysql\") {\n // MySQL uses individual params pattern: writes DATABASE_URL + individual vars\n lines.push(\n \" 1. Configure your connection\",\n ` ${pc.cyan(\".env\")} was updated with individual parameters:`,\n ` ${pc.cyan(`DATABASE_HOST=\"...\"`)}`,\n ` ${pc.cyan(`DATABASE_USER=\"...\"`)}`,\n ` ${pc.cyan(`DATABASE_PASSWORD=\"...\"`)}`,\n ` ${pc.cyan(`DATABASE_NAME=\"...\"`)}`,\n ` ${pc.cyan(`DATABASE_PORT=\"3306\"`)}`,\n ` ${pc.cyan(`DATABASE_URL=\"mysql://user:pass@host:3306/db\"`)} (also set for Prisma CLI)`,\n \"\",\n \" 2. Push schema to database:\",\n ` ${pc.cyan(`${cmds.run} db:push`)} ${pc.dim(`# or: ${cmds.exec} prisma db push`)}`,\n \"\",\n \" 3. Generate Prisma Client:\",\n ` ${pc.cyan(`${cmds.run} db:generate`)} ${pc.dim(`# or: ${cmds.exec} prisma generate --no-hints`)}`,\n \"\",\n \" 4. Open Prisma Studio:\",\n ` ${pc.cyan(`${cmds.run} db:studio`)} ${pc.dim(`# or: ${cmds.exec} prisma studio`)}`,\n );\n } else if (answers.provider === \"sqlserver\") {\n // SQL Server uses individual params pattern: writes DATABASE_URL + individual vars\n lines.push(\n \" 1. Configure your connection\",\n ` ${pc.cyan(\".env\")} was updated with individual parameters:`,\n ` ${pc.cyan(`HOST=\"...\"`)}`,\n ` ${pc.cyan(`DB_USER=\"...\"`)}`,\n ` ${pc.cyan(`DB_PASSWORD=\"...\"`)}`,\n ` ${pc.cyan(`DB_NAME=\"...\"`)}`,\n ` ${pc.cyan(`DATABASE_URL=\"sqlserver://host:1433;database=db;user=user;password=pass;encrypt=true\"`)} (also set for Prisma CLI)`,\n \"\",\n \" 2. Push schema to database:\",\n ` ${pc.cyan(`${cmds.run} db:push`)} ${pc.dim(`# or: ${cmds.exec} prisma db push`)}`,\n \"\",\n \" 3. Generate Prisma Client:\",\n ` ${pc.cyan(`${cmds.run} db:generate`)} ${pc.dim(`# or: ${cmds.exec} prisma generate --no-hints`)}`,\n \"\",\n \" 4. Open Prisma Studio:\",\n ` ${pc.cyan(`${cmds.run} db:studio`)} ${pc.dim(`# or: ${cmds.exec} prisma studio`)}`,\n );\n } else {\n // Other server providers (postgresql, planetscale, cockroachdb, prismapostgres)\n // use DATABASE_URL only\n lines.push(\n \" 1. Configure your connection string\",\n ` Edit ${pc.cyan(\".env\")} and replace the placeholder:`,\n ` ${pc.cyan(`DATABASE_URL=\"${placeholder}\"`)}`,\n \"\",\n \" 2. Push schema to database:\",\n ` ${pc.cyan(`${cmds.run} db:push`)} ${pc.dim(`# or: ${cmds.exec} prisma db push`)}`,\n \"\",\n \" 3. Generate Prisma Client:\",\n ` ${pc.cyan(`${cmds.run} db:generate`)} ${pc.dim(`# or: ${cmds.exec} prisma generate --no-hints`)}`,\n \"\",\n \" 4. Open Prisma Studio:\",\n ` ${pc.cyan(`${cmds.run} db:studio`)} ${pc.dim(`# or: ${cmds.exec} prisma studio`)}`,\n );\n }\n\n // Provider-specific tips\n if (answers.provider === \"postgresql\") {\n lines.push(\n \"\",\n pc.dim(\n \"Tip: For Neon/Supabase: use pooled URL (port 6543) for runtime via DATABASE_URL, direct URL (port 5432) for CLI via DIRECT_URL\",\n ),\n );\n } else if (answers.provider === \"planetscale\") {\n lines.push(\n \"\",\n pc.dim(\n 'Warning: PlanetScale requires `relationMode = \"prisma\"` in schema.prisma (MySQL protocol).',\n ),\n pc.dim(\n \" Schema changes use PlanetScale's deploy request workflow, not prisma migrate.\",\n ),\n );\n } else if (answers.provider === \"prismapostgres\") {\n lines.push(\n \"\",\n pc.dim(\n \"Tip: Prisma Postgres uses pooled connection: pooled.db.prisma.io (PgBouncer).\",\n ),\n pc.dim(\" Migrations use direct host: db.prisma.io.\"),\n );\n } else if (answers.provider === \"cockroachdb\") {\n lines.push(\n \"\",\n pc.dim(\"Tip: CockroachDB uses port 26257 with sslmode=require.\"),\n );\n } else if (answers.provider === \"mysql\") {\n lines.push(\n \"\",\n pc.dim(\n \"Tip: For SSL: add ?sslcert=./cert.pem&sslaccept=strict to the URL.\",\n ),\n );\n } else if (answers.provider === \"sqlserver\") {\n lines.push(\n \"\",\n pc.dim(\n \"Tip: SQL Server uses semicolon syntax: sqlserver://host:1433;database=db;user=user;password=pass;encrypt=true\",\n ),\n );\n }\n }\n\n lines.push(\n \"\",\n pc.dim(\n `Docs: https://www.prisma.io/docs/orm/v7/core-concepts/supported-databases/${answers.provider}`,\n ),\n );\n\n // Render Next steps in a separate note box\n note(lines.join(\"\\n\"), \"Next Steps\");\n\n // Outro — completion message only (green for success)\n outro(pc.green(`Database setup completed for ${answers.provider}!`));\n } catch (error) {\n // Handle cancellation - propagate to CLI for consistent rendering\n if (isCancel(error)) {\n throw error;\n }\n\n // Handle other errors — the CLI's error formatter prints the message;\n // the outro marks the Clack boundary without duplicating it (red for error).\n outro(pc.red(`Failed to setup database for ${answers.provider}`));\n throw error;\n }\n}\n\n// Type for the plan returned by planDatabase\nexport type PlanDatabaseResult = ReturnType<\n typeof import(\"./index\").planDatabase\n>;\n","/**\n * READ-ONLY Prisma provider detection.\n *\n * Extracts the provider from an existing Prisma schema (prisma/schema.prisma)\n * or Prisma 7 config (prisma7.config.ts). Never writes, never mutates.\n * Used by the database generator to detect provider mismatches before planning.\n */\n\nimport type { GeneratorContext } from \"../../types\";\n\n// Shared database meta (provider detection pure functions)\nimport {\n extractProviderFromSchema,\n extractProviderFromConfig,\n type PrismaState,\n} from \"@dxgjs/database-meta\";\n\n/**\n * Detects the existing Prisma state in the project.\n * Reads schema.prisma first, falls back to prisma7.config.ts.\n * Returns { installed: false, provider: null, schemaPath: null } if neither exists.\n */\nexport async function detectPrismaState(\n ctx: Pick<GeneratorContext, \"fs\">,\n): Promise<PrismaState> {\n const fs = ctx.fs;\n\n // Check schema.prisma first\n const schemaPath = \"prisma/schema.prisma\";\n const schemaExists = await fs.pathExists(schemaPath);\n\n if (schemaExists) {\n try {\n const schemaText = (await fs.readFile(schemaPath, {\n encoding: \"utf8\",\n })) as string | undefined;\n if (typeof schemaText === \"string\" && schemaText.trim() !== \"\") {\n const provider = extractProviderFromSchema(schemaText);\n return {\n installed: true,\n provider,\n schemaPath,\n };\n }\n } catch {\n // Read failed — fall through to config check\n }\n }\n\n // Fall back to prisma7.config.ts\n const configPath = \"prisma7.config.ts\";\n const configExists = await fs.pathExists(configPath);\n\n if (configExists) {\n try {\n const configText = (await fs.readFile(configPath, {\n encoding: \"utf8\",\n })) as string | undefined;\n if (typeof configText === \"string\" && configText.trim() !== \"\") {\n const provider = extractProviderFromConfig(configText);\n return {\n installed: true,\n provider,\n schemaPath: configPath,\n };\n }\n } catch {\n // Read failed\n }\n }\n\n return {\n installed: false,\n provider: null,\n schemaPath: null,\n };\n}","/**\n * READ-ONLY project inspection for the database generator.\n *\n * Everything in this module answers ONE question: \"what does the project\n * already have, so the generator can reconcile instead of blindly\n * reinstalling/reinitializing?\". It never installs packages, never executes\n * Prisma, never writes a single file — the inspection result feeds\n * planDatabase and the execution gates in executeDatabase.\n *\n * Domain-local on purpose (the decision document forbids a generic\n * detection/state framework): Prisma knowledge stays in the database domain,\n * package-manager knowledge is a single agent-aware installed-probe.\n */\n\nimport type { GeneratorContext } from \"../../types\";\nimport type { PackageManagerAgent } from \"../../install/types\";\n\n// Shared database meta (single source of truth for Prisma version, providers, scripts, paths)\nimport {\n providerData,\n DEFAULT_GENERATOR_OUTPUT,\n DEFAULT_HELPER_PATH,\n PRISMA_CONFIG_PATH as CONFIG_PATH,\n SCHEMA_PATH,\n ENV_PATH,\n classifyPrismaVersion,\n declaredVersion,\n specName,\n schemaHasLegacyDatasource,\n parseGeneratorOutput,\n resolveGeneratorOutput,\n isValidPrismaClientHelper,\n type DatabaseInspection,\n} from \"@dxgjs/database-meta\";\n\n// Re-export database-meta functions for backward compatibility with tests and consumers\nexport {\n PRISMA_PINNED_VERSION,\n DEFAULT_GENERATOR_OUTPUT,\n DEFAULT_HELPER_PATH,\n parseVersion,\n classifyPrismaVersion,\n parseGeneratorOutput,\n resolveGeneratorOutput,\n computeRelativeImport,\n computeFileImport,\n normalizeHelperPath,\n validateHelperPath,\n schemaHasLegacyDatasource,\n type DatabaseInspection,\n type PrismaVersionClass,\n} from \"@dxgjs/database-meta\";\n\n/**\n * Installed-state probe, agent-aware (decision document, section 4).\n *\n * - npm / pnpm / yarn classic / bun: node_modules/<name>/package.json\n * (pnpm's symlink is followed by pathExists).\n * - yarn@berry: node_modules first (covers nodeLinker: node-modules, which\n * behaves like npm — verified empirically), then an ANCHORED yarn.lock\n * lookup (PnP mode has no node_modules at all; the lockfile entry looks\n * like `\"prisma@npm:7\"`).\n *\n * The lockfile match is anchored on the quote so `prisma` can never match\n * `@prisma/client` (the latter's entry starts with `\"@prisma/client@`).\n */\nexport async function isPackageInstalled(\n fs: GeneratorContext[\"fs\"],\n agent: PackageManagerAgent | undefined,\n name: string,\n): Promise<boolean> {\n if (await fs.pathExists(`node_modules/${name}/package.json`)) {\n return true;\n }\n if (agent !== \"yarn@berry\") return false;\n // Absent lockfile → not installed. Guarded explicitly: the REAL @dxgjs/fs\n // readFile rejects with ENOENT on a missing file (found by real E2E — the\n // in-memory test mock resolves undefined and masked this), and a yarn@berry\n // project may legitimately have no yarn.lock yet (fresh, never installed).\n if (!(await fs.pathExists(\"yarn.lock\"))) return false;\n let lockfile: unknown;\n try {\n lockfile = await fs.readFile(\"yarn.lock\", { encoding: \"utf8\" });\n } catch {\n return false; // unreadable lockfile (locked, perms) — not \"installed\"\n }\n if (typeof lockfile !== \"string\") return false;\n // Anchored: entry key must start exactly with \"name@ — no substring match\n // across a longer package name (@prisma/client would not match prisma).\n const anchor = `\"${name}@`;\n for (const line of lockfile.split(\"\\n\")) {\n if (line.trimStart().startsWith(anchor)) return true;\n }\n return false;\n}\n\n// ---------------------------------------------------------------------------\n// The inspection itself\n// ---------------------------------------------------------------------------\n\n/**\n * Inspects the project. All reads go through ctx.fs so tests drive the same\n * seam as production, and nothing here mutates state.\n */\nexport async function inspectDatabase(\n ctx: Pick<GeneratorContext, \"fs\"> & {\n installer?: { agent: PackageManagerAgent };\n },\n providerKey: string,\n): Promise<DatabaseInspection> {\n const fs = ctx.fs;\n\n const schemaExists = await fs.pathExists(SCHEMA_PATH);\n const configExists = await fs.pathExists(CONFIG_PATH);\n const prismaDirExists = await fs.pathExists(\"prisma\");\n\n // prisma/ exists but there is no schema to generate from AND init cannot\n // run (it refuses any existing prisma/ folder — verified empirically).\n let prismaDirEmpty = false;\n if (prismaDirExists && !schemaExists) {\n const entries = (await fs\n .readdir(\"prisma\")\n .catch(() => [] as string[])) as string[];\n prismaDirEmpty = !entries.some((e) => e === \"schema.prisma\");\n }\n\n let schemaHasGenerator = false;\n let generatorOutput = DEFAULT_GENERATOR_OUTPUT;\n let generatorOutputEscapesRoot = false;\n let datasourceLegacyForm = false;\n if (schemaExists) {\n const schemaText = (await fs.readFile(SCHEMA_PATH, {\n encoding: \"utf8\",\n })) as string | undefined;\n if (typeof schemaText === \"string\" && schemaText.trim() !== \"\") {\n const gen = parseGeneratorOutput(schemaText);\n schemaHasGenerator = gen.present;\n if (gen.present && gen.output !== undefined) {\n const resolved = resolveGeneratorOutput(gen.output);\n if (resolved === undefined) {\n generatorOutputEscapesRoot = true;\n } else {\n generatorOutput = resolved;\n }\n }\n datasourceLegacyForm = schemaHasLegacyDatasource(schemaText);\n }\n }\n\n // package.json read fresh (never the pre-run awareness snapshot).\n const packageJson = await fs.readJson<\n | (Record<string, unknown> & {\n devDependencies?: Record<string, string>;\n dependencies?: Record<string, string>;\n })\n | undefined\n >(\"package.json\");\n\n const prismaDeclaredSpec = declaredVersion(packageJson, \"prisma\");\n const clientDeclaredSpec = declaredVersion(packageJson, \"@prisma/client\");\n const prismaVersion = classifyPrismaVersion(prismaDeclaredSpec);\n const clientVersion = classifyPrismaVersion(clientDeclaredSpec);\n\n // Provider non-Prisma dependencies: name-only declared check (adapters,\n // drivers, dotenv). Version pinning stays provider data's job.\n const provider = providerData[providerKey as keyof typeof providerData];\n const providerDeps: string[] = provider\n ? [...provider.dependencies, ...provider.devDependencies]\n .map((spec) => specName(spec))\n .filter((name) => name !== \"prisma\" && name !== \"@prisma/client\")\n : [];\n const providerDependenciesMissing: string[] = [];\n for (const name of providerDeps) {\n if (declaredVersion(packageJson, name) === undefined) {\n providerDependenciesMissing.push(name);\n }\n }\n\n // Seed runner declared check (name-only, same rule as the provider deps):\n // planDatabase pushes tsx into the dev batch only when db:seed is\n // selected AND the project does not declare it — this field is the\n // rerun-side idempotence gate for that push.\n const seedRunnerDeclared = declaredVersion(packageJson, \"tsx\") !== undefined;\n\n const agent = ctx.installer?.agent;\n const prismaInstalled = await isPackageInstalled(fs, agent, \"prisma\");\n const clientInstalled = await isPackageInstalled(fs, agent, \"@prisma/client\");\n\n const envExists = await fs.pathExists(ENV_PATH);\n let envHasDatabaseUrl = false;\n if (envExists) {\n const envText = (await fs.readFile(ENV_PATH, { encoding: \"utf8\" })) as\n | string\n | undefined;\n envHasDatabaseUrl =\n typeof envText === \"string\" &&\n /^\\s*(?:export\\s+)?DATABASE_URL\\s*=/m.test(envText);\n }\n\n // Helper candidates: paths a previous DXG run may have created. Discovery\n // now includes CONTENT VALIDATION (requirement: inspect Prisma Client\n // imports/initialization patterns, not just file existence).\n const helperCandidates: string[] = [];\n // Plausible locations where DXG may have created the helper\n const plausibleHelperPaths = [\n DEFAULT_HELPER_PATH,\n \"src/lib/prisma.ts\",\n \"lib2/prisma.ts\",\n ];\n for (const candidate of plausibleHelperPaths) {\n if (await fs.pathExists(candidate)) {\n const content = (await fs.readFile(candidate, { encoding: \"utf8\" })) as string | undefined;\n if (content && isValidPrismaClientHelper(content)) {\n helperCandidates.push(candidate);\n }\n }\n }\n\n return {\n schemaExists,\n configExists,\n prismaDirExists,\n prismaDirEmpty,\n schemaHasGenerator,\n generatorOutput,\n generatorOutputEscapesRoot,\n datasourceLegacyForm,\n prismaVersion,\n prismaDeclaredSpec,\n clientVersion,\n clientDeclaredSpec,\n providerDependenciesMissing,\n seedRunnerDeclared,\n prismaInstalled,\n clientInstalled,\n envExists,\n envHasDatabaseUrl,\n helperCandidates,\n defaultHelperPath: DEFAULT_HELPER_PATH,\n };\n}\n","import type { GeneratorContext } from \"../../types\";\nimport { ValidationError } from \"@dxgjs/errors\";\n\n/**\n * Placeholder flow for Drizzle ORM. Drizzle support is not implemented yet, so\n * selecting it fails with an actionable error (the CLI exits with a non-zero\n * code) instead of reporting success after doing nothing. This module will be\n * replaced with real Drizzle setup logic when Drizzle support is implemented.\n */\nexport async function setupDrizzleFlow(\n _answers: Record<string, unknown>,\n _ctx: GeneratorContext,\n): Promise<void> {\n void _answers;\n void _ctx;\n\n throw new ValidationError(\"Drizzle ORM is not supported yet.\", {\n hints: [\n \"Drizzle support is coming soon\",\n \"Use Prisma instead (the default): omit --orm or pass --orm prisma\",\n ],\n });\n}\n","// Import the database generator\nimport databaseGenerator from './generators/database';\n// Import the Generator type\nimport type { Generator, GeneratorContext } from './types';\n\n// Dependency-installation engine (internal module, re-exported for the CLI\n// which builds the installer seam in prepareContext)\nexport * from './install';\n\nexport { databaseGenerator, Generator, GeneratorContext };\n\n// Default export for convenience (database generator is the only one)\nexport default databaseGenerator;"],"mappings":";;;;;;;;;;;AAAA,SAAS,qBAAqB;AAA9B,IAEI,UACAA,YACA,kBACAC,oBACA,cACA,cACA,eACA,aASA,aAUA,YACA,SAIA;AAjCJ;AAAA;AAAA;AAEA,IAAI,WAAW,OAAO;AACtB,IAAID,aAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAIC,qBAA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AAG;AAAA,EACpC;AACF;AAGA,IAAO,mBAAQ;;;ASv7Df,IAAO,gBAAQ;","names":["__defProp","__getOwnPropNames","process","path2","cwd","version","cwd","path","resolveCommand","resolve","fs","path","dirname","resolve","url","cwd","version","command","args","remove","run","open","x","prompt","delimiter","readline","cursor","sep","override","question","answer","posix","isWindows","init_dist","init_dist","isCancel","note","prompt","dirname","join","executeCommand","pc","init_dist","join","join","fs","fs","cwd","join","options","detect","ProviderUnsupportedError","ValidationError","providerData","fs","DEFAULT_GENERATOR_OUTPUT","DEFAULT_HELPER_PATH","classifyPrismaVersion","parseGeneratorOutput","resolveGeneratorOutput","schemaHasLegacyDatasource","fs","providerData","inspection","DEFAULT_HELPER_PATH","ValidationError","providerData","databaseScriptCatalog","SEED_SCRIPT_NAME","SEED_FILE_PATH","SEED_CONFIG_COMMAND","PRISMA_CONFIG_PATH","PRISMA_PINNED_VERSION","DEFAULT_GENERATOR_OUTPUT","DEFAULT_HELPER_PATH","buildPrismaInitArgs","providerScripts","recommendedScripts","resolveDatabaseScripts","computeRelativeImport","computeFileImport","normalizeHelperPath","validateHelperPath","providersMatch","specName","dirname","join","ValidationError","ProviderUnsupportedError","isCancel","fs","providerObj","note","result","executeCommand","path","pc","prompt"]}