@prisma/composer-cli 0.15.0 → 0.16.0-dev.1
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 +28 -10
- package/dist/bin.mjs.map +1 -1
- package/dist/{execute-deploy-destroy-Bsdh8hf4-BVXNSBmy.mjs → execute-deploy-destroy-5sr2Z9oW-C7fFHLH7.mjs} +5 -5
- package/dist/{execute-deploy-destroy-Bsdh8hf4-BVXNSBmy.mjs.map → execute-deploy-destroy-5sr2Z9oW-C7fFHLH7.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-Bsdh8hf4-CZVPrQtx.mjs → execute-deploy-destroy-5sr2Z9oW-x0IufboB.mjs} +6 -6
- package/dist/{execute-deploy-destroy-Bsdh8hf4-CZVPrQtx.mjs.map → execute-deploy-destroy-5sr2Z9oW-x0IufboB.mjs.map} +1 -1
- package/dist/{execute-dev-CQ0Lo2eN-DxMcOjxh.mjs → execute-dev-B8CNl38E-CeibTOFD.mjs} +7 -7
- package/dist/{execute-dev-CQ0Lo2eN-DxMcOjxh.mjs.map → execute-dev-B8CNl38E-CeibTOFD.mjs.map} +1 -1
- package/dist/{execute-dev-CQ0Lo2eN-WebHkuDn.mjs → execute-dev-B8CNl38E-DYxJchU7.mjs} +6 -6
- package/dist/{execute-dev-CQ0Lo2eN-WebHkuDn.mjs.map → execute-dev-B8CNl38E-DYxJchU7.mjs.map} +1 -1
- package/dist/{execute-log-CUzTOzSj-BndClj6B.mjs → execute-log-BHrslCk8-BgbLqNUm.mjs} +6 -6
- package/dist/{execute-log-CUzTOzSj-BndClj6B.mjs.map → execute-log-BHrslCk8-BgbLqNUm.mjs.map} +1 -1
- package/dist/{execute-log-CUzTOzSj-DPxnEKA2.mjs → execute-log-BHrslCk8-CVBBPbon.mjs} +5 -5
- package/dist/{execute-log-CUzTOzSj-DPxnEKA2.mjs.map → execute-log-BHrslCk8-CVBBPbon.mjs.map} +1 -1
- package/dist/family.mjs +28 -10
- package/dist/family.mjs.map +1 -1
- package/dist/{local-target-H0IWu_FM.mjs → local-target-D6-LxNqW.mjs} +2 -2
- package/dist/{local-target-CBZyaBy0.mjs.map → local-target-D6-LxNqW.mjs.map} +1 -1
- package/dist/{local-target-CBZyaBy0.mjs → local-target-s1j_ZEu2.mjs} +2 -2
- package/dist/{local-target-H0IWu_FM.mjs.map → local-target-s1j_ZEu2.mjs.map} +1 -1
- package/dist/{pipeline-Bt8QocRh-B_yOh-0h.mjs → pipeline-DF-cm6XS-smwFmkzQ.mjs} +4 -4
- package/dist/{pipeline-Bt8QocRh-BGjwJqNH.mjs.map → pipeline-DF-cm6XS-smwFmkzQ.mjs.map} +1 -1
- package/dist/{pipeline-Bt8QocRh-BGjwJqNH.mjs → pipeline-DF-cm6XS-wJcVPq8c.mjs} +5 -5
- package/dist/{pipeline-Bt8QocRh-B_yOh-0h.mjs.map → pipeline-DF-cm6XS-wJcVPq8c.mjs.map} +1 -1
- package/dist/{result-B4XjxVK6.mjs → result-8JIfIz1C.mjs} +3 -3
- package/dist/result-8JIfIz1C.mjs.map +1 -0
- package/dist/{result-D4d-xy4I.mjs → result-CD_-UW1W.mjs} +3 -3
- package/dist/result-CD_-UW1W.mjs.map +1 -0
- package/dist/{run-alchemy--ZIvgqyU-Cub4-pDf.mjs → run-alchemy--ZIvgqyU-DjOPkNk-.mjs} +2 -2
- package/dist/{run-alchemy--ZIvgqyU-Cub4-pDf.mjs.map → run-alchemy--ZIvgqyU-DjOPkNk-.mjs.map} +1 -1
- package/dist/{run-alchemy--ZIvgqyU-DWvpeRrI.mjs → run-alchemy--ZIvgqyU-DrF25ZOK.mjs} +2 -2
- package/dist/{run-alchemy--ZIvgqyU-DWvpeRrI.mjs.map → run-alchemy--ZIvgqyU-DrF25ZOK.mjs.map} +1 -1
- package/dist/{shared-BTnATsqm-CDCqKwCF.mjs → shared-BTnATsqm-B_UZdb6_.mjs} +2 -2
- package/dist/{shared-BTnATsqm-CDCqKwCF.mjs.map → shared-BTnATsqm-B_UZdb6_.mjs.map} +1 -1
- package/dist/testing.mjs +1 -1
- package/package.json +4 -4
- package/dist/result-B4XjxVK6.mjs.map +0 -1
- package/dist/result-D4d-xy4I.mjs.map +0 -1
package/dist/bin.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as executionDiagnostics, l as DOCS_BASE, o as executorLoadFailure, t as notOk$1 } from "./result-
|
|
3
|
-
import { t as alchemyCommandLine } from "./run-alchemy--ZIvgqyU-
|
|
2
|
+
import { a as executionDiagnostics, l as DOCS_BASE, o as executorLoadFailure, t as notOk$1 } from "./result-8JIfIz1C.mjs";
|
|
3
|
+
import { t as alchemyCommandLine } from "./run-alchemy--ZIvgqyU-DjOPkNk-.mjs";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import * as path from "node:path";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import { EnvironmentCredentialManager, createCli, defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, loadConfig, positional } from "@prisma/cli-engine";
|
|
8
8
|
import { CliStructuredError, notOk, ok } from "@prisma/cli-engine/protocol";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
|
-
//#region ../../0-framework/3-tooling/cli/dist/log-
|
|
10
|
+
//#region ../../0-framework/3-tooling/cli/dist/log-9MtF1k6l.mjs
|
|
11
11
|
/** In-package variant threading the injection seam (the CLI's RunDeps, unit
|
|
12
12
|
* tests). Deliberately NOT re-exported through `./control` — the seam mirrors
|
|
13
13
|
* internal types and is not part of the published surface. */
|
|
@@ -15,7 +15,7 @@ async function deployWithDeps(input, deps) {
|
|
|
15
15
|
const cwd = input.cwd ?? process.cwd();
|
|
16
16
|
let executor;
|
|
17
17
|
try {
|
|
18
|
-
executor = await import("./execute-deploy-destroy-
|
|
18
|
+
executor = await import("./execute-deploy-destroy-5sr2Z9oW-C7fFHLH7.mjs");
|
|
19
19
|
} catch (error) {
|
|
20
20
|
return notOk$1(executorLoadFailure("deploy", error, cwd));
|
|
21
21
|
}
|
|
@@ -28,7 +28,7 @@ async function destroyWithDeps(input, deps) {
|
|
|
28
28
|
const cwd = input.cwd ?? process.cwd();
|
|
29
29
|
let executor;
|
|
30
30
|
try {
|
|
31
|
-
executor = await import("./execute-deploy-destroy-
|
|
31
|
+
executor = await import("./execute-deploy-destroy-5sr2Z9oW-C7fFHLH7.mjs");
|
|
32
32
|
} catch (error) {
|
|
33
33
|
return notOk$1(executorLoadFailure("destroy", error, cwd));
|
|
34
34
|
}
|
|
@@ -41,7 +41,7 @@ async function devWithDeps(input, deps) {
|
|
|
41
41
|
const cwd = input.cwd ?? process.cwd();
|
|
42
42
|
let executor;
|
|
43
43
|
try {
|
|
44
|
-
executor = await import("./execute-dev-
|
|
44
|
+
executor = await import("./execute-dev-B8CNl38E-DYxJchU7.mjs");
|
|
45
45
|
} catch (error) {
|
|
46
46
|
return notOk$1(executorLoadFailure("dev", error, cwd));
|
|
47
47
|
}
|
|
@@ -54,14 +54,14 @@ async function logWithDeps(input, deps) {
|
|
|
54
54
|
const cwd = input.cwd ?? process.cwd();
|
|
55
55
|
let executor;
|
|
56
56
|
try {
|
|
57
|
-
executor = await import("./execute-log-
|
|
57
|
+
executor = await import("./execute-log-BHrslCk8-CVBBPbon.mjs");
|
|
58
58
|
} catch (error) {
|
|
59
59
|
return notOk$1(executorLoadFailure("log", error, cwd));
|
|
60
60
|
}
|
|
61
61
|
return executor.executeLog(input, deps, cwd);
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
|
-
//#region ../../0-framework/3-tooling/cli/dist/engine-cli-
|
|
64
|
+
//#region ../../0-framework/3-tooling/cli/dist/engine-cli-X_xrCar3.mjs
|
|
65
65
|
/**
|
|
66
66
|
* The family boundary's error translation.
|
|
67
67
|
*
|
|
@@ -913,13 +913,31 @@ function mountedTree(family, operations) {
|
|
|
913
913
|
log: createLogCommand(operations)
|
|
914
914
|
};
|
|
915
915
|
}
|
|
916
|
+
/**
|
|
917
|
+
* The ORM's slice of prisma.config.ts, declared so a config shared with the
|
|
918
|
+
* unified `prisma` CLI loads here: the engine rejects any top-level key no
|
|
919
|
+
* mounted family declares, and this bin does not mount the ORM family. The
|
|
920
|
+
* value passes through unvalidated — the ORM CLI owns its section's shape,
|
|
921
|
+
* and no composer command reads it.
|
|
922
|
+
*/
|
|
923
|
+
const foreignOrmSectionFamily = defineCommandFamily({
|
|
924
|
+
configSection: defineConfigSection({
|
|
925
|
+
name: "orm",
|
|
926
|
+
validate: (raw) => ({
|
|
927
|
+
ok: true,
|
|
928
|
+
value: raw,
|
|
929
|
+
diagnostics: []
|
|
930
|
+
})
|
|
931
|
+
}),
|
|
932
|
+
commands: {}
|
|
933
|
+
});
|
|
916
934
|
function createComposerCli(spec) {
|
|
917
935
|
const operations = spec.operations ?? realOperations;
|
|
918
936
|
const family = createComposerFamily({ operations });
|
|
919
937
|
return createCli({
|
|
920
938
|
name: BINARY_NAME,
|
|
921
939
|
version: spec.version,
|
|
922
|
-
commandFamilies: [family],
|
|
940
|
+
commandFamilies: [family, foreignOrmSectionFamily],
|
|
923
941
|
groups: {},
|
|
924
942
|
commands: mountedTree(family, operations)
|
|
925
943
|
});
|
|
@@ -940,7 +958,7 @@ function runComposerCli(argv, host, spec, hooks) {
|
|
|
940
958
|
return createComposerCli(spec).run(argv, runtime, hooks);
|
|
941
959
|
}
|
|
942
960
|
//#endregion
|
|
943
|
-
//#region ../../0-framework/3-tooling/cli/dist/cli-
|
|
961
|
+
//#region ../../0-framework/3-tooling/cli/dist/cli-CZ2ENVcY.mjs
|
|
944
962
|
/**
|
|
945
963
|
* The `prisma-composer` entrypoint: adapt this process into the engine's
|
|
946
964
|
* `HostProcess`, run one invocation of composer's own CLI, and hand back an
|
package/dist/bin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.mjs","names":["notOk","CliStructuredError$1"],"sources":["../../../0-framework/3-tooling/cli/dist/log-E_5UMZl8.mjs","../../../0-framework/3-tooling/cli/dist/engine-cli-BI4fPmYY.mjs","../../../0-framework/3-tooling/cli/dist/cli-B4o-gpsM.mjs","../../../0-framework/3-tooling/cli/dist/bin.mjs"],"sourcesContent":["import { n as executorLoadFailure } from \"./shared-BTnATsqm.mjs\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/deploy.ts\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-Bsdh8hf4.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error, cwd));\n\t}\n\treturn executor.executeDeploy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/destroy.ts\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-Bsdh8hf4.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error, cwd));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-CQ0Lo2eN.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error, cwd));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's LogRunDeps,\n* unit tests). Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-CUzTOzSj.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error, cwd));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { destroy as a, deployWithDeps as c, devWithDeps as i, logWithDeps as n, destroyWithDeps as o, dev as r, deploy as s, log as t };\n\n//# sourceMappingURL=log-E_5UMZl8.mjs.map","import { t as executionDiagnostics } from \"./shared-BTnATsqm.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy--ZIvgqyU.mjs\";\nimport { c as deployWithDeps, i as devWithDeps, n as logWithDeps, o as destroyWithDeps } from \"./log-E_5UMZl8.mjs\";\nimport { DOCS_BASE } from \"@internal/foundation/errors\";\nimport { EnvironmentCredentialManager, createCli, defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, loadConfig, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError as CliStructuredError$1, notOk, ok } from \"@prisma/cli-engine/protocol\";\nimport { spawn } from \"node:child_process\";\n//#region src/family/translate-error.ts\n/**\n* The family boundary's error translation.\n*\n* Composer and the engine each carry a class called `CliStructuredError`, both\n* descended from the same prisma/prisma foundation, and both recognize errors\n* by duck-typing on `name === 'CliStructuredError'`. That means a composer\n* error handed to the engine untranslated is ACCEPTED — it does not fail\n* loudly, it renders. What it loses is its `fix`: composer's foundation\n* carries remediation as one prose string on that field, the engine carries it\n* as a `nextActions` list and has no `fix` at all, so the fix text is dropped\n* silently and the user is told what broke with no word on what to do about\n* it. Nothing about that failure is visible without a test that looks for the\n* fix on the other side, which is why there is one.\n*\n* Everything else on the envelope survives as-is; only remediation changes\n* representation.\n*/\n/**\n* Composer's `fix` is free prose — \"add this overrides block and reinstall\",\n* \"run the build, then retry\" — with no machine-readable command inside it.\n* `user-choice` is the engine's own kind for exactly that (it is what the\n* engine uses for its own config and prompt failures), so the text carries\n* over verbatim as one action rather than being parsed into a command the\n* author never wrote.\n*/\nfunction fixAsNextActions(fix) {\n\treturn fix === void 0 ? [] : [{\n\t\tkind: \"user-choice\",\n\t\tlabel: fix\n\t}];\n}\n/** Translates a composer failure into the engine's error type. Composer-side detail — `meta`, `where`, `docsUrl` — rides along untouched. */\nfunction toEngineError(error) {\n\treturn new CliStructuredError$1(error.code, error.message, {\n\t\tseverity: error.severity,\n\t\tnextActions: fixAsNextActions(error.fix),\n\t\t...error.why === void 0 ? {} : { why: error.why },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: error.meta },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl },\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/family/converge.ts\n/** The adapter the operations call, backed by the engine's `ctx.spawn` so the\n* terminal reaches alchemy natively and the engine owns signal policy. */\nfunction convergeSpawn(ctx) {\n\treturn async (invocation) => {\n\t\tconst line = alchemyCommandLine(invocation);\n\t\treturn await ctx.spawn({\n\t\t\tcommand: line.command,\n\t\t\targs: line.args,\n\t\t\tcwd: line.cwd,\n\t\t\tenv: line.env\n\t\t});\n\t};\n}\n/** The in-process leg's deps: composer's existing seam, carrying the engine's\n* own client and workspace id rather than anything read from the env. */\nfunction operationDeps(spec) {\n\treturn {\n\t\talchemy: spec.alchemy,\n\t\tconfigPath: spec.configPath,\n\t\tcredentials: {\n\t\t\tworkspaceId: spec.workspaceId,\n\t\t\tclient: spec.client\n\t\t}\n\t};\n}\n/**\n* The reproduce hint a failed converge carries. Deliberately absent for an\n* aborted one: the user stopped it, so there is nothing to reproduce.\n*/\nfunction reproduceHint(failure) {\n\tconst diagnostics = executionDiagnostics(failure);\n\tif (diagnostics === void 0) return [];\n\treturn [{\n\t\tkind: \"run-command\",\n\t\tlabel: `Run the converge directly from ${diagnostics.cwd} to reproduce this`,\n\t\tcommand: diagnostics.reproduceCommand,\n\t\treason: `Generated stack file: ${diagnostics.stackFilePath}`\n\t}];\n}\n/**\n* How a FAILED converge settles. `deploy`, `destroy` and `dev` all end this\n* way and must not drift apart, so the decision lives here once rather than\n* inline in each handler.\n*\n* A failure that reached the child exits with the child's status verbatim and\n* carries the reproduce hint; a failure that never reached the child is an\n* ordinary structured error and gets the normal envelope. Nothing here reads\n* `signal` — see settleConverge.\n*/\nfunction settleConvergeFailure(failure, ctx) {\n\tconst child = ctx.lastChild();\n\tif (child !== void 0 && child.exitCode !== 0) return ok(exitWithChildStatus({ nextActions: reproduceHint(failure) }));\n\treturn notOk(toEngineError(failure));\n}\n/**\n* How a converge settles, now that the engine owns the child's status.\n*\n* Nothing here reads `signal`. `exitWithChildStatus` settles from the engine's\n* own record of the child, and a signal-killed one overrules whatever this\n* function asked for: 128 + the signal, no failure envelope, and the reproduce\n* hint dropped, because the user stopped the run and there is nothing to\n* reproduce.\n*\n* What is left is the operation's own verdict. A failure that reached the\n* child exits with the child's status verbatim and carries the reproduce hint;\n* a failure that never reached the child is an ordinary structured error and\n* gets the normal envelope.\n*\n* A SUCCESS presents its result even when the child was signal-killed. No\n* composer operation produces that pair today — each one reports a\n* signal-killed converge as a failure — and an operation that ever did would\n* have a real result worth showing. The run still exits 130, because the\n* engine settles a signal-terminated run from its own record of the signal\n* whatever the handler returns.\n*/\nfunction settleConverge(result, ctx, present) {\n\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\treturn ok(present(result.value));\n}\n//#endregion\n//#region src/family/section.ts\n/**\n* Composer's projection into `prisma.config.ts` — the `composer` section.\n*\n* The section is deliberately tiny. Composer's real configuration lives in\n* `prisma-composer.config.ts`, which holds executable values (Effect layers,\n* provider factories, container lifecycles) and can only be understood by\n* evaluating it inside a running command. A config-section validator loads\n* with the command tree at start-up and must be dependency-light and total,\n* so it is the wrong place to evaluate any of that. What the section carries\n* is therefore only the one fact the engine can usefully know before a\n* command runs: WHERE that file is, when the user wants to say so.\n*\n* Its fields grow only by amending the slice contract.\n*/\nconst KNOWN_FIELDS = [\"configPath\"];\nfunction diagnostic(spec) {\n\treturn {\n\t\tcode: spec.code,\n\t\tseverity: spec.severity,\n\t\tsummary: spec.summary,\n\t\t...spec.why === void 0 ? {} : { why: spec.why },\n\t\tnextActions: spec.fix === void 0 ? [] : [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: spec.fix\n\t\t}]\n\t};\n}\nfunction validate(raw) {\n\tif (raw === void 0) return {\n\t\tok: true,\n\t\tvalue: {},\n\t\tdiagnostics: []\n\t};\n\tif (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) return {\n\t\tok: false,\n\t\tdiagnostics: [diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tseverity: \"error\",\n\t\t\tsummary: \"The `composer` section of prisma.config.ts must be an object.\",\n\t\t\tfix: \"Write `composer: { configPath: \\\"./prisma-composer.config.ts\\\" }`, or remove the section entirely.\"\n\t\t})]\n\t};\n\tlet record;\n\ttry {\n\t\trecord = { ...raw };\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tdiagnostics: [diagnostic({\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tsummary: \"The `composer` section of prisma.config.ts could not be read.\",\n\t\t\t\twhy: \"Reading its fields threw, so nothing in it can be trusted.\",\n\t\t\t\tfix: \"Write it as a plain object literal, e.g. `composer: { configPath: \\\"./prisma-composer.config.ts\\\" }`.\"\n\t\t\t})]\n\t\t};\n\t}\n\tconst configPath = record[\"configPath\"];\n\tif (configPath !== void 0 && (typeof configPath !== \"string\" || configPath.length === 0)) return {\n\t\tok: false,\n\t\tdiagnostics: [diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tseverity: \"error\",\n\t\t\tsummary: \"`composer.configPath` must be a non-empty string.\",\n\t\t\twhy: \"It names the prisma-composer.config.ts file to load.\",\n\t\t\tfix: \"Set it to a path, or remove it to search upward from the entry.\"\n\t\t})]\n\t};\n\tconst unknown = Object.keys(record).filter((key) => !KNOWN_FIELDS.includes(key));\n\treturn {\n\t\tok: true,\n\t\tvalue: configPath === void 0 ? {} : { configPath },\n\t\tdiagnostics: unknown.map((key) => diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_UNKNOWN\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: `The \\`composer\\` section has no field \\`${key}\\`; it is ignored.`,\n\t\t\tfix: `Remove \\`${key}\\`, or check it against the version of @prisma/composer you have installed.`\n\t\t}))\n\t};\n}\nconst composerSection = defineConfigSection({\n\tname: \"composer\",\n\tvalidate\n});\n//#endregion\n//#region src/family/target.ts\n/**\n* `destroy`'s target, from its two mutually exclusive flags. Kept out of the\n* grammar because the engine's flag layer has no \"exactly one of these\"\n* construct — and because both wrong shapes need their own remedy, which a\n* generic arity error could not give.\n*/\nfunction targetOf(stage, production) {\n\tif (stage !== void 0 && production) return notOk(new CliStructuredError$1(\"DEPLOY.TARGET_CONFLICT\", \"Pass either --stage <name> or --production to `destroy`, not both.\"));\n\tif (stage === void 0 && !production) return notOk(new CliStructuredError$1(\"DEPLOY.TARGET_MISSING\", \"`destroy` requires an explicit target.\", { nextActions: [{\n\t\tkind: \"user-choice\",\n\t\tlabel: \"Pass --stage <name> to tear down a branch environment, or --production to tear down the production environment.\"\n\t}] }));\n\treturn ok(stage !== void 0 ? {\n\t\tkind: \"stage\",\n\t\tstage\n\t} : { kind: \"production\" });\n}\n//#endregion\n//#region src/family/workspace.ts\n/**\n* The workspace the in-process leg acts in, from the engine's credential\n* read. Handlers never decode a token and never read PRISMA_WORKSPACE_ID:\n* whether the credential came from a stored session or the environment, the\n* engine has already resolved it, and branching on where it came from is a\n* defect by the credential-manager design.\n*\n* Undefined when the active credential names no workspace — an environment\n* token whose claims carry none. The container descriptors raise their own\n* \"workspace required\" error in that case, which is the error the user needs.\n*/\nasync function workspaceIdOf(ctx) {\n\treturn (await ctx.activeCredential())?.workspaceId;\n}\n//#endregion\n//#region src/family/commands/destroy.ts\n/**\n* `destroy <entry>` — deploy's mirror: same derivation, alchemy destroy.\n*\n* No confirmation prompt, matching the CLI this replaces. The front door\n* cannot know what the child will tear down, so a consent step here would be\n* asking the user to approve a list nobody has computed yet; if destroy\n* deserves one it belongs in composer's own operation, not in the grammar.\n*/\nconst createDestroyCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Tear down the application whose root node is <entry>'s default export.\",\n\t\tdescription: \"Same derivation as deploy. Requires an explicit target: --stage <name> for a branch environment, or --production for the production environment.\",\n\t\texamples: [\"{bin} destroy src/service.ts --stage feat-auth\", \"{bin} destroy src/service.ts --production\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the application name to tear down.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Tear down this branch environment.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\tproduction: flag.boolean({ brief: \"Tear down the project-level production environment.\" })\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst target = targetOf(args.flags.stage, args.flags.production);\n\t\tif (!target.ok) return target;\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.destroy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\ttarget: target.value,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: (event) => {\n\t\t\t\tif (event.kind !== \"no-local-deploy-state\") return;\n\t\t\t\tctx.report({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `No prior deploy state under ${event.cwd} — if you deployed from a different directory, run destroy from there; otherwise this is a no-op.`\n\t\t\t\t});\n\t\t\t}\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tconfigPath: ctx.config.configPath,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, () => ctx.present({ data: void 0 }, {\n\t\t\thuman: () => [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Destroyed.\"\n\t\t\t}],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => void 0,\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/commands/log.ts\n/**\n* `log <entry> [address]` — a session command that tails the merged logs of\n* the app running locally on this machine.\n*\n* It reads the LOCAL dev-emulator daemon, not the platform's logs surface, so\n* it is credential-free. It hands the terminal to nothing, which is why it\n* does not declare `maySpawn` and keeps json support: the log lines ARE its\n* json surface.\n*\n* Windows is refused inside the operation itself (LOG.PLATFORM_UNSUPPORTED),\n* which is why nothing here reads the platform.\n*/\n/** An empty screen reads as broken, so show a little recent history before going live. */\nconst DEFAULT_TAIL = 20;\nconst createLogCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Tail the merged logs of the locally-running application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} log src/service.ts\", \"{bin} log src/service.ts catalog.service\"]\n\t},\n\targs: {\n\t\tpositionals: {\n\t\t\tentry: positional.string({\n\t\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\t\tplaceholder: \"entry\"\n\t\t\t}),\n\t\t\taddress: positional.optionalString({\n\t\t\t\tbrief: \"Only this service's lines, by its dotted address (catalog.service); every service when absent.\",\n\t\t\t\tplaceholder: \"address\"\n\t\t\t})\n\t\t},\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\ttail: flag.number({\n\t\t\t\tbrief: `How many trailing history lines to show before live output (default ${String(DEFAULT_TAIL)}).`,\n\t\t\t\tplaceholder: \"lines\",\n\t\t\t\tdefault: DEFAULT_TAIL\n\t\t\t})\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\thandler: async (args, ctx) => {\n\t\tconst reportLogEvent = (event) => {\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: event.kind === \"stream-failed\" ? `Stream failed: ${event.message}` : `Falling behind — dropped the ${String(event.count)} oldest lines.`\n\t\t\t});\n\t\t};\n\t\tconst result = await operations.log({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\taddress: args.positionals.address,\n\t\t\ttail: args.flags.tail ?? DEFAULT_TAIL,\n\t\t\tcwd: ctx.cwd,\n\t\t\tsignal: ctx.signal,\n\t\t\tonEvent: reportLogEvent\n\t\t}, { configPath: ctx.config.configPath });\n\t\tif (!result.ok) return notOk(toEngineError(result.failure));\n\t\tconst attached = result.value;\n\t\tif (attached.services.length === 0) {\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: `No running services for \"${attached.appName}\" — start it first with \\`dev ${args.positionals.entry}\\`.`\n\t\t\t});\n\t\t\treturn ok(void 0);\n\t\t}\n\t\tfor await (const { service, line } of attached.lines) ctx.report({\n\t\t\tkind: \"output\",\n\t\t\tsource: service,\n\t\t\tchannel: \"data\",\n\t\t\tline: `[${service}] ${line}`\n\t\t});\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/commands/deploy.ts\n/**\n* `deploy <entry>` — a result command that hands the terminal to alchemy.\n*\n* `--production` is gone. It was accepted and then always errored (\"only\n* valid with destroy\"), so no invocation using it could ever have succeeded;\n* deploy targets production by default when no `--stage` is given.\n*/\nconst createDeployCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} deploy src/service.ts\", \"{bin} deploy src/service.ts --stage feat-auth\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the deploy's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Deploy scope to target; omit for production.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\treport: flag.string({\n\t\t\t\tbrief: \"Write the deploy's outcome as JSON to this path — resources, preview URLs, and the failure cause. Also settable as PRISMA_COMPOSER_REPORT_FILE.\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t}),\n\t\t\tbuildId: flag.string({\n\t\t\t\tbrief: \"Join the deploy record your CI already created rather than letting the target create one. Each target also reads its own environment variable for this; the flag wins.\",\n\t\t\t\tplaceholder: \"id\"\n\t\t\t})\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.deploy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\tstage: args.flags.stage,\n\t\t\tcwd: ctx.cwd,\n\t\t\treportPath: args.flags.report,\n\t\t\treportId: args.flags.buildId\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tconfigPath: ctx.config.configPath,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, ({ summary }) => ctx.present({ data: { summary: summary ?? null } }, {\n\t\t\thuman: (ui) => summary === void 0 ? [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Deployed.\"\n\t\t\t}] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: `Deployed ${ui.emphasize(summary.app)}.`\n\t\t\t}, {\n\t\t\t\tkind: \"table\",\n\t\t\t\tcolumns: [\"Address\", \"Deployed\"],\n\t\t\t\trows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(\", \")])\n\t\t\t}],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => ({ summary: summary ?? null }),\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/commands/dev.ts\nconst STOP_STEP = \"Stopping the app's services — emulators and data stay up\";\n/** Resolves when the run is asked to stop. */\nfunction stopRequested(signal) {\n\tif (signal.aborted) return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n/**\n* One converge at a time. `ctx.spawn` refuses a second live child, and the\n* watch loop can well fire a rebuild while the previous converge is still\n* running — so a request that arrives during a live converge joins the single\n* queued follow-up instead of starting its own. That extends the coalescing\n* the watcher already does across a burst of edits to cover the converge\n* itself, and it is sound because every dev converge is the SAME invocation:\n* one stack file at one fixed path, rewritten in place before each request.\n*/\nfunction coalescedConverge(run) {\n\tlet live;\n\tlet queued;\n\tconst start = (invocation) => {\n\t\tconst outcome = run(invocation);\n\t\tconst settled = outcome.then(() => void 0, () => void 0);\n\t\tlive = settled;\n\t\tsettled.then(() => {\n\t\t\tif (live === settled) live = void 0;\n\t\t});\n\t\treturn outcome;\n\t};\n\treturn (invocation) => {\n\t\tconst running = live;\n\t\tif (running === void 0) return start(invocation);\n\t\tqueued ??= running.then(() => {\n\t\t\tqueued = void 0;\n\t\t\treturn start(invocation);\n\t\t});\n\t\treturn queued;\n\t};\n}\n/** The front door, ordered by address depth (fewest dots first) then lexicographically. */\nfunction frontDoorOrder(endpoints) {\n\treturn [...endpoints].sort((a, b) => {\n\t\tconst depth = a.address.split(\".\").length - b.address.split(\".\").length;\n\t\tif (depth !== 0) return depth;\n\t\treturn a.address < b.address ? -1 : a.address > b.address ? 1 : 0;\n\t});\n}\n/**\n* The operation's events as engine events. The legacy `[dev]` console prefix\n* is gone: these are commentary the engine renders and frames.\n*/\nfunction reportDevEvent(report, lastChild) {\n\tlet stopFailed = false;\n\treturn (event) => {\n\t\tswitch (event.kind) {\n\t\t\tcase \"ready\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"status\",\n\t\t\t\t\tsubject: \"dev\",\n\t\t\t\t\tstatus: \"ready\"\n\t\t\t\t});\n\t\t\t\tfor (const endpoint of frontDoorOrder(event.endpoints)) report({\n\t\t\t\t\tkind: \"endpoint\",\n\t\t\t\t\tname: endpoint.address,\n\t\t\t\t\turl: endpoint.url\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"unwatchable\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.address} has no watchable inputs.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"rebuild-failed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Rebuild failed: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"watch-error\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Watch error: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"converge-failed\": {\n\t\t\t\tconst child = lastChild();\n\t\t\t\tif (child !== void 0 && child.signal !== null) return;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Converge failed — the running app is untouched; still watching.\nGenerated stack file: ${event.stackFilePath}\\nRun \\`${event.reproduceCommand}\\` from ${event.cwd} to reproduce this directly.`\n\t\t\t\t});\n\t\t\t\treport({\n\t\t\t\t\tkind: \"remediation\",\n\t\t\t\t\taction: {\n\t\t\t\t\t\tkind: \"run-command\",\n\t\t\t\t\t\tlabel: `Run the converge directly from ${event.cwd} to reproduce this`,\n\t\t\t\t\t\tcommand: event.reproduceCommand,\n\t\t\t\t\t\treason: `Generated stack file: ${event.stackFilePath}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"stopping\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-started\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stop-error\":\n\t\t\t\tstopFailed = true;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `A service refused to stop: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stopped\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\",\n\t\t\t\t\toutcome: stopFailed ? \"warning\" : \"ok\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t}\n\t};\n}\nconst createDevCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Bring up the application whose root node is <entry>'s default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit.\",\n\t\texamples: [\"{bin} dev src/service.ts\", \"{bin} dev src/service.ts --fresh\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tfresh: flag.boolean({ brief: \"Destroy the dev stack and wipe the dev state directory before starting.\" })\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\tconst result = await operations.dev({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\tfresh: args.flags.fresh,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: reportDevEvent(ctx.report, ctx.lastChild)\n\t\t}, {\n\t\t\talchemy: coalescedConverge(alchemy),\n\t\t\tconfigPath: ctx.config.configPath\n\t\t});\n\t\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\t\tawait stopRequested(ctx.signal);\n\t\tawait result.value.stop();\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/family.ts\n/**\n* Composer's `CommandFamily` — the unit the engine mounts, whether the process\n* is composer's own CLI or the `prisma` bin.\n*\n* This module and everything it reaches statically must stay free of alchemy\n* and of effect VALUE imports: the `prisma` bin imports the family directly,\n* so anything in this static graph loads on `prisma --version`. The mechanism\n* that holds it is the existing lazy boundary inside the operation modules —\n* `operations/deploy.ts`, `destroy.ts`, `dev.ts` and `log.ts` each `await\n* import()` their executor, and it is the executors that reach the provider\n* tree. Importing the operations here is therefore free; importing an\n* executor, or flattening one of those dynamic imports, is not.\n* scripts/check-family-static-graph.mjs enforces this against BUILT output,\n* where type-only imports have already been erased.\n*\n* The commands close over the operations they are given, so a host can\n* mount this family against the test double and exercise real grammar, real\n* arg validation and real handlers with no alchemy behind them.\n*\n* The family ships `deploy` and `dev` only: `destroy` and `log` were retired\n* from the family surface (2026-08-21 PM review), so hosts mounting the family\n* — the `prisma` bin — never see them. They remain first-class commands of\n* composer's own bin, mounted on top of the family in engine-cli.ts.\n*/\nconst realOperations = {\n\tdeploy: deployWithDeps,\n\tdestroy: destroyWithDeps,\n\tdev: devWithDeps,\n\tlog: logWithDeps\n};\nfunction createComposerFamily(options = {}) {\n\tconst operations = options.operations ?? realOperations;\n\treturn defineCommandFamily({\n\t\tconfigSection: composerSection,\n\t\tcommands: {\n\t\t\tdeploy: createDeployCommand(operations),\n\t\t\tdev: createDevCommand(operations)\n\t\t},\n\t\tdocsBaseUrl: DOCS_BASE\n\t});\n}\n//#endregion\n//#region src/family/runtime.ts\n/**\n* Everything environmental the engine needs, assembled from a host process.\n*\n* The engine takes no globals: streams, cwd, env, TTY-ness, exit and signal\n* subscription all arrive through `Runtime`, which is what lets a test drive a\n* whole run without touching `process`. Composing one is the substantive part\n* of hosting the engine — `createCli` and `Cli.run` are two calls.\n*\n* Credentials come from the engine's own environment-only manager, which\n* composes a session from PRISMA_SERVICE_TOKEN / PRISMA_WORKSPACE_ID and\n* refuses every mutation. That is the whole of composer's standalone auth\n* story: this CLI has no login flow and mounts no auth commands, so there is\n* nothing to store — the two variables ARE the credential.\n*/\n/** Where the management API lives. Matches the lowering client's default origin; the env var is the escape hatch for staging. */\nconst DEFAULT_MANAGEMENT_API_BASE_URL = \"https://api.prisma.io\";\nconst DEFAULT_AUTH_BASE_URL = \"https://auth.prisma.io\";\n/**\n* Starts the converge child: inherited stdio, this process's own group, no\n* `detached` and no new console — which is what lets the terminal deliver\n* Ctrl-C to the child natively instead of the CLI forwarding it. The engine\n* never imports node:child_process; this adapter is the whole of the host's\n* side of that seam.\n*/\nconst spawnChild = (request) => {\n\tconst child = spawn(request.command, [...request.args], {\n\t\tcwd: request.cwd,\n\t\tstdio: \"inherit\",\n\t\tenv: request.env\n\t});\n\treturn {\n\t\tended: new Promise((resolve, reject) => {\n\t\t\tchild.on(\"error\", reject);\n\t\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\t\tresolve({\n\t\t\t\t\texitCode,\n\t\t\t\t\tsignal\n\t\t\t\t});\n\t\t\t});\n\t\t}),\n\t\tkill: (signal) => {\n\t\t\tchild.kill(signal);\n\t\t}\n\t};\n};\n/**\n* The SDK's client construction config. The engine requires all four fields\n* whenever a credential manager is wired, but this host reaches none of the\n* login paths: an environment credential carries no refresh token, so nothing\n* ever refreshes and `clientId`/`redirectUri` are never read. They are\n* env-overridable rather than hard-coded so a staging run can point the whole\n* client somewhere else in one place.\n*/\nfunction clientConfig(env, apiBaseUrl) {\n\treturn {\n\t\tclientId: env[\"PRISMA_CLIENT_ID\"] ?? \"prisma-composer-cli\",\n\t\tredirectUri: env[\"PRISMA_REDIRECT_URI\"] ?? \"http://127.0.0.1/callback\",\n\t\tapiBaseUrl,\n\t\tauthBaseUrl: env[\"PRISMA_AUTH_URL\"] ?? DEFAULT_AUTH_BASE_URL\n\t};\n}\n/**\n* What this process runs on, for `ctx.host`. Bun and Deno both announce\n* themselves in `versions`; nothing else does, so an absent marker means Node.\n*/\nfunction describeHost(host) {\n\tconst name = [\"bun\", \"deno\"].find((candidate) => host.versions[candidate] !== void 0) ?? \"node\";\n\treturn {\n\t\truntime: {\n\t\t\tname,\n\t\t\tversion: host.versions[name] ?? host.version\n\t\t},\n\t\tplatform: host.platform,\n\t\tarch: host.arch\n\t};\n}\n/**\n* Which package manager invoked us, read from the `npm_config_user_agent`\n* every major manager sets (`pnpm/10.27.0 npm/? node/v24.16.0 darwin arm64`).\n* `undefined` when the CLI was run directly rather than through a manager — a\n* normal case, not a failure, so nothing is inferred from the filesystem, and\n* the engine falls back to its own detection from the project at cwd.\n*/\nfunction detectPackageManager(env) {\n\tconst agent = env[\"npm_config_user_agent\"];\n\tif (agent === void 0) return void 0;\n\tconst name = agent.split(\"/\")[0];\n\tswitch (name) {\n\t\tcase \"npm\":\n\t\tcase \"pnpm\":\n\t\tcase \"yarn\":\n\t\tcase \"bun\":\n\t\tcase \"deno\": return name;\n\t\tdefault: return;\n\t}\n}\n/**\n* The config loader arrives as a function rather than an already-loaded config\n* because the engine reads `prisma.config.ts` on demand — only when the command\n* it is about to run declares a config section, and with whatever file\n* `--config` named. A host that loaded the file up front would read it for runs\n* that never needed it, and would have nowhere to put `--config`.\n*\n* Nothing here answers \"is this CI\": the engine detects it from `env` itself,\n* and `isCIOverride` exists only for hosts where that detection cannot be\n* right — composer is not one.\n*/\nconst nonEmpty = (value) => value !== void 0 && value.length > 0 ? value : void 0;\nfunction createRuntime(host, loadConfig) {\n\tconst env = host.env;\n\tconst apiBaseUrl = nonEmpty(env[\"PRISMA_API_URL\"]) ?? nonEmpty(env[\"PRISMA_MANAGEMENT_API_URL\"]) ?? DEFAULT_MANAGEMENT_API_BASE_URL;\n\tconst packageManager = detectPackageManager(env);\n\treturn {\n\t\tstdout: host.stdout,\n\t\tstderr: host.stderr,\n\t\tstdin: host.stdin,\n\t\tcwd: host.cwd(),\n\t\tenv,\n\t\tisTty: {\n\t\t\tstdin: host.stdin.isTTY === true,\n\t\t\tstdout: host.stdout.isTTY === true,\n\t\t\tstderr: host.stderr.isTTY === true\n\t\t},\n\t\texit: (code) => host.exit(code),\n\t\tonSignal: (cb) => {\n\t\t\tconst onSigint = () => {\n\t\t\t\tcb(\"SIGINT\");\n\t\t\t};\n\t\t\tconst onSigterm = () => {\n\t\t\t\tcb(\"SIGTERM\");\n\t\t\t};\n\t\t\thost.on(\"SIGINT\", onSigint);\n\t\t\thost.on(\"SIGTERM\", onSigterm);\n\t\t\treturn () => {\n\t\t\t\thost.off(\"SIGINT\", onSigint);\n\t\t\t\thost.off(\"SIGTERM\", onSigterm);\n\t\t\t};\n\t\t},\n\t\tloadConfig,\n\t\tcredentialManager: new EnvironmentCredentialManager({ env }),\n\t\tmanagementApiClientConfig: clientConfig(env, apiBaseUrl),\n\t\tspawn: spawnChild,\n\t\tmanagementApi: { baseUrl: apiBaseUrl },\n\t\t...packageManager !== void 0 && { packageManager },\n\t\thost: describeHost(host)\n\t};\n}\n//#endregion\n//#region src/family/engine-cli.ts\n/**\n* Composer's own CLI, rebuilt as a thin composition of the family it\n* publishes: `createCli` over `createComposerFamily()`, `Cli.run` with a\n* Runtime. Grammar, help, arg validation, output framing, exit codes and\n* signal ownership all belong to the engine now — this module contributes the\n* family and the environment, and nothing else.\n*\n* Running composer's commands through the same path an external host uses is\n* the point: it is what proves the family works standalone before the `prisma`\n* bin mounts it.\n*\n* This IS composer's CLI. The clipanion shell it replaced, and the bespoke\n* runner that shelled out to alchemy, are gone; `bin.ts` is a call into here.\n*/\nconst BINARY_NAME = \"prisma-composer\";\n/**\n* Composer's commands mount at the top level of its own CLI (`prisma-composer\n* deploy`). The bin mounts more than the family carries: `destroy` and `log`\n* were retired from the family (the surface the `prisma` bin mounts, per the\n* 2026-08-21 PM review) but stay first-class commands of `prisma-composer`\n* itself, so their definitions are mounted here on top of the family.\n*/\nfunction mountedTree(family, operations) {\n\treturn {\n\t\t...family.commands,\n\t\tdestroy: createDestroyCommand(operations),\n\t\tlog: createLogCommand(operations)\n\t};\n}\nfunction createComposerCli(spec) {\n\tconst operations = spec.operations ?? realOperations;\n\tconst family = createComposerFamily({ operations });\n\treturn createCli({\n\t\tname: BINARY_NAME,\n\t\tversion: spec.version,\n\t\tcommandFamilies: [family],\n\t\tgroups: {},\n\t\tcommands: mountedTree(family, operations)\n\t});\n}\n/**\n* Composes the Runtime and runs one invocation. Returns the exit code rather\n* than exiting, so the caller owns the process — a bin assigns it to\n* `process.exitCode` and lets the streams drain, as composer's CLI has always\n* done.\n*\n* `prisma.config.ts` is not read here. The loader goes in as a function, and the\n* engine calls it only when the command it is about to run declares a config\n* section, passing it the file `--config` named; the loader resolves that\n* against the host's cwd.\n*/\nfunction runComposerCli(argv, host, spec, hooks) {\n\tconst runtime = createRuntime(host, (configPath) => loadConfig(host.cwd(), configPath));\n\treturn createComposerCli(spec).run(argv, runtime, hooks);\n}\n//#endregion\nexport { realOperations as a, createComposerFamily as i, createComposerCli as n, composerSection as o, runComposerCli as r, toEngineError as s, BINARY_NAME as t };\n\n//# sourceMappingURL=engine-cli-BI4fPmYY.mjs.map","import { r as runComposerCli } from \"./engine-cli-BI4fPmYY.mjs\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/cli.ts\n/**\n* The `prisma-composer` entrypoint: adapt this process into the engine's\n* `HostProcess`, run one invocation of composer's own CLI, and hand back an\n* exit code. Grammar, help, argument validation, output framing, exit codes\n* and signal policy all belong to the engine — this module contributes the\n* process and the version, and nothing else.\n*\n* Node's `process` already satisfies `HostProcess` structurally, so there is\n* no adapter object here; that is the whole point of the engine taking a host\n* surface rather than reading globals.\n*/\n/** Printed for a throw that escapes the engine entirely — by the shared base-type rules that is a bug, not a user failure. */\nconst REPORT_HINT = \"This is a bug in prisma-composer, not in your app — please report it: https://github.com/prisma/composer/issues\";\nconst UNKNOWN_VERSION = \"unknown\";\n/**\n* The version the CLI reports, read from the manifest of the package this\n* module was BUNDLED INTO — `@prisma/composer` for the published bin, since\n* that is the package whose executable the user installed. Walking up from the\n* module's own location is what makes that true in both layouts: the published\n* `dist/bin.mjs` finds `@prisma/composer`'s manifest, and a direct run of\n* `src/bin.ts` finds this package's.\n*/\nfunction shippedVersion(fromDir = path.dirname(fileURLToPath(import.meta.url))) {\n\tlet dir = fromDir;\n\twhile (true) {\n\t\tconst manifest = path.join(dir, \"package.json\");\n\t\tif (fs.existsSync(manifest)) try {\n\t\t\tconst version = JSON.parse(fs.readFileSync(manifest, \"utf-8\")).version;\n\t\t\treturn typeof version === \"string\" ? version : UNKNOWN_VERSION;\n\t\t} catch {\n\t\t\treturn UNKNOWN_VERSION;\n\t\t}\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return UNKNOWN_VERSION;\n\t\tdir = parent;\n\t}\n}\n/**\n* Runs `prisma-composer` end to end and returns the process exit code. The\n* caller assigns it to `process.exitCode` rather than exiting, so the streams\n* drain — the engine returns a code for exactly this reason.\n*\n* The catch is not error handling for commands: the engine renders every\n* command failure itself. It catches a throw that escaped the engine — a\n* construction fault, a broken config load — which by ADR-0044 is a bug in\n* this CLI and exits 1 with a report hint.\n*/\nasync function cli(argv = process.argv.slice(2)) {\n\ttry {\n\t\treturn await runComposerCli(argv, process, { version: shippedVersion() });\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n\t\tconsole.error(REPORT_HINT);\n\t\treturn 1;\n\t}\n}\n//#endregion\nexport { shippedVersion as n, cli as t };\n\n//# sourceMappingURL=cli-B4o-gpsM.mjs.map","#!/usr/bin/env node\nimport { t as cli } from \"./cli-B4o-gpsM.mjs\";\n//#region src/bin.ts\nprocess.exitCode = await cli();\n//#endregion\nexport {};\n\n//# sourceMappingURL=bin.mjs.map"],"mappings":";;;;;;;;;;;;;AASA,eAAe,eAAe,OAAO,MAAM;CAC1C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,UAAU,OAAO,GAAG,CAAC;CACvD;CACA,OAAO,SAAS,cAAc,OAAO,MAAM,GAAG;AAC/C;;;;AASA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,WAAW,OAAO,GAAG,CAAC;CACxD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;;;;AASA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAA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AM,OAAO;CAChD,MAAM,UAAU,cAAc,OAAO,eAAe,WAAW,KAAK,IAAI,GAAG,UAAU,CAAC;CACtF,OAAO,kBAAkB,IAAI,CAAC,CAAC,IAAI,MAAM,SAAS,KAAK;AACxD;;;;;;;;;;;;;;;ACz3BA,MAAM,cAAc;AACpB,MAAM,kBAAkB;;;;;;;;;AASxB,SAAS,eAAe,UAAU,KAAK,QAAQ,cAAc,OAAO,KAAK,GAAG,CAAC,GAAG;CAC/E,IAAI,MAAM;CACV,OAAO,MAAM;EACZ,MAAM,WAAW,KAAK,KAAK,KAAK,cAAc;EAC9C,IAAI,GAAG,WAAW,QAAQ,GAAG,IAAI;GAChC,MAAM,UAAU,KAAK,MAAM,GAAG,aAAa,UAAU,OAAO,CAAC,CAAC,CAAC;GAC/D,OAAO,OAAO,YAAY,WAAW,UAAU;EAChD,QAAQ;GACP,OAAO;EACR;EACA,MAAM,SAAS,KAAK,QAAQ,GAAG;EAC/B,IAAI,WAAW,KAAK,OAAO;EAC3B,MAAM;CACP;AACD;;;;;;;;;;;AAWA,eAAe,IAAI,OAAO,QAAQ,KAAK,MAAM,CAAC,GAAG;CAChD,IAAI;EACH,OAAO,MAAM,eAAe,MAAM,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;CACzE,SAAS,OAAO;EACf,QAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;EAChF,QAAQ,MAAM,WAAW;EACzB,OAAO;CACR;AACD;;;ACzDA,QAAQ,WAAW,MAAM,IAAI"}
|
|
1
|
+
{"version":3,"file":"bin.mjs","names":["notOk","CliStructuredError$1"],"sources":["../../../0-framework/3-tooling/cli/dist/log-9MtF1k6l.mjs","../../../0-framework/3-tooling/cli/dist/engine-cli-X_xrCar3.mjs","../../../0-framework/3-tooling/cli/dist/cli-CZ2ENVcY.mjs","../../../0-framework/3-tooling/cli/dist/bin.mjs"],"sourcesContent":["import { n as executorLoadFailure } from \"./shared-BTnATsqm.mjs\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/deploy.ts\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-5sr2Z9oW.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error, cwd));\n\t}\n\treturn executor.executeDeploy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/destroy.ts\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-5sr2Z9oW.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error, cwd));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-B8CNl38E.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error, cwd));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's LogRunDeps,\n* unit tests). Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-BHrslCk8.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error, cwd));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { destroy as a, deployWithDeps as c, devWithDeps as i, logWithDeps as n, destroyWithDeps as o, dev as r, deploy as s, log as t };\n\n//# sourceMappingURL=log-9MtF1k6l.mjs.map","import { t as executionDiagnostics } from \"./shared-BTnATsqm.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy--ZIvgqyU.mjs\";\nimport { c as deployWithDeps, i as devWithDeps, n as logWithDeps, o as destroyWithDeps } from \"./log-9MtF1k6l.mjs\";\nimport { DOCS_BASE } from \"@internal/foundation/errors\";\nimport { EnvironmentCredentialManager, createCli, defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, loadConfig, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError as CliStructuredError$1, notOk, ok } from \"@prisma/cli-engine/protocol\";\nimport { spawn } from \"node:child_process\";\n//#region src/family/translate-error.ts\n/**\n* The family boundary's error translation.\n*\n* Composer and the engine each carry a class called `CliStructuredError`, both\n* descended from the same prisma/prisma foundation, and both recognize errors\n* by duck-typing on `name === 'CliStructuredError'`. That means a composer\n* error handed to the engine untranslated is ACCEPTED — it does not fail\n* loudly, it renders. What it loses is its `fix`: composer's foundation\n* carries remediation as one prose string on that field, the engine carries it\n* as a `nextActions` list and has no `fix` at all, so the fix text is dropped\n* silently and the user is told what broke with no word on what to do about\n* it. Nothing about that failure is visible without a test that looks for the\n* fix on the other side, which is why there is one.\n*\n* Everything else on the envelope survives as-is; only remediation changes\n* representation.\n*/\n/**\n* Composer's `fix` is free prose — \"add this overrides block and reinstall\",\n* \"run the build, then retry\" — with no machine-readable command inside it.\n* `user-choice` is the engine's own kind for exactly that (it is what the\n* engine uses for its own config and prompt failures), so the text carries\n* over verbatim as one action rather than being parsed into a command the\n* author never wrote.\n*/\nfunction fixAsNextActions(fix) {\n\treturn fix === void 0 ? [] : [{\n\t\tkind: \"user-choice\",\n\t\tlabel: fix\n\t}];\n}\n/** Translates a composer failure into the engine's error type. Composer-side detail — `meta`, `where`, `docsUrl` — rides along untouched. */\nfunction toEngineError(error) {\n\treturn new CliStructuredError$1(error.code, error.message, {\n\t\tseverity: error.severity,\n\t\tnextActions: fixAsNextActions(error.fix),\n\t\t...error.why === void 0 ? {} : { why: error.why },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: error.meta },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl },\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/family/converge.ts\n/** The adapter the operations call, backed by the engine's `ctx.spawn` so the\n* terminal reaches alchemy natively and the engine owns signal policy. */\nfunction convergeSpawn(ctx) {\n\treturn async (invocation) => {\n\t\tconst line = alchemyCommandLine(invocation);\n\t\treturn await ctx.spawn({\n\t\t\tcommand: line.command,\n\t\t\targs: line.args,\n\t\t\tcwd: line.cwd,\n\t\t\tenv: line.env\n\t\t});\n\t};\n}\n/** The in-process leg's deps: composer's existing seam, carrying the engine's\n* own client and workspace id rather than anything read from the env. */\nfunction operationDeps(spec) {\n\treturn {\n\t\talchemy: spec.alchemy,\n\t\tconfigPath: spec.configPath,\n\t\tcredentials: {\n\t\t\tworkspaceId: spec.workspaceId,\n\t\t\tclient: spec.client\n\t\t}\n\t};\n}\n/**\n* The reproduce hint a failed converge carries. Deliberately absent for an\n* aborted one: the user stopped it, so there is nothing to reproduce.\n*/\nfunction reproduceHint(failure) {\n\tconst diagnostics = executionDiagnostics(failure);\n\tif (diagnostics === void 0) return [];\n\treturn [{\n\t\tkind: \"run-command\",\n\t\tlabel: `Run the converge directly from ${diagnostics.cwd} to reproduce this`,\n\t\tcommand: diagnostics.reproduceCommand,\n\t\treason: `Generated stack file: ${diagnostics.stackFilePath}`\n\t}];\n}\n/**\n* How a FAILED converge settles. `deploy`, `destroy` and `dev` all end this\n* way and must not drift apart, so the decision lives here once rather than\n* inline in each handler.\n*\n* A failure that reached the child exits with the child's status verbatim and\n* carries the reproduce hint; a failure that never reached the child is an\n* ordinary structured error and gets the normal envelope. Nothing here reads\n* `signal` — see settleConverge.\n*/\nfunction settleConvergeFailure(failure, ctx) {\n\tconst child = ctx.lastChild();\n\tif (child !== void 0 && child.exitCode !== 0) return ok(exitWithChildStatus({ nextActions: reproduceHint(failure) }));\n\treturn notOk(toEngineError(failure));\n}\n/**\n* How a converge settles, now that the engine owns the child's status.\n*\n* Nothing here reads `signal`. `exitWithChildStatus` settles from the engine's\n* own record of the child, and a signal-killed one overrules whatever this\n* function asked for: 128 + the signal, no failure envelope, and the reproduce\n* hint dropped, because the user stopped the run and there is nothing to\n* reproduce.\n*\n* What is left is the operation's own verdict. A failure that reached the\n* child exits with the child's status verbatim and carries the reproduce hint;\n* a failure that never reached the child is an ordinary structured error and\n* gets the normal envelope.\n*\n* A SUCCESS presents its result even when the child was signal-killed. No\n* composer operation produces that pair today — each one reports a\n* signal-killed converge as a failure — and an operation that ever did would\n* have a real result worth showing. The run still exits 130, because the\n* engine settles a signal-terminated run from its own record of the signal\n* whatever the handler returns.\n*/\nfunction settleConverge(result, ctx, present) {\n\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\treturn ok(present(result.value));\n}\n//#endregion\n//#region src/family/section.ts\n/**\n* Composer's projection into `prisma.config.ts` — the `composer` section.\n*\n* The section is deliberately tiny. Composer's real configuration lives in\n* `prisma-composer.config.ts`, which holds executable values (Effect layers,\n* provider factories, container lifecycles) and can only be understood by\n* evaluating it inside a running command. A config-section validator loads\n* with the command tree at start-up and must be dependency-light and total,\n* so it is the wrong place to evaluate any of that. What the section carries\n* is therefore only the one fact the engine can usefully know before a\n* command runs: WHERE that file is, when the user wants to say so.\n*\n* Its fields grow only by amending the slice contract.\n*/\nconst KNOWN_FIELDS = [\"configPath\"];\nfunction diagnostic(spec) {\n\treturn {\n\t\tcode: spec.code,\n\t\tseverity: spec.severity,\n\t\tsummary: spec.summary,\n\t\t...spec.why === void 0 ? {} : { why: spec.why },\n\t\tnextActions: spec.fix === void 0 ? [] : [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: spec.fix\n\t\t}]\n\t};\n}\nfunction validate(raw) {\n\tif (raw === void 0) return {\n\t\tok: true,\n\t\tvalue: {},\n\t\tdiagnostics: []\n\t};\n\tif (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) return {\n\t\tok: false,\n\t\tdiagnostics: [diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tseverity: \"error\",\n\t\t\tsummary: \"The `composer` section of prisma.config.ts must be an object.\",\n\t\t\tfix: \"Write `composer: { configPath: \\\"./prisma-composer.config.ts\\\" }`, or remove the section entirely.\"\n\t\t})]\n\t};\n\tlet record;\n\ttry {\n\t\trecord = { ...raw };\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tdiagnostics: [diagnostic({\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tsummary: \"The `composer` section of prisma.config.ts could not be read.\",\n\t\t\t\twhy: \"Reading its fields threw, so nothing in it can be trusted.\",\n\t\t\t\tfix: \"Write it as a plain object literal, e.g. `composer: { configPath: \\\"./prisma-composer.config.ts\\\" }`.\"\n\t\t\t})]\n\t\t};\n\t}\n\tconst configPath = record[\"configPath\"];\n\tif (configPath !== void 0 && (typeof configPath !== \"string\" || configPath.length === 0)) return {\n\t\tok: false,\n\t\tdiagnostics: [diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tseverity: \"error\",\n\t\t\tsummary: \"`composer.configPath` must be a non-empty string.\",\n\t\t\twhy: \"It names the prisma-composer.config.ts file to load.\",\n\t\t\tfix: \"Set it to a path, or remove it to search upward from the entry.\"\n\t\t})]\n\t};\n\tconst unknown = Object.keys(record).filter((key) => !KNOWN_FIELDS.includes(key));\n\treturn {\n\t\tok: true,\n\t\tvalue: configPath === void 0 ? {} : { configPath },\n\t\tdiagnostics: unknown.map((key) => diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_UNKNOWN\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: `The \\`composer\\` section has no field \\`${key}\\`; it is ignored.`,\n\t\t\tfix: `Remove \\`${key}\\`, or check it against the version of @prisma/composer you have installed.`\n\t\t}))\n\t};\n}\nconst composerSection = defineConfigSection({\n\tname: \"composer\",\n\tvalidate\n});\n//#endregion\n//#region src/family/target.ts\n/**\n* `destroy`'s target, from its two mutually exclusive flags. Kept out of the\n* grammar because the engine's flag layer has no \"exactly one of these\"\n* construct — and because both wrong shapes need their own remedy, which a\n* generic arity error could not give.\n*/\nfunction targetOf(stage, production) {\n\tif (stage !== void 0 && production) return notOk(new CliStructuredError$1(\"DEPLOY.TARGET_CONFLICT\", \"Pass either --stage <name> or --production to `destroy`, not both.\"));\n\tif (stage === void 0 && !production) return notOk(new CliStructuredError$1(\"DEPLOY.TARGET_MISSING\", \"`destroy` requires an explicit target.\", { nextActions: [{\n\t\tkind: \"user-choice\",\n\t\tlabel: \"Pass --stage <name> to tear down a branch environment, or --production to tear down the production environment.\"\n\t}] }));\n\treturn ok(stage !== void 0 ? {\n\t\tkind: \"stage\",\n\t\tstage\n\t} : { kind: \"production\" });\n}\n//#endregion\n//#region src/family/workspace.ts\n/**\n* The workspace the in-process leg acts in, from the engine's credential\n* read. Handlers never decode a token and never read PRISMA_WORKSPACE_ID:\n* whether the credential came from a stored session or the environment, the\n* engine has already resolved it, and branching on where it came from is a\n* defect by the credential-manager design.\n*\n* Undefined when the active credential names no workspace — an environment\n* token whose claims carry none. The container descriptors raise their own\n* \"workspace required\" error in that case, which is the error the user needs.\n*/\nasync function workspaceIdOf(ctx) {\n\treturn (await ctx.activeCredential())?.workspaceId;\n}\n//#endregion\n//#region src/family/commands/destroy.ts\n/**\n* `destroy <entry>` — deploy's mirror: same derivation, alchemy destroy.\n*\n* No confirmation prompt, matching the CLI this replaces. The front door\n* cannot know what the child will tear down, so a consent step here would be\n* asking the user to approve a list nobody has computed yet; if destroy\n* deserves one it belongs in composer's own operation, not in the grammar.\n*/\nconst createDestroyCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Tear down the application whose root node is <entry>'s default export.\",\n\t\tdescription: \"Same derivation as deploy. Requires an explicit target: --stage <name> for a branch environment, or --production for the production environment.\",\n\t\texamples: [\"{bin} destroy src/service.ts --stage feat-auth\", \"{bin} destroy src/service.ts --production\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the application name to tear down.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Tear down this branch environment.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\tproduction: flag.boolean({ brief: \"Tear down the project-level production environment.\" })\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst target = targetOf(args.flags.stage, args.flags.production);\n\t\tif (!target.ok) return target;\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.destroy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\ttarget: target.value,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: (event) => {\n\t\t\t\tif (event.kind !== \"no-local-deploy-state\") return;\n\t\t\t\tctx.report({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `No prior deploy state under ${event.cwd} — if you deployed from a different directory, run destroy from there; otherwise this is a no-op.`\n\t\t\t\t});\n\t\t\t}\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tconfigPath: ctx.config.configPath,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, () => ctx.present({ data: void 0 }, {\n\t\t\thuman: () => [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Destroyed.\"\n\t\t\t}],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => void 0,\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/commands/log.ts\n/**\n* `log <entry> [address]` — a session command that tails the merged logs of\n* the app running locally on this machine.\n*\n* It reads the LOCAL dev-emulator daemon, not the platform's logs surface, so\n* it is credential-free. It hands the terminal to nothing, which is why it\n* does not declare `maySpawn` and keeps json support: the log lines ARE its\n* json surface.\n*\n* Windows is refused inside the operation itself (LOG.PLATFORM_UNSUPPORTED),\n* which is why nothing here reads the platform.\n*/\n/** An empty screen reads as broken, so show a little recent history before going live. */\nconst DEFAULT_TAIL = 20;\nconst createLogCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Tail the merged logs of the locally-running application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} log src/service.ts\", \"{bin} log src/service.ts catalog.service\"]\n\t},\n\targs: {\n\t\tpositionals: {\n\t\t\tentry: positional.string({\n\t\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\t\tplaceholder: \"entry\"\n\t\t\t}),\n\t\t\taddress: positional.optionalString({\n\t\t\t\tbrief: \"Only this service's lines, by its dotted address (catalog.service); every service when absent.\",\n\t\t\t\tplaceholder: \"address\"\n\t\t\t})\n\t\t},\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\ttail: flag.number({\n\t\t\t\tbrief: `How many trailing history lines to show before live output (default ${String(DEFAULT_TAIL)}).`,\n\t\t\t\tplaceholder: \"lines\",\n\t\t\t\tdefault: DEFAULT_TAIL\n\t\t\t})\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\thandler: async (args, ctx) => {\n\t\tconst reportLogEvent = (event) => {\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: event.kind === \"stream-failed\" ? `Stream failed: ${event.message}` : `Falling behind — dropped the ${String(event.count)} oldest lines.`\n\t\t\t});\n\t\t};\n\t\tconst result = await operations.log({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\taddress: args.positionals.address,\n\t\t\ttail: args.flags.tail ?? DEFAULT_TAIL,\n\t\t\tcwd: ctx.cwd,\n\t\t\tsignal: ctx.signal,\n\t\t\tonEvent: reportLogEvent\n\t\t}, { configPath: ctx.config.configPath });\n\t\tif (!result.ok) return notOk(toEngineError(result.failure));\n\t\tconst attached = result.value;\n\t\tif (attached.services.length === 0) {\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: `No running services for \"${attached.appName}\" — start it first with \\`dev ${args.positionals.entry}\\`.`\n\t\t\t});\n\t\t\treturn ok(void 0);\n\t\t}\n\t\tfor await (const { service, line } of attached.lines) ctx.report({\n\t\t\tkind: \"output\",\n\t\t\tsource: service,\n\t\t\tchannel: \"data\",\n\t\t\tline: `[${service}] ${line}`\n\t\t});\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/commands/deploy.ts\n/**\n* `deploy <entry>` — a result command that hands the terminal to alchemy.\n*\n* `--production` is gone. It was accepted and then always errored (\"only\n* valid with destroy\"), so no invocation using it could ever have succeeded;\n* deploy targets production by default when no `--stage` is given.\n*/\nconst createDeployCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} deploy src/service.ts\", \"{bin} deploy src/service.ts --stage feat-auth\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the deploy's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Deploy scope to target; omit for production.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\treport: flag.string({\n\t\t\t\tbrief: \"Write the deploy's outcome as JSON to this path — resources, preview URLs, and the failure cause. Also settable as PRISMA_COMPOSER_REPORT_FILE.\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t}),\n\t\t\tbuildId: flag.string({\n\t\t\t\tbrief: \"Join the deploy record your CI already created rather than letting the target create one. Each target also reads its own environment variable for this; the flag wins.\",\n\t\t\t\tplaceholder: \"id\"\n\t\t\t})\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.deploy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\tstage: args.flags.stage,\n\t\t\tcwd: ctx.cwd,\n\t\t\treportPath: args.flags.report,\n\t\t\treportId: args.flags.buildId\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tconfigPath: ctx.config.configPath,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, ({ summary }) => ctx.present({ data: { summary: summary ?? null } }, {\n\t\t\thuman: (ui) => summary === void 0 ? [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Deployed.\"\n\t\t\t}] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: `Deployed ${ui.emphasize(summary.app)}.`\n\t\t\t}, {\n\t\t\t\tkind: \"table\",\n\t\t\t\tcolumns: [\"Address\", \"Deployed\"],\n\t\t\t\trows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(\", \")])\n\t\t\t}],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => ({ summary: summary ?? null }),\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/commands/dev.ts\nconst STOP_STEP = \"Stopping the app's services — emulators and data stay up\";\n/** Resolves when the run is asked to stop. */\nfunction stopRequested(signal) {\n\tif (signal.aborted) return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n/**\n* One converge at a time. `ctx.spawn` refuses a second live child, and the\n* watch loop can well fire a rebuild while the previous converge is still\n* running — so a request that arrives during a live converge joins the single\n* queued follow-up instead of starting its own. That extends the coalescing\n* the watcher already does across a burst of edits to cover the converge\n* itself, and it is sound because every dev converge is the SAME invocation:\n* one stack file at one fixed path, rewritten in place before each request.\n*/\nfunction coalescedConverge(run) {\n\tlet live;\n\tlet queued;\n\tconst start = (invocation) => {\n\t\tconst outcome = run(invocation);\n\t\tconst settled = outcome.then(() => void 0, () => void 0);\n\t\tlive = settled;\n\t\tsettled.then(() => {\n\t\t\tif (live === settled) live = void 0;\n\t\t});\n\t\treturn outcome;\n\t};\n\treturn (invocation) => {\n\t\tconst running = live;\n\t\tif (running === void 0) return start(invocation);\n\t\tqueued ??= running.then(() => {\n\t\t\tqueued = void 0;\n\t\t\treturn start(invocation);\n\t\t});\n\t\treturn queued;\n\t};\n}\n/** The front door, ordered by address depth (fewest dots first) then lexicographically. */\nfunction frontDoorOrder(endpoints) {\n\treturn [...endpoints].sort((a, b) => {\n\t\tconst depth = a.address.split(\".\").length - b.address.split(\".\").length;\n\t\tif (depth !== 0) return depth;\n\t\treturn a.address < b.address ? -1 : a.address > b.address ? 1 : 0;\n\t});\n}\n/**\n* The operation's events as engine events. The legacy `[dev]` console prefix\n* is gone: these are commentary the engine renders and frames.\n*/\nfunction reportDevEvent(report, lastChild) {\n\tlet stopFailed = false;\n\treturn (event) => {\n\t\tswitch (event.kind) {\n\t\t\tcase \"ready\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"status\",\n\t\t\t\t\tsubject: \"dev\",\n\t\t\t\t\tstatus: \"ready\"\n\t\t\t\t});\n\t\t\t\tfor (const endpoint of frontDoorOrder(event.endpoints)) report({\n\t\t\t\t\tkind: \"endpoint\",\n\t\t\t\t\tname: endpoint.address,\n\t\t\t\t\turl: endpoint.url\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"unwatchable\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.address} has no watchable inputs.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"rebuild-failed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Rebuild failed: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"watch-error\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Watch error: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"converge-failed\": {\n\t\t\t\tconst child = lastChild();\n\t\t\t\tif (child !== void 0 && child.signal !== null) return;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Converge failed — the running app is untouched; still watching.\nGenerated stack file: ${event.stackFilePath}\\nRun \\`${event.reproduceCommand}\\` from ${event.cwd} to reproduce this directly.`\n\t\t\t\t});\n\t\t\t\treport({\n\t\t\t\t\tkind: \"remediation\",\n\t\t\t\t\taction: {\n\t\t\t\t\t\tkind: \"run-command\",\n\t\t\t\t\t\tlabel: `Run the converge directly from ${event.cwd} to reproduce this`,\n\t\t\t\t\t\tcommand: event.reproduceCommand,\n\t\t\t\t\t\treason: `Generated stack file: ${event.stackFilePath}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"stopping\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-started\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stop-error\":\n\t\t\t\tstopFailed = true;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `A service refused to stop: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stopped\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\",\n\t\t\t\t\toutcome: stopFailed ? \"warning\" : \"ok\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t}\n\t};\n}\nconst createDevCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Bring up the application whose root node is <entry>'s default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit.\",\n\t\texamples: [\"{bin} dev src/service.ts\", \"{bin} dev src/service.ts --fresh\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tfresh: flag.boolean({ brief: \"Destroy the dev stack and wipe the dev state directory before starting.\" })\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\tconst result = await operations.dev({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\tfresh: args.flags.fresh,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: reportDevEvent(ctx.report, ctx.lastChild)\n\t\t}, {\n\t\t\talchemy: coalescedConverge(alchemy),\n\t\t\tconfigPath: ctx.config.configPath\n\t\t});\n\t\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\t\tawait stopRequested(ctx.signal);\n\t\tawait result.value.stop();\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/family.ts\n/**\n* Composer's `CommandFamily` — the unit the engine mounts, whether the process\n* is composer's own CLI or the `prisma` bin.\n*\n* This module and everything it reaches statically must stay free of alchemy\n* and of effect VALUE imports: the `prisma` bin imports the family directly,\n* so anything in this static graph loads on `prisma --version`. The mechanism\n* that holds it is the existing lazy boundary inside the operation modules —\n* `operations/deploy.ts`, `destroy.ts`, `dev.ts` and `log.ts` each `await\n* import()` their executor, and it is the executors that reach the provider\n* tree. Importing the operations here is therefore free; importing an\n* executor, or flattening one of those dynamic imports, is not.\n* scripts/check-family-static-graph.mjs enforces this against BUILT output,\n* where type-only imports have already been erased.\n*\n* The commands close over the operations they are given, so a host can\n* mount this family against the test double and exercise real grammar, real\n* arg validation and real handlers with no alchemy behind them.\n*\n* The family ships `deploy` and `dev` only: `destroy` and `log` were retired\n* from the family surface (2026-08-21 PM review), so hosts mounting the family\n* — the `prisma` bin — never see them. They remain first-class commands of\n* composer's own bin, mounted on top of the family in engine-cli.ts.\n*/\nconst realOperations = {\n\tdeploy: deployWithDeps,\n\tdestroy: destroyWithDeps,\n\tdev: devWithDeps,\n\tlog: logWithDeps\n};\nfunction createComposerFamily(options = {}) {\n\tconst operations = options.operations ?? realOperations;\n\treturn defineCommandFamily({\n\t\tconfigSection: composerSection,\n\t\tcommands: {\n\t\t\tdeploy: createDeployCommand(operations),\n\t\t\tdev: createDevCommand(operations)\n\t\t},\n\t\tdocsBaseUrl: DOCS_BASE\n\t});\n}\n//#endregion\n//#region src/family/runtime.ts\n/**\n* Everything environmental the engine needs, assembled from a host process.\n*\n* The engine takes no globals: streams, cwd, env, TTY-ness, exit and signal\n* subscription all arrive through `Runtime`, which is what lets a test drive a\n* whole run without touching `process`. Composing one is the substantive part\n* of hosting the engine — `createCli` and `Cli.run` are two calls.\n*\n* Credentials come from the engine's own environment-only manager, which\n* composes a session from PRISMA_SERVICE_TOKEN / PRISMA_WORKSPACE_ID and\n* refuses every mutation. That is the whole of composer's standalone auth\n* story: this CLI has no login flow and mounts no auth commands, so there is\n* nothing to store — the two variables ARE the credential.\n*/\n/** Where the management API lives. Matches the lowering client's default origin; the env var is the escape hatch for staging. */\nconst DEFAULT_MANAGEMENT_API_BASE_URL = \"https://api.prisma.io\";\nconst DEFAULT_AUTH_BASE_URL = \"https://auth.prisma.io\";\n/**\n* Starts the converge child: inherited stdio, this process's own group, no\n* `detached` and no new console — which is what lets the terminal deliver\n* Ctrl-C to the child natively instead of the CLI forwarding it. The engine\n* never imports node:child_process; this adapter is the whole of the host's\n* side of that seam.\n*/\nconst spawnChild = (request) => {\n\tconst child = spawn(request.command, [...request.args], {\n\t\tcwd: request.cwd,\n\t\tstdio: \"inherit\",\n\t\tenv: request.env\n\t});\n\treturn {\n\t\tended: new Promise((resolve, reject) => {\n\t\t\tchild.on(\"error\", reject);\n\t\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\t\tresolve({\n\t\t\t\t\texitCode,\n\t\t\t\t\tsignal\n\t\t\t\t});\n\t\t\t});\n\t\t}),\n\t\tkill: (signal) => {\n\t\t\tchild.kill(signal);\n\t\t}\n\t};\n};\n/**\n* The SDK's client construction config. The engine requires all four fields\n* whenever a credential manager is wired, but this host reaches none of the\n* login paths: an environment credential carries no refresh token, so nothing\n* ever refreshes and `clientId`/`redirectUri` are never read. They are\n* env-overridable rather than hard-coded so a staging run can point the whole\n* client somewhere else in one place.\n*/\nfunction clientConfig(env, apiBaseUrl) {\n\treturn {\n\t\tclientId: env[\"PRISMA_CLIENT_ID\"] ?? \"prisma-composer-cli\",\n\t\tredirectUri: env[\"PRISMA_REDIRECT_URI\"] ?? \"http://127.0.0.1/callback\",\n\t\tapiBaseUrl,\n\t\tauthBaseUrl: env[\"PRISMA_AUTH_URL\"] ?? DEFAULT_AUTH_BASE_URL\n\t};\n}\n/**\n* What this process runs on, for `ctx.host`. Bun and Deno both announce\n* themselves in `versions`; nothing else does, so an absent marker means Node.\n*/\nfunction describeHost(host) {\n\tconst name = [\"bun\", \"deno\"].find((candidate) => host.versions[candidate] !== void 0) ?? \"node\";\n\treturn {\n\t\truntime: {\n\t\t\tname,\n\t\t\tversion: host.versions[name] ?? host.version\n\t\t},\n\t\tplatform: host.platform,\n\t\tarch: host.arch\n\t};\n}\n/**\n* Which package manager invoked us, read from the `npm_config_user_agent`\n* every major manager sets (`pnpm/10.27.0 npm/? node/v24.16.0 darwin arm64`).\n* `undefined` when the CLI was run directly rather than through a manager — a\n* normal case, not a failure, so nothing is inferred from the filesystem, and\n* the engine falls back to its own detection from the project at cwd.\n*/\nfunction detectPackageManager(env) {\n\tconst agent = env[\"npm_config_user_agent\"];\n\tif (agent === void 0) return void 0;\n\tconst name = agent.split(\"/\")[0];\n\tswitch (name) {\n\t\tcase \"npm\":\n\t\tcase \"pnpm\":\n\t\tcase \"yarn\":\n\t\tcase \"bun\":\n\t\tcase \"deno\": return name;\n\t\tdefault: return;\n\t}\n}\n/**\n* The config loader arrives as a function rather than an already-loaded config\n* because the engine reads `prisma.config.ts` on demand — only when the command\n* it is about to run declares a config section, and with whatever file\n* `--config` named. A host that loaded the file up front would read it for runs\n* that never needed it, and would have nowhere to put `--config`.\n*\n* Nothing here answers \"is this CI\": the engine detects it from `env` itself,\n* and `isCIOverride` exists only for hosts where that detection cannot be\n* right — composer is not one.\n*/\nconst nonEmpty = (value) => value !== void 0 && value.length > 0 ? value : void 0;\nfunction createRuntime(host, loadConfig) {\n\tconst env = host.env;\n\tconst apiBaseUrl = nonEmpty(env[\"PRISMA_API_URL\"]) ?? nonEmpty(env[\"PRISMA_MANAGEMENT_API_URL\"]) ?? DEFAULT_MANAGEMENT_API_BASE_URL;\n\tconst packageManager = detectPackageManager(env);\n\treturn {\n\t\tstdout: host.stdout,\n\t\tstderr: host.stderr,\n\t\tstdin: host.stdin,\n\t\tcwd: host.cwd(),\n\t\tenv,\n\t\tisTty: {\n\t\t\tstdin: host.stdin.isTTY === true,\n\t\t\tstdout: host.stdout.isTTY === true,\n\t\t\tstderr: host.stderr.isTTY === true\n\t\t},\n\t\texit: (code) => host.exit(code),\n\t\tonSignal: (cb) => {\n\t\t\tconst onSigint = () => {\n\t\t\t\tcb(\"SIGINT\");\n\t\t\t};\n\t\t\tconst onSigterm = () => {\n\t\t\t\tcb(\"SIGTERM\");\n\t\t\t};\n\t\t\thost.on(\"SIGINT\", onSigint);\n\t\t\thost.on(\"SIGTERM\", onSigterm);\n\t\t\treturn () => {\n\t\t\t\thost.off(\"SIGINT\", onSigint);\n\t\t\t\thost.off(\"SIGTERM\", onSigterm);\n\t\t\t};\n\t\t},\n\t\tloadConfig,\n\t\tcredentialManager: new EnvironmentCredentialManager({ env }),\n\t\tmanagementApiClientConfig: clientConfig(env, apiBaseUrl),\n\t\tspawn: spawnChild,\n\t\tmanagementApi: { baseUrl: apiBaseUrl },\n\t\t...packageManager !== void 0 && { packageManager },\n\t\thost: describeHost(host)\n\t};\n}\n//#endregion\n//#region src/family/engine-cli.ts\n/**\n* Composer's own CLI, rebuilt as a thin composition of the family it\n* publishes: `createCli` over `createComposerFamily()`, `Cli.run` with a\n* Runtime. Grammar, help, arg validation, output framing, exit codes and\n* signal ownership all belong to the engine now — this module contributes the\n* family and the environment, and nothing else.\n*\n* Running composer's commands through the same path an external host uses is\n* the point: it is what proves the family works standalone before the `prisma`\n* bin mounts it.\n*\n* This IS composer's CLI. The clipanion shell it replaced, and the bespoke\n* runner that shelled out to alchemy, are gone; `bin.ts` is a call into here.\n*/\nconst BINARY_NAME = \"prisma-composer\";\n/**\n* Composer's commands mount at the top level of its own CLI (`prisma-composer\n* deploy`). The bin mounts more than the family carries: `destroy` and `log`\n* were retired from the family (the surface the `prisma` bin mounts, per the\n* 2026-08-21 PM review) but stay first-class commands of `prisma-composer`\n* itself, so their definitions are mounted here on top of the family.\n*/\nfunction mountedTree(family, operations) {\n\treturn {\n\t\t...family.commands,\n\t\tdestroy: createDestroyCommand(operations),\n\t\tlog: createLogCommand(operations)\n\t};\n}\n/**\n* The ORM's slice of prisma.config.ts, declared so a config shared with the\n* unified `prisma` CLI loads here: the engine rejects any top-level key no\n* mounted family declares, and this bin does not mount the ORM family. The\n* value passes through unvalidated — the ORM CLI owns its section's shape,\n* and no composer command reads it.\n*/\nconst foreignOrmSectionFamily = defineCommandFamily({\n\tconfigSection: defineConfigSection({\n\t\tname: \"orm\",\n\t\tvalidate: (raw) => ({\n\t\t\tok: true,\n\t\t\tvalue: raw,\n\t\t\tdiagnostics: []\n\t\t})\n\t}),\n\tcommands: {}\n});\nfunction createComposerCli(spec) {\n\tconst operations = spec.operations ?? realOperations;\n\tconst family = createComposerFamily({ operations });\n\treturn createCli({\n\t\tname: BINARY_NAME,\n\t\tversion: spec.version,\n\t\tcommandFamilies: [family, foreignOrmSectionFamily],\n\t\tgroups: {},\n\t\tcommands: mountedTree(family, operations)\n\t});\n}\n/**\n* Composes the Runtime and runs one invocation. Returns the exit code rather\n* than exiting, so the caller owns the process — a bin assigns it to\n* `process.exitCode` and lets the streams drain, as composer's CLI has always\n* done.\n*\n* `prisma.config.ts` is not read here. The loader goes in as a function, and the\n* engine calls it only when the command it is about to run declares a config\n* section, passing it the file `--config` named; the loader resolves that\n* against the host's cwd.\n*/\nfunction runComposerCli(argv, host, spec, hooks) {\n\tconst runtime = createRuntime(host, (configPath) => loadConfig(host.cwd(), configPath));\n\treturn createComposerCli(spec).run(argv, runtime, hooks);\n}\n//#endregion\nexport { realOperations as a, createComposerFamily as i, createComposerCli as n, composerSection as o, runComposerCli as r, toEngineError as s, BINARY_NAME as t };\n\n//# sourceMappingURL=engine-cli-X_xrCar3.mjs.map","import { r as runComposerCli } from \"./engine-cli-X_xrCar3.mjs\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/cli.ts\n/**\n* The `prisma-composer` entrypoint: adapt this process into the engine's\n* `HostProcess`, run one invocation of composer's own CLI, and hand back an\n* exit code. Grammar, help, argument validation, output framing, exit codes\n* and signal policy all belong to the engine — this module contributes the\n* process and the version, and nothing else.\n*\n* Node's `process` already satisfies `HostProcess` structurally, so there is\n* no adapter object here; that is the whole point of the engine taking a host\n* surface rather than reading globals.\n*/\n/** Printed for a throw that escapes the engine entirely — by the shared base-type rules that is a bug, not a user failure. */\nconst REPORT_HINT = \"This is a bug in prisma-composer, not in your app — please report it: https://github.com/prisma/composer/issues\";\nconst UNKNOWN_VERSION = \"unknown\";\n/**\n* The version the CLI reports, read from the manifest of the package this\n* module was BUNDLED INTO — `@prisma/composer` for the published bin, since\n* that is the package whose executable the user installed. Walking up from the\n* module's own location is what makes that true in both layouts: the published\n* `dist/bin.mjs` finds `@prisma/composer`'s manifest, and a direct run of\n* `src/bin.ts` finds this package's.\n*/\nfunction shippedVersion(fromDir = path.dirname(fileURLToPath(import.meta.url))) {\n\tlet dir = fromDir;\n\twhile (true) {\n\t\tconst manifest = path.join(dir, \"package.json\");\n\t\tif (fs.existsSync(manifest)) try {\n\t\t\tconst version = JSON.parse(fs.readFileSync(manifest, \"utf-8\")).version;\n\t\t\treturn typeof version === \"string\" ? version : UNKNOWN_VERSION;\n\t\t} catch {\n\t\t\treturn UNKNOWN_VERSION;\n\t\t}\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return UNKNOWN_VERSION;\n\t\tdir = parent;\n\t}\n}\n/**\n* Runs `prisma-composer` end to end and returns the process exit code. The\n* caller assigns it to `process.exitCode` rather than exiting, so the streams\n* drain — the engine returns a code for exactly this reason.\n*\n* The catch is not error handling for commands: the engine renders every\n* command failure itself. It catches a throw that escaped the engine — a\n* construction fault, a broken config load — which by ADR-0044 is a bug in\n* this CLI and exits 1 with a report hint.\n*/\nasync function cli(argv = process.argv.slice(2)) {\n\ttry {\n\t\treturn await runComposerCli(argv, process, { version: shippedVersion() });\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n\t\tconsole.error(REPORT_HINT);\n\t\treturn 1;\n\t}\n}\n//#endregion\nexport { shippedVersion as n, cli as t };\n\n//# sourceMappingURL=cli-CZ2ENVcY.mjs.map","#!/usr/bin/env node\nimport { t as cli } from \"./cli-CZ2ENVcY.mjs\";\n//#region src/bin.ts\nprocess.exitCode = await cli();\n//#endregion\nexport {};\n\n//# sourceMappingURL=bin.mjs.map"],"mappings":";;;;;;;;;;;;;AASA,eAAe,eAAe,OAAO,MAAM;CAC1C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,UAAU,OAAO,GAAG,CAAC;CACvD;CACA,OAAO,SAAS,cAAc,OAAO,MAAM,GAAG;AAC/C;;;;AASA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,WAAW,OAAO,GAAG,CAAC;CACxD;CACA,OAAO,SAA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;;ACzDA,QAAQ,WAAW,MAAM,IAAI"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as CliStructuredError, d as blindCast, n as ok, r as okVoid, s as toStructured, t as notOk } from "./result-
|
|
2
|
-
import { n as alchemyInvocation, r as spawnAlchemy } from "./run-alchemy--ZIvgqyU-
|
|
3
|
-
import { n as runPipeline } from "./pipeline-
|
|
1
|
+
import { c as CliStructuredError, d as blindCast, n as ok, r as okVoid, s as toStructured, t as notOk } from "./result-8JIfIz1C.mjs";
|
|
2
|
+
import { n as alchemyInvocation, r as spawnAlchemy } from "./run-alchemy--ZIvgqyU-DjOPkNk-.mjs";
|
|
3
|
+
import { n as runPipeline } from "./pipeline-DF-cm6XS-smwFmkzQ.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";
|
|
@@ -174,7 +174,7 @@ function preflightEnv(payloads) {
|
|
|
174
174
|
return env;
|
|
175
175
|
}
|
|
176
176
|
//#endregion
|
|
177
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-
|
|
177
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-5sr2Z9oW.mjs
|
|
178
178
|
/** 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. */
|
|
179
179
|
function validateStageName(stage) {
|
|
180
180
|
const result = spawnSync("git", ["check-ref-format", `refs/heads/${stage}`], { stdio: "ignore" });
|
|
@@ -525,4 +525,4 @@ async function runStackPipelineInner(action, opts, reporters) {
|
|
|
525
525
|
//#endregion
|
|
526
526
|
export { executeDeploy, executeDestroy };
|
|
527
527
|
|
|
528
|
-
//# sourceMappingURL=execute-deploy-destroy-
|
|
528
|
+
//# sourceMappingURL=execute-deploy-destroy-5sr2Z9oW-C7fFHLH7.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-deploy-destroy-Bsdh8hf4-BVXNSBmy.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/generate-stack-DLu6b7YM.mjs","../../../0-framework/3-tooling/cli/dist/deployment-summary-DswOl_9E.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-Bsdh8hf4.mjs"],"sourcesContent":["import * 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: 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.configPath);\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 { deploymentReport } from '@prisma/composer/report';\nimport config from ${quote(configImport)};\nimport app from ${quote(appImport)};\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-DLu6b7YM.mjs.map","import * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\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`.\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//#endregion\nexport { readDeploymentSummary as n, writeDeploymentSummaryFile as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-DswOl_9E.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-joXc-BKm.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-BTnATsqm.mjs\";\nimport { i as spawnAlchemy, n as alchemyInvocation } from \"./run-alchemy--ZIvgqyU.mjs\";\nimport { r as writeStackFile, t as GENERATED_STACK_RELATIVE_PATH } from \"./generate-stack-DLu6b7YM.mjs\";\nimport { n as readDeploymentSummary, t as DEPLOYMENT_RESULT_FILE_ENV } from \"./deployment-summary-DswOl_9E.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-Bt8QocRh.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { spawnSync } from \"node:child_process\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\nimport { randomUUID } from \"node:crypto\";\nimport { containerEnv, preflightEnv, preflightEnvVarName } from \"@internal/core/config\";\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\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\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, 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, {\n\t\t\trunAssembler: deps.runAssembler,\n\t\t\tconfig: deps.config,\n\t\t\tconfigPath: deps.configPath\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\tconst { config, graph, name: resolvedName } = pipeline;\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\tconfigPath: pipeline.configPath,\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) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} exited with status ${status}.`, { meta: {\n\t\t\texitCode: status,\n\t\t\tdiagnostics: {\n\t\t\t\texitCode: status,\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\ttry {\n\t\t\tif (action === \"destroy\") {\n\t\t\t\tfor (const extension of pipeline.config.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.config.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} catch {}\n\t}\n}\n//#endregion\nexport { executeDeploy, executeDestroy };\n\n//# sourceMappingURL=execute-deploy-destroy-Bsdh8hf4.mjs.map"],"mappings":";;;;;;;;;;AAIA,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,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AAO,GAAG,KAAK,CAAC;CACjB,UAAU;EACT,IAAI;GACH,GAAG,OAAO,gBAAgB,EAAE,OAAO,KAAK,CAAC;EAC1C,QAAQ,CAAC;CACV;AACD"}
|
|
1
|
+
{"version":3,"file":"execute-deploy-destroy-5sr2Z9oW-C7fFHLH7.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/generate-stack-DLu6b7YM.mjs","../../../0-framework/3-tooling/cli/dist/deployment-summary-DswOl_9E.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-5sr2Z9oW.mjs"],"sourcesContent":["import * 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: 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.configPath);\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 { deploymentReport } from '@prisma/composer/report';\nimport config from ${quote(configImport)};\nimport app from ${quote(appImport)};\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-DLu6b7YM.mjs.map","import * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\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`.\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//#endregion\nexport { readDeploymentSummary as n, writeDeploymentSummaryFile as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-DswOl_9E.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-joXc-BKm.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-BTnATsqm.mjs\";\nimport { i as spawnAlchemy, n as alchemyInvocation } from \"./run-alchemy--ZIvgqyU.mjs\";\nimport { r as writeStackFile, t as GENERATED_STACK_RELATIVE_PATH } from \"./generate-stack-DLu6b7YM.mjs\";\nimport { n as readDeploymentSummary, t as DEPLOYMENT_RESULT_FILE_ENV } from \"./deployment-summary-DswOl_9E.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-DF-cm6XS.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { spawnSync } from \"node:child_process\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\nimport { randomUUID } from \"node:crypto\";\nimport { containerEnv, preflightEnv, preflightEnvVarName } from \"@internal/core/config\";\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\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\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, 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, {\n\t\t\trunAssembler: deps.runAssembler,\n\t\t\tconfig: deps.config,\n\t\t\tconfigPath: deps.configPath\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\tconst { config, graph, name: resolvedName } = pipeline;\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\tconfigPath: pipeline.configPath,\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) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} exited with status ${status}.`, { meta: {\n\t\t\texitCode: status,\n\t\t\tdiagnostics: {\n\t\t\t\texitCode: status,\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\ttry {\n\t\t\tif (action === \"destroy\") {\n\t\t\t\tfor (const extension of pipeline.config.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.config.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} catch {}\n\t}\n}\n//#endregion\nexport { executeDeploy, executeDestroy };\n\n//# sourceMappingURL=execute-deploy-destroy-5sr2Z9oW.mjs.map"],"mappings":";;;;;;;;;;AAIA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;;AAEvB,SAAS,wBAAwB,cAAc,QAAQ;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