@prisma/composer-cli 0.25.0-dev.3 → 0.25.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +55 -108
- package/dist/bin.mjs.map +1 -1
- package/dist/{execute-deploy-destroy-Bdi-RiN5-T3tv5DHr.mjs → execute-deploy-destroy-CF6DR7sA-DGs5poBA.mjs} +23 -19
- package/dist/execute-deploy-destroy-CF6DR7sA-DGs5poBA.mjs.map +1 -0
- package/dist/{execute-deploy-destroy-Bdi-RiN5-BBrZ9a8c.mjs → execute-deploy-destroy-CF6DR7sA-jdelm-y5.mjs} +22 -18
- package/dist/execute-deploy-destroy-CF6DR7sA-jdelm-y5.mjs.map +1 -0
- package/dist/{execute-dev-BLCK5wF7-B-fG_E31.mjs → execute-dev-DAIUT0es-CVW9TfgX.mjs} +179 -130
- package/dist/execute-dev-DAIUT0es-CVW9TfgX.mjs.map +1 -0
- package/dist/{execute-dev-BLCK5wF7-CuzMSK7T.mjs → execute-dev-DAIUT0es-DTdnJdOi.mjs} +100 -131
- package/dist/{execute-dev-BLCK5wF7-B-fG_E31.mjs.map → execute-dev-DAIUT0es-DTdnJdOi.mjs.map} +1 -1
- package/dist/{execute-log-B_zCJ17b-C4a0uxJj.mjs → execute-log-PLs9-Qn3-BUBx5KmY.mjs} +7 -10
- package/dist/execute-log-PLs9-Qn3-BUBx5KmY.mjs.map +1 -0
- package/dist/{execute-log-B_zCJ17b-BrLUt7vo.mjs → execute-log-PLs9-Qn3-D8DRuvDr.mjs} +6 -9
- package/dist/execute-log-PLs9-Qn3-D8DRuvDr.mjs.map +1 -0
- package/dist/{family-DEJvITUc-DHsvEGPB.d.mts → family-DB2Uf88c-DWEm0USb.d.mts} +71 -14
- package/dist/{family-DEJvITUc-DHsvEGPB.d.mts.map → family-DB2Uf88c-DWEm0USb.d.mts.map} +1 -1
- package/dist/family.d.mts +3 -13
- package/dist/family.d.mts.map +1 -1
- package/dist/family.mjs +55 -108
- package/dist/family.mjs.map +1 -1
- package/dist/generate-dev-stack-CPpjJdTG-W0N0YgsI.mjs +87 -0
- package/dist/generate-dev-stack-CPpjJdTG-W0N0YgsI.mjs.map +1 -0
- package/dist/{local-target-hoEGqgVA.mjs → local-target-B9cBl_6r.mjs} +3 -3
- package/dist/local-target-B9cBl_6r.mjs.map +1 -0
- package/dist/{local-target-BOGjATc2.mjs → local-target-P4-n1Ovh.mjs} +3 -3
- package/dist/local-target-P4-n1Ovh.mjs.map +1 -0
- package/dist/{pipeline-C7gNjMzJ-CMqZQxqM.mjs → pipeline-DAYhea3J-BEnHHWp8.mjs} +36 -261
- package/dist/{pipeline-C7gNjMzJ-CMqZQxqM.mjs.map → pipeline-DAYhea3J-BEnHHWp8.mjs.map} +1 -1
- package/dist/{pipeline-C7gNjMzJ-CixaMvnR.mjs → pipeline-DAYhea3J-uuBciVDS.mjs} +36 -262
- package/dist/{pipeline-C7gNjMzJ-CixaMvnR.mjs.map → pipeline-DAYhea3J-uuBciVDS.mjs.map} +1 -1
- package/dist/result-D9vIrN7i.mjs +432 -0
- package/dist/result-D9vIrN7i.mjs.map +1 -0
- package/dist/{result-B874OKwb.mjs → result-SF9LFOuR.mjs} +207 -129
- package/dist/result-SF9LFOuR.mjs.map +1 -0
- package/dist/{run-alchemy-pANK8XNX-BH1wC0r6.mjs → run-alchemy-pANK8XNX-CqXC1tbs.mjs} +2 -2
- package/dist/{run-alchemy-pANK8XNX-BH1wC0r6.mjs.map → run-alchemy-pANK8XNX-CqXC1tbs.mjs.map} +1 -1
- package/dist/{run-alchemy-pANK8XNX-XcCQncKN.mjs → run-alchemy-pANK8XNX-T_pHNDBo.mjs} +2 -2
- package/dist/{run-alchemy-pANK8XNX-XcCQncKN.mjs.map → run-alchemy-pANK8XNX-T_pHNDBo.mjs.map} +1 -1
- package/dist/shared-BAIiDgXa-DYP7EOSk.mjs +33 -0
- package/dist/shared-BAIiDgXa-DYP7EOSk.mjs.map +1 -0
- package/dist/testing.d.mts +16 -2
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +3 -2
- package/dist/testing.mjs.map +1 -1
- package/package.json +4 -5
- package/src/exports/testing.ts +3 -1
- package/dist/execute-deploy-destroy-Bdi-RiN5-BBrZ9a8c.mjs.map +0 -1
- package/dist/execute-deploy-destroy-Bdi-RiN5-T3tv5DHr.mjs.map +0 -1
- package/dist/execute-dev-BLCK5wF7-CuzMSK7T.mjs.map +0 -1
- package/dist/execute-log-B_zCJ17b-BrLUt7vo.mjs.map +0 -1
- package/dist/execute-log-B_zCJ17b-C4a0uxJj.mjs.map +0 -1
- package/dist/local-target-BOGjATc2.mjs.map +0 -1
- package/dist/local-target-hoEGqgVA.mjs.map +0 -1
- package/dist/result-B874OKwb.mjs.map +0 -1
- package/dist/result-sR7PBi61.mjs +0 -229
- package/dist/result-sR7PBi61.mjs.map +0 -1
- package/dist/shared-BTnATsqm-BH4axbJg.mjs +0 -158
- package/dist/shared-BTnATsqm-BH4axbJg.mjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as alchemyInvocation, r as spawnAlchemy } from "./run-alchemy-pANK8XNX-
|
|
4
|
-
import { n as runPipeline } from "./pipeline-
|
|
1
|
+
import { c as CliStructuredError, n as ok, o as noComposerExportMessage, r as okVoid, t as notOk, u as blindCast } from "./result-D9vIrN7i.mjs";
|
|
2
|
+
import { r as toStructured } from "./shared-BAIiDgXa-DYP7EOSk.mjs";
|
|
3
|
+
import { n as alchemyInvocation, r as spawnAlchemy } from "./run-alchemy-pANK8XNX-T_pHNDBo.mjs";
|
|
4
|
+
import { n as runPipeline } from "./pipeline-DAYhea3J-BEnHHWp8.mjs";
|
|
5
5
|
import { n as envVarSafeExtensionId, t as containerEnv } from "./container-transport-HcvNOGZL-CIoZc7Rs.mjs";
|
|
6
6
|
import * as fs from "node:fs";
|
|
7
7
|
import * as path from "node:path";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { spawnSync } from "node:child_process";
|
|
10
|
-
//#region ../../0-framework/3-tooling/cli/dist/generate-stack-
|
|
10
|
+
//#region ../../0-framework/3-tooling/cli/dist/generate-stack-DlooNx6k.mjs
|
|
11
11
|
/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */
|
|
12
12
|
const GENERATED_DIR = ".prisma-composer";
|
|
13
13
|
const GENERATED_FILE = "alchemy.run.ts";
|
|
@@ -35,7 +35,7 @@ function renderOptions(input) {
|
|
|
35
35
|
function renderStackFile(input) {
|
|
36
36
|
const generatedDir = path.join(input.cwd, GENERATED_DIR);
|
|
37
37
|
const appImport = relativeImportSpecifier(generatedDir, input.entryPath);
|
|
38
|
-
const configImport = relativeImportSpecifier(generatedDir, input.
|
|
38
|
+
const configImport = relativeImportSpecifier(generatedDir, input.configFile);
|
|
39
39
|
return `// Generated by \`prisma-composer deploy\`/\`prisma-composer destroy\` — overwritten on every
|
|
40
40
|
// run; do not edit by hand. Runnable from ${quote(input.cwd)} WITH the env the
|
|
41
41
|
// CLI passes its child (the PRISMA_COMPOSER_CONTAINER_*/_PREFLIGHT_* vars —
|
|
@@ -46,9 +46,14 @@ function renderStackFile(input) {
|
|
|
46
46
|
// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).
|
|
47
47
|
import { lower } from '@prisma/composer/deploy';
|
|
48
48
|
import * as report from '@prisma/composer/report';
|
|
49
|
-
import
|
|
49
|
+
import prismaConfig from ${quote(configImport)};
|
|
50
50
|
import app from ${quote(appImport)};
|
|
51
51
|
|
|
52
|
+
const config = prismaConfig.composer;
|
|
53
|
+
if (config === undefined) {
|
|
54
|
+
throw new Error(${quote(noComposerExportMessage(input.configFile))});
|
|
55
|
+
}
|
|
56
|
+
|
|
52
57
|
// The app's own @prisma/composer may predate the failure recorder.
|
|
53
58
|
report.captureEngineFailure?.();
|
|
54
59
|
|
|
@@ -192,7 +197,7 @@ function preflightEnv(payloads) {
|
|
|
192
197
|
return env;
|
|
193
198
|
}
|
|
194
199
|
//#endregion
|
|
195
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-
|
|
200
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-CF6DR7sA.mjs
|
|
196
201
|
/** A stage name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */
|
|
197
202
|
function validateStageName(stage) {
|
|
198
203
|
const result = spawnSync("git", ["check-ref-format", `refs/heads/${stage}`], { stdio: "ignore" });
|
|
@@ -215,6 +220,7 @@ function hasNoLocalDeployState(cwd) {
|
|
|
215
220
|
async function executeDeploy(input, deps, cwd) {
|
|
216
221
|
const outcome = await runStackPipeline("deploy", {
|
|
217
222
|
entry: input.entry,
|
|
223
|
+
config: input.config,
|
|
218
224
|
name: input.name,
|
|
219
225
|
stage: input.stage,
|
|
220
226
|
cwd,
|
|
@@ -237,6 +243,7 @@ async function executeDeploy(input, deps, cwd) {
|
|
|
237
243
|
async function executeDestroy(input, deps, cwd) {
|
|
238
244
|
const outcome = await runStackPipeline("destroy", {
|
|
239
245
|
entry: input.entry,
|
|
246
|
+
config: input.config,
|
|
240
247
|
name: input.name,
|
|
241
248
|
stage: input.target.kind === "stage" ? input.target.stage : void 0,
|
|
242
249
|
cwd,
|
|
@@ -358,7 +365,7 @@ async function runStackPipeline(action, opts) {
|
|
|
358
365
|
* write the stack file, run alchemy against it, then the destroy-only
|
|
359
366
|
* teardown/removal suffix. The value is only ever a summary for deploy. */
|
|
360
367
|
async function runStackPipelineInner(action, opts, reporters) {
|
|
361
|
-
const { entry, name, stage, cwd, onEvent, deps } = opts;
|
|
368
|
+
const { entry, config: composerConfig, name, stage, cwd, onEvent, deps } = opts;
|
|
362
369
|
if (stage !== void 0) try {
|
|
363
370
|
validateStageName(stage);
|
|
364
371
|
} catch (error) {
|
|
@@ -375,16 +382,13 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
375
382
|
const preflightPayloads = /* @__PURE__ */ new Map();
|
|
376
383
|
let preflightTransportEnv = {};
|
|
377
384
|
try {
|
|
378
|
-
pipeline = await runPipeline(entry, name, cwd, {
|
|
379
|
-
runAssembler: deps.runAssembler,
|
|
380
|
-
config: deps.config,
|
|
381
|
-
configPath: deps.configPath
|
|
382
|
-
}, action === "destroy" ? (error) => new CliStructuredError("DEPLOY.BUILD_REQUIRED", error.message, {
|
|
385
|
+
pipeline = await runPipeline(entry, name, cwd, composerConfig, { runAssembler: deps.runAssembler }, action === "destroy" ? (error) => new CliStructuredError("DEPLOY.BUILD_REQUIRED", error.message, {
|
|
383
386
|
why: "destroy evaluates the same stack program as deploy, which packages the built artifacts — so the app must be built first.",
|
|
384
387
|
fix: "Run the build, then retry the destroy.",
|
|
385
388
|
cause: error
|
|
386
389
|
}) : void 0);
|
|
387
|
-
const {
|
|
390
|
+
const { graph, name: resolvedName } = pipeline;
|
|
391
|
+
const config = pipeline.configSource.value;
|
|
388
392
|
if (action === "deploy") reporters.push(...await beginReporters(config.extensions, {
|
|
389
393
|
appName: resolvedName,
|
|
390
394
|
graph,
|
|
@@ -450,7 +454,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
450
454
|
stackPath = writeStackFile({
|
|
451
455
|
entryPath: pipeline.entryModule.path,
|
|
452
456
|
cwd,
|
|
453
|
-
|
|
457
|
+
configFile: pipeline.configSource.file,
|
|
454
458
|
name: pipeline.name,
|
|
455
459
|
assembled: pipeline.assembled
|
|
456
460
|
});
|
|
@@ -511,7 +515,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
511
515
|
}
|
|
512
516
|
try {
|
|
513
517
|
if (action === "destroy") {
|
|
514
|
-
for (const extension of pipeline.
|
|
518
|
+
for (const extension of pipeline.configSource.value.extensions) {
|
|
515
519
|
if (extension.teardown === void 0) continue;
|
|
516
520
|
try {
|
|
517
521
|
await extension.teardown({
|
|
@@ -522,7 +526,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
522
526
|
throw toStructured("DEPLOY.TEARDOWN_FAILED", error);
|
|
523
527
|
}
|
|
524
528
|
}
|
|
525
|
-
for (const extension of pipeline.
|
|
529
|
+
for (const extension of pipeline.configSource.value.extensions) {
|
|
526
530
|
if (extension.container === void 0) continue;
|
|
527
531
|
const instance = containers.get(extension.id);
|
|
528
532
|
if (instance === void 0) continue;
|
|
@@ -549,4 +553,4 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
549
553
|
//#endregion
|
|
550
554
|
export { executeDeploy, executeDestroy };
|
|
551
555
|
|
|
552
|
-
//# sourceMappingURL=execute-deploy-destroy-
|
|
556
|
+
//# sourceMappingURL=execute-deploy-destroy-CF6DR7sA-DGs5poBA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-deploy-destroy-CF6DR7sA-DGs5poBA.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/generate-stack-DlooNx6k.mjs","../../../0-framework/3-tooling/cli/dist/deployment-summary-BtvC7Z73.mjs","../../../0-framework/3-tooling/cli/dist/run-report-C2o98uD-.mjs","../../../0-framework/1-core/core/dist/config.mjs","../../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-CF6DR7sA.mjs"],"sourcesContent":["import { r as noComposerExportMessage } from \"./composer-config-CY9fET8H.mjs\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\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(\" 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 \\`prisma-composer deploy\\`/\\`prisma-composer destroy\\` — 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 —\n// without them lower() refuses because no container is resolved):\n//\n// alchemy deploy ${GENERATED_DIR}/${GENERATED_FILE}\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\nimport { lower } from '@prisma/composer/deploy';\nimport * as report from '@prisma/composer/report';\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\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\nexport { renderStackFile as n, writeStackFile as r, GENERATED_STACK_RELATIVE_PATH as t };\n\n//# sourceMappingURL=generate-stack-DlooNx6k.mjs.map","import * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { format, stripVTControlCharacters } from \"node:util\";\n//#region src/deployment-summary.ts\n/**\n* The deploy result's cross-process protocol, whole in one place: the\n* serializable shape, the env var that names the carrier file, the writer the\n* report hook calls from inside the alchemy child, and the reader the deploy\n* operation runs after the child exits. `DeploymentResult` itself cannot\n* cross the boundary — its `DeployedNode` entries hold live graph-node\n* references (ADR-0033) — so the writer projects it down to what CAN.\n*\n* The summary is best-effort by contract: the writer never fails the child\n* over it, and the reader maps absent or malformed to `undefined`. So is the\n* failure cause the child leaves beside it when it exits non-zero.\n*/\n/** Env var the deploy operation sets on the alchemy child: when present,\n* the report hook also writes the JSON DeploymentSummary there. */\nconst DEPLOYMENT_RESULT_FILE_ENV = \"PRISMA_COMPOSER_DEPLOYMENT_RESULT_FILE\";\n/** Pure projection: keeps app + each node's address/entities, drops the in-process `node`. */\nfunction toDeploymentSummary(result) {\n\treturn {\n\t\tapp: result.app,\n\t\tnodes: result.nodes.map((node) => ({\n\t\t\taddress: node.address,\n\t\t\tentities: node.entities\n\t\t}))\n\t};\n}\n/**\n* Writer half, called by the report hook inside the alchemy child: when the\n* env var names a file, write the summary there. Best-effort — a write\n* failure must not fail a deploy that already converged, so it is swallowed.\n*/\nfunction writeDeploymentSummaryFile(result) {\n\tconst file = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (file === void 0 || file.length === 0) return;\n\ttry {\n\t\tfs.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));\n\t} catch {}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Reader half, run by the deploy operation after the child exits. Absent or\n* malformed → undefined — the summary is best-effort, never a deploy failure.\n*/\nfunction readDeploymentSummary(resultFilePath) {\n\tlet raw;\n\ttry {\n\t\traw = fs.readFileSync(resultFilePath, \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isRecord(parsed) || typeof parsed[\"app\"] !== \"string\" || !Array.isArray(parsed[\"nodes\"])) return;\n\tfor (const node of parsed[\"nodes\"]) {\n\t\tif (!isRecord(node) || typeof node[\"address\"] !== \"string\" || !Array.isArray(node[\"entities\"])) return;\n\t\tfor (const entity of node[\"entities\"]) if (!isRecord(entity) || typeof entity[\"kind\"] !== \"string\" || typeof entity[\"id\"] !== \"string\") return;\n\t}\n\treturn blindCast(parsed);\n}\n/** The child's failure cause rides beside the result file, so the one env var names both and the parent's cleanup removes both. */\nfunction engineFailureFilePath(resultFilePath) {\n\treturn `${resultFilePath}.failure.txt`;\n}\n/** Fits the platform's 5000-character build `errorMessage` with room for the exit-status prefix. */\nconst ENGINE_FAILURE_CAUSE_LIMIT = 1e3;\n/**\n* Child half of the failure protocol, called by the generated stack file.\n* Keeps a bounded tail of everything this process logs through `console`,\n* passing every call through untouched, and on a non-zero exit writes the\n* redacted cause beside the result file. `console`, not the output streams:\n* alchemy's logger and its error reporting both go through it, and under Bun\n* `console` does not reach `process.stdout.write`.\n*/\nfunction captureEngineFailure() {\n\tconst resultFile = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (resultFile === void 0 || resultFile.length === 0) return;\n\tlet tail = \"\";\n\tfor (const method of [\n\t\t\"log\",\n\t\t\"info\",\n\t\t\"warn\",\n\t\t\"error\",\n\t\t\"debug\"\n\t]) {\n\t\tconst original = console[method];\n\t\tconsole[method] = (...args) => {\n\t\t\ttail = `${tail}${redactSecrets(format(...args), process.env)}\\n`.slice(-65536);\n\t\t\toriginal.apply(console, args);\n\t\t};\n\t}\n\tprocess.once(\"exit\", (code) => {\n\t\tif (code === 0) return;\n\t\tconst cause = engineFailureCause(tail, process.env);\n\t\tif (cause === void 0) return;\n\t\ttry {\n\t\t\tfs.writeFileSync(engineFailureFilePath(resultFile), cause);\n\t\t} catch {}\n\t});\n}\n/** Parent half: the cause the child recorded, or undefined when it recorded none. */\nfunction readEngineFailureCause(resultFilePath) {\n\ttry {\n\t\tconst cause = fs.readFileSync(engineFailureFilePath(resultFilePath), \"utf8\");\n\t\treturn cause.length > 0 ? cause : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/** Effect's pretty log prefix, e.g. `[10:29:16.556] INFO (#53): `. */\nconst LOG_PREFIX = /^\\[[\\d:.]+\\] ([A-Z]+) \\(#\\d+\\): ?/;\n/** Alchemy's per-resource failure row, e.g. `[web] fail — UnknownError: …`. */\nconst RESOURCE_FAIL_ROW = /^\\[[^\\]]+\\] fail\\b/;\nconst STACK_FRAME = /^\\s*at /;\n/**\n* The failure the output describes: every line from the first failure line\n* (a failed resource row, an ERROR log, or an `error:` line) to the end, minus\n* blank lines, stack frames and info logs; the last five lines when there is no\n* failure line. Redacted, then capped.\n*/\nfunction engineFailureCause(output, env) {\n\tconst lines = [];\n\tfor (const raw of stripVTControlCharacters(output).split(/\\r\\n|\\r|\\n/)) {\n\t\tconst clean = raw.replace(/(?![\\t])\\p{Cc}/gu, \"\").trimEnd();\n\t\tconst prefix = LOG_PREFIX.exec(clean);\n\t\tconst text = (prefix === null ? clean : clean.slice(prefix[0].length)).trim();\n\t\tif (text.length === 0 || text === \"{\" || text === \"}\" || STACK_FRAME.test(text)) continue;\n\t\tconst level = prefix?.[1];\n\t\tconst failure = level === \"ERROR\" || level === \"FATAL\" || RESOURCE_FAIL_ROW.test(text) || /^\\W*error:/i.test(text);\n\t\tlines.push({\n\t\t\ttext,\n\t\t\tfailure,\n\t\t\tinfo: !failure && level !== void 0\n\t\t});\n\t}\n\tconst start = lines.findIndex((line) => line.failure);\n\tconst kept = start === -1 ? lines.slice(-5) : lines.slice(start).filter((line) => !line.info);\n\tif (kept.length === 0) return void 0;\n\tconst cause = redactSecrets(kept.map((line) => line.text).join(\"\\n\"), env);\n\treturn cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;\n}\n/** Env var names whose values are credentials: the service token, preflight payloads, and the usual secret spellings. */\nconst SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$|^PRISMA_COMPOSER_PREFLIGHT_/i;\nconst REDACTED = \"[redacted]\";\n/**\n* Removes credentials from text that is about to leave the machine: the value\n* of every secret-named env var, bearer/basic tokens, JWTs, the password in a\n* URL, and `token=…`-style pairs. Values shorter than 8 characters are left,\n* so a one-letter placeholder does not blank every matching letter.\n*/\nfunction redactSecrets(text, env) {\n\tconst values = Object.entries(env).filter(([name, value]) => SECRET_ENV_NAME.test(name) && (value ?? \"\").length >= 8).map(([, value]) => value ?? \"\").sort((a, b) => b.length - a.length);\n\tlet redacted = text;\n\tfor (const value of values) redacted = redacted.replaceAll(value, REDACTED);\n\treturn redacted.replace(/\\b(Bearer|Basic)\\s+[\\w.~+/=-]+/gi, `$1 ${REDACTED}`).replace(/\\beyJ[\\w-]+\\.[\\w-]+\\.[\\w-]*/g, REDACTED).replace(/(\\b[a-z][\\w+.-]*:\\/\\/[^\\s:/@]*:)[^\\s/@]+@/gi, `$1${REDACTED}@`).replace(/\\b((?:[\\w-]*[_-])?(?:token|secret|password|passwd|api[_-]?key|access[_-]?key|private[_-]?key)[\"']?\\s*[:=]\\s*[\"']?)[^\\s\"',;&]+/gi, `$1${REDACTED}`);\n}\n//#endregion\nexport { readEngineFailureCause as a, readDeploymentSummary as i, captureEngineFailure as n, writeDeploymentSummaryFile as o, engineFailureFilePath as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-BtvC7Z73.mjs.map","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/run-report.ts\n/**\n* The run report: one deploy's outcome as JSON, for tools that consume a\n* deploy rather than watch one — the Prisma GitHub Action reads it to build a\n* pull-request comment carrying preview links.\n*\n* Deliberately separate from `deployment-summary.ts`. That file is a private\n* carrier between the alchemy child and this process, written to a\n* per-run path the parent deletes in a `finally` so resource ids and URLs do\n* not accumulate on disk. This one is written where the operator asked for\n* it, survives the run, is written on the failure path too, and carries a\n* version so a consumer can depend on its shape.\n*/\n/** Bump when a change would break a consumer that reads the current shape. */\nconst RUN_REPORT_VERSION = 1;\n/** Names the file to write the run report to, when `--report` is not passed. */\nconst RUN_REPORT_FILE_ENV = \"PRISMA_COMPOSER_REPORT_FILE\";\nfunction toRunReport(input) {\n\treturn {\n\t\tversion: 1,\n\t\toutcome: input.failure === void 0 ? \"succeeded\" : \"failed\",\n\t\tapp: input.summary?.app ?? null,\n\t\tstage: input.stage ?? null,\n\t\tnodes: input.summary?.nodes ?? [],\n\t\tfailure: input.failure ?? null\n\t};\n}\n/**\n* The path to write to: the `--report` flag first, then the env var. Relative\n* paths resolve against the deploy's cwd. `undefined` means no report was\n* asked for, which is the common case and writes nothing.\n*/\nfunction resolveRunReportPath(flag, env, cwd) {\n\tconst requested = flag !== void 0 && flag.length > 0 ? flag : env;\n\tif (requested === void 0 || requested.length === 0) return void 0;\n\treturn path.resolve(cwd, requested);\n}\n/**\n* Writes the report, creating the parent directory if needed. A write failure\n* warns and returns false rather than failing a deploy that already\n* converged — but it is never silent, because the operator asked for this\n* file and a consumer is waiting on it.\n*/\nfunction writeRunReport(filePath, report) {\n\ttry {\n\t\tfs.mkdirSync(path.dirname(filePath), { recursive: true });\n\t\tfs.writeFileSync(filePath, `${JSON.stringify(report, null, 2)}\\n`);\n\t\treturn true;\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not write the run report to ${filePath}: ${detail}`);\n\t\treturn false;\n\t}\n}\n//#endregion\nexport { writeRunReport as a, toRunReport as i, RUN_REPORT_VERSION as n, resolveRunReportPath as r, RUN_REPORT_FILE_ENV as t };\n\n//# sourceMappingURL=run-report-C2o98uD-.mjs.map","import { i as envVarSafeExtensionId, n as containerEnvVarName, r as deserializeContainers, t as containerEnv } from \"./container-transport-HcvNOGZL.mjs\";\nimport { n as defineConfig, r as isBuildOnlyExtension, t as DEV_DIR } from \"./app-config-CGJHcFb-.mjs\";\n//#region src/preflight-transport.ts\n/**\n* Carries an extension's deploy-preflight payload from the CLI process to the\n* alchemy child (which re-imports the config from scratch) — one env var per\n* extension, same channel as containers (container-transport.ts). The\n* framework never reads the contents. Payloads carry metadata only, never\n* secret values: the child's environment is not a secret store.\n*/\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PREFLIGHT_PRISMA_COMPOSER_PRISMA_CLOUD' */\nfunction preflightEnvVarName(extensionId) {\n\treturn `PRISMA_COMPOSER_PREFLIGHT_${envVarSafeExtensionId(extensionId)}`;\n}\n/** The env entries the CLI sets on the alchemy process: `{ [preflightEnvVarName(id)]: payload }` for every extension whose preflight returned one. */\nfunction preflightEnv(payloads) {\n\tconst env = {};\n\tconst ownerByVarName = /* @__PURE__ */ new Map();\n\tfor (const [extensionId, payload] of payloads) {\n\t\tif (payload.length === 0) continue;\n\t\tconst varName = preflightEnvVarName(extensionId);\n\t\tconst owner = ownerByVarName.get(varName);\n\t\tif (owner !== void 0) throw new Error(`Extension ids \"${owner}\" and \"${extensionId}\" both map to the preflight transport variable \"${varName}\" — rename one of the extensions.`);\n\t\townerByVarName.set(varName, extensionId);\n\t\tenv[varName] = payload;\n\t}\n\treturn env;\n}\n/** The alchemy-process side: the payload this extension's own preflight wrote, or `undefined` when it wrote none (or when nothing ran a preflight at all). */\nfunction readPreflightPayload(extensionId, env) {\n\tconst payload = env[preflightEnvVarName(extensionId)];\n\treturn payload === void 0 || payload.length === 0 ? void 0 : payload;\n}\n//#endregion\nexport { DEV_DIR, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, isBuildOnlyExtension, preflightEnv, preflightEnvVarName, readPreflightPayload };\n\n//# sourceMappingURL=config.mjs.map","import { r as toStructured } from \"./shared-BAIiDgXa.mjs\";\nimport { i as spawnAlchemy, n as alchemyInvocation } from \"./run-alchemy-pANK8XNX.mjs\";\nimport { r as writeStackFile, t as GENERATED_STACK_RELATIVE_PATH } from \"./generate-stack-DlooNx6k.mjs\";\nimport { a as readEngineFailureCause, i as readDeploymentSummary, r as engineFailureFilePath, t as DEPLOYMENT_RESULT_FILE_ENV } from \"./deployment-summary-BtvC7Z73.mjs\";\nimport { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from \"./run-report-C2o98uD-.mjs\";\nimport { n as runPipeline } from \"./pipeline-DAYhea3J.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\nimport { randomUUID } from \"node:crypto\";\nimport { containerEnv, preflightEnv, preflightEnvVarName } from \"@internal/core/config\";\nimport { spawnSync } from \"node:child_process\";\n//#region src/validate-stage.ts\n/** A stage name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */\nfunction validateStageName(stage) {\n\tconst result = spawnSync(\"git\", [\"check-ref-format\", `refs/heads/${stage}`], { stdio: \"ignore\" });\n\tif (result.error) throw new CliStructuredError(\"DEPLOY.STAGE_UNVALIDATABLE\", `git is required to validate --stage \"${stage}\" (git check-ref-format): ${result.error.message}.`, { cause: result.error });\n\tif (result.status !== 0) throw new CliStructuredError(\"DEPLOY.STAGE_INVALID\", `Invalid --stage \"${stage}\": must be a valid git ref name (git check-ref-format rejected \"refs/heads/${stage}\").`);\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}\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\tstage: input.stage,\n\t\tcwd,\n\t\tonEvent: void 0,\n\t\tdeps,\n\t\treportId: input.reportId\n\t});\n\tconst reportPath = resolveRunReportPath(input.reportPath, process.env[RUN_REPORT_FILE_ENV], cwd);\n\tif (reportPath !== void 0) writeRunReport(reportPath, toRunReport({\n\t\tsummary: outcome.ok ? outcome.value : void 0,\n\t\tstage: input.stage,\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}));\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\tstage: input.target.kind === \"stage\" ? input.target.stage : void 0,\n\t\tcwd,\n\t\tonEvent: input.onEvent,\n\t\tdeps,\n\t\treportId: void 0\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) {\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}: ${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) {\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}: ${detail}`);\n\t\t}\n\t}));\n}\n/** Every session's contribution to the alchemy child's environment, so reporting that happens inside the apply can find the run. */\nfunction reporterChildEnv(reporters) {\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}: ${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 (the engine settled a Ctrl-C) — reported as `cancelled`, never as `failed`. */\nfunction wasInterrupted(failure) {\n\treturn 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) {\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: ${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.\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\tawait finishReporters(reporters, {\n\t\t\tok: false,\n\t\t\tcancelled: false,\n\t\t\tcode: \"DEPLOY.UNEXPECTED\",\n\t\t\tmessage: error instanceof Error ? error.message : String(error)\n\t\t});\n\t\tthrow error;\n\t}\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});\n\treturn outcome;\n}\n/** The pipeline both actions share: validate, resolve containers, preflight,\n* write the stack file, run alchemy against it, then the destroy-only\n* teardown/removal suffix. The value is only ever a summary for deploy. */\nasync function runStackPipelineInner(action, opts, reporters) {\n\tconst { entry, config: composerConfig, name, stage, cwd, onEvent, deps } = opts;\n\tif (stage !== void 0) try {\n\t\tvalidateStageName(stage);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\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\tlet preflightTransportEnv = {};\n\ttry {\n\t\tpipeline = await runPipeline(entry, name, cwd, composerConfig, { runAssembler: deps.runAssembler }, 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\tconst { graph, name: resolvedName } = pipeline;\n\t\tconst config = pipeline.configSource.value;\n\t\tif (action === \"deploy\") reporters.push(...await beginReporters(config.extensions, {\n\t\t\tappName: resolvedName,\n\t\t\tgraph,\n\t\t\tstage,\n\t\t\tcwd,\n\t\t\treportId: opts.reportId,\n\t\t\tcredentials: deps.credentials\n\t\t}));\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\") containers.set(extension.id, await extension.container.ensure({\n\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\tstage\n\t\t\t\t}, deps.credentials));\n\t\t\t\telse {\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\tstage\n\t\t\t\t\t}, deps.credentials);\n\t\t\t\t\tif (instance === void 0) throw new CliStructuredError(\"DEPLOY.TARGET_NOT_FOUND\", `Nothing deployed for ${resolvedName}${stage !== void 0 ? `/${stage}` : \"\"}.`, { fix: \"Deploy it first.\" });\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);\n\t\tconst pinnedStage = containers.get(config.state.extension)?.alchemyStage ?? stage;\n\t\tif (pinnedStage === void 0) throw new CliStructuredError(\"DEPLOY.SCOPE_MISSING\", \"The configured deploy target supplied no deploy scope (its container defines no alchemyStage), so Alchemy has no stage to run under.\", { fix: action === \"deploy\" ? \"Pass --stage <name> to choose the deploy scope explicitly.\" : \"destroy --production needs a target whose container supplies the production deploy scope.\" });\n\t\talchemyStage = pinnedStage;\n\t\tif (action === \"deploy\") {\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\tstage,\n\t\t\t\t\t\tcredentials: deps.credentials\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\ttry {\n\t\t\t\tpreflightTransportEnv = preflightEnv(preflightPayloads);\n\t\t\t} catch (error) {\n\t\t\t\tthrow toStructured(\"DEPLOY.PREFLIGHT_FAILED\", error);\n\t\t\t}\n\t\t}\n\t\tfor (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\tlet stackPath;\n\tconst resultFilePath = path.join(cwd, \".prisma-composer\", `deployment-result-${String(process.pid)}-${randomUUID()}.json`);\n\ttry {\n\t\ttry {\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\tassembled: pipeline.assembled\n\t\t\t});\n\t\t} catch (error) {\n\t\t\treturn notOk(toStructured(\"DEPLOY.STACK_WRITE_FAILED\", error));\n\t\t}\n\t\tconst reproduceCommand = `alchemy ${action} ${GENERATED_STACK_RELATIVE_PATH} --yes --stage ${alchemyStage}`;\n\t\tlet outcome;\n\t\ttry {\n\t\t\toutcome = await (deps.alchemy ?? spawnAlchemy)(alchemyInvocation({\n\t\t\t\tcommand: action,\n\t\t\t\tstackFileRelativePath: GENERATED_STACK_RELATIVE_PATH,\n\t\t\t\tcwd,\n\t\t\t\tstage: alchemyStage,\n\t\t\t\tcontainerEnv: containerEnv(containers),\n\t\t\t\tpreflightEnv: preflightTransportEnv,\n\t\t\t\tenv: {\n\t\t\t\t\t...reporterChildEnv(reporters),\n\t\t\t\t\t[DEPLOYMENT_RESULT_FILE_ENV]: resultFilePath\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\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,\n\t\t\t\t\tcwd\n\t\t\t\t} }\n\t\t\t}));\n\t\t}\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,\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);\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,\n\t\t\t\t\tcwd\n\t\t\t\t}\n\t\t\t} }));\n\t\t}\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\tstage\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, deps.credentials);\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\tif (action === \"deploy\") return ok(readDeploymentSummary(resultFilePath));\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}\n}\n//#endregion\nexport { executeDeploy, executeDestroy };\n\n//# sourceMappingURL=execute-deploy-destroy-CF6DR7sA.mjs.map"],"mappings":";;;;;;;;;;;AAKA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;;AAEvB,SAAS,wBAAwB,cAAc,QAAQ;CACtD,MAAM,MAAM,KAAK,SAAS,cAAc,MAAM,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG;CACxE,OAAO,IAAI,WAAW,GAAG,IAAI,MAAM,KAAK;AACzC;AACA,SAAS,MAAM,OAAO;CACrB,OAAO,KAAK,UAAU,KAAK;AAC5B;AACA,SAAS,aAAa,QAAQ;CAC7B,OAAO,UAAU,MAAM,OAAO,GAAG,EAAE,WAAW,MAAM,OAAO,KAAK,EAAE;AACnE;AACA,SAAS,cAAc,OAAO;CAC7B,MAAM,QAAQ,CAAC;CACf,MAAM,KAAK,WAAW,MAAM,MAAM,IAAI,EAAE,EAAE;CAC1C,MAAM,KAAK,cAAc;CACzB,KAAK,MAAM,CAAC,IAAI,WAAW,OAAO,QAAQ,MAAM,UAAU,OAAO,GAAG,MAAM,KAAK,OAAO,MAAM,EAAE,EAAE,IAAI,aAAa,MAAM,EAAE,EAAE;CAC3H,MAAM,KAAK,MAAM;CACjB,MAAM,KAAK,oCAAoC;CAC/C,OAAO,MAAM,KAAK,IAAI;AACvB;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,eAAe,KAAK,KAAK,MAAM,KAAK,aAAa;CACvD,MAAM,YAAY,wBAAwB,cAAc,MAAM,SAAS;CACvE,MAAM,eAAe,wBAAwB,cAAc,MAAM,UAAU;CAC3E,OAAO;6CACqC,MAAM,MAAM,GAAG,EAAE;;;;sBAIxC,cAAc,GAAG,eAAe;;;;;2BAK3B,MAAM,YAAY,EAAE;kBAC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XNX-
|
|
3
|
-
import { n as runPipeline } from "./pipeline-
|
|
1
|
+
import { d as CliStructuredError, n as ok, o as noComposerExportMessage, p as blindCast, r as okVoid, t as notOk, u as toStructured } from "./result-SF9LFOuR.mjs";
|
|
2
|
+
import { n as alchemyInvocation, r as spawnAlchemy } from "./run-alchemy-pANK8XNX-CqXC1tbs.mjs";
|
|
3
|
+
import { n as runPipeline } from "./pipeline-DAYhea3J-uuBciVDS.mjs";
|
|
4
4
|
import { n as envVarSafeExtensionId, t as containerEnv } from "./container-transport-HcvNOGZL-CIoZc7Rs.mjs";
|
|
5
5
|
import * as fs from "node:fs";
|
|
6
6
|
import * as path from "node:path";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
import { spawnSync } from "node:child_process";
|
|
9
|
-
//#region ../../0-framework/3-tooling/cli/dist/generate-stack-
|
|
9
|
+
//#region ../../0-framework/3-tooling/cli/dist/generate-stack-DlooNx6k.mjs
|
|
10
10
|
/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */
|
|
11
11
|
const GENERATED_DIR = ".prisma-composer";
|
|
12
12
|
const GENERATED_FILE = "alchemy.run.ts";
|
|
@@ -34,7 +34,7 @@ function renderOptions(input) {
|
|
|
34
34
|
function renderStackFile(input) {
|
|
35
35
|
const generatedDir = path.join(input.cwd, GENERATED_DIR);
|
|
36
36
|
const appImport = relativeImportSpecifier(generatedDir, input.entryPath);
|
|
37
|
-
const configImport = relativeImportSpecifier(generatedDir, input.
|
|
37
|
+
const configImport = relativeImportSpecifier(generatedDir, input.configFile);
|
|
38
38
|
return `// Generated by \`prisma-composer deploy\`/\`prisma-composer destroy\` — overwritten on every
|
|
39
39
|
// run; do not edit by hand. Runnable from ${quote(input.cwd)} WITH the env the
|
|
40
40
|
// CLI passes its child (the PRISMA_COMPOSER_CONTAINER_*/_PREFLIGHT_* vars —
|
|
@@ -45,9 +45,14 @@ function renderStackFile(input) {
|
|
|
45
45
|
// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).
|
|
46
46
|
import { lower } from '@prisma/composer/deploy';
|
|
47
47
|
import * as report from '@prisma/composer/report';
|
|
48
|
-
import
|
|
48
|
+
import prismaConfig from ${quote(configImport)};
|
|
49
49
|
import app from ${quote(appImport)};
|
|
50
50
|
|
|
51
|
+
const config = prismaConfig.composer;
|
|
52
|
+
if (config === undefined) {
|
|
53
|
+
throw new Error(${quote(noComposerExportMessage(input.configFile))});
|
|
54
|
+
}
|
|
55
|
+
|
|
51
56
|
// The app's own @prisma/composer may predate the failure recorder.
|
|
52
57
|
report.captureEngineFailure?.();
|
|
53
58
|
|
|
@@ -191,7 +196,7 @@ function preflightEnv(payloads) {
|
|
|
191
196
|
return env;
|
|
192
197
|
}
|
|
193
198
|
//#endregion
|
|
194
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-
|
|
199
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-CF6DR7sA.mjs
|
|
195
200
|
/** A stage name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */
|
|
196
201
|
function validateStageName(stage) {
|
|
197
202
|
const result = spawnSync("git", ["check-ref-format", `refs/heads/${stage}`], { stdio: "ignore" });
|
|
@@ -214,6 +219,7 @@ function hasNoLocalDeployState(cwd) {
|
|
|
214
219
|
async function executeDeploy(input, deps, cwd) {
|
|
215
220
|
const outcome = await runStackPipeline("deploy", {
|
|
216
221
|
entry: input.entry,
|
|
222
|
+
config: input.config,
|
|
217
223
|
name: input.name,
|
|
218
224
|
stage: input.stage,
|
|
219
225
|
cwd,
|
|
@@ -236,6 +242,7 @@ async function executeDeploy(input, deps, cwd) {
|
|
|
236
242
|
async function executeDestroy(input, deps, cwd) {
|
|
237
243
|
const outcome = await runStackPipeline("destroy", {
|
|
238
244
|
entry: input.entry,
|
|
245
|
+
config: input.config,
|
|
239
246
|
name: input.name,
|
|
240
247
|
stage: input.target.kind === "stage" ? input.target.stage : void 0,
|
|
241
248
|
cwd,
|
|
@@ -357,7 +364,7 @@ async function runStackPipeline(action, opts) {
|
|
|
357
364
|
* write the stack file, run alchemy against it, then the destroy-only
|
|
358
365
|
* teardown/removal suffix. The value is only ever a summary for deploy. */
|
|
359
366
|
async function runStackPipelineInner(action, opts, reporters) {
|
|
360
|
-
const { entry, name, stage, cwd, onEvent, deps } = opts;
|
|
367
|
+
const { entry, config: composerConfig, name, stage, cwd, onEvent, deps } = opts;
|
|
361
368
|
if (stage !== void 0) try {
|
|
362
369
|
validateStageName(stage);
|
|
363
370
|
} catch (error) {
|
|
@@ -374,16 +381,13 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
374
381
|
const preflightPayloads = /* @__PURE__ */ new Map();
|
|
375
382
|
let preflightTransportEnv = {};
|
|
376
383
|
try {
|
|
377
|
-
pipeline = await runPipeline(entry, name, cwd, {
|
|
378
|
-
runAssembler: deps.runAssembler,
|
|
379
|
-
config: deps.config,
|
|
380
|
-
configPath: deps.configPath
|
|
381
|
-
}, action === "destroy" ? (error) => new CliStructuredError("DEPLOY.BUILD_REQUIRED", error.message, {
|
|
384
|
+
pipeline = await runPipeline(entry, name, cwd, composerConfig, { runAssembler: deps.runAssembler }, action === "destroy" ? (error) => new CliStructuredError("DEPLOY.BUILD_REQUIRED", error.message, {
|
|
382
385
|
why: "destroy evaluates the same stack program as deploy, which packages the built artifacts — so the app must be built first.",
|
|
383
386
|
fix: "Run the build, then retry the destroy.",
|
|
384
387
|
cause: error
|
|
385
388
|
}) : void 0);
|
|
386
|
-
const {
|
|
389
|
+
const { graph, name: resolvedName } = pipeline;
|
|
390
|
+
const config = pipeline.configSource.value;
|
|
387
391
|
if (action === "deploy") reporters.push(...await beginReporters(config.extensions, {
|
|
388
392
|
appName: resolvedName,
|
|
389
393
|
graph,
|
|
@@ -449,7 +453,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
449
453
|
stackPath = writeStackFile({
|
|
450
454
|
entryPath: pipeline.entryModule.path,
|
|
451
455
|
cwd,
|
|
452
|
-
|
|
456
|
+
configFile: pipeline.configSource.file,
|
|
453
457
|
name: pipeline.name,
|
|
454
458
|
assembled: pipeline.assembled
|
|
455
459
|
});
|
|
@@ -510,7 +514,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
510
514
|
}
|
|
511
515
|
try {
|
|
512
516
|
if (action === "destroy") {
|
|
513
|
-
for (const extension of pipeline.
|
|
517
|
+
for (const extension of pipeline.configSource.value.extensions) {
|
|
514
518
|
if (extension.teardown === void 0) continue;
|
|
515
519
|
try {
|
|
516
520
|
await extension.teardown({
|
|
@@ -521,7 +525,7 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
521
525
|
throw toStructured("DEPLOY.TEARDOWN_FAILED", error);
|
|
522
526
|
}
|
|
523
527
|
}
|
|
524
|
-
for (const extension of pipeline.
|
|
528
|
+
for (const extension of pipeline.configSource.value.extensions) {
|
|
525
529
|
if (extension.container === void 0) continue;
|
|
526
530
|
const instance = containers.get(extension.id);
|
|
527
531
|
if (instance === void 0) continue;
|
|
@@ -548,4 +552,4 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
548
552
|
//#endregion
|
|
549
553
|
export { executeDeploy, executeDestroy };
|
|
550
554
|
|
|
551
|
-
//# sourceMappingURL=execute-deploy-destroy-
|
|
555
|
+
//# sourceMappingURL=execute-deploy-destroy-CF6DR7sA-jdelm-y5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-deploy-destroy-CF6DR7sA-jdelm-y5.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/generate-stack-DlooNx6k.mjs","../../../0-framework/3-tooling/cli/dist/deployment-summary-BtvC7Z73.mjs","../../../0-framework/3-tooling/cli/dist/run-report-C2o98uD-.mjs","../../../0-framework/1-core/core/dist/config.mjs","../../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-CF6DR7sA.mjs"],"sourcesContent":["import { r as noComposerExportMessage } from \"./composer-config-CY9fET8H.mjs\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\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(\" 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 \\`prisma-composer deploy\\`/\\`prisma-composer destroy\\` — 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 —\n// without them lower() refuses because no container is resolved):\n//\n// alchemy deploy ${GENERATED_DIR}/${GENERATED_FILE}\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\nimport { lower } from '@prisma/composer/deploy';\nimport * as report from '@prisma/composer/report';\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\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\nexport { renderStackFile as n, writeStackFile as r, GENERATED_STACK_RELATIVE_PATH as t };\n\n//# sourceMappingURL=generate-stack-DlooNx6k.mjs.map","import * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { format, stripVTControlCharacters } from \"node:util\";\n//#region src/deployment-summary.ts\n/**\n* The deploy result's cross-process protocol, whole in one place: the\n* serializable shape, the env var that names the carrier file, the writer the\n* report hook calls from inside the alchemy child, and the reader the deploy\n* operation runs after the child exits. `DeploymentResult` itself cannot\n* cross the boundary — its `DeployedNode` entries hold live graph-node\n* references (ADR-0033) — so the writer projects it down to what CAN.\n*\n* The summary is best-effort by contract: the writer never fails the child\n* over it, and the reader maps absent or malformed to `undefined`. So is the\n* failure cause the child leaves beside it when it exits non-zero.\n*/\n/** Env var the deploy operation sets on the alchemy child: when present,\n* the report hook also writes the JSON DeploymentSummary there. */\nconst DEPLOYMENT_RESULT_FILE_ENV = \"PRISMA_COMPOSER_DEPLOYMENT_RESULT_FILE\";\n/** Pure projection: keeps app + each node's address/entities, drops the in-process `node`. */\nfunction toDeploymentSummary(result) {\n\treturn {\n\t\tapp: result.app,\n\t\tnodes: result.nodes.map((node) => ({\n\t\t\taddress: node.address,\n\t\t\tentities: node.entities\n\t\t}))\n\t};\n}\n/**\n* Writer half, called by the report hook inside the alchemy child: when the\n* env var names a file, write the summary there. Best-effort — a write\n* failure must not fail a deploy that already converged, so it is swallowed.\n*/\nfunction writeDeploymentSummaryFile(result) {\n\tconst file = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (file === void 0 || file.length === 0) return;\n\ttry {\n\t\tfs.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));\n\t} catch {}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Reader half, run by the deploy operation after the child exits. Absent or\n* malformed → undefined — the summary is best-effort, never a deploy failure.\n*/\nfunction readDeploymentSummary(resultFilePath) {\n\tlet raw;\n\ttry {\n\t\traw = fs.readFileSync(resultFilePath, \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isRecord(parsed) || typeof parsed[\"app\"] !== \"string\" || !Array.isArray(parsed[\"nodes\"])) return;\n\tfor (const node of parsed[\"nodes\"]) {\n\t\tif (!isRecord(node) || typeof node[\"address\"] !== \"string\" || !Array.isArray(node[\"entities\"])) return;\n\t\tfor (const entity of node[\"entities\"]) if (!isRecord(entity) || typeof entity[\"kind\"] !== \"string\" || typeof entity[\"id\"] !== \"string\") return;\n\t}\n\treturn blindCast(parsed);\n}\n/** The child's failure cause rides beside the result file, so the one env var names both and the parent's cleanup removes both. */\nfunction engineFailureFilePath(resultFilePath) {\n\treturn `${resultFilePath}.failure.txt`;\n}\n/** Fits the platform's 5000-character build `errorMessage` with room for the exit-status prefix. */\nconst ENGINE_FAILURE_CAUSE_LIMIT = 1e3;\n/**\n* Child half of the failure protocol, called by the generated stack file.\n* Keeps a bounded tail of everything this process logs through `console`,\n* passing every call through untouched, and on a non-zero exit writes the\n* redacted cause beside the result file. `console`, not the output streams:\n* alchemy's logger and its error reporting both go through it, and under Bun\n* `console` does not reach `process.stdout.write`.\n*/\nfunction captureEngineFailure() {\n\tconst resultFile = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (resultFile === void 0 || resultFile.length === 0) return;\n\tlet tail = \"\";\n\tfor (const method of [\n\t\t\"log\",\n\t\t\"info\",\n\t\t\"warn\",\n\t\t\"error\",\n\t\t\"debug\"\n\t]) {\n\t\tconst original = console[method];\n\t\tconsole[method] = (...args) => {\n\t\t\ttail = `${tail}${redactSecrets(format(...args), process.env)}\\n`.slice(-65536);\n\t\t\toriginal.apply(console, args);\n\t\t};\n\t}\n\tprocess.once(\"exit\", (code) => {\n\t\tif (code === 0) return;\n\t\tconst cause = engineFailureCause(tail, process.env);\n\t\tif (cause === void 0) return;\n\t\ttry {\n\t\t\tfs.writeFileSync(engineFailureFilePath(resultFile), cause);\n\t\t} catch {}\n\t});\n}\n/** Parent half: the cause the child recorded, or undefined when it recorded none. */\nfunction readEngineFailureCause(resultFilePath) {\n\ttry {\n\t\tconst cause = fs.readFileSync(engineFailureFilePath(resultFilePath), \"utf8\");\n\t\treturn cause.length > 0 ? cause : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/** Effect's pretty log prefix, e.g. `[10:29:16.556] INFO (#53): `. */\nconst LOG_PREFIX = /^\\[[\\d:.]+\\] ([A-Z]+) \\(#\\d+\\): ?/;\n/** Alchemy's per-resource failure row, e.g. `[web] fail — UnknownError: …`. */\nconst RESOURCE_FAIL_ROW = /^\\[[^\\]]+\\] fail\\b/;\nconst STACK_FRAME = /^\\s*at /;\n/**\n* The failure the output describes: every line from the first failure line\n* (a failed resource row, an ERROR log, or an `error:` line) to the end, minus\n* blank lines, stack frames and info logs; the last five lines when there is no\n* failure line. Redacted, then capped.\n*/\nfunction engineFailureCause(output, env) {\n\tconst lines = [];\n\tfor (const raw of stripVTControlCharacters(output).split(/\\r\\n|\\r|\\n/)) {\n\t\tconst clean = raw.replace(/(?![\\t])\\p{Cc}/gu, \"\").trimEnd();\n\t\tconst prefix = LOG_PREFIX.exec(clean);\n\t\tconst text = (prefix === null ? clean : clean.slice(prefix[0].length)).trim();\n\t\tif (text.length === 0 || text === \"{\" || text === \"}\" || STACK_FRAME.test(text)) continue;\n\t\tconst level = prefix?.[1];\n\t\tconst failure = level === \"ERROR\" || level === \"FATAL\" || RESOURCE_FAIL_ROW.test(text) || /^\\W*error:/i.test(text);\n\t\tlines.push({\n\t\t\ttext,\n\t\t\tfailure,\n\t\t\tinfo: !failure && level !== void 0\n\t\t});\n\t}\n\tconst start = lines.findIndex((line) => line.failure);\n\tconst kept = start === -1 ? lines.slice(-5) : lines.slice(start).filter((line) => !line.info);\n\tif (kept.length === 0) return void 0;\n\tconst cause = redactSecrets(kept.map((line) => line.text).join(\"\\n\"), env);\n\treturn cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;\n}\n/** Env var names whose values are credentials: the service token, preflight payloads, and the usual secret spellings. */\nconst SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$|^PRISMA_COMPOSER_PREFLIGHT_/i;\nconst REDACTED = \"[redacted]\";\n/**\n* Removes credentials from text that is about to leave the machine: the value\n* of every secret-named env var, bearer/basic tokens, JWTs, the password in a\n* URL, and `token=…`-style pairs. Values shorter than 8 characters are left,\n* so a one-letter placeholder does not blank every matching letter.\n*/\nfunction redactSecrets(text, env) {\n\tconst values = Object.entries(env).filter(([name, value]) => SECRET_ENV_NAME.test(name) && (value ?? \"\").length >= 8).map(([, value]) => value ?? \"\").sort((a, b) => b.length - a.length);\n\tlet redacted = text;\n\tfor (const value of values) redacted = redacted.replaceAll(value, REDACTED);\n\treturn redacted.replace(/\\b(Bearer|Basic)\\s+[\\w.~+/=-]+/gi, `$1 ${REDACTED}`).replace(/\\beyJ[\\w-]+\\.[\\w-]+\\.[\\w-]*/g, REDACTED).replace(/(\\b[a-z][\\w+.-]*:\\/\\/[^\\s:/@]*:)[^\\s/@]+@/gi, `$1${REDACTED}@`).replace(/\\b((?:[\\w-]*[_-])?(?:token|secret|password|passwd|api[_-]?key|access[_-]?key|private[_-]?key)[\"']?\\s*[:=]\\s*[\"']?)[^\\s\"',;&]+/gi, `$1${REDACTED}`);\n}\n//#endregion\nexport { readEngineFailureCause as a, readDeploymentSummary as i, captureEngineFailure as n, writeDeploymentSummaryFile as o, engineFailureFilePath as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-BtvC7Z73.mjs.map","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/run-report.ts\n/**\n* The run report: one deploy's outcome as JSON, for tools that consume a\n* deploy rather than watch one — the Prisma GitHub Action reads it to build a\n* pull-request comment carrying preview links.\n*\n* Deliberately separate from `deployment-summary.ts`. That file is a private\n* carrier between the alchemy child and this process, written to a\n* per-run path the parent deletes in a `finally` so resource ids and URLs do\n* not accumulate on disk. This one is written where the operator asked for\n* it, survives the run, is written on the failure path too, and carries a\n* version so a consumer can depend on its shape.\n*/\n/** Bump when a change would break a consumer that reads the current shape. */\nconst RUN_REPORT_VERSION = 1;\n/** Names the file to write the run report to, when `--report` is not passed. */\nconst RUN_REPORT_FILE_ENV = \"PRISMA_COMPOSER_REPORT_FILE\";\nfunction toRunReport(input) {\n\treturn {\n\t\tversion: 1,\n\t\toutcome: input.failure === void 0 ? \"succeeded\" : \"failed\",\n\t\tapp: input.summary?.app ?? null,\n\t\tstage: input.stage ?? null,\n\t\tnodes: input.summary?.nodes ?? [],\n\t\tfailure: input.failure ?? null\n\t};\n}\n/**\n* The path to write to: the `--report` flag first, then the env var. Relative\n* paths resolve against the deploy's cwd. `undefined` means no report was\n* asked for, which is the common case and writes nothing.\n*/\nfunction resolveRunReportPath(flag, env, cwd) {\n\tconst requested = flag !== void 0 && flag.length > 0 ? flag : env;\n\tif (requested === void 0 || requested.length === 0) return void 0;\n\treturn path.resolve(cwd, requested);\n}\n/**\n* Writes the report, creating the parent directory if needed. A write failure\n* warns and returns false rather than failing a deploy that already\n* converged — but it is never silent, because the operator asked for this\n* file and a consumer is waiting on it.\n*/\nfunction writeRunReport(filePath, report) {\n\ttry {\n\t\tfs.mkdirSync(path.dirname(filePath), { recursive: true });\n\t\tfs.writeFileSync(filePath, `${JSON.stringify(report, null, 2)}\\n`);\n\t\treturn true;\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not write the run report to ${filePath}: ${detail}`);\n\t\treturn false;\n\t}\n}\n//#endregion\nexport { writeRunReport as a, toRunReport as i, RUN_REPORT_VERSION as n, resolveRunReportPath as r, RUN_REPORT_FILE_ENV as t };\n\n//# sourceMappingURL=run-report-C2o98uD-.mjs.map","import { i as envVarSafeExtensionId, n as containerEnvVarName, r as deserializeContainers, t as containerEnv } from \"./container-transport-HcvNOGZL.mjs\";\nimport { n as defineConfig, r as isBuildOnlyExtension, t as DEV_DIR } from \"./app-config-CGJHcFb-.mjs\";\n//#region src/preflight-transport.ts\n/**\n* Carries an extension's deploy-preflight payload from the CLI process to the\n* alchemy child (which re-imports the config from scratch) — one env var per\n* extension, same channel as containers (container-transport.ts). The\n* framework never reads the contents. Payloads carry metadata only, never\n* secret values: the child's environment is not a secret store.\n*/\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PREFLIGHT_PRISMA_COMPOSER_PRISMA_CLOUD' */\nfunction preflightEnvVarName(extensionId) {\n\treturn `PRISMA_COMPOSER_PREFLIGHT_${envVarSafeExtensionId(extensionId)}`;\n}\n/** The env entries the CLI sets on the alchemy process: `{ [preflightEnvVarName(id)]: payload }` for every extension whose preflight returned one. */\nfunction preflightEnv(payloads) {\n\tconst env = {};\n\tconst ownerByVarName = /* @__PURE__ */ new Map();\n\tfor (const [extensionId, payload] of payloads) {\n\t\tif (payload.length === 0) continue;\n\t\tconst varName = preflightEnvVarName(extensionId);\n\t\tconst owner = ownerByVarName.get(varName);\n\t\tif (owner !== void 0) throw new Error(`Extension ids \"${owner}\" and \"${extensionId}\" both map to the preflight transport variable \"${varName}\" — rename one of the extensions.`);\n\t\townerByVarName.set(varName, extensionId);\n\t\tenv[varName] = payload;\n\t}\n\treturn env;\n}\n/** The alchemy-process side: the payload this extension's own preflight wrote, or `undefined` when it wrote none (or when nothing ran a preflight at all). */\nfunction readPreflightPayload(extensionId, env) {\n\tconst payload = env[preflightEnvVarName(extensionId)];\n\treturn payload === void 0 || payload.length === 0 ? void 0 : payload;\n}\n//#endregion\nexport { DEV_DIR, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, isBuildOnlyExtension, preflightEnv, preflightEnvVarName, readPreflightPayload };\n\n//# sourceMappingURL=config.mjs.map","import { r as toStructured } from \"./shared-BAIiDgXa.mjs\";\nimport { i as spawnAlchemy, n as alchemyInvocation } from \"./run-alchemy-pANK8XNX.mjs\";\nimport { r as writeStackFile, t as GENERATED_STACK_RELATIVE_PATH } from \"./generate-stack-DlooNx6k.mjs\";\nimport { a as readEngineFailureCause, i as readDeploymentSummary, r as engineFailureFilePath, t as DEPLOYMENT_RESULT_FILE_ENV } from \"./deployment-summary-BtvC7Z73.mjs\";\nimport { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from \"./run-report-C2o98uD-.mjs\";\nimport { n as runPipeline } from \"./pipeline-DAYhea3J.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\nimport { randomUUID } from \"node:crypto\";\nimport { containerEnv, preflightEnv, preflightEnvVarName } from \"@internal/core/config\";\nimport { spawnSync } from \"node:child_process\";\n//#region src/validate-stage.ts\n/** A stage name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */\nfunction validateStageName(stage) {\n\tconst result = spawnSync(\"git\", [\"check-ref-format\", `refs/heads/${stage}`], { stdio: \"ignore\" });\n\tif (result.error) throw new CliStructuredError(\"DEPLOY.STAGE_UNVALIDATABLE\", `git is required to validate --stage \"${stage}\" (git check-ref-format): ${result.error.message}.`, { cause: result.error });\n\tif (result.status !== 0) throw new CliStructuredError(\"DEPLOY.STAGE_INVALID\", `Invalid --stage \"${stage}\": must be a valid git ref name (git check-ref-format rejected \"refs/heads/${stage}\").`);\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}\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\tstage: input.stage,\n\t\tcwd,\n\t\tonEvent: void 0,\n\t\tdeps,\n\t\treportId: input.reportId\n\t});\n\tconst reportPath = resolveRunReportPath(input.reportPath, process.env[RUN_REPORT_FILE_ENV], cwd);\n\tif (reportPath !== void 0) writeRunReport(reportPath, toRunReport({\n\t\tsummary: outcome.ok ? outcome.value : void 0,\n\t\tstage: input.stage,\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}));\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\tstage: input.target.kind === \"stage\" ? input.target.stage : void 0,\n\t\tcwd,\n\t\tonEvent: input.onEvent,\n\t\tdeps,\n\t\treportId: void 0\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) {\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}: ${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) {\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}: ${detail}`);\n\t\t}\n\t}));\n}\n/** Every session's contribution to the alchemy child's environment, so reporting that happens inside the apply can find the run. */\nfunction reporterChildEnv(reporters) {\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}: ${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 (the engine settled a Ctrl-C) — reported as `cancelled`, never as `failed`. */\nfunction wasInterrupted(failure) {\n\treturn 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) {\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: ${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.\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\tawait finishReporters(reporters, {\n\t\t\tok: false,\n\t\t\tcancelled: false,\n\t\t\tcode: \"DEPLOY.UNEXPECTED\",\n\t\t\tmessage: error instanceof Error ? error.message : String(error)\n\t\t});\n\t\tthrow error;\n\t}\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});\n\treturn outcome;\n}\n/** The pipeline both actions share: validate, resolve containers, preflight,\n* write the stack file, run alchemy against it, then the destroy-only\n* teardown/removal suffix. The value is only ever a summary for deploy. */\nasync function runStackPipelineInner(action, opts, reporters) {\n\tconst { entry, config: composerConfig, name, stage, cwd, onEvent, deps } = opts;\n\tif (stage !== void 0) try {\n\t\tvalidateStageName(stage);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\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\tlet preflightTransportEnv = {};\n\ttry {\n\t\tpipeline = await runPipeline(entry, name, cwd, composerConfig, { runAssembler: deps.runAssembler }, 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\tconst { graph, name: resolvedName } = pipeline;\n\t\tconst config = pipeline.configSource.value;\n\t\tif (action === \"deploy\") reporters.push(...await beginReporters(config.extensions, {\n\t\t\tappName: resolvedName,\n\t\t\tgraph,\n\t\t\tstage,\n\t\t\tcwd,\n\t\t\treportId: opts.reportId,\n\t\t\tcredentials: deps.credentials\n\t\t}));\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\") containers.set(extension.id, await extension.container.ensure({\n\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\tstage\n\t\t\t\t}, deps.credentials));\n\t\t\t\telse {\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\tstage\n\t\t\t\t\t}, deps.credentials);\n\t\t\t\t\tif (instance === void 0) throw new CliStructuredError(\"DEPLOY.TARGET_NOT_FOUND\", `Nothing deployed for ${resolvedName}${stage !== void 0 ? `/${stage}` : \"\"}.`, { fix: \"Deploy it first.\" });\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);\n\t\tconst pinnedStage = containers.get(config.state.extension)?.alchemyStage ?? stage;\n\t\tif (pinnedStage === void 0) throw new CliStructuredError(\"DEPLOY.SCOPE_MISSING\", \"The configured deploy target supplied no deploy scope (its container defines no alchemyStage), so Alchemy has no stage to run under.\", { fix: action === \"deploy\" ? \"Pass --stage <name> to choose the deploy scope explicitly.\" : \"destroy --production needs a target whose container supplies the production deploy scope.\" });\n\t\talchemyStage = pinnedStage;\n\t\tif (action === \"deploy\") {\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\tstage,\n\t\t\t\t\t\tcredentials: deps.credentials\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\ttry {\n\t\t\t\tpreflightTransportEnv = preflightEnv(preflightPayloads);\n\t\t\t} catch (error) {\n\t\t\t\tthrow toStructured(\"DEPLOY.PREFLIGHT_FAILED\", error);\n\t\t\t}\n\t\t}\n\t\tfor (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\tlet stackPath;\n\tconst resultFilePath = path.join(cwd, \".prisma-composer\", `deployment-result-${String(process.pid)}-${randomUUID()}.json`);\n\ttry {\n\t\ttry {\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\tassembled: pipeline.assembled\n\t\t\t});\n\t\t} catch (error) {\n\t\t\treturn notOk(toStructured(\"DEPLOY.STACK_WRITE_FAILED\", error));\n\t\t}\n\t\tconst reproduceCommand = `alchemy ${action} ${GENERATED_STACK_RELATIVE_PATH} --yes --stage ${alchemyStage}`;\n\t\tlet outcome;\n\t\ttry {\n\t\t\toutcome = await (deps.alchemy ?? spawnAlchemy)(alchemyInvocation({\n\t\t\t\tcommand: action,\n\t\t\t\tstackFileRelativePath: GENERATED_STACK_RELATIVE_PATH,\n\t\t\t\tcwd,\n\t\t\t\tstage: alchemyStage,\n\t\t\t\tcontainerEnv: containerEnv(containers),\n\t\t\t\tpreflightEnv: preflightTransportEnv,\n\t\t\t\tenv: {\n\t\t\t\t\t...reporterChildEnv(reporters),\n\t\t\t\t\t[DEPLOYMENT_RESULT_FILE_ENV]: resultFilePath\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\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,\n\t\t\t\t\tcwd\n\t\t\t\t} }\n\t\t\t}));\n\t\t}\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,\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);\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,\n\t\t\t\t\tcwd\n\t\t\t\t}\n\t\t\t} }));\n\t\t}\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\tstage\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, deps.credentials);\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\tif (action === \"deploy\") return ok(readDeploymentSummary(resultFilePath));\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}\n}\n//#endregion\nexport { executeDeploy, executeDestroy };\n\n//# sourceMappingURL=execute-deploy-destroy-CF6DR7sA.mjs.map"],"mappings":";;;;;;;;;;AAKA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;;AAEvB,SAAS,wBAAwB,cAAc,QAAQ;CACtD,MAAM,MAAM,KAAK,SAAS,cAAc,MAAM,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG;CACxE,OAAO,IAAI,WAAW,GAAG,IAAI,MAAM,KAAK;AACzC;AACA,SAAS,MAAM,OAAO;CACrB,OAAO,KAAK,UAAU,KAAK;AAC5B;AACA,SAAS,aAAa,QAAQ;CAC7B,OAAO,UAAU,MAAM,OAAO,GAAG,EAAE,WAAW,MAAM,OAAO,KAAK,EAAE;AACnE;AACA,SAAS,cAAc,OAAO;CAC7B,MAAM,QAAQ,CAAC;CACf,MAAM,KAAK,WAAW,MAAM,MAAM,IAAI,EAAE,EAAE;CAC1C,MAAM,KAAK,cAAc;CACzB,KAAK,MAAM,CAAC,IAAI,WAAW,OAAO,QAAQ,MAAM,UAAU,OAAO,GAAG,MAA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