@prisma/composer 0.39.0-dev.1 → 0.39.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-config-UeKFBma7-CohaMmWp.d.mts → app-config-DriAu5RU-C8hYpR38.d.mts} +88 -83
- package/dist/app-config-DriAu5RU-C8hYpR38.d.mts.map +1 -0
- package/dist/{app-configuration-file-CeJvBAti-D3uDlheX.mjs → app-configuration-file-D0rB5g65-CdMrjkCc.mjs} +50 -85
- package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs.map +1 -0
- package/dist/app-converge-bS1l9jIf-DRGbjw2D.mjs +88 -0
- package/dist/app-converge-bS1l9jIf-DRGbjw2D.mjs.map +1 -0
- package/dist/arktype.d.mts +7 -5
- package/dist/arktype.d.mts.map +1 -1
- package/dist/arktype.mjs +7 -5
- package/dist/arktype.mjs.map +1 -1
- package/dist/config-Bpi8QVLB.d.mts +1 -0
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +2 -2
- package/dist/control.d.mts +19 -21
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +4 -4
- package/dist/control.mjs.map +1 -1
- package/dist/converge-in-process-CTomEXaD-BnDylZP8.d.mts +67 -0
- package/dist/converge-in-process-CTomEXaD-BnDylZP8.d.mts.map +1 -0
- package/dist/converge-in-process-x89zb2MF-Dvj-J8xo.mjs +258 -0
- package/dist/converge-in-process-x89zb2MF-Dvj-J8xo.mjs.map +1 -0
- package/dist/{deploy-3EXLVrtG.mjs → deploy-CSU0kr4j.mjs} +130 -38
- package/dist/deploy-CSU0kr4j.mjs.map +1 -0
- package/dist/deploy-DHgEJDpg.d.mts +32 -0
- package/dist/deploy-DHgEJDpg.d.mts.map +1 -0
- package/dist/deploy.d.mts +4 -4
- package/dist/deploy.mjs +3 -3
- package/dist/{deployment-summary-p88NV5m5-SgniM8TX.d.mts → deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts} +7 -4
- package/dist/deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts.map +1 -0
- package/dist/{deployment-summary-D74WrJX7-DQ3LDUuO.mjs → deployment-summary-CVJZn2v0-Dz-gX1rp.mjs} +16 -44
- package/dist/deployment-summary-CVJZn2v0-Dz-gX1rp.mjs.map +1 -0
- package/dist/{describe-kind-Cpm_euxo-CkhlGJUL.mjs → describe-kind-Cpm_euxo-DsSPENQa.mjs} +4 -4
- package/dist/describe-kind-Cpm_euxo-DsSPENQa.mjs.map +1 -0
- package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs +165 -0
- package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs.map +1 -0
- package/dist/dev-converge-worker.d.mts +1 -0
- package/dist/dev-converge-worker.mjs +142 -0
- package/dist/dev-converge-worker.mjs.map +1 -0
- package/dist/{dev-current-wD5YDLjA-CzyFYXni.mjs → dev-current-lAlj53eX-DrtBnAmA.mjs} +11 -7
- package/dist/dev-current-lAlj53eX-DrtBnAmA.mjs.map +1 -0
- package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs → dev-environment-name-6eEr5PW8-7ntm9Xhs.mjs} +3 -3
- package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs.map → dev-environment-name-6eEr5PW8-7ntm9Xhs.mjs.map} +1 -1
- package/dist/{dist-ynqBR6y8.mjs → dist-Cf_mZHaH.mjs} +4 -26
- package/dist/dist-Cf_mZHaH.mjs.map +1 -0
- package/dist/{emulator-retry-CV8rl69G-BgUzkxc-.mjs → emulator-retry-CV8rl69G-scQ105wk.mjs} +2 -2
- package/dist/{emulator-retry-CV8rl69G-BgUzkxc-.mjs.map → emulator-retry-CV8rl69G-scQ105wk.mjs.map} +1 -1
- package/dist/{errors-0e8IVwzi.mjs → errors-DI3TBXE-.mjs} +7 -2
- package/dist/{errors-0e8IVwzi.mjs.map → errors-DI3TBXE-.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs → execute-deploy-destroy-DN16ETAk-BaopEKsA.mjs} +376 -86
- package/dist/execute-deploy-destroy-DN16ETAk-BaopEKsA.mjs.map +1 -0
- package/dist/{execute-dev-BIyOI3Ys-BbDOLlV4.mjs → execute-dev-DnVmNpc1-kSyPML7l.mjs} +455 -221
- package/dist/execute-dev-DnVmNpc1-kSyPML7l.mjs.map +1 -0
- package/dist/{execute-dev-current-CKOzjWuO-BPecs6Lf.mjs → execute-dev-current-CZdmxVQ4-Bij2LeBY.mjs} +7 -7
- package/dist/{execute-dev-current-CKOzjWuO-BPecs6Lf.mjs.map → execute-dev-current-CZdmxVQ4-Bij2LeBY.mjs.map} +1 -1
- package/dist/{execute-log-BDdHor71-B2p8Zae2.mjs → execute-log-Bl-j6izb-BTAo6tRM.mjs} +8 -8
- package/dist/{execute-log-BDdHor71-B2p8Zae2.mjs.map → execute-log-Bl-j6izb-BTAo6tRM.mjs.map} +1 -1
- package/dist/{graph-C7mdtisq-RnKiwVsx.d.mts → graph-CUYXjK8S-BzL-mhjq.d.mts} +3 -3
- package/dist/graph-CUYXjK8S-BzL-mhjq.d.mts.map +1 -0
- package/dist/{graph-BzPLUUsB-D7EnB1F5.mjs → graph-D2WMLL43-CeiC5wdy.mjs} +150 -107
- package/dist/graph-D2WMLL43-CeiC5wdy.mjs.map +1 -0
- package/dist/{graph-types-s5V7pGj2-BxSqB1ZH.d.mts → graph-types-D4PrtP-l-B0uuchTl.d.mts} +101 -98
- package/dist/graph-types-D4PrtP-l-B0uuchTl.d.mts.map +1 -0
- package/dist/http.d.mts +2 -2
- package/dist/http.mjs +2 -2
- package/dist/{index-DyuwxTtd.d.mts → index-D8chHe55.d.mts} +3 -3
- package/dist/{index-DyuwxTtd.d.mts.map → index-D8chHe55.d.mts.map} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +4 -4
- package/dist/internal-app-configuration-file.d.mts +7 -10
- package/dist/internal-app-configuration-file.d.mts.map +1 -1
- package/dist/internal-app-configuration-file.mjs +2 -2
- package/dist/internal-converge-contract.d.mts +16 -0
- package/dist/internal-converge-contract.d.mts.map +1 -0
- package/dist/internal-converge-contract.mjs +16 -0
- package/dist/internal-converge-contract.mjs.map +1 -0
- package/dist/internal-converge.d.mts +5 -0
- package/dist/internal-converge.mjs +4 -0
- package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs +527 -0
- package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs.map +1 -0
- package/dist/local-target-7KRsLMDO.d.mts +31 -0
- package/dist/local-target-7KRsLMDO.d.mts.map +1 -0
- package/dist/{local-target-Dd8FJEb5.mjs → local-target-DhU1vaxd.mjs} +8 -8
- package/dist/{local-target-Dd8FJEb5.mjs.map → local-target-DhU1vaxd.mjs.map} +1 -1
- package/dist/local-target.d.mts +3 -31
- package/dist/local-target.mjs +1 -1
- package/dist/{nextjs-DLyeRR7M-0lw_cBIr.d.mts → nextjs-DLyeRR7M-CzUbvPaJ.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-0lw_cBIr.d.mts.map → nextjs-DLyeRR7M-CzUbvPaJ.d.mts.map} +1 -1
- package/dist/nextjs-control.d.mts +4 -4
- package/dist/nextjs.d.mts +1 -1
- package/dist/node-control.d.mts +3 -3
- package/dist/node.d.mts +2 -2
- package/dist/{pointer-CyQZZugO-D7k3vibs.d.mts → pointer-BX2KJ720-BxcfpaHP.d.mts} +8 -6
- package/dist/{pointer-CyQZZugO-D7k3vibs.d.mts.map → pointer-BX2KJ720-BxcfpaHP.d.mts.map} +1 -1
- package/dist/{preflight-transport-DmmtoFPH-CnDWufmu.mjs → preflight-transport-2d6iIchu-B-v7Di6I.mjs} +7 -44
- package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs.map +1 -0
- package/dist/{redaction-DXung4ip-bBoNomi3.mjs → redaction-DY6eDC12-W-FzW7_r.mjs} +32 -15
- package/dist/redaction-DY6eDC12-W-FzW7_r.mjs.map +1 -0
- package/dist/{redaction-Bf8FvTFH-D_HvoMrf.d.mts → redaction-Dn7BRdaP-BcLSPhLV.d.mts} +65 -16
- package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts.map +1 -0
- package/dist/report.d.mts +3 -3
- package/dist/report.mjs +2 -2
- package/dist/report.mjs.map +1 -1
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/steps-BZXNqW6U-C_ME2VLd.mjs +112 -0
- package/dist/steps-BZXNqW6U-C_ME2VLd.mjs.map +1 -0
- package/dist/testing.d.mts +1 -1
- package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs +344 -0
- package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs.map +1 -0
- package/dist/zod.d.mts +6 -5
- package/dist/zod.d.mts.map +1 -1
- package/dist/zod.mjs +6 -5
- package/dist/zod.mjs.map +1 -1
- package/package.json +15 -13
- package/skills/prisma-composer-core-concepts/SKILL.md +47 -66
- package/src/exports/dev-converge-worker.ts +2 -0
- package/src/exports/internal-converge-contract.ts +1 -0
- package/src/exports/internal-converge.ts +1 -0
- package/dist/app-config-UeKFBma7-CohaMmWp.d.mts.map +0 -1
- package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs.map +0 -1
- package/dist/config-BeZEgGCg.d.mts +0 -1
- package/dist/deploy-3EXLVrtG.mjs.map +0 -1
- package/dist/deploy-Xi4_JrtE.d.mts +0 -2
- package/dist/deployment-summary-D74WrJX7-DQ3LDUuO.mjs.map +0 -1
- package/dist/deployment-summary-p88NV5m5-SgniM8TX.d.mts.map +0 -1
- package/dist/describe-kind-Cpm_euxo-CkhlGJUL.mjs.map +0 -1
- package/dist/dev-current-wD5YDLjA-CzyFYXni.mjs.map +0 -1
- package/dist/dist-ynqBR6y8.mjs.map +0 -1
- package/dist/execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs.map +0 -1
- package/dist/execute-dev-BIyOI3Ys-BbDOLlV4.mjs.map +0 -1
- package/dist/graph-BzPLUUsB-D7EnB1F5.mjs.map +0 -1
- package/dist/graph-C7mdtisq-RnKiwVsx.d.mts.map +0 -1
- package/dist/graph-types-s5V7pGj2-BxSqB1ZH.d.mts.map +0 -1
- package/dist/local-target.d.mts.map +0 -1
- package/dist/preflight-transport-DmmtoFPH-CnDWufmu.mjs.map +0 -1
- package/dist/redaction-Bf8FvTFH-D_HvoMrf.d.mts.map +0 -1
- package/dist/redaction-DXung4ip-bBoNomi3.mjs.map +0 -1
- package/dist/run-alchemy-CRLAyOtt-CBUV28We.mjs +0 -236
- package/dist/run-alchemy-CRLAyOtt-CBUV28We.mjs.map +0 -1
- package/dist/validate-environment-D1BTCkTs-BQprjyNP.mjs +0 -739
- package/dist/validate-environment-D1BTCkTs-BQprjyNP.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-deploy-destroy-DN16ETAk-BaopEKsA.mjs","names":["path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-DN16ETAk.mjs"],"sourcesContent":["import { i as runPipeline, t as validateEnvironmentName } from \"./validate-environment-DCZiNSlR.mjs\";\nimport { i as noComposerExportMessage } from \"./composer-config-QKdY85G-.mjs\";\nimport { c as redactThrown, l as redactUnsetPlatformVariable, n as StreamRedactor, o as redactError, r as credentialLookingValues, s as redactSummary, t as SecretRedaction } from \"./redaction-DY6eDC12.mjs\";\nimport { a as readEngineFailureCause, i as engineFailureFilePath, n as capFailureCause, o as toDeploymentSummary, s as withComposerAdvice, t as DEPLOYMENT_RESULT_FILE_ENV } from \"./deployment-summary-CVJZn2v0.mjs\";\nimport { i as removeLeftoverAppConfigurationFiles, n as prepareSecondProcess, o as refuseSecretsInRootInput, t as deployAppConfigurationFile } from \"./app-configuration-file-D0rB5g65.mjs\";\nimport { c as convergeReasonsText, d as requireContainerForEnvironment, f as toStructured } from \"./dev-current-lAlj53eX.mjs\";\nimport { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from \"./run-report-CmBz2-xc.mjs\";\nimport { t as loadAppConvergeEntry } from \"./app-converge-bS1l9jIf.mjs\";\nimport { n as reportConvergeEvent, r as stepTracker, t as interactionMessages } from \"./steps-BZXNqW6U.mjs\";\nimport { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { nodeAddresses } from \"@internal/core/deploy\";\nimport { CliStructuredError, InternalError } from \"@internal/foundation/errors\";\nimport { containerEnv, preflightEnvVarName } from \"@internal/core/config\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\nimport { randomUUID } from \"node:crypto\";\nimport spawn from \"cross-spawn\";\n//#region src/generate-stack.ts\n/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */\nconst GENERATED_DIR = \".prisma-composer\";\nconst GENERATED_FILE = \"alchemy.run.ts\";\n/** A relative import specifier from `.prisma-composer/alchemy.run.ts` to `target` (posix separators). */\nfunction relativeImportSpecifier(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle(bundle) {\n\treturn `{ dir: ${quote(bundle.dir)}, entry: ${quote(bundle.entry)} }`;\n}\nfunction renderOptions(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote(input.name)},`);\n\tlines.push(` environment: ${quote(input.environment)},`);\n\tlines.push(\" appConfigurationRead: file.appConfigurationRead,\");\n\tlines.push(\" firstProcessNodeAddresses: file.nodeAddresses,\");\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote(id)}: ${renderBundle(bundle)},`);\n\tlines.push(\" },\");\n\tlines.push(\" report: report.deploymentReport,\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the stack module's source (tests assert on it without touching disk) — uses `//` headers, not a block comment, since a cwd path with a star-slash could close one early. */\nfunction renderStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst configImport = relativeImportSpecifier(generatedDir, input.configFile);\n\treturn `// Generated by Composer's deploy and destroy operations — overwritten on every\n// run; do not edit by hand. Runnable from ${quote(input.cwd)} WITH the env the\n// CLI passes its child (the PRISMA_COMPOSER_CONTAINER_*/_PREFLIGHT_* vars and the app configuration file —\n// without them lower() refuses because no container is resolved), by the\n// command Composer starts, which a failed run prints:\n//\n// <node> <bin of the alchemy @prisma/composer depends on> deploy ${GENERATED_DIR}/${GENERATED_FILE} --yes --stage <stage>\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\n// It runs no config adapter: it reads what the first process's Load read from the app configuration file named in PRISMA_COMPOSER_APP_CONFIGURATION_FILE.\nimport { lower } from '@prisma/composer/deploy';\nimport * as report from '@prisma/composer/report';\nimport { readAppConfigurationFile } from '@prisma/composer/internal/app-configuration-file';\nimport prismaConfig from ${quote(configImport)};\nimport app from ${quote(appImport)};\n\nconst config = prismaConfig.composer;\nif (config === undefined) {\n throw new Error(${quote(noComposerExportMessage(input.configFile))});\n}\n\n// The app's own @prisma/composer may predate the failure recorder.\nreport.captureEngineFailure?.();\n\nconst file = readAppConfigurationFile(process.env);\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the stack file, returning its absolute path. */\nfunction writeStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderStackFile(input));\n\treturn filePath;\n}\nconst GENERATED_STACK_RELATIVE_PATH = path.join(GENERATED_DIR, GENERATED_FILE);\n//#endregion\n//#region src/alchemy-bin.ts\n/**\n* Which Alchemy CLI runs a generated stack file: the `alchemy` that\n* `@prisma/composer` depends on, found from the app the way the stack file's\n* own `@prisma/composer/...` imports are. The CLI and the stack code then\n* come from one install, so the child loads one copy of `alchemy`.\n*\n* Node's resolver finds `@prisma/composer` from the app. It cannot find\n* `alchemy` from there: alchemy exports neither its `package.json` nor its\n* bin, and has no `require` condition. Bun has no `module.findPackageJSON`.\n* So the last step is Node's own lookup written out: each `node_modules`\n* above `@prisma/composer`'s real location, nearest first.\n*/\nconst FIX = \"Check that the app depends on @prisma/composer and that `alchemy`, which @prisma/composer depends on, is installed in a node_modules directory. Layouts without one, such as Yarn Plug'n'Play, are not supported.\";\nfunction binMissing(message) {\n\treturn new CliStructuredError(\"DEPLOY.ALCHEMY_BIN_MISSING\", message, { fix: FIX });\n}\nfunction composerPackageDir(appDir) {\n\ttry {\n\t\tconst manifest = createRequire(path.join(appDir, \"package.json\")).resolve(\"@prisma/composer/package.json\");\n\t\treturn path.dirname(fs.realpathSync(manifest));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction alchemyPackageDirAbove(dir) {\n\tfor (let current = dir;; current = path.dirname(current)) {\n\t\tconst candidate = path.join(current, \"node_modules\", \"alchemy\");\n\t\tif (fs.existsSync(path.join(candidate, \"package.json\"))) return candidate;\n\t\tif (path.dirname(current) === current) return void 0;\n\t}\n}\nfunction readPackageJson(packageDir) {\n\ttry {\n\t\treturn JSON.parse(fs.readFileSync(path.join(packageDir, \"package.json\"), \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction binOf(packageDir) {\n\tconst manifest = readPackageJson(packageDir);\n\tif (typeof manifest !== \"object\" || manifest === null || !(\"bin\" in manifest)) return void 0;\n\tconst bin = manifest.bin;\n\tconst relative = typeof bin === \"string\" ? bin : typeof bin === \"object\" && bin !== null && \"alchemy\" in bin ? bin.alchemy : void 0;\n\tif (typeof relative !== \"string\") return void 0;\n\tconst entry = path.join(packageDir, relative);\n\treturn fs.existsSync(entry) ? entry : void 0;\n}\n/**\n* The JavaScript file `alchemy`'s `bin` names, for the app in `appDir`.\n* Raises DEPLOY.ALCHEMY_BIN_MISSING when the app does not resolve\n* `@prisma/composer` or no usable `alchemy` is installed beside it.\n*/\nfunction resolveAlchemyBin(appDir) {\n\tconst composerDir = composerPackageDir(appDir);\n\tif (composerDir === void 0) throw binMissing(`Could not resolve @prisma/composer from \"${appDir}\".`);\n\tconst alchemyDir = alchemyPackageDirAbove(composerDir);\n\tconst entry = alchemyDir === void 0 ? void 0 : binOf(alchemyDir);\n\tif (entry === void 0) throw binMissing(`Could not resolve the bin of the \\`alchemy\\` package @prisma/composer depends on, from \"${composerDir}\".`);\n\treturn entry;\n}\n//#endregion\n//#region src/run-alchemy.ts\n/**\n* Pipeline step 9 (deploy-cli.md § The pipeline; design-notes.md's \"Driving\n* Alchemy\" call): run the generated stack file and, for programmatic hosts, pipe its\n* output through redaction.\n*\n* Runs the bin of the `alchemy` the app's `@prisma/composer` depends on\n* (`resolveAlchemyBin`), started with Node (`nodeExecutable`). Never a\n* `node_modules/.bin` link, which pnpm creates only for an app's direct\n* dependencies.\n*\n* Only `destroy` still runs Alchemy in a child; `deploy` and `dev` converge\n* in-process (ADR-0066). This module composes the invocation; `spawnAlchemy`\n* starts it, piping the child's output through the stream redactor\n* (ADR-0062), and tests substitute their own runner.\n*/\nfunction currentRuntime() {\n\treturn {\n\t\tbun: process.versions.bun !== void 0,\n\t\texecPath: process.execPath,\n\t\tenv: process.env,\n\t\tplatform: process.platform,\n\t\texists: fs.existsSync\n\t};\n}\nfunction envValue(env, name) {\n\treturn Object.entries(env).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];\n}\n/** The file names `node` may have in a PATH directory: PATHEXT's extensions on Windows. */\nfunction nodeFileNames(runtime) {\n\tif (runtime.platform !== \"win32\") return [\"node\"];\n\treturn (envValue(runtime.env, \"PATHEXT\") ?? \".COM;.EXE;.BAT;.CMD\").split(\";\").filter((extension) => extension.length > 0).map((extension) => `node${extension}`);\n}\n/**\n* The Node that starts Alchemy's launcher: this process's own runtime under\n* Node, and the first `node` on PATH under Bun. Alchemy's launcher may still\n* move itself to Bun when the package-manager environment says Bun invoked\n* it (`bunx`, `bun run`), so the runtime Alchemy ends up on follows how\n* `prisma` was invoked.\n*/\nfunction nodeExecutable(runtime = currentRuntime()) {\n\tif (!runtime.bun) return runtime.execPath;\n\tconst paths = runtime.platform === \"win32\" ? path.win32 : path.posix;\n\tconst names = nodeFileNames(runtime);\n\tfor (const rawDir of (envValue(runtime.env, \"PATH\") ?? \"\").split(paths.delimiter)) {\n\t\tconst dir = rawDir.replace(/^\"(.*)\"$/, \"$1\");\n\t\tif (dir.length === 0) continue;\n\t\tfor (const name of names) {\n\t\t\tconst candidate = paths.join(dir, name);\n\t\t\tif (runtime.exists(candidate)) return candidate;\n\t\t}\n\t}\n\tthrow new CliStructuredError(\"DEPLOY.NODE_MISSING\", \"Composer starts Alchemy with Node, and no `node` was found on PATH.\", { fix: \"Install Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer, and put it on PATH, or run `prisma` under Node.\" });\n}\n/**\n* Resolves the invocation against this machine — the step every adapter takes\n* and no caller should. Runs alchemy's JavaScript entry with Node, so no shell\n* shim is involved on any platform. Raises DEPLOY.ALCHEMY_BIN_MISSING when\n* Composer's alchemy cannot be resolved, and DEPLOY.NODE_MISSING when no Node\n* can run it.\n*/\nfunction alchemyCommandLine(invocation, alchemyBin = resolveAlchemyBin(invocation.cwd), node = nodeExecutable()) {\n\treturn {\n\t\tcommand: node,\n\t\targs: [\n\t\t\talchemyBin,\n\t\t\tinvocation.action,\n\t\t\tinvocation.stackFileRelativePath,\n\t\t\t\"--yes\",\n\t\t\t\"--stage\",\n\t\t\tinvocation.stage\n\t\t],\n\t\tcwd: invocation.cwd,\n\t\tenv: invocation.env\n\t};\n}\n/** What becomes `alchemy deploy|destroy <stack file> --yes --stage <stage>`. */\nfunction alchemyInvocation(input) {\n\treturn {\n\t\taction: input.command,\n\t\tstackFileRelativePath: input.stackFileRelativePath,\n\t\tcwd: input.cwd,\n\t\tstage: input.stage,\n\t\tenv: {\n\t\t\t...input.containerEnv,\n\t\t\t...input.preflightEnv,\n\t\t\t...input.env\n\t\t},\n\t\tredactedValues: input.redactedValues\n\t};\n}\n/**\n* The default runner for hosts with no engine: stdin inherited and output piped through redaction, the caller's\n* own process group, and the child's status returned verbatim. It does not\n* collapse a signal into an exit code — that collapse is what made a\n* Ctrl-C'd deploy report itself as a failure.\n*/\nconst spawnAlchemy = async (invocation) => {\n\tconst commandLine = alchemyCommandLine(invocation);\n\treturn {\n\t\t...await spawnCommandLine(commandLine, invocation.redactedValues),\n\t\tcommandLine\n\t};\n};\n/**\n* One argument as the platform's shell reads it literally: single quotes for\n* POSIX shells, double quotes for cmd.exe. cmd.exe expands `%VAR%` inside\n* double quotes, and strips or expands `!` when delayed expansion is on; no\n* quoting prevents either, so an argument containing them is not fully\n* literal there.\n*/\nfunction shellArg(arg, platform) {\n\tif (platform === \"win32\") return /^[\\w@+=:,./\\\\~-]+$/.test(arg) ? arg : `\"${arg.replaceAll(\"\\\"\", \"\\\"\\\"\")}\"`;\n\treturn /^[\\w@%+=:,./-]+$/.test(arg) ? arg : `'${arg.replaceAll(\"'\", \"'\\\\''\")}'`;\n}\n/**\n* The command a user runs from the invocation's directory to repeat a\n* converge: the command line the adapter started, or, from an adapter that\n* does not report one, `alchemy` with the same arguments.\n*/\nfunction reproduceCommand(invocation, outcome, platform = process.platform) {\n\treturn (outcome?.commandLine === void 0 ? [\n\t\t\"alchemy\",\n\t\tinvocation.action,\n\t\tinvocation.stackFileRelativePath,\n\t\t\"--yes\",\n\t\t\"--stage\",\n\t\tinvocation.stage\n\t] : [outcome.commandLine.command, ...outcome.commandLine.args]).map((arg) => shellArg(arg, platform)).join(\" \");\n}\n/** Starts a resolved command line with stdin inherited and its output piped through redaction, and returns how it ended. */\nfunction spawnCommandLine(line, redactedValues, outputs = process) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst child = spawn(line.command, [...line.args], {\n\t\t\tcwd: line.cwd,\n\t\t\tstdio: [\n\t\t\t\t\"inherit\",\n\t\t\t\t\"pipe\",\n\t\t\t\t\"pipe\"\n\t\t\t],\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\t...line.env\n\t\t\t}\n\t\t});\n\t\tconst stdout = new StreamRedactor(redactedValues);\n\t\tconst stderr = new StreamRedactor(redactedValues);\n\t\tconst write = (stream, text) => {\n\t\t\tif (text.length > 0) stream.write(text);\n\t\t};\n\t\tchild.stdout?.setEncoding(\"utf8\").on(\"data\", (chunk) => write(outputs.stdout, stdout.push(chunk)));\n\t\tchild.stderr?.setEncoding(\"utf8\").on(\"data\", (chunk) => write(outputs.stderr, stderr.push(chunk)));\n\t\tchild.on(\"error\", reject);\n\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\twrite(outputs.stdout, stdout.end());\n\t\t\twrite(outputs.stderr, stderr.end());\n\t\t\tresolve({\n\t\t\t\texitCode,\n\t\t\t\tsignal\n\t\t\t});\n\t\t});\n\t});\n}\n//#endregion\n//#region src/operations/execute-deploy-destroy.ts\n/**\n* The deploy/destroy executor — main.ts's pipeline orchestration with argv,\n* console, and exit codes removed: typed inputs in, structured results out.\n* Reached only by lazy import from deploy.ts/destroy.ts — this module's\n* static graph transitively loads alchemy's provider tree, so the control\n* entry must never import it statically.\n*/\nconst ALCHEMY_STATE_DIR = \".alchemy\";\n/** Destroy guardrail (moved from main.ts): true when `<cwd>/.alchemy` is missing or empty — likely wrong directory or nothing deployed yet. */\nfunction hasNoLocalDeployState(cwd) {\n\tconst stateDir = path.join(cwd, ALCHEMY_STATE_DIR);\n\treturn !(fs.existsSync(stateDir) && fs.readdirSync(stateDir).length > 0);\n}\n/** Times each deploy step for the host's `onEvent`. A step still open when the run fails is closed as failed, innermost first. */\nfunction deploySteps(onEvent) {\n\treturn stepTracker((step) => step.name === \"assemble-service\" ? `${step.name}:${step.address}` : step.name === \"apply-resource\" ? `${step.name}:${step.resourceId}` : step.name, onEvent);\n}\nasync function executeDeploy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"deploy\", {\n\t\tentry: input.entry,\n\t\tconfig: input.config,\n\t\tname: input.name,\n\t\tenvironment: input.environment ?? \"production\",\n\t\tcwd,\n\t\tonEvent: void 0,\n\t\tdeps,\n\t\treportId: input.reportId,\n\t\treportPath: resolveRunReportPath(input.reportPath, process.env[RUN_REPORT_FILE_ENV], cwd),\n\t\tsteps: deploySteps(input.onEvent),\n\t\tsignal: input.signal,\n\t\tredaction: deps.redaction ?? new SecretRedaction(process.env)\n\t});\n\tif (!outcome.ok) return outcome;\n\treturn ok({ summary: outcome.value });\n}\nasync function executeDestroy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"destroy\", {\n\t\tentry: input.entry,\n\t\tconfig: input.config,\n\t\tname: input.name,\n\t\tenvironment: input.environment,\n\t\tcwd,\n\t\tonEvent: input.onEvent,\n\t\tdeps,\n\t\treportId: void 0,\n\t\treportPath: void 0,\n\t\tsteps: deploySteps(void 0),\n\t\tsignal: void 0,\n\t\tredaction: new SecretRedaction(process.env)\n\t});\n\tif (!outcome.ok) return outcome;\n\treturn okVoid();\n}\n/**\n* Opens a session per extension that declares a reporter. A `begin` that\n* throws costs that extension its reporting and nothing else — the deploy\n* has not started, and refusing to run it because an observer failed would\n* invert the relationship.\n*/\nasync function beginReporters(extensions, context, redaction) {\n\treturn (await Promise.all(extensions.map(async (extension) => {\n\t\tif (extension.reporter === void 0) return void 0;\n\t\ttry {\n\t\t\tconst reporter = await extension.reporter.begin(context);\n\t\t\treturn reporter === void 0 ? void 0 : {\n\t\t\t\textensionId: extension.id,\n\t\t\t\treporter\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not start deploy reporting for ${extension.id}: ${redaction.redact(detail)}`);\n\t\t\treturn;\n\t\t}\n\t}))).filter((entry) => entry !== void 0);\n}\n/** Hands each session its own extension's resolved container, so it can attach the run to what that container names. */\nasync function attachReporters(reporters, containers, redaction) {\n\tawait Promise.all(reporters.map(async ({ extensionId, reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.attach({ container: containers.get(extensionId) });\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not attach this deploy to its project for ${extensionId}: ${redaction.redact(detail)}`);\n\t\t}\n\t}));\n}\n/** Every session's contribution to the apply's environment, so reporting that happens inside the apply can find the run. */\nfunction reporterEnv(reporters, redaction) {\n\tconst env = {};\n\tfor (const { extensionId, reporter } of reporters) try {\n\t\tObject.assign(env, reporter.childEnv());\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not pass deploy reporting into the apply for ${extensionId}: ${redaction.redact(detail)}`);\n\t}\n\treturn env;\n}\n/** `failingStep` is capped at 500 by the platform and `errorMessage` at 5000; truncating here keeps a long message from costing the whole report. */\nfunction truncate(value, limit) {\n\treturn value.length <= limit ? value : `${value.slice(0, limit - 1)}…`;\n}\n/** An interrupted converge — reported as `cancelled`, never as `failed`. */\nfunction wasInterrupted(failure) {\n\treturn failure.code === \"DEPLOY.INTERRUPTED\" || typeof failure.meta?.[\"signal\"] === \"string\";\n}\n/**\n* Ends every reporting session, whatever the run did. Sessions never reject\n* by contract, but a buggy one must not turn a converged deploy into a\n* failure — so this swallows anyway, and reports each session independently\n* so one bad implementation cannot silence another.\n*/\nasync function finishReporters(reporters, outcome, redaction) {\n\tconst entities = outcome.summary?.nodes.flatMap((node) => node.entities) ?? [];\n\tawait Promise.all(reporters.map(async ({ reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.finish({\n\t\t\t\tok: outcome.ok,\n\t\t\t\tcancelled: outcome.cancelled,\n\t\t\t\tfailingStep: outcome.code === void 0 ? void 0 : truncate(outcome.code, 500),\n\t\t\t\terrorMessage: outcome.message === void 0 ? void 0 : truncate(outcome.message, 5e3),\n\t\t\t\tentities\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not report this deploy's outcome: ${redaction.redact(detail)}`);\n\t\t}\n\t}));\n}\n/**\n* Owns the reporting sessions around the pipeline: the inner run opens them\n* once it knows which extensions are configured, and this closes them on\n* every exit path — a returned failure, a success, or a thrown defect — as\n* the `record` step, which also writes the run report.\n* Nothing here can change what the pipeline returns.\n*/\nasync function runStackPipeline(action, opts) {\n\tconst reporters = [];\n\tlet outcome;\n\ttry {\n\t\toutcome = await runStackPipelineInner(action, opts, reporters);\n\t} catch (error) {\n\t\topts.steps.closeOpen(\"failed\");\n\t\topts.steps.start({ name: \"record\" });\n\t\tconst thrown = redactThrown(error, opts.redaction);\n\t\tawait finishReporters(reporters, {\n\t\t\tok: false,\n\t\t\tcancelled: false,\n\t\t\tcode: \"DEPLOY.UNEXPECTED\",\n\t\t\tmessage: thrown.message\n\t\t}, opts.redaction);\n\t\topts.steps.finish({ name: \"record\" });\n\t\tthrow thrown;\n\t}\n\tif (!outcome.ok) outcome = notOk(redactError(outcome.failure, opts.redaction));\n\tif (!outcome.ok) opts.steps.closeOpen(\"failed\");\n\topts.steps.start({ name: \"record\" });\n\tawait finishReporters(reporters, outcome.ok ? {\n\t\tok: true,\n\t\tcancelled: false,\n\t\tsummary: outcome.value\n\t} : {\n\t\tok: false,\n\t\tcancelled: wasInterrupted(outcome.failure),\n\t\tcode: outcome.failure.code,\n\t\tmessage: outcome.failure.message\n\t}, opts.redaction);\n\tif (opts.reportPath === void 0 || writeRunReport(opts.reportPath, toRunReport({\n\t\tsummary: outcome.ok ? outcome.value : void 0,\n\t\tenvironment: opts.environment,\n\t\tfailure: outcome.ok ? void 0 : {\n\t\t\tcode: outcome.failure.code,\n\t\t\tmessage: outcome.failure.message\n\t\t}\n\t}))) opts.steps.finish({ name: \"record\" });\n\telse opts.steps.fail({ name: \"record\" });\n\treturn outcome;\n}\n/** The pipeline both actions share: validate, resolve containers, then for\n* deploy preflight and the in-process converge, and for destroy the stack\n* file, the alchemy child and the teardown/removal suffix. The value is only\n* ever a summary for deploy. */\nasync function runStackPipelineInner(action, opts, reporters) {\n\tconst { entry, config: composerConfig, name, environment, cwd, onEvent, deps, steps } = opts;\n\tsteps.start({ name: \"prepare\" });\n\tremoveLeftoverAppConfigurationFiles(cwd);\n\ttry {\n\t\tvalidateEnvironmentName(environment);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tlet appConvergeEntry;\n\tif (action === \"deploy\") {\n\t\tconst loaded = await prepareAppConvergeEntry(deps, path.dirname(path.resolve(cwd, composerConfig.file)));\n\t\tif (!loaded.ok) return loaded;\n\t\tappConvergeEntry = loaded.value;\n\t}\n\tconst platformCredentials = deps.credentials;\n\tif (action === \"destroy\" && hasNoLocalDeployState(cwd)) onEvent?.({\n\t\tkind: \"no-local-deploy-state\",\n\t\tcwd\n\t});\n\tlet pipeline;\n\tlet containers;\n\tlet alchemyStage;\n\tconst preflightPayloads = /* @__PURE__ */ new Map();\n\tconst unset = [];\n\tconst preflightTransportEnv = {};\n\ttry {\n\t\tpipeline = await runPipeline(entry, name, environment, cwd, composerConfig, {\n\t\t\trunAssembler: deps.runAssembler,\n\t\t\treadSecrets: action === \"deploy\",\n\t\t\tredaction: opts.redaction,\n\t\t\tonEvent: (event) => {\n\t\t\t\tswitch (event.kind) {\n\t\t\t\t\tcase \"loaded\":\n\t\t\t\t\t\tsteps.finish({ name: \"prepare\" });\n\t\t\t\t\t\tsteps.start({ name: \"assemble\" });\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"service-started\":\n\t\t\t\t\t\tsteps.start({\n\t\t\t\t\t\t\tname: \"assemble-service\",\n\t\t\t\t\t\t\taddress: event.address\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"service-assembled\":\n\t\t\t\t\t\tsteps.finish({\n\t\t\t\t\t\t\tname: \"assemble-service\",\n\t\t\t\t\t\t\taddress: event.address\n\t\t\t\t\t\t}, event.data);\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}, action === \"destroy\" ? (error) => new CliStructuredError(\"DEPLOY.BUILD_REQUIRED\", error.message, {\n\t\t\twhy: \"destroy evaluates the same stack program as deploy, which packages the built artifacts — so the app must be built first.\",\n\t\t\tfix: \"Run the build, then retry the destroy.\",\n\t\t\tcause: error\n\t\t}) : void 0);\n\t\tsteps.finish({ name: \"assemble\" });\n\t\tconst { graph, name: resolvedName } = pipeline;\n\t\tconst config = pipeline.configSource.value;\n\t\tif (action === \"deploy\") refuseSecretsInRootInput(graph.appConfigurationRead, opts.redaction.knownSecrets, \"A deploy sends every plain value Load read to the platform as plain configuration, and never sends a secret that way.\");\n\t\tsteps.start({ name: \"connect\" });\n\t\tif (action === \"deploy\") reporters.push(...await beginReporters(config.extensions, {\n\t\t\tappName: resolvedName,\n\t\t\tgraph,\n\t\t\tenvironment,\n\t\t\tcwd,\n\t\t\treportId: opts.reportId,\n\t\t\tcredentials: platformCredentials\n\t\t}, opts.redaction));\n\t\tcontainers = /* @__PURE__ */ new Map();\n\t\tfor (const extension of config.extensions) {\n\t\t\tif (extension.container === void 0) continue;\n\t\t\ttry {\n\t\t\t\tif (action === \"deploy\") {\n\t\t\t\t\tconst instance = await extension.container.ensure({\n\t\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\t\tenvironment\n\t\t\t\t\t}, platformCredentials);\n\t\t\t\t\trequireContainerForEnvironment(action, extension.id, extension.container, instance, environment);\n\t\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t\t} else {\n\t\t\t\t\tconst instance = await extension.container.locate({\n\t\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\t\tenvironment\n\t\t\t\t\t}, platformCredentials);\n\t\t\t\t\tif (instance === void 0) throw new CliStructuredError(\"DEPLOY.TARGET_NOT_FOUND\", `Nothing deployed for ${resolvedName} in the environment ${environment}.`, { fix: \"Deploy it first.\" });\n\t\t\t\t\trequireContainerForEnvironment(action, extension.id, extension.container, instance, environment);\n\t\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_FAILED\", error);\n\t\t\t}\n\t\t}\n\t\tawait attachReporters(reporters, containers, opts.redaction);\n\t\talchemyStage = containers.get(config.state.extension)?.alchemyStage ?? environment;\n\t\tsteps.finish({ name: \"connect\" });\n\t\tif (action === \"deploy\") {\n\t\t\tsteps.start({ name: \"preflight\" });\n\t\t\tlet checked = 0;\n\t\t\tconst report = (reported) => {\n\t\t\t\tchecked += reported.checked;\n\t\t\t\tunset.push(...reported.unset.map((variable) => redactUnsetPlatformVariable(variable, opts.redaction)));\n\t\t\t};\n\t\t\tfor (const extension of config.extensions) {\n\t\t\t\tif (extension.preflight === void 0) continue;\n\t\t\t\ttry {\n\t\t\t\t\tconst payload = await extension.preflight({\n\t\t\t\t\t\tgraph,\n\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tconfiguration: pipeline.configuration,\n\t\t\t\t\t\tsecrets: pipeline.secrets,\n\t\t\t\t\t\tcredentials: platformCredentials,\n\t\t\t\t\t\treport\n\t\t\t\t\t});\n\t\t\t\t\tif (payload !== void 0) preflightPayloads.set(extension.id, payload);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow toStructured(\"DEPLOY.PREFLIGHT_FAILED\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsteps.finish({ name: \"preflight\" }, {\n\t\t\t\tchecked,\n\t\t\t\tunset: unset.length\n\t\t\t});\n\t\t\tif (unset.length > 0) steps.emit({\n\t\t\t\tkind: \"preflight-findings\",\n\t\t\t\tfindings: { unset }\n\t\t\t});\n\t\t}\n\t\tif (action === \"destroy\") for (const extension of config.extensions) preflightTransportEnv[preflightEnvVarName(extension.id)] = \"\";\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tif (appConvergeEntry !== void 0) return convergeDeploy(opts, pipeline, appConvergeEntry, {\n\t\tcontainers,\n\t\tstage: alchemyStage,\n\t\tpreflightPayloads,\n\t\tfindings: { unset },\n\t\tenv: reporterEnv(reporters, opts.redaction)\n\t});\n\tlet stackPath;\n\tconst resultFilePath = path.join(cwd, \".prisma-composer\", `deployment-result-${String(process.pid)}-${randomUUID()}.json`);\n\tlet handover;\n\ttry {\n\t\ttry {\n\t\t\thandover = prepareSecondProcess({\n\t\t\t\tfile: deployAppConfigurationFile(cwd, randomUUID()),\n\t\t\t\tappConfigurationRead: pipeline.graph.appConfigurationRead,\n\t\t\t\tplainVariableText: {},\n\t\t\t\tnodeAddresses: nodeAddresses(pipeline.graph),\n\t\t\t\tknownSecrets: opts.redaction.knownSecrets\n\t\t\t});\n\t\t\tstackPath = writeStackFile({\n\t\t\t\tentryPath: pipeline.entryModule.path,\n\t\t\t\tcwd,\n\t\t\t\tconfigFile: pipeline.configSource.file,\n\t\t\t\tname: pipeline.name,\n\t\t\t\tenvironment,\n\t\t\t\tassembled: pipeline.assembled\n\t\t\t});\n\t\t\thandover.writeFile();\n\t\t} catch (error) {\n\t\t\treturn notOk(toStructured(\"DEPLOY.STACK_WRITE_FAILED\", error));\n\t\t}\n\t\tconst invocation = alchemyInvocation({\n\t\t\tcommand: action,\n\t\t\tstackFileRelativePath: GENERATED_STACK_RELATIVE_PATH,\n\t\t\tcwd,\n\t\t\tstage: alchemyStage,\n\t\t\tcontainerEnv: containerEnv(containers),\n\t\t\tpreflightEnv: preflightTransportEnv,\n\t\t\tenv: {\n\t\t\t\t...reporterEnv(reporters, opts.redaction),\n\t\t\t\t...handover.env,\n\t\t\t\t[DEPLOYMENT_RESULT_FILE_ENV]: resultFilePath\n\t\t\t},\n\t\t\tredactedValues: opts.redaction.allValues()\n\t\t});\n\t\tsteps.start({ name: \"apply\" });\n\t\tlet outcome;\n\t\ttry {\n\t\t\toutcome = await (deps.alchemy ?? spawnAlchemy)(invocation);\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\tmeta: { diagnostics: {\n\t\t\t\t\texitCode: void 0,\n\t\t\t\t\tstackFilePath: stackPath,\n\t\t\t\t\treproduceCommand: reproduceCommand(invocation),\n\t\t\t\t\tcwd\n\t\t\t\t} }\n\t\t\t}));\n\t\t}\n\t\tconst reproduce = reproduceCommand(invocation, outcome);\n\t\tif (outcome.signal !== null) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} was interrupted by ${outcome.signal}.`, { meta: {\n\t\t\tsignal: outcome.signal,\n\t\t\tdiagnostics: {\n\t\t\t\texitCode: void 0,\n\t\t\t\tsignal: outcome.signal,\n\t\t\t\tstackFilePath: stackPath,\n\t\t\t\treproduceCommand: reproduce,\n\t\t\t\tcwd\n\t\t\t}\n\t\t} }));\n\t\tconst status = outcome.exitCode ?? 1;\n\t\tif (status !== 0) {\n\t\t\tconst engineCause = readEngineFailureCause(resultFilePath, (text) => opts.redaction.redact(text));\n\t\t\tconst withCause = (sentence) => engineCause === void 0 ? sentence : `${sentence}\\n${engineCause}`;\n\t\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", withCause(`alchemy ${action} exited with status ${status}.`), { meta: {\n\t\t\t\texitCode: status,\n\t\t\t\t...engineCause !== void 0 ? { engineCause } : {},\n\t\t\t\tdiagnostics: {\n\t\t\t\t\texitCode: status,\n\t\t\t\t\tstackFilePath: stackPath,\n\t\t\t\t\treproduceCommand: reproduce,\n\t\t\t\t\tcwd\n\t\t\t\t}\n\t\t\t} }));\n\t\t}\n\t\tsteps.finish({ name: \"apply\" });\n\t\ttry {\n\t\t\tif (action === \"destroy\") {\n\t\t\t\tfor (const extension of pipeline.configSource.value.extensions) {\n\t\t\t\t\tif (extension.teardown === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.teardown({\n\t\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\t\tenvironment\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.TEARDOWN_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const extension of pipeline.configSource.value.extensions) {\n\t\t\t\t\tif (extension.container === void 0) continue;\n\t\t\t\t\tconst instance = containers.get(extension.id);\n\t\t\t\t\tif (instance === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.container.remove(instance, platformCredentials);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_REMOVE_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\tthrow error;\n\t\t}\n\t\treturn ok(void 0);\n\t} finally {\n\t\ttry {\n\t\t\tfs.rmSync(resultFilePath, { force: true });\n\t\t\tfs.rmSync(engineFailureFilePath(resultFilePath), { force: true });\n\t\t} catch {}\n\t\thandover?.removeFile();\n\t}\n}\n/** Loaded before anything is created, so a missing or incompatible install fails first. */\nasync function prepareAppConvergeEntry(deps, appDir) {\n\ttry {\n\t\treturn ok(deps.appConvergeEntry ?? await loadAppConvergeEntry(appDir));\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n/** The structured failure a converge that did not apply settles as. */\nfunction convergeFailure(outcome, redact) {\n\tswitch (outcome.kind) {\n\t\tcase \"interrupted\": return new CliStructuredError(\"DEPLOY.INTERRUPTED\", \"The deploy was interrupted.\", {\n\t\t\twhy: \"It stopped while Alchemy planned or applied it. Resources it had already changed stay as they are.\",\n\t\t\tfix: \"Deploy again to finish.\"\n\t\t});\n\t\tcase \"refused\": return outcome.reason === \"already-running\" ? new CliStructuredError(\"DEPLOY.CONVERGE_RUNNING\", \"Another deploy is already running in this process.\", {\n\t\t\twhy: \"A deploy sets the process's environment and working directory while Alchemy runs, so two cannot overlap.\",\n\t\t\tfix: \"Wait for the other deploy to finish, or run this one in its own process.\"\n\t\t}) : new CliStructuredError(\"DEPLOY.WORKER_THREAD\", \"Deploy cannot run in a worker thread when its cwd is not the process working directory.\", {\n\t\t\twhy: \"Alchemy reads `.env` and keeps `.alchemy` in the working directory, and a worker thread cannot change it.\",\n\t\t\tfix: \"Call deploy from the main thread, or with the process's working directory as its cwd.\"\n\t\t});\n\t\tcase \"failed\": {\n\t\t\tconst cause = capFailureCause(redact(withComposerAdvice(convergeReasonsText(outcome.reasons))));\n\t\t\treturn new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `Alchemy could not deploy the app.\\n${cause}`, { meta: {\n\t\t\t\tengineCause: cause,\n\t\t\t\treasons: outcome.reasons.map(({ tag, message }) => ({\n\t\t\t\t\ttag,\n\t\t\t\t\tmessage: redact(message)\n\t\t\t\t}))\n\t\t\t} });\n\t\t}\n\t}\n\treturn new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", \"The converge ended with an outcome this Composer does not know.\");\n}\n/**\n* Deploy's converge: lowers the app with the containers and preflight\n* payloads this run resolved, then plans and applies it in this process.\n* The report hook runs inside the apply, here, so the summary comes back as\n* a value.\n*/\nasync function convergeDeploy(opts, pipeline, entry, resolved) {\n\tconst { cwd, environment, steps } = opts;\n\tconst config = pipeline.configSource.value;\n\tconst env = resolved.env;\n\topts.redaction.addCredentialLookingValues(credentialLookingValues(env));\n\tconst redact = (text) => opts.redaction.redact(text);\n\tlet summary;\n\tconst root = pipeline.graph.root.node;\n\tif (root.kind !== \"module\") throw new InternalError(\"runPipeline admitted a root that is not a module\");\n\tsteps.start({ name: \"apply\" });\n\tlet stack;\n\ttry {\n\t\tstack = entry.lower(root, config, {\n\t\t\tname: pipeline.name,\n\t\t\tenvironment,\n\t\t\tappConfigurationRead: pipeline.graph.appConfigurationRead,\n\t\t\tfirstProcessNodeAddresses: nodeAddresses(pipeline.graph),\n\t\t\tbundles: pipeline.assembled.bundles,\n\t\t\tcontainers: resolved.containers,\n\t\t\tpreflightPayloads: resolved.preflightPayloads,\n\t\t\tfindings: resolved.findings,\n\t\t\tcredentials: opts.deps.credentials,\n\t\t\treport: (result) => {\n\t\t\t\tsummary = toDeploymentSummary(result);\n\t\t\t}\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", redact(error instanceof Error ? error.message : String(error))));\n\t}\n\tconst output = interactionMessages(steps, opts.redaction);\n\tlet outcome;\n\ttry {\n\t\toutcome = await entry.converge({\n\t\t\toperation: \"deploy\",\n\t\t\tstack,\n\t\t\tstage: resolved.stage,\n\t\t\tcwd,\n\t\t\tenv,\n\t\t\tsignal: opts.signal,\n\t\t\tonEvent: (event) => reportConvergeEvent(steps, event, redact, (resource) => ({\n\t\t\t\tname: \"apply-resource\",\n\t\t\t\t...resource\n\t\t\t})),\n\t\t\toutput: (text) => output.push(text)\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", redact(`Alchemy could not deploy the app.\\n${error instanceof Error ? error.message : String(error)}`)));\n\t} finally {\n\t\toutput.end();\n\t}\n\tif (outcome.kind !== \"applied\") return notOk(convergeFailure(outcome, redact));\n\tsteps.finish({ name: \"apply\" });\n\treturn ok(redactSummary(summary, opts.redaction));\n}\n//#endregion\nexport { executeDeploy, executeDestroy };\n\n//# sourceMappingURL=execute-deploy-destroy-DN16ETAk.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;;AAEvB,SAAS,wBAAwB,cAAc,QAAQ;CACtD,MAAM,MAAMA,OAAK,SAAS,cAAc,MAAM,CAAC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